@stll/folio-agents 0.12.3 → 0.13.1

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.
@@ -83,6 +83,11 @@ declare const FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA: {
83
83
  }];
84
84
  readonly description: "Complete direct paragraph indentation (`w:ind`); null removes the direct child and restores style inheritance.";
85
85
  };
86
+ declare const FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA: {
87
+ readonly type: "string";
88
+ readonly enum: readonly ["firstParagraph", "allParagraphs"];
89
+ readonly description: string;
90
+ };
86
91
  declare const FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA: {
87
92
  readonly oneOf: readonly [{
88
93
  readonly type: "object";
@@ -143,7 +148,7 @@ declare const FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA: {
143
148
  };
144
149
  readonly lineSpacingRule: {
145
150
  readonly type: "string";
146
- readonly enum: readonly ("auto" | "exact" | "atLeast")[];
151
+ readonly enum: readonly import("@stll/docx-core/model").LineSpacingRule[];
147
152
  readonly description: "How `lineSpacing` is interpreted.";
148
153
  };
149
154
  readonly beforeAutospacing: {
@@ -239,7 +244,7 @@ declare const FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA: {
239
244
  readonly alignment: {
240
245
  readonly oneOf: readonly [{
241
246
  readonly type: "string";
242
- readonly enum: readonly ("left" | "right" | "center" | "both" | "distribute" | "mediumKashida" | "highKashida" | "lowKashida" | "thaiDistribute")[];
247
+ readonly enum: readonly import("@stll/docx-core/model").ParagraphAlignment[];
243
248
  }, {
244
249
  readonly type: "null";
245
250
  }];
@@ -269,7 +274,7 @@ declare const FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA: {
269
274
  };
270
275
  readonly lineSpacingRule: {
271
276
  readonly type: "string";
272
- readonly enum: readonly ("auto" | "exact" | "atLeast")[];
277
+ readonly enum: readonly import("@stll/docx-core/model").LineSpacingRule[];
273
278
  readonly description: "How `lineSpacing` is interpreted.";
274
279
  };
275
280
  readonly beforeAutospacing: {
@@ -360,4 +365,4 @@ type FolioDocumentOperationBatchSchema = StandardSchemaV1<unknown, FolioDocument
360
365
  */
361
366
  declare const folioDocumentOperationBatchSchema: FolioDocumentOperationBatchSchema;
362
367
  //#endregion
363
- export { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA, FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_OPERATION_CONSTRAINT, FOLIO_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, FolioJsonSchema, folioDocumentOperationBatchSchema };
368
+ export { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA, FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_OPERATION_CONSTRAINT, FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA, FOLIO_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, FolioJsonSchema, folioDocumentOperationBatchSchema };
@@ -172,6 +172,11 @@ const FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA = {
172
172
  }, { type: "null" }],
173
173
  description: "Complete direct paragraph indentation (`w:ind`); null removes the direct child and restores style inheritance."
174
174
  };
175
+ const FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA = {
176
+ type: "string",
177
+ enum: ["firstParagraph", "allParagraphs"],
178
+ description: "Which paragraphs split from `text` receive the operation's paragraph formatting: `firstParagraph` (default) formats only the first, for a heading followed by its body; `allParagraphs` formats every paragraph alike, for several list items in one operation."
179
+ };
175
180
  const FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA = {
176
181
  oneOf: [{
177
182
  type: "object",
@@ -405,7 +410,7 @@ const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA = {
405
410
  blockId: blockIdProperty,
406
411
  text: {
407
412
  type: "string",
408
- description: "The paragraph text to insert. A line break splits this into consecutive paragraphs at the same anchor instead of one paragraph with embedded newlines — only the first paragraph gets `styleId` / `alignment` / `spacing` / `inheritFormatting`, later ones use body formatting. Prefer one paragraph per operation; only rely on the split for a heading immediately followed by its body text."
413
+ description: "The paragraph text to insert. A line break splits this into consecutive paragraphs at the same anchor instead of one paragraph with embedded newlines. By default only the first paragraph gets `styleId` / `listLevel` / `numbering` / `alignment` / `spacing` / `inheritFormatting` and later ones use body formatting; set `formattingScope: \"allParagraphs\"` to format every paragraph alike, for example several list items. Prefer one paragraph per operation otherwise."
409
414
  },
410
415
  inheritFormatting: {
411
416
  type: "boolean",
@@ -430,6 +435,7 @@ const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA = {
430
435
  type: "string",
431
436
  enum: ["paragraph", "inline"]
432
437
  },
438
+ formattingScope: FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA,
433
439
  numbering: FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA,
434
440
  hardPageBreak: FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA,
435
441
  moveId: {
@@ -460,7 +466,7 @@ const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA = {
460
466
  blockId: blockIdProperty,
461
467
  text: {
462
468
  type: "string",
463
- description: "The paragraph text to insert. A line break splits this into consecutive paragraphs at the same anchor instead of one paragraph with embedded newlines — only the first paragraph gets `styleId` / `alignment` / `spacing` / `inheritFormatting`, later ones use body formatting. Prefer one paragraph per operation; only rely on the split for a heading immediately followed by its body text."
469
+ description: "The paragraph text to insert. A line break splits this into consecutive paragraphs at the same anchor instead of one paragraph with embedded newlines. By default only the first paragraph gets `styleId` / `listLevel` / `numbering` / `alignment` / `spacing` / `inheritFormatting` and later ones use body formatting; set `formattingScope: \"allParagraphs\"` to format every paragraph alike, for example several list items. Prefer one paragraph per operation otherwise."
464
470
  },
465
471
  inheritFormatting: {
466
472
  type: "boolean",
@@ -485,6 +491,7 @@ const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA = {
485
491
  type: "string",
486
492
  enum: ["paragraph", "inline"]
487
493
  },
494
+ formattingScope: FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA,
488
495
  numbering: FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA,
489
496
  hardPageBreak: FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA,
490
497
  moveId: {
@@ -1018,4 +1025,4 @@ const folioDocumentOperationBatchSchema = {
1018
1025
  jsonSchema: FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA
1019
1026
  };
1020
1027
  //#endregion
1021
- export { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA, FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_OPERATION_CONSTRAINT, FOLIO_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, folioDocumentOperationBatchSchema };
1028
+ export { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA, FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA, FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_OPERATION_CONSTRAINT, FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA, FOLIO_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, folioDocumentOperationBatchSchema };
package/dist/tools.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FOLIO_COMMENT_ID_JSON_SCHEMA, FOLIO_SCOPED_HANDLE_JSON_SCHEMA, FOLIO_SECTION_HANDLE_JSON_SCHEMA, FOLIO_STORY_HANDLE_JSON_SCHEMA } from "./codecs.js";
2
- import { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA, FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_OPERATION_CONSTRAINT, FOLIO_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA } from "./operation-schema.js";
2
+ import { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA, FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_INDENTATION_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA, FOLIO_HARD_PAGE_BREAK_OPERATION_CONSTRAINT, FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA, FOLIO_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA } from "./operation-schema.js";
3
3
  import { DEFAULT_SUGGEST_CHANGES_OPERATION_TYPES, resolveSuggestChangesOptions } from "./suggest-changes-options.js";
4
4
  import { defineFolioAgentToolDefinition } from "./tool-contract.js";
5
5
  import { FOLIO_AGENT_TOOL_NAMES } from "./types.js";
@@ -127,6 +127,10 @@ const OPERATION_PROPERTY_SCHEMAS = {
127
127
  enum: ["paragraph", "inline"],
128
128
  description: "For inserts: interpret line breaks as paragraph boundaries (default) or inline breaks."
129
129
  },
130
+ formattingScope: {
131
+ ...FOLIO_INSERT_FORMATTING_SCOPE_JSON_SCHEMA,
132
+ description: "For inserts: which paragraphs split from `text` get the operation's paragraph formatting. `firstParagraph` (default) formats only the first; `allParagraphs` formats every paragraph alike, for several list items in one operation."
133
+ },
130
134
  numbering: FOLIO_CLEARABLE_NUMBERING_JSON_SCHEMA,
131
135
  hardPageBreak: FOLIO_HARD_PAGE_BREAK_JSON_SCHEMA,
132
136
  preserveFormatting: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/folio-agents",
3
- "version": "0.12.3",
3
+ "version": "0.13.1",
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",
@@ -54,7 +54,7 @@
54
54
  "test": "bun test src"
55
55
  },
56
56
  "dependencies": {
57
- "@stll/folio-core": "^0.39.0",
57
+ "@stll/folio-core": "^0.41.0",
58
58
  "better-result": "3.0.1"
59
59
  },
60
60
  "main": "./dist/index.js",