@stll/folio-agents
Advanced tools
+3
-2
| import { FolioAgentChange, FolioAgentComment } from "./types.js"; | ||
| import { FolioAIEditSnapshot, FolioDocumentOperationBatch, FolioDocumentOperationResult, FolioDocumentStory, FolioDocumentStoryHandle } from "@stll/folio-core/server"; | ||
| import { FolioAIEditSnapshot, FolioDocumentOperationBatch, FolioDocumentOperationResult, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult, FolioDocumentStory, FolioDocumentStoryHandle } from "@stll/folio-core/server"; | ||
@@ -24,3 +24,4 @@ //#region src/bridge.d.ts | ||
| */ | ||
| applyDocumentOperations(batch: FolioDocumentOperationBatch): FolioDocumentOperationResult; /** The comment threads present in the document. */ | ||
| applyDocumentOperations(batch: FolioDocumentOperationBatch): FolioDocumentOperationResult; /** Undo the latest unchanged batch when the execution surface supports it. */ | ||
| undoDocumentOperations?(undoHandle: FolioDocumentOperationUndoHandle): FolioDocumentOperationUndoResult; /** The comment threads present in the document. */ | ||
| getComments(): FolioAgentComment[]; /** The pending tracked changes (insertions/deletions) present in the document. */ | ||
@@ -27,0 +28,0 @@ getChanges(): FolioAgentChange[]; /** Discover typed document stories when the surface exposes package parts. */ |
| import { FolioAgentBridge } from "../bridge.js"; | ||
| import { FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot, FolioDocumentOperationBatch, FolioDocumentOperationResult } from "@stll/folio-core/server"; | ||
| import { FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot, FolioDocumentOperationBatch, FolioDocumentOperationResult, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult } from "@stll/folio-core/server"; | ||
| import { FolioCommentAnchor, FolioReviewChange as FolioReviewChange$1 } from "@stll/folio-core/ai-edits"; | ||
@@ -33,3 +33,4 @@ import { Comment } from "@stll/folio-core/types/content"; | ||
| }): FolioAIEditApplyResult; /** `DocxEditorRef.applyDocumentOperations`, when available on newer refs. */ | ||
| applyDocumentOperations?(options: FolioAgentEditorApplyDocumentOperationsOptions): FolioDocumentOperationResult; /** `DocxEditorRef.scrollToBlock`. */ | ||
| applyDocumentOperations?(options: FolioAgentEditorApplyDocumentOperationsOptions): FolioDocumentOperationResult; /** `DocxEditorRef.undoDocumentOperations`, when available on newer refs. */ | ||
| undoDocumentOperations?(undoHandle: FolioDocumentOperationUndoHandle): FolioDocumentOperationUndoResult; /** `DocxEditorRef.scrollToBlock`. */ | ||
| scrollToBlock(blockId: string, snapshot?: FolioAIEditSnapshot): boolean; /** `DocxEditorRef.getTotalPages`. */ | ||
@@ -36,0 +37,0 @@ getTotalPages(): number; |
@@ -54,2 +54,3 @@ import { toAgentChange } from "./shared.js"; | ||
| const { ref, author, getComments, setComments } = options; | ||
| const undoDocumentOperations = ref.undoDocumentOperations?.bind(ref); | ||
| const mode = options.mode ?? "tracked-changes"; | ||
@@ -79,3 +80,4 @@ const requireSnapshot = () => { | ||
| issues: result.issues ?? getFolioDocumentOperationIssues(versionedBatch.operations, result.skipped), | ||
| receipts: result.receipts ?? getFolioDocumentOperationReceipts(versionedBatch.operations, result.applied) | ||
| receipts: result.receipts ?? getFolioDocumentOperationReceipts(versionedBatch.operations, result.applied), | ||
| undoHandle: result.undoHandle ?? null | ||
| }; | ||
@@ -94,3 +96,4 @@ } | ||
| issues: getFolioDocumentOperationIssues(versionedBatch.operations, skipped), | ||
| receipts: [] | ||
| receipts: [], | ||
| undoHandle: null | ||
| }; | ||
@@ -109,3 +112,4 @@ } | ||
| issues: getFolioDocumentOperationIssues(versionedBatch.operations, skipped), | ||
| receipts: [] | ||
| receipts: [], | ||
| undoHandle: null | ||
| }; | ||
@@ -124,5 +128,7 @@ } | ||
| issues: getFolioDocumentOperationIssues(versionedBatch.operations, result.skipped), | ||
| receipts: getFolioDocumentOperationReceipts(versionedBatch.operations, result.applied) | ||
| receipts: getFolioDocumentOperationReceipts(versionedBatch.operations, result.applied), | ||
| undoHandle: null | ||
| }; | ||
| }, | ||
| ...undoDocumentOperations && { undoDocumentOperations: (undoHandle) => undoDocumentOperations(undoHandle) }, | ||
| getComments: () => { | ||
@@ -129,0 +135,0 @@ const comments = getComments(); |
@@ -40,2 +40,3 @@ import { toAgentChange } from "./shared.js"; | ||
| }), | ||
| undoDocumentOperations: (undoHandle) => reviewer.undoDocumentOperations(undoHandle), | ||
| getComments: () => reviewer.getComments().map(toAgentComment), | ||
@@ -42,0 +43,0 @@ getChanges: () => reviewer.getChanges().map(toAgentChange), |
+2
-2
| { | ||
| "name": "@stll/folio-agents", | ||
| "version": "0.3.0", | ||
| "version": "0.4.0", | ||
| "description": "Framework-neutral LLM tool layer over folio's ai-edits engine: function-calling tools so an agent can read and mutate .docx documents through @stll/folio-core.", | ||
@@ -57,3 +57,3 @@ "keywords": [ | ||
| "dependencies": { | ||
| "@stll/folio-core": "^0.4.0" | ||
| "@stll/folio-core": "^0.5.0" | ||
| }, | ||
@@ -60,0 +60,0 @@ "main": "./dist/index.js", |
166407
0.54%3619
0.25%+ Added
+ Added
- Removed
Updated