@raytio/mcp-server 9.4.0 → 10.1.0
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/contracts/persist/mcp_resource_contract.json +52 -23
- package/dist/authorization.d.ts.map +1 -1
- package/dist/authorization.js +2 -0
- package/dist/authorization.js.map +1 -1
- package/dist/tools/_shared/finance-idempotency.d.ts +1 -1
- package/dist/tools/_shared/finance-idempotency.js +1 -1
- package/dist/tools/_shared/side-effect.d.ts +25 -2
- package/dist/tools/_shared/side-effect.d.ts.map +1 -1
- package/dist/tools/_shared/side-effect.js +29 -4
- package/dist/tools/_shared/side-effect.js.map +1 -1
- package/dist/tools/bkm/bkm-adapter-configuration-update.d.ts +17 -0
- package/dist/tools/bkm/bkm-adapter-configuration-update.d.ts.map +1 -0
- package/dist/tools/bkm/bkm-adapter-configuration-update.js +79 -0
- package/dist/tools/bkm/bkm-adapter-configuration-update.js.map +1 -0
- package/dist/tools/bkm/bkm-availability-search-start.d.ts +20 -0
- package/dist/tools/bkm/bkm-availability-search-start.d.ts.map +1 -0
- package/dist/tools/bkm/bkm-availability-search-start.js +110 -0
- package/dist/tools/bkm/bkm-availability-search-start.js.map +1 -0
- package/dist/tools/bkm/bkm-provider-item-mapping-create.d.ts +15 -0
- package/dist/tools/bkm/bkm-provider-item-mapping-create.d.ts.map +1 -0
- package/dist/tools/bkm/bkm-provider-item-mapping-create.js +62 -0
- package/dist/tools/bkm/bkm-provider-item-mapping-create.js.map +1 -0
- package/dist/tools/bkm/generated-reads.d.ts +5 -0
- package/dist/tools/bkm/generated-reads.d.ts.map +1 -0
- package/dist/tools/bkm/generated-reads.js +33 -0
- package/dist/tools/bkm/generated-reads.js.map +1 -0
- package/dist/tools/bkm/index.d.ts +5 -0
- package/dist/tools/bkm/index.d.ts.map +1 -0
- package/dist/tools/bkm/index.js +13 -0
- package/dist/tools/bkm/index.js.map +1 -0
- package/dist/tools/dcm/dcm-device-command-dispatch.d.ts +28 -0
- package/dist/tools/dcm/dcm-device-command-dispatch.d.ts.map +1 -0
- package/dist/tools/dcm/dcm-device-command-dispatch.js +96 -0
- package/dist/tools/dcm/dcm-device-command-dispatch.js.map +1 -0
- package/dist/tools/dcm/dcm-device-register.d.ts +22 -0
- package/dist/tools/dcm/dcm-device-register.d.ts.map +1 -0
- package/dist/tools/dcm/dcm-device-register.js +86 -0
- package/dist/tools/dcm/dcm-device-register.js.map +1 -0
- package/dist/tools/dcm/dcm-device-slot-configure.d.ts +13 -0
- package/dist/tools/dcm/dcm-device-slot-configure.d.ts.map +1 -0
- package/dist/tools/dcm/dcm-device-slot-configure.js +68 -0
- package/dist/tools/dcm/dcm-device-slot-configure.js.map +1 -0
- package/dist/tools/dcm/dcm-device-update.d.ts +13 -0
- package/dist/tools/dcm/dcm-device-update.d.ts.map +1 -0
- package/dist/tools/dcm/dcm-device-update.js +55 -0
- package/dist/tools/dcm/dcm-device-update.js.map +1 -0
- package/dist/tools/dcm/generated-reads.d.ts +5 -0
- package/dist/tools/dcm/generated-reads.d.ts.map +1 -0
- package/dist/tools/dcm/generated-reads.js +30 -0
- package/dist/tools/dcm/generated-reads.js.map +1 -0
- package/dist/tools/dcm/index.d.ts +5 -0
- package/dist/tools/dcm/index.d.ts.map +1 -0
- package/dist/tools/dcm/index.js +15 -0
- package/dist/tools/dcm/index.js.map +1 -0
- package/dist/tools/domains.d.ts.map +1 -1
- package/dist/tools/domains.js +18 -0
- package/dist/tools/domains.js.map +1 -1
- package/dist/tools/far/far-cash-receipt-record.d.ts +5 -10
- package/dist/tools/far/far-cash-receipt-record.d.ts.map +1 -1
- package/dist/tools/far/far-cash-receipt-record.js +6 -11
- package/dist/tools/far/far-cash-receipt-record.js.map +1 -1
- package/dist/tools/role-mapping.d.ts.map +1 -1
- package/dist/tools/role-mapping.js +12 -0
- package/dist/tools/role-mapping.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"content_hash": "
|
|
3
|
-
"contract_version": "2.1.
|
|
2
|
+
"content_hash": "ddc1fbc0185f712084c0c5414ffa61a9e1941c43bece701334115361acc61399",
|
|
3
|
+
"contract_version": "2.1.2",
|
|
4
4
|
"excluded": [
|
|
5
5
|
{
|
|
6
6
|
"detail": "Stores authentication credentials, secrets, or certificates.",
|
|
@@ -18363,6 +18363,7 @@
|
|
|
18363
18363
|
"title_plural": "Payment Schedules"
|
|
18364
18364
|
},
|
|
18365
18365
|
{
|
|
18366
|
+
"authorization_model": "rebac",
|
|
18366
18367
|
"description": null,
|
|
18367
18368
|
"fields": [
|
|
18368
18369
|
{
|
|
@@ -18548,7 +18549,7 @@
|
|
|
18548
18549
|
"UPDATE"
|
|
18549
18550
|
],
|
|
18550
18551
|
"resource_group": "FAP",
|
|
18551
|
-
"resource_name":
|
|
18552
|
+
"resource_name": null
|
|
18552
18553
|
},
|
|
18553
18554
|
"primary_key": "id",
|
|
18554
18555
|
"public_endpoint": "/fap_supplier_site_uses",
|
|
@@ -19426,6 +19427,7 @@
|
|
|
19426
19427
|
"title_plural": "Supplier Invoices"
|
|
19427
19428
|
},
|
|
19428
19429
|
{
|
|
19430
|
+
"authorization_model": "rebac",
|
|
19429
19431
|
"description": null,
|
|
19430
19432
|
"fields": [
|
|
19431
19433
|
{
|
|
@@ -19689,7 +19691,7 @@
|
|
|
19689
19691
|
"UPDATE"
|
|
19690
19692
|
],
|
|
19691
19693
|
"resource_group": "FAP",
|
|
19692
|
-
"resource_name":
|
|
19694
|
+
"resource_name": null
|
|
19693
19695
|
},
|
|
19694
19696
|
"primary_key": "id",
|
|
19695
19697
|
"public_endpoint": "/fap_supplier_transaction_lines",
|
|
@@ -21301,6 +21303,15 @@
|
|
|
21301
21303
|
{
|
|
21302
21304
|
"description": "Cash receipts table: Used to store payment/receipt information from customers",
|
|
21303
21305
|
"fields": [
|
|
21306
|
+
{
|
|
21307
|
+
"name": "accounting_origin",
|
|
21308
|
+
"read_only": true,
|
|
21309
|
+
"required": false,
|
|
21310
|
+
"type": [
|
|
21311
|
+
"null",
|
|
21312
|
+
"string"
|
|
21313
|
+
]
|
|
21314
|
+
},
|
|
21304
21315
|
{
|
|
21305
21316
|
"description": "Audit: User who created this record",
|
|
21306
21317
|
"format": "uuid",
|
|
@@ -21421,6 +21432,16 @@
|
|
|
21421
21432
|
"string"
|
|
21422
21433
|
]
|
|
21423
21434
|
},
|
|
21435
|
+
{
|
|
21436
|
+
"format": "uuid",
|
|
21437
|
+
"name": "import_run_id",
|
|
21438
|
+
"read_only": true,
|
|
21439
|
+
"required": false,
|
|
21440
|
+
"type": [
|
|
21441
|
+
"null",
|
|
21442
|
+
"string"
|
|
21443
|
+
]
|
|
21444
|
+
},
|
|
21424
21445
|
{
|
|
21425
21446
|
"description": "Additional unstructured data stored as JSON",
|
|
21426
21447
|
"name": "metadata",
|
|
@@ -21464,9 +21485,9 @@
|
|
|
21464
21485
|
]
|
|
21465
21486
|
},
|
|
21466
21487
|
{
|
|
21467
|
-
"description": "The
|
|
21468
|
-
"maxLength":
|
|
21469
|
-
"name": "
|
|
21488
|
+
"description": "The identifier of the receipt",
|
|
21489
|
+
"maxLength": 30,
|
|
21490
|
+
"name": "receipt_code",
|
|
21470
21491
|
"read_only": false,
|
|
21471
21492
|
"required": true,
|
|
21472
21493
|
"type": [
|
|
@@ -21475,9 +21496,9 @@
|
|
|
21475
21496
|
]
|
|
21476
21497
|
},
|
|
21477
21498
|
{
|
|
21478
|
-
"description": "The
|
|
21479
|
-
"
|
|
21480
|
-
"name": "
|
|
21499
|
+
"description": "The currency code of the receipt",
|
|
21500
|
+
"maxLength": 3,
|
|
21501
|
+
"name": "receipt_currency_code",
|
|
21481
21502
|
"read_only": false,
|
|
21482
21503
|
"required": true,
|
|
21483
21504
|
"type": [
|
|
@@ -21486,11 +21507,11 @@
|
|
|
21486
21507
|
]
|
|
21487
21508
|
},
|
|
21488
21509
|
{
|
|
21489
|
-
"description": "The
|
|
21490
|
-
"
|
|
21491
|
-
"name": "
|
|
21510
|
+
"description": "The date on which the receipt was received",
|
|
21511
|
+
"format": "date",
|
|
21512
|
+
"name": "receipt_date",
|
|
21492
21513
|
"read_only": false,
|
|
21493
|
-
"required":
|
|
21514
|
+
"required": true,
|
|
21494
21515
|
"type": [
|
|
21495
21516
|
"null",
|
|
21496
21517
|
"string"
|
|
@@ -21630,6 +21651,7 @@
|
|
|
21630
21651
|
],
|
|
21631
21652
|
"filter_capabilities": {
|
|
21632
21653
|
"filterable_fields": [
|
|
21654
|
+
"accounting_origin",
|
|
21633
21655
|
"created_by",
|
|
21634
21656
|
"created_date",
|
|
21635
21657
|
"customer_bank_account_id",
|
|
@@ -21641,12 +21663,13 @@
|
|
|
21641
21663
|
"exchange_rate",
|
|
21642
21664
|
"exchange_rate_type",
|
|
21643
21665
|
"id",
|
|
21666
|
+
"import_run_id",
|
|
21644
21667
|
"org_id",
|
|
21645
21668
|
"owned_by",
|
|
21646
21669
|
"receipt_amount",
|
|
21670
|
+
"receipt_code",
|
|
21647
21671
|
"receipt_currency_code",
|
|
21648
21672
|
"receipt_date",
|
|
21649
|
-
"receipt_number",
|
|
21650
21673
|
"receipt_status",
|
|
21651
21674
|
"receipt_type",
|
|
21652
21675
|
"remittance_bank_account_use_id",
|
|
@@ -21691,6 +21714,7 @@
|
|
|
21691
21714
|
],
|
|
21692
21715
|
"order_capabilities": {
|
|
21693
21716
|
"orderable_fields": [
|
|
21717
|
+
"accounting_origin",
|
|
21694
21718
|
"created_by",
|
|
21695
21719
|
"created_date",
|
|
21696
21720
|
"customer_bank_account_id",
|
|
@@ -21702,12 +21726,13 @@
|
|
|
21702
21726
|
"exchange_rate",
|
|
21703
21727
|
"exchange_rate_type",
|
|
21704
21728
|
"id",
|
|
21729
|
+
"import_run_id",
|
|
21705
21730
|
"org_id",
|
|
21706
21731
|
"owned_by",
|
|
21707
21732
|
"receipt_amount",
|
|
21733
|
+
"receipt_code",
|
|
21708
21734
|
"receipt_currency_code",
|
|
21709
21735
|
"receipt_date",
|
|
21710
|
-
"receipt_number",
|
|
21711
21736
|
"receipt_status",
|
|
21712
21737
|
"receipt_type",
|
|
21713
21738
|
"remittance_bank_account_use_id",
|
|
@@ -22285,6 +22310,7 @@
|
|
|
22285
22310
|
"title_plural": null
|
|
22286
22311
|
},
|
|
22287
22312
|
{
|
|
22313
|
+
"authorization_model": "rebac",
|
|
22288
22314
|
"description": "Customer site uses table: Used to store the uses of a customer site e.g. bill-to, ship-to etc",
|
|
22289
22315
|
"fields": [
|
|
22290
22316
|
{
|
|
@@ -22508,7 +22534,7 @@
|
|
|
22508
22534
|
"UPDATE"
|
|
22509
22535
|
],
|
|
22510
22536
|
"resource_group": "FAR",
|
|
22511
|
-
"resource_name":
|
|
22537
|
+
"resource_name": null
|
|
22512
22538
|
},
|
|
22513
22539
|
"primary_key": "id",
|
|
22514
22540
|
"public_endpoint": "/far_customer_site_uses",
|
|
@@ -23611,6 +23637,7 @@
|
|
|
23611
23637
|
"title_plural": "Invoices"
|
|
23612
23638
|
},
|
|
23613
23639
|
{
|
|
23640
|
+
"authorization_model": "rebac",
|
|
23614
23641
|
"description": null,
|
|
23615
23642
|
"fields": [
|
|
23616
23643
|
{
|
|
@@ -23874,7 +23901,7 @@
|
|
|
23874
23901
|
"UPDATE"
|
|
23875
23902
|
],
|
|
23876
23903
|
"resource_group": "FAR",
|
|
23877
|
-
"resource_name":
|
|
23904
|
+
"resource_name": null
|
|
23878
23905
|
},
|
|
23879
23906
|
"primary_key": "id",
|
|
23880
23907
|
"public_endpoint": "/far_customer_transaction_lines",
|
|
@@ -26368,6 +26395,7 @@
|
|
|
26368
26395
|
"title_plural": null
|
|
26369
26396
|
},
|
|
26370
26397
|
{
|
|
26398
|
+
"authorization_model": "rebac",
|
|
26371
26399
|
"description": "Payment term lines table: Used to store customer payment term line details",
|
|
26372
26400
|
"fields": [
|
|
26373
26401
|
{
|
|
@@ -26586,7 +26614,7 @@
|
|
|
26586
26614
|
"UPDATE"
|
|
26587
26615
|
],
|
|
26588
26616
|
"resource_group": "FAR",
|
|
26589
|
-
"resource_name":
|
|
26617
|
+
"resource_name": null
|
|
26590
26618
|
},
|
|
26591
26619
|
"primary_key": "id",
|
|
26592
26620
|
"public_endpoint": "/far_payment_term_lines",
|
|
@@ -26623,6 +26651,7 @@
|
|
|
26623
26651
|
"title_plural": "Payment Term Lines"
|
|
26624
26652
|
},
|
|
26625
26653
|
{
|
|
26654
|
+
"authorization_model": "rebac",
|
|
26626
26655
|
"description": "Payment terms table: Used to store customer payment terms header details",
|
|
26627
26656
|
"fields": [
|
|
26628
26657
|
{
|
|
@@ -26800,7 +26829,7 @@
|
|
|
26800
26829
|
"UPDATE"
|
|
26801
26830
|
],
|
|
26802
26831
|
"resource_group": "FAR",
|
|
26803
|
-
"resource_name":
|
|
26832
|
+
"resource_name": null
|
|
26804
26833
|
},
|
|
26805
26834
|
"primary_key": "id",
|
|
26806
26835
|
"public_endpoint": "/far_payment_terms",
|
|
@@ -43760,7 +43789,7 @@
|
|
|
43760
43789
|
"resource_id": "fxm_funds_account_transactions",
|
|
43761
43790
|
"schema_name": "ss_fxm_funds_account_transaction",
|
|
43762
43791
|
"schema_version": "0.0.7",
|
|
43763
|
-
"sensitivity": "
|
|
43792
|
+
"sensitivity": "sensitive",
|
|
43764
43793
|
"side_effects": [],
|
|
43765
43794
|
"table": "fxm_funds_account_transactions",
|
|
43766
43795
|
"title": "Funds Account Transaction",
|
|
@@ -44310,7 +44339,7 @@
|
|
|
44310
44339
|
"resource_id": "fxm_funds_account_transactions_anon",
|
|
44311
44340
|
"schema_name": null,
|
|
44312
44341
|
"schema_version": null,
|
|
44313
|
-
"sensitivity": "
|
|
44342
|
+
"sensitivity": "sensitive",
|
|
44314
44343
|
"side_effects": [],
|
|
44315
44344
|
"table": "fxm_funds_account_transactions_anon",
|
|
44316
44345
|
"title": null,
|
|
@@ -44728,7 +44757,7 @@
|
|
|
44728
44757
|
"resource_id": "fxm_funds_accounts",
|
|
44729
44758
|
"schema_name": "ss_fxm_funds_account",
|
|
44730
44759
|
"schema_version": "0.0.7",
|
|
44731
|
-
"sensitivity": "
|
|
44760
|
+
"sensitivity": "sensitive",
|
|
44732
44761
|
"side_effects": [],
|
|
44733
44762
|
"table": "fxm_funds_accounts",
|
|
44734
44763
|
"title": "Funds Account",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../src/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EAEzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,mHAAmH;IACnH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,yFAAyF;IACzF,MAAM,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC;CACzC;AAED,KAAK,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../src/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EAEzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,mHAAmH;IACnH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,yFAAyF;IACzF,MAAM,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC;CACzC;AAED,KAAK,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAwD3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,MAAM,GAAE,YAAsB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CAqE9B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,YAAY,EAAE,wBAAwB,EACtC,MAAM,GAAE,YAAsB,GAC7B,IAAI,EAAE,CA8BR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,GAAE,YAAsB,GAC7B,IAAI,EAAE,CAkBR"}
|
package/dist/authorization.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../src/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAExB,0BAA0B,GAC3B,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAwB7D;;;;;GAKG;AACH,MAAM,gBAAgB,GAA2B;IAC/C,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF,SAAS,SAAS,CAAC,IAA+B;IAChD,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,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AM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,KAAK,CACV,0CAA0C,WAAW,CAAC,MAAM,wCAAwC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7H,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { z } from 'zod';
|
|
|
9
9
|
* production incident. We express this two ways:
|
|
10
10
|
*
|
|
11
11
|
* - Tools that have a natural key (a unique index such as
|
|
12
|
-
* organisation + transaction_code, organisation +
|
|
12
|
+
* organisation + transaction_code, organisation + receipt_code,
|
|
13
13
|
* open hold per bill + hold_code) require it, document it in the
|
|
14
14
|
* tool description, and inherit `idempotency: 'natural_key'`. A
|
|
15
15
|
* retry then fails with a duplicate-key error instead of creating
|
|
@@ -9,7 +9,7 @@ import { z } from 'zod';
|
|
|
9
9
|
* production incident. We express this two ways:
|
|
10
10
|
*
|
|
11
11
|
* - Tools that have a natural key (a unique index such as
|
|
12
|
-
* organisation + transaction_code, organisation +
|
|
12
|
+
* organisation + transaction_code, organisation + receipt_code,
|
|
13
13
|
* open hold per bill + hold_code) require it, document it in the
|
|
14
14
|
* tool description, and inherit `idempotency: 'natural_key'`. A
|
|
15
15
|
* retry then fails with a duplicate-key error instead of creating
|
|
@@ -10,17 +10,29 @@ import { z } from 'zod';
|
|
|
10
10
|
* - `confirm: true` on consequential paths so a model cannot invoke
|
|
11
11
|
* them accidentally;
|
|
12
12
|
* - a caller-supplied `reason` on state transitions that leave an
|
|
13
|
-
* audit trail (revoke, unassign, deactivate, cancel);
|
|
13
|
+
* audit trail (release, revoke, unassign, deactivate, cancel);
|
|
14
14
|
* - an optional `idempotency_key` forwarded as an `Idempotency-Key`
|
|
15
15
|
* header so retries converge on the original result rather than
|
|
16
|
-
* creating a duplicate row / grant / message
|
|
16
|
+
* creating a duplicate row / grant / message / command / mapping /
|
|
17
|
+
* device row.
|
|
17
18
|
*
|
|
18
19
|
* The MCP server does not maintain its own dedupe cache — the
|
|
19
20
|
* canonical answer lives in Persist. This module keeps the input
|
|
20
21
|
* schema and header-injection logic in one place so every write path
|
|
21
22
|
* surfaces the same contract.
|
|
22
23
|
*/
|
|
24
|
+
/**
|
|
25
|
+
* Zod schema for the optional idempotency key input. Keeps the shape
|
|
26
|
+
* consistent so callers passing the same key across tools do not need
|
|
27
|
+
* to remember tool-specific spellings.
|
|
28
|
+
*/
|
|
23
29
|
export declare const idempotencyKeySchema: z.ZodOptional<z.ZodString>;
|
|
30
|
+
/**
|
|
31
|
+
* The same input, described accurately: Persist (PostgREST) ignores the
|
|
32
|
+
* `Idempotency-Key` header (WI-0008817), so a key alone does not make a
|
|
33
|
+
* retry safe. Use this on tools where that matters to the caller.
|
|
34
|
+
*/
|
|
35
|
+
export declare const unenforcedIdempotencyKeySchema: z.ZodOptional<z.ZodString>;
|
|
24
36
|
/**
|
|
25
37
|
* Build the request headers for a side-effecting mutation. Passes
|
|
26
38
|
* through `Prefer: return=representation` (needed for PostgREST to
|
|
@@ -28,6 +40,17 @@ export declare const idempotencyKeySchema: z.ZodOptional<z.ZodString>;
|
|
|
28
40
|
* supplied.
|
|
29
41
|
*/
|
|
30
42
|
export declare function writeHeadersWithIdempotency(idempotencyKey: string | undefined): Record<string, string>;
|
|
43
|
+
/**
|
|
44
|
+
* Zod schema for a caller-supplied confirmation flag. Used on
|
|
45
|
+
* consequential actions (message send, provisioning, external sync,
|
|
46
|
+
* permission grant) where an explicit `confirm: true` is required in
|
|
47
|
+
* addition to the required business inputs.
|
|
48
|
+
*/
|
|
31
49
|
export declare const confirmFlagSchema: z.ZodLiteral<true>;
|
|
50
|
+
/**
|
|
51
|
+
* Zod schema for a caller-supplied reason string. Used on lifecycle
|
|
52
|
+
* transitions and side-effect invocations so the audit log carries a
|
|
53
|
+
* human-readable justification.
|
|
54
|
+
*/
|
|
32
55
|
export declare const reasonSchema: z.ZodString;
|
|
33
56
|
//# sourceMappingURL=side-effect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-effect.d.ts","sourceRoot":"","sources":["../../../src/tools/_shared/side-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB
|
|
1
|
+
{"version":3,"file":"side-effect.d.ts","sourceRoot":"","sources":["../../../src/tools/_shared/side-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,4BAa9B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,4BAG1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,oBAa3B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,YAAY,aAG2B,CAAC"}
|
|
@@ -10,16 +10,22 @@ import { z } from 'zod';
|
|
|
10
10
|
* - `confirm: true` on consequential paths so a model cannot invoke
|
|
11
11
|
* them accidentally;
|
|
12
12
|
* - a caller-supplied `reason` on state transitions that leave an
|
|
13
|
-
* audit trail (revoke, unassign, deactivate, cancel);
|
|
13
|
+
* audit trail (release, revoke, unassign, deactivate, cancel);
|
|
14
14
|
* - an optional `idempotency_key` forwarded as an `Idempotency-Key`
|
|
15
15
|
* header so retries converge on the original result rather than
|
|
16
|
-
* creating a duplicate row / grant / message
|
|
16
|
+
* creating a duplicate row / grant / message / command / mapping /
|
|
17
|
+
* device row.
|
|
17
18
|
*
|
|
18
19
|
* The MCP server does not maintain its own dedupe cache — the
|
|
19
20
|
* canonical answer lives in Persist. This module keeps the input
|
|
20
21
|
* schema and header-injection logic in one place so every write path
|
|
21
22
|
* surfaces the same contract.
|
|
22
23
|
*/
|
|
24
|
+
/**
|
|
25
|
+
* Zod schema for the optional idempotency key input. Keeps the shape
|
|
26
|
+
* consistent so callers passing the same key across tools do not need
|
|
27
|
+
* to remember tool-specific spellings.
|
|
28
|
+
*/
|
|
23
29
|
export const idempotencyKeySchema = z
|
|
24
30
|
.string()
|
|
25
31
|
.min(8)
|
|
@@ -29,6 +35,13 @@ export const idempotencyKeySchema = z
|
|
|
29
35
|
.describe('Optional caller-supplied idempotency key. Reusing the same key with equivalent ' +
|
|
30
36
|
'inputs converges to the original result rather than creating a duplicate. ' +
|
|
31
37
|
'Must be a URL-safe token of 8–128 characters.');
|
|
38
|
+
/**
|
|
39
|
+
* The same input, described accurately: Persist (PostgREST) ignores the
|
|
40
|
+
* `Idempotency-Key` header (WI-0008817), so a key alone does not make a
|
|
41
|
+
* retry safe. Use this on tools where that matters to the caller.
|
|
42
|
+
*/
|
|
43
|
+
export const unenforcedIdempotencyKeySchema = idempotencyKeySchema.describe('Optional. Forwarded as an Idempotency-Key header, but Persist does not enforce it yet, ' +
|
|
44
|
+
'so it does not make a retry safe.');
|
|
32
45
|
/**
|
|
33
46
|
* Build the request headers for a side-effecting mutation. Passes
|
|
34
47
|
* through `Prefer: return=representation` (needed for PostgREST to
|
|
@@ -44,6 +57,12 @@ export function writeHeadersWithIdempotency(idempotencyKey) {
|
|
|
44
57
|
}
|
|
45
58
|
return headers;
|
|
46
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Zod schema for a caller-supplied confirmation flag. Used on
|
|
62
|
+
* consequential actions (message send, provisioning, external sync,
|
|
63
|
+
* permission grant) where an explicit `confirm: true` is required in
|
|
64
|
+
* addition to the required business inputs.
|
|
65
|
+
*/
|
|
47
66
|
export const confirmFlagSchema = z
|
|
48
67
|
.literal(true, {
|
|
49
68
|
errorMap: () => ({
|
|
@@ -52,8 +71,14 @@ export const confirmFlagSchema = z
|
|
|
52
71
|
}),
|
|
53
72
|
})
|
|
54
73
|
.describe('Must be `true` to execute. Present so a model cannot accidentally grant a ' +
|
|
55
|
-
'permission, revoke a role, register a payment instrument,
|
|
56
|
-
'
|
|
74
|
+
'permission, revoke a role, register a payment instrument, transition a security ' +
|
|
75
|
+
'session, dispatch a command, register a device, or trigger an external sync ' +
|
|
76
|
+
'without an explicit confirmation step.');
|
|
77
|
+
/**
|
|
78
|
+
* Zod schema for a caller-supplied reason string. Used on lifecycle
|
|
79
|
+
* transitions and side-effect invocations so the audit log carries a
|
|
80
|
+
* human-readable justification.
|
|
81
|
+
*/
|
|
57
82
|
export const reasonSchema = z
|
|
58
83
|
.string()
|
|
59
84
|
.min(4, 'reason must be at least 4 characters')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-effect.js","sourceRoot":"","sources":["../../../src/tools/_shared/side-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB
|
|
1
|
+
{"version":3,"file":"side-effect.js","sourceRoot":"","sources":["../../../src/tools/_shared/side-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CACJ,qBAAqB,EACrB,qFAAqF,CACtF;KACA,QAAQ,EAAE;KACV,QAAQ,CACP,iFAAiF;IAC/E,4EAA4E;IAC5E,+CAA+C,CAClD,CAAC;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,oBAAoB,CAAC,QAAQ,CACzE,yFAAyF;IACvF,mCAAmC,CACtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,cAAkC;IAElC,MAAM,OAAO,GAA2B;QACtC,MAAM,EAAE,uBAAuB;KAChC,CAAC;IACF,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,CAAC,iBAAiB,CAAC,GAAG,cAAc,CAAC;IAC9C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,OAAO,CAAC,IAAI,EAAE;IACb,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;QACf,OAAO,EACL,oFAAoF;YAClF,6BAA6B;KAClC,CAAC;CACH,CAAC;KACD,QAAQ,CACP,4EAA4E;IAC1E,kFAAkF;IAClF,8EAA8E;IAC9E,wCAAwC,CAC3C,CAAC;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,EAAE,sCAAsC,CAAC;KAC9C,GAAG,CAAC,GAAG,EAAE,uCAAuC,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Explicit-schema update for `bkm_adapter_configurations` — connector
|
|
4
|
+
* settings for a third-party booking provider (target URL, schedule,
|
|
5
|
+
* adapter status). Connector credentials live in a separate table
|
|
6
|
+
* (`bkm_adapter_credentials` / provider-specific secret stores) that
|
|
7
|
+
* is EXCLUDED from the MCP surface by the credentials guardrail and
|
|
8
|
+
* are never touched by this tool.
|
|
9
|
+
*
|
|
10
|
+
* `last_sync_date` and `last_sync_status_code` are sync-path telemetry
|
|
11
|
+
* and are omitted from this update — they are set by the adapter
|
|
12
|
+
* itself, not by callers.
|
|
13
|
+
*
|
|
14
|
+
* Retry-safe (converges on the same target configuration).
|
|
15
|
+
*/
|
|
16
|
+
export declare const bkmAdapterConfigurationUpdateTool: Tool;
|
|
17
|
+
//# sourceMappingURL=bkm-adapter-configuration-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bkm-adapter-configuration-update.d.ts","sourceRoot":"","sources":["../../../src/tools/bkm/bkm-adapter-configuration-update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAQtC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iCAAiC,EAAE,IA2E/C,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { API_ERROR, errorResponse, successResponse } from '../types.js';
|
|
3
|
+
import { cap } from '../../capabilities/tool-capability.js';
|
|
4
|
+
import { unenforcedIdempotencyKeySchema, writeHeadersWithIdempotency, } from '../_shared/side-effect.js';
|
|
5
|
+
/**
|
|
6
|
+
* Explicit-schema update for `bkm_adapter_configurations` — connector
|
|
7
|
+
* settings for a third-party booking provider (target URL, schedule,
|
|
8
|
+
* adapter status). Connector credentials live in a separate table
|
|
9
|
+
* (`bkm_adapter_credentials` / provider-specific secret stores) that
|
|
10
|
+
* is EXCLUDED from the MCP surface by the credentials guardrail and
|
|
11
|
+
* are never touched by this tool.
|
|
12
|
+
*
|
|
13
|
+
* `last_sync_date` and `last_sync_status_code` are sync-path telemetry
|
|
14
|
+
* and are omitted from this update — they are set by the adapter
|
|
15
|
+
* itself, not by callers.
|
|
16
|
+
*
|
|
17
|
+
* Retry-safe (converges on the same target configuration).
|
|
18
|
+
*/
|
|
19
|
+
export const bkmAdapterConfigurationUpdateTool = {
|
|
20
|
+
name: 'bkm_adapter_configuration_update',
|
|
21
|
+
description: 'Update a BKM adapter configuration (bkm_adapter_configurations): target URL, scrape ' +
|
|
22
|
+
'schedule, status, and non-secret metadata. Credentials live in a separate credential ' +
|
|
23
|
+
'store and cannot be set from MCP. Retry-safe.',
|
|
24
|
+
inputSchema: z
|
|
25
|
+
.object({
|
|
26
|
+
id: z.string().min(1).describe('UUID of the adapter configuration row'),
|
|
27
|
+
adapter_status_code: z.string().max(32).optional(),
|
|
28
|
+
target_url: z
|
|
29
|
+
.string()
|
|
30
|
+
.url()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Provider endpoint URL the adapter connects to'),
|
|
33
|
+
scrape_schedule_cron: z
|
|
34
|
+
.string()
|
|
35
|
+
.max(64)
|
|
36
|
+
.nullable()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('Cron expression for scheduled scraping; null to disable schedule'),
|
|
39
|
+
browserbase_project_id: z.string().max(255).nullable().optional(),
|
|
40
|
+
configuration: z
|
|
41
|
+
.record(z.unknown())
|
|
42
|
+
.nullable()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Non-secret adapter configuration blob'),
|
|
45
|
+
metadata: z.record(z.unknown()).nullable().optional(),
|
|
46
|
+
idempotency_key: unenforcedIdempotencyKeySchema,
|
|
47
|
+
})
|
|
48
|
+
.refine((v) => v.adapter_status_code !== undefined ||
|
|
49
|
+
v.target_url !== undefined ||
|
|
50
|
+
v.scrape_schedule_cron !== undefined ||
|
|
51
|
+
v.browserbase_project_id !== undefined ||
|
|
52
|
+
v.configuration !== undefined ||
|
|
53
|
+
v.metadata !== undefined, {
|
|
54
|
+
message: 'supply at least one field to change.',
|
|
55
|
+
}),
|
|
56
|
+
capabilities: [cap('bkm_adapter_configurations', 'UPDATE')],
|
|
57
|
+
sideEffect: 'state_change',
|
|
58
|
+
confirmation: 'none',
|
|
59
|
+
idempotency: 'natural_key',
|
|
60
|
+
handler: async (args, ctx) => {
|
|
61
|
+
const { id, idempotency_key, ...rest } = args;
|
|
62
|
+
const body = {};
|
|
63
|
+
for (const [k, v] of Object.entries(rest)) {
|
|
64
|
+
if (v !== undefined)
|
|
65
|
+
body[k] = v;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const rows = await ctx.apiClient.patch(`${ctx.apiClient.dbBasePath}/bkm_adapter_configurations?id=eq.${id}&select=*`, body, { headers: writeHeadersWithIdempotency(idempotency_key) });
|
|
69
|
+
if (!rows || rows.length === 0) {
|
|
70
|
+
return errorResponse(API_ERROR, `BKM adapter configuration ${id} not found or not accessible`);
|
|
71
|
+
}
|
|
72
|
+
return successResponse(rows[0]);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
return errorResponse(API_ERROR, `Failed to update BKM adapter configuration: ${error.message}`);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=bkm-adapter-configuration-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bkm-adapter-configuration-update.js","sourceRoot":"","sources":["../../../src/tools/bkm/bkm-adapter-configuration-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAS;IACrD,IAAI,EAAE,kCAAkC;IACxC,WAAW,EACT,sFAAsF;QACtF,uFAAuF;QACvF,+CAA+C;IACjD,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACvE,mBAAmB,EAAE,CAA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AE,EAAE;QAC3B,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,IAGd,CAAC;QAC5B,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,KAAK,SAAS;gBAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,CACpC,GAAG,GAAG,CAAC,SAAS,CAAC,UAAU,qCAAqC,EAAE,WAAW,EAC7E,IAAI,EACJ,EAAE,OAAO,EAAE,2BAA2B,CAAC,eAAe,CAAC,EAAE,CAC1D,CAAC;YACF,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC/B,OAAO,aAAa,CAClB,SAAS,EACT,6BAA6B,EAAE,8BAA8B,CAC9D,CAAC;YACJ,CAAC;YACD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,aAAa,CAClB,SAAS,EACT,+CAA+C,KAAK,CAAC,OAAO,EAAE,CAC/D,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Tool } from '../registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* External-synchronisation semantic tool: start a real-time
|
|
4
|
+
* availability search (`bkm_availability_searches`). Kicks off
|
|
5
|
+
* concurrent fetches against every connected third-party booking
|
|
6
|
+
* provider, so the tool requires:
|
|
7
|
+
*
|
|
8
|
+
* - `confirm: true` to prevent accidental provider load;
|
|
9
|
+
* - a bounded search radius / time window.
|
|
10
|
+
*
|
|
11
|
+
* This tool is NOT retry-safe: nothing identifies a repeat call and
|
|
12
|
+
* Persist ignores `Idempotency-Key` (WI-0008817), so a retry starts a
|
|
13
|
+
* second wave of provider calls. The created row's `id` is the polling
|
|
14
|
+
* handle — callers use `bkm_availability_searches_get`
|
|
15
|
+
* to watch `status` and `providers_completed` transition to a
|
|
16
|
+
* terminal state, then list `bkm_availability_slots?search_id=eq.<id>`
|
|
17
|
+
* for the results.
|
|
18
|
+
*/
|
|
19
|
+
export declare const bkmAvailabilitySearchStartTool: Tool;
|
|
20
|
+
//# sourceMappingURL=bkm-availability-search-start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bkm-availability-search-start.d.ts","sourceRoot":"","sources":["../../../src/tools/bkm/bkm-availability-search-start.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,8BAA8B,EAAE,IA6F5C,CAAC"}
|