@tool-bridge/server 0.22.1 → 0.24.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 (110) hide show
  1. package/dist/admin.js +2 -2
  2. package/dist/{airtable-ML2GIGCH.js → airtable-Z6KEL3MA.js} +6 -6
  3. package/dist/{alt_text_generator_ai-FGYQAF2A.js → alt_text_generator_ai-RM2GHSNM.js} +5 -5
  4. package/dist/{amap-G7V65NGK.js → amap-YEJLGIKY.js} +5 -5
  5. package/dist/{anthropic-6ZK24TBB.js → anthropic-62M4MUVQ.js} +6 -6
  6. package/dist/{apify-VDGYHP6W.js → apify-AHRNDBCB.js} +6 -6
  7. package/dist/{brave_search-TAATLZOS.js → brave_search-JAHWOMQC.js} +6 -6
  8. package/dist/{chunk-HA4BGL6C.js → chunk-7MUNQNXG.js} +486 -450
  9. package/dist/{chunk-RTW5VRTK.js → chunk-FZV7CF7L.js} +3 -3
  10. package/dist/{chunk-7ISGFRC6.js → chunk-GQ4O7NK5.js} +1 -1
  11. package/dist/{chunk-RMAWSG7E.js → chunk-LD7KQRQ3.js} +372 -554
  12. package/dist/{chunk-BNMLA2RC.js → chunk-NG4C7YB3.js} +3 -3
  13. package/dist/{chunk-X7ZUTKHR.js → chunk-SU6Q4RAY.js} +2 -2
  14. package/dist/{chunk-UY6ANCOY.js → chunk-TH3H5YAG.js} +1 -1
  15. package/dist/{chunk-2IAI3XQM.js → chunk-U2UGFSOX.js} +2 -2
  16. package/dist/{circleci-BQ2UWXL2.js → circleci-UJUYBIAO.js} +6 -6
  17. package/dist/{clerk-2JYWQNOI.js → clerk-FCFM3WJK.js} +6 -6
  18. package/dist/{cohere-6MI7AQM4.js → cohere-OTSYSMPC.js} +6 -6
  19. package/dist/{confluence-6Y6GDETF.js → confluence-LPANSCGT.js} +6 -6
  20. package/dist/{convertapi-HBZCSWOX.js → convertapi-AJZOVUHT.js} +4 -4
  21. package/dist/{currencyapi-337U5TGI.js → currencyapi-HGK5FSGO.js} +6 -6
  22. package/dist/{deepseek-OSPASO7O.js → deepseek-7HMTFJRV.js} +6 -6
  23. package/dist/{docker_hub-3ATQOY5L.js → docker_hub-FCNVKJZW.js} +5 -5
  24. package/dist/{dropbox-LSA4GM2Y.js → dropbox-2XVKCQZE.js} +6 -6
  25. package/dist/{dub-VZPJSPI6.js → dub-CTUKPX2A.js} +6 -6
  26. package/dist/{e2b-6SDYQZL2.js → e2b-ULEWTRKI.js} +6 -6
  27. package/dist/{exa-B6EUYDVP.js → exa-QENFV3AU.js} +6 -6
  28. package/dist/{fal_ai-K4Q27IME.js → fal_ai-TQYUBBAF.js} +6 -6
  29. package/dist/{feishu-4TKXG4SU.js → feishu-OYCWDSHD.js} +3 -3
  30. package/dist/{feishu_custom_bot-7CTEAKRB.js → feishu_custom_bot-VYQ7A3PU.js} +4 -4
  31. package/dist/{figma-OUKSZLD5.js → figma-5DLOKAQQ.js} +6 -6
  32. package/dist/{firehydrant-7MOYL7QH.js → firehydrant-X4MGP2OI.js} +6 -6
  33. package/dist/{fixer-H2BV2NO4.js → fixer-LMIWM3ZX.js} +5 -5
  34. package/dist/{fly-PXKY6PNH.js → fly-J5HN5L2I.js} +6 -6
  35. package/dist/{front-UZYIV5DW.js → front-E3SMBQW3.js} +6 -6
  36. package/dist/{geocodio-NSYO7TFP.js → geocodio-AOINRPLA.js} +5 -5
  37. package/dist/{ghost-QBKKQQMF.js → ghost-E4CBGZWJ.js} +5 -5
  38. package/dist/{github-ENLSJ4CL.js → github-PGR6U3FC.js} +6 -6
  39. package/dist/{gmail-KQSDEB47.js → gmail-XNQHMQ6F.js} +6 -6
  40. package/dist/{googlecalendar-5YCX4SZF.js → googlecalendar-RE6DGG7L.js} +6 -6
  41. package/dist/{googledocs-SSWIVFKA.js → googledocs-CX2BZDQH.js} +4 -4
  42. package/dist/{grafana-TF2LXDQA.js → grafana-GX75ZA5X.js} +6 -6
  43. package/dist/{graphhopper-CURBVHYK.js → graphhopper-XMUYLWHS.js} +5 -5
  44. package/dist/index.js +5 -5
  45. package/dist/{ip2proxy-YNVMTZEM.js → ip2proxy-ZGIRBAG5.js} +5 -5
  46. package/dist/{ipgeolocation_io-NAU7VJ4J.js → ipgeolocation_io-MAP27QMO.js} +5 -5
  47. package/dist/{ipqualityscore-OT63L4TI.js → ipqualityscore-6IIUUAQ2.js} +5 -5
  48. package/dist/{jina_ai-6WBMBGWM.js → jina_ai-GGH77RQH.js} +6 -6
  49. package/dist/{jira-DVDVTHNO.js → jira-7GPZW6HZ.js} +6 -6
  50. package/dist/{langsmith-IM5N4YAU.js → langsmith-CJXYE7WM.js} +6 -6
  51. package/dist/{lemlist-277SHUQF.js → lemlist-OYPOX6GN.js} +6 -6
  52. package/dist/{linear-AEPH7B5V.js → linear-TPQ6X4XZ.js} +4 -4
  53. package/dist/{logsnag-VEWRAGBG.js → logsnag-HT2PRLIV.js} +6 -6
  54. package/dist/main.js +5 -5
  55. package/dist/{mattermost-Q3A2BIZA.js → mattermost-6IYTWTM5.js} +6 -6
  56. package/dist/{mem0-AXS7GZGI.js → mem0-7AVGBGOX.js} +6 -6
  57. package/dist/{memos-7TXG4ZTU.js → memos-CTOXWZ6X.js} +6 -6
  58. package/dist/{metabase-NSVACWQM.js → metabase-AFJXQ5SQ.js} +6 -6
  59. package/dist/{mistral_ai-YZ52RGD4.js → mistral_ai-QDKM4N3R.js} +6 -6
  60. package/dist/{mother_duck-XLLL6FVL.js → mother_duck-XSKR4GVL.js} +6 -6
  61. package/dist/{ngrok-4O4W3WZW.js → ngrok-NQMLM24P.js} +6 -6
  62. package/dist/{notes-YTB3TJOO.js → notes-ZWMVZQWJ.js} +2 -2
  63. package/dist/{notion-4W4O7J7V.js → notion-6544KSMM.js} +6 -6
  64. package/dist/{open_exchange_rates-23QJXVO5.js → open_exchange_rates-4CLN7O2N.js} +5 -5
  65. package/dist/{openai-ZS7GLSLH.js → openai-HLFGPVI5.js} +6 -6
  66. package/dist/{opengraph_io-PMVH7OYI.js → opengraph_io-57JDHT3M.js} +5 -5
  67. package/dist/{openrouter-ONRGFNB6.js → openrouter-WDAVB2OP.js} +6 -6
  68. package/dist/{outline-UCUYZZ7J.js → outline-A6MDLZVH.js} +6 -6
  69. package/dist/{paddle-35HTKTUL.js → paddle-WX5ULOPP.js} +6 -6
  70. package/dist/{perplexity-NVOBYN24.js → perplexity-LYTWWWCZ.js} +6 -6
  71. package/dist/{pinecone-55CJY73C.js → pinecone-7KAF3S7U.js} +6 -6
  72. package/dist/{pipedrive-WMCAKS72.js → pipedrive-YQY243G7.js} +6 -6
  73. package/dist/{polar-SM4ZM53B.js → polar-A5HKXSQY.js} +6 -6
  74. package/dist/{posthog-NWCXVXNJ.js → posthog-CF2LHLS4.js} +6 -6
  75. package/dist/{postmark-QJV5PHUQ.js → postmark-W756TMJM.js} +6 -6
  76. package/dist/{prerender-2W7UT4SC.js → prerender-ZYM4UQ5R.js} +5 -5
  77. package/dist/{pubmed-VVV7XYLU.js → pubmed-QXTUQCTQ.js} +4 -4
  78. package/dist/{railway-KGI57S3O.js → railway-F4MOZ3LQ.js} +4 -4
  79. package/dist/{readwise-AGHTQB42.js → readwise-S7MF5SR5.js} +6 -6
  80. package/dist/{render-O4HBROCK.js → render-D7EIVDUA.js} +6 -6
  81. package/dist/{replicate-KWBOMX7D.js → replicate-ABNKPZR7.js} +6 -6
  82. package/dist/{resend-DRH6Y6I4.js → resend-7VJEY4KC.js} +6 -6
  83. package/dist/{rootly-XGCUDW6X.js → rootly-UMFJOKXC.js} +6 -6
  84. package/dist/{scrapfly-OIQ3OY6L.js → scrapfly-UDT4KNFL.js} +5 -5
  85. package/dist/{scrapingbee-OCZO4FHX.js → scrapingbee-XTFD54NB.js} +5 -5
  86. package/dist/{screenshot_fyi-CUNGFZOC.js → screenshot_fyi-5GTW3SFY.js} +5 -5
  87. package/dist/{semantic_scholar-3UJRLKES.js → semantic_scholar-Y6WK2MST.js} +6 -6
  88. package/dist/{sentry-5BWVZFJV.js → sentry-ZFPGDA6C.js} +6 -6
  89. package/dist/{shodan-HI37CTEW.js → shodan-3SCDBOQ3.js} +5 -5
  90. package/dist/{shopify-LJ2EV2HH.js → shopify-LMTBS2I2.js} +6 -6
  91. package/dist/{stripe-3LHMV55K.js → stripe-4JQJ2CUG.js} +4 -4
  92. package/dist/{supabase-H2KPX3Q2.js → supabase-7HA3BEFK.js} +6 -6
  93. package/dist/{tavily-FBEWGH3Z.js → tavily-H34ZBPGC.js} +6 -6
  94. package/dist/{telegram-MYYO3JND.js → telegram-CRX4YWQ3.js} +5 -5
  95. package/dist/{telnyx-H4ALEGAX.js → telnyx-TIKGEU34.js} +6 -6
  96. package/dist/{todoist-OBWICA5Q.js → todoist-LU563DGZ.js} +6 -6
  97. package/dist/{trello-GUFUJRWO.js → trello-NTRGEROX.js} +5 -5
  98. package/dist/{turso-NIAK4UMS.js → turso-EY3CNVPZ.js} +6 -6
  99. package/dist/{twilio-K6SLK2CX.js → twilio-ICX3WRQH.js} +4 -4
  100. package/dist/{umami-42RS2EPS.js → umami-NPMRVI3M.js} +6 -6
  101. package/dist/{unsplash-V7TOTETT.js → unsplash-TIHBZFIM.js} +6 -6
  102. package/dist/{upstash_redis-AWQMB6Y3.js → upstash_redis-2DO6EHCN.js} +6 -6
  103. package/dist/{uptimerobot-AZC2DHOT.js → uptimerobot-BGYOCKGI.js} +4 -4
  104. package/dist/{v2ex-4TVRNMLS.js → v2ex-GOWDPGGA.js} +6 -6
  105. package/dist/{vercel-DPHTJ3XR.js → vercel-G33RXVBI.js} +6 -6
  106. package/dist/{wolfram_alpha_api-XAG7IXBW.js → wolfram_alpha_api-IRZSMD3P.js} +5 -5
  107. package/dist/{wordpress-KMPKVGUX.js → wordpress-ATWGGUC3.js} +6 -6
  108. package/dist/{workos-PKB2YR7S.js → workos-LHJDETBX.js} +6 -6
  109. package/dist/{zhihu-Y4H4XYPB.js → zhihu-IAH53YPP.js} +6 -6
  110. package/package.json +3 -3
@@ -2170,10 +2170,10 @@ function createFederationModule(deps) {
2170
2170
  }
2171
2171
 
2172
2172
  // ../core/src/builtin/registry.ts
2173
- import { z as z15 } from "zod/v4";
2173
+ import { z as z16 } from "zod/v4";
2174
2174
 
2175
2175
  // ../core/src/protocol/wire.ts
2176
- import { z as z14 } from "zod";
2176
+ import { z as z15 } from "zod";
2177
2177
 
2178
2178
  // ../core/src/secret/keyring.ts
2179
2179
  function validateEncryptionKeyring(input) {
@@ -2833,109 +2833,125 @@ var DeviceMailboxService = class {
2833
2833
  }
2834
2834
  };
2835
2835
 
2836
- // ../core/src/protocol/errorWire.ts
2836
+ // ../core/src/device/environment.ts
2837
2837
  import { z as z13 } from "zod";
2838
- var tbErrorCodeSchema = z13.enum(TB_ERROR_CODES);
2839
- var tbErrorBodySchema = z13.object({
2838
+ var deviceEnvironmentSchema = z13.strictObject({
2839
+ platform: z13.enum(["darwin", "linux", "win32", "android", "ios", "other"]),
2840
+ arch: z13.string().min(1).max(32).regex(/^[a-zA-Z0-9._-]+$/).optional(),
2841
+ runtime: z13.enum(["node", "bun", "react-native", "other"]).optional(),
2842
+ runtimeVersion: z13.string().min(1).max(64).regex(/^[a-zA-Z0-9.+_-]+$/).optional(),
2843
+ runtimeId: z13.string().min(1).max(128).regex(/^[a-zA-Z0-9._-]+$/).optional()
2844
+ });
2845
+
2846
+ // ../core/src/protocol/errorWire.ts
2847
+ import { z as z14 } from "zod";
2848
+ var tbErrorCodeSchema = z14.enum(TB_ERROR_CODES);
2849
+ var tbErrorBodySchema = z14.object({
2840
2850
  code: tbErrorCodeSchema,
2841
- message: z13.string(),
2842
- retryable: z13.boolean()
2851
+ message: z14.string(),
2852
+ retryable: z14.boolean()
2843
2853
  });
2844
2854
 
2845
2855
  // ../core/src/protocol/wire.ts
2846
- var actionSchema = z14.enum(ACTIONS);
2847
- var nodeKindSchema = z14.enum(NODE_KINDS);
2848
- var nodeInputConfigSchema = z14.record(z14.string(), z14.unknown()).optional().describe(
2856
+ var actionSchema = z15.enum(ACTIONS);
2857
+ var nodeKindSchema = z15.enum(NODE_KINDS);
2858
+ var nodeInputConfigSchema = z15.record(z15.string(), z15.unknown()).optional().describe(
2849
2859
  "kind-specific config, e.g. mcp: { url, auth?, authRef?, oauthClient?: { clientId, clientSecretRef? } } / http: { endpoint, tools } / context: { provider, bucket, \u2026 } / remote: { baseUrl, skRef }; credentials go by SecretStore reference name, never inline"
2850
2860
  );
2851
- var nodeInputVirtualizeSchema = z14.strictObject({
2852
- prefix: z14.string().optional(),
2853
- rename: z14.record(z14.string(), z14.string()).optional(),
2854
- hide: z14.array(z14.string()).optional(),
2855
- describe: z14.record(z14.string(), z14.string()).optional()
2861
+ var nodeInputVirtualizeSchema = z15.strictObject({
2862
+ prefix: z15.string().optional(),
2863
+ rename: z15.record(z15.string(), z15.string()).optional(),
2864
+ hide: z15.array(z15.string()).optional(),
2865
+ describe: z15.record(z15.string(), z15.string()).optional()
2856
2866
  }).optional().describe(
2857
2867
  "optional tool virtualization: { prefix?, rename?: {from:to}, hide?: [name], describe?: {name:text} }"
2858
2868
  );
2859
- var nodeInputSchema = z14.strictObject({
2860
- path: z14.string().min(1).describe('tree path to mount at, e.g. "docs/context7"'),
2869
+ var nodeInputSchema = z15.strictObject({
2870
+ path: z15.string().min(1).describe('tree path to mount at, e.g. "docs/context7"'),
2861
2871
  kind: nodeKindSchema.describe("node kind; determines the config shape"),
2862
- description: z14.string().min(1).describe("one-line description shown in parent ~help"),
2872
+ description: z15.string().min(1).describe("one-line description shown in parent ~help"),
2863
2873
  config: nodeInputConfigSchema,
2864
2874
  virtualize: nodeInputVirtualizeSchema
2865
2875
  });
2866
- var presenceStateSchema = z14.enum(["online", "stale", "offline"]);
2867
- var presenceSchema = z14.object({
2868
- lastSeenAt: z14.string().optional(),
2876
+ var presenceStateSchema = z15.enum(["online", "stale", "offline"]);
2877
+ var presenceSchema = z15.object({
2878
+ lastSeenAt: z15.string().optional(),
2869
2879
  state: presenceStateSchema
2870
2880
  });
2871
- var helpFeedbackItemSchema = z14.object({
2872
- id: z14.string(),
2873
- score: z14.number(),
2874
- title: z14.string()
2881
+ var helpFeedbackItemSchema = z15.object({
2882
+ id: z15.string(),
2883
+ score: z15.number(),
2884
+ title: z15.string()
2875
2885
  });
2876
- var helpChildSchema = z14.object({
2877
- description: z14.string(),
2886
+ var helpChildSchema = z15.object({
2887
+ description: z15.string(),
2878
2888
  kind: nodeKindSchema,
2879
- path: z14.string()
2889
+ path: z15.string()
2880
2890
  });
2881
- var helpCommandSchema = z14.object({
2882
- confirm: z14.boolean().optional(),
2883
- delivery: z14.enum(["realtime", "mailbox", "both"]).optional(),
2884
- effect: z14.string().optional(),
2885
- h: z14.string().optional(),
2886
- inputSchema: z14.unknown().optional(),
2887
- method: z14.literal("POST"),
2888
- name: z14.string(),
2889
- outputSchema: z14.unknown().optional(),
2890
- path: z14.string(),
2891
- returns: z14.string().optional(),
2891
+ var helpCommandSchema = z15.object({
2892
+ confirm: z15.boolean().optional(),
2893
+ delivery: z15.enum(["realtime", "mailbox", "both"]).optional(),
2894
+ effect: z15.string().optional(),
2895
+ h: z15.string().optional(),
2896
+ inputSchema: z15.unknown().optional(),
2897
+ method: z15.literal("POST"),
2898
+ name: z15.string(),
2899
+ outputSchema: z15.unknown().optional(),
2900
+ path: z15.string(),
2901
+ returns: z15.string().optional(),
2892
2902
  scope: actionSchema
2893
2903
  });
2894
- var helpJsonSchema = z14.object({
2895
- children: z14.array(helpChildSchema).optional(),
2896
- cmds: z14.array(helpCommandSchema),
2897
- feedback: z14.array(helpFeedbackItemSchema).optional(),
2898
- hint: z14.string().optional(),
2899
- htbp: z14.string(),
2900
- node: z14.object({
2901
- description: z14.string(),
2904
+ var deviceContextSchema = z15.strictObject({
2905
+ environment: deviceEnvironmentSchema,
2906
+ reportedAt: z15.iso.datetime({ offset: true }),
2907
+ presence: presenceSchema.optional()
2908
+ });
2909
+ var helpJsonSchema = z15.object({
2910
+ children: z15.array(helpChildSchema).optional(),
2911
+ cmds: z15.array(helpCommandSchema),
2912
+ deviceContext: deviceContextSchema.optional(),
2913
+ feedback: z15.array(helpFeedbackItemSchema).optional(),
2914
+ hint: z15.string().optional(),
2915
+ htbp: z15.string(),
2916
+ node: z15.object({
2917
+ description: z15.string(),
2902
2918
  kind: nodeKindSchema,
2903
- path: z14.string()
2919
+ path: z15.string()
2904
2920
  }),
2905
- note: z14.string().optional()
2921
+ note: z15.string().optional()
2906
2922
  });
2907
- var treeJsonSchema = z14.lazy(() => z14.object({
2908
- children: z14.array(treeJsonSchema).optional(),
2909
- description: z14.string(),
2923
+ var treeJsonSchema = z15.lazy(() => z15.object({
2924
+ children: z15.array(treeJsonSchema).optional(),
2925
+ description: z15.string(),
2910
2926
  kind: nodeKindSchema,
2911
- path: z14.string(),
2927
+ path: z15.string(),
2912
2928
  presence: presenceSchema.optional(),
2913
- truncated: z14.boolean().optional()
2929
+ truncated: z15.boolean().optional()
2914
2930
  }));
2915
- var toolSpecSchema = z14.object({
2916
- confirm: z14.boolean().optional(),
2917
- delivery: z14.enum(["realtime", "mailbox", "both"]).optional(),
2918
- description: z14.string().optional(),
2919
- effect: z14.string().optional(),
2920
- inputSchema: z14.unknown().optional(),
2921
- name: z14.string(),
2922
- outputSchema: z14.unknown().optional()
2931
+ var toolSpecSchema = z15.object({
2932
+ confirm: z15.boolean().optional(),
2933
+ delivery: z15.enum(["realtime", "mailbox", "both"]).optional(),
2934
+ description: z15.string().optional(),
2935
+ effect: z15.string().optional(),
2936
+ inputSchema: z15.unknown().optional(),
2937
+ name: z15.string(),
2938
+ outputSchema: z15.unknown().optional()
2923
2939
  });
2924
- var toolSearchRelevanceSchema = z14.strictObject({
2925
- coverage: z14.number().min(0).max(1),
2926
- matchedTermCount: z14.number().int().nonnegative(),
2927
- rankingVersion: z14.literal("keyword-v2"),
2928
- totalTermCount: z14.number().int().positive()
2940
+ var toolSearchRelevanceSchema = z15.strictObject({
2941
+ coverage: z15.number().min(0).max(1),
2942
+ matchedTermCount: z15.number().int().nonnegative(),
2943
+ rankingVersion: z15.literal("keyword-v2"),
2944
+ totalTermCount: z15.number().int().positive()
2929
2945
  }).refine(
2930
2946
  (value) => value.matchedTermCount <= value.totalTermCount && value.coverage === value.matchedTermCount / value.totalTermCount,
2931
2947
  { message: "coverage must equal matchedTermCount / totalTermCount" }
2932
2948
  );
2933
- var toolSearchSourceSchema = z14.strictObject({
2934
- path: z14.string()
2949
+ var toolSearchSourceSchema = z15.strictObject({
2950
+ path: z15.string()
2935
2951
  });
2936
- var toolSearchSourceResultSchema = z14.strictObject({
2937
- path: z14.string(),
2938
- status: z14.enum([
2952
+ var toolSearchSourceResultSchema = z15.strictObject({
2953
+ path: z15.string(),
2954
+ status: z15.enum([
2939
2955
  "ok",
2940
2956
  "unsupported",
2941
2957
  "timed_out",
@@ -2946,206 +2962,209 @@ var toolSearchSourceResultSchema = z14.strictObject({
2946
2962
  "invalid_response"
2947
2963
  ])
2948
2964
  });
2949
- var toolSearchItemSchema = z14.strictObject({
2950
- path: z14.string(),
2965
+ var toolSearchItemSchema = z15.strictObject({
2966
+ path: z15.string(),
2951
2967
  relevance: toolSearchRelevanceSchema,
2952
2968
  source: toolSearchSourceSchema.optional(),
2953
2969
  tool: toolSpecSchema
2954
2970
  });
2955
2971
  function pageSchema(itemSchema) {
2956
- return z14.object({
2957
- cursor: z14.string().optional(),
2958
- items: z14.array(itemSchema)
2972
+ return z15.object({
2973
+ cursor: z15.string().optional(),
2974
+ items: z15.array(itemSchema)
2959
2975
  });
2960
2976
  }
2961
- var toolSearchPageSchema = z14.strictObject({
2962
- cursor: z14.string().optional(),
2963
- items: z14.array(toolSearchItemSchema),
2964
- partial: z14.boolean().optional(),
2965
- snapshot: z14.string().optional(),
2966
- sources: z14.array(toolSearchSourceResultSchema).optional()
2977
+ var toolSearchPageSchema = z15.strictObject({
2978
+ cursor: z15.string().optional(),
2979
+ items: z15.array(toolSearchItemSchema),
2980
+ partial: z15.boolean().optional(),
2981
+ snapshot: z15.string().optional(),
2982
+ sources: z15.array(toolSearchSourceResultSchema).optional()
2967
2983
  });
2968
- var toolSearchRequestSchema = z14.strictObject({
2969
- opts: z14.strictObject({
2970
- cursor: z14.string().optional(),
2971
- detail: z14.enum(["compact", "full"]).optional(),
2972
- effects: z14.array(z14.enum(["read", "write", "destructive", "unknown"])).min(1).optional(),
2973
- federation: z14.enum(["local", "recursive"]).optional(),
2974
- limit: z14.number().int().optional(),
2975
- matching: z14.enum(["best", "all"]).optional(),
2976
- minCoverage: z14.number().gt(0).max(1).optional(),
2977
- mode: z14.enum(["keyword"]).optional(),
2978
- pathPrefix: z14.string().optional()
2979
- }).optional(),
2980
- query: z14.string().trim().min(1)
2984
+ var toolSearchOptionsSchema = z15.strictObject({
2985
+ cursor: z15.string().optional(),
2986
+ detail: z15.enum(["compact", "full"]).optional(),
2987
+ effects: z15.array(z15.enum(["read", "write", "destructive", "unknown"])).min(1).optional(),
2988
+ federation: z15.enum(["local", "recursive"]).optional(),
2989
+ limit: z15.number().int().optional(),
2990
+ matching: z15.enum(["best", "all"]).optional(),
2991
+ minCoverage: z15.number().gt(0).max(1).optional(),
2992
+ mode: z15.enum(["keyword"]).optional(),
2993
+ pathPrefix: z15.string().optional()
2994
+ });
2995
+ var toolSearchRequestSchema = z15.strictObject({
2996
+ opts: toolSearchOptionsSchema.optional(),
2997
+ query: z15.string().trim().min(1)
2981
2998
  });
2982
- var deviceOperationStateSchema = z14.enum(
2999
+ var deviceOperationStateSchema = z15.enum(
2983
3000
  DEVICE_OPERATION_STATES
2984
3001
  );
2985
- var deviceOperationCallerSchema = z14.object({
2986
- keyId: z14.string().min(1),
2987
- owner: z14.string().min(1)
3002
+ var deviceOperationCallerSchema = z15.object({
3003
+ keyId: z15.string().min(1),
3004
+ owner: z15.string().min(1)
2988
3005
  });
2989
3006
  var deviceOperationSummaryShape = {
2990
- attempt: z14.number().int().nonnegative(),
3007
+ attempt: z15.number().int().nonnegative(),
2991
3008
  caller: deviceOperationCallerSchema,
2992
- cancelRequestedAt: z14.iso.datetime({ offset: true }).optional(),
2993
- createdAt: z14.iso.datetime({ offset: true }),
2994
- deviceId: z14.string().min(1),
2995
- executionMayHaveOccurred: z14.boolean(),
2996
- expiresAt: z14.iso.datetime({ offset: true }),
2997
- leaseUntil: z14.iso.datetime({ offset: true }).optional(),
2998
- mountPath: z14.string().min(1),
2999
- operationId: z14.string().min(1),
3009
+ cancelRequestedAt: z15.iso.datetime({ offset: true }).optional(),
3010
+ createdAt: z15.iso.datetime({ offset: true }),
3011
+ deviceId: z15.string().min(1),
3012
+ executionMayHaveOccurred: z15.boolean(),
3013
+ expiresAt: z15.iso.datetime({ offset: true }),
3014
+ leaseUntil: z15.iso.datetime({ offset: true }).optional(),
3015
+ mountPath: z15.string().min(1),
3016
+ operationId: z15.string().min(1),
3000
3017
  state: deviceOperationStateSchema,
3001
- targetPath: z14.string().min(1),
3002
- terminalAt: z14.iso.datetime({ offset: true }).optional(),
3003
- traceId: z14.string().min(1),
3004
- updatedAt: z14.iso.datetime({ offset: true })
3018
+ targetPath: z15.string().min(1),
3019
+ terminalAt: z15.iso.datetime({ offset: true }).optional(),
3020
+ traceId: z15.string().min(1),
3021
+ updatedAt: z15.iso.datetime({ offset: true })
3005
3022
  };
3006
- var deviceOperationSummarySchema = z14.object(
3023
+ var deviceOperationSummarySchema = z15.object(
3007
3024
  deviceOperationSummaryShape
3008
3025
  );
3009
- var deviceOperationDetailSchema = z14.object({
3026
+ var deviceOperationDetailSchema = z15.object({
3010
3027
  ...deviceOperationSummaryShape,
3011
3028
  error: tbErrorBodySchema.optional(),
3012
- result: z14.json().optional()
3029
+ result: z15.json().optional()
3013
3030
  });
3014
- var deviceOperationListRequestSchema = z14.strictObject({
3015
- deviceId: z14.string().min(1),
3016
- opts: z14.strictObject({
3017
- cursor: z14.string().min(1).optional(),
3018
- limit: z14.number().int().positive().optional(),
3019
- states: z14.array(deviceOperationStateSchema).min(1).optional()
3031
+ var deviceOperationListRequestSchema = z15.strictObject({
3032
+ deviceId: z15.string().min(1),
3033
+ opts: z15.strictObject({
3034
+ cursor: z15.string().min(1).optional(),
3035
+ limit: z15.number().int().positive().optional(),
3036
+ states: z15.array(deviceOperationStateSchema).min(1).optional()
3020
3037
  }).optional()
3021
3038
  });
3022
3039
  var deviceOperationListResponseSchema = pageSchema(deviceOperationSummarySchema);
3023
- var deviceOperationIdentityRequestSchema = z14.strictObject({
3024
- deviceId: z14.string().min(1),
3025
- operationId: z14.string().min(1)
3040
+ var deviceOperationIdentityRequestSchema = z15.strictObject({
3041
+ deviceId: z15.string().min(1),
3042
+ operationId: z15.string().min(1)
3026
3043
  });
3027
- var deviceOperationClaimRequestSchema = z14.strictObject({
3028
- cursor: z14.string().min(1).optional(),
3029
- deviceId: z14.string().min(1),
3030
- limit: z14.number().int().positive().optional()
3044
+ var deviceOperationClaimRequestSchema = z15.strictObject({
3045
+ cursor: z15.string().min(1).optional(),
3046
+ deviceId: z15.string().min(1),
3047
+ limit: z15.number().int().positive().optional()
3031
3048
  });
3032
- var deviceOperationClaimSchema = z14.object({
3033
- arguments: z14.record(z14.string(), z14.json()),
3034
- attempt: z14.number().int().positive(),
3049
+ var deviceOperationClaimSchema = z15.object({
3050
+ arguments: z15.record(z15.string(), z15.json()),
3051
+ attempt: z15.number().int().positive(),
3035
3052
  caller: deviceOperationCallerSchema,
3036
- cancelRequestedAt: z14.iso.datetime({ offset: true }).optional(),
3037
- createdAt: z14.iso.datetime({ offset: true }),
3038
- expiresAt: z14.iso.datetime({ offset: true }),
3039
- leaseId: z14.string().min(1),
3040
- leaseUntil: z14.iso.datetime({ offset: true }),
3041
- operationId: z14.string().min(1),
3042
- path: z14.string().min(1),
3043
- targetPath: z14.string().min(1),
3044
- traceId: z14.string().min(1)
3053
+ cancelRequestedAt: z15.iso.datetime({ offset: true }).optional(),
3054
+ createdAt: z15.iso.datetime({ offset: true }),
3055
+ expiresAt: z15.iso.datetime({ offset: true }),
3056
+ leaseId: z15.string().min(1),
3057
+ leaseUntil: z15.iso.datetime({ offset: true }),
3058
+ operationId: z15.string().min(1),
3059
+ path: z15.string().min(1),
3060
+ targetPath: z15.string().min(1),
3061
+ traceId: z15.string().min(1)
3045
3062
  });
3046
- var deviceOperationClaimResponseSchema = z14.object({
3047
- cursor: z14.string().optional(),
3063
+ var deviceOperationClaimResponseSchema = z15.object({
3064
+ cursor: z15.string().optional(),
3048
3065
  operation: deviceOperationClaimSchema.optional(),
3049
- serverNow: z14.iso.datetime({ offset: true })
3066
+ serverNow: z15.iso.datetime({ offset: true })
3050
3067
  });
3051
3068
  var deviceOperationLeaseShape = {
3052
- deviceId: z14.string().min(1),
3053
- leaseId: z14.string().min(1),
3054
- operationId: z14.string().min(1)
3069
+ deviceId: z15.string().min(1),
3070
+ leaseId: z15.string().min(1),
3071
+ operationId: z15.string().min(1)
3055
3072
  };
3056
- var deviceOperationRenewRequestSchema = z14.strictObject(deviceOperationLeaseShape);
3057
- var deviceOperationRenewResponseSchema = z14.object({
3058
- cancelRequestedAt: z14.iso.datetime({ offset: true }).optional(),
3059
- leaseUntil: z14.iso.datetime({ offset: true }),
3060
- serverNow: z14.iso.datetime({ offset: true })
3073
+ var deviceOperationRenewRequestSchema = z15.strictObject(deviceOperationLeaseShape);
3074
+ var deviceOperationRenewResponseSchema = z15.object({
3075
+ cancelRequestedAt: z15.iso.datetime({ offset: true }).optional(),
3076
+ leaseUntil: z15.iso.datetime({ offset: true }),
3077
+ serverNow: z15.iso.datetime({ offset: true })
3061
3078
  });
3062
- var deviceOperationCompleteRequestSchema = z14.discriminatedUnion("outcome", [
3063
- z14.strictObject({
3079
+ var deviceOperationCompleteRequestSchema = z15.discriminatedUnion("outcome", [
3080
+ z15.strictObject({
3064
3081
  ...deviceOperationLeaseShape,
3065
- outcome: z14.literal("succeeded"),
3066
- result: z14.json()
3082
+ outcome: z15.literal("succeeded"),
3083
+ result: z15.json()
3067
3084
  }),
3068
- z14.strictObject({
3085
+ z15.strictObject({
3069
3086
  ...deviceOperationLeaseShape,
3070
3087
  error: tbErrorBodySchema,
3071
- outcome: z14.literal("rejected")
3088
+ outcome: z15.literal("rejected")
3072
3089
  }),
3073
- z14.strictObject({
3090
+ z15.strictObject({
3074
3091
  ...deviceOperationLeaseShape,
3075
3092
  error: tbErrorBodySchema,
3076
- outcome: z14.literal("failed")
3093
+ outcome: z15.literal("failed")
3077
3094
  }),
3078
- z14.strictObject({
3095
+ z15.strictObject({
3079
3096
  ...deviceOperationLeaseShape,
3080
3097
  error: tbErrorBodySchema.optional(),
3081
- outcome: z14.literal("result_unknown")
3098
+ outcome: z15.literal("result_unknown")
3082
3099
  })
3083
3100
  ]);
3084
- var registryNodeSchema = z14.object({
3085
- config: z14.record(z14.string(), z14.unknown()).optional(),
3086
- createdAt: z14.string().optional(),
3087
- description: z14.string(),
3088
- deviceId: z14.string().optional(),
3101
+ var registryNodeSchema = z15.object({
3102
+ config: z15.record(z15.string(), z15.unknown()).optional(),
3103
+ createdAt: z15.string().optional(),
3104
+ description: z15.string(),
3105
+ deviceId: z15.string().optional(),
3106
+ deviceEnvironment: deviceEnvironmentSchema.optional(),
3107
+ deviceReportedAt: z15.iso.datetime({ offset: true }).optional(),
3089
3108
  kind: nodeKindSchema,
3090
- lastSeenAt: z14.string().optional(),
3091
- online: z14.boolean().optional(),
3092
- path: z14.string(),
3093
- registeredBy: z14.string().optional(),
3094
- updatedAt: z14.string().optional(),
3095
- virtualize: z14.record(z14.string(), z14.unknown()).optional()
3109
+ lastSeenAt: z15.string().optional(),
3110
+ online: z15.boolean().optional(),
3111
+ path: z15.string(),
3112
+ registeredBy: z15.string().optional(),
3113
+ updatedAt: z15.string().optional(),
3114
+ virtualize: z15.record(z15.string(), z15.unknown()).optional()
3096
3115
  });
3097
3116
  var feedbackViewShape = {
3098
- at: z14.string(),
3099
- by: z14.string(),
3100
- down: z14.number().int().nonnegative(),
3101
- id: z14.string(),
3102
- score: z14.number().int(),
3103
- title: z14.string(),
3104
- up: z14.number().int().nonnegative()
3117
+ at: z15.string(),
3118
+ by: z15.string(),
3119
+ down: z15.number().int().nonnegative(),
3120
+ id: z15.string(),
3121
+ score: z15.number().int(),
3122
+ title: z15.string(),
3123
+ up: z15.number().int().nonnegative()
3105
3124
  };
3106
- var feedbackViewSchema = z14.object(feedbackViewShape);
3107
- var feedbackDetailSchema = z14.object({
3125
+ var feedbackViewSchema = z15.object(feedbackViewShape);
3126
+ var feedbackDetailSchema = z15.object({
3108
3127
  ...feedbackViewShape,
3109
- detail: z14.string(),
3110
- path: z14.string()
3128
+ detail: z15.string(),
3129
+ path: z15.string()
3111
3130
  });
3112
- var feedbackListSchema = z14.object({ items: z14.array(feedbackViewSchema) });
3113
- var feedbackSubmitRequestSchema = z14.strictObject({
3114
- detail: z14.string(),
3115
- title: z14.string()
3131
+ var feedbackListSchema = z15.object({ items: z15.array(feedbackViewSchema) });
3132
+ var feedbackSubmitRequestSchema = z15.strictObject({
3133
+ detail: z15.string(),
3134
+ title: z15.string()
3116
3135
  });
3117
- var feedbackSubmitResponseSchema = z14.object({
3118
- at: z14.string().optional(),
3119
- id: z14.string(),
3120
- path: z14.string(),
3121
- title: z14.string()
3136
+ var feedbackSubmitResponseSchema = z15.object({
3137
+ at: z15.string().optional(),
3138
+ id: z15.string(),
3139
+ path: z15.string(),
3140
+ title: z15.string()
3122
3141
  });
3123
- var feedbackVoteRequestSchema = z14.strictObject({
3124
- vote: z14.enum(["up", "down", "clear"])
3142
+ var feedbackVoteRequestSchema = z15.strictObject({
3143
+ vote: z15.enum(["up", "down", "clear"])
3125
3144
  });
3126
- var feedbackRemoveResponseSchema = z14.object({ ok: z14.literal(true) });
3127
- var oauthAuthorizeRequestSchema = z14.strictObject({
3128
- redirectUri: z14.string().optional()
3145
+ var feedbackRemoveResponseSchema = z15.object({ ok: z15.literal(true) });
3146
+ var oauthAuthorizeRequestSchema = z15.strictObject({
3147
+ redirectUri: z15.string().optional()
3129
3148
  });
3130
- var oauthAuthorizeResponseSchema = z14.discriminatedUnion("status", [
3131
- z14.object({ status: z14.literal("authorized") }),
3132
- z14.object({ authorizationUrl: z14.url(), status: z14.literal("redirect") })
3149
+ var oauthAuthorizeResponseSchema = z15.discriminatedUnion("status", [
3150
+ z15.object({ status: z15.literal("authorized") }),
3151
+ z15.object({ authorizationUrl: z15.url(), status: z15.literal("redirect") })
3133
3152
  ]);
3134
- var healthResponseSchema = z14.object({
3135
- catalog: z14.object({
3136
- count: z14.number().int().nonnegative(),
3137
- digest: z14.string()
3153
+ var healthResponseSchema = z15.object({
3154
+ catalog: z15.object({
3155
+ count: z15.number().int().nonnegative(),
3156
+ digest: z15.string()
3138
3157
  }).optional(),
3139
- healthy: z14.boolean(),
3140
- version: z14.string()
3158
+ healthy: z15.boolean(),
3159
+ version: z15.string()
3141
3160
  });
3142
- var livenessResponseSchema = z14.object({ live: z14.boolean() });
3143
- var readinessResponseSchema = z14.object({
3144
- checks: z14.record(z14.string(), z14.object({
3145
- detail: z14.string().optional(),
3146
- ok: z14.boolean()
3161
+ var livenessResponseSchema = z15.object({ live: z15.boolean() });
3162
+ var readinessResponseSchema = z15.object({
3163
+ checks: z15.record(z15.string(), z15.object({
3164
+ detail: z15.string().optional(),
3165
+ ok: z15.boolean()
3147
3166
  })),
3148
- ready: z14.boolean()
3167
+ ready: z15.boolean()
3149
3168
  });
3150
3169
 
3151
3170
  // ../core/src/builtin/registry.ts
@@ -3168,8 +3187,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
3168
3187
  "list",
3169
3188
  {
3170
3189
  h: "list registered nodes, optionally under a path prefix",
3171
- inputSchema: z15.strictObject({
3172
- prefix: z15.string().optional().describe("only nodes under this path prefix"),
3190
+ inputSchema: z16.strictObject({
3191
+ prefix: z16.string().optional().describe("only nodes under this path prefix"),
3173
3192
  opts: HTBP_LIST_OPTIONS_SCHEMA.optional()
3174
3193
  }),
3175
3194
  returns: "Page<Node>",
@@ -3185,8 +3204,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
3185
3204
  "get",
3186
3205
  {
3187
3206
  h: "fetch one node registration (kind, description, config) by path",
3188
- inputSchema: z15.strictObject({
3189
- path: z15.string().min(1).describe("exact tree path")
3207
+ inputSchema: z16.strictObject({
3208
+ path: z16.string().min(1).describe("exact tree path")
3190
3209
  }),
3191
3210
  returns: "Node",
3192
3211
  scope: "read"
@@ -3210,8 +3229,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
3210
3229
  "update",
3211
3230
  {
3212
3231
  h: "patch fields of a mounted node (description, config, virtualize, \u2026) without remounting",
3213
- inputSchema: z15.strictObject({
3214
- path: z15.string().min(1).describe("exact tree path"),
3232
+ inputSchema: z16.strictObject({
3233
+ path: z16.string().min(1).describe("exact tree path"),
3215
3234
  patch: nodePatchSchema
3216
3235
  }),
3217
3236
  returns: "Node",
@@ -3222,8 +3241,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
3222
3241
  "delete",
3223
3242
  {
3224
3243
  h: "unmount a node (and reclaim empty auto-created parents); a node registered by another key can only be removed by its registrar or by a key holding the 'admin' scope on that path",
3225
- inputSchema: z15.strictObject({
3226
- path: z15.string().min(1).describe("exact tree path")
3244
+ inputSchema: z16.strictObject({
3245
+ path: z16.string().min(1).describe("exact tree path")
3227
3246
  }),
3228
3247
  returns: "void",
3229
3248
  scope: "register"
@@ -3238,7 +3257,7 @@ function createRegistryModule(store, now, visibility) {
3238
3257
  }
3239
3258
 
3240
3259
  // ../core/src/builtin/secret.ts
3241
- import { z as z16 } from "zod/v4";
3260
+ import { z as z17 } from "zod/v4";
3242
3261
  var DESCRIPTION7 = "Upstream credential vault: write-only; mounts reference entries by name (authRef), values can never be read back (admin only)";
3243
3262
  function assertUserSecretName(name) {
3244
3263
  if (name.includes(":")) {
@@ -3252,11 +3271,11 @@ var COMMANDS7 = new BuiltinCommandRegistry("secret", DESCRIPTION7).register(
3252
3271
  "set",
3253
3272
  {
3254
3273
  h: "store or rotate a credential under a name; mount configs reference it as authRef",
3255
- inputSchema: z16.strictObject({
3256
- name: z16.string().min(1).describe(
3274
+ inputSchema: z17.strictObject({
3275
+ name: z17.string().min(1).describe(
3257
3276
  'reference name used as authRef in mount configs (":" is reserved)'
3258
3277
  ),
3259
- value: z16.string().min(1).describe(
3278
+ value: z17.string().min(1).describe(
3260
3279
  "the credential (token / key / JSON); encrypted at rest, never echoed"
3261
3280
  )
3262
3281
  }),
@@ -3272,7 +3291,7 @@ var COMMANDS7 = new BuiltinCommandRegistry("secret", DESCRIPTION7).register(
3272
3291
  "list",
3273
3292
  {
3274
3293
  h: "list stored credential names (names and timestamps only, never values)",
3275
- inputSchema: z16.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
3294
+ inputSchema: z17.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
3276
3295
  returns: "Page<{ name, updatedAt }>",
3277
3296
  scope: "admin"
3278
3297
  },
@@ -3281,8 +3300,8 @@ var COMMANDS7 = new BuiltinCommandRegistry("secret", DESCRIPTION7).register(
3281
3300
  "delete",
3282
3301
  {
3283
3302
  h: "delete a credential; mounts still referencing it will fail to resolve",
3284
- inputSchema: z16.strictObject({
3285
- name: z16.string().min(1).describe("reference name")
3303
+ inputSchema: z17.strictObject({
3304
+ name: z17.string().min(1).describe("reference name")
3286
3305
  }),
3287
3306
  returns: "void",
3288
3307
  scope: "admin"
@@ -3298,13 +3317,13 @@ function createSecretModule(store, now) {
3298
3317
  }
3299
3318
 
3300
3319
  // ../core/src/builtin/status.ts
3301
- import { z as z17 } from "zod/v4";
3320
+ import { z as z18 } from "zod/v4";
3302
3321
  var DESCRIPTION8 = "Gateway health and summary (readable without admin)";
3303
3322
  var COMMANDS8 = new BuiltinCommandRegistry("status", DESCRIPTION8).register(
3304
3323
  "get",
3305
3324
  {
3306
3325
  h: "health summary: gateway version and node count; no arguments",
3307
- inputSchema: z17.strictObject({}),
3326
+ inputSchema: z18.strictObject({}),
3308
3327
  returns: "{ healthy, version, nodeCount }",
3309
3328
  scope: "read"
3310
3329
  },
@@ -3322,41 +3341,41 @@ function createStatusModule(deps) {
3322
3341
  }
3323
3342
 
3324
3343
  // ../core/src/builtin/sk.ts
3325
- import { z as z18 } from "zod/v4";
3344
+ import { z as z19 } from "zod/v4";
3326
3345
  var DESCRIPTION9 = "Secret Key registry: issue / list / update / revoke access keys (the only credential form; admin only)";
3327
- var actionSchema2 = z18.enum(["read", "write", "call", "register", "admin"]);
3328
- var scopeSchema = z18.strictObject({
3329
- pattern: z18.string().describe('tree path glob, e.g. "**" (everything) or "docs/**"'),
3330
- actions: z18.array(actionSchema2),
3331
- effect: z18.enum(["allow", "deny"]).optional().describe('default "allow"')
3346
+ var actionSchema2 = z19.enum(["read", "write", "call", "register", "admin"]);
3347
+ var scopeSchema = z19.strictObject({
3348
+ pattern: z19.string().describe('tree path glob, e.g. "**" (everything) or "docs/**"'),
3349
+ actions: z19.array(actionSchema2),
3350
+ effect: z19.enum(["allow", "deny"]).optional().describe('default "allow"')
3332
3351
  });
3333
- var ownerSchema = z18.string().min(1).describe(
3352
+ var ownerSchema = z19.string().min(1).describe(
3334
3353
  'owner ref: "user:<name>" | "agent:<name>" | "device:<id>"'
3335
3354
  );
3336
- var descriptionSchema = z18.string().optional().describe("what this key is for (shown in list)");
3337
- var scopesSchema = z18.array(scopeSchema).describe(
3355
+ var descriptionSchema = z19.string().optional().describe("what this key is for (shown in list)");
3356
+ var scopesSchema = z19.array(scopeSchema).describe(
3338
3357
  "permission grants; deny wins over allow, no match = denied"
3339
3358
  );
3340
- var registerPathsSchema = z18.array(z18.string()).optional().describe(
3359
+ var registerPathsSchema = z19.array(z19.string()).optional().describe(
3341
3360
  "path prefixes this key may self-register nodes under (via ~register)"
3342
3361
  );
3343
- var expiresAtSchema = z18.string().optional().describe(
3362
+ var expiresAtSchema = z19.string().optional().describe(
3344
3363
  "expiry, ISO 8601 timestamp with timezone; omit = never"
3345
3364
  );
3346
- var writeSchema = z18.strictObject({
3365
+ var writeSchema = z19.strictObject({
3347
3366
  owner: ownerSchema,
3348
3367
  description: descriptionSchema,
3349
3368
  scopes: scopesSchema,
3350
3369
  registerPaths: registerPathsSchema,
3351
3370
  expiresAt: expiresAtSchema
3352
3371
  });
3353
- var patchSchema2 = z18.strictObject({
3372
+ var patchSchema2 = z19.strictObject({
3354
3373
  owner: ownerSchema.optional(),
3355
3374
  description: descriptionSchema,
3356
3375
  scopes: scopesSchema.optional(),
3357
3376
  registerPaths: registerPathsSchema,
3358
3377
  expiresAt: expiresAtSchema,
3359
- disabled: z18.boolean().optional().describe("true = key rejected until re-enabled")
3378
+ disabled: z19.boolean().optional().describe("true = key rejected until re-enabled")
3360
3379
  }).describe("fields to change; same shape as write (all optional) plus disabled");
3361
3380
  function toSecretKeyInput(input) {
3362
3381
  return {
@@ -3381,7 +3400,7 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
3381
3400
  "list",
3382
3401
  {
3383
3402
  h: "list issued keys (id, owner, scopes; the secret itself is never returned)",
3384
- inputSchema: z18.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
3403
+ inputSchema: z19.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
3385
3404
  returns: "Page<SecretKey without hash>",
3386
3405
  scope: "admin"
3387
3406
  },
@@ -3390,8 +3409,8 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
3390
3409
  "get",
3391
3410
  {
3392
3411
  h: "fetch one key by id",
3393
- inputSchema: z18.strictObject({
3394
- id: z18.string().min(1).describe("key id (from list or the issue response)")
3412
+ inputSchema: z19.strictObject({
3413
+ id: z19.string().min(1).describe("key id (from list or the issue response)")
3395
3414
  }),
3396
3415
  returns: "SecretKey without hash",
3397
3416
  scope: "admin"
@@ -3410,8 +3429,8 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
3410
3429
  "update",
3411
3430
  {
3412
3431
  h: "patch fields of an issued key (scopes, expiresAt, disabled, \u2026); takes effect immediately",
3413
- inputSchema: z18.strictObject({
3414
- id: z18.string().min(1).describe("key id"),
3432
+ inputSchema: z19.strictObject({
3433
+ id: z19.string().min(1).describe("key id"),
3415
3434
  patch: patchSchema2
3416
3435
  }),
3417
3436
  returns: "SecretKey without hash",
@@ -3422,7 +3441,7 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
3422
3441
  "delete",
3423
3442
  {
3424
3443
  h: "revoke a key permanently; takes effect immediately",
3425
- inputSchema: z18.strictObject({ id: z18.string().min(1).describe("key id") }),
3444
+ inputSchema: z19.strictObject({ id: z19.string().min(1).describe("key id") }),
3426
3445
  returns: "void",
3427
3446
  scope: "admin"
3428
3447
  },
@@ -3436,24 +3455,24 @@ function createSkModule(store, now) {
3436
3455
  }
3437
3456
 
3438
3457
  // ../core/src/builtin/keys.ts
3439
- import { z as z20 } from "zod";
3458
+ import { z as z21 } from "zod";
3440
3459
 
3441
3460
  // ../core/src/keyManagement.ts
3442
- import { z as z19 } from "zod";
3443
- var keyRotateSchema = z19.strictObject({
3444
- expectedRevision: z19.number().int().nonnegative(),
3445
- target: z19.enum(["encryption", "signing"]),
3446
- revokeExisting: z19.boolean().optional()
3461
+ import { z as z20 } from "zod";
3462
+ var keyRotateSchema = z20.strictObject({
3463
+ expectedRevision: z20.number().int().nonnegative(),
3464
+ target: z20.enum(["encryption", "signing"]),
3465
+ revokeExisting: z20.boolean().optional()
3447
3466
  });
3448
- var keyRetireSchema = z19.strictObject({
3449
- expectedRevision: z19.number().int().nonnegative(),
3450
- keyId: z19.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
3451
- target: z19.enum(["encryption", "signing"])
3467
+ var keyRetireSchema = z20.strictObject({
3468
+ expectedRevision: z20.number().int().nonnegative(),
3469
+ keyId: z20.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
3470
+ target: z20.enum(["encryption", "signing"])
3452
3471
  });
3453
- var keyResumeSchema = z19.strictObject({ jobId: z19.string().min(1).max(128) });
3472
+ var keyResumeSchema = z20.strictObject({ jobId: z20.string().min(1).max(128) });
3454
3473
 
3455
3474
  // ../core/src/builtin/keys.ts
3456
- var commands = new BuiltinCommandRegistry("keys", "\u52A0\u5BC6\u6839\u3001\u7B7E\u540D\u5BC6\u94A5\u4E0E\u53EF\u6062\u590D\u8F6E\u6362\uFF08\u7BA1\u7406\u5458\uFF09").register("status", { inputSchema: z20.strictObject({}), scope: "admin", h: "\u67E5\u770B\u5BC6\u94A5\u7248\u672C\u3001\u5F15\u7528\u548C\u8F6E\u6362\u8FDB\u5EA6\uFF0C\u4E0D\u542B\u6839\u6750\u6599", returns: "KeyStatus" }, async (_, { deps }) => deps.status()).register("rotate", { inputSchema: keyRotateSchema, scope: "admin", h: "\u7EF4\u62A4\u7A97\u53E3\u5185\u751F\u6210\u65B0\u6839\uFF1B\u65E7\u6839\u9ED8\u8BA4\u4FDD\u7559\uFF0C\u91CD\u52A0\u5BC6\u53EF\u6062\u590D", returns: "KeyStatus" }, async (input, { deps }) => deps.rotate(input)).register("resume", { inputSchema: keyResumeSchema, scope: "admin", h: "\u7EE7\u7EED\u4E00\u6279\u91CD\u52A0\u5BC6\u4EFB\u52A1\uFF0C\u5B8C\u6210\u540E\u68C0\u67E5\u65E7\u5BC6\u6587\u5F15\u7528", returns: "KeyStatus" }, async (input, { deps }) => deps.resume(input)).register("retire", { inputSchema: keyRetireSchema, scope: "admin", h: "\u4EC5\u5728\u65E0\u5F15\u7528\u4E14\u7B7E\u540D\u5B89\u5168\u7A97\u53E3\u5DF2\u8FC7\u540E\u5220\u9664\u65E7\u6839", returns: "KeyStatus" }, async (input, { deps }) => deps.retire(input)).register("backup", { inputSchema: z20.strictObject({}), scope: "admin", h: "\u663E\u5F0F\u5BFC\u51FA\u5305\u542B\u5BC6\u94A5\u7684\u5B9E\u4F8B\u6062\u590D\u6587\u4EF6\uFF1B\u8BF7\u5B89\u5168\u4FDD\u5B58", returns: "KeyBackup" }, async (_, { deps }) => deps.backup());
3475
+ var commands = new BuiltinCommandRegistry("keys", "\u52A0\u5BC6\u6839\u3001\u7B7E\u540D\u5BC6\u94A5\u4E0E\u53EF\u6062\u590D\u8F6E\u6362\uFF08\u7BA1\u7406\u5458\uFF09").register("status", { inputSchema: z21.strictObject({}), scope: "admin", h: "\u67E5\u770B\u5BC6\u94A5\u7248\u672C\u3001\u5F15\u7528\u548C\u8F6E\u6362\u8FDB\u5EA6\uFF0C\u4E0D\u542B\u6839\u6750\u6599", returns: "KeyStatus" }, async (_, { deps }) => deps.status()).register("rotate", { inputSchema: keyRotateSchema, scope: "admin", h: "\u7EF4\u62A4\u7A97\u53E3\u5185\u751F\u6210\u65B0\u6839\uFF1B\u65E7\u6839\u9ED8\u8BA4\u4FDD\u7559\uFF0C\u91CD\u52A0\u5BC6\u53EF\u6062\u590D", returns: "KeyStatus" }, async (input, { deps }) => deps.rotate(input)).register("resume", { inputSchema: keyResumeSchema, scope: "admin", h: "\u7EE7\u7EED\u4E00\u6279\u91CD\u52A0\u5BC6\u4EFB\u52A1\uFF0C\u5B8C\u6210\u540E\u68C0\u67E5\u65E7\u5BC6\u6587\u5F15\u7528", returns: "KeyStatus" }, async (input, { deps }) => deps.resume(input)).register("retire", { inputSchema: keyRetireSchema, scope: "admin", h: "\u4EC5\u5728\u65E0\u5F15\u7528\u4E14\u7B7E\u540D\u5B89\u5168\u7A97\u53E3\u5DF2\u8FC7\u540E\u5220\u9664\u65E7\u6839", returns: "KeyStatus" }, async (input, { deps }) => deps.retire(input)).register("backup", { inputSchema: z21.strictObject({}), scope: "admin", h: "\u663E\u5F0F\u5BFC\u51FA\u5305\u542B\u5BC6\u94A5\u7684\u5B9E\u4F8B\u6062\u590D\u6587\u4EF6\uFF1B\u8BF7\u5B89\u5168\u4FDD\u5B58", returns: "KeyBackup" }, async (_, { deps }) => deps.backup());
3457
3476
  var createKeysModule = (deps) => commands.module(deps);
3458
3477
 
3459
3478
  // ../core/src/builtin/index.ts
@@ -3498,47 +3517,47 @@ function createBuiltins(deps) {
3498
3517
  }
3499
3518
 
3500
3519
  // ../core/src/builtin/deployment.ts
3501
- import { z as z22 } from "zod";
3520
+ import { z as z23 } from "zod";
3502
3521
 
3503
3522
  // ../core/src/deployment.ts
3504
- import { z as z21 } from "zod";
3505
- var directory = z21.string().min(2).startsWith("/").refine((value) => !/(?:^|\/)\.\.(?:\/|$)/.test(value) && !/^\/(?:etc|proc|sys|dev|var\/run)(?:\/|$)/.test(value), "\u8BF7\u9009\u62E9\u90E8\u7F72\u76EE\u5F55\u5185\u7684\u7EDD\u5BF9\u8DEF\u5F84");
3506
- var deploymentSettingsSchema = z21.strictObject({
3507
- image: z21.string().min(1).max(512).regex(/^[a-zA-Z0-9][a-zA-Z0-9._:/@-]*$/).describe("\u5E94\u7528\u955C\u50CF"),
3508
- hostPort: z21.number().int().min(1).max(65535).describe("\u5BBF\u4E3B\u8BBF\u95EE\u7AEF\u53E3"),
3509
- bindAddress: z21.enum(["127.0.0.1", "0.0.0.0"]).describe("\u76D1\u542C\u8303\u56F4"),
3523
+ import { z as z22 } from "zod";
3524
+ var directory = z22.string().min(2).startsWith("/").refine((value) => !/(?:^|\/)\.\.(?:\/|$)/.test(value) && !/^\/(?:etc|proc|sys|dev|var\/run)(?:\/|$)/.test(value), "\u8BF7\u9009\u62E9\u90E8\u7F72\u76EE\u5F55\u5185\u7684\u7EDD\u5BF9\u8DEF\u5F84");
3525
+ var deploymentSettingsSchema = z22.strictObject({
3526
+ image: z22.string().min(1).max(512).regex(/^[a-zA-Z0-9][a-zA-Z0-9._:/@-]*$/).describe("\u5E94\u7528\u955C\u50CF"),
3527
+ hostPort: z22.number().int().min(1).max(65535).describe("\u5BBF\u4E3B\u8BBF\u95EE\u7AEF\u53E3"),
3528
+ bindAddress: z22.enum(["127.0.0.1", "0.0.0.0"]).describe("\u76D1\u542C\u8303\u56F4"),
3510
3529
  stateDirectory: directory.optional().describe("\u5BBF\u4E3B\u6570\u636E\u76EE\u5F55\uFF08\u53EF\u9009\uFF09"),
3511
3530
  uiDirectory: directory.optional().describe("\u5BBF\u4E3B\u7BA1\u7406\u754C\u9762\u76EE\u5F55\uFF08\u53EF\u9009\uFF09")
3512
3531
  });
3513
- var deploymentUpdateSchema = z21.strictObject({ expectedRevision: z21.number().int().nonnegative(), settings: deploymentSettingsSchema });
3514
- var deploymentClaimSchema = z21.strictObject({ agentId: z21.string().min(1).max(128), instanceId: z21.string().min(1), observed: deploymentSettingsSchema });
3515
- var deploymentCompleteSchema = z21.strictObject({ jobId: z21.string().min(1), leaseToken: z21.string().min(1), ok: z21.boolean(), error: z21.enum(["preflight_failed", "apply_failed", "health_failed", "rollback_failed"]).optional() });
3532
+ var deploymentUpdateSchema = z22.strictObject({ expectedRevision: z22.number().int().nonnegative(), settings: deploymentSettingsSchema });
3533
+ var deploymentClaimSchema = z22.strictObject({ agentId: z22.string().min(1).max(128), instanceId: z22.string().min(1), observed: deploymentSettingsSchema });
3534
+ var deploymentCompleteSchema = z22.strictObject({ jobId: z22.string().min(1), leaseToken: z22.string().min(1), ok: z22.boolean(), error: z22.enum(["preflight_failed", "apply_failed", "health_failed", "rollback_failed"]).optional() });
3516
3535
 
3517
3536
  // ../core/src/builtin/deployment.ts
3518
- var commands2 = new BuiltinCommandRegistry("deployment", "\u90E8\u7F72\u6267\u884C\u5668\u3001\u671F\u671B\u914D\u7F6E\u4E0E\u5B9E\u9645\u751F\u6548\u72B6\u6001\uFF08\u7BA1\u7406\u5458\uFF09").register("schema", { inputSchema: z22.strictObject({}), scope: "admin", h: "\u67E5\u8BE2\u90E8\u7F72\u8BBE\u7F6E\u5B57\u6BB5", returns: "JSON Schema" }, async () => z22.toJSONSchema(deploymentSettingsSchema)).register("get", { inputSchema: z22.strictObject({}), scope: "admin", h: "\u8BFB\u53D6\u90E8\u7F72\u914D\u7F6E\u4E0E\u6267\u884C\u5668\u72B6\u6001", returns: "DeploymentStatus" }, async (_, { deps }) => deps.get()).register("status", { inputSchema: z22.strictObject({}), scope: "admin", h: "\u6838\u5BF9\u90E8\u7F72\u4EFB\u52A1\u4E0E\u5DF2\u5E94\u7528\u7248\u672C", returns: "DeploymentStatus" }, async (_, { deps }) => deps.get()).register("update", { inputSchema: deploymentUpdateSchema, scope: "admin", h: "\u4FDD\u5B58\u914D\u7F6E\u5E76\u521B\u5EFA\u767D\u540D\u5355\u90E8\u7F72\u4EFB\u52A1", returns: "DeploymentStatus" }, async (input, { deps }) => deps.update(input)).register("claim", { inputSchema: deploymentClaimSchema, scope: "admin", h: "\u672C\u673A\u6267\u884C\u5668\u72EC\u5360\u9886\u53D6\u56FA\u5B9A\u90E8\u7F72\u4EFB\u52A1", returns: "{job:DeploymentClaim|null}" }, async (input, { deps }) => deps.claim(input)).register("complete", { inputSchema: deploymentCompleteSchema, scope: "admin", h: "\u63D0\u4EA4\u5B9E\u4F8B\u68C0\u67E5\u6216\u6062\u590D\u7ED3\u679C", returns: "DeploymentStatus" }, async (input, { deps }) => deps.complete(input));
3537
+ var commands2 = new BuiltinCommandRegistry("deployment", "\u90E8\u7F72\u6267\u884C\u5668\u3001\u671F\u671B\u914D\u7F6E\u4E0E\u5B9E\u9645\u751F\u6548\u72B6\u6001\uFF08\u7BA1\u7406\u5458\uFF09").register("schema", { inputSchema: z23.strictObject({}), scope: "admin", h: "\u67E5\u8BE2\u90E8\u7F72\u8BBE\u7F6E\u5B57\u6BB5", returns: "JSON Schema" }, async () => z23.toJSONSchema(deploymentSettingsSchema)).register("get", { inputSchema: z23.strictObject({}), scope: "admin", h: "\u8BFB\u53D6\u90E8\u7F72\u914D\u7F6E\u4E0E\u6267\u884C\u5668\u72B6\u6001", returns: "DeploymentStatus" }, async (_, { deps }) => deps.get()).register("status", { inputSchema: z23.strictObject({}), scope: "admin", h: "\u6838\u5BF9\u90E8\u7F72\u4EFB\u52A1\u4E0E\u5DF2\u5E94\u7528\u7248\u672C", returns: "DeploymentStatus" }, async (_, { deps }) => deps.get()).register("update", { inputSchema: deploymentUpdateSchema, scope: "admin", h: "\u4FDD\u5B58\u914D\u7F6E\u5E76\u521B\u5EFA\u767D\u540D\u5355\u90E8\u7F72\u4EFB\u52A1", returns: "DeploymentStatus" }, async (input, { deps }) => deps.update(input)).register("claim", { inputSchema: deploymentClaimSchema, scope: "admin", h: "\u672C\u673A\u6267\u884C\u5668\u72EC\u5360\u9886\u53D6\u56FA\u5B9A\u90E8\u7F72\u4EFB\u52A1", returns: "{job:DeploymentClaim|null}" }, async (input, { deps }) => deps.claim(input)).register("complete", { inputSchema: deploymentCompleteSchema, scope: "admin", h: "\u63D0\u4EA4\u5B9E\u4F8B\u68C0\u67E5\u6216\u6062\u590D\u7ED3\u679C", returns: "DeploymentStatus" }, async (input, { deps }) => deps.complete(input));
3519
3538
  var createDeploymentModule = (deps) => commands2.module(deps);
3520
3539
 
3521
3540
  // ../core/src/builtin/maintenance.ts
3522
- import { z as z24 } from "zod";
3541
+ import { z as z25 } from "zod";
3523
3542
 
3524
3543
  // ../core/src/maintenance.ts
3525
- import { z as z23 } from "zod";
3526
- var revision = z23.number().int().nonnegative();
3527
- var databaseUrl = z23.string().min(1).max(8192);
3528
- var databaseMigrationSchema = z23.strictObject({
3544
+ import { z as z24 } from "zod";
3545
+ var revision = z24.number().int().nonnegative();
3546
+ var databaseUrl = z24.string().min(1).max(8192);
3547
+ var databaseMigrationSchema = z24.strictObject({
3529
3548
  expectedRevision: revision,
3530
- expectedInstanceId: z23.string().min(1),
3549
+ expectedInstanceId: z24.string().min(1),
3531
3550
  databaseUrl
3532
3551
  });
3533
- var databaseCredentialRotationSchema = z23.strictObject({
3552
+ var databaseCredentialRotationSchema = z24.strictObject({
3534
3553
  databaseAdminUrl: databaseUrl.optional(),
3535
3554
  expectedRevision: revision,
3536
- expectedInstanceId: z23.string().min(1),
3537
- password: z23.string().min(24).max(4096)
3555
+ expectedInstanceId: z24.string().min(1),
3556
+ password: z24.string().min(24).max(4096)
3538
3557
  });
3539
- var redisMaintenanceSchema = z23.strictObject({
3558
+ var redisMaintenanceSchema = z24.strictObject({
3540
3559
  expectedRevision: revision,
3541
- redisUrl: z23.string().min(1).max(8192).nullable()
3560
+ redisUrl: z24.string().min(1).max(8192).nullable()
3542
3561
  });
3543
3562
 
3544
3563
  // ../core/src/builtin/maintenance.ts
@@ -3548,7 +3567,7 @@ var commands3 = new BuiltinCommandRegistry(
3548
3567
  ).register(
3549
3568
  "status",
3550
3569
  {
3551
- inputSchema: z24.strictObject({}),
3570
+ inputSchema: z25.strictObject({}),
3552
3571
  scope: "admin",
3553
3572
  h: "\u7EF4\u62A4\u9636\u6BB5\u53CA\u5DF2\u8131\u654F\u7684\u8FDE\u63A5\u72B6\u6001",
3554
3573
  returns: "MaintenanceStatus"
@@ -3585,20 +3604,20 @@ var commands3 = new BuiltinCommandRegistry(
3585
3604
  var createMaintenanceModule = (deps) => commands3.module(deps);
3586
3605
 
3587
3606
  // ../core/src/builtin/management.ts
3588
- import { z as z26 } from "zod";
3607
+ import { z as z27 } from "zod";
3589
3608
 
3590
3609
  // ../core/src/managedConfig.ts
3591
- import { z as z25 } from "zod";
3610
+ import { z as z26 } from "zod";
3592
3611
 
3593
3612
  // ../core/src/runtimeConfig.ts
3594
3613
  var DEFAULT_MAX_HOPS = 4;
3595
3614
 
3596
3615
  // ../core/src/managedConfig.ts
3597
- var positive = z25.number().int().positive().max(Number.MAX_SAFE_INTEGER);
3616
+ var positive = z26.number().int().positive().max(Number.MAX_SAFE_INTEGER);
3598
3617
  var ttl = positive.max(604800);
3599
- var runtimeConfigSchema = z25.strictObject({
3600
- canonicalOrigin: z25.union([z25.literal(""), z25.url({ protocol: /^https?$/ })]).default("").describe("\u516C\u5F00\u8BBF\u95EE\u5730\u5740"),
3601
- remoteAllowlist: z25.array(z25.string().min(1)).default([]).describe("\u5141\u8BB8\u8054\u90A6\u8FDE\u63A5\u7684\u4E3B\u673A"),
3618
+ var runtimeConfigSchema = z26.strictObject({
3619
+ canonicalOrigin: z26.union([z26.literal(""), z26.url({ protocol: /^https?$/ })]).default("").describe("\u516C\u5F00\u8BBF\u95EE\u5730\u5740"),
3620
+ remoteAllowlist: z26.array(z26.string().min(1)).default([]).describe("\u5141\u8BB8\u8054\u90A6\u8FDE\u63A5\u7684\u4E3B\u673A"),
3602
3621
  maxHops: positive.max(16).default(DEFAULT_MAX_HOPS).describe("\u8054\u90A6\u6700\u5927\u8DF3\u6570"),
3603
3622
  deviceReclaimSec: positive.max(2147483).default(86400).describe("\u79BB\u7EBF\u8BBE\u5907\u56DE\u6536\u7B49\u5F85\uFF08\u79D2\uFF09"),
3604
3623
  toolCacheTtlSec: positive.default(300).describe("\u5DE5\u5177\u7F13\u5B58\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
@@ -3610,7 +3629,7 @@ var runtimeConfigSchema = z25.strictObject({
3610
3629
  storeCallMaxBytes: positive.default(536870912).describe("\u5355\u6B21\u8C03\u7528\u7D2F\u8BA1\u4E0A\u4F20\u5927\u5C0F\uFF08\u5B57\u8282\uFF09"),
3611
3630
  storeCallMaxObjectBytes: positive.max(1073741824).default(268435456).describe("\u8C03\u7528\u5185\u5355\u4E2A\u5BF9\u8C61\u6700\u5927\u5927\u5C0F\uFF08\u5B57\u8282\uFF09"),
3612
3631
  storeCallMaxObjects: positive.default(4).describe("\u5355\u6B21\u8C03\u7528\u6700\u591A\u5BF9\u8C61\u6570"),
3613
- storeCallAllowedContentTypes: z25.array(z25.string().min(1)).min(1).default(["*/*"]).describe("\u8C03\u7528\u4E0A\u4F20\u5141\u8BB8\u7684 MIME \u7C7B\u578B"),
3632
+ storeCallAllowedContentTypes: z26.array(z26.string().min(1)).min(1).default(["*/*"]).describe("\u8C03\u7528\u4E0A\u4F20\u5141\u8BB8\u7684 MIME \u7C7B\u578B"),
3614
3633
  storeUploadTtlSec: ttl.default(900).describe("\u4E0A\u4F20\u4F1A\u8BDD\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
3615
3634
  storeShareTtlSec: ttl.default(900).describe("\u5206\u4EAB\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
3616
3635
  storeReadTtlSec: ttl.default(900).describe("\u4E0B\u8F7D\u5F15\u7528\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
@@ -3622,37 +3641,37 @@ var runtimeConfigSchema = z25.strictObject({
3622
3641
  searchMinChildWorkMs: positive.default(200).describe("\u5B50\u641C\u7D22\u6700\u5C11\u5DE5\u4F5C\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09"),
3623
3642
  searchReturnReserveMs: positive.default(100).describe("\u641C\u7D22\u8FD4\u56DE\u9884\u7559\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09"),
3624
3643
  searchSessionTtlSec: positive.default(300).describe("\u641C\u7D22\u5FEB\u7167\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
3625
- shutdownDrainSec: z25.number().int().min(0).max(300).default(0).describe("\u5173\u505C\u6392\u7A7A\u7B49\u5F85\uFF08\u79D2\uFF09")
3644
+ shutdownDrainSec: z26.number().int().min(0).max(300).default(0).describe("\u5173\u505C\u6392\u7A7A\u7B49\u5F85\uFF08\u79D2\uFF09")
3626
3645
  });
3627
- var configUpdateSchema = z25.strictObject({
3628
- expectedRevision: z25.number().int().nonnegative(),
3646
+ var configUpdateSchema = z26.strictObject({
3647
+ expectedRevision: z26.number().int().nonnegative(),
3629
3648
  settings: runtimeConfigSchema
3630
3649
  });
3631
- var revisionSchema = z25.strictObject({ expectedRevision: z25.number().int().nonnegative() });
3632
- var s3ConnectionSchema = z25.strictObject({
3633
- endpoint: z25.url(),
3634
- bucket: z25.string().min(1).max(255),
3635
- region: z25.string().min(1).default("us-east-1"),
3636
- accessKeyId: z25.string().min(1).max(4096),
3637
- secretAccessKey: z25.string().min(1).max(4096)
3650
+ var revisionSchema = z26.strictObject({ expectedRevision: z26.number().int().nonnegative() });
3651
+ var s3ConnectionSchema = z26.strictObject({
3652
+ endpoint: z26.url(),
3653
+ bucket: z26.string().min(1).max(255),
3654
+ region: z26.string().min(1).default("us-east-1"),
3655
+ accessKeyId: z26.string().min(1).max(4096),
3656
+ secretAccessKey: z26.string().min(1).max(4096)
3638
3657
  });
3639
- var storageWriteSchema = z25.strictObject({
3640
- name: z25.string().min(1).max(120),
3658
+ var storageWriteSchema = z26.strictObject({
3659
+ name: z26.string().min(1).max(120),
3641
3660
  connection: s3ConnectionSchema
3642
3661
  });
3643
- var storageIdSchema = z25.strictObject({ id: z25.string().min(1).max(128) });
3662
+ var storageIdSchema = z26.strictObject({ id: z26.string().min(1).max(128) });
3644
3663
  var storageRevisionSchema = storageIdSchema.extend({
3645
- expectedRevision: z25.number().int().nonnegative()
3664
+ expectedRevision: z26.number().int().nonnegative()
3646
3665
  });
3647
3666
  var storageActivateSchema = storageRevisionSchema.extend({
3648
- expectedActiveRevision: z25.number().int().nonnegative()
3667
+ expectedActiveRevision: z26.number().int().nonnegative()
3649
3668
  });
3650
3669
  var storageRotateSchema = storageRevisionSchema.extend({
3651
- accessKeyId: z25.string().min(1),
3652
- secretAccessKey: z25.string().min(1)
3670
+ accessKeyId: z26.string().min(1),
3671
+ secretAccessKey: z26.string().min(1)
3653
3672
  });
3654
- var setupInputSchema = z25.strictObject({
3655
- databaseUrl: z25.string().min(1).refine((value) => {
3673
+ var setupInputSchema = z26.strictObject({
3674
+ databaseUrl: z26.string().min(1).refine((value) => {
3656
3675
  try {
3657
3676
  return ["postgres:", "postgresql:"].includes(new URL(value).protocol);
3658
3677
  } catch {
@@ -3660,47 +3679,47 @@ var setupInputSchema = z25.strictObject({
3660
3679
  }
3661
3680
  }, "\u9700\u8981 PostgreSQL \u8FDE\u63A5\u5730\u5740").optional(),
3662
3681
  storage: s3ConnectionSchema.optional(),
3663
- redisUrl: z25.string().optional(),
3682
+ redisUrl: z26.string().optional(),
3664
3683
  settings: runtimeConfigSchema.default(() => runtimeConfigSchema.parse({}))
3665
3684
  });
3666
- var setupStatusSchema = z25.object({
3667
- state: z25.enum(["setup", "installing", "ready", "recovery"]),
3668
- instanceId: z25.string().min(1),
3669
- pairingRequired: z25.boolean()
3685
+ var setupStatusSchema = z26.object({
3686
+ state: z26.enum(["setup", "installing", "ready", "recovery"]),
3687
+ instanceId: z26.string().min(1),
3688
+ pairingRequired: z26.boolean()
3670
3689
  });
3671
- var setupDefaultsSchema = z25.object({
3672
- databaseConfigured: z25.boolean(),
3673
- databaseHost: z25.string().optional(),
3674
- redisConfigured: z25.boolean(),
3675
- storageConfigured: z25.boolean(),
3676
- storage: z25.object({ endpoint: z25.string(), bucket: z25.string(), region: z25.string() }).optional()
3690
+ var setupDefaultsSchema = z26.object({
3691
+ databaseConfigured: z26.boolean(),
3692
+ databaseHost: z26.string().optional(),
3693
+ redisConfigured: z26.boolean(),
3694
+ storageConfigured: z26.boolean(),
3695
+ storage: z26.object({ endpoint: z26.string(), bucket: z26.string(), region: z26.string() }).optional()
3677
3696
  });
3678
- var setupResultSchema = z25.object({
3679
- state: z25.literal("ready"),
3680
- adminSk: z25.string().min(1),
3681
- baseUrl: z25.string()
3697
+ var setupResultSchema = z26.object({
3698
+ state: z26.literal("ready"),
3699
+ adminSk: z26.string().min(1),
3700
+ baseUrl: z26.string()
3682
3701
  });
3683
- var backupKeyringSchema = z25.strictObject({ activeKeyId: z25.string().min(1), keys: z25.record(z25.string(), z25.string()) });
3702
+ var backupKeyringSchema = z26.strictObject({ activeKeyId: z26.string().min(1), keys: z26.record(z26.string(), z26.string()) });
3684
3703
  var recoveryInputSchema = setupInputSchema.extend({
3685
- backup: z25.strictObject({
3686
- version: z25.literal(1),
3687
- instanceId: z25.string().min(1),
3688
- exportedAt: z25.string().min(1),
3704
+ backup: z26.strictObject({
3705
+ version: z26.literal(1),
3706
+ instanceId: z26.string().min(1),
3707
+ exportedAt: z26.string().min(1),
3689
3708
  keyring: backupKeyringSchema,
3690
3709
  storeTokenKeyring: backupKeyringSchema,
3691
- oauthKey: z25.string().min(1),
3692
- signingRetireAfter: z25.record(z25.string(), z25.string()).optional()
3710
+ oauthKey: z26.string().min(1),
3711
+ signingRetireAfter: z26.record(z26.string(), z26.string()).optional()
3693
3712
  }).optional()
3694
3713
  });
3695
- var recoveryResultSchema = z25.object({
3696
- state: z25.literal("ready"),
3697
- baseUrl: z25.string(),
3698
- adminSk: z25.string().min(1).optional()
3714
+ var recoveryResultSchema = z26.object({
3715
+ state: z26.literal("ready"),
3716
+ baseUrl: z26.string(),
3717
+ adminSk: z26.string().min(1).optional()
3699
3718
  });
3700
3719
 
3701
3720
  // ../core/src/builtin/management.ts
3702
- var configCommands = new BuiltinCommandRegistry("config", "\u5B9E\u4F8B\u914D\u7F6E\u4E0E\u751F\u6548\u72B6\u6001\uFF08\u7BA1\u7406\u5458\uFF09").register("schema", { inputSchema: z26.strictObject({}), scope: "admin", h: "\u914D\u7F6E\u76EE\u5F55\u3001\u5B57\u6BB5\u8BF4\u660E\u4E0E\u9ED8\u8BA4\u503C", returns: "JSON Schema" }, async () => z26.toJSONSchema(runtimeConfigSchema)).register("get", { inputSchema: z26.strictObject({}), scope: "admin", h: "\u8BFB\u53D6\u671F\u671B\u503C\u3001\u5B9E\u9645\u503C\u548C revision", returns: "ConfigStatus" }, async (_, { deps }) => deps.get()).register("status", { inputSchema: z26.strictObject({}), scope: "admin", h: "\u68C0\u67E5\u914D\u7F6E\u5E94\u7528\u72B6\u6001", returns: "ConfigStatus" }, async (_, { deps }) => deps.get()).register("validate", { inputSchema: runtimeConfigSchema, scope: "admin", h: "\u6821\u9A8C\u5B8C\u6574\u5019\u9009\u914D\u7F6E", returns: "RuntimeConfig" }, async (input) => input).register("update", { inputSchema: configUpdateSchema, scope: "admin", h: "\u6309 revision \u4FDD\u5B58\u914D\u7F6E\uFF1B\u5C1A\u672A\u5E94\u7528", returns: "ConfigStatus" }, async (input, { deps }) => deps.update(input)).register("apply", { inputSchema: revisionSchema, scope: "admin", h: "\u5E94\u7528\u6307\u5B9A revision \u5E76\u68C0\u67E5\u5B9E\u9645\u72B6\u6001", returns: "ConfigStatus" }, async (input, { deps }) => deps.apply(input));
3703
- var storageCommands = new BuiltinCommandRegistry("storage", "\u5BF9\u8C61\u5B58\u50A8\u540E\u7AEF\u3001\u9A8C\u8BC1\u548C\u9ED8\u8BA4\u4E0A\u4F20\u76EE\u6807\uFF08\u7BA1\u7406\u5458\uFF09").register("list", { inputSchema: z26.strictObject({}), scope: "admin", h: "\u5217\u51FA\u9ED8\u8BA4\u4E0E\u5386\u53F2\u5B58\u50A8\u540E\u7AEF", returns: "Page<StorageBackendView>" }, async (_, { deps }) => deps.list()).register("get", { inputSchema: storageIdSchema, scope: "admin", h: "\u8BFB\u53D6\u540E\u7AEF\u72B6\u6001\uFF0C\u4E0D\u56DE\u663E\u51ED\u8BC1", returns: "StorageBackendView" }, async (input, { deps }) => deps.get(input)).register("write", { inputSchema: storageWriteSchema, scope: "admin", h: "\u521B\u5EFA\u672A\u542F\u7528\u7684\u540E\u7AEF\uFF0C\u51ED\u8BC1\u53EA\u5199\u5165\u52A0\u5BC6\u4FDD\u7BA1\u5E93", returns: "StorageBackendView" }, async (input, { deps }) => deps.write(input)).register("test", { inputSchema: storageRevisionSchema, scope: "admin", h: "\u9A8C\u8BC1\u5B9E\u9645\u8BFB\u5199\u548C\u6761\u4EF6\u5199\u80FD\u529B", returns: "StorageBackendView" }, async (input, { deps }) => deps.test(input)).register("activate", { inputSchema: storageActivateSchema, scope: "admin", h: "\u8BBE\u4E3A\u65B0\u4E0A\u4F20\u9ED8\u8BA4\u503C\uFF1B\u65E7\u5BF9\u8C61\u4FDD\u7559\u539F\u540E\u7AEF", returns: "StorageBackendView" }, async (input, { deps }) => deps.activate(input)).register("update", { inputSchema: storageRotateSchema, scope: "admin", h: "\u9A8C\u8BC1\u5E76\u8F6E\u6362\u51ED\u8BC1\uFF0C\u4F4D\u7F6E\u4E0D\u53D8", returns: "StorageBackendView" }, async (input, { deps }) => deps.update(input)).register("delete", { inputSchema: storageRevisionSchema, scope: "admin", h: "\u5220\u9664\u6CA1\u6709\u5BF9\u8C61\u6216 Context \u5F15\u7528\u7684\u975E\u9ED8\u8BA4\u540E\u7AEF", returns: "{ok:true}" }, async (input, { deps }) => deps.delete(input));
3721
+ var configCommands = new BuiltinCommandRegistry("config", "\u5B9E\u4F8B\u914D\u7F6E\u4E0E\u751F\u6548\u72B6\u6001\uFF08\u7BA1\u7406\u5458\uFF09").register("schema", { inputSchema: z27.strictObject({}), scope: "admin", h: "\u914D\u7F6E\u76EE\u5F55\u3001\u5B57\u6BB5\u8BF4\u660E\u4E0E\u9ED8\u8BA4\u503C", returns: "JSON Schema" }, async () => z27.toJSONSchema(runtimeConfigSchema)).register("get", { inputSchema: z27.strictObject({}), scope: "admin", h: "\u8BFB\u53D6\u671F\u671B\u503C\u3001\u5B9E\u9645\u503C\u548C revision", returns: "ConfigStatus" }, async (_, { deps }) => deps.get()).register("status", { inputSchema: z27.strictObject({}), scope: "admin", h: "\u68C0\u67E5\u914D\u7F6E\u5E94\u7528\u72B6\u6001", returns: "ConfigStatus" }, async (_, { deps }) => deps.get()).register("validate", { inputSchema: runtimeConfigSchema, scope: "admin", h: "\u6821\u9A8C\u5B8C\u6574\u5019\u9009\u914D\u7F6E", returns: "RuntimeConfig" }, async (input) => input).register("update", { inputSchema: configUpdateSchema, scope: "admin", h: "\u6309 revision \u4FDD\u5B58\u914D\u7F6E\uFF1B\u5C1A\u672A\u5E94\u7528", returns: "ConfigStatus" }, async (input, { deps }) => deps.update(input)).register("apply", { inputSchema: revisionSchema, scope: "admin", h: "\u5E94\u7528\u6307\u5B9A revision \u5E76\u68C0\u67E5\u5B9E\u9645\u72B6\u6001", returns: "ConfigStatus" }, async (input, { deps }) => deps.apply(input));
3722
+ var storageCommands = new BuiltinCommandRegistry("storage", "\u5BF9\u8C61\u5B58\u50A8\u540E\u7AEF\u3001\u9A8C\u8BC1\u548C\u9ED8\u8BA4\u4E0A\u4F20\u76EE\u6807\uFF08\u7BA1\u7406\u5458\uFF09").register("list", { inputSchema: z27.strictObject({}), scope: "admin", h: "\u5217\u51FA\u9ED8\u8BA4\u4E0E\u5386\u53F2\u5B58\u50A8\u540E\u7AEF", returns: "Page<StorageBackendView>" }, async (_, { deps }) => deps.list()).register("get", { inputSchema: storageIdSchema, scope: "admin", h: "\u8BFB\u53D6\u540E\u7AEF\u72B6\u6001\uFF0C\u4E0D\u56DE\u663E\u51ED\u8BC1", returns: "StorageBackendView" }, async (input, { deps }) => deps.get(input)).register("write", { inputSchema: storageWriteSchema, scope: "admin", h: "\u521B\u5EFA\u672A\u542F\u7528\u7684\u540E\u7AEF\uFF0C\u51ED\u8BC1\u53EA\u5199\u5165\u52A0\u5BC6\u4FDD\u7BA1\u5E93", returns: "StorageBackendView" }, async (input, { deps }) => deps.write(input)).register("test", { inputSchema: storageRevisionSchema, scope: "admin", h: "\u9A8C\u8BC1\u5B9E\u9645\u8BFB\u5199\u548C\u6761\u4EF6\u5199\u80FD\u529B", returns: "StorageBackendView" }, async (input, { deps }) => deps.test(input)).register("activate", { inputSchema: storageActivateSchema, scope: "admin", h: "\u8BBE\u4E3A\u65B0\u4E0A\u4F20\u9ED8\u8BA4\u503C\uFF1B\u65E7\u5BF9\u8C61\u4FDD\u7559\u539F\u540E\u7AEF", returns: "StorageBackendView" }, async (input, { deps }) => deps.activate(input)).register("update", { inputSchema: storageRotateSchema, scope: "admin", h: "\u9A8C\u8BC1\u5E76\u8F6E\u6362\u51ED\u8BC1\uFF0C\u4F4D\u7F6E\u4E0D\u53D8", returns: "StorageBackendView" }, async (input, { deps }) => deps.update(input)).register("delete", { inputSchema: storageRevisionSchema, scope: "admin", h: "\u5220\u9664\u6CA1\u6709\u5BF9\u8C61\u6216 Context \u5F15\u7528\u7684\u975E\u9ED8\u8BA4\u540E\u7AEF", returns: "{ok:true}" }, async (input, { deps }) => deps.delete(input));
3704
3723
  var createConfigModule = (deps) => configCommands.module(deps);
3705
3724
  var createStorageModule = (deps) => storageCommands.module(deps);
3706
3725
 
@@ -4105,78 +4124,79 @@ function isContextExpired(createdAt, ttlSec, now) {
4105
4124
  }
4106
4125
 
4107
4126
  // ../core/src/device/frames.ts
4108
- import { z as z27 } from "zod";
4109
- var deviceNodeCmdSchema = z27.object({
4110
- name: z27.string().min(1),
4111
- delivery: z27.enum(["realtime", "mailbox", "both"]).optional(),
4112
- description: z27.string().optional(),
4113
- inputSchema: z27.unknown().optional(),
4114
- outputSchema: z27.unknown().optional(),
4115
- effect: z27.string().optional(),
4116
- confirm: z27.boolean().optional()
4127
+ import { z as z28 } from "zod";
4128
+ var deviceNodeCmdSchema = z28.object({
4129
+ name: z28.string().min(1),
4130
+ delivery: z28.enum(["realtime", "mailbox", "both"]).optional(),
4131
+ description: z28.string().optional(),
4132
+ inputSchema: z28.unknown().optional(),
4133
+ outputSchema: z28.unknown().optional(),
4134
+ effect: z28.string().optional(),
4135
+ confirm: z28.boolean().optional()
4117
4136
  }).passthrough();
4118
- var nodeInputSchema2 = z27.object({
4119
- path: z27.string().min(1),
4120
- kind: z27.enum(NODE_KINDS),
4121
- description: z27.string(),
4122
- cmds: z27.array(deviceNodeCmdSchema).optional()
4137
+ var nodeInputSchema2 = z28.object({
4138
+ path: z28.string().min(1),
4139
+ kind: z28.enum(NODE_KINDS),
4140
+ description: z28.string(),
4141
+ cmds: z28.array(deviceNodeCmdSchema).optional()
4123
4142
  }).passthrough();
4124
- var deviceExposeSchema = z27.object({
4125
- shell: z27.object({
4126
- description: z27.string().optional(),
4127
- allow: z27.array(z27.string()).optional()
4143
+ var deviceExposeSchema = z28.object({
4144
+ environment: deviceEnvironmentSchema.optional(),
4145
+ shell: z28.object({
4146
+ description: z28.string().optional(),
4147
+ allow: z28.array(z28.string()).optional()
4128
4148
  }).optional(),
4129
- fs: z27.object({
4130
- roots: z27.array(z27.string().min(1)).min(1),
4131
- readOnly: z27.boolean().optional()
4149
+ fs: z28.object({
4150
+ roots: z28.array(z28.string().min(1)).min(1),
4151
+ readOnly: z28.boolean().optional()
4132
4152
  }).optional(),
4133
- nodes: z27.array(nodeInputSchema2).optional()
4153
+ nodes: z28.array(nodeInputSchema2).optional()
4134
4154
  });
4135
- var idSchema = z27.string().min(1);
4136
- var deviceCallContextSchema = z27.object({
4137
- caller: z27.object({
4138
- keyId: z27.string().min(1),
4139
- owner: z27.string().min(1),
4140
- displayName: z27.string().optional()
4155
+ var idSchema = z28.string().min(1);
4156
+ var deviceCallContextSchema = z28.object({
4157
+ caller: z28.object({
4158
+ keyId: z28.string().min(1),
4159
+ owner: z28.string().min(1),
4160
+ displayName: z28.string().optional()
4141
4161
  }).passthrough(),
4142
- traceId: z27.string().min(1),
4143
- createdAt: z27.string().min(1),
4144
- expiresAt: z27.string().min(1),
4145
- upload: z27.object({
4146
- token: z27.string().min(1),
4147
- expiresAt: z27.iso.datetime({ offset: true }),
4148
- maxBytes: z27.number().int().positive(),
4149
- maxObjects: z27.number().int().positive()
4162
+ traceId: z28.string().min(1),
4163
+ createdAt: z28.string().min(1),
4164
+ expiresAt: z28.string().min(1),
4165
+ upload: z28.object({
4166
+ token: z28.string().min(1),
4167
+ expiresAt: z28.iso.datetime({ offset: true }),
4168
+ maxBytes: z28.number().int().positive(),
4169
+ maxObjects: z28.number().int().positive()
4150
4170
  }).strict().optional()
4151
4171
  }).passthrough();
4152
4172
  var schemaByType = {
4153
- hello: z27.object({
4154
- type: z27.literal("hello"),
4155
- deviceId: z27.string().min(1),
4156
- mountPath: z27.string().min(1).optional(),
4173
+ hello: z28.object({
4174
+ type: z28.literal("hello"),
4175
+ deviceId: z28.string().min(1),
4176
+ mountPath: z28.string().min(1).optional(),
4157
4177
  expose: deviceExposeSchema
4158
4178
  }),
4159
- ready: z27.object({ type: z27.literal("ready"), mountPath: z27.string().min(1) }),
4160
- error: z27.object({ type: z27.literal("error"), error: tbErrorBodySchema }),
4161
- call: z27.object({
4162
- type: z27.literal("call"),
4179
+ ready: z28.object({ type: z28.literal("ready"), mountPath: z28.string().min(1) }),
4180
+ error: z28.object({ type: z28.literal("error"), error: tbErrorBodySchema }),
4181
+ call: z28.object({
4182
+ type: z28.literal("call"),
4163
4183
  id: idSchema,
4164
- path: z27.string().min(1),
4165
- arguments: z27.record(z27.string(), z27.unknown()),
4184
+ path: z28.string().min(1),
4185
+ arguments: z28.record(z28.string(), z28.unknown()),
4166
4186
  context: deviceCallContextSchema.optional()
4167
4187
  }),
4168
- result: z27.discriminatedUnion("ok", [
4169
- z27.object({ type: z27.literal("result"), id: idSchema, ok: z27.literal(true), value: z27.unknown() }),
4170
- z27.object({
4171
- type: z27.literal("result"),
4188
+ result: z28.discriminatedUnion("ok", [
4189
+ z28.object({ type: z28.literal("result"), id: idSchema, ok: z28.literal(true), value: z28.unknown() }),
4190
+ z28.object({
4191
+ type: z28.literal("result"),
4172
4192
  id: idSchema,
4173
- ok: z27.literal(false),
4193
+ ok: z28.literal(false),
4174
4194
  error: tbErrorBodySchema
4175
4195
  })
4176
4196
  ]),
4177
- ping: z27.object({ type: z27.literal("ping") }),
4178
- pong: z27.object({ type: z27.literal("pong") }),
4179
- cancel: z27.object({ type: z27.literal("cancel"), id: idSchema })
4197
+ ping: z28.object({ type: z28.literal("ping") }),
4198
+ pong: z28.object({ type: z28.literal("pong") }),
4199
+ cancel: z28.object({ type: z28.literal("cancel"), id: idSchema })
4180
4200
  };
4181
4201
  var PING_FRAME_JSON = '{"type":"ping"}';
4182
4202
  var PONG_FRAME_JSON = '{"type":"pong"}';
@@ -4263,7 +4283,11 @@ function deviceDirectoryHelpModel(node, children = []) {
4263
4283
  description: `${node.description} (${node.presence.state})`
4264
4284
  },
4265
4285
  cmds: [],
4266
- children
4286
+ children,
4287
+ ...node.environment === void 0 || node.reportedAt === void 0 ? {} : {
4288
+ deviceContext: { environment: node.environment, reportedAt: node.reportedAt, presence: node.presence },
4289
+ hint: `Environment is the last hello report (${node.presence.state}); inspect authorized child ~help for commands, execution limits and session recovery rules.`
4290
+ }
4267
4291
  };
4268
4292
  }
4269
4293
 
@@ -4670,6 +4694,7 @@ function attrLines(key, value) {
4670
4694
  function renderHelpDsl(model) {
4671
4695
  const lines = [HTBP_HELP_HEADER];
4672
4696
  lines.push(nodeLine(model.node.path, model.node.kind, model.node.description));
4697
+ if (model.deviceContext !== void 0) lines.push(`deviceContext ${JSON.stringify(model.deviceContext)}`);
4673
4698
  if (model.hint !== void 0) lines.push(`hint ${collapseToOneLine(model.hint)}`);
4674
4699
  if (model.note !== void 0) lines.push(`note "${collapseToOneLine(model.note)}"`);
4675
4700
  for (const cmd of model.cmds) {
@@ -4724,6 +4749,7 @@ function renderHelpJson(model) {
4724
4749
  node: { path: model.node.path, kind: model.node.kind, description: model.node.description },
4725
4750
  cmds
4726
4751
  };
4752
+ if (model.deviceContext !== void 0) json.deviceContext = model.deviceContext;
4727
4753
  if (model.hint !== void 0) json.hint = model.hint;
4728
4754
  if (model.note !== void 0) json.note = model.note;
4729
4755
  if (model.feedback !== void 0 && model.feedback.length > 0) {
@@ -4789,6 +4815,11 @@ function renderHelpMarkdown(model) {
4789
4815
  if (model.node.description.trim() !== "") {
4790
4816
  out.push(model.node.description.trim(), "");
4791
4817
  }
4818
+ if (model.deviceContext !== void 0) {
4819
+ out.push("## Device context", "");
4820
+ out.push("Last reported environment (self-reported; presence does not refresh this snapshot):", "");
4821
+ out.push("```json", JSON.stringify(model.deviceContext, null, 2), "```", "");
4822
+ }
4792
4823
  if (model.hint !== void 0) {
4793
4824
  out.push(`> **Next step**: ${collapseToOneLine(model.hint)}`, "");
4794
4825
  }
@@ -4980,7 +5011,7 @@ function assertUploadBinding(existing, requested, now) {
4980
5011
  }
4981
5012
 
4982
5013
  // ../core/src/objectStoreService/service.ts
4983
- import { z as z28 } from "zod/v4";
5014
+ import { z as z29 } from "zod/v4";
4984
5015
 
4985
5016
  // ../core/src/objectStoreService/uri.ts
4986
5017
  var STORE_OBJECT_ID_RE = /^[A-Za-z0-9_-]{22,64}$/;
@@ -5019,18 +5050,18 @@ var TOKEN_PREFIX = {
5019
5050
  function stateCorrupt(kind) {
5020
5051
  return new TBError("internal", `Store ${kind} \u72B6\u6001\u635F\u574F`, { retryable: false });
5021
5052
  }
5022
- var persistedId = z28.string().min(1);
5023
- var persistedOwner = z28.string().min(1).refine((value) => !/[\r\n\0]/.test(value));
5024
- var persistedTimestamp = z28.string().refine((value) => Number.isFinite(Date.parse(value)));
5025
- var persistedNonNegativeInt = z28.number().int().nonnegative().refine(Number.isSafeInteger);
5053
+ var persistedId = z29.string().min(1);
5054
+ var persistedOwner = z29.string().min(1).refine((value) => !/[\r\n\0]/.test(value));
5055
+ var persistedTimestamp = z29.string().refine((value) => Number.isFinite(Date.parse(value)));
5056
+ var persistedNonNegativeInt = z29.number().int().nonnegative().refine(Number.isSafeInteger);
5026
5057
  var persistedPositiveInt = persistedNonNegativeInt.refine((value) => value > 0);
5027
- var persistedHash = z28.string().regex(/^[0-9a-f]{64}$/);
5028
- var persistedChecksum = z28.looseObject({
5029
- algorithm: z28.literal("sha256"),
5030
- value: z28.string().min(1)
5058
+ var persistedHash = z29.string().regex(/^[0-9a-f]{64}$/);
5059
+ var persistedChecksum = z29.looseObject({
5060
+ algorithm: z29.literal("sha256"),
5061
+ value: z29.string().min(1)
5031
5062
  });
5032
5063
  function stateParser(kind, shape) {
5033
- const schema = z28.looseObject({ revision: persistedPositiveInt, ...shape });
5064
+ const schema = z29.looseObject({ revision: persistedPositiveInt, ...shape });
5034
5065
  return (value) => {
5035
5066
  const parsed = schema.safeParse(value);
5036
5067
  if (!parsed.success) throw stateCorrupt(kind);
@@ -5041,22 +5072,22 @@ var parseObject = stateParser("object", {
5041
5072
  backendId: persistedId,
5042
5073
  bytesDeletedAt: persistedTimestamp.optional(),
5043
5074
  checksum: persistedChecksum.optional(),
5044
- contentType: z28.string().min(1),
5075
+ contentType: z29.string().min(1),
5045
5076
  createdAt: persistedTimestamp,
5046
5077
  driverKey: persistedId,
5047
- etag: z28.string().optional(),
5078
+ etag: z29.string().optional(),
5048
5079
  expectedChecksum: persistedChecksum.optional(),
5049
5080
  expectedSize: persistedNonNegativeInt.optional(),
5050
5081
  expiresAt: persistedTimestamp.optional(),
5051
- filename: z28.string().optional(),
5082
+ filename: z29.string().optional(),
5052
5083
  id: persistedId,
5053
5084
  originCallId: persistedId.optional(),
5054
5085
  owner: persistedOwner,
5055
5086
  producer: persistedOwner.optional(),
5056
5087
  readyAt: persistedTimestamp.optional(),
5057
5088
  size: persistedNonNegativeInt.optional(),
5058
- status: z28.enum(["pending", "ready", "failed", "abandoned", "deleted"]),
5059
- store: z28.literal(DEFAULT_STORE_NAME),
5089
+ status: z29.enum(["pending", "ready", "failed", "abandoned", "deleted"]),
5090
+ store: z29.literal(DEFAULT_STORE_NAME),
5060
5091
  updatedAt: persistedTimestamp,
5061
5092
  uploadId: persistedId
5062
5093
  });
@@ -5066,7 +5097,7 @@ var parseSessionRecord = stateParser("upload session", {
5066
5097
  backendId: persistedId,
5067
5098
  capabilityHash: persistedHash,
5068
5099
  completedAt: persistedTimestamp.optional(),
5069
- contentType: z28.string().min(1),
5100
+ contentType: z29.string().min(1),
5070
5101
  createdAt: persistedTimestamp,
5071
5102
  expectedChecksum: persistedChecksum.optional(),
5072
5103
  expectedSize: persistedNonNegativeInt.optional(),
@@ -5074,13 +5105,13 @@ var parseSessionRecord = stateParser("upload session", {
5074
5105
  id: persistedId,
5075
5106
  maxBytes: persistedPositiveInt,
5076
5107
  objectId: persistedId,
5077
- status: z28.enum(["created", "completed", "aborted", "expired", "failed"]),
5108
+ status: z29.enum(["created", "completed", "aborted", "expired", "failed"]),
5078
5109
  terminalAt: persistedTimestamp.optional(),
5079
- transport: z28.enum(["relay", "presigned-put"])
5110
+ transport: z29.enum(["relay", "presigned-put"])
5080
5111
  });
5081
5112
  var parseCallCapabilityRecord = stateParser("call capability", {
5082
5113
  signingKeyId: persistedId,
5083
- allowedContentTypes: z28.array(z28.string().min(1)).min(1),
5114
+ allowedContentTypes: z29.array(z29.string().min(1)).min(1),
5084
5115
  callId: persistedId,
5085
5116
  createdAt: persistedTimestamp,
5086
5117
  expiresAt: persistedTimestamp,
@@ -5090,12 +5121,12 @@ var parseCallCapabilityRecord = stateParser("call capability", {
5090
5121
  maxObjects: persistedPositiveInt,
5091
5122
  owner: persistedOwner,
5092
5123
  producer: persistedOwner,
5093
- reservations: z28.array(z28.looseObject({
5124
+ reservations: z29.array(z29.looseObject({
5094
5125
  maxBytes: persistedPositiveInt,
5095
5126
  objectId: persistedId
5096
5127
  })),
5097
5128
  reservedBytes: persistedNonNegativeInt,
5098
- status: z28.enum(["active", "exhausted", "revoked", "expired"]),
5129
+ status: z29.enum(["active", "exhausted", "revoked", "expired"]),
5099
5130
  terminalAt: persistedTimestamp.optional(),
5100
5131
  tokenHash: persistedHash
5101
5132
  });
@@ -5106,13 +5137,13 @@ var parseShare = stateParser("share grant", {
5106
5137
  expiresAt: persistedTimestamp,
5107
5138
  id: persistedId,
5108
5139
  objectId: persistedId,
5109
- status: z28.enum(["active", "revoked", "expired"]),
5140
+ status: z29.enum(["active", "revoked", "expired"]),
5110
5141
  terminalAt: persistedTimestamp.optional(),
5111
5142
  tokenHash: persistedHash
5112
5143
  });
5113
5144
  var parseIdempotencyBinding = stateParser("idempotency binding", {
5114
5145
  createdAt: persistedTimestamp,
5115
- domain: z28.enum(["owner", "call"]),
5146
+ domain: z29.enum(["owner", "call"]),
5116
5147
  expiresAt: persistedTimestamp,
5117
5148
  fingerprint: persistedHash,
5118
5149
  objectId: persistedId,
@@ -6319,24 +6350,24 @@ var RequestDedupe = class {
6319
6350
  };
6320
6351
 
6321
6352
  // ../core/src/plugin/envelope.ts
6322
- import { z as z29 } from "zod";
6353
+ import { z as z30 } from "zod";
6323
6354
  var HEADER_TB_CONTEXT = "X-TB-Context";
6324
6355
  var HEADER_TB_REQUEST_ID = "X-TB-Request-Id";
6325
6356
  var HEADER_TB_UPSTREAM_AUTH = "X-TB-Upstream-Auth";
6326
6357
  var PLUGIN_PAYLOAD_MAX_BYTES = 1024 * 1024;
6327
- var callContextSchema = z29.object({
6328
- keyId: z29.string().min(1),
6329
- owner: z29.string().min(1),
6330
- scopes: z29.array(
6331
- z29.object({
6332
- pattern: z29.string().min(1),
6333
- actions: z29.array(z29.enum(ACTIONS)),
6334
- effect: z29.enum(["allow", "deny"]).optional()
6358
+ var callContextSchema = z30.object({
6359
+ keyId: z30.string().min(1),
6360
+ owner: z30.string().min(1),
6361
+ scopes: z30.array(
6362
+ z30.object({
6363
+ pattern: z30.string().min(1),
6364
+ actions: z30.array(z30.enum(ACTIONS)),
6365
+ effect: z30.enum(["allow", "deny"]).optional()
6335
6366
  })
6336
6367
  ),
6337
- registerPaths: z29.array(z29.string()).optional(),
6338
- traceId: z29.string().min(1),
6339
- mountPath: z29.string().min(1).optional(),
6368
+ registerPaths: z30.array(z30.string()).optional(),
6369
+ traceId: z30.string().min(1),
6370
+ mountPath: z30.string().min(1).optional(),
6340
6371
  /**
6341
6372
  * 挂载节点的 `providerConfig`。**只发给该节点对应的那个 plugin**(随本次调用的信封),
6342
6373
  * 插件之间不共享 —— 同一 plugin 部署的不同挂载各自收到自己那份。
@@ -6348,9 +6379,9 @@ var callContextSchema = z29.object({
6348
6379
  *
6349
6380
  * 放这里的应当是:region / baseUrl override / 功能开关 / workspace 归属之类的**非敏感**配置。
6350
6381
  */
6351
- mountConfig: z29.record(z29.string(), z29.unknown()).optional(),
6382
+ mountConfig: z30.record(z30.string(), z30.unknown()).optional(),
6352
6383
  /** v2 多 export 路由:本次调用命中 plugin 的哪个 export。 */
6353
- exportId: z29.string().min(1).optional()
6384
+ exportId: z30.string().min(1).optional()
6354
6385
  });
6355
6386
  function encodeCallContext(ctx) {
6356
6387
  return base64urlEncode(new TextEncoder().encode(JSON.stringify(ctx)));
@@ -6378,9 +6409,9 @@ function decodeCallContext(header) {
6378
6409
  }
6379
6410
  return parsed.data;
6380
6411
  }
6381
- var pluginCallSchema = z29.object({
6382
- tool: z29.string().min(1),
6383
- arguments: z29.record(z29.string(), z29.unknown())
6412
+ var pluginCallSchema = z30.object({
6413
+ tool: z30.string().min(1),
6414
+ arguments: z30.record(z30.string(), z30.unknown())
6384
6415
  });
6385
6416
  function assertPluginPayloadSize(payload) {
6386
6417
  const bytes2 = new TextEncoder().encode(payload).length;
@@ -7394,19 +7425,19 @@ function parseFrontmatter(text) {
7394
7425
  }
7395
7426
 
7396
7427
  // ../core/src/skillhub/commands.ts
7397
- import { z as z30 } from "zod/v4";
7398
- var publishFileSchema = z30.strictObject({
7399
- path: z30.string().describe(
7428
+ import { z as z31 } from "zod/v4";
7429
+ var publishFileSchema = z31.strictObject({
7430
+ path: z31.string().describe(
7400
7431
  "file path relative to the skill root, e.g. 'SKILL.md', 'scripts/run.sh'"
7401
7432
  ),
7402
- content: z30.string().describe("UTF-8 text content"),
7403
- contentType: z30.string().optional().describe("optional; inferred from extension when omitted")
7433
+ content: z31.string().describe("UTF-8 text content"),
7434
+ contentType: z31.string().optional().describe("optional; inferred from extension when omitted")
7404
7435
  });
7405
7436
  var skillhubCommands = new HtbpCommandRegistry().register(
7406
7437
  "list",
7407
7438
  {
7408
7439
  h: "list published skills (id / name / description from SKILL.md frontmatter, paginated)",
7409
- inputSchema: z30.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
7440
+ inputSchema: z31.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
7410
7441
  returns: "Page<SkillSummary>",
7411
7442
  scope: "read"
7412
7443
  },
@@ -7415,9 +7446,9 @@ var skillhubCommands = new HtbpCommandRegistry().register(
7415
7446
  "get",
7416
7447
  {
7417
7448
  h: "read a skill: SKILL.md body + file manifest; pass 'file' to fetch one bundled file (oversized/binary as { $ref })",
7418
- inputSchema: z30.strictObject({
7419
- id: z30.string().describe("skill id"),
7420
- file: z30.string().optional().describe(
7449
+ inputSchema: z31.strictObject({
7450
+ id: z31.string().describe("skill id"),
7451
+ file: z31.string().optional().describe(
7421
7452
  "optional: path of one bundled file to fetch instead of the manifest"
7422
7453
  )
7423
7454
  }),
@@ -7429,8 +7460,8 @@ var skillhubCommands = new HtbpCommandRegistry().register(
7429
7460
  "search",
7430
7461
  {
7431
7462
  h: "keyword search over skill id / name / description",
7432
- inputSchema: z30.strictObject({
7433
- query: z30.string().describe("substring to match"),
7463
+ inputSchema: z31.strictObject({
7464
+ query: z31.string().describe("substring to match"),
7434
7465
  opts: HTBP_LIST_OPTIONS_SCHEMA.optional()
7435
7466
  }),
7436
7467
  returns: "Page<SkillSummary>",
@@ -7441,11 +7472,11 @@ var skillhubCommands = new HtbpCommandRegistry().register(
7441
7472
  "publish",
7442
7473
  {
7443
7474
  h: "publish/replace a skill from a set of text files (must include SKILL.md with name+description frontmatter)",
7444
- inputSchema: z30.strictObject({
7445
- id: z30.string().optional().describe(
7475
+ inputSchema: z31.strictObject({
7476
+ id: z31.string().optional().describe(
7446
7477
  "skill id; defaults to a slug derived from the frontmatter name"
7447
7478
  ),
7448
- files: z30.array(publishFileSchema).describe(
7479
+ files: z31.array(publishFileSchema).describe(
7449
7480
  "the skill files; whole-skill replace (files not listed are removed)"
7450
7481
  )
7451
7482
  }),
@@ -7463,7 +7494,7 @@ var skillhubCommands = new HtbpCommandRegistry().register(
7463
7494
  "remove",
7464
7495
  {
7465
7496
  h: "delete a skill and all its files (not_found if it does not exist)",
7466
- inputSchema: z30.strictObject({ id: z30.string().describe("skill id") }),
7497
+ inputSchema: z31.strictObject({ id: z31.string().describe("skill id") }),
7467
7498
  scope: "write",
7468
7499
  effect: "destructive"
7469
7500
  },
@@ -8129,6 +8160,8 @@ var NodeRegistryStore = class {
8129
8160
  ...node.config !== void 0 ? { config: node.config } : {},
8130
8161
  ...node.virtualize !== void 0 ? { virtualize: node.virtualize } : {},
8131
8162
  ...opts.deviceId !== void 0 ? { deviceId: opts.deviceId } : {},
8163
+ ...opts.deviceEnvironment !== void 0 ? { deviceEnvironment: opts.deviceEnvironment } : {},
8164
+ ...opts.deviceReportedAt !== void 0 ? { deviceReportedAt: opts.deviceReportedAt } : {},
8132
8165
  ...opts.online !== void 0 ? { online: opts.online } : {},
8133
8166
  ...opts.lastSeenAt !== void 0 ? { lastSeenAt: opts.lastSeenAt } : {},
8134
8167
  registeredBy,
@@ -8252,6 +8285,7 @@ export {
8252
8285
  TBError,
8253
8286
  isTBError,
8254
8287
  normalizePath,
8288
+ canonicalizePath,
8255
8289
  assertNoCollision,
8256
8290
  validatePath,
8257
8291
  KEY_SK_HASH,
@@ -8296,6 +8330,7 @@ export {
8296
8330
  createEncryptionKeyring,
8297
8331
  validateStoreTokenKeyring,
8298
8332
  DeviceMailboxService,
8333
+ deviceEnvironmentSchema,
8299
8334
  tbErrorBodySchema,
8300
8335
  nodeInputSchema,
8301
8336
  helpJsonSchema,
@@ -8304,7 +8339,9 @@ export {
8304
8339
  toolSearchSourceSchema,
8305
8340
  toolSearchSourceResultSchema,
8306
8341
  toolSearchPageSchema,
8342
+ toolSearchOptionsSchema,
8307
8343
  toolSearchRequestSchema,
8344
+ deviceOperationStateSchema,
8308
8345
  deviceOperationSummarySchema,
8309
8346
  deviceOperationDetailSchema,
8310
8347
  deviceOperationListRequestSchema,
@@ -8367,7 +8404,6 @@ export {
8367
8404
  negotiate,
8368
8405
  contentTypeFor,
8369
8406
  MAX_TREE_DEPTH,
8370
- DEFAULT_MAX_NODES,
8371
8407
  clampDepth,
8372
8408
  buildTree,
8373
8409
  reserveUploadQuota,