@stll/folio-agents 0.12.0 → 0.12.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.
- package/dist/operation-schema.d.ts +79 -1
- package/dist/operation-schema.js +32 -19
- package/dist/tools.js +15 -17
- package/package.json +2 -2
|
@@ -95,6 +95,84 @@ declare const FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA: {
|
|
|
95
95
|
}];
|
|
96
96
|
readonly description: "Complete direct paragraph spacing (`w:spacing`); omitted attributes stay absent, while zero and false remain explicit. Null removes the direct spacing child and restores style inheritance.";
|
|
97
97
|
};
|
|
98
|
+
declare const FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA: {
|
|
99
|
+
readonly type: "object";
|
|
100
|
+
readonly description: "The paragraph properties to set; at least one.";
|
|
101
|
+
readonly properties: {
|
|
102
|
+
readonly styleId: {
|
|
103
|
+
readonly oneOf: readonly [{
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
}, {
|
|
106
|
+
readonly type: "null";
|
|
107
|
+
}];
|
|
108
|
+
readonly description: "Paragraph style id; null clears the direct style.";
|
|
109
|
+
};
|
|
110
|
+
readonly listLevel: {
|
|
111
|
+
readonly oneOf: readonly [{
|
|
112
|
+
readonly type: "integer";
|
|
113
|
+
readonly minimum: 0;
|
|
114
|
+
readonly maximum: number;
|
|
115
|
+
}, {
|
|
116
|
+
readonly type: "null";
|
|
117
|
+
}];
|
|
118
|
+
readonly description: "`w:numPr/w:ilvl`, zero-based; a number retains the paragraph or anchor's numbering instance (`numId`), while null removes paragraph numbering.";
|
|
119
|
+
};
|
|
120
|
+
readonly alignment: {
|
|
121
|
+
readonly oneOf: readonly [{
|
|
122
|
+
readonly type: "string";
|
|
123
|
+
readonly enum: readonly ("left" | "center" | "right" | "both" | "distribute" | "mediumKashida" | "highKashida" | "lowKashida" | "thaiDistribute")[];
|
|
124
|
+
}, {
|
|
125
|
+
readonly type: "null";
|
|
126
|
+
}];
|
|
127
|
+
readonly description: "Direct paragraph alignment; null restores style inheritance.";
|
|
128
|
+
};
|
|
129
|
+
readonly spacing: {
|
|
130
|
+
readonly oneOf: readonly [{
|
|
131
|
+
readonly type: "object";
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly spaceBefore: {
|
|
134
|
+
readonly type: "integer";
|
|
135
|
+
readonly minimum: 0;
|
|
136
|
+
readonly maximum: number;
|
|
137
|
+
readonly description: "Non-negative space before, in twips.";
|
|
138
|
+
};
|
|
139
|
+
readonly spaceAfter: {
|
|
140
|
+
readonly type: "integer";
|
|
141
|
+
readonly minimum: 0;
|
|
142
|
+
readonly maximum: number;
|
|
143
|
+
readonly description: "Non-negative space after, in twips.";
|
|
144
|
+
};
|
|
145
|
+
readonly lineSpacing: {
|
|
146
|
+
readonly type: "integer";
|
|
147
|
+
readonly minimum: number;
|
|
148
|
+
readonly maximum: number;
|
|
149
|
+
readonly description: "Signed line spacing: 240ths of a line with the auto rule, otherwise twips.";
|
|
150
|
+
};
|
|
151
|
+
readonly lineSpacingRule: {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
readonly enum: readonly ("auto" | "exact" | "atLeast")[];
|
|
154
|
+
readonly description: "How `lineSpacing` is interpreted.";
|
|
155
|
+
};
|
|
156
|
+
readonly beforeAutospacing: {
|
|
157
|
+
readonly type: "boolean";
|
|
158
|
+
readonly description: "Whether the application determines spacing before automatically.";
|
|
159
|
+
};
|
|
160
|
+
readonly afterAutospacing: {
|
|
161
|
+
readonly type: "boolean";
|
|
162
|
+
readonly description: "Whether the application determines spacing after automatically.";
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
readonly minProperties: 1;
|
|
166
|
+
readonly additionalProperties: false;
|
|
167
|
+
}, {
|
|
168
|
+
readonly type: "null";
|
|
169
|
+
}];
|
|
170
|
+
readonly description: "Complete direct paragraph spacing (`w:spacing`); omitted attributes stay absent, while zero and false remain explicit. Null removes the direct spacing child and restores style inheritance.";
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
readonly minProperties: 1;
|
|
174
|
+
readonly additionalProperties: false;
|
|
175
|
+
};
|
|
98
176
|
/**
|
|
99
177
|
* JSON Schema (draft-07 compatible) for ONE document operation: the full
|
|
100
178
|
* union accepted by `parseFolioDocumentOperationBatch` in
|
|
@@ -163,4 +241,4 @@ type FolioDocumentOperationBatchSchema = StandardSchemaV1<unknown, FolioDocument
|
|
|
163
241
|
*/
|
|
164
242
|
declare const folioDocumentOperationBatchSchema: FolioDocumentOperationBatchSchema;
|
|
165
243
|
//#endregion
|
|
166
|
-
export { FOLIO_CLEARABLE_LIST_LEVEL_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_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, FolioJsonSchema, folioDocumentOperationBatchSchema };
|
|
244
|
+
export { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_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_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, FolioJsonSchema, folioDocumentOperationBatchSchema };
|
package/dist/operation-schema.js
CHANGED
|
@@ -187,6 +187,24 @@ const FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA = {
|
|
|
187
187
|
}, { type: "null" }],
|
|
188
188
|
description: "Complete direct paragraph spacing (`w:spacing`); omitted attributes stay absent, while zero and false remain explicit. Null removes the direct spacing child and restores style inheritance."
|
|
189
189
|
};
|
|
190
|
+
const FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA = {
|
|
191
|
+
type: "object",
|
|
192
|
+
description: "The paragraph properties to set; at least one.",
|
|
193
|
+
properties: {
|
|
194
|
+
styleId: FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA,
|
|
195
|
+
listLevel: FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA,
|
|
196
|
+
alignment: {
|
|
197
|
+
oneOf: [{
|
|
198
|
+
type: "string",
|
|
199
|
+
enum: FOLIO_PARAGRAPH_ALIGNMENT_VALUES
|
|
200
|
+
}, { type: "null" }],
|
|
201
|
+
description: "Direct paragraph alignment; null restores style inheritance."
|
|
202
|
+
},
|
|
203
|
+
spacing: FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA
|
|
204
|
+
},
|
|
205
|
+
minProperties: 1,
|
|
206
|
+
additionalProperties: false
|
|
207
|
+
};
|
|
190
208
|
/**
|
|
191
209
|
* JSON Schema (draft-07 compatible) for ONE document operation: the full
|
|
192
210
|
* union accepted by `parseFolioDocumentOperationBatch` in
|
|
@@ -473,6 +491,14 @@ const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA = {
|
|
|
473
491
|
separator: {
|
|
474
492
|
type: "string",
|
|
475
493
|
description: "Text at `offset` the break replaces, usually the space between the halves."
|
|
494
|
+
},
|
|
495
|
+
firstParagraphProperties: {
|
|
496
|
+
...FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA,
|
|
497
|
+
description: "Properties for the first result; omitted properties keep the source paragraph's value."
|
|
498
|
+
},
|
|
499
|
+
secondParagraphProperties: {
|
|
500
|
+
...FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA,
|
|
501
|
+
description: "Properties for the second result; omitted properties keep the source paragraph's value."
|
|
476
502
|
}
|
|
477
503
|
},
|
|
478
504
|
required: [
|
|
@@ -497,6 +523,10 @@ const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA = {
|
|
|
497
523
|
separator: {
|
|
498
524
|
type: "string",
|
|
499
525
|
description: "Text the join inserts between the two halves, usually a space."
|
|
526
|
+
},
|
|
527
|
+
mergedParagraphProperties: {
|
|
528
|
+
...FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA,
|
|
529
|
+
description: "Properties for the joined result; omitted properties keep the first paragraph's value."
|
|
500
530
|
}
|
|
501
531
|
},
|
|
502
532
|
required: [
|
|
@@ -517,24 +547,7 @@ const FOLIO_DOCUMENT_OPERATION_JSON_SCHEMA = {
|
|
|
517
547
|
enum: ["setBlockParagraphProperties"]
|
|
518
548
|
},
|
|
519
549
|
blockId: blockIdProperty,
|
|
520
|
-
properties:
|
|
521
|
-
type: "object",
|
|
522
|
-
description: "The paragraph properties to set; at least one.",
|
|
523
|
-
properties: {
|
|
524
|
-
styleId: FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA,
|
|
525
|
-
listLevel: FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA,
|
|
526
|
-
alignment: {
|
|
527
|
-
oneOf: [{
|
|
528
|
-
type: "string",
|
|
529
|
-
enum: FOLIO_PARAGRAPH_ALIGNMENT_VALUES
|
|
530
|
-
}, { type: "null" }],
|
|
531
|
-
description: "Direct paragraph alignment; null restores style inheritance."
|
|
532
|
-
},
|
|
533
|
-
spacing: FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA
|
|
534
|
-
},
|
|
535
|
-
minProperties: 1,
|
|
536
|
-
additionalProperties: false
|
|
537
|
-
}
|
|
550
|
+
properties: FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA
|
|
538
551
|
},
|
|
539
552
|
required: [
|
|
540
553
|
"id",
|
|
@@ -921,4 +934,4 @@ const folioDocumentOperationBatchSchema = {
|
|
|
921
934
|
jsonSchema: FOLIO_DOCUMENT_OPERATION_BATCH_JSON_SCHEMA
|
|
922
935
|
};
|
|
923
936
|
//#endregion
|
|
924
|
-
export { FOLIO_CLEARABLE_LIST_LEVEL_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_PRECONDITION_JSON_SCHEMA, FOLIO_TEXT_RANGE_JSON_SCHEMA, folioDocumentOperationBatchSchema };
|
|
937
|
+
export { FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA, FOLIO_CLEARABLE_LIST_LEVEL_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_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_CLEARABLE_LIST_LEVEL_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_JSON_SCHEMA, 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_PARAGRAPH_SPACING_JSON_SCHEMA, FOLIO_CLEARABLE_PARAGRAPH_STYLE_ID_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";
|
|
@@ -179,22 +179,20 @@ const OPERATION_PROPERTY_SCHEMAS = {
|
|
|
179
179
|
additionalProperties: false
|
|
180
180
|
},
|
|
181
181
|
properties: {
|
|
182
|
-
|
|
183
|
-
description: "Required for `setBlockParagraphProperties`: the paragraph properties to set. Null clears a direct property."
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
minProperties: 1,
|
|
197
|
-
additionalProperties: false
|
|
182
|
+
...FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA,
|
|
183
|
+
description: "Required for `setBlockParagraphProperties`: the paragraph properties to set. Null clears a direct property."
|
|
184
|
+
},
|
|
185
|
+
firstParagraphProperties: {
|
|
186
|
+
...FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA,
|
|
187
|
+
description: "For `splitBlock`, properties for the first result; omitted properties keep the source paragraph's value."
|
|
188
|
+
},
|
|
189
|
+
secondParagraphProperties: {
|
|
190
|
+
...FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA,
|
|
191
|
+
description: "For `splitBlock`, properties for the second result; omitted properties keep the source paragraph's value."
|
|
192
|
+
},
|
|
193
|
+
mergedParagraphProperties: {
|
|
194
|
+
...FOLIO_BLOCK_PARAGRAPH_PROPERTIES_JSON_SCHEMA,
|
|
195
|
+
description: "For `mergeBlockWithNext`, properties for the joined result; omitted properties keep the first paragraph's value."
|
|
198
196
|
},
|
|
199
197
|
listLevel: FOLIO_CLEARABLE_LIST_LEVEL_JSON_SCHEMA,
|
|
200
198
|
offset: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-agents",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.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.37.
|
|
57
|
+
"@stll/folio-core": "^0.37.1",
|
|
58
58
|
"better-result": "3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"main": "./dist/index.js",
|