@tool-bridge/server 0.14.0 → 0.16.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.
Files changed (108) hide show
  1. package/dist/{airtable-NVGQVZJW.js → airtable-S3T4TAN7.js} +4 -4
  2. package/dist/{alt_text_generator_ai-WF7NHVWE.js → alt_text_generator_ai-4DIRIDKL.js} +4 -4
  3. package/dist/{amap-EPI7AQ4O.js → amap-LGVGNPML.js} +4 -4
  4. package/dist/{anthropic-KVYWBZIV.js → anthropic-27RFZO35.js} +4 -4
  5. package/dist/{apify-MB56RQIA.js → apify-6WLYAIAS.js} +4 -4
  6. package/dist/{brave_search-JDAGJ7PO.js → brave_search-K2SVJ66F.js} +4 -4
  7. package/dist/{chunk-HGIPJFHA.js → chunk-2O27H4Y2.js} +1 -1
  8. package/dist/{chunk-X6LLG5OZ.js → chunk-BB6ZLMTU.js} +1194 -120
  9. package/dist/{chunk-CDOWN2AB.js → chunk-GKX72JMJ.js} +1 -1
  10. package/dist/{chunk-BWGAV3MR.js → chunk-VK3V2WTY.js} +2 -2
  11. package/dist/{chunk-ABHHWYEV.js → chunk-YB2FLNWI.js} +1689 -39
  12. package/dist/{circleci-2IL5RU2O.js → circleci-WV3ITU7Q.js} +4 -4
  13. package/dist/{clerk-A5YYGWYM.js → clerk-NFQEFKS4.js} +4 -4
  14. package/dist/{cloudflare_dns-GUA5BUWO.js → cloudflare_dns-2RK5ASBJ.js} +4 -4
  15. package/dist/{cohere-BS27QMKR.js → cohere-5KEW7LWT.js} +4 -4
  16. package/dist/{confluence-675IWLHU.js → confluence-SZE63S46.js} +4 -4
  17. package/dist/{convertapi-DGKXP2T3.js → convertapi-QPG2JC5K.js} +4 -4
  18. package/dist/{currencyapi-PFH3UKVU.js → currencyapi-UO2APQRY.js} +4 -4
  19. package/dist/{deepseek-5U3STDGY.js → deepseek-LJELIMM3.js} +4 -4
  20. package/dist/{docker_hub-UVXRU2L3.js → docker_hub-2MFXSBOF.js} +4 -4
  21. package/dist/{dropbox-BC54XUXF.js → dropbox-GQYNTTVA.js} +4 -4
  22. package/dist/{dub-GV5M6PWD.js → dub-KI2LHXST.js} +4 -4
  23. package/dist/{e2b-KEQ3PYPV.js → e2b-WO6ISY3C.js} +4 -4
  24. package/dist/{exa-OGQR7D47.js → exa-IZ7B3BPT.js} +4 -4
  25. package/dist/{fal_ai-ULI6YF4O.js → fal_ai-LTMF36GJ.js} +4 -4
  26. package/dist/{feishu-YWLRRUGP.js → feishu-WM7SLSFD.js} +3 -3
  27. package/dist/{feishu_custom_bot-7HP4UHB7.js → feishu_custom_bot-66W3MXH2.js} +4 -4
  28. package/dist/{figma-BFGC24YI.js → figma-2Z274VQZ.js} +4 -4
  29. package/dist/{firehydrant-R6DG7SBL.js → firehydrant-IFI4R65V.js} +4 -4
  30. package/dist/{fixer-ZVXOVTMF.js → fixer-BCCZEB3D.js} +4 -4
  31. package/dist/{fly-EBKWMDWV.js → fly-755FXYB5.js} +4 -4
  32. package/dist/{front-CFWVIQYX.js → front-4FZKKXXK.js} +4 -4
  33. package/dist/{geocodio-N27RDBFV.js → geocodio-WYKDJ3DP.js} +4 -4
  34. package/dist/{ghost-2HT2SJYO.js → ghost-5BNQTCOH.js} +4 -4
  35. package/dist/{github-ZDLAIRXP.js → github-ULELF5VX.js} +4 -4
  36. package/dist/{gmail-TICKPP6S.js → gmail-G34WT64J.js} +4 -4
  37. package/dist/{googlecalendar-GUR47UTF.js → googlecalendar-BQU255SC.js} +4 -4
  38. package/dist/{googledocs-QGDIJA4S.js → googledocs-HPCNQXYJ.js} +4 -4
  39. package/dist/{grafana-33Y3WEU5.js → grafana-VOV24FIC.js} +4 -4
  40. package/dist/{graphhopper-KWTMYEVH.js → graphhopper-D5RXW6AP.js} +4 -4
  41. package/dist/index.d.ts +164 -61
  42. package/dist/index.js +2 -2
  43. package/dist/{ip2proxy-4SAYDJPQ.js → ip2proxy-DAYO7EKZ.js} +4 -4
  44. package/dist/{ipgeolocation_io-4WT2WKHF.js → ipgeolocation_io-XD4PSLII.js} +4 -4
  45. package/dist/{ipqualityscore-VGZCROJJ.js → ipqualityscore-K27QEAWK.js} +4 -4
  46. package/dist/{jina_ai-X5VJVORK.js → jina_ai-E6UXFV2P.js} +4 -4
  47. package/dist/{jira-XUAF2UPM.js → jira-ZDSXGQ6W.js} +4 -4
  48. package/dist/{langsmith-RRLFNL6D.js → langsmith-TIFJRREW.js} +4 -4
  49. package/dist/{lemlist-KQKG6JHM.js → lemlist-DASEMJMA.js} +4 -4
  50. package/dist/{linear-I32UBCBL.js → linear-KE6UP4SP.js} +4 -4
  51. package/dist/{logsnag-TVNUQEM7.js → logsnag-IMNDN4R5.js} +4 -4
  52. package/dist/main.js +101 -101
  53. package/dist/{mattermost-OCIA7Z4P.js → mattermost-HHHMUXQA.js} +4 -4
  54. package/dist/{mem0-FARYP2ZM.js → mem0-D2FGGOIY.js} +4 -4
  55. package/dist/{memos-6M6QEUYI.js → memos-4OVIGFPH.js} +4 -4
  56. package/dist/{metabase-VCNMPHIR.js → metabase-33WCX5YD.js} +4 -4
  57. package/dist/{mistral_ai-SMPVEWBM.js → mistral_ai-QIMZ2JYL.js} +4 -4
  58. package/dist/{mother_duck-CMHFH5A6.js → mother_duck-M6VWS2VH.js} +4 -4
  59. package/dist/{ngrok-WRQJ3X54.js → ngrok-Z2PKQBHH.js} +4 -4
  60. package/dist/{notes-HLPED7H7.js → notes-SS4RPC4K.js} +2 -2
  61. package/dist/{notion-FFCK2KZ4.js → notion-FJCNQ6I7.js} +4 -4
  62. package/dist/{open_exchange_rates-VKQICRS6.js → open_exchange_rates-WU57WTT5.js} +4 -4
  63. package/dist/{openai-PJDJ2AZ2.js → openai-JODZ4GKT.js} +4 -4
  64. package/dist/{opengraph_io-DMQQXMEC.js → opengraph_io-SQRAUSV5.js} +4 -4
  65. package/dist/{openrouter-I52ZZHQT.js → openrouter-Q5XXEJZ7.js} +4 -4
  66. package/dist/{outline-I6EIBEHQ.js → outline-RT2EHJ2X.js} +4 -4
  67. package/dist/{paddle-4DU7GKCS.js → paddle-OF2V7GAC.js} +4 -4
  68. package/dist/{perplexity-DE6K444O.js → perplexity-LNZEWLHG.js} +4 -4
  69. package/dist/{pinecone-KMRF5YWJ.js → pinecone-JSJIXZYN.js} +4 -4
  70. package/dist/{pipedrive-4OC5UU3L.js → pipedrive-D4CKVUXR.js} +4 -4
  71. package/dist/{polar-OACUFN7P.js → polar-M7ZYP6UR.js} +4 -4
  72. package/dist/{posthog-PSGNT66O.js → posthog-YV7CZOH4.js} +4 -4
  73. package/dist/{postmark-CSOVREPD.js → postmark-KYHLECRG.js} +4 -4
  74. package/dist/{prerender-B7M6SAIA.js → prerender-HCMHBKV2.js} +4 -4
  75. package/dist/{pubmed-JJ5URMS6.js → pubmed-WYVLCCN3.js} +4 -4
  76. package/dist/{railway-VO42EWHC.js → railway-TWIRD5KR.js} +4 -4
  77. package/dist/{readwise-O7I4HLU4.js → readwise-UZ467IQ7.js} +4 -4
  78. package/dist/{render-24X3H3WB.js → render-MECUC5CC.js} +4 -4
  79. package/dist/{replicate-TO6OPISC.js → replicate-A5MEK3SW.js} +4 -4
  80. package/dist/{resend-IBVGUV4X.js → resend-BC6EAWJQ.js} +4 -4
  81. package/dist/{rootly-MD5GFDUC.js → rootly-ZM3QDUIS.js} +4 -4
  82. package/dist/{scrapfly-ZKDGE4IL.js → scrapfly-WAML42QJ.js} +4 -4
  83. package/dist/{scrapingbee-2FVX2BFI.js → scrapingbee-DG7PET3V.js} +4 -4
  84. package/dist/{screenshot_fyi-HNPNS43Z.js → screenshot_fyi-HY6WTHIO.js} +4 -4
  85. package/dist/{semantic_scholar-EJ2CYAKO.js → semantic_scholar-C5IZA7IP.js} +4 -4
  86. package/dist/{sentry-DXB3CQZA.js → sentry-OKBPSTDM.js} +4 -4
  87. package/dist/{shodan-HEFZ6NHP.js → shodan-PPC6DYU4.js} +4 -4
  88. package/dist/{shopify-SUN5J257.js → shopify-EWGUHBXO.js} +4 -4
  89. package/dist/{stripe-N3HNTHD5.js → stripe-6RPDPC5W.js} +4 -4
  90. package/dist/{supabase-IMZ6YRES.js → supabase-SK7DQ42N.js} +4 -4
  91. package/dist/{tavily-QMPSOIGW.js → tavily-YCG5VQMH.js} +4 -4
  92. package/dist/{telegram-SHZX3C73.js → telegram-2OES5FYB.js} +4 -4
  93. package/dist/{telnyx-SF6KMQ7W.js → telnyx-POOSBBR4.js} +4 -4
  94. package/dist/{todoist-Y252DAZ2.js → todoist-M7YD6YSS.js} +4 -4
  95. package/dist/{trello-BTRC6I5Y.js → trello-IS6V5W3E.js} +4 -4
  96. package/dist/{turso-SB4KFTUP.js → turso-RCFHUFVH.js} +4 -4
  97. package/dist/{twilio-CRRJZ6MR.js → twilio-OS2RXFGO.js} +4 -4
  98. package/dist/{umami-7PJKITQ5.js → umami-PQ2SJ2LN.js} +4 -4
  99. package/dist/{unsplash-PYZXMXH2.js → unsplash-C6BPZO4E.js} +4 -4
  100. package/dist/{upstash_redis-L2IJTHFW.js → upstash_redis-WH6UER7H.js} +4 -4
  101. package/dist/{uptimerobot-XDYEYFJQ.js → uptimerobot-M3YZGS6Z.js} +4 -4
  102. package/dist/{v2ex-TNACDCAO.js → v2ex-R4JWTEHN.js} +4 -4
  103. package/dist/{vercel-QRU4UC5M.js → vercel-FZVYUOQD.js} +4 -4
  104. package/dist/{wolfram_alpha_api-TS663Q5L.js → wolfram_alpha_api-2KOLO5DC.js} +4 -4
  105. package/dist/{wordpress-RTEUS26Y.js → wordpress-XRWGO6LG.js} +4 -4
  106. package/dist/{workos-4NGPU4VP.js → workos-WR4NKOYL.js} +4 -4
  107. package/dist/{zhihu-GGLOXAVO.js → zhihu-BKZIB3WA.js} +4 -4
  108. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -68,8 +68,24 @@ interface Scope {
68
68
  * sys:bootstrapped → true(Admin SK 引导幂等标志)
69
69
  * annotation:<path> → { text, updatedAt, updatedBy }(管理员 Path 补充说明)
70
70
  * feedback:<path> → FeedbackEntry[](Agent 使用反馈,单 key 整存)
71
+ * store:object:<id> → StoreObject(revision CAS)
72
+ * store:upload:<id> → UploadSession(revision CAS)
73
+ * store:call-capability:<id> → CallUploadCapability(token 仅存 hash)
74
+ * store:share:<id> → ShareGrant(token 仅存 hash)
71
75
  */
72
76
  interface StateStore {
77
+ /**
78
+ * 可选原子 compare-and-swap 原语,供带 `revision` 的权威记录做跨副本状态转换。
79
+ *
80
+ * - `expectedRevision === null`:仅当 key 不存在时写入;
81
+ * - 数字:仅当现存值是对象且其 `revision` 严格等于该值时替换或删除;
82
+ * - `value === null`:命中后删除,否则替换为 value。
83
+ *
84
+ * 调用方负责让新值的 revision 从 expectedRevision 单调加一。实现必须把比较与
85
+ * 写入/删除放在同一条原子存储操作中,不能用 get→put 或进程内锁模拟。
86
+ * StoreService 等依赖并发状态机的能力会在缺少此原语时 fail closed。
87
+ */
88
+ compareAndSwap?(key: string, expectedRevision: number | null, value: unknown | null): Promise<boolean>;
73
89
  delete(key: string): Promise<void>;
74
90
  get(key: string): Promise<unknown | null>;
75
91
  /** 批量读取,返回值只包含当前存在的 key;单次最多 100 keys。 */
@@ -358,66 +374,6 @@ interface BuiltinCatalogEntry {
358
374
  /** binding 名 → 目录项。 */
359
375
  type BuiltinCatalog = Record<string, BuiltinCatalogEntry>;
360
376
 
361
- /**
362
- * Context Layer 类型(原样转写;方法签名异步化以兼容对象存储后端)。
363
- *
364
- * 全部动词可选:能力由 handler 存在性推导(见 context/capabilities.ts)。
365
- * 可选能力(Search/Delete)另在 ~describe 的 capabilities 中声明,调用方先探测再用。
366
- */
367
-
368
- interface ContextEntryMeta {
369
- /** "text/markdown" | "application/json" | ... */
370
- contentType: string;
371
- metadata: Record<string, string>;
372
- size?: number;
373
- updatedAt: Timestamp;
374
- /** node://<namespace-path>/<entry-path>;目录条目以尾 '/' 表示。 */
375
- uri: URI;
376
- /** 乐观并发:Update/Write 可携带 ifVersion;对象存储后端 = etag。 */
377
- version: string;
378
- }
379
- interface ContextEntry extends ContextEntryMeta {
380
- /** 文本或 JSON;大对象返回 { $ref: <预签名或中转 URL> }。 */
381
- content: string | unknown;
382
- }
383
- interface ContextEntryInput {
384
- content: string | unknown;
385
- /** 字符串 content 必填(缺失 → invalid_argument);非字符串 content 缺省 application/json。 */
386
- contentType?: string;
387
- /** 不匹配 → conflict。 */
388
- ifVersion?: string;
389
- metadata?: Record<string, string>;
390
- }
391
- interface ContextPatch {
392
- content?: string | unknown;
393
- ifVersion?: string;
394
- /** 浅合并。 */
395
- metadata?: Record<string, string>;
396
- }
397
- interface SearchOptions extends ListOptions {
398
- /** 缺省 keyword;semantic 需 capabilities 声明 "search:semantic",未声明 → invalid_argument。 */
399
- mode?: 'keyword' | 'semantic';
400
- }
401
- /**
402
- * Context provider。**全部动词可选**:能力由 handler 存在性推导(context/capabilities.ts),
403
- * `~help` 只列真实存在的操作,没有任何写动词即自动只读。
404
- *
405
- * 这样只读资源、纯搜索服务、append-only 存储都能如实表达自己,不必为满足接口而伪造
406
- * 方法或抛 unimplemented。未实现的动词在数据面按 unknown cmd 拒绝(invalid_argument)。
407
- */
408
- interface ContextProvider {
409
- delete?(path: string): Promise<void>;
410
- /** 读取单个条目(含内容);不存在 → not_found。 */
411
- get?(path: string): Promise<ContextEntry>;
412
- /** 枚举条目(浅层列表 + 分页);path 为 namespace 内相对路径前缀。 */
413
- list?(path: string, opts?: ListOptions): Promise<Page<ContextEntryMeta>>;
414
- search?(query: string, opts?: SearchOptions): Promise<Page<ContextEntryMeta>>;
415
- /** 部分更新已存在条目的内容或 metadata;不存在 → not_found。 */
416
- update?(path: string, patch: ContextPatch): Promise<ContextEntryMeta>;
417
- /** 创建或整体替换条目(幂等 upsert)。 */
418
- write?(path: string, entry: ContextEntryInput): Promise<ContextEntryMeta>;
419
- }
420
-
421
377
  /**
422
378
  * ObjectStore:对象存储抽象。
423
379
  *
@@ -456,6 +412,8 @@ interface ObjectPutOptions {
456
412
  contentType?: string;
457
413
  /** 与现存对象 etag 不符(含对象不存在)→ TBError conflict。 */
458
414
  ifMatchEtag?: string;
415
+ /** `*` 表示仅当对象不存在时创建;命中现存对象 → TBError conflict。 */
416
+ ifNoneMatch?: '*';
459
417
  metadata?: Record<string, string>;
460
418
  }
461
419
  interface ObjectListOptions {
@@ -471,7 +429,30 @@ interface ObjectListResult {
471
429
  prefix: string;
472
430
  }>;
473
431
  }
432
+ interface ObjectPresignedPut {
433
+ /** 上传时必须原样携带的请求头。 */
434
+ headers: Record<string, string>;
435
+ method: 'PUT';
436
+ url: string;
437
+ }
438
+ interface ObjectPresignPutOptions {
439
+ contentType: string;
440
+ /** `*` 表示仅当对象不存在时写入;必须随 PUT 一同签名并发送。 */
441
+ ifNoneMatch?: '*';
442
+ }
443
+ /**
444
+ * 定长直传契约:实现必须把 Content-Length 纳入签名,让存储端拒绝
445
+ * 任何与声明字节数不同的请求。普通 `presignPut` 没有这个安全保证。
446
+ */
447
+ interface ObjectPresignPutExactOptions extends ObjectPresignPutOptions {
448
+ contentLength: number;
449
+ }
474
450
  interface ObjectStore {
451
+ /**
452
+ * 可选宿主钩子:清理 prefix 下早于 olderThan 的未落位 staging 临时文件。
453
+ * staging 不进入 list,且命名/mtime 属于 driver 私有实现;返回实际删除数量。
454
+ */
455
+ cleanupStaging?(prefix: string, olderThan: string): Promise<number>;
475
456
  /** 幂等:不存在静默。 */
476
457
  delete(key: string): Promise<void>;
477
458
  get(key: string): Promise<{
@@ -482,9 +463,73 @@ interface ObjectStore {
482
463
  list(prefix: string, opts?: ObjectListOptions): Promise<ObjectListResult>;
483
464
  /** 生成限时直连 URL;后端不支持则缺省(provider 退化到 relayRefUrl)。 */
484
465
  presign?(key: string, ttlSec: number): Promise<string>;
466
+ /** 生成限时、定路径的直传 PUT 请求;后端或凭证不支持时缺省。 */
467
+ presignPut?(key: string, ttlSec: number, opts: ObjectPresignPutOptions): Promise<ObjectPresignedPut>;
468
+ /** 仅当 backend 能在签名中强制精确 Content-Length 时提供。 */
469
+ presignPutExact?(key: string, ttlSec: number, opts: ObjectPresignPutExactOptions): Promise<ObjectPresignedPut>;
485
470
  put(key: string, body: ObjectBody, opts?: ObjectPutOptions): Promise<ObjectMeta>;
486
471
  }
487
472
 
473
+ /**
474
+ * Context Layer 类型(原样转写;方法签名异步化以兼容对象存储后端)。
475
+ *
476
+ * 全部动词可选:能力由 handler 存在性推导(见 context/capabilities.ts)。
477
+ * 可选能力(Search/Delete)另在 ~describe 的 capabilities 中声明,调用方先探测再用。
478
+ */
479
+
480
+ interface ContextEntryMeta {
481
+ /** "text/markdown" | "application/json" | ... */
482
+ contentType: string;
483
+ metadata: Record<string, string>;
484
+ size?: number;
485
+ updatedAt: Timestamp;
486
+ /** node://<namespace-path>/<entry-path>;目录条目以尾 '/' 表示。 */
487
+ uri: URI;
488
+ /** 乐观并发:Update/Write 可携带 ifVersion;对象存储后端 = etag。 */
489
+ version: string;
490
+ }
491
+ interface ContextEntry extends ContextEntryMeta {
492
+ /** 文本或 JSON;大对象返回 { $ref: <预签名或中转 URL> }。 */
493
+ content: string | unknown;
494
+ }
495
+ interface ContextEntryInput {
496
+ content: string | unknown;
497
+ /** 字符串 content 必填(缺失 → invalid_argument);非字符串 content 缺省 application/json。 */
498
+ contentType?: string;
499
+ /** 不匹配 → conflict。 */
500
+ ifVersion?: string;
501
+ metadata?: Record<string, string>;
502
+ }
503
+ interface ContextPatch {
504
+ content?: string | unknown;
505
+ ifVersion?: string;
506
+ /** 浅合并。 */
507
+ metadata?: Record<string, string>;
508
+ }
509
+ interface SearchOptions extends ListOptions {
510
+ /** 缺省 keyword;semantic 需 capabilities 声明 "search:semantic",未声明 → invalid_argument。 */
511
+ mode?: 'keyword' | 'semantic';
512
+ }
513
+ /**
514
+ * Context provider。**全部动词可选**:能力由 handler 存在性推导(context/capabilities.ts),
515
+ * `~help` 只列真实存在的操作,没有任何写动词即自动只读。
516
+ *
517
+ * 这样只读资源、纯搜索服务、append-only 存储都能如实表达自己,不必为满足接口而伪造
518
+ * 方法或抛 unimplemented。未实现的动词在数据面按 unknown cmd 拒绝(invalid_argument)。
519
+ */
520
+ interface ContextProvider {
521
+ delete?(path: string): Promise<void>;
522
+ /** 读取单个条目(含内容);不存在 → not_found。 */
523
+ get?(path: string): Promise<ContextEntry>;
524
+ /** 枚举条目(浅层列表 + 分页);path 为 namespace 内相对路径前缀。 */
525
+ list?(path: string, opts?: ListOptions): Promise<Page<ContextEntryMeta>>;
526
+ search?(query: string, opts?: SearchOptions): Promise<Page<ContextEntryMeta>>;
527
+ /** 部分更新已存在条目的内容或 metadata;不存在 → not_found。 */
528
+ update?(path: string, patch: ContextPatch): Promise<ContextEntryMeta>;
529
+ /** 创建或整体替换条目(幂等 upsert)。 */
530
+ write?(path: string, entry: ContextEntryInput): Promise<ContextEntryMeta>;
531
+ }
532
+
488
533
  /**
489
534
  * DeviceFrame:设备 WS 帧协议的类型与编解码。
490
535
  *
@@ -511,6 +556,16 @@ interface DeviceCallContext {
511
556
  expiresAt: Timestamp;
512
557
  /** 全链路观测,与 call id 同源。 */
513
558
  traceId: string;
559
+ /**
560
+ * 本次 call 独享的 Store 上传能力。token 是短期 bearer,只由 SDK 消费并放入
561
+ * capability-only 请求 header,设备 handler 不应把它写入结果或日志。
562
+ */
563
+ upload?: {
564
+ expiresAt: Timestamp;
565
+ maxBytes: number;
566
+ maxObjects: number;
567
+ token: string;
568
+ };
514
569
  }
515
570
 
516
571
  /**
@@ -904,8 +959,30 @@ interface TbAppDeps {
904
959
  search?: SearchIndex;
905
960
  secrets: SecretStoreImpl;
906
961
  state: StateStore;
962
+ /** call capability 允许的 MIME pattern;缺省 `*\/*`。 */
963
+ storeCallAllowedContentTypes?: string[];
964
+ /** 单次 device call 的聚合上传字节预算。 */
965
+ storeCallMaxBytes?: number;
966
+ /** 单次 device call 的单对象字节预算。 */
967
+ storeCallMaxObjectBytes?: number;
968
+ /** 单次 device call 最多创建的 Store 对象数。 */
969
+ storeCallMaxObjects?: number;
970
+ /** default Store 的单对象部署级上限。 */
971
+ storeMaxObjectBytes?: number;
972
+ /** owner read `$ref` 有效期秒;缺省 refTtlSec 或 900。 */
973
+ storeReadTtlSec?: number;
974
+ /** relay transport 的有效 request-body 上限;direct 不受此值收紧。 */
975
+ storeRelayMaxBytes?: number;
976
+ /** 短期 share 的缺省有效期秒。 */
977
+ storeShareTtlSec?: number;
978
+ /** Store capability HMAC secret;缺省由 StateStore 原子生成并持久化。 */
979
+ storeTokenSecret?: string;
980
+ /** Store upload session 有效期秒。 */
981
+ storeUploadTtlSec?: number;
907
982
  /** mcp/tool 工具缓存 TTL 秒(缺省 300)。 */
908
983
  toolCacheTtlSec?: number;
984
+ /** create_upload 写入 grant 有效期秒;缺省 min(refTtlSec, 900)。 */
985
+ uploadGrantTtlSec?: number;
909
986
  /** healthz 与 system/status 回显的版本号(单一真源:宿主 package.json)。 */
910
987
  version: string;
911
988
  }
@@ -957,7 +1034,7 @@ interface ServerConfig {
957
1034
  encryptionKey?: string;
958
1035
  host: string;
959
1036
  /**
960
- * 平台对象存储(context `$ref` 大对象落点)。给出则用 S3/R2 兼容端点,
1037
+ * 平台对象存储(default Store + context `$ref` 大对象落点)。给出则用 S3/R2 兼容端点,
961
1038
  * 缺省回退 dataDir 下的本地 FS。配 S3 后容器可无状态横向扩容 —— FS 落点
962
1039
  * 在多副本间互不可见、容器重建即丢。
963
1040
  */
@@ -1006,9 +1083,33 @@ interface ServerConfig {
1006
1083
  * 请求吃闭门羹;单机/本地开发保持 0,关停立即进行。
1007
1084
  */
1008
1085
  shutdownDrainSec?: number;
1086
+ /** 设备调用允许上传的 MIME pattern;缺省由应用使用安全默认值。 */
1087
+ storeCallAllowedContentTypes?: string[];
1088
+ /** 设备调用所签发 Store capability 的总字节上限。 */
1089
+ storeCallMaxBytes?: number;
1090
+ /** 设备调用单个 Store 对象的字节上限。 */
1091
+ storeCallMaxObjectBytes?: number;
1092
+ /** 设备调用最多可创建的 Store 对象数。 */
1093
+ storeCallMaxObjects?: number;
1094
+ /** Store 孤儿字节、过期 session/share/call capability 的周期清理间隔。 */
1095
+ storeCleanupIntervalSec: number;
1096
+ /** Store 对象统一上限;direct upload 可使用完整值。 */
1097
+ storeMaxObjectBytes?: number;
1098
+ /** Store owner read ref 的有效期。 */
1099
+ storeReadTtlSec?: number;
1100
+ /** relay upload 的宿主有效上限;缺省等于对象统一上限。 */
1101
+ storeRelayMaxBytes?: number;
1102
+ /** Store 匿名可撤销 share 的有效期。 */
1103
+ storeShareTtlSec?: number;
1104
+ /** 显式 Store token 根密钥;缺省由应用在 StateStore 原子生成并持久化。 */
1105
+ storeTokenSecret?: string;
1106
+ /** Store upload session 的有效期。 */
1107
+ storeUploadTtlSec?: number;
1009
1108
  toolCacheTtlSec?: number;
1010
1109
  /** Dashboard 静态资源目录覆盖(缺省经 @tool-bridge/dashboard 包解析)。 */
1011
1110
  uiDir?: string;
1111
+ /** create_upload 写入 grant 有效期秒;缺省 min(refTtlSec, 900)。 */
1112
+ uploadGrantTtlSec?: number;
1012
1113
  }
1013
1114
  declare function configFromEnv(env?: NodeJS.ProcessEnv): ServerConfig;
1014
1115
 
@@ -1230,6 +1331,7 @@ declare class PgStateStore implements StateStore {
1230
1331
  get(key: string): Promise<unknown | null>;
1231
1332
  getMany(keys: readonly string[]): Promise<Map<string, unknown>>;
1232
1333
  put(key: string, value: unknown): Promise<void>;
1334
+ compareAndSwap(key: string, expectedRevision: number | null, value: unknown | null): Promise<boolean>;
1233
1335
  putIfAbsent(key: string, value: unknown): Promise<boolean>;
1234
1336
  delete(key: string): Promise<void>;
1235
1337
  list(prefix: string, opts?: {
@@ -1332,6 +1434,7 @@ declare class SqliteStateStore implements StateStore {
1332
1434
  get(key: string): Promise<unknown | null>;
1333
1435
  getMany(keys: readonly string[]): Promise<Map<string, unknown>>;
1334
1436
  put(key: string, value: unknown): Promise<void>;
1437
+ compareAndSwap(key: string, expectedRevision: number | null, value: unknown | null): Promise<boolean>;
1335
1438
  putIfAbsent(key: string, value: unknown): Promise<boolean>;
1336
1439
  delete(key: string): Promise<void>;
1337
1440
  list(prefix: string, opts?: {
package/dist/index.js CHANGED
@@ -12,8 +12,8 @@ import {
12
12
  configFromEnv,
13
13
  createDataObjectStore,
14
14
  createTbServer
15
- } from "./chunk-X6LLG5OZ.js";
16
- import "./chunk-ABHHWYEV.js";
15
+ } from "./chunk-BB6ZLMTU.js";
16
+ import "./chunk-YB2FLNWI.js";
17
17
  import "./chunk-MLKGABMK.js";
18
18
  export {
19
19
  DEVICE_FORWARD_TIMEOUT_MS,
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-ABHHWYEV.js";
13
+ } from "./chunk-YB2FLNWI.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/ip2proxy/schema.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-ABHHWYEV.js";
13
+ } from "./chunk-YB2FLNWI.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/ipgeolocation_io/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-ABHHWYEV.js";
13
+ } from "./chunk-YB2FLNWI.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/ipqualityscore/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-ABHHWYEV.js";
13
+ } from "./chunk-YB2FLNWI.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/jina_ai/api.ts
@@ -2,16 +2,16 @@ import {
2
2
  createProviderPlugin,
3
3
  requireCredential,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  assertPublicHttpUrl,
8
8
  guardedFetch
9
- } from "./chunk-HGIPJFHA.js";
10
- import "./chunk-CDOWN2AB.js";
9
+ } from "./chunk-2O27H4Y2.js";
10
+ import "./chunk-GKX72JMJ.js";
11
11
  import {
12
12
  TBError,
13
13
  external_exports
14
- } from "./chunk-ABHHWYEV.js";
14
+ } from "./chunk-YB2FLNWI.js";
15
15
  import "./chunk-MLKGABMK.js";
16
16
 
17
17
  // ../plugins/src/jira/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-ABHHWYEV.js";
13
+ } from "./chunk-YB2FLNWI.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/langsmith/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-ABHHWYEV.js";
13
+ } from "./chunk-YB2FLNWI.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/lemlist/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-ABHHWYEV.js";
13
+ } from "./chunk-YB2FLNWI.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/linear/api.ts
@@ -2,14 +2,14 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-BWGAV3MR.js";
5
+ } from "./chunk-VK3V2WTY.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-HGIPJFHA.js";
9
- import "./chunk-CDOWN2AB.js";
8
+ } from "./chunk-2O27H4Y2.js";
9
+ import "./chunk-GKX72JMJ.js";
10
10
  import {
11
11
  external_exports
12
- } from "./chunk-ABHHWYEV.js";
12
+ } from "./chunk-YB2FLNWI.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
 
15
15
  // ../plugins/src/logsnag/api.ts