@tool-bridge/server 0.23.0 → 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.
- package/dist/admin.js +2 -2
- package/dist/{airtable-VMQVXLHK.js → airtable-Z6KEL3MA.js} +6 -6
- package/dist/{alt_text_generator_ai-FTWY4RU4.js → alt_text_generator_ai-RM2GHSNM.js} +5 -5
- package/dist/{amap-OK5VBHYC.js → amap-YEJLGIKY.js} +5 -5
- package/dist/{anthropic-S67AZFZ3.js → anthropic-62M4MUVQ.js} +6 -6
- package/dist/{apify-ZE6MYQI3.js → apify-AHRNDBCB.js} +6 -6
- package/dist/{brave_search-TG2M2KOD.js → brave_search-JAHWOMQC.js} +6 -6
- package/dist/{chunk-5ICRY3VU.js → chunk-7MUNQNXG.js} +481 -448
- package/dist/{chunk-TDAWLMDE.js → chunk-FZV7CF7L.js} +3 -3
- package/dist/{chunk-2JNAI4OC.js → chunk-GQ4O7NK5.js} +1 -1
- package/dist/{chunk-4XJPN3DY.js → chunk-LD7KQRQ3.js} +121 -104
- package/dist/{chunk-VWRUGUSU.js → chunk-NG4C7YB3.js} +3 -3
- package/dist/{chunk-WJHG6OK7.js → chunk-SU6Q4RAY.js} +2 -2
- package/dist/{chunk-BADVCN6K.js → chunk-TH3H5YAG.js} +1 -1
- package/dist/{chunk-7CTWGTDU.js → chunk-U2UGFSOX.js} +2 -2
- package/dist/{circleci-3L3WJVSK.js → circleci-UJUYBIAO.js} +6 -6
- package/dist/{clerk-EZPF2V7T.js → clerk-FCFM3WJK.js} +6 -6
- package/dist/{cohere-U27DPO64.js → cohere-OTSYSMPC.js} +6 -6
- package/dist/{confluence-G2KL6ERH.js → confluence-LPANSCGT.js} +6 -6
- package/dist/{convertapi-L4CLJ2M3.js → convertapi-AJZOVUHT.js} +4 -4
- package/dist/{currencyapi-YPYXG7YY.js → currencyapi-HGK5FSGO.js} +6 -6
- package/dist/{deepseek-6HT6WF3M.js → deepseek-7HMTFJRV.js} +6 -6
- package/dist/{docker_hub-LPE3PCVB.js → docker_hub-FCNVKJZW.js} +5 -5
- package/dist/{dropbox-V56ABHTA.js → dropbox-2XVKCQZE.js} +6 -6
- package/dist/{dub-6OKQ7MHT.js → dub-CTUKPX2A.js} +6 -6
- package/dist/{e2b-JS2U2QFU.js → e2b-ULEWTRKI.js} +6 -6
- package/dist/{exa-DPWVYXSP.js → exa-QENFV3AU.js} +6 -6
- package/dist/{fal_ai-DK6Y27ZF.js → fal_ai-TQYUBBAF.js} +6 -6
- package/dist/{feishu-K7EGSRF3.js → feishu-OYCWDSHD.js} +3 -3
- package/dist/{feishu_custom_bot-2JUGFYNG.js → feishu_custom_bot-VYQ7A3PU.js} +4 -4
- package/dist/{figma-FT5I7ITD.js → figma-5DLOKAQQ.js} +6 -6
- package/dist/{firehydrant-EIKLKHX2.js → firehydrant-X4MGP2OI.js} +6 -6
- package/dist/{fixer-U5QXIAKD.js → fixer-LMIWM3ZX.js} +5 -5
- package/dist/{fly-T3JYFZ2M.js → fly-J5HN5L2I.js} +6 -6
- package/dist/{front-D72MGVOR.js → front-E3SMBQW3.js} +6 -6
- package/dist/{geocodio-BOTD5TI5.js → geocodio-AOINRPLA.js} +5 -5
- package/dist/{ghost-KYP7SZGB.js → ghost-E4CBGZWJ.js} +5 -5
- package/dist/{github-AGMZT3VY.js → github-PGR6U3FC.js} +6 -6
- package/dist/{gmail-BLJNJOBG.js → gmail-XNQHMQ6F.js} +6 -6
- package/dist/{googlecalendar-GTHWNCF6.js → googlecalendar-RE6DGG7L.js} +6 -6
- package/dist/{googledocs-6EEDMEBQ.js → googledocs-CX2BZDQH.js} +4 -4
- package/dist/{grafana-GMW6EKSQ.js → grafana-GX75ZA5X.js} +6 -6
- package/dist/{graphhopper-6OLGBDGB.js → graphhopper-XMUYLWHS.js} +5 -5
- package/dist/index.js +5 -5
- package/dist/{ip2proxy-4QN42E6T.js → ip2proxy-ZGIRBAG5.js} +5 -5
- package/dist/{ipgeolocation_io-SK4XKDA2.js → ipgeolocation_io-MAP27QMO.js} +5 -5
- package/dist/{ipqualityscore-6ANBPXKT.js → ipqualityscore-6IIUUAQ2.js} +5 -5
- package/dist/{jina_ai-IHPSVRM5.js → jina_ai-GGH77RQH.js} +6 -6
- package/dist/{jira-46KKM4LC.js → jira-7GPZW6HZ.js} +6 -6
- package/dist/{langsmith-JZA345I5.js → langsmith-CJXYE7WM.js} +6 -6
- package/dist/{lemlist-43IV7DK6.js → lemlist-OYPOX6GN.js} +6 -6
- package/dist/{linear-5LFH7XNL.js → linear-TPQ6X4XZ.js} +4 -4
- package/dist/{logsnag-5RMYAHIL.js → logsnag-HT2PRLIV.js} +6 -6
- package/dist/main.js +5 -5
- package/dist/{mattermost-XFL6SHGG.js → mattermost-6IYTWTM5.js} +6 -6
- package/dist/{mem0-NYO4DTP6.js → mem0-7AVGBGOX.js} +6 -6
- package/dist/{memos-37MPQOLV.js → memos-CTOXWZ6X.js} +6 -6
- package/dist/{metabase-KYBKZFMG.js → metabase-AFJXQ5SQ.js} +6 -6
- package/dist/{mistral_ai-6PL3K4PM.js → mistral_ai-QDKM4N3R.js} +6 -6
- package/dist/{mother_duck-2NH7W5M5.js → mother_duck-XSKR4GVL.js} +6 -6
- package/dist/{ngrok-UO6CDYCA.js → ngrok-NQMLM24P.js} +6 -6
- package/dist/{notes-I3P32WP4.js → notes-ZWMVZQWJ.js} +2 -2
- package/dist/{notion-BEAJFUOE.js → notion-6544KSMM.js} +6 -6
- package/dist/{open_exchange_rates-CMF62JB4.js → open_exchange_rates-4CLN7O2N.js} +5 -5
- package/dist/{openai-IHOMKVND.js → openai-HLFGPVI5.js} +6 -6
- package/dist/{opengraph_io-ZQ2FGLHX.js → opengraph_io-57JDHT3M.js} +5 -5
- package/dist/{openrouter-HXLW3NR5.js → openrouter-WDAVB2OP.js} +6 -6
- package/dist/{outline-ELCP4NEU.js → outline-A6MDLZVH.js} +6 -6
- package/dist/{paddle-O77LALVN.js → paddle-WX5ULOPP.js} +6 -6
- package/dist/{perplexity-JCU654QV.js → perplexity-LYTWWWCZ.js} +6 -6
- package/dist/{pinecone-W5W4LRKL.js → pinecone-7KAF3S7U.js} +6 -6
- package/dist/{pipedrive-ITMJLLPZ.js → pipedrive-YQY243G7.js} +6 -6
- package/dist/{polar-R33XU4L3.js → polar-A5HKXSQY.js} +6 -6
- package/dist/{posthog-JVNTOLTV.js → posthog-CF2LHLS4.js} +6 -6
- package/dist/{postmark-6SBG7HWV.js → postmark-W756TMJM.js} +6 -6
- package/dist/{prerender-GPNKTNFC.js → prerender-ZYM4UQ5R.js} +5 -5
- package/dist/{pubmed-UP6ZEEIH.js → pubmed-QXTUQCTQ.js} +4 -4
- package/dist/{railway-KWEWXHTY.js → railway-F4MOZ3LQ.js} +4 -4
- package/dist/{readwise-BLATSMC3.js → readwise-S7MF5SR5.js} +6 -6
- package/dist/{render-QYRVIXII.js → render-D7EIVDUA.js} +6 -6
- package/dist/{replicate-JYTWH4NF.js → replicate-ABNKPZR7.js} +6 -6
- package/dist/{resend-L5N75SZM.js → resend-7VJEY4KC.js} +6 -6
- package/dist/{rootly-MHCPEQ26.js → rootly-UMFJOKXC.js} +6 -6
- package/dist/{scrapfly-PTPGYSJM.js → scrapfly-UDT4KNFL.js} +5 -5
- package/dist/{scrapingbee-JN6UH5PY.js → scrapingbee-XTFD54NB.js} +5 -5
- package/dist/{screenshot_fyi-4QRVSV55.js → screenshot_fyi-5GTW3SFY.js} +5 -5
- package/dist/{semantic_scholar-LRSWA2GE.js → semantic_scholar-Y6WK2MST.js} +6 -6
- package/dist/{sentry-2G6PF5W6.js → sentry-ZFPGDA6C.js} +6 -6
- package/dist/{shodan-WKKPP5C6.js → shodan-3SCDBOQ3.js} +5 -5
- package/dist/{shopify-64YDK5T2.js → shopify-LMTBS2I2.js} +6 -6
- package/dist/{stripe-QAIGGOTF.js → stripe-4JQJ2CUG.js} +4 -4
- package/dist/{supabase-WHTGR6ND.js → supabase-7HA3BEFK.js} +6 -6
- package/dist/{tavily-QIXCDDWO.js → tavily-H34ZBPGC.js} +6 -6
- package/dist/{telegram-E6G7CWI6.js → telegram-CRX4YWQ3.js} +5 -5
- package/dist/{telnyx-ZDVVS7PK.js → telnyx-TIKGEU34.js} +6 -6
- package/dist/{todoist-DMYF3G7J.js → todoist-LU563DGZ.js} +6 -6
- package/dist/{trello-HY2RYIRP.js → trello-NTRGEROX.js} +5 -5
- package/dist/{turso-HAQWMGRP.js → turso-EY3CNVPZ.js} +6 -6
- package/dist/{twilio-MLXYPHJE.js → twilio-ICX3WRQH.js} +4 -4
- package/dist/{umami-DZHBLPVG.js → umami-NPMRVI3M.js} +6 -6
- package/dist/{unsplash-GS2OPXKE.js → unsplash-TIHBZFIM.js} +6 -6
- package/dist/{upstash_redis-XMXWTNAJ.js → upstash_redis-2DO6EHCN.js} +6 -6
- package/dist/{uptimerobot-TF5WRZ4G.js → uptimerobot-BGYOCKGI.js} +4 -4
- package/dist/{v2ex-2BVXAPDF.js → v2ex-GOWDPGGA.js} +6 -6
- package/dist/{vercel-YMJGQYJE.js → vercel-G33RXVBI.js} +6 -6
- package/dist/{wolfram_alpha_api-I56SXWFZ.js → wolfram_alpha_api-IRZSMD3P.js} +5 -5
- package/dist/{wordpress-R7TDFZ2P.js → wordpress-ATWGGUC3.js} +6 -6
- package/dist/{workos-HDNHWVMS.js → workos-LHJDETBX.js} +6 -6
- package/dist/{zhihu-LX6AGGDS.js → zhihu-IAH53YPP.js} +6 -6
- 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
|
|
2173
|
+
import { z as z16 } from "zod/v4";
|
|
2174
2174
|
|
|
2175
2175
|
// ../core/src/protocol/wire.ts
|
|
2176
|
-
import { z as
|
|
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/
|
|
2836
|
+
// ../core/src/device/environment.ts
|
|
2837
2837
|
import { z as z13 } from "zod";
|
|
2838
|
-
var
|
|
2839
|
-
|
|
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:
|
|
2842
|
-
retryable:
|
|
2851
|
+
message: z14.string(),
|
|
2852
|
+
retryable: z14.boolean()
|
|
2843
2853
|
});
|
|
2844
2854
|
|
|
2845
2855
|
// ../core/src/protocol/wire.ts
|
|
2846
|
-
var actionSchema =
|
|
2847
|
-
var nodeKindSchema =
|
|
2848
|
-
var nodeInputConfigSchema =
|
|
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 =
|
|
2852
|
-
prefix:
|
|
2853
|
-
rename:
|
|
2854
|
-
hide:
|
|
2855
|
-
describe:
|
|
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 =
|
|
2860
|
-
path:
|
|
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:
|
|
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 =
|
|
2867
|
-
var presenceSchema =
|
|
2868
|
-
lastSeenAt:
|
|
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 =
|
|
2872
|
-
id:
|
|
2873
|
-
score:
|
|
2874
|
-
title:
|
|
2881
|
+
var helpFeedbackItemSchema = z15.object({
|
|
2882
|
+
id: z15.string(),
|
|
2883
|
+
score: z15.number(),
|
|
2884
|
+
title: z15.string()
|
|
2875
2885
|
});
|
|
2876
|
-
var helpChildSchema =
|
|
2877
|
-
description:
|
|
2886
|
+
var helpChildSchema = z15.object({
|
|
2887
|
+
description: z15.string(),
|
|
2878
2888
|
kind: nodeKindSchema,
|
|
2879
|
-
path:
|
|
2889
|
+
path: z15.string()
|
|
2880
2890
|
});
|
|
2881
|
-
var helpCommandSchema =
|
|
2882
|
-
confirm:
|
|
2883
|
-
delivery:
|
|
2884
|
-
effect:
|
|
2885
|
-
h:
|
|
2886
|
-
inputSchema:
|
|
2887
|
-
method:
|
|
2888
|
-
name:
|
|
2889
|
-
outputSchema:
|
|
2890
|
-
path:
|
|
2891
|
-
returns:
|
|
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
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
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:
|
|
2919
|
+
path: z15.string()
|
|
2904
2920
|
}),
|
|
2905
|
-
note:
|
|
2921
|
+
note: z15.string().optional()
|
|
2906
2922
|
});
|
|
2907
|
-
var treeJsonSchema =
|
|
2908
|
-
children:
|
|
2909
|
-
description:
|
|
2923
|
+
var treeJsonSchema = z15.lazy(() => z15.object({
|
|
2924
|
+
children: z15.array(treeJsonSchema).optional(),
|
|
2925
|
+
description: z15.string(),
|
|
2910
2926
|
kind: nodeKindSchema,
|
|
2911
|
-
path:
|
|
2927
|
+
path: z15.string(),
|
|
2912
2928
|
presence: presenceSchema.optional(),
|
|
2913
|
-
truncated:
|
|
2929
|
+
truncated: z15.boolean().optional()
|
|
2914
2930
|
}));
|
|
2915
|
-
var toolSpecSchema =
|
|
2916
|
-
confirm:
|
|
2917
|
-
delivery:
|
|
2918
|
-
description:
|
|
2919
|
-
effect:
|
|
2920
|
-
inputSchema:
|
|
2921
|
-
name:
|
|
2922
|
-
outputSchema:
|
|
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 =
|
|
2925
|
-
coverage:
|
|
2926
|
-
matchedTermCount:
|
|
2927
|
-
rankingVersion:
|
|
2928
|
-
totalTermCount:
|
|
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 =
|
|
2934
|
-
path:
|
|
2949
|
+
var toolSearchSourceSchema = z15.strictObject({
|
|
2950
|
+
path: z15.string()
|
|
2935
2951
|
});
|
|
2936
|
-
var toolSearchSourceResultSchema =
|
|
2937
|
-
path:
|
|
2938
|
-
status:
|
|
2952
|
+
var toolSearchSourceResultSchema = z15.strictObject({
|
|
2953
|
+
path: z15.string(),
|
|
2954
|
+
status: z15.enum([
|
|
2939
2955
|
"ok",
|
|
2940
2956
|
"unsupported",
|
|
2941
2957
|
"timed_out",
|
|
@@ -2946,207 +2962,209 @@ var toolSearchSourceResultSchema = z14.strictObject({
|
|
|
2946
2962
|
"invalid_response"
|
|
2947
2963
|
])
|
|
2948
2964
|
});
|
|
2949
|
-
var toolSearchItemSchema =
|
|
2950
|
-
path:
|
|
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
|
|
2957
|
-
cursor:
|
|
2958
|
-
items:
|
|
2972
|
+
return z15.object({
|
|
2973
|
+
cursor: z15.string().optional(),
|
|
2974
|
+
items: z15.array(itemSchema)
|
|
2959
2975
|
});
|
|
2960
2976
|
}
|
|
2961
|
-
var toolSearchPageSchema =
|
|
2962
|
-
cursor:
|
|
2963
|
-
items:
|
|
2964
|
-
partial:
|
|
2965
|
-
snapshot:
|
|
2966
|
-
sources:
|
|
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 toolSearchOptionsSchema =
|
|
2969
|
-
cursor:
|
|
2970
|
-
detail:
|
|
2971
|
-
effects:
|
|
2972
|
-
federation:
|
|
2973
|
-
limit:
|
|
2974
|
-
matching:
|
|
2975
|
-
minCoverage:
|
|
2976
|
-
mode:
|
|
2977
|
-
pathPrefix:
|
|
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()
|
|
2978
2994
|
});
|
|
2979
|
-
var toolSearchRequestSchema =
|
|
2995
|
+
var toolSearchRequestSchema = z15.strictObject({
|
|
2980
2996
|
opts: toolSearchOptionsSchema.optional(),
|
|
2981
|
-
query:
|
|
2997
|
+
query: z15.string().trim().min(1)
|
|
2982
2998
|
});
|
|
2983
|
-
var deviceOperationStateSchema =
|
|
2999
|
+
var deviceOperationStateSchema = z15.enum(
|
|
2984
3000
|
DEVICE_OPERATION_STATES
|
|
2985
3001
|
);
|
|
2986
|
-
var deviceOperationCallerSchema =
|
|
2987
|
-
keyId:
|
|
2988
|
-
owner:
|
|
3002
|
+
var deviceOperationCallerSchema = z15.object({
|
|
3003
|
+
keyId: z15.string().min(1),
|
|
3004
|
+
owner: z15.string().min(1)
|
|
2989
3005
|
});
|
|
2990
3006
|
var deviceOperationSummaryShape = {
|
|
2991
|
-
attempt:
|
|
3007
|
+
attempt: z15.number().int().nonnegative(),
|
|
2992
3008
|
caller: deviceOperationCallerSchema,
|
|
2993
|
-
cancelRequestedAt:
|
|
2994
|
-
createdAt:
|
|
2995
|
-
deviceId:
|
|
2996
|
-
executionMayHaveOccurred:
|
|
2997
|
-
expiresAt:
|
|
2998
|
-
leaseUntil:
|
|
2999
|
-
mountPath:
|
|
3000
|
-
operationId:
|
|
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),
|
|
3001
3017
|
state: deviceOperationStateSchema,
|
|
3002
|
-
targetPath:
|
|
3003
|
-
terminalAt:
|
|
3004
|
-
traceId:
|
|
3005
|
-
updatedAt:
|
|
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 })
|
|
3006
3022
|
};
|
|
3007
|
-
var deviceOperationSummarySchema =
|
|
3023
|
+
var deviceOperationSummarySchema = z15.object(
|
|
3008
3024
|
deviceOperationSummaryShape
|
|
3009
3025
|
);
|
|
3010
|
-
var deviceOperationDetailSchema =
|
|
3026
|
+
var deviceOperationDetailSchema = z15.object({
|
|
3011
3027
|
...deviceOperationSummaryShape,
|
|
3012
3028
|
error: tbErrorBodySchema.optional(),
|
|
3013
|
-
result:
|
|
3029
|
+
result: z15.json().optional()
|
|
3014
3030
|
});
|
|
3015
|
-
var deviceOperationListRequestSchema =
|
|
3016
|
-
deviceId:
|
|
3017
|
-
opts:
|
|
3018
|
-
cursor:
|
|
3019
|
-
limit:
|
|
3020
|
-
states:
|
|
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()
|
|
3021
3037
|
}).optional()
|
|
3022
3038
|
});
|
|
3023
3039
|
var deviceOperationListResponseSchema = pageSchema(deviceOperationSummarySchema);
|
|
3024
|
-
var deviceOperationIdentityRequestSchema =
|
|
3025
|
-
deviceId:
|
|
3026
|
-
operationId:
|
|
3040
|
+
var deviceOperationIdentityRequestSchema = z15.strictObject({
|
|
3041
|
+
deviceId: z15.string().min(1),
|
|
3042
|
+
operationId: z15.string().min(1)
|
|
3027
3043
|
});
|
|
3028
|
-
var deviceOperationClaimRequestSchema =
|
|
3029
|
-
cursor:
|
|
3030
|
-
deviceId:
|
|
3031
|
-
limit:
|
|
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()
|
|
3032
3048
|
});
|
|
3033
|
-
var deviceOperationClaimSchema =
|
|
3034
|
-
arguments:
|
|
3035
|
-
attempt:
|
|
3049
|
+
var deviceOperationClaimSchema = z15.object({
|
|
3050
|
+
arguments: z15.record(z15.string(), z15.json()),
|
|
3051
|
+
attempt: z15.number().int().positive(),
|
|
3036
3052
|
caller: deviceOperationCallerSchema,
|
|
3037
|
-
cancelRequestedAt:
|
|
3038
|
-
createdAt:
|
|
3039
|
-
expiresAt:
|
|
3040
|
-
leaseId:
|
|
3041
|
-
leaseUntil:
|
|
3042
|
-
operationId:
|
|
3043
|
-
path:
|
|
3044
|
-
targetPath:
|
|
3045
|
-
traceId:
|
|
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)
|
|
3046
3062
|
});
|
|
3047
|
-
var deviceOperationClaimResponseSchema =
|
|
3048
|
-
cursor:
|
|
3063
|
+
var deviceOperationClaimResponseSchema = z15.object({
|
|
3064
|
+
cursor: z15.string().optional(),
|
|
3049
3065
|
operation: deviceOperationClaimSchema.optional(),
|
|
3050
|
-
serverNow:
|
|
3066
|
+
serverNow: z15.iso.datetime({ offset: true })
|
|
3051
3067
|
});
|
|
3052
3068
|
var deviceOperationLeaseShape = {
|
|
3053
|
-
deviceId:
|
|
3054
|
-
leaseId:
|
|
3055
|
-
operationId:
|
|
3069
|
+
deviceId: z15.string().min(1),
|
|
3070
|
+
leaseId: z15.string().min(1),
|
|
3071
|
+
operationId: z15.string().min(1)
|
|
3056
3072
|
};
|
|
3057
|
-
var deviceOperationRenewRequestSchema =
|
|
3058
|
-
var deviceOperationRenewResponseSchema =
|
|
3059
|
-
cancelRequestedAt:
|
|
3060
|
-
leaseUntil:
|
|
3061
|
-
serverNow:
|
|
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 })
|
|
3062
3078
|
});
|
|
3063
|
-
var deviceOperationCompleteRequestSchema =
|
|
3064
|
-
|
|
3079
|
+
var deviceOperationCompleteRequestSchema = z15.discriminatedUnion("outcome", [
|
|
3080
|
+
z15.strictObject({
|
|
3065
3081
|
...deviceOperationLeaseShape,
|
|
3066
|
-
outcome:
|
|
3067
|
-
result:
|
|
3082
|
+
outcome: z15.literal("succeeded"),
|
|
3083
|
+
result: z15.json()
|
|
3068
3084
|
}),
|
|
3069
|
-
|
|
3085
|
+
z15.strictObject({
|
|
3070
3086
|
...deviceOperationLeaseShape,
|
|
3071
3087
|
error: tbErrorBodySchema,
|
|
3072
|
-
outcome:
|
|
3088
|
+
outcome: z15.literal("rejected")
|
|
3073
3089
|
}),
|
|
3074
|
-
|
|
3090
|
+
z15.strictObject({
|
|
3075
3091
|
...deviceOperationLeaseShape,
|
|
3076
3092
|
error: tbErrorBodySchema,
|
|
3077
|
-
outcome:
|
|
3093
|
+
outcome: z15.literal("failed")
|
|
3078
3094
|
}),
|
|
3079
|
-
|
|
3095
|
+
z15.strictObject({
|
|
3080
3096
|
...deviceOperationLeaseShape,
|
|
3081
3097
|
error: tbErrorBodySchema.optional(),
|
|
3082
|
-
outcome:
|
|
3098
|
+
outcome: z15.literal("result_unknown")
|
|
3083
3099
|
})
|
|
3084
3100
|
]);
|
|
3085
|
-
var registryNodeSchema =
|
|
3086
|
-
config:
|
|
3087
|
-
createdAt:
|
|
3088
|
-
description:
|
|
3089
|
-
deviceId:
|
|
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(),
|
|
3090
3108
|
kind: nodeKindSchema,
|
|
3091
|
-
lastSeenAt:
|
|
3092
|
-
online:
|
|
3093
|
-
path:
|
|
3094
|
-
registeredBy:
|
|
3095
|
-
updatedAt:
|
|
3096
|
-
virtualize:
|
|
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()
|
|
3097
3115
|
});
|
|
3098
3116
|
var feedbackViewShape = {
|
|
3099
|
-
at:
|
|
3100
|
-
by:
|
|
3101
|
-
down:
|
|
3102
|
-
id:
|
|
3103
|
-
score:
|
|
3104
|
-
title:
|
|
3105
|
-
up:
|
|
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()
|
|
3106
3124
|
};
|
|
3107
|
-
var feedbackViewSchema =
|
|
3108
|
-
var feedbackDetailSchema =
|
|
3125
|
+
var feedbackViewSchema = z15.object(feedbackViewShape);
|
|
3126
|
+
var feedbackDetailSchema = z15.object({
|
|
3109
3127
|
...feedbackViewShape,
|
|
3110
|
-
detail:
|
|
3111
|
-
path:
|
|
3128
|
+
detail: z15.string(),
|
|
3129
|
+
path: z15.string()
|
|
3112
3130
|
});
|
|
3113
|
-
var feedbackListSchema =
|
|
3114
|
-
var feedbackSubmitRequestSchema =
|
|
3115
|
-
detail:
|
|
3116
|
-
title:
|
|
3131
|
+
var feedbackListSchema = z15.object({ items: z15.array(feedbackViewSchema) });
|
|
3132
|
+
var feedbackSubmitRequestSchema = z15.strictObject({
|
|
3133
|
+
detail: z15.string(),
|
|
3134
|
+
title: z15.string()
|
|
3117
3135
|
});
|
|
3118
|
-
var feedbackSubmitResponseSchema =
|
|
3119
|
-
at:
|
|
3120
|
-
id:
|
|
3121
|
-
path:
|
|
3122
|
-
title:
|
|
3136
|
+
var feedbackSubmitResponseSchema = z15.object({
|
|
3137
|
+
at: z15.string().optional(),
|
|
3138
|
+
id: z15.string(),
|
|
3139
|
+
path: z15.string(),
|
|
3140
|
+
title: z15.string()
|
|
3123
3141
|
});
|
|
3124
|
-
var feedbackVoteRequestSchema =
|
|
3125
|
-
vote:
|
|
3142
|
+
var feedbackVoteRequestSchema = z15.strictObject({
|
|
3143
|
+
vote: z15.enum(["up", "down", "clear"])
|
|
3126
3144
|
});
|
|
3127
|
-
var feedbackRemoveResponseSchema =
|
|
3128
|
-
var oauthAuthorizeRequestSchema =
|
|
3129
|
-
redirectUri:
|
|
3145
|
+
var feedbackRemoveResponseSchema = z15.object({ ok: z15.literal(true) });
|
|
3146
|
+
var oauthAuthorizeRequestSchema = z15.strictObject({
|
|
3147
|
+
redirectUri: z15.string().optional()
|
|
3130
3148
|
});
|
|
3131
|
-
var oauthAuthorizeResponseSchema =
|
|
3132
|
-
|
|
3133
|
-
|
|
3149
|
+
var oauthAuthorizeResponseSchema = z15.discriminatedUnion("status", [
|
|
3150
|
+
z15.object({ status: z15.literal("authorized") }),
|
|
3151
|
+
z15.object({ authorizationUrl: z15.url(), status: z15.literal("redirect") })
|
|
3134
3152
|
]);
|
|
3135
|
-
var healthResponseSchema =
|
|
3136
|
-
catalog:
|
|
3137
|
-
count:
|
|
3138
|
-
digest:
|
|
3153
|
+
var healthResponseSchema = z15.object({
|
|
3154
|
+
catalog: z15.object({
|
|
3155
|
+
count: z15.number().int().nonnegative(),
|
|
3156
|
+
digest: z15.string()
|
|
3139
3157
|
}).optional(),
|
|
3140
|
-
healthy:
|
|
3141
|
-
version:
|
|
3158
|
+
healthy: z15.boolean(),
|
|
3159
|
+
version: z15.string()
|
|
3142
3160
|
});
|
|
3143
|
-
var livenessResponseSchema =
|
|
3144
|
-
var readinessResponseSchema =
|
|
3145
|
-
checks:
|
|
3146
|
-
detail:
|
|
3147
|
-
ok:
|
|
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()
|
|
3148
3166
|
})),
|
|
3149
|
-
ready:
|
|
3167
|
+
ready: z15.boolean()
|
|
3150
3168
|
});
|
|
3151
3169
|
|
|
3152
3170
|
// ../core/src/builtin/registry.ts
|
|
@@ -3169,8 +3187,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
|
|
|
3169
3187
|
"list",
|
|
3170
3188
|
{
|
|
3171
3189
|
h: "list registered nodes, optionally under a path prefix",
|
|
3172
|
-
inputSchema:
|
|
3173
|
-
prefix:
|
|
3190
|
+
inputSchema: z16.strictObject({
|
|
3191
|
+
prefix: z16.string().optional().describe("only nodes under this path prefix"),
|
|
3174
3192
|
opts: HTBP_LIST_OPTIONS_SCHEMA.optional()
|
|
3175
3193
|
}),
|
|
3176
3194
|
returns: "Page<Node>",
|
|
@@ -3186,8 +3204,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
|
|
|
3186
3204
|
"get",
|
|
3187
3205
|
{
|
|
3188
3206
|
h: "fetch one node registration (kind, description, config) by path",
|
|
3189
|
-
inputSchema:
|
|
3190
|
-
path:
|
|
3207
|
+
inputSchema: z16.strictObject({
|
|
3208
|
+
path: z16.string().min(1).describe("exact tree path")
|
|
3191
3209
|
}),
|
|
3192
3210
|
returns: "Node",
|
|
3193
3211
|
scope: "read"
|
|
@@ -3211,8 +3229,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
|
|
|
3211
3229
|
"update",
|
|
3212
3230
|
{
|
|
3213
3231
|
h: "patch fields of a mounted node (description, config, virtualize, \u2026) without remounting",
|
|
3214
|
-
inputSchema:
|
|
3215
|
-
path:
|
|
3232
|
+
inputSchema: z16.strictObject({
|
|
3233
|
+
path: z16.string().min(1).describe("exact tree path"),
|
|
3216
3234
|
patch: nodePatchSchema
|
|
3217
3235
|
}),
|
|
3218
3236
|
returns: "Node",
|
|
@@ -3223,8 +3241,8 @@ var COMMANDS6 = new BuiltinCommandRegistry("registry", DESCRIPTION6).register(
|
|
|
3223
3241
|
"delete",
|
|
3224
3242
|
{
|
|
3225
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",
|
|
3226
|
-
inputSchema:
|
|
3227
|
-
path:
|
|
3244
|
+
inputSchema: z16.strictObject({
|
|
3245
|
+
path: z16.string().min(1).describe("exact tree path")
|
|
3228
3246
|
}),
|
|
3229
3247
|
returns: "void",
|
|
3230
3248
|
scope: "register"
|
|
@@ -3239,7 +3257,7 @@ function createRegistryModule(store, now, visibility) {
|
|
|
3239
3257
|
}
|
|
3240
3258
|
|
|
3241
3259
|
// ../core/src/builtin/secret.ts
|
|
3242
|
-
import { z as
|
|
3260
|
+
import { z as z17 } from "zod/v4";
|
|
3243
3261
|
var DESCRIPTION7 = "Upstream credential vault: write-only; mounts reference entries by name (authRef), values can never be read back (admin only)";
|
|
3244
3262
|
function assertUserSecretName(name) {
|
|
3245
3263
|
if (name.includes(":")) {
|
|
@@ -3253,11 +3271,11 @@ var COMMANDS7 = new BuiltinCommandRegistry("secret", DESCRIPTION7).register(
|
|
|
3253
3271
|
"set",
|
|
3254
3272
|
{
|
|
3255
3273
|
h: "store or rotate a credential under a name; mount configs reference it as authRef",
|
|
3256
|
-
inputSchema:
|
|
3257
|
-
name:
|
|
3274
|
+
inputSchema: z17.strictObject({
|
|
3275
|
+
name: z17.string().min(1).describe(
|
|
3258
3276
|
'reference name used as authRef in mount configs (":" is reserved)'
|
|
3259
3277
|
),
|
|
3260
|
-
value:
|
|
3278
|
+
value: z17.string().min(1).describe(
|
|
3261
3279
|
"the credential (token / key / JSON); encrypted at rest, never echoed"
|
|
3262
3280
|
)
|
|
3263
3281
|
}),
|
|
@@ -3273,7 +3291,7 @@ var COMMANDS7 = new BuiltinCommandRegistry("secret", DESCRIPTION7).register(
|
|
|
3273
3291
|
"list",
|
|
3274
3292
|
{
|
|
3275
3293
|
h: "list stored credential names (names and timestamps only, never values)",
|
|
3276
|
-
inputSchema:
|
|
3294
|
+
inputSchema: z17.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
|
|
3277
3295
|
returns: "Page<{ name, updatedAt }>",
|
|
3278
3296
|
scope: "admin"
|
|
3279
3297
|
},
|
|
@@ -3282,8 +3300,8 @@ var COMMANDS7 = new BuiltinCommandRegistry("secret", DESCRIPTION7).register(
|
|
|
3282
3300
|
"delete",
|
|
3283
3301
|
{
|
|
3284
3302
|
h: "delete a credential; mounts still referencing it will fail to resolve",
|
|
3285
|
-
inputSchema:
|
|
3286
|
-
name:
|
|
3303
|
+
inputSchema: z17.strictObject({
|
|
3304
|
+
name: z17.string().min(1).describe("reference name")
|
|
3287
3305
|
}),
|
|
3288
3306
|
returns: "void",
|
|
3289
3307
|
scope: "admin"
|
|
@@ -3299,13 +3317,13 @@ function createSecretModule(store, now) {
|
|
|
3299
3317
|
}
|
|
3300
3318
|
|
|
3301
3319
|
// ../core/src/builtin/status.ts
|
|
3302
|
-
import { z as
|
|
3320
|
+
import { z as z18 } from "zod/v4";
|
|
3303
3321
|
var DESCRIPTION8 = "Gateway health and summary (readable without admin)";
|
|
3304
3322
|
var COMMANDS8 = new BuiltinCommandRegistry("status", DESCRIPTION8).register(
|
|
3305
3323
|
"get",
|
|
3306
3324
|
{
|
|
3307
3325
|
h: "health summary: gateway version and node count; no arguments",
|
|
3308
|
-
inputSchema:
|
|
3326
|
+
inputSchema: z18.strictObject({}),
|
|
3309
3327
|
returns: "{ healthy, version, nodeCount }",
|
|
3310
3328
|
scope: "read"
|
|
3311
3329
|
},
|
|
@@ -3323,41 +3341,41 @@ function createStatusModule(deps) {
|
|
|
3323
3341
|
}
|
|
3324
3342
|
|
|
3325
3343
|
// ../core/src/builtin/sk.ts
|
|
3326
|
-
import { z as
|
|
3344
|
+
import { z as z19 } from "zod/v4";
|
|
3327
3345
|
var DESCRIPTION9 = "Secret Key registry: issue / list / update / revoke access keys (the only credential form; admin only)";
|
|
3328
|
-
var actionSchema2 =
|
|
3329
|
-
var scopeSchema =
|
|
3330
|
-
pattern:
|
|
3331
|
-
actions:
|
|
3332
|
-
effect:
|
|
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"')
|
|
3333
3351
|
});
|
|
3334
|
-
var ownerSchema =
|
|
3352
|
+
var ownerSchema = z19.string().min(1).describe(
|
|
3335
3353
|
'owner ref: "user:<name>" | "agent:<name>" | "device:<id>"'
|
|
3336
3354
|
);
|
|
3337
|
-
var descriptionSchema =
|
|
3338
|
-
var scopesSchema =
|
|
3355
|
+
var descriptionSchema = z19.string().optional().describe("what this key is for (shown in list)");
|
|
3356
|
+
var scopesSchema = z19.array(scopeSchema).describe(
|
|
3339
3357
|
"permission grants; deny wins over allow, no match = denied"
|
|
3340
3358
|
);
|
|
3341
|
-
var registerPathsSchema =
|
|
3359
|
+
var registerPathsSchema = z19.array(z19.string()).optional().describe(
|
|
3342
3360
|
"path prefixes this key may self-register nodes under (via ~register)"
|
|
3343
3361
|
);
|
|
3344
|
-
var expiresAtSchema =
|
|
3362
|
+
var expiresAtSchema = z19.string().optional().describe(
|
|
3345
3363
|
"expiry, ISO 8601 timestamp with timezone; omit = never"
|
|
3346
3364
|
);
|
|
3347
|
-
var writeSchema =
|
|
3365
|
+
var writeSchema = z19.strictObject({
|
|
3348
3366
|
owner: ownerSchema,
|
|
3349
3367
|
description: descriptionSchema,
|
|
3350
3368
|
scopes: scopesSchema,
|
|
3351
3369
|
registerPaths: registerPathsSchema,
|
|
3352
3370
|
expiresAt: expiresAtSchema
|
|
3353
3371
|
});
|
|
3354
|
-
var patchSchema2 =
|
|
3372
|
+
var patchSchema2 = z19.strictObject({
|
|
3355
3373
|
owner: ownerSchema.optional(),
|
|
3356
3374
|
description: descriptionSchema,
|
|
3357
3375
|
scopes: scopesSchema.optional(),
|
|
3358
3376
|
registerPaths: registerPathsSchema,
|
|
3359
3377
|
expiresAt: expiresAtSchema,
|
|
3360
|
-
disabled:
|
|
3378
|
+
disabled: z19.boolean().optional().describe("true = key rejected until re-enabled")
|
|
3361
3379
|
}).describe("fields to change; same shape as write (all optional) plus disabled");
|
|
3362
3380
|
function toSecretKeyInput(input) {
|
|
3363
3381
|
return {
|
|
@@ -3382,7 +3400,7 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
|
|
|
3382
3400
|
"list",
|
|
3383
3401
|
{
|
|
3384
3402
|
h: "list issued keys (id, owner, scopes; the secret itself is never returned)",
|
|
3385
|
-
inputSchema:
|
|
3403
|
+
inputSchema: z19.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
|
|
3386
3404
|
returns: "Page<SecretKey without hash>",
|
|
3387
3405
|
scope: "admin"
|
|
3388
3406
|
},
|
|
@@ -3391,8 +3409,8 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
|
|
|
3391
3409
|
"get",
|
|
3392
3410
|
{
|
|
3393
3411
|
h: "fetch one key by id",
|
|
3394
|
-
inputSchema:
|
|
3395
|
-
id:
|
|
3412
|
+
inputSchema: z19.strictObject({
|
|
3413
|
+
id: z19.string().min(1).describe("key id (from list or the issue response)")
|
|
3396
3414
|
}),
|
|
3397
3415
|
returns: "SecretKey without hash",
|
|
3398
3416
|
scope: "admin"
|
|
@@ -3411,8 +3429,8 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
|
|
|
3411
3429
|
"update",
|
|
3412
3430
|
{
|
|
3413
3431
|
h: "patch fields of an issued key (scopes, expiresAt, disabled, \u2026); takes effect immediately",
|
|
3414
|
-
inputSchema:
|
|
3415
|
-
id:
|
|
3432
|
+
inputSchema: z19.strictObject({
|
|
3433
|
+
id: z19.string().min(1).describe("key id"),
|
|
3416
3434
|
patch: patchSchema2
|
|
3417
3435
|
}),
|
|
3418
3436
|
returns: "SecretKey without hash",
|
|
@@ -3423,7 +3441,7 @@ var COMMANDS9 = new BuiltinCommandRegistry("sk", DESCRIPTION9).register(
|
|
|
3423
3441
|
"delete",
|
|
3424
3442
|
{
|
|
3425
3443
|
h: "revoke a key permanently; takes effect immediately",
|
|
3426
|
-
inputSchema:
|
|
3444
|
+
inputSchema: z19.strictObject({ id: z19.string().min(1).describe("key id") }),
|
|
3427
3445
|
returns: "void",
|
|
3428
3446
|
scope: "admin"
|
|
3429
3447
|
},
|
|
@@ -3437,24 +3455,24 @@ function createSkModule(store, now) {
|
|
|
3437
3455
|
}
|
|
3438
3456
|
|
|
3439
3457
|
// ../core/src/builtin/keys.ts
|
|
3440
|
-
import { z as
|
|
3458
|
+
import { z as z21 } from "zod";
|
|
3441
3459
|
|
|
3442
3460
|
// ../core/src/keyManagement.ts
|
|
3443
|
-
import { z as
|
|
3444
|
-
var keyRotateSchema =
|
|
3445
|
-
expectedRevision:
|
|
3446
|
-
target:
|
|
3447
|
-
revokeExisting:
|
|
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()
|
|
3448
3466
|
});
|
|
3449
|
-
var keyRetireSchema =
|
|
3450
|
-
expectedRevision:
|
|
3451
|
-
keyId:
|
|
3452
|
-
target:
|
|
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"])
|
|
3453
3471
|
});
|
|
3454
|
-
var keyResumeSchema =
|
|
3472
|
+
var keyResumeSchema = z20.strictObject({ jobId: z20.string().min(1).max(128) });
|
|
3455
3473
|
|
|
3456
3474
|
// ../core/src/builtin/keys.ts
|
|
3457
|
-
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:
|
|
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());
|
|
3458
3476
|
var createKeysModule = (deps) => commands.module(deps);
|
|
3459
3477
|
|
|
3460
3478
|
// ../core/src/builtin/index.ts
|
|
@@ -3499,47 +3517,47 @@ function createBuiltins(deps) {
|
|
|
3499
3517
|
}
|
|
3500
3518
|
|
|
3501
3519
|
// ../core/src/builtin/deployment.ts
|
|
3502
|
-
import { z as
|
|
3520
|
+
import { z as z23 } from "zod";
|
|
3503
3521
|
|
|
3504
3522
|
// ../core/src/deployment.ts
|
|
3505
|
-
import { z as
|
|
3506
|
-
var directory =
|
|
3507
|
-
var deploymentSettingsSchema =
|
|
3508
|
-
image:
|
|
3509
|
-
hostPort:
|
|
3510
|
-
bindAddress:
|
|
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"),
|
|
3511
3529
|
stateDirectory: directory.optional().describe("\u5BBF\u4E3B\u6570\u636E\u76EE\u5F55\uFF08\u53EF\u9009\uFF09"),
|
|
3512
3530
|
uiDirectory: directory.optional().describe("\u5BBF\u4E3B\u7BA1\u7406\u754C\u9762\u76EE\u5F55\uFF08\u53EF\u9009\uFF09")
|
|
3513
3531
|
});
|
|
3514
|
-
var deploymentUpdateSchema =
|
|
3515
|
-
var deploymentClaimSchema =
|
|
3516
|
-
var deploymentCompleteSchema =
|
|
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() });
|
|
3517
3535
|
|
|
3518
3536
|
// ../core/src/builtin/deployment.ts
|
|
3519
|
-
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:
|
|
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));
|
|
3520
3538
|
var createDeploymentModule = (deps) => commands2.module(deps);
|
|
3521
3539
|
|
|
3522
3540
|
// ../core/src/builtin/maintenance.ts
|
|
3523
|
-
import { z as
|
|
3541
|
+
import { z as z25 } from "zod";
|
|
3524
3542
|
|
|
3525
3543
|
// ../core/src/maintenance.ts
|
|
3526
|
-
import { z as
|
|
3527
|
-
var revision =
|
|
3528
|
-
var databaseUrl =
|
|
3529
|
-
var databaseMigrationSchema =
|
|
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({
|
|
3530
3548
|
expectedRevision: revision,
|
|
3531
|
-
expectedInstanceId:
|
|
3549
|
+
expectedInstanceId: z24.string().min(1),
|
|
3532
3550
|
databaseUrl
|
|
3533
3551
|
});
|
|
3534
|
-
var databaseCredentialRotationSchema =
|
|
3552
|
+
var databaseCredentialRotationSchema = z24.strictObject({
|
|
3535
3553
|
databaseAdminUrl: databaseUrl.optional(),
|
|
3536
3554
|
expectedRevision: revision,
|
|
3537
|
-
expectedInstanceId:
|
|
3538
|
-
password:
|
|
3555
|
+
expectedInstanceId: z24.string().min(1),
|
|
3556
|
+
password: z24.string().min(24).max(4096)
|
|
3539
3557
|
});
|
|
3540
|
-
var redisMaintenanceSchema =
|
|
3558
|
+
var redisMaintenanceSchema = z24.strictObject({
|
|
3541
3559
|
expectedRevision: revision,
|
|
3542
|
-
redisUrl:
|
|
3560
|
+
redisUrl: z24.string().min(1).max(8192).nullable()
|
|
3543
3561
|
});
|
|
3544
3562
|
|
|
3545
3563
|
// ../core/src/builtin/maintenance.ts
|
|
@@ -3549,7 +3567,7 @@ var commands3 = new BuiltinCommandRegistry(
|
|
|
3549
3567
|
).register(
|
|
3550
3568
|
"status",
|
|
3551
3569
|
{
|
|
3552
|
-
inputSchema:
|
|
3570
|
+
inputSchema: z25.strictObject({}),
|
|
3553
3571
|
scope: "admin",
|
|
3554
3572
|
h: "\u7EF4\u62A4\u9636\u6BB5\u53CA\u5DF2\u8131\u654F\u7684\u8FDE\u63A5\u72B6\u6001",
|
|
3555
3573
|
returns: "MaintenanceStatus"
|
|
@@ -3586,20 +3604,20 @@ var commands3 = new BuiltinCommandRegistry(
|
|
|
3586
3604
|
var createMaintenanceModule = (deps) => commands3.module(deps);
|
|
3587
3605
|
|
|
3588
3606
|
// ../core/src/builtin/management.ts
|
|
3589
|
-
import { z as
|
|
3607
|
+
import { z as z27 } from "zod";
|
|
3590
3608
|
|
|
3591
3609
|
// ../core/src/managedConfig.ts
|
|
3592
|
-
import { z as
|
|
3610
|
+
import { z as z26 } from "zod";
|
|
3593
3611
|
|
|
3594
3612
|
// ../core/src/runtimeConfig.ts
|
|
3595
3613
|
var DEFAULT_MAX_HOPS = 4;
|
|
3596
3614
|
|
|
3597
3615
|
// ../core/src/managedConfig.ts
|
|
3598
|
-
var positive =
|
|
3616
|
+
var positive = z26.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
3599
3617
|
var ttl = positive.max(604800);
|
|
3600
|
-
var runtimeConfigSchema =
|
|
3601
|
-
canonicalOrigin:
|
|
3602
|
-
remoteAllowlist:
|
|
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"),
|
|
3603
3621
|
maxHops: positive.max(16).default(DEFAULT_MAX_HOPS).describe("\u8054\u90A6\u6700\u5927\u8DF3\u6570"),
|
|
3604
3622
|
deviceReclaimSec: positive.max(2147483).default(86400).describe("\u79BB\u7EBF\u8BBE\u5907\u56DE\u6536\u7B49\u5F85\uFF08\u79D2\uFF09"),
|
|
3605
3623
|
toolCacheTtlSec: positive.default(300).describe("\u5DE5\u5177\u7F13\u5B58\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
|
|
@@ -3611,7 +3629,7 @@ var runtimeConfigSchema = z25.strictObject({
|
|
|
3611
3629
|
storeCallMaxBytes: positive.default(536870912).describe("\u5355\u6B21\u8C03\u7528\u7D2F\u8BA1\u4E0A\u4F20\u5927\u5C0F\uFF08\u5B57\u8282\uFF09"),
|
|
3612
3630
|
storeCallMaxObjectBytes: positive.max(1073741824).default(268435456).describe("\u8C03\u7528\u5185\u5355\u4E2A\u5BF9\u8C61\u6700\u5927\u5927\u5C0F\uFF08\u5B57\u8282\uFF09"),
|
|
3613
3631
|
storeCallMaxObjects: positive.default(4).describe("\u5355\u6B21\u8C03\u7528\u6700\u591A\u5BF9\u8C61\u6570"),
|
|
3614
|
-
storeCallAllowedContentTypes:
|
|
3632
|
+
storeCallAllowedContentTypes: z26.array(z26.string().min(1)).min(1).default(["*/*"]).describe("\u8C03\u7528\u4E0A\u4F20\u5141\u8BB8\u7684 MIME \u7C7B\u578B"),
|
|
3615
3633
|
storeUploadTtlSec: ttl.default(900).describe("\u4E0A\u4F20\u4F1A\u8BDD\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
|
|
3616
3634
|
storeShareTtlSec: ttl.default(900).describe("\u5206\u4EAB\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
|
|
3617
3635
|
storeReadTtlSec: ttl.default(900).describe("\u4E0B\u8F7D\u5F15\u7528\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
|
|
@@ -3623,37 +3641,37 @@ var runtimeConfigSchema = z25.strictObject({
|
|
|
3623
3641
|
searchMinChildWorkMs: positive.default(200).describe("\u5B50\u641C\u7D22\u6700\u5C11\u5DE5\u4F5C\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09"),
|
|
3624
3642
|
searchReturnReserveMs: positive.default(100).describe("\u641C\u7D22\u8FD4\u56DE\u9884\u7559\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09"),
|
|
3625
3643
|
searchSessionTtlSec: positive.default(300).describe("\u641C\u7D22\u5FEB\u7167\u6709\u6548\u671F\uFF08\u79D2\uFF09"),
|
|
3626
|
-
shutdownDrainSec:
|
|
3644
|
+
shutdownDrainSec: z26.number().int().min(0).max(300).default(0).describe("\u5173\u505C\u6392\u7A7A\u7B49\u5F85\uFF08\u79D2\uFF09")
|
|
3627
3645
|
});
|
|
3628
|
-
var configUpdateSchema =
|
|
3629
|
-
expectedRevision:
|
|
3646
|
+
var configUpdateSchema = z26.strictObject({
|
|
3647
|
+
expectedRevision: z26.number().int().nonnegative(),
|
|
3630
3648
|
settings: runtimeConfigSchema
|
|
3631
3649
|
});
|
|
3632
|
-
var revisionSchema =
|
|
3633
|
-
var s3ConnectionSchema =
|
|
3634
|
-
endpoint:
|
|
3635
|
-
bucket:
|
|
3636
|
-
region:
|
|
3637
|
-
accessKeyId:
|
|
3638
|
-
secretAccessKey:
|
|
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)
|
|
3639
3657
|
});
|
|
3640
|
-
var storageWriteSchema =
|
|
3641
|
-
name:
|
|
3658
|
+
var storageWriteSchema = z26.strictObject({
|
|
3659
|
+
name: z26.string().min(1).max(120),
|
|
3642
3660
|
connection: s3ConnectionSchema
|
|
3643
3661
|
});
|
|
3644
|
-
var storageIdSchema =
|
|
3662
|
+
var storageIdSchema = z26.strictObject({ id: z26.string().min(1).max(128) });
|
|
3645
3663
|
var storageRevisionSchema = storageIdSchema.extend({
|
|
3646
|
-
expectedRevision:
|
|
3664
|
+
expectedRevision: z26.number().int().nonnegative()
|
|
3647
3665
|
});
|
|
3648
3666
|
var storageActivateSchema = storageRevisionSchema.extend({
|
|
3649
|
-
expectedActiveRevision:
|
|
3667
|
+
expectedActiveRevision: z26.number().int().nonnegative()
|
|
3650
3668
|
});
|
|
3651
3669
|
var storageRotateSchema = storageRevisionSchema.extend({
|
|
3652
|
-
accessKeyId:
|
|
3653
|
-
secretAccessKey:
|
|
3670
|
+
accessKeyId: z26.string().min(1),
|
|
3671
|
+
secretAccessKey: z26.string().min(1)
|
|
3654
3672
|
});
|
|
3655
|
-
var setupInputSchema =
|
|
3656
|
-
databaseUrl:
|
|
3673
|
+
var setupInputSchema = z26.strictObject({
|
|
3674
|
+
databaseUrl: z26.string().min(1).refine((value) => {
|
|
3657
3675
|
try {
|
|
3658
3676
|
return ["postgres:", "postgresql:"].includes(new URL(value).protocol);
|
|
3659
3677
|
} catch {
|
|
@@ -3661,47 +3679,47 @@ var setupInputSchema = z25.strictObject({
|
|
|
3661
3679
|
}
|
|
3662
3680
|
}, "\u9700\u8981 PostgreSQL \u8FDE\u63A5\u5730\u5740").optional(),
|
|
3663
3681
|
storage: s3ConnectionSchema.optional(),
|
|
3664
|
-
redisUrl:
|
|
3682
|
+
redisUrl: z26.string().optional(),
|
|
3665
3683
|
settings: runtimeConfigSchema.default(() => runtimeConfigSchema.parse({}))
|
|
3666
3684
|
});
|
|
3667
|
-
var setupStatusSchema =
|
|
3668
|
-
state:
|
|
3669
|
-
instanceId:
|
|
3670
|
-
pairingRequired:
|
|
3685
|
+
var setupStatusSchema = z26.object({
|
|
3686
|
+
state: z26.enum(["setup", "installing", "ready", "recovery"]),
|
|
3687
|
+
instanceId: z26.string().min(1),
|
|
3688
|
+
pairingRequired: z26.boolean()
|
|
3671
3689
|
});
|
|
3672
|
-
var setupDefaultsSchema =
|
|
3673
|
-
databaseConfigured:
|
|
3674
|
-
databaseHost:
|
|
3675
|
-
redisConfigured:
|
|
3676
|
-
storageConfigured:
|
|
3677
|
-
storage:
|
|
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()
|
|
3678
3696
|
});
|
|
3679
|
-
var setupResultSchema =
|
|
3680
|
-
state:
|
|
3681
|
-
adminSk:
|
|
3682
|
-
baseUrl:
|
|
3697
|
+
var setupResultSchema = z26.object({
|
|
3698
|
+
state: z26.literal("ready"),
|
|
3699
|
+
adminSk: z26.string().min(1),
|
|
3700
|
+
baseUrl: z26.string()
|
|
3683
3701
|
});
|
|
3684
|
-
var backupKeyringSchema =
|
|
3702
|
+
var backupKeyringSchema = z26.strictObject({ activeKeyId: z26.string().min(1), keys: z26.record(z26.string(), z26.string()) });
|
|
3685
3703
|
var recoveryInputSchema = setupInputSchema.extend({
|
|
3686
|
-
backup:
|
|
3687
|
-
version:
|
|
3688
|
-
instanceId:
|
|
3689
|
-
exportedAt:
|
|
3704
|
+
backup: z26.strictObject({
|
|
3705
|
+
version: z26.literal(1),
|
|
3706
|
+
instanceId: z26.string().min(1),
|
|
3707
|
+
exportedAt: z26.string().min(1),
|
|
3690
3708
|
keyring: backupKeyringSchema,
|
|
3691
3709
|
storeTokenKeyring: backupKeyringSchema,
|
|
3692
|
-
oauthKey:
|
|
3693
|
-
signingRetireAfter:
|
|
3710
|
+
oauthKey: z26.string().min(1),
|
|
3711
|
+
signingRetireAfter: z26.record(z26.string(), z26.string()).optional()
|
|
3694
3712
|
}).optional()
|
|
3695
3713
|
});
|
|
3696
|
-
var recoveryResultSchema =
|
|
3697
|
-
state:
|
|
3698
|
-
baseUrl:
|
|
3699
|
-
adminSk:
|
|
3714
|
+
var recoveryResultSchema = z26.object({
|
|
3715
|
+
state: z26.literal("ready"),
|
|
3716
|
+
baseUrl: z26.string(),
|
|
3717
|
+
adminSk: z26.string().min(1).optional()
|
|
3700
3718
|
});
|
|
3701
3719
|
|
|
3702
3720
|
// ../core/src/builtin/management.ts
|
|
3703
|
-
var configCommands = new BuiltinCommandRegistry("config", "\u5B9E\u4F8B\u914D\u7F6E\u4E0E\u751F\u6548\u72B6\u6001\uFF08\u7BA1\u7406\u5458\uFF09").register("schema", { inputSchema:
|
|
3704
|
-
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:
|
|
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));
|
|
3705
3723
|
var createConfigModule = (deps) => configCommands.module(deps);
|
|
3706
3724
|
var createStorageModule = (deps) => storageCommands.module(deps);
|
|
3707
3725
|
|
|
@@ -4106,78 +4124,79 @@ function isContextExpired(createdAt, ttlSec, now) {
|
|
|
4106
4124
|
}
|
|
4107
4125
|
|
|
4108
4126
|
// ../core/src/device/frames.ts
|
|
4109
|
-
import { z as
|
|
4110
|
-
var deviceNodeCmdSchema =
|
|
4111
|
-
name:
|
|
4112
|
-
delivery:
|
|
4113
|
-
description:
|
|
4114
|
-
inputSchema:
|
|
4115
|
-
outputSchema:
|
|
4116
|
-
effect:
|
|
4117
|
-
confirm:
|
|
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()
|
|
4118
4136
|
}).passthrough();
|
|
4119
|
-
var nodeInputSchema2 =
|
|
4120
|
-
path:
|
|
4121
|
-
kind:
|
|
4122
|
-
description:
|
|
4123
|
-
cmds:
|
|
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()
|
|
4124
4142
|
}).passthrough();
|
|
4125
|
-
var deviceExposeSchema =
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
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()
|
|
4129
4148
|
}).optional(),
|
|
4130
|
-
fs:
|
|
4131
|
-
roots:
|
|
4132
|
-
readOnly:
|
|
4149
|
+
fs: z28.object({
|
|
4150
|
+
roots: z28.array(z28.string().min(1)).min(1),
|
|
4151
|
+
readOnly: z28.boolean().optional()
|
|
4133
4152
|
}).optional(),
|
|
4134
|
-
nodes:
|
|
4153
|
+
nodes: z28.array(nodeInputSchema2).optional()
|
|
4135
4154
|
});
|
|
4136
|
-
var idSchema =
|
|
4137
|
-
var deviceCallContextSchema =
|
|
4138
|
-
caller:
|
|
4139
|
-
keyId:
|
|
4140
|
-
owner:
|
|
4141
|
-
displayName:
|
|
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()
|
|
4142
4161
|
}).passthrough(),
|
|
4143
|
-
traceId:
|
|
4144
|
-
createdAt:
|
|
4145
|
-
expiresAt:
|
|
4146
|
-
upload:
|
|
4147
|
-
token:
|
|
4148
|
-
expiresAt:
|
|
4149
|
-
maxBytes:
|
|
4150
|
-
maxObjects:
|
|
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()
|
|
4151
4170
|
}).strict().optional()
|
|
4152
4171
|
}).passthrough();
|
|
4153
4172
|
var schemaByType = {
|
|
4154
|
-
hello:
|
|
4155
|
-
type:
|
|
4156
|
-
deviceId:
|
|
4157
|
-
mountPath:
|
|
4173
|
+
hello: z28.object({
|
|
4174
|
+
type: z28.literal("hello"),
|
|
4175
|
+
deviceId: z28.string().min(1),
|
|
4176
|
+
mountPath: z28.string().min(1).optional(),
|
|
4158
4177
|
expose: deviceExposeSchema
|
|
4159
4178
|
}),
|
|
4160
|
-
ready:
|
|
4161
|
-
error:
|
|
4162
|
-
call:
|
|
4163
|
-
type:
|
|
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"),
|
|
4164
4183
|
id: idSchema,
|
|
4165
|
-
path:
|
|
4166
|
-
arguments:
|
|
4184
|
+
path: z28.string().min(1),
|
|
4185
|
+
arguments: z28.record(z28.string(), z28.unknown()),
|
|
4167
4186
|
context: deviceCallContextSchema.optional()
|
|
4168
4187
|
}),
|
|
4169
|
-
result:
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
type:
|
|
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"),
|
|
4173
4192
|
id: idSchema,
|
|
4174
|
-
ok:
|
|
4193
|
+
ok: z28.literal(false),
|
|
4175
4194
|
error: tbErrorBodySchema
|
|
4176
4195
|
})
|
|
4177
4196
|
]),
|
|
4178
|
-
ping:
|
|
4179
|
-
pong:
|
|
4180
|
-
cancel:
|
|
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 })
|
|
4181
4200
|
};
|
|
4182
4201
|
var PING_FRAME_JSON = '{"type":"ping"}';
|
|
4183
4202
|
var PONG_FRAME_JSON = '{"type":"pong"}';
|
|
@@ -4264,7 +4283,11 @@ function deviceDirectoryHelpModel(node, children = []) {
|
|
|
4264
4283
|
description: `${node.description} (${node.presence.state})`
|
|
4265
4284
|
},
|
|
4266
4285
|
cmds: [],
|
|
4267
|
-
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
|
+
}
|
|
4268
4291
|
};
|
|
4269
4292
|
}
|
|
4270
4293
|
|
|
@@ -4671,6 +4694,7 @@ function attrLines(key, value) {
|
|
|
4671
4694
|
function renderHelpDsl(model) {
|
|
4672
4695
|
const lines = [HTBP_HELP_HEADER];
|
|
4673
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)}`);
|
|
4674
4698
|
if (model.hint !== void 0) lines.push(`hint ${collapseToOneLine(model.hint)}`);
|
|
4675
4699
|
if (model.note !== void 0) lines.push(`note "${collapseToOneLine(model.note)}"`);
|
|
4676
4700
|
for (const cmd of model.cmds) {
|
|
@@ -4725,6 +4749,7 @@ function renderHelpJson(model) {
|
|
|
4725
4749
|
node: { path: model.node.path, kind: model.node.kind, description: model.node.description },
|
|
4726
4750
|
cmds
|
|
4727
4751
|
};
|
|
4752
|
+
if (model.deviceContext !== void 0) json.deviceContext = model.deviceContext;
|
|
4728
4753
|
if (model.hint !== void 0) json.hint = model.hint;
|
|
4729
4754
|
if (model.note !== void 0) json.note = model.note;
|
|
4730
4755
|
if (model.feedback !== void 0 && model.feedback.length > 0) {
|
|
@@ -4790,6 +4815,11 @@ function renderHelpMarkdown(model) {
|
|
|
4790
4815
|
if (model.node.description.trim() !== "") {
|
|
4791
4816
|
out.push(model.node.description.trim(), "");
|
|
4792
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
|
+
}
|
|
4793
4823
|
if (model.hint !== void 0) {
|
|
4794
4824
|
out.push(`> **Next step**: ${collapseToOneLine(model.hint)}`, "");
|
|
4795
4825
|
}
|
|
@@ -4981,7 +5011,7 @@ function assertUploadBinding(existing, requested, now) {
|
|
|
4981
5011
|
}
|
|
4982
5012
|
|
|
4983
5013
|
// ../core/src/objectStoreService/service.ts
|
|
4984
|
-
import { z as
|
|
5014
|
+
import { z as z29 } from "zod/v4";
|
|
4985
5015
|
|
|
4986
5016
|
// ../core/src/objectStoreService/uri.ts
|
|
4987
5017
|
var STORE_OBJECT_ID_RE = /^[A-Za-z0-9_-]{22,64}$/;
|
|
@@ -5020,18 +5050,18 @@ var TOKEN_PREFIX = {
|
|
|
5020
5050
|
function stateCorrupt(kind) {
|
|
5021
5051
|
return new TBError("internal", `Store ${kind} \u72B6\u6001\u635F\u574F`, { retryable: false });
|
|
5022
5052
|
}
|
|
5023
|
-
var persistedId =
|
|
5024
|
-
var persistedOwner =
|
|
5025
|
-
var persistedTimestamp =
|
|
5026
|
-
var persistedNonNegativeInt =
|
|
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);
|
|
5027
5057
|
var persistedPositiveInt = persistedNonNegativeInt.refine((value) => value > 0);
|
|
5028
|
-
var persistedHash =
|
|
5029
|
-
var persistedChecksum =
|
|
5030
|
-
algorithm:
|
|
5031
|
-
value:
|
|
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)
|
|
5032
5062
|
});
|
|
5033
5063
|
function stateParser(kind, shape) {
|
|
5034
|
-
const schema =
|
|
5064
|
+
const schema = z29.looseObject({ revision: persistedPositiveInt, ...shape });
|
|
5035
5065
|
return (value) => {
|
|
5036
5066
|
const parsed = schema.safeParse(value);
|
|
5037
5067
|
if (!parsed.success) throw stateCorrupt(kind);
|
|
@@ -5042,22 +5072,22 @@ var parseObject = stateParser("object", {
|
|
|
5042
5072
|
backendId: persistedId,
|
|
5043
5073
|
bytesDeletedAt: persistedTimestamp.optional(),
|
|
5044
5074
|
checksum: persistedChecksum.optional(),
|
|
5045
|
-
contentType:
|
|
5075
|
+
contentType: z29.string().min(1),
|
|
5046
5076
|
createdAt: persistedTimestamp,
|
|
5047
5077
|
driverKey: persistedId,
|
|
5048
|
-
etag:
|
|
5078
|
+
etag: z29.string().optional(),
|
|
5049
5079
|
expectedChecksum: persistedChecksum.optional(),
|
|
5050
5080
|
expectedSize: persistedNonNegativeInt.optional(),
|
|
5051
5081
|
expiresAt: persistedTimestamp.optional(),
|
|
5052
|
-
filename:
|
|
5082
|
+
filename: z29.string().optional(),
|
|
5053
5083
|
id: persistedId,
|
|
5054
5084
|
originCallId: persistedId.optional(),
|
|
5055
5085
|
owner: persistedOwner,
|
|
5056
5086
|
producer: persistedOwner.optional(),
|
|
5057
5087
|
readyAt: persistedTimestamp.optional(),
|
|
5058
5088
|
size: persistedNonNegativeInt.optional(),
|
|
5059
|
-
status:
|
|
5060
|
-
store:
|
|
5089
|
+
status: z29.enum(["pending", "ready", "failed", "abandoned", "deleted"]),
|
|
5090
|
+
store: z29.literal(DEFAULT_STORE_NAME),
|
|
5061
5091
|
updatedAt: persistedTimestamp,
|
|
5062
5092
|
uploadId: persistedId
|
|
5063
5093
|
});
|
|
@@ -5067,7 +5097,7 @@ var parseSessionRecord = stateParser("upload session", {
|
|
|
5067
5097
|
backendId: persistedId,
|
|
5068
5098
|
capabilityHash: persistedHash,
|
|
5069
5099
|
completedAt: persistedTimestamp.optional(),
|
|
5070
|
-
contentType:
|
|
5100
|
+
contentType: z29.string().min(1),
|
|
5071
5101
|
createdAt: persistedTimestamp,
|
|
5072
5102
|
expectedChecksum: persistedChecksum.optional(),
|
|
5073
5103
|
expectedSize: persistedNonNegativeInt.optional(),
|
|
@@ -5075,13 +5105,13 @@ var parseSessionRecord = stateParser("upload session", {
|
|
|
5075
5105
|
id: persistedId,
|
|
5076
5106
|
maxBytes: persistedPositiveInt,
|
|
5077
5107
|
objectId: persistedId,
|
|
5078
|
-
status:
|
|
5108
|
+
status: z29.enum(["created", "completed", "aborted", "expired", "failed"]),
|
|
5079
5109
|
terminalAt: persistedTimestamp.optional(),
|
|
5080
|
-
transport:
|
|
5110
|
+
transport: z29.enum(["relay", "presigned-put"])
|
|
5081
5111
|
});
|
|
5082
5112
|
var parseCallCapabilityRecord = stateParser("call capability", {
|
|
5083
5113
|
signingKeyId: persistedId,
|
|
5084
|
-
allowedContentTypes:
|
|
5114
|
+
allowedContentTypes: z29.array(z29.string().min(1)).min(1),
|
|
5085
5115
|
callId: persistedId,
|
|
5086
5116
|
createdAt: persistedTimestamp,
|
|
5087
5117
|
expiresAt: persistedTimestamp,
|
|
@@ -5091,12 +5121,12 @@ var parseCallCapabilityRecord = stateParser("call capability", {
|
|
|
5091
5121
|
maxObjects: persistedPositiveInt,
|
|
5092
5122
|
owner: persistedOwner,
|
|
5093
5123
|
producer: persistedOwner,
|
|
5094
|
-
reservations:
|
|
5124
|
+
reservations: z29.array(z29.looseObject({
|
|
5095
5125
|
maxBytes: persistedPositiveInt,
|
|
5096
5126
|
objectId: persistedId
|
|
5097
5127
|
})),
|
|
5098
5128
|
reservedBytes: persistedNonNegativeInt,
|
|
5099
|
-
status:
|
|
5129
|
+
status: z29.enum(["active", "exhausted", "revoked", "expired"]),
|
|
5100
5130
|
terminalAt: persistedTimestamp.optional(),
|
|
5101
5131
|
tokenHash: persistedHash
|
|
5102
5132
|
});
|
|
@@ -5107,13 +5137,13 @@ var parseShare = stateParser("share grant", {
|
|
|
5107
5137
|
expiresAt: persistedTimestamp,
|
|
5108
5138
|
id: persistedId,
|
|
5109
5139
|
objectId: persistedId,
|
|
5110
|
-
status:
|
|
5140
|
+
status: z29.enum(["active", "revoked", "expired"]),
|
|
5111
5141
|
terminalAt: persistedTimestamp.optional(),
|
|
5112
5142
|
tokenHash: persistedHash
|
|
5113
5143
|
});
|
|
5114
5144
|
var parseIdempotencyBinding = stateParser("idempotency binding", {
|
|
5115
5145
|
createdAt: persistedTimestamp,
|
|
5116
|
-
domain:
|
|
5146
|
+
domain: z29.enum(["owner", "call"]),
|
|
5117
5147
|
expiresAt: persistedTimestamp,
|
|
5118
5148
|
fingerprint: persistedHash,
|
|
5119
5149
|
objectId: persistedId,
|
|
@@ -6320,24 +6350,24 @@ var RequestDedupe = class {
|
|
|
6320
6350
|
};
|
|
6321
6351
|
|
|
6322
6352
|
// ../core/src/plugin/envelope.ts
|
|
6323
|
-
import { z as
|
|
6353
|
+
import { z as z30 } from "zod";
|
|
6324
6354
|
var HEADER_TB_CONTEXT = "X-TB-Context";
|
|
6325
6355
|
var HEADER_TB_REQUEST_ID = "X-TB-Request-Id";
|
|
6326
6356
|
var HEADER_TB_UPSTREAM_AUTH = "X-TB-Upstream-Auth";
|
|
6327
6357
|
var PLUGIN_PAYLOAD_MAX_BYTES = 1024 * 1024;
|
|
6328
|
-
var callContextSchema =
|
|
6329
|
-
keyId:
|
|
6330
|
-
owner:
|
|
6331
|
-
scopes:
|
|
6332
|
-
|
|
6333
|
-
pattern:
|
|
6334
|
-
actions:
|
|
6335
|
-
effect:
|
|
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()
|
|
6336
6366
|
})
|
|
6337
6367
|
),
|
|
6338
|
-
registerPaths:
|
|
6339
|
-
traceId:
|
|
6340
|
-
mountPath:
|
|
6368
|
+
registerPaths: z30.array(z30.string()).optional(),
|
|
6369
|
+
traceId: z30.string().min(1),
|
|
6370
|
+
mountPath: z30.string().min(1).optional(),
|
|
6341
6371
|
/**
|
|
6342
6372
|
* 挂载节点的 `providerConfig`。**只发给该节点对应的那个 plugin**(随本次调用的信封),
|
|
6343
6373
|
* 插件之间不共享 —— 同一 plugin 部署的不同挂载各自收到自己那份。
|
|
@@ -6349,9 +6379,9 @@ var callContextSchema = z29.object({
|
|
|
6349
6379
|
*
|
|
6350
6380
|
* 放这里的应当是:region / baseUrl override / 功能开关 / workspace 归属之类的**非敏感**配置。
|
|
6351
6381
|
*/
|
|
6352
|
-
mountConfig:
|
|
6382
|
+
mountConfig: z30.record(z30.string(), z30.unknown()).optional(),
|
|
6353
6383
|
/** v2 多 export 路由:本次调用命中 plugin 的哪个 export。 */
|
|
6354
|
-
exportId:
|
|
6384
|
+
exportId: z30.string().min(1).optional()
|
|
6355
6385
|
});
|
|
6356
6386
|
function encodeCallContext(ctx) {
|
|
6357
6387
|
return base64urlEncode(new TextEncoder().encode(JSON.stringify(ctx)));
|
|
@@ -6379,9 +6409,9 @@ function decodeCallContext(header) {
|
|
|
6379
6409
|
}
|
|
6380
6410
|
return parsed.data;
|
|
6381
6411
|
}
|
|
6382
|
-
var pluginCallSchema =
|
|
6383
|
-
tool:
|
|
6384
|
-
arguments:
|
|
6412
|
+
var pluginCallSchema = z30.object({
|
|
6413
|
+
tool: z30.string().min(1),
|
|
6414
|
+
arguments: z30.record(z30.string(), z30.unknown())
|
|
6385
6415
|
});
|
|
6386
6416
|
function assertPluginPayloadSize(payload) {
|
|
6387
6417
|
const bytes2 = new TextEncoder().encode(payload).length;
|
|
@@ -7395,19 +7425,19 @@ function parseFrontmatter(text) {
|
|
|
7395
7425
|
}
|
|
7396
7426
|
|
|
7397
7427
|
// ../core/src/skillhub/commands.ts
|
|
7398
|
-
import { z as
|
|
7399
|
-
var publishFileSchema =
|
|
7400
|
-
path:
|
|
7428
|
+
import { z as z31 } from "zod/v4";
|
|
7429
|
+
var publishFileSchema = z31.strictObject({
|
|
7430
|
+
path: z31.string().describe(
|
|
7401
7431
|
"file path relative to the skill root, e.g. 'SKILL.md', 'scripts/run.sh'"
|
|
7402
7432
|
),
|
|
7403
|
-
content:
|
|
7404
|
-
contentType:
|
|
7433
|
+
content: z31.string().describe("UTF-8 text content"),
|
|
7434
|
+
contentType: z31.string().optional().describe("optional; inferred from extension when omitted")
|
|
7405
7435
|
});
|
|
7406
7436
|
var skillhubCommands = new HtbpCommandRegistry().register(
|
|
7407
7437
|
"list",
|
|
7408
7438
|
{
|
|
7409
7439
|
h: "list published skills (id / name / description from SKILL.md frontmatter, paginated)",
|
|
7410
|
-
inputSchema:
|
|
7440
|
+
inputSchema: z31.strictObject({ opts: HTBP_LIST_OPTIONS_SCHEMA.optional() }),
|
|
7411
7441
|
returns: "Page<SkillSummary>",
|
|
7412
7442
|
scope: "read"
|
|
7413
7443
|
},
|
|
@@ -7416,9 +7446,9 @@ var skillhubCommands = new HtbpCommandRegistry().register(
|
|
|
7416
7446
|
"get",
|
|
7417
7447
|
{
|
|
7418
7448
|
h: "read a skill: SKILL.md body + file manifest; pass 'file' to fetch one bundled file (oversized/binary as { $ref })",
|
|
7419
|
-
inputSchema:
|
|
7420
|
-
id:
|
|
7421
|
-
file:
|
|
7449
|
+
inputSchema: z31.strictObject({
|
|
7450
|
+
id: z31.string().describe("skill id"),
|
|
7451
|
+
file: z31.string().optional().describe(
|
|
7422
7452
|
"optional: path of one bundled file to fetch instead of the manifest"
|
|
7423
7453
|
)
|
|
7424
7454
|
}),
|
|
@@ -7430,8 +7460,8 @@ var skillhubCommands = new HtbpCommandRegistry().register(
|
|
|
7430
7460
|
"search",
|
|
7431
7461
|
{
|
|
7432
7462
|
h: "keyword search over skill id / name / description",
|
|
7433
|
-
inputSchema:
|
|
7434
|
-
query:
|
|
7463
|
+
inputSchema: z31.strictObject({
|
|
7464
|
+
query: z31.string().describe("substring to match"),
|
|
7435
7465
|
opts: HTBP_LIST_OPTIONS_SCHEMA.optional()
|
|
7436
7466
|
}),
|
|
7437
7467
|
returns: "Page<SkillSummary>",
|
|
@@ -7442,11 +7472,11 @@ var skillhubCommands = new HtbpCommandRegistry().register(
|
|
|
7442
7472
|
"publish",
|
|
7443
7473
|
{
|
|
7444
7474
|
h: "publish/replace a skill from a set of text files (must include SKILL.md with name+description frontmatter)",
|
|
7445
|
-
inputSchema:
|
|
7446
|
-
id:
|
|
7475
|
+
inputSchema: z31.strictObject({
|
|
7476
|
+
id: z31.string().optional().describe(
|
|
7447
7477
|
"skill id; defaults to a slug derived from the frontmatter name"
|
|
7448
7478
|
),
|
|
7449
|
-
files:
|
|
7479
|
+
files: z31.array(publishFileSchema).describe(
|
|
7450
7480
|
"the skill files; whole-skill replace (files not listed are removed)"
|
|
7451
7481
|
)
|
|
7452
7482
|
}),
|
|
@@ -7464,7 +7494,7 @@ var skillhubCommands = new HtbpCommandRegistry().register(
|
|
|
7464
7494
|
"remove",
|
|
7465
7495
|
{
|
|
7466
7496
|
h: "delete a skill and all its files (not_found if it does not exist)",
|
|
7467
|
-
inputSchema:
|
|
7497
|
+
inputSchema: z31.strictObject({ id: z31.string().describe("skill id") }),
|
|
7468
7498
|
scope: "write",
|
|
7469
7499
|
effect: "destructive"
|
|
7470
7500
|
},
|
|
@@ -8130,6 +8160,8 @@ var NodeRegistryStore = class {
|
|
|
8130
8160
|
...node.config !== void 0 ? { config: node.config } : {},
|
|
8131
8161
|
...node.virtualize !== void 0 ? { virtualize: node.virtualize } : {},
|
|
8132
8162
|
...opts.deviceId !== void 0 ? { deviceId: opts.deviceId } : {},
|
|
8163
|
+
...opts.deviceEnvironment !== void 0 ? { deviceEnvironment: opts.deviceEnvironment } : {},
|
|
8164
|
+
...opts.deviceReportedAt !== void 0 ? { deviceReportedAt: opts.deviceReportedAt } : {},
|
|
8133
8165
|
...opts.online !== void 0 ? { online: opts.online } : {},
|
|
8134
8166
|
...opts.lastSeenAt !== void 0 ? { lastSeenAt: opts.lastSeenAt } : {},
|
|
8135
8167
|
registeredBy,
|
|
@@ -8298,6 +8330,7 @@ export {
|
|
|
8298
8330
|
createEncryptionKeyring,
|
|
8299
8331
|
validateStoreTokenKeyring,
|
|
8300
8332
|
DeviceMailboxService,
|
|
8333
|
+
deviceEnvironmentSchema,
|
|
8301
8334
|
tbErrorBodySchema,
|
|
8302
8335
|
nodeInputSchema,
|
|
8303
8336
|
helpJsonSchema,
|