@tiwater/office-mcp 0.21.27 → 0.21.28
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema": "tiwater.office-provider-contract-manifest/v1",
|
|
3
3
|
"provider": {
|
|
4
4
|
"id": "@tiwater/office-mcp",
|
|
5
|
-
"version": "0.21.
|
|
5
|
+
"version": "0.21.28"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -456,6 +456,17 @@
|
|
|
456
456
|
"sha256": "9ae4a846a8ca5b9059dcfd2a589e9872a2ab8d4ba3a118a513f3e05462f923d0"
|
|
457
457
|
}
|
|
458
458
|
},
|
|
459
|
+
{
|
|
460
|
+
"name": "xlsx_read_range",
|
|
461
|
+
"providerContract": {
|
|
462
|
+
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_read_range.schema.json",
|
|
463
|
+
"sha256": "04b0ce1b912047f774fbbbb6ba7cf55e5e53a9b74d6f027d9c21b4d6d7397225"
|
|
464
|
+
},
|
|
465
|
+
"inputContract": {
|
|
466
|
+
"path": "office/contracts/xlsx_read_range.schema.json",
|
|
467
|
+
"sha256": "04b0ce1b912047f774fbbbb6ba7cf55e5e53a9b74d6f027d9c21b4d6d7397225"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
459
470
|
{
|
|
460
471
|
"name": "xlsx_set_cell_number_format",
|
|
461
472
|
"providerContract": {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "tiwater.office-mcp-input/xlsx_read_range/v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"input": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1,
|
|
9
|
+
"description": "Current XLSX workbook. Convert legacy XLS before selecting Open XML cells.",
|
|
10
|
+
"x-tiwater-file-role": "read"
|
|
11
|
+
},
|
|
12
|
+
"sheet": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"description": "Exact current worksheet name returned by workbook observation."
|
|
16
|
+
},
|
|
17
|
+
"range": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^[A-Za-z]{1,3}[1-9][0-9]*(?::[A-Za-z]{1,3}[1-9][0-9]*)?$",
|
|
20
|
+
"description": "Explicit native A1 cell or rectangular range. A single cell is a one-cell range."
|
|
21
|
+
},
|
|
22
|
+
"offset": {
|
|
23
|
+
"type": "integer",
|
|
24
|
+
"minimum": 0,
|
|
25
|
+
"maximum": 9007199254740991,
|
|
26
|
+
"description": "Zero-based cell offset in row-major order within the selected range. Continue only when another selected cell is needed."
|
|
27
|
+
},
|
|
28
|
+
"limit": {
|
|
29
|
+
"type": "integer",
|
|
30
|
+
"minimum": 1,
|
|
31
|
+
"maximum": 256,
|
|
32
|
+
"description": "Maximum selected cells in this bounded page."
|
|
33
|
+
},
|
|
34
|
+
"returnContent": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"description": "Return this selected technical page directly when it fits the response limit. May be combined with output."
|
|
37
|
+
},
|
|
38
|
+
"output": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1,
|
|
41
|
+
"description": "Optional immutable JSON artifact path for this selected technical page. May be combined with returnContent.",
|
|
42
|
+
"x-tiwater-file-role": "write"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": ["input", "sheet", "range", "limit", "returnContent"],
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
}
|
package/office/index.mjs
CHANGED
|
@@ -202,6 +202,67 @@ const xlsxInspectionSummary = z.object({
|
|
|
202
202
|
}).strict()).max(6),
|
|
203
203
|
}).strict();
|
|
204
204
|
|
|
205
|
+
const xlsxRangePageSummary = z.object({
|
|
206
|
+
schema: z.literal('tiwater.xlsx-range-page-receipt/v1'),
|
|
207
|
+
totalCellCount: z.number().int().nonnegative(),
|
|
208
|
+
returnedCellCount: z.number().int().nonnegative(),
|
|
209
|
+
remaining: z.number().int().nonnegative(),
|
|
210
|
+
nextOffset: z.number().int().nonnegative().nullable(),
|
|
211
|
+
}).strict();
|
|
212
|
+
|
|
213
|
+
const xlsxRangePage = z.object({
|
|
214
|
+
schema: z.literal('tiwater.xlsx-range-page/v1'),
|
|
215
|
+
toolVersion: z.string(),
|
|
216
|
+
file: z.string(),
|
|
217
|
+
inputSha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
218
|
+
sheet: z.string(),
|
|
219
|
+
range: z.string(),
|
|
220
|
+
receipt: xlsxRangePageSummary,
|
|
221
|
+
cells: z.array(z.object({
|
|
222
|
+
reference: z.string(),
|
|
223
|
+
row: z.number().int().positive(),
|
|
224
|
+
column: z.number().int().positive(),
|
|
225
|
+
physical: z.boolean(),
|
|
226
|
+
rawValue: z.string().nullable(),
|
|
227
|
+
formattedValue: z.string().nullable(),
|
|
228
|
+
valueType: z.string().nullable(),
|
|
229
|
+
normalizedValue: z.object({ kind: z.string(), iso8601: z.string().nullable() }).strict().nullable(),
|
|
230
|
+
formula: z.object({
|
|
231
|
+
text: z.string(),
|
|
232
|
+
type: z.string().nullable(),
|
|
233
|
+
sharedIndex: z.number().int().nonnegative().nullable(),
|
|
234
|
+
reference: z.string().nullable(),
|
|
235
|
+
}).strict().nullable(),
|
|
236
|
+
style: z.object({
|
|
237
|
+
styleIndex: z.number().int().nonnegative(),
|
|
238
|
+
numberFormatId: z.number().int().nonnegative(),
|
|
239
|
+
numberFormatCode: z.string().nullable(),
|
|
240
|
+
fontId: z.number().int().nonnegative(),
|
|
241
|
+
fillId: z.number().int().nonnegative(),
|
|
242
|
+
borderId: z.number().int().nonnegative(),
|
|
243
|
+
horizontalAlignment: z.string().nullable(),
|
|
244
|
+
verticalAlignment: z.string().nullable(),
|
|
245
|
+
wrapText: z.boolean(),
|
|
246
|
+
bold: z.boolean(),
|
|
247
|
+
}).strict().nullable(),
|
|
248
|
+
richTextRuns: z.array(z.object({
|
|
249
|
+
text: z.string(),
|
|
250
|
+
fontName: z.string().nullable(),
|
|
251
|
+
color: z.string().nullable(),
|
|
252
|
+
underline: z.string().nullable(),
|
|
253
|
+
bold: z.boolean(),
|
|
254
|
+
italic: z.boolean(),
|
|
255
|
+
}).strict()).nullable(),
|
|
256
|
+
mergedRange: z.string().nullable(),
|
|
257
|
+
mergeOwner: z.string().nullable(),
|
|
258
|
+
}).strict()).max(256),
|
|
259
|
+
}).strict();
|
|
260
|
+
|
|
261
|
+
const xlsxRangeReadOutput = largeResultOutput('xlsx_read_range').extend({
|
|
262
|
+
summary: xlsxRangePageSummary,
|
|
263
|
+
content: xlsxRangePage.optional(),
|
|
264
|
+
}).strict();
|
|
265
|
+
|
|
205
266
|
const pptxInspectionSummary = z.object({
|
|
206
267
|
slideCount: z.number().int().nonnegative(),
|
|
207
268
|
masterCount: z.number().int().nonnegative(),
|
|
@@ -580,6 +641,14 @@ const tools = [
|
|
|
580
641
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
581
642
|
handler: xlsxExportJson,
|
|
582
643
|
},
|
|
644
|
+
{
|
|
645
|
+
name: 'xlsx_read_range',
|
|
646
|
+
description: 'Read one explicit native A1 cell or rectangular range from one current XLSX worksheet. Pages use a row-major cell offset and return physical presence, raw and formatted values, normalized value type, formula metadata, style, rich text, and merged-range ownership. The receipt always reports remaining cells and the next offset. Continue only when another selected cell is needed. Set returnContent true to return the selected page when it fits the response limit. Provide output to store the same complete selected page as an immutable artifact. These channels are independent and may be used together; at least one is required. This tool does not infer regions, headers, records, field meanings, or business mappings; convert legacy XLS before reading Open XML cells.',
|
|
647
|
+
inputSchema: inputContract('xlsx_read_range'),
|
|
648
|
+
outputSchema: xlsxRangeReadOutput,
|
|
649
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
650
|
+
handler: xlsxReadRange,
|
|
651
|
+
},
|
|
583
652
|
...fixedToolDefinitions(xlsxFixedTools),
|
|
584
653
|
{
|
|
585
654
|
name: 'xlsx_validate',
|
|
@@ -1202,6 +1271,21 @@ async function xlsxExportJson(args) {
|
|
|
1202
1271
|
return deliverLargeJsonResult({ tool: 'xlsx_export_json', args, runtime: commandRuntime(result), payload: result.json, sourcePaths: [input] });
|
|
1203
1272
|
}
|
|
1204
1273
|
|
|
1274
|
+
async function xlsxReadRange(args) {
|
|
1275
|
+
const input = path.resolve(requireString(args.input, 'input'));
|
|
1276
|
+
return withTempJsonFile(args, async requestPath => {
|
|
1277
|
+
const result = await runJsonCandidateChain(xlsxCandidates, ['xlsx_read_range', requestPath]);
|
|
1278
|
+
return deliverLargeJsonResult({
|
|
1279
|
+
tool: 'xlsx_read_range',
|
|
1280
|
+
args,
|
|
1281
|
+
runtime: commandRuntime(result),
|
|
1282
|
+
payload: result.json,
|
|
1283
|
+
sourcePaths: [input],
|
|
1284
|
+
summary: result.json.receipt,
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1205
1289
|
async function xlsxValidate(args) {
|
|
1206
1290
|
const input = path.resolve(requireString(args.input, 'input'));
|
|
1207
1291
|
const result = await runJsonCandidateChain(xlsxCandidates, ['validate', input], { allowedExitCodes: [0, 1] });
|