@stll/folio-agents 0.8.9 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/bridge.d.ts +15 -2
- package/dist/bridge.js +9 -0
- package/dist/bridges/editor-ref.d.ts +1 -0
- package/dist/bridges/editor-ref.js +39 -36
- package/dist/bridges/reviewer.js +16 -15
- package/dist/codecs.d.ts +92 -0
- package/dist/codecs.js +150 -0
- package/dist/execute.d.ts +5 -3
- package/dist/execute.js +50 -86
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/operation-schema.d.ts +21 -2083
- package/dist/parse.d.ts +15 -2
- package/dist/parse.js +24 -20
- package/dist/tool-contract.d.ts +111 -0
- package/dist/tool-contract.js +4 -0
- package/dist/tools.d.ts +69 -2
- package/dist/tools.js +44 -124
- package/dist/types.d.ts +18 -3
- package/dist/types.js +0 -6
- package/package.json +2 -2
- package/skills/folio-agents/SKILL.md +1 -1
package/dist/execute.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getDecodedCommentHandlers } from "./bridge.js";
|
|
2
|
+
import { decodeCommentId, decodeMainStoryTextRangeHandle, decodeSectionHandle, decodeStoryHandle } from "./codecs.js";
|
|
3
|
+
import { explainTextTooLong, parseAddCommentInput, parseSuggestChangesInput, prepareFolioAgentDocumentOperationBatch } from "./parse.js";
|
|
2
4
|
import { FOLIO_AGENT_TOOL_NAMES } from "./types.js";
|
|
3
|
-
import {
|
|
5
|
+
import { createFolioAITextRangeHandle, getFolioDocumentOutline, hashFolioAIBlockText, normalizeFolioAIBlockText, readFolioDocumentSection } from "@stll/folio-core/server";
|
|
4
6
|
//#region src/execute.ts
|
|
5
7
|
const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
8
|
const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
@@ -37,7 +39,7 @@ const MAX_FIND_MATCHES = 200;
|
|
|
37
39
|
* Every bridge member used here ({@link FolioDocxReviewer} and the live-editor
|
|
38
40
|
* ref) is synchronous, so this stays synchronous too.
|
|
39
41
|
*/
|
|
40
|
-
const
|
|
42
|
+
const executeFolioToolCallUntyped = (name, args, bridge) => {
|
|
41
43
|
if (!VALID_TOOL_NAMES.includes(name)) return fail(`Unknown tool "${name}". Valid tools: ${VALID_TOOL_NAMES.join(", ")}.`);
|
|
42
44
|
try {
|
|
43
45
|
return dispatch(name, args, bridge);
|
|
@@ -45,24 +47,12 @@ const executeFolioToolCall = (name, args, bridge) => {
|
|
|
45
47
|
return fail(error instanceof Error ? error.message : String(error));
|
|
46
48
|
}
|
|
47
49
|
};
|
|
50
|
+
function executeFolioToolCall(name, args, bridge) {
|
|
51
|
+
return executeFolioToolCallUntyped(name, args, bridge);
|
|
52
|
+
}
|
|
48
53
|
const dispatch = (name, args, bridge) => {
|
|
49
|
-
if (name
|
|
50
|
-
|
|
51
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.readSection) return readSection(args, bridge);
|
|
52
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.listStories) return bridge.listStories ? ok(bridge.listStories()) : fail("This editor surface does not support story discovery.");
|
|
53
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.readStory) return readStory(args, bridge);
|
|
54
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.findText) return findText(args, bridge);
|
|
55
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.readComments) return readComments(args, bridge);
|
|
56
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.readChanges) return ok(bridge.getChanges());
|
|
57
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.addComment) return addComment(args, bridge);
|
|
58
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.suggestChanges) return suggestChanges(args, bridge);
|
|
59
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.replyComment) return replyComment(args, bridge);
|
|
60
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.resolveComment) return resolveComment(args, bridge);
|
|
61
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.readPage) return readPage(args, bridge);
|
|
62
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.readSelection) return readSelection(bridge);
|
|
63
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.scrollToBlock) return scrollToBlock(args, bridge);
|
|
64
|
-
if (name === FOLIO_AGENT_TOOL_NAMES.showInDocument) return showInDocument(args, bridge);
|
|
65
|
-
return fail(`Unknown tool "${name}".`);
|
|
54
|
+
if (!isFolioAgentToolName(name)) return fail(`Unknown tool "${name}".`);
|
|
55
|
+
return TOOL_HANDLERS[name](args, bridge);
|
|
66
56
|
};
|
|
67
57
|
const readDocument = (bridge) => {
|
|
68
58
|
const { blocks } = bridge.snapshot();
|
|
@@ -73,20 +63,6 @@ const readDocument = (bridge) => {
|
|
|
73
63
|
blockTextHash: blockTextHashOf(block.text)
|
|
74
64
|
})));
|
|
75
65
|
};
|
|
76
|
-
const parseSectionHandle = (value) => {
|
|
77
|
-
if (!isPlainObject(value)) return null;
|
|
78
|
-
const headingBlockId = value["headingBlockId"];
|
|
79
|
-
const headingTextHash = value["headingTextHash"];
|
|
80
|
-
const headingLevel = value["headingLevel"];
|
|
81
|
-
if (value["type"] !== "headingSection" || value["story"] !== "main" || !isNonEmptyString(headingBlockId) || !isNonEmptyString(headingTextHash) || typeof headingLevel !== "number" || !Number.isInteger(headingLevel) || headingLevel < 1 || headingLevel > 9) return null;
|
|
82
|
-
return {
|
|
83
|
-
type: "headingSection",
|
|
84
|
-
story: "main",
|
|
85
|
-
headingBlockId,
|
|
86
|
-
headingTextHash,
|
|
87
|
-
headingLevel
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
66
|
const getDocumentOutline = (args, bridge) => {
|
|
91
67
|
const maxDepth = isPlainObject(args) ? args["maxDepth"] : void 0;
|
|
92
68
|
if (maxDepth !== void 0 && (typeof maxDepth !== "number" || !Number.isInteger(maxDepth) || maxDepth < 1 || maxDepth > 9)) return fail("get_document_outline's `maxDepth` must be an integer from 1 to 9.");
|
|
@@ -108,7 +84,7 @@ const getDocumentOutline = (args, bridge) => {
|
|
|
108
84
|
};
|
|
109
85
|
const readSection = (args, bridge) => {
|
|
110
86
|
if (!isPlainObject(args)) return fail("read_section expects a section `handle` from get_document_outline.");
|
|
111
|
-
const handle =
|
|
87
|
+
const handle = decodeSectionHandle(args["handle"]);
|
|
112
88
|
if (handle === null) return fail("read_section requires a valid `handle` from get_document_outline.");
|
|
113
89
|
const maxBlocks = args["maxBlocks"] ?? 100;
|
|
114
90
|
if (typeof maxBlocks !== "number" || !Number.isInteger(maxBlocks) || maxBlocks < 1 || maxBlocks > 200) return fail("read_section's `maxBlocks` must be an integer from 1 to 200.");
|
|
@@ -140,32 +116,9 @@ const readSection = (args, bridge) => {
|
|
|
140
116
|
...hasMore && lastBlockId !== void 0 && { nextAfterBlockId: lastBlockId }
|
|
141
117
|
});
|
|
142
118
|
};
|
|
143
|
-
const parseStoryHandle = (value) => {
|
|
144
|
-
if (!isPlainObject(value)) return null;
|
|
145
|
-
const handle = value;
|
|
146
|
-
const type = handle["type"];
|
|
147
|
-
if (type === "main") return { type };
|
|
148
|
-
if (type === "header" || type === "footer") {
|
|
149
|
-
const relationshipId = handle["relationshipId"];
|
|
150
|
-
if (!isNonEmptyString(relationshipId)) return null;
|
|
151
|
-
return {
|
|
152
|
-
type,
|
|
153
|
-
relationshipId
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if (type === "footnote" || type === "endnote") {
|
|
157
|
-
const noteId = handle["noteId"];
|
|
158
|
-
if (typeof noteId !== "number" || !Number.isInteger(noteId)) return null;
|
|
159
|
-
return {
|
|
160
|
-
type,
|
|
161
|
-
noteId
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
return null;
|
|
165
|
-
};
|
|
166
119
|
const readStory = (args, bridge) => {
|
|
167
120
|
if (!bridge.readStory) return fail("This editor surface does not support story reads.");
|
|
168
|
-
const parsed = isPlainObject(args) ?
|
|
121
|
+
const parsed = isPlainObject(args) ? decodeStoryHandle(args["handle"]) : null;
|
|
169
122
|
if (parsed === null) return fail("read_story requires a valid typed `handle` from list_stories.");
|
|
170
123
|
const story = bridge.readStory(parsed);
|
|
171
124
|
return story ? ok(story) : fail("The requested story was not found; run list_stories again.");
|
|
@@ -268,7 +221,7 @@ const findText = (args, bridge) => {
|
|
|
268
221
|
if (scope !== void 0) {
|
|
269
222
|
if (!isPlainObject(scope) || !isNonEmptyString(scope["type"])) return fail("find_text's `scope` must be a document, section, page, or story scope.");
|
|
270
223
|
if (scope["type"] === "section") {
|
|
271
|
-
const handle =
|
|
224
|
+
const handle = decodeSectionHandle(scope["handle"]);
|
|
272
225
|
if (handle === null) return fail("find_text's section scope requires a handle from get_document_outline.");
|
|
273
226
|
const section = readFolioDocumentSection(bridge.snapshot(), handle);
|
|
274
227
|
if (section.status !== "found") return fail("The scoped section is stale or missing; run get_document_outline again.");
|
|
@@ -282,7 +235,7 @@ const findText = (args, bridge) => {
|
|
|
282
235
|
getTargetPage = bridge.getTargetPage;
|
|
283
236
|
pageFilter = page;
|
|
284
237
|
} else if (scope["type"] === "story") {
|
|
285
|
-
const handle =
|
|
238
|
+
const handle = decodeStoryHandle(scope["handle"]);
|
|
286
239
|
if (handle === null) return fail("find_text's story scope requires a handle from list_stories.");
|
|
287
240
|
if (handle.type !== "main") {
|
|
288
241
|
if (!bridge.readStory) return fail("This editor surface does not support story search.");
|
|
@@ -374,10 +327,10 @@ const applyOperations = (bridge, operations) => {
|
|
|
374
327
|
...blockTextHash !== void 0 && { precondition: { blockTextHash } }
|
|
375
328
|
});
|
|
376
329
|
}
|
|
377
|
-
return summarizeApplyResult(bridge.applyDocumentOperations({
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}));
|
|
330
|
+
return summarizeApplyResult(bridge.applyDocumentOperations(prepareFolioAgentDocumentOperationBatch({
|
|
331
|
+
operations: guardedOperations,
|
|
332
|
+
...bridge.documentOperationMode !== void 0 && { mode: bridge.documentOperationMode }
|
|
333
|
+
})));
|
|
381
334
|
};
|
|
382
335
|
const addComment = (args, bridge) => {
|
|
383
336
|
const parsed = parseAddCommentInput(args);
|
|
@@ -396,7 +349,11 @@ const replyComment = (args, bridge) => {
|
|
|
396
349
|
if (!isNonEmptyString(commentId)) return fail("reply_comment requires a non-empty string `commentId`.");
|
|
397
350
|
if (!isNonEmptyString(text)) return fail("reply_comment requires a non-empty string `text`.");
|
|
398
351
|
if (text.length > 1e5) return fail(explainTextTooLong("reply_comment's `text`", text.length));
|
|
399
|
-
|
|
352
|
+
const decodedHandlers = getDecodedCommentHandlers(bridge);
|
|
353
|
+
if (decodedHandlers === void 0) return bridge.replyToComment(commentId, text) ? ok({ replied: true }) : fail(`No comment with id "${commentId}" was found.`);
|
|
354
|
+
const decodedCommentId = decodeCommentId(commentId);
|
|
355
|
+
if (decodedCommentId === null) return fail("reply_comment's `commentId` must be a comment id from `read_comments`.");
|
|
356
|
+
if (!decodedHandlers.replyToComment(decodedCommentId, text)) return fail(`No comment with id "${commentId}" was found.`);
|
|
400
357
|
return ok({ replied: true });
|
|
401
358
|
};
|
|
402
359
|
const resolveComment = (args, bridge) => {
|
|
@@ -406,7 +363,11 @@ const resolveComment = (args, bridge) => {
|
|
|
406
363
|
if (!isNonEmptyString(commentId)) return fail("resolve_comment requires a non-empty string `commentId`.");
|
|
407
364
|
if (reopen !== void 0 && typeof reopen !== "boolean") return fail("resolve_comment's `reopen` must be a boolean when provided.");
|
|
408
365
|
const resolved = reopen !== true;
|
|
409
|
-
|
|
366
|
+
const decodedHandlers = getDecodedCommentHandlers(bridge);
|
|
367
|
+
if (decodedHandlers === void 0) return bridge.resolveComment(commentId, resolved) ? ok({ resolved }) : fail(`No comment with id "${commentId}" was found.`);
|
|
368
|
+
const decodedCommentId = decodeCommentId(commentId);
|
|
369
|
+
if (decodedCommentId === null) return fail("resolve_comment's `commentId` must be a comment id from `read_comments`.");
|
|
370
|
+
if (!decodedHandlers.resolveComment(decodedCommentId, resolved)) return fail(`No comment with id "${commentId}" was found.`);
|
|
410
371
|
return ok({ resolved });
|
|
411
372
|
};
|
|
412
373
|
const readPage = (args, bridge) => {
|
|
@@ -417,7 +378,7 @@ const readPage = (args, bridge) => {
|
|
|
417
378
|
if (pageCount !== void 0 && page > pageCount) return fail(`read_page's \`page\` (${page}) exceeds the document's page count (${pageCount}).`);
|
|
418
379
|
return ok({
|
|
419
380
|
page,
|
|
420
|
-
totalPages: pageCount,
|
|
381
|
+
...pageCount !== void 0 && { totalPages: pageCount },
|
|
421
382
|
text: bridge.getPageText(page)
|
|
422
383
|
});
|
|
423
384
|
};
|
|
@@ -431,22 +392,6 @@ const scrollToBlock = (args, bridge) => {
|
|
|
431
392
|
if (!isNonEmptyString(blockId)) return fail("scroll_to_block requires a non-empty string `blockId`.");
|
|
432
393
|
return ok({ scrolled: bridge.scrollToBlock(blockId) });
|
|
433
394
|
};
|
|
434
|
-
const parseTextRange = (value) => {
|
|
435
|
-
if (!isPlainObject(value)) return null;
|
|
436
|
-
const blockId = value["blockId"];
|
|
437
|
-
const startOffset = value["startOffset"];
|
|
438
|
-
const endOffset = value["endOffset"];
|
|
439
|
-
const selectedTextHash = value["selectedTextHash"];
|
|
440
|
-
if (value["type"] !== "textRange" || value["story"] !== "main" || !isNonEmptyString(blockId) || typeof startOffset !== "number" || !Number.isInteger(startOffset) || startOffset < 0 || typeof endOffset !== "number" || !Number.isInteger(endOffset) || endOffset <= startOffset || !isNonEmptyString(selectedTextHash)) return null;
|
|
441
|
-
return {
|
|
442
|
-
type: "textRange",
|
|
443
|
-
story: "main",
|
|
444
|
-
blockId,
|
|
445
|
-
startOffset,
|
|
446
|
-
endOffset,
|
|
447
|
-
selectedTextHash
|
|
448
|
-
};
|
|
449
|
-
};
|
|
450
395
|
const showInDocument = (args, bridge) => {
|
|
451
396
|
if (!bridge.showInDocument) return fail("This editor surface does not support show_in_document (no live editor view).");
|
|
452
397
|
if (!isPlainObject(args)) return fail("show_in_document expects exactly one of `blockId` or `range`.");
|
|
@@ -461,9 +406,28 @@ const showInDocument = (args, bridge) => {
|
|
|
461
406
|
blockId
|
|
462
407
|
}) });
|
|
463
408
|
}
|
|
464
|
-
const range =
|
|
409
|
+
const range = decodeMainStoryTextRangeHandle(rawRange);
|
|
465
410
|
if (range === null) return fail("show_in_document's `range` must be copied from find_text.");
|
|
466
411
|
return ok({ shown: bridge.showInDocument(range) });
|
|
467
412
|
};
|
|
413
|
+
const TOOL_HANDLERS = {
|
|
414
|
+
[FOLIO_AGENT_TOOL_NAMES.readDocument]: (_args, bridge) => readDocument(bridge),
|
|
415
|
+
[FOLIO_AGENT_TOOL_NAMES.getDocumentOutline]: getDocumentOutline,
|
|
416
|
+
[FOLIO_AGENT_TOOL_NAMES.readSection]: readSection,
|
|
417
|
+
[FOLIO_AGENT_TOOL_NAMES.listStories]: (_args, bridge) => bridge.listStories ? ok(bridge.listStories()) : fail("This editor surface does not support story discovery."),
|
|
418
|
+
[FOLIO_AGENT_TOOL_NAMES.readStory]: readStory,
|
|
419
|
+
[FOLIO_AGENT_TOOL_NAMES.findText]: findText,
|
|
420
|
+
[FOLIO_AGENT_TOOL_NAMES.readComments]: readComments,
|
|
421
|
+
[FOLIO_AGENT_TOOL_NAMES.readChanges]: (_args, bridge) => ok(bridge.getChanges()),
|
|
422
|
+
[FOLIO_AGENT_TOOL_NAMES.addComment]: addComment,
|
|
423
|
+
[FOLIO_AGENT_TOOL_NAMES.suggestChanges]: suggestChanges,
|
|
424
|
+
[FOLIO_AGENT_TOOL_NAMES.replyComment]: replyComment,
|
|
425
|
+
[FOLIO_AGENT_TOOL_NAMES.resolveComment]: resolveComment,
|
|
426
|
+
[FOLIO_AGENT_TOOL_NAMES.readPage]: readPage,
|
|
427
|
+
[FOLIO_AGENT_TOOL_NAMES.readSelection]: (_args, bridge) => readSelection(bridge),
|
|
428
|
+
[FOLIO_AGENT_TOOL_NAMES.scrollToBlock]: scrollToBlock,
|
|
429
|
+
[FOLIO_AGENT_TOOL_NAMES.showInDocument]: showInDocument
|
|
430
|
+
};
|
|
431
|
+
const isFolioAgentToolName = (name) => Object.hasOwn(TOOL_HANDLERS, name);
|
|
468
432
|
//#endregion
|
|
469
|
-
export { executeFolioToolCall };
|
|
433
|
+
export { executeFolioToolCall, executeFolioToolCallUntyped };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, folioDocumentOperationBatchSchema } from "./operation-schema.js";
|
|
1
2
|
import { FOLIO_AGENT_TOOL_NAMES, FolioAgentApplyOperationsSummary, FolioAgentBlock, FolioAgentChange, FolioAgentComment, FolioAgentCommentFilter, FolioAgentCommentReply, FolioAgentDocumentOutline, FolioAgentOutlineEntry, FolioAgentScopedFindTextResult, FolioAgentSectionRead, FolioAgentStoryFindTextResult, FolioAgentStoryTextMatch, FolioAgentTextMatch, FolioAgentToolDefinition, FolioAgentToolName, FolioToolCallResult } from "./types.js";
|
|
2
3
|
import { FolioAgentBridge } from "./bridge.js";
|
|
3
4
|
import { CreateEditorRefBridgeOptions, FolioAgentEditorApplyDocumentOperationsOptions, FolioAgentEditorRefLike, createEditorRefBridge } from "./bridges/editor-ref.js";
|
|
4
5
|
import { CreateReviewerBridgeOptions, createReviewerBridge } from "./bridges/reviewer.js";
|
|
5
6
|
import { FolioAgentBlockDiff, FolioAgentCompareDocxVersionsOptions, FolioAgentGenerateRedlineDocxOptions, FolioAgentGenerateRedlineDocxResult, FolioAgentVersionDiff, FolioAgentVersionDiffSegment, compareDocxVersions, formatVersionDiffForLLM, generateRedlineDocx } from "./compare.js";
|
|
6
|
-
import { executeFolioToolCall } from "./execute.js";
|
|
7
|
-
import { FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, folioDocumentOperationBatchSchema } from "./operation-schema.js";
|
|
7
|
+
import { executeFolioToolCall, executeFolioToolCallUntyped } from "./execute.js";
|
|
8
8
|
import { ParseAddCommentResult, ParseSuggestChangesResult, parseAddCommentInput, parseSuggestChangesInput } from "./parse.js";
|
|
9
9
|
import { AnthropicToolDefinition, OpenAIToolDefinition, toAnthropicTools, toOpenAITools } from "./providers.js";
|
|
10
10
|
import { FOLIO_AGENT_TOOLS, getFolioToolDefinitions } from "./tools.js";
|
|
11
|
-
export { type AnthropicToolDefinition, type CreateEditorRefBridgeOptions, type CreateReviewerBridgeOptions, FOLIO_AGENT_TOOLS, FOLIO_AGENT_TOOL_NAMES, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, type FolioAgentApplyOperationsSummary, type FolioAgentBlock, type FolioAgentBlockDiff, type FolioAgentBridge, type FolioAgentChange, type FolioAgentComment, type FolioAgentCommentFilter, type FolioAgentCommentReply, type FolioAgentCompareDocxVersionsOptions, type FolioAgentDocumentOutline, type FolioAgentEditorApplyDocumentOperationsOptions, type FolioAgentEditorRefLike, type FolioAgentGenerateRedlineDocxOptions, type FolioAgentGenerateRedlineDocxResult, type FolioAgentOutlineEntry, type FolioAgentScopedFindTextResult, type FolioAgentSectionRead, type FolioAgentStoryFindTextResult, type FolioAgentStoryTextMatch, type FolioAgentTextMatch, type FolioAgentToolDefinition, type FolioAgentToolName, type FolioAgentVersionDiff, type FolioAgentVersionDiffSegment, type FolioToolCallResult, type OpenAIToolDefinition, type ParseAddCommentResult, type ParseSuggestChangesResult, compareDocxVersions, createEditorRefBridge, createReviewerBridge, executeFolioToolCall, folioDocumentOperationBatchSchema, formatVersionDiffForLLM, generateRedlineDocx, getFolioToolDefinitions, parseAddCommentInput, parseSuggestChangesInput, toAnthropicTools, toOpenAITools };
|
|
11
|
+
export { type AnthropicToolDefinition, type CreateEditorRefBridgeOptions, type CreateReviewerBridgeOptions, FOLIO_AGENT_TOOLS, FOLIO_AGENT_TOOL_NAMES, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, type FolioAgentApplyOperationsSummary, type FolioAgentBlock, type FolioAgentBlockDiff, type FolioAgentBridge, type FolioAgentChange, type FolioAgentComment, type FolioAgentCommentFilter, type FolioAgentCommentReply, type FolioAgentCompareDocxVersionsOptions, type FolioAgentDocumentOutline, type FolioAgentEditorApplyDocumentOperationsOptions, type FolioAgentEditorRefLike, type FolioAgentGenerateRedlineDocxOptions, type FolioAgentGenerateRedlineDocxResult, type FolioAgentOutlineEntry, type FolioAgentScopedFindTextResult, type FolioAgentSectionRead, type FolioAgentStoryFindTextResult, type FolioAgentStoryTextMatch, type FolioAgentTextMatch, type FolioAgentToolDefinition, type FolioAgentToolName, type FolioAgentVersionDiff, type FolioAgentVersionDiffSegment, type FolioToolCallResult, type OpenAIToolDefinition, type ParseAddCommentResult, type ParseSuggestChangesResult, compareDocxVersions, createEditorRefBridge, createReviewerBridge, executeFolioToolCall, executeFolioToolCallUntyped, folioDocumentOperationBatchSchema, formatVersionDiffForLLM, generateRedlineDocx, getFolioToolDefinitions, parseAddCommentInput, parseSuggestChangesInput, toAnthropicTools, toOpenAITools };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createEditorRefBridge } from "./bridges/editor-ref.js";
|
|
2
2
|
import { createReviewerBridge } from "./bridges/reviewer.js";
|
|
3
3
|
import { compareDocxVersions, formatVersionDiffForLLM, generateRedlineDocx } from "./compare.js";
|
|
4
|
-
import { executeFolioToolCall } from "./execute.js";
|
|
4
|
+
import { executeFolioToolCall, executeFolioToolCallUntyped } from "./execute.js";
|
|
5
5
|
import { FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, folioDocumentOperationBatchSchema } from "./operation-schema.js";
|
|
6
6
|
import { parseAddCommentInput, parseSuggestChangesInput } from "./parse.js";
|
|
7
7
|
import { toAnthropicTools, toOpenAITools } from "./providers.js";
|
|
8
8
|
import { FOLIO_AGENT_TOOLS, getFolioToolDefinitions } from "./tools.js";
|
|
9
9
|
import { FOLIO_AGENT_TOOL_NAMES } from "./types.js";
|
|
10
|
-
export { FOLIO_AGENT_TOOLS, FOLIO_AGENT_TOOL_NAMES, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, compareDocxVersions, createEditorRefBridge, createReviewerBridge, executeFolioToolCall, folioDocumentOperationBatchSchema, formatVersionDiffForLLM, generateRedlineDocx, getFolioToolDefinitions, parseAddCommentInput, parseSuggestChangesInput, toAnthropicTools, toOpenAITools };
|
|
10
|
+
export { FOLIO_AGENT_TOOLS, FOLIO_AGENT_TOOL_NAMES, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, compareDocxVersions, createEditorRefBridge, createReviewerBridge, executeFolioToolCall, executeFolioToolCallUntyped, folioDocumentOperationBatchSchema, formatVersionDiffForLLM, generateRedlineDocx, getFolioToolDefinitions, parseAddCommentInput, parseSuggestChangesInput, toAnthropicTools, toOpenAITools };
|