@tiwater/office-mcp 0.21.41 → 0.21.43
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/office/contracts/docx_read_table.schema.json +5 -4
- package/office/contracts/tiwater-office-provider-contract-manifest-v1.json +37 -37
- package/office/contracts/xlsx_convert_legacy.schema.json +2 -0
- package/office/contracts/xlsx_copy_row.schema.json +2 -0
- package/office/contracts/xlsx_delete_rows.schema.json +2 -0
- package/office/contracts/xlsx_expand_section_rows.schema.json +2 -0
- package/office/contracts/xlsx_export_json.schema.json +1 -0
- package/office/contracts/xlsx_insert_rows.schema.json +2 -0
- package/office/contracts/xlsx_inspect.schema.json +1 -0
- package/office/contracts/xlsx_read_range.schema.json +1 -0
- package/office/contracts/xlsx_set_cell_number_format.schema.json +2 -0
- package/office/contracts/xlsx_set_cell_value.schema.json +2 -0
- package/office/contracts/xlsx_set_column_width.schema.json +2 -0
- package/office/contracts/xlsx_set_page_setup.schema.json +2 -0
- package/office/contracts/xlsx_set_print_area.schema.json +2 -0
- package/office/contracts/xlsx_set_range_values.schema.json +2 -0
- package/office/contracts/xlsx_set_rich_text_cell_value.schema.json +2 -0
- package/office/contracts/xlsx_set_row_page_breaks.schema.json +2 -0
- package/office/contracts/xlsx_validate.schema.json +1 -0
- package/office/index.mjs +43 -40
- package/package.json +1 -1
- package/pdf/contracts/tiwater-pdf-provider-contract-manifest-v1.json +1 -1
- package/text/contracts/tiwater-text-provider-contract-manifest-v1.json +1 -1
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"required": ["part", "path"],
|
|
22
22
|
"additionalProperties": false
|
|
23
23
|
},
|
|
24
|
-
"
|
|
25
|
-
"type": "
|
|
26
|
-
"
|
|
27
|
-
"
|
|
24
|
+
"offset": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 0,
|
|
27
|
+
"maximum": 9007199254740991,
|
|
28
|
+
"description": "Zero-based row offset. Continue from receipt.nextOffset only when a later row is needed."
|
|
28
29
|
},
|
|
29
30
|
"output": {
|
|
30
31
|
"type": "string",
|
|
@@ -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.43"
|
|
6
6
|
},
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -152,11 +152,11 @@
|
|
|
152
152
|
"name": "docx_read_table",
|
|
153
153
|
"providerContract": {
|
|
154
154
|
"source": "packages/docx-cli/contracts/mcp-input/docx_read_table.schema.json",
|
|
155
|
-
"sha256": "
|
|
155
|
+
"sha256": "c5f9f628494a11e0377248c256b3c047471f897c92a81b6fa1a01f408e478962"
|
|
156
156
|
},
|
|
157
157
|
"inputContract": {
|
|
158
158
|
"path": "office/contracts/docx_read_table.schema.json",
|
|
159
|
-
"sha256": "
|
|
159
|
+
"sha256": "c5f9f628494a11e0377248c256b3c047471f897c92a81b6fa1a01f408e478962"
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
162
|
{
|
|
@@ -405,187 +405,187 @@
|
|
|
405
405
|
"name": "xlsx_convert_legacy",
|
|
406
406
|
"providerContract": {
|
|
407
407
|
"source": "packages/convert-cli/schemas/mcp-input/xlsx_convert_legacy.schema.json",
|
|
408
|
-
"sha256": "
|
|
408
|
+
"sha256": "0867f51d4b2461ae2d739a0a9dd01c1d7935bb6b4ebeb9678f56ddc8775543ad"
|
|
409
409
|
},
|
|
410
410
|
"inputContract": {
|
|
411
411
|
"path": "office/contracts/xlsx_convert_legacy.schema.json",
|
|
412
|
-
"sha256": "
|
|
412
|
+
"sha256": "0867f51d4b2461ae2d739a0a9dd01c1d7935bb6b4ebeb9678f56ddc8775543ad"
|
|
413
413
|
}
|
|
414
414
|
},
|
|
415
415
|
{
|
|
416
416
|
"name": "xlsx_copy_row",
|
|
417
417
|
"providerContract": {
|
|
418
418
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_copy_row.schema.json",
|
|
419
|
-
"sha256": "
|
|
419
|
+
"sha256": "66d20708d28a82112a372fee7cdd20976b32e562788d0f6336e27311b872caf6"
|
|
420
420
|
},
|
|
421
421
|
"inputContract": {
|
|
422
422
|
"path": "office/contracts/xlsx_copy_row.schema.json",
|
|
423
|
-
"sha256": "
|
|
423
|
+
"sha256": "66d20708d28a82112a372fee7cdd20976b32e562788d0f6336e27311b872caf6"
|
|
424
424
|
}
|
|
425
425
|
},
|
|
426
426
|
{
|
|
427
427
|
"name": "xlsx_delete_rows",
|
|
428
428
|
"providerContract": {
|
|
429
429
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_delete_rows.schema.json",
|
|
430
|
-
"sha256": "
|
|
430
|
+
"sha256": "13211831a052d1c5d2b406f1481412ebe95c46344fe8c86e6744184f22fc8352"
|
|
431
431
|
},
|
|
432
432
|
"inputContract": {
|
|
433
433
|
"path": "office/contracts/xlsx_delete_rows.schema.json",
|
|
434
|
-
"sha256": "
|
|
434
|
+
"sha256": "13211831a052d1c5d2b406f1481412ebe95c46344fe8c86e6744184f22fc8352"
|
|
435
435
|
}
|
|
436
436
|
},
|
|
437
437
|
{
|
|
438
438
|
"name": "xlsx_expand_section_rows",
|
|
439
439
|
"providerContract": {
|
|
440
440
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_expand_section_rows.schema.json",
|
|
441
|
-
"sha256": "
|
|
441
|
+
"sha256": "b9a3b3b73186e0d03777977717bc07afd25816e9843e9c832596f3fff348a871"
|
|
442
442
|
},
|
|
443
443
|
"inputContract": {
|
|
444
444
|
"path": "office/contracts/xlsx_expand_section_rows.schema.json",
|
|
445
|
-
"sha256": "
|
|
445
|
+
"sha256": "b9a3b3b73186e0d03777977717bc07afd25816e9843e9c832596f3fff348a871"
|
|
446
446
|
}
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
449
|
"name": "xlsx_export_json",
|
|
450
450
|
"providerContract": {
|
|
451
451
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_export_json.schema.json",
|
|
452
|
-
"sha256": "
|
|
452
|
+
"sha256": "a5d08d470d52c8deab61894ac28319339ae5a6d2c769280a24fa9c6d40579c3e"
|
|
453
453
|
},
|
|
454
454
|
"inputContract": {
|
|
455
455
|
"path": "office/contracts/xlsx_export_json.schema.json",
|
|
456
|
-
"sha256": "
|
|
456
|
+
"sha256": "a5d08d470d52c8deab61894ac28319339ae5a6d2c769280a24fa9c6d40579c3e"
|
|
457
457
|
}
|
|
458
458
|
},
|
|
459
459
|
{
|
|
460
460
|
"name": "xlsx_insert_rows",
|
|
461
461
|
"providerContract": {
|
|
462
462
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_insert_rows.schema.json",
|
|
463
|
-
"sha256": "
|
|
463
|
+
"sha256": "6667ff2ddada86e4bac3da7e1dfec99d107f80eed00bc1af4335c95e3e2ebe29"
|
|
464
464
|
},
|
|
465
465
|
"inputContract": {
|
|
466
466
|
"path": "office/contracts/xlsx_insert_rows.schema.json",
|
|
467
|
-
"sha256": "
|
|
467
|
+
"sha256": "6667ff2ddada86e4bac3da7e1dfec99d107f80eed00bc1af4335c95e3e2ebe29"
|
|
468
468
|
}
|
|
469
469
|
},
|
|
470
470
|
{
|
|
471
471
|
"name": "xlsx_inspect",
|
|
472
472
|
"providerContract": {
|
|
473
473
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_inspect.schema.json",
|
|
474
|
-
"sha256": "
|
|
474
|
+
"sha256": "f1c15dc66eafe6208a30a711c76c4e058c8b2a035707a4064e6a0a3b64687945"
|
|
475
475
|
},
|
|
476
476
|
"inputContract": {
|
|
477
477
|
"path": "office/contracts/xlsx_inspect.schema.json",
|
|
478
|
-
"sha256": "
|
|
478
|
+
"sha256": "f1c15dc66eafe6208a30a711c76c4e058c8b2a035707a4064e6a0a3b64687945"
|
|
479
479
|
}
|
|
480
480
|
},
|
|
481
481
|
{
|
|
482
482
|
"name": "xlsx_read_range",
|
|
483
483
|
"providerContract": {
|
|
484
484
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_read_range.schema.json",
|
|
485
|
-
"sha256": "
|
|
485
|
+
"sha256": "a4c489e1e695347bc853a9113f330d14a8256ae56b056936147fe510d0a48a82"
|
|
486
486
|
},
|
|
487
487
|
"inputContract": {
|
|
488
488
|
"path": "office/contracts/xlsx_read_range.schema.json",
|
|
489
|
-
"sha256": "
|
|
489
|
+
"sha256": "a4c489e1e695347bc853a9113f330d14a8256ae56b056936147fe510d0a48a82"
|
|
490
490
|
}
|
|
491
491
|
},
|
|
492
492
|
{
|
|
493
493
|
"name": "xlsx_set_cell_number_format",
|
|
494
494
|
"providerContract": {
|
|
495
495
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_cell_number_format.schema.json",
|
|
496
|
-
"sha256": "
|
|
496
|
+
"sha256": "5e250e4de4b287f0f3963e9c00218095bcb36ac3966334fab1af0d418a92c1c0"
|
|
497
497
|
},
|
|
498
498
|
"inputContract": {
|
|
499
499
|
"path": "office/contracts/xlsx_set_cell_number_format.schema.json",
|
|
500
|
-
"sha256": "
|
|
500
|
+
"sha256": "5e250e4de4b287f0f3963e9c00218095bcb36ac3966334fab1af0d418a92c1c0"
|
|
501
501
|
}
|
|
502
502
|
},
|
|
503
503
|
{
|
|
504
504
|
"name": "xlsx_set_cell_value",
|
|
505
505
|
"providerContract": {
|
|
506
506
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_cell_value.schema.json",
|
|
507
|
-
"sha256": "
|
|
507
|
+
"sha256": "b781ff899a8690ee9f1d487885fa7354071940f7f62afe22c9235a07ff8d277d"
|
|
508
508
|
},
|
|
509
509
|
"inputContract": {
|
|
510
510
|
"path": "office/contracts/xlsx_set_cell_value.schema.json",
|
|
511
|
-
"sha256": "
|
|
511
|
+
"sha256": "b781ff899a8690ee9f1d487885fa7354071940f7f62afe22c9235a07ff8d277d"
|
|
512
512
|
}
|
|
513
513
|
},
|
|
514
514
|
{
|
|
515
515
|
"name": "xlsx_set_column_width",
|
|
516
516
|
"providerContract": {
|
|
517
517
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_column_width.schema.json",
|
|
518
|
-
"sha256": "
|
|
518
|
+
"sha256": "6fbc2b7db11436369ef94f04860bc83fd0ca19025728e59f781f83ce4afa10ae"
|
|
519
519
|
},
|
|
520
520
|
"inputContract": {
|
|
521
521
|
"path": "office/contracts/xlsx_set_column_width.schema.json",
|
|
522
|
-
"sha256": "
|
|
522
|
+
"sha256": "6fbc2b7db11436369ef94f04860bc83fd0ca19025728e59f781f83ce4afa10ae"
|
|
523
523
|
}
|
|
524
524
|
},
|
|
525
525
|
{
|
|
526
526
|
"name": "xlsx_set_page_setup",
|
|
527
527
|
"providerContract": {
|
|
528
528
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_page_setup.schema.json",
|
|
529
|
-
"sha256": "
|
|
529
|
+
"sha256": "caad609ad9375cd8ca45172b2e7672195128957330aeabc2575b10777e1ceeac"
|
|
530
530
|
},
|
|
531
531
|
"inputContract": {
|
|
532
532
|
"path": "office/contracts/xlsx_set_page_setup.schema.json",
|
|
533
|
-
"sha256": "
|
|
533
|
+
"sha256": "caad609ad9375cd8ca45172b2e7672195128957330aeabc2575b10777e1ceeac"
|
|
534
534
|
}
|
|
535
535
|
},
|
|
536
536
|
{
|
|
537
537
|
"name": "xlsx_set_print_area",
|
|
538
538
|
"providerContract": {
|
|
539
539
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_print_area.schema.json",
|
|
540
|
-
"sha256": "
|
|
540
|
+
"sha256": "e5b4b96f107850f23bda595a7c439ba1c1af89f43ffca1769da07b49391d4611"
|
|
541
541
|
},
|
|
542
542
|
"inputContract": {
|
|
543
543
|
"path": "office/contracts/xlsx_set_print_area.schema.json",
|
|
544
|
-
"sha256": "
|
|
544
|
+
"sha256": "e5b4b96f107850f23bda595a7c439ba1c1af89f43ffca1769da07b49391d4611"
|
|
545
545
|
}
|
|
546
546
|
},
|
|
547
547
|
{
|
|
548
548
|
"name": "xlsx_set_range_values",
|
|
549
549
|
"providerContract": {
|
|
550
550
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_range_values.schema.json",
|
|
551
|
-
"sha256": "
|
|
551
|
+
"sha256": "62643e69fe16fc6d1a498d14e3f2fb07897491a0951278c474843994b79b0df3"
|
|
552
552
|
},
|
|
553
553
|
"inputContract": {
|
|
554
554
|
"path": "office/contracts/xlsx_set_range_values.schema.json",
|
|
555
|
-
"sha256": "
|
|
555
|
+
"sha256": "62643e69fe16fc6d1a498d14e3f2fb07897491a0951278c474843994b79b0df3"
|
|
556
556
|
}
|
|
557
557
|
},
|
|
558
558
|
{
|
|
559
559
|
"name": "xlsx_set_rich_text_cell_value",
|
|
560
560
|
"providerContract": {
|
|
561
561
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_rich_text_cell_value.schema.json",
|
|
562
|
-
"sha256": "
|
|
562
|
+
"sha256": "5ec57876cda3217979d77ba9304383002830931996dd0a361a4a69147896a145"
|
|
563
563
|
},
|
|
564
564
|
"inputContract": {
|
|
565
565
|
"path": "office/contracts/xlsx_set_rich_text_cell_value.schema.json",
|
|
566
|
-
"sha256": "
|
|
566
|
+
"sha256": "5ec57876cda3217979d77ba9304383002830931996dd0a361a4a69147896a145"
|
|
567
567
|
}
|
|
568
568
|
},
|
|
569
569
|
{
|
|
570
570
|
"name": "xlsx_set_row_page_breaks",
|
|
571
571
|
"providerContract": {
|
|
572
572
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_set_row_page_breaks.schema.json",
|
|
573
|
-
"sha256": "
|
|
573
|
+
"sha256": "f912774c49e48dd797169907e72de56696fb91c5b2a9108ab16334339a0b98e6"
|
|
574
574
|
},
|
|
575
575
|
"inputContract": {
|
|
576
576
|
"path": "office/contracts/xlsx_set_row_page_breaks.schema.json",
|
|
577
|
-
"sha256": "
|
|
577
|
+
"sha256": "f912774c49e48dd797169907e72de56696fb91c5b2a9108ab16334339a0b98e6"
|
|
578
578
|
}
|
|
579
579
|
},
|
|
580
580
|
{
|
|
581
581
|
"name": "xlsx_validate",
|
|
582
582
|
"providerContract": {
|
|
583
583
|
"source": "packages/xlsx-cli/contracts/mcp-input/xlsx_validate.schema.json",
|
|
584
|
-
"sha256": "
|
|
584
|
+
"sha256": "3844ee1273cd434814fb3e8eb2d4b7098342641a9ac6a6cefb35b06b67fd58ca"
|
|
585
585
|
},
|
|
586
586
|
"inputContract": {
|
|
587
587
|
"path": "office/contracts/xlsx_validate.schema.json",
|
|
588
|
-
"sha256": "
|
|
588
|
+
"sha256": "3844ee1273cd434814fb3e8eb2d4b7098342641a9ac6a6cefb35b06b67fd58ca"
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
]
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS]$",
|
|
8
9
|
"x-tiwater-file-role": "read"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"x-tiwater-file-role": "write"
|
|
14
16
|
},
|
|
15
17
|
"receiptOutput": {
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
"input": {
|
|
6
6
|
"type": "string",
|
|
7
7
|
"minLength": 1,
|
|
8
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
8
9
|
"x-tiwater-file-role": "read", "x-tiwater-document-revision-role": "current"
|
|
9
10
|
},
|
|
10
11
|
"output": {
|
|
11
12
|
"type": "string",
|
|
12
13
|
"minLength": 1,
|
|
14
|
+
"pattern": "\\.[xX][lL][sS][xX]$",
|
|
13
15
|
"description": "Output document path; may equal input for an atomic in-place update.",
|
|
14
16
|
"x-tiwater-file-role": "write"
|
|
15
17
|
},
|
package/office/index.mjs
CHANGED
|
@@ -488,7 +488,7 @@ const docxTableReadOutput = docxObservationOutput('docx_read_table').extend({
|
|
|
488
488
|
retainedRowCount: z.number().int().nonnegative(),
|
|
489
489
|
returnedRowCount: z.number().int().nonnegative(),
|
|
490
490
|
remaining: z.number().int().nonnegative(),
|
|
491
|
-
|
|
491
|
+
nextOffset: z.number().int().nonnegative().nullable(),
|
|
492
492
|
detailPageRetained: z.boolean(),
|
|
493
493
|
narrowingRequired: z.boolean(),
|
|
494
494
|
}).strict(),
|
|
@@ -582,7 +582,7 @@ const tools = [
|
|
|
582
582
|
},
|
|
583
583
|
{
|
|
584
584
|
name: 'docx_read_table',
|
|
585
|
-
description: 'Read one explicit native DOCX table. Provide output to retain every remaining row with full paragraph and text-node detail. Set returnContent true to also receive the largest compact inline page within the response limit; these channels are independent and at least one is required. retainedRowCount counts artifact rows and returnedRowCount counts inline rows. When remaining is nonzero, continue
|
|
585
|
+
description: 'Read one explicit native DOCX table. Provide output to retain every remaining row with full paragraph and text-node detail. Set returnContent true to also receive the largest compact inline page within the response limit; these channels are independent and at least one is required. retainedRowCount counts artifact rows and returnedRowCount counts inline rows. When remaining is nonzero, continue from receipt.nextOffset only when a later row is needed. Match columns by gridColumnStart, not tc position. A vertical-merge restart owns one logical value; a continue cell points to verticalMergeOwner and does not repeat that value inline.',
|
|
586
586
|
inputSchema: inputContract('docx_read_table'),
|
|
587
587
|
outputSchema: docxTableReadOutput,
|
|
588
588
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -784,7 +784,7 @@ const tools = [
|
|
|
784
784
|
},
|
|
785
785
|
{
|
|
786
786
|
name: 'xlsx_read_range',
|
|
787
|
-
description: 'Read one explicit native A1 cell or rectangular range from one current XLSX worksheet. The provider chooses the bounded page size. 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
|
|
787
|
+
description: 'Read one explicit native A1 cell or rectangular range from one current XLSX worksheet. The provider chooses the bounded page size. 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 largest leading cell page that 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.',
|
|
788
788
|
inputSchema: inputContract('xlsx_read_range'),
|
|
789
789
|
outputSchema: xlsxRangeReadOutput,
|
|
790
790
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
@@ -989,34 +989,6 @@ async function docxInspect(args) {
|
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
991
|
|
|
992
|
-
function encodeTableContinuation(input, table, offset) {
|
|
993
|
-
return Buffer.from(JSON.stringify({
|
|
994
|
-
schema: 'tiwater.docx-table-continuation/v1',
|
|
995
|
-
input,
|
|
996
|
-
table,
|
|
997
|
-
offset,
|
|
998
|
-
})).toString('base64url');
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
function decodeTableContinuation(continuation, input, table) {
|
|
1002
|
-
if (continuation === undefined) return 0;
|
|
1003
|
-
let decoded;
|
|
1004
|
-
try {
|
|
1005
|
-
decoded = JSON.parse(Buffer.from(continuation, 'base64url').toString('utf8'));
|
|
1006
|
-
} catch {
|
|
1007
|
-
throw new Error('invalid-docx-table-continuation');
|
|
1008
|
-
}
|
|
1009
|
-
if (decoded?.schema !== 'tiwater.docx-table-continuation/v1'
|
|
1010
|
-
|| decoded.input !== input
|
|
1011
|
-
|| decoded.table?.part !== table?.part
|
|
1012
|
-
|| decoded.table?.path !== table?.path
|
|
1013
|
-
|| !Number.isSafeInteger(decoded.offset)
|
|
1014
|
-
|| decoded.offset < 0) {
|
|
1015
|
-
throw new Error('invalid-docx-table-continuation');
|
|
1016
|
-
}
|
|
1017
|
-
return decoded.offset;
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
992
|
async function docxObservation(tool, args) {
|
|
1021
993
|
const input = path.resolve(requireString(args.input, 'input'));
|
|
1022
994
|
const delivery = resultChannels(args);
|
|
@@ -1111,7 +1083,7 @@ async function docxObservation(tool, args) {
|
|
|
1111
1083
|
}
|
|
1112
1084
|
if (tool === 'docx_read_table') {
|
|
1113
1085
|
const totalRowCount = payload.rows.length;
|
|
1114
|
-
const offset = Math.min(
|
|
1086
|
+
const offset = Math.min(args.offset ?? 0, totalRowCount);
|
|
1115
1087
|
const selectedRows = payload.rows.slice(offset);
|
|
1116
1088
|
const selectedNextOffset = offset + selectedRows.length < totalRowCount
|
|
1117
1089
|
? offset + selectedRows.length
|
|
@@ -1122,9 +1094,7 @@ async function docxObservation(tool, args) {
|
|
|
1122
1094
|
retainedRowCount: selectedRows.length,
|
|
1123
1095
|
returnedRowCount: selectedRows.length,
|
|
1124
1096
|
remaining: totalRowCount - offset - selectedRows.length,
|
|
1125
|
-
|
|
1126
|
-
nextContinuation: encodeTableContinuation(input, args.table, selectedNextOffset),
|
|
1127
|
-
}),
|
|
1097
|
+
nextOffset: selectedNextOffset,
|
|
1128
1098
|
};
|
|
1129
1099
|
const detailPage = {
|
|
1130
1100
|
schema: 'tiwater.docx-table-detail-page/v1',
|
|
@@ -1195,9 +1165,7 @@ async function docxObservation(tool, args) {
|
|
|
1195
1165
|
retainedRowCount,
|
|
1196
1166
|
returnedRowCount: rows.length,
|
|
1197
1167
|
remaining: totalRowCount - offset - rows.length,
|
|
1198
|
-
|
|
1199
|
-
nextContinuation: encodeTableContinuation(input, args.table, inlineNextOffset),
|
|
1200
|
-
}),
|
|
1168
|
+
nextOffset: inlineNextOffset,
|
|
1201
1169
|
};
|
|
1202
1170
|
return {
|
|
1203
1171
|
...withArtifact,
|
|
@@ -1520,17 +1488,52 @@ async function xlsxExportJson(args) {
|
|
|
1520
1488
|
return deliverLargeJsonResult({ tool: 'xlsx_export_json', args, runtime: commandRuntime(result), payload: result.json, sourcePaths: [input] });
|
|
1521
1489
|
}
|
|
1522
1490
|
|
|
1491
|
+
function xlsxRangeDeliveryPage(page, returnContent) {
|
|
1492
|
+
if (!returnContent || page.cells.length === 0) return page;
|
|
1493
|
+
const startOffset = page.receipt.totalCellCount
|
|
1494
|
+
- page.receipt.remaining
|
|
1495
|
+
- page.receipt.returnedCellCount;
|
|
1496
|
+
for (let count = page.cells.length; count > 0; count -= 1) {
|
|
1497
|
+
const remaining = page.receipt.totalCellCount - startOffset - count;
|
|
1498
|
+
const candidate = {
|
|
1499
|
+
...page,
|
|
1500
|
+
receipt: {
|
|
1501
|
+
...page.receipt,
|
|
1502
|
+
returnedCellCount: count,
|
|
1503
|
+
remaining,
|
|
1504
|
+
nextOffset: remaining > 0 ? startOffset + count : null,
|
|
1505
|
+
},
|
|
1506
|
+
cells: page.cells.slice(0, count),
|
|
1507
|
+
};
|
|
1508
|
+
if (Buffer.byteLength(JSON.stringify(candidate), 'utf8') <= returnedContentBudgetBytes) {
|
|
1509
|
+
return candidate;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
const remaining = page.receipt.totalCellCount - startOffset - 1;
|
|
1513
|
+
return {
|
|
1514
|
+
...page,
|
|
1515
|
+
receipt: {
|
|
1516
|
+
...page.receipt,
|
|
1517
|
+
returnedCellCount: 1,
|
|
1518
|
+
remaining,
|
|
1519
|
+
nextOffset: remaining > 0 ? startOffset + 1 : null,
|
|
1520
|
+
},
|
|
1521
|
+
cells: page.cells.slice(0, 1),
|
|
1522
|
+
};
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1523
1525
|
async function xlsxReadRange(args) {
|
|
1524
1526
|
const input = path.resolve(requireString(args.input, 'input'));
|
|
1525
1527
|
return withTempJsonFile(args, async requestPath => {
|
|
1526
1528
|
const result = await runJsonCandidateChain(xlsxCandidates, ['xlsx_read_range', requestPath]);
|
|
1529
|
+
const page = xlsxRangeDeliveryPage(result.json, args.returnContent === true);
|
|
1527
1530
|
return deliverLargeJsonResult({
|
|
1528
1531
|
tool: 'xlsx_read_range',
|
|
1529
1532
|
args,
|
|
1530
1533
|
runtime: commandRuntime(result),
|
|
1531
|
-
payload:
|
|
1534
|
+
payload: page,
|
|
1532
1535
|
sourcePaths: [input],
|
|
1533
|
-
summary:
|
|
1536
|
+
summary: page.receipt,
|
|
1534
1537
|
});
|
|
1535
1538
|
});
|
|
1536
1539
|
}
|
package/package.json
CHANGED