@tool-bridge/server 0.4.0 → 0.7.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-K3I4W27V.js → airtable-BNVPDLF2.js} +4 -4
  2. package/dist/{alt_text_generator_ai-NE5YYNW3.js → alt_text_generator_ai-RMQPHK2Y.js} +4 -4
  3. package/dist/{amap-C2Y347XH.js → amap-PRNZPQ34.js} +4 -4
  4. package/dist/{anthropic-HEEOKRI7.js → anthropic-A76VIXR7.js} +4 -4
  5. package/dist/{apify-4SCWADEP.js → apify-2Q2CTLKE.js} +4 -4
  6. package/dist/{brave_search-UDLPBEMQ.js → brave_search-5YJJVPXH.js} +4 -4
  7. package/dist/{chunk-F4O6ZRH7.js → chunk-76YX7XSX.js} +91 -84
  8. package/dist/{chunk-OKQUN7BC.js → chunk-7ASYWVYP.js} +64 -24
  9. package/dist/{chunk-TKKRVFMK.js → chunk-BUHY4IE6.js} +2 -2
  10. package/dist/{chunk-CYTI7JDJ.js → chunk-EBO6Q4NR.js} +1 -1
  11. package/dist/{chunk-XE34TXY6.js → chunk-GMHELPK3.js} +1 -1
  12. package/dist/{circleci-UJEIISGE.js → circleci-TDXP3CPQ.js} +4 -4
  13. package/dist/{clerk-I2I22BUO.js → clerk-JRSGMXMS.js} +4 -4
  14. package/dist/{cloudflare_dns-5M2EY2RS.js → cloudflare_dns-G4CHNLO7.js} +4 -4
  15. package/dist/{cohere-XQWLOLCR.js → cohere-3KN27F2B.js} +4 -4
  16. package/dist/{confluence-JHCKTQX4.js → confluence-QV6J2PBV.js} +4 -4
  17. package/dist/{convertapi-B56OVE2W.js → convertapi-HETITAHL.js} +4 -4
  18. package/dist/{currencyapi-UPOFZ5P6.js → currencyapi-647DEY6G.js} +4 -4
  19. package/dist/{deepseek-OS75U3HY.js → deepseek-G63RUHM6.js} +4 -4
  20. package/dist/{docker_hub-LQVDQTQJ.js → docker_hub-RH72CRWO.js} +4 -4
  21. package/dist/{dropbox-HWO6JJ5L.js → dropbox-T4Y5KSZW.js} +4 -4
  22. package/dist/{dub-3J7YEZZ7.js → dub-ECKQT3DC.js} +4 -4
  23. package/dist/{e2b-KT6W4M6Y.js → e2b-N5SRTPLF.js} +4 -4
  24. package/dist/{exa-GWZZ6BWW.js → exa-525ZDM7G.js} +4 -4
  25. package/dist/{fal_ai-V4AQIJ5K.js → fal_ai-BFMVHAUW.js} +4 -4
  26. package/dist/{feishu-GLQBDJMW.js → feishu-NIDOD7EW.js} +3 -3
  27. package/dist/{feishu_custom_bot-TEEZ3BRW.js → feishu_custom_bot-V5RGAIUH.js} +4 -4
  28. package/dist/{figma-N7L3KF4A.js → figma-GH7TXJMP.js} +4 -4
  29. package/dist/{firehydrant-WJT2MLGI.js → firehydrant-5T3UHAQM.js} +4 -4
  30. package/dist/{fixer-TG5NW6OA.js → fixer-3RMJLMFO.js} +4 -4
  31. package/dist/{fly-LYK5NNBG.js → fly-NPHJC5MH.js} +4 -4
  32. package/dist/{front-MUQ4YT7O.js → front-PYGXJAQK.js} +4 -4
  33. package/dist/{geocodio-XXB2D3AN.js → geocodio-T6G3FVIF.js} +4 -4
  34. package/dist/{ghost-MWYITKQ5.js → ghost-L3XIF4SJ.js} +4 -4
  35. package/dist/{github-CIBT2UB2.js → github-7YDUB6N6.js} +4 -4
  36. package/dist/{gmail-JZECDA2U.js → gmail-RY2ZDG3B.js} +4 -4
  37. package/dist/{googlecalendar-ICIIDGEO.js → googlecalendar-EHOFMXHE.js} +4 -4
  38. package/dist/{googledocs-AV5CHSH3.js → googledocs-BA3OAMKA.js} +4 -4
  39. package/dist/{grafana-SJVGZAV5.js → grafana-PYZQ4CKI.js} +4 -4
  40. package/dist/{graphhopper-ZVBBXBHD.js → graphhopper-3P4YU45N.js} +4 -4
  41. package/dist/index.d.ts +35 -11
  42. package/dist/index.js +2 -2
  43. package/dist/{ip2proxy-EJMBZ4ZQ.js → ip2proxy-GQO6VF4P.js} +4 -4
  44. package/dist/{ipgeolocation_io-7BP766PO.js → ipgeolocation_io-VOZU6E7H.js} +4 -4
  45. package/dist/{ipqualityscore-QSB62FH3.js → ipqualityscore-XDJ3TTMM.js} +4 -4
  46. package/dist/{jina_ai-O5GT4ZZZ.js → jina_ai-ELXPSTUJ.js} +4 -4
  47. package/dist/{jira-DFOD6SAV.js → jira-INDXWO4I.js} +4 -4
  48. package/dist/{langsmith-B5HC4HNY.js → langsmith-PMCQBCIK.js} +4 -4
  49. package/dist/{lemlist-63EOIXDT.js → lemlist-VWZXIHJX.js} +4 -4
  50. package/dist/{linear-LBQC6RCY.js → linear-YXG4KZR4.js} +4 -4
  51. package/dist/{logsnag-YQL67XIX.js → logsnag-XENBYHHK.js} +4 -4
  52. package/dist/main.js +101 -101
  53. package/dist/{mattermost-VWLKWU7X.js → mattermost-BHVJP5MA.js} +4 -4
  54. package/dist/{mem0-2J5MMVIP.js → mem0-7AP5UBJV.js} +4 -4
  55. package/dist/{memos-ANAGWSHJ.js → memos-MNVRYSLG.js} +4 -4
  56. package/dist/{metabase-ONSZZ4E2.js → metabase-NSXM7EID.js} +4 -4
  57. package/dist/{mistral_ai-FYNVJRRG.js → mistral_ai-HXN625YX.js} +4 -4
  58. package/dist/{mother_duck-NRSVBZM7.js → mother_duck-46VQ3V3D.js} +4 -4
  59. package/dist/{ngrok-FXSVFLEE.js → ngrok-BWCVMS3T.js} +4 -4
  60. package/dist/{notes-VO45PFNB.js → notes-AVHKCFLU.js} +2 -2
  61. package/dist/{notion-AQH7ZGLG.js → notion-BSEN3KSU.js} +4 -4
  62. package/dist/{open_exchange_rates-G3MSI5KX.js → open_exchange_rates-DWO4T5TF.js} +4 -4
  63. package/dist/{openai-SZETZOPF.js → openai-HPZYRS3M.js} +4 -4
  64. package/dist/{opengraph_io-XNV4BFE5.js → opengraph_io-OLUAYD5P.js} +4 -4
  65. package/dist/{openrouter-TV5LQ55F.js → openrouter-4DQYZIG3.js} +4 -4
  66. package/dist/{outline-DTZCJ7NR.js → outline-ZDNMKXZ6.js} +4 -4
  67. package/dist/{paddle-T6RK3QSQ.js → paddle-HCOOYW3F.js} +4 -4
  68. package/dist/{perplexity-MVT3DWR2.js → perplexity-2GJJPDA7.js} +4 -4
  69. package/dist/{pinecone-Z4IVTJMV.js → pinecone-ZPOBKL5T.js} +4 -4
  70. package/dist/{pipedrive-PM2PBDDZ.js → pipedrive-3WN2RFMB.js} +4 -4
  71. package/dist/{polar-CKXLVP45.js → polar-DJFGBTXW.js} +4 -4
  72. package/dist/{posthog-QTYLJI3S.js → posthog-G4OXNEXP.js} +4 -4
  73. package/dist/{postmark-V6QQYQ6X.js → postmark-NJMGDQKO.js} +4 -4
  74. package/dist/{prerender-SQAU4FDE.js → prerender-2TUPKRK5.js} +4 -4
  75. package/dist/{pubmed-6ZMRZYGK.js → pubmed-CCXZZT34.js} +4 -4
  76. package/dist/{railway-PJBDYQYM.js → railway-ZUUY5YYR.js} +4 -4
  77. package/dist/{readwise-KJAOWBS5.js → readwise-PYSRGJ4J.js} +4 -4
  78. package/dist/{render-Z2YG43ZD.js → render-SFA3EMGM.js} +4 -4
  79. package/dist/{replicate-AXMIH4OJ.js → replicate-KGZHYBPK.js} +4 -4
  80. package/dist/{resend-HQBXFMOO.js → resend-HENMZC5U.js} +4 -4
  81. package/dist/{rootly-CJW5SJEL.js → rootly-HV2PXIDP.js} +4 -4
  82. package/dist/{scrapfly-7APCZZ7V.js → scrapfly-FOZFHUN3.js} +4 -4
  83. package/dist/{scrapingbee-HTUP6YCA.js → scrapingbee-VHUMSO2J.js} +4 -4
  84. package/dist/{screenshot_fyi-N6JAOGFQ.js → screenshot_fyi-FFDXAKHD.js} +4 -4
  85. package/dist/{semantic_scholar-METX5XVW.js → semantic_scholar-GHO37BZF.js} +4 -4
  86. package/dist/{sentry-QM7OGZZK.js → sentry-MZVZW3YE.js} +4 -4
  87. package/dist/{shodan-ZPQCN5RX.js → shodan-IDICOPGU.js} +4 -4
  88. package/dist/{shopify-FPLQQJXS.js → shopify-WQLO23JO.js} +4 -4
  89. package/dist/{stripe-NNGIPJRH.js → stripe-XOAKLAKU.js} +4 -4
  90. package/dist/{supabase-HKIEC7JZ.js → supabase-6DKGSLST.js} +4 -4
  91. package/dist/{tavily-WMQVNVQC.js → tavily-76QZGEHM.js} +4 -4
  92. package/dist/{telegram-VP76Z774.js → telegram-O536CLFR.js} +4 -4
  93. package/dist/{telnyx-7BGNYZMU.js → telnyx-XOPYXF3K.js} +4 -4
  94. package/dist/{todoist-MXXO72IA.js → todoist-YXHVWPP3.js} +4 -4
  95. package/dist/{trello-7RFKIFYN.js → trello-WMTM3WA2.js} +4 -4
  96. package/dist/{turso-SVWKUF5Y.js → turso-CG7PR5HM.js} +4 -4
  97. package/dist/{twilio-WGXCKTR7.js → twilio-ZW4SD36D.js} +4 -4
  98. package/dist/{umami-2BB5YCC7.js → umami-IJQ5VH77.js} +4 -4
  99. package/dist/{unsplash-W7TX5OXX.js → unsplash-JBQY7NKO.js} +4 -4
  100. package/dist/{upstash_redis-YJEWXBBX.js → upstash_redis-2BAO776T.js} +4 -4
  101. package/dist/{uptimerobot-BP4BGPOL.js → uptimerobot-BRIHMPB3.js} +4 -4
  102. package/dist/{v2ex-Y2ENEEYQ.js → v2ex-HWIHF4HX.js} +4 -4
  103. package/dist/{vercel-6EB3NZZP.js → vercel-MGMRY2DJ.js} +4 -4
  104. package/dist/{wolfram_alpha_api-EF3CZMNC.js → wolfram_alpha_api-JG6JD33L.js} +4 -4
  105. package/dist/{wordpress-JI3YVGXG.js → wordpress-ZSYJERWV.js} +4 -4
  106. package/dist/{workos-YDK42RA3.js → workos-QFEOSJAN.js} +4 -4
  107. package/dist/{zhihu-CNFASBUW.js → zhihu-5RF7BBFV.js} +4 -4
  108. package/package.json +5 -5
@@ -2,6 +2,7 @@ import {
2
2
  AnnotationStore,
3
3
  CONTEXT_CAPABILITIES,
4
4
  DEFAULT_MAX_NODES,
5
+ DEVICE_CALL_TIMEOUT_MS,
5
6
  DeviceGatewaySession,
6
7
  FEEDBACK_HIDE_SCORE,
7
8
  FeedbackStore,
@@ -68,6 +69,7 @@ import {
68
69
  createObjectContextProvider,
69
70
  createSkillhubProvider,
70
71
  decodeDeviceFrame,
72
+ derivePresence,
71
73
  deviceDirectoryHelpModel,
72
74
  deviceFsHelpModel,
73
75
  deviceShellHelpModel,
@@ -130,7 +132,7 @@ import {
130
132
  url,
131
133
  validatePath,
132
134
  virtualizeTools
133
- } from "./chunk-F4O6ZRH7.js";
135
+ } from "./chunk-76YX7XSX.js";
134
136
 
135
137
  // src/config.ts
136
138
  var DEFAULT_PORT = 8787;
@@ -442,7 +444,7 @@ async function doBootstrap(store, adminSk, requireAdminSk) {
442
444
  if (!bootstrapped) await store.put(KEY_BOOTSTRAPPED, true);
443
445
  }
444
446
  function runBootstrap(store, opts) {
445
- return doBootstrap(store, opts?.adminSk, opts?.requireAdminSk ?? false);
447
+ return doBootstrap(store, opts?.adminSk, opts?.requireAdminSk ?? true);
446
448
  }
447
449
  function buildDeps(opts) {
448
450
  return {
@@ -457,8 +459,7 @@ function buildDeps(opts) {
457
459
  store: opts.store,
458
460
  probe: (manifest) => probePlugin(manifest, opts.pluginBindings),
459
461
  fetchContract: (manifest) => fetchPluginContract(manifest, opts.pluginBindings),
460
- allowInsecureHttp: opts.allowInsecureHttp,
461
- ...opts.pluginBindings !== void 0 ? { bindings: () => [...(opts.pluginBindings ?? /* @__PURE__ */ new Map()).keys()] } : {}
462
+ allowInsecureHttp: opts.allowInsecureHttp
462
463
  },
463
464
  // federation 模块:remote host 白名单运行时存储 + env 基线。
464
465
  federation: { store: new RemoteAllowlistStore(opts.store), base: opts.remoteAllowlistBase },
@@ -964,6 +965,15 @@ async function invokeDevice(deps, deviceId, req) {
964
965
  if (body.ok) return body.value;
965
966
  throw tbErrorFromBody(body.error);
966
967
  }
968
+ function deviceCallContextFrom(ctx) {
969
+ const now = Date.now();
970
+ return {
971
+ caller: { keyId: ctx.keyId, owner: ctx.owner },
972
+ traceId: ctx.traceId,
973
+ createdAt: new Date(now).toISOString(),
974
+ expiresAt: new Date(now + DEVICE_CALL_TIMEOUT_MS).toISOString()
975
+ };
976
+ }
967
977
  function deviceMarkerOf(pc) {
968
978
  if (pc === void 0 || typeof pc.deviceId !== "string" || typeof pc.mountPath !== "string") {
969
979
  return null;
@@ -19331,7 +19341,7 @@ async function providerFor(node, ctx, deps) {
19331
19341
  if (node.kind === "mcp" && node.config?.kind === "mcp") {
19332
19342
  return createMcpProvider(node.config, deps.secrets, {
19333
19343
  allowInsecure: insecure,
19334
- // 会话复用凭证存 StateStore(mcpsession:<path>);调用结果不缓存(providers/mcp.ts)。
19344
+ // era 判定存 StateStore(mcpera:<path>);调用结果不缓存(providers/mcp.ts)。
19335
19345
  session: { store: deps.state, nodePath: node.path },
19336
19346
  // auth:'oauth' 节点的托管凭证存取面(mcpoauth:*);密钥缺省 → provider 内报 unavailable。
19337
19347
  ...deps.encryptionKey !== void 0 ? { oauth: { store: deps.state, encryptionKey: deps.encryptionKey } } : {}
@@ -19923,7 +19933,7 @@ async function processDeviceHello(opts) {
19923
19933
  input,
19924
19934
  authCtx.keyId,
19925
19935
  now,
19926
- input.path === mountPath ? { online: true } : {}
19936
+ input.path === mountPath ? { online: true, lastSeenAt: now } : {}
19927
19937
  );
19928
19938
  } catch (error) {
19929
19939
  await searchSync?.abort(marker);
@@ -19933,8 +19943,8 @@ async function processDeviceHello(opts) {
19933
19943
  throw error;
19934
19944
  }
19935
19945
  }
19936
- await searchSync?.rebuildAll(searchMarkers);
19937
- return { mountPath, keyId: authCtx.keyId };
19946
+ const searchIndexed = searchSync === void 0 ? true : await searchSync.rebuildAll(searchMarkers);
19947
+ return { mountPath, keyId: authCtx.keyId, searchIndexed };
19938
19948
  }
19939
19949
 
19940
19950
  // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.0.0/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
@@ -35899,9 +35909,15 @@ async function assertRegisterPath2(registry, ctx, targetPath, action, deps) {
35899
35909
  });
35900
35910
  if (!res.allow) throw res.error;
35901
35911
  }
35902
- function toEntry(n) {
35912
+ function toEntry(n, now) {
35903
35913
  const e = { path: n.path, kind: n.kind, description: n.description };
35904
- if (n.online !== void 0) e.online = n.online;
35914
+ if (n.online !== void 0) {
35915
+ e.presence = derivePresence({
35916
+ online: n.online,
35917
+ ...n.lastSeenAt !== void 0 ? { lastSeenAt: n.lastSeenAt } : {},
35918
+ now
35919
+ });
35920
+ }
35905
35921
  return e;
35906
35922
  }
35907
35923
  function filterListVisible(nodes, scopes) {
@@ -36157,7 +36173,7 @@ function localizeRemoteEntry(mountPath, remoteParentPath, entry) {
36157
36173
  kind: entry.kind,
36158
36174
  description: entry.description
36159
36175
  };
36160
- if (entry.online !== void 0) out.online = entry.online;
36176
+ if (entry.presence !== void 0) out.presence = entry.presence;
36161
36177
  return out;
36162
36178
  }
36163
36179
  async function resolveRemoteSettings(state, base) {
@@ -36700,6 +36716,7 @@ function registerSearchRoute(app, env) {
36700
36716
 
36701
36717
  // ../app/src/helpModel.ts
36702
36718
  async function helpModelFor(node, registry, ctx, builtins, deps, opts) {
36719
+ const index = opts.schemas !== true;
36703
36720
  if (node.kind === "builtin" && node.config?.kind === "builtin") {
36704
36721
  const mod = builtins.get(node.config.module);
36705
36722
  if (mod) return mod.help(node.path);
@@ -36711,8 +36728,13 @@ async function helpModelFor(node, registry, ctx, builtins, deps, opts) {
36711
36728
  ctx.scopes
36712
36729
  );
36713
36730
  if (node.online !== void 0) {
36731
+ const presence = derivePresence({
36732
+ online: node.online,
36733
+ ...node.lastSeenAt !== void 0 ? { lastSeenAt: node.lastSeenAt } : {},
36734
+ now: opts.now
36735
+ });
36714
36736
  return deviceDirectoryHelpModel(
36715
- { path: node.path, description: node.description, online: node.online },
36737
+ { path: node.path, description: node.description, presence },
36716
36738
  children.map((n) => ({ path: n.path, kind: n.kind, description: n.description }))
36717
36739
  );
36718
36740
  }
@@ -36729,7 +36751,7 @@ async function helpModelFor(node, registry, ctx, builtins, deps, opts) {
36729
36751
  node.path,
36730
36752
  { kind: node.kind, description: node.description },
36731
36753
  toolMarker.cmds ?? [],
36732
- { index: true }
36754
+ { index }
36733
36755
  );
36734
36756
  }
36735
36757
  if (node.kind === "mcp" || node.kind === "http" || node.kind === "tool") {
@@ -36740,9 +36762,7 @@ async function helpModelFor(node, registry, ctx, builtins, deps, opts) {
36740
36762
  node.path,
36741
36763
  { kind: node.kind, description: node.description },
36742
36764
  exposed,
36743
- {
36744
- index: true
36745
- }
36765
+ { index }
36746
36766
  );
36747
36767
  }
36748
36768
  if (node.kind === "device" && node.config?.kind === "device") {
@@ -37208,7 +37228,8 @@ async function handleInvoke(c, env) {
37208
37228
  const result2 = await invokeDevice(deps, toolMarker.deviceId, {
37209
37229
  path: relativeDevicePath(node.path, toolMarker.mountPath),
37210
37230
  tool,
37211
- arguments: args2
37231
+ arguments: args2,
37232
+ context: deviceCallContextFrom(ctx)
37212
37233
  });
37213
37234
  return renderResult(result2, negotiate(c.req.header("accept")));
37214
37235
  }
@@ -37237,7 +37258,8 @@ async function handleInvoke(c, env) {
37237
37258
  const result2 = await invokeDevice(deps, node.config.deviceId, {
37238
37259
  path: "shell",
37239
37260
  tool: body2.tool,
37240
- arguments: body2.arguments ?? {}
37261
+ arguments: body2.arguments ?? {},
37262
+ context: deviceCallContextFrom(ctx)
37241
37263
  });
37242
37264
  return renderResult(result2, negotiate(c.req.header("accept")));
37243
37265
  }
@@ -37263,7 +37285,8 @@ async function handleInvoke(c, env) {
37263
37285
  const result3 = await invokeDevice(deps, deviceIdForDeviceFs(cfg), {
37264
37286
  path: "fs",
37265
37287
  tool: body2.tool,
37266
- arguments: args2
37288
+ arguments: args2,
37289
+ context: deviceCallContextFrom(ctx)
37267
37290
  });
37268
37291
  return renderResult(result3, negotiate(c.req.header("accept")));
37269
37292
  }
@@ -37272,7 +37295,8 @@ async function handleInvoke(c, env) {
37272
37295
  const result3 = await invokeDevice(deps, contextMarker.deviceId, {
37273
37296
  path: relativeDevicePath(node.path, contextMarker.mountPath),
37274
37297
  tool: body2.tool,
37275
- arguments: args2
37298
+ arguments: args2,
37299
+ context: deviceCallContextFrom(ctx)
37276
37300
  });
37277
37301
  return renderResult(result3, negotiate(c.req.header("accept")));
37278
37302
  }
@@ -37498,8 +37522,10 @@ async function handleHelp(c, env) {
37498
37522
  }
37499
37523
  const builtins = builtinsOf(store);
37500
37524
  const refresh = c.req.query("refresh") === "1";
37525
+ const schemas = c.req.query("schemas") === "1";
37501
37526
  const model = await helpModelFor(node, registry, ctx, builtins, deps, {
37502
37527
  refresh,
37528
+ schemas,
37503
37529
  now: (/* @__PURE__ */ new Date()).toISOString()
37504
37530
  });
37505
37531
  return renderHelp(await enrichHelp(model, path, store), rep);
@@ -37515,6 +37541,7 @@ async function handleTree(c, env) {
37515
37541
  const store = c.get("store");
37516
37542
  if (path !== "" && !check(ctx, path, "read").allow) throw TBError.notFound("not found");
37517
37543
  const registry = new NodeRegistryStore(store);
37544
+ const now = (/* @__PURE__ */ new Date()).toISOString();
37518
37545
  if (path !== "") {
37519
37546
  const remote = await remotePassthroughIfMatch(c, ctx, registry, path, "~tree", deps);
37520
37547
  if (remote) return remote;
@@ -37530,14 +37557,14 @@ async function handleTree(c, env) {
37530
37557
  if (rootNode.kind === "context" && rootNode.config?.kind === "context") {
37531
37558
  await assertContextAlive(rootNode, rootNode.config, registry);
37532
37559
  }
37533
- rootEntry = toEntry(rootNode);
37560
+ rootEntry = toEntry(rootNode, now);
37534
37561
  }
37535
37562
  const nodes = await pruneExpiredContext(await registry.subtree(path), registry);
37536
37563
  const byParent = indexByParent(nodes);
37537
37564
  const getChildren = async (p) => {
37538
37565
  const localKids = filterListVisible(byParent.get(p) ?? [], ctx.scopes);
37539
37566
  const remoteKids = await remoteTreeChildren(c, ctx, registry, p, deps);
37540
- return [...localKids.map((n) => toEntry(n)), ...remoteKids];
37567
+ return [...localKids.map((n) => toEntry(n, now)), ...remoteKids];
37541
37568
  };
37542
37569
  const depth = clampDepth(Number(c.req.query("depth")));
37543
37570
  const tree = await buildTree({
@@ -37744,6 +37771,10 @@ var DeviceHub = class {
37744
37771
  if (this.activeByDevice.has(meta.deviceId)) continue;
37745
37772
  if (meta.disconnectedAt === void 0) {
37746
37773
  const now = (/* @__PURE__ */ new Date()).toISOString();
37774
+ try {
37775
+ await new NodeRegistryStore(this.store).setOnline(meta.mountPath, false, now);
37776
+ } catch {
37777
+ }
37747
37778
  await this.store.put(KEY_DEVICE_META + meta.deviceId, { ...meta, disconnectedAt: now });
37748
37779
  this.scheduleReclaim(meta.deviceId, this.reclaimSec * 1e3);
37749
37780
  } else {
@@ -37808,6 +37839,10 @@ var DeviceHub = class {
37808
37839
  this.connections.add(conn);
37809
37840
  ws.on("pong", () => {
37810
37841
  conn.isAlive = true;
37842
+ if (conn.mountPath !== void 0) {
37843
+ void new NodeRegistryStore(this.store).touchSeen(conn.mountPath, (/* @__PURE__ */ new Date()).toISOString()).catch(() => {
37844
+ });
37845
+ }
37811
37846
  });
37812
37847
  ws.on("message", (data) => {
37813
37848
  try {
@@ -37824,7 +37859,7 @@ var DeviceHub = class {
37824
37859
  }
37825
37860
  async acceptHello(conn, hello) {
37826
37861
  const now = (/* @__PURE__ */ new Date()).toISOString();
37827
- const { mountPath, keyId } = await processDeviceHello({
37862
+ const { mountPath, keyId, searchIndexed } = await processDeviceHello({
37828
37863
  store: this.store,
37829
37864
  authorization: conn.authorization,
37830
37865
  deviceIdHint: conn.deviceId,
@@ -37832,6 +37867,11 @@ var DeviceHub = class {
37832
37867
  now,
37833
37868
  ...this.search === void 0 ? {} : { search: this.search }
37834
37869
  });
37870
+ if (!searchIndexed) {
37871
+ console.warn(
37872
+ `[tool-bridge] device '${conn.deviceId}' mounted at ${mountPath} but its tools are NOT in the search index: registry exceeds the tool-search capacity (TOOL_SEARCH_AUDIT_NODE_LIMIT). The device is callable but won't appear in \`tb search\` until capacity frees up.`
37873
+ );
37874
+ }
37835
37875
  const meta = { deviceId: conn.deviceId, mountPath, keyId, connectedAt: now };
37836
37876
  await this.store.put(KEY_DEVICE_META + conn.deviceId, meta);
37837
37877
  conn.keyId = keyId;
@@ -38337,7 +38377,7 @@ import { join as join4 } from "path";
38337
38377
  // package.json
38338
38378
  var package_default = {
38339
38379
  name: "@tool-bridge/server",
38340
- version: "0.4.0",
38380
+ version: "0.7.0",
38341
38381
  description: "tool-bridge self-hosted server: run the HTBP gateway on Node with SQLite persistence, filesystem object storage and WebSocket device channel \u2014 single container via docker run",
38342
38382
  type: "module",
38343
38383
  license: "MIT",
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createPlugin
3
- } from "./chunk-XE34TXY6.js";
3
+ } from "./chunk-GMHELPK3.js";
4
4
  import {
5
5
  TBError
6
- } from "./chunk-F4O6ZRH7.js";
6
+ } from "./chunk-76YX7XSX.js";
7
7
 
8
8
  // ../plugins/src/_runtime/plugin.ts
9
9
  function requireApiKey(ctx, service) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TBError
3
- } from "./chunk-F4O6ZRH7.js";
3
+ } from "./chunk-76YX7XSX.js";
4
4
 
5
5
  // ../plugins/src/_runtime/ipPolicy.ts
6
6
  function parseIpv4(value) {
@@ -10,7 +10,7 @@ import {
10
10
  isTBError,
11
11
  parseCredentialValues,
12
12
  toToolResult
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
 
15
15
  // ../plugin-sdk/src/index.ts
16
16
  var CONTEXT_VERB_BY_HANDLER = {
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/circleci/api.ts
@@ -2,14 +2,14 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  external_exports
12
- } from "./chunk-F4O6ZRH7.js";
12
+ } from "./chunk-76YX7XSX.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
 
15
15
  // ../plugins/src/clerk/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/cloudflare_dns/api.ts
@@ -2,14 +2,14 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  external_exports
12
- } from "./chunk-F4O6ZRH7.js";
12
+ } from "./chunk-76YX7XSX.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
 
15
15
  // ../plugins/src/cohere/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireCredential,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/confluence/api.ts
@@ -2,16 +2,16 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  assertPublicHttpUrl,
8
8
  guardedFetch
9
- } from "./chunk-CYTI7JDJ.js";
10
- import "./chunk-XE34TXY6.js";
9
+ } from "./chunk-EBO6Q4NR.js";
10
+ import "./chunk-GMHELPK3.js";
11
11
  import {
12
12
  TBError,
13
13
  external_exports
14
- } from "./chunk-F4O6ZRH7.js";
14
+ } from "./chunk-76YX7XSX.js";
15
15
  import "./chunk-MLKGABMK.js";
16
16
 
17
17
  // ../plugins/src/convertapi/schema.ts
@@ -2,14 +2,14 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  external_exports
12
- } from "./chunk-F4O6ZRH7.js";
12
+ } from "./chunk-76YX7XSX.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
 
15
15
  // ../plugins/src/currencyapi/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/deepseek/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/docker_hub/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/dropbox/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/dub/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/e2b/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/exa/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/fal_ai/api.ts
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createGuardedFetch
3
- } from "./chunk-CYTI7JDJ.js";
3
+ } from "./chunk-EBO6Q4NR.js";
4
4
  import {
5
5
  createPlugin
6
- } from "./chunk-XE34TXY6.js";
6
+ } from "./chunk-GMHELPK3.js";
7
7
  import {
8
8
  TBError,
9
9
  isTBError,
10
10
  normalizeUpstreamError
11
- } from "./chunk-F4O6ZRH7.js";
11
+ } from "./chunk-76YX7XSX.js";
12
12
  import "./chunk-MLKGABMK.js";
13
13
 
14
14
  // ../plugins/src/feishu/feishuMcp.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireCredential,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/feishu_custom_bot/api.ts
@@ -2,15 +2,15 @@ import {
2
2
  createProviderPlugin,
3
3
  requireApiKey,
4
4
  upstreamError
5
- } from "./chunk-TKKRVFMK.js";
5
+ } from "./chunk-BUHY4IE6.js";
6
6
  import {
7
7
  guardedFetch
8
- } from "./chunk-CYTI7JDJ.js";
9
- import "./chunk-XE34TXY6.js";
8
+ } from "./chunk-EBO6Q4NR.js";
9
+ import "./chunk-GMHELPK3.js";
10
10
  import {
11
11
  TBError,
12
12
  external_exports
13
- } from "./chunk-F4O6ZRH7.js";
13
+ } from "./chunk-76YX7XSX.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // ../plugins/src/figma/api.ts