@stll/folio-agents 0.16.4 → 0.16.5
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FolioDocumentOperationBatch } from "@stll/folio-core/server";
|
|
2
|
+
import { LineSpacingRule, ParagraphAlignment } from "@stll/folio-core/types/document";
|
|
2
3
|
//#region src/operation-schema.d.ts
|
|
3
4
|
/** Compact public shape for the runtime JSON Schema projections. */
|
|
4
5
|
export type FolioJsonSchema = {
|
|
@@ -196,7 +197,7 @@ export declare const FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA: {
|
|
|
196
197
|
};
|
|
197
198
|
readonly lineSpacingRule: {
|
|
198
199
|
readonly type: "string";
|
|
199
|
-
readonly enum: readonly
|
|
200
|
+
readonly enum: readonly LineSpacingRule[];
|
|
200
201
|
readonly description: "How `lineSpacing` is interpreted.";
|
|
201
202
|
};
|
|
202
203
|
readonly beforeAutospacing: {
|
|
@@ -339,7 +340,7 @@ export declare const FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA: {
|
|
|
339
340
|
readonly alignment: {
|
|
340
341
|
readonly oneOf: readonly [{
|
|
341
342
|
readonly type: "string";
|
|
342
|
-
readonly enum: readonly
|
|
343
|
+
readonly enum: readonly ParagraphAlignment[];
|
|
343
344
|
}, {
|
|
344
345
|
readonly type: "null";
|
|
345
346
|
}];
|
|
@@ -369,7 +370,7 @@ export declare const FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA: {
|
|
|
369
370
|
};
|
|
370
371
|
readonly lineSpacingRule: {
|
|
371
372
|
readonly type: "string";
|
|
372
|
-
readonly enum: readonly
|
|
373
|
+
readonly enum: readonly LineSpacingRule[];
|
|
373
374
|
readonly description: "How `lineSpacing` is interpreted.";
|
|
374
375
|
};
|
|
375
376
|
readonly beforeAutospacing: {
|
package/dist/parse.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { FolioAIEditOperation, FolioDocumentOperationBatch, FolioDocumentOperati
|
|
|
13
13
|
* (`FolioSuggestChangesOptions.maxOperations`), defaulting to
|
|
14
14
|
* {@link DEFAULT_MAX_OPERATIONS_PER_CALL}.
|
|
15
15
|
*/
|
|
16
|
-
export declare const MAX_OPERATION_TEXT_LENGTH =
|
|
16
|
+
export declare const MAX_OPERATION_TEXT_LENGTH = 1e5;
|
|
17
17
|
/**
|
|
18
18
|
* Aggregate cap on the SUM of every text-bearing field's length across one
|
|
19
19
|
* `suggest_changes` call. Each field alone is bounded by
|
|
@@ -25,7 +25,7 @@ export declare const MAX_OPERATION_TEXT_LENGTH = 100000;
|
|
|
25
25
|
* tracked-changes engine in one call even though every per-field cap was
|
|
26
26
|
* respected. This budget bounds the running total instead.
|
|
27
27
|
*/
|
|
28
|
-
export declare const MAX_TOTAL_OPERATION_TEXT_LENGTH =
|
|
28
|
+
export declare const MAX_TOTAL_OPERATION_TEXT_LENGTH = 2e6;
|
|
29
29
|
/** Plain-language error for a string argument over {@link MAX_OPERATION_TEXT_LENGTH}. */
|
|
30
30
|
export declare const explainTextTooLong: (label: string, length: number) => string;
|
|
31
31
|
export type PrepareFolioAgentDocumentOperationBatchOptions = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FolioDocumentOperationType } from "@stll/folio-core/server";
|
|
2
|
+
import { TaggedErrorClass } from "better-result";
|
|
2
3
|
//#region src/suggest-changes-options.d.ts
|
|
4
|
+
declare const InvalidFolioSuggestChangesOptionsErrorBase: TaggedErrorClass<"InvalidFolioSuggestChangesOptionsError">;
|
|
3
5
|
/** Whether every operation must carry `severity` and `area`. */
|
|
4
6
|
export type FolioSuggestChangesReviewMetaPolicy = "optional" | "required";
|
|
5
7
|
/**
|
|
@@ -48,9 +50,8 @@ export type ResolvedFolioSuggestChangesOptions = {
|
|
|
48
50
|
export declare const DEFAULT_SUGGEST_CHANGES_OPERATION_TYPES: readonly FolioDocumentOperationType[];
|
|
49
51
|
export declare const DEFAULT_MAX_OPERATIONS_PER_CALL = 50;
|
|
50
52
|
export declare const MAX_OPERATIONS_PER_CALL_LIMIT = 200;
|
|
51
|
-
declare const InvalidFolioSuggestChangesOptionsError_base: import("better-result").TaggedErrorClass<"InvalidFolioSuggestChangesOptionsError">;
|
|
52
53
|
/** Programmer misuse of {@link FolioSuggestChangesOptions}; never reaches the model. */
|
|
53
|
-
export declare class InvalidFolioSuggestChangesOptionsError extends
|
|
54
|
+
export declare class InvalidFolioSuggestChangesOptionsError extends InvalidFolioSuggestChangesOptionsErrorBase<{
|
|
54
55
|
message: string;
|
|
55
56
|
option: keyof FolioSuggestChangesOptions;
|
|
56
57
|
}> {}
|
|
@@ -8,13 +8,14 @@ import { TaggedError } from "better-result";
|
|
|
8
8
|
* narrower or stricter surface configures instead of re-deriving the
|
|
9
9
|
* contract.
|
|
10
10
|
*/
|
|
11
|
+
const InvalidFolioSuggestChangesOptionsErrorBase = TaggedError("InvalidFolioSuggestChangesOptionsError");
|
|
11
12
|
const DEFAULT_EXCLUDED_OPERATION_TYPES = /* @__PURE__ */ new Set(["commentOnBlock", "insertSignatureTable"]);
|
|
12
13
|
/** The operation types `suggest_changes` exposes when a host passes no `operationTypes`. */
|
|
13
14
|
const DEFAULT_SUGGEST_CHANGES_OPERATION_TYPES = FOLIO_DOCUMENT_OPERATION_TYPES.filter((type) => !DEFAULT_EXCLUDED_OPERATION_TYPES.has(type));
|
|
14
15
|
const DEFAULT_MAX_OPERATIONS_PER_CALL = 50;
|
|
15
16
|
const MAX_OPERATIONS_PER_CALL_LIMIT = 200;
|
|
16
17
|
/** Programmer misuse of {@link FolioSuggestChangesOptions}; never reaches the model. */
|
|
17
|
-
var InvalidFolioSuggestChangesOptionsError = class extends
|
|
18
|
+
var InvalidFolioSuggestChangesOptionsError = class extends InvalidFolioSuggestChangesOptionsErrorBase {};
|
|
18
19
|
const invalidOption = (option, message) => {
|
|
19
20
|
throw new InvalidFolioSuggestChangesOptionsError({
|
|
20
21
|
message: `Invalid suggest_changes option \`${option}\`: ${message}.`,
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FolioAgentApplyOperationsSummary, FolioAgentBlock, FolioAgentChange, FolioAgentComment, FolioAgentCommentFilter, FolioAgentDocumentOutline, FolioAgentScopedFindTextResult, FolioAgentSectionRead, FolioAgentToolDefinition, FolioAgentTypedToolDefinition } from "./types.js";
|
|
2
2
|
import { FolioAgentToolOptions, FolioSuggestChangesOptions } from "./suggest-changes-options.js";
|
|
3
3
|
import { FolioAgentFindTextScope, FolioAgentShowInDocumentArgs } from "./tool-contract.js";
|
|
4
|
-
import { FolioDocumentOperationType } from "@stll/folio-core/server";
|
|
4
|
+
import { FolioDocumentOperationType, FolioDocumentSectionHandle, FolioDocumentStory, FolioDocumentStoryHandle } from "@stll/folio-core/server";
|
|
5
5
|
//#region src/tools.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* `suggest_changes` is a host-configurable projection of the document-operation
|
|
@@ -39,14 +39,14 @@ export declare const FOLIO_AGENT_TOOL_REGISTRY: {
|
|
|
39
39
|
maxDepth?: number;
|
|
40
40
|
}, FolioAgentDocumentOutline>;
|
|
41
41
|
readonly read_section: FolioAgentTypedToolDefinition<"read_section", {
|
|
42
|
-
handle:
|
|
42
|
+
handle: FolioDocumentSectionHandle;
|
|
43
43
|
maxBlocks?: number;
|
|
44
44
|
afterBlockId?: string;
|
|
45
45
|
}, FolioAgentSectionRead>;
|
|
46
|
-
readonly list_stories: FolioAgentTypedToolDefinition<"list_stories", Readonly<Record<string, never>>,
|
|
46
|
+
readonly list_stories: FolioAgentTypedToolDefinition<"list_stories", Readonly<Record<string, never>>, FolioDocumentStory[]>;
|
|
47
47
|
readonly read_story: FolioAgentTypedToolDefinition<"read_story", {
|
|
48
|
-
handle:
|
|
49
|
-
},
|
|
48
|
+
handle: FolioDocumentStoryHandle;
|
|
49
|
+
}, FolioDocumentStory>;
|
|
50
50
|
readonly find_text: FolioAgentTypedToolDefinition<"find_text", {
|
|
51
51
|
query: string;
|
|
52
52
|
matchCase?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-agents",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
4
|
"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.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"test": "bun test src"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@stll/folio-core": "^0.63.
|
|
60
|
-
"@stll/utf8-boundaries": "0.1.
|
|
59
|
+
"@stll/folio-core": "^0.63.1",
|
|
60
|
+
"@stll/utf8-boundaries": "0.1.2",
|
|
61
61
|
"better-result": "3.0.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|