@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.
- package/dist/admin.js +2 -2
- package/dist/{airtable-ML2GIGCH.js → airtable-Z6KEL3MA.js} +6 -6
- package/dist/{alt_text_generator_ai-FGYQAF2A.js → alt_text_generator_ai-RM2GHSNM.js} +5 -5
- package/dist/{amap-G7V65NGK.js → amap-YEJLGIKY.js} +5 -5
- package/dist/{anthropic-6ZK24TBB.js → anthropic-62M4MUVQ.js} +6 -6
- package/dist/{apify-VDGYHP6W.js → apify-AHRNDBCB.js} +6 -6
- package/dist/{brave_search-TAATLZOS.js → brave_search-JAHWOMQC.js} +6 -6
- package/dist/{chunk-HA4BGL6C.js → chunk-7MUNQNXG.js} +486 -450
- package/dist/{chunk-RTW5VRTK.js → chunk-FZV7CF7L.js} +3 -3
- package/dist/{chunk-7ISGFRC6.js → chunk-GQ4O7NK5.js} +1 -1
- package/dist/{chunk-RMAWSG7E.js → chunk-LD7KQRQ3.js} +372 -554
- package/dist/{chunk-BNMLA2RC.js → chunk-NG4C7YB3.js} +3 -3
- package/dist/{chunk-X7ZUTKHR.js → chunk-SU6Q4RAY.js} +2 -2
- package/dist/{chunk-UY6ANCOY.js → chunk-TH3H5YAG.js} +1 -1
- package/dist/{chunk-2IAI3XQM.js → chunk-U2UGFSOX.js} +2 -2
- package/dist/{circleci-BQ2UWXL2.js → circleci-UJUYBIAO.js} +6 -6
- package/dist/{clerk-2JYWQNOI.js → clerk-FCFM3WJK.js} +6 -6
- package/dist/{cohere-6MI7AQM4.js → cohere-OTSYSMPC.js} +6 -6
- package/dist/{confluence-6Y6GDETF.js → confluence-LPANSCGT.js} +6 -6
- package/dist/{convertapi-HBZCSWOX.js → convertapi-AJZOVUHT.js} +4 -4
- package/dist/{currencyapi-337U5TGI.js → currencyapi-HGK5FSGO.js} +6 -6
- package/dist/{deepseek-OSPASO7O.js → deepseek-7HMTFJRV.js} +6 -6
- package/dist/{docker_hub-3ATQOY5L.js → docker_hub-FCNVKJZW.js} +5 -5
- package/dist/{dropbox-LSA4GM2Y.js → dropbox-2XVKCQZE.js} +6 -6
- package/dist/{dub-VZPJSPI6.js → dub-CTUKPX2A.js} +6 -6
- package/dist/{e2b-6SDYQZL2.js → e2b-ULEWTRKI.js} +6 -6
- package/dist/{exa-B6EUYDVP.js → exa-QENFV3AU.js} +6 -6
- package/dist/{fal_ai-K4Q27IME.js → fal_ai-TQYUBBAF.js} +6 -6
- package/dist/{feishu-4TKXG4SU.js → feishu-OYCWDSHD.js} +3 -3
- package/dist/{feishu_custom_bot-7CTEAKRB.js → feishu_custom_bot-VYQ7A3PU.js} +4 -4
- package/dist/{figma-OUKSZLD5.js → figma-5DLOKAQQ.js} +6 -6
- package/dist/{firehydrant-7MOYL7QH.js → firehydrant-X4MGP2OI.js} +6 -6
- package/dist/{fixer-H2BV2NO4.js → fixer-LMIWM3ZX.js} +5 -5
- package/dist/{fly-PXKY6PNH.js → fly-J5HN5L2I.js} +6 -6
- package/dist/{front-UZYIV5DW.js → front-E3SMBQW3.js} +6 -6
- package/dist/{geocodio-NSYO7TFP.js → geocodio-AOINRPLA.js} +5 -5
- package/dist/{ghost-QBKKQQMF.js → ghost-E4CBGZWJ.js} +5 -5
- package/dist/{github-ENLSJ4CL.js → github-PGR6U3FC.js} +6 -6
- package/dist/{gmail-KQSDEB47.js → gmail-XNQHMQ6F.js} +6 -6
- package/dist/{googlecalendar-5YCX4SZF.js → googlecalendar-RE6DGG7L.js} +6 -6
- package/dist/{googledocs-SSWIVFKA.js → googledocs-CX2BZDQH.js} +4 -4
- package/dist/{grafana-TF2LXDQA.js → grafana-GX75ZA5X.js} +6 -6
- package/dist/{graphhopper-CURBVHYK.js → graphhopper-XMUYLWHS.js} +5 -5
- package/dist/index.js +5 -5
- package/dist/{ip2proxy-YNVMTZEM.js → ip2proxy-ZGIRBAG5.js} +5 -5
- package/dist/{ipgeolocation_io-NAU7VJ4J.js → ipgeolocation_io-MAP27QMO.js} +5 -5
- package/dist/{ipqualityscore-OT63L4TI.js → ipqualityscore-6IIUUAQ2.js} +5 -5
- package/dist/{jina_ai-6WBMBGWM.js → jina_ai-GGH77RQH.js} +6 -6
- package/dist/{jira-DVDVTHNO.js → jira-7GPZW6HZ.js} +6 -6
- package/dist/{langsmith-IM5N4YAU.js → langsmith-CJXYE7WM.js} +6 -6
- package/dist/{lemlist-277SHUQF.js → lemlist-OYPOX6GN.js} +6 -6
- package/dist/{linear-AEPH7B5V.js → linear-TPQ6X4XZ.js} +4 -4
- package/dist/{logsnag-VEWRAGBG.js → logsnag-HT2PRLIV.js} +6 -6
- package/dist/main.js +5 -5
- package/dist/{mattermost-Q3A2BIZA.js → mattermost-6IYTWTM5.js} +6 -6
- package/dist/{mem0-AXS7GZGI.js → mem0-7AVGBGOX.js} +6 -6
- package/dist/{memos-7TXG4ZTU.js → memos-CTOXWZ6X.js} +6 -6
- package/dist/{metabase-NSVACWQM.js → metabase-AFJXQ5SQ.js} +6 -6
- package/dist/{mistral_ai-YZ52RGD4.js → mistral_ai-QDKM4N3R.js} +6 -6
- package/dist/{mother_duck-XLLL6FVL.js → mother_duck-XSKR4GVL.js} +6 -6
- package/dist/{ngrok-4O4W3WZW.js → ngrok-NQMLM24P.js} +6 -6
- package/dist/{notes-YTB3TJOO.js → notes-ZWMVZQWJ.js} +2 -2
- package/dist/{notion-4W4O7J7V.js → notion-6544KSMM.js} +6 -6
- package/dist/{open_exchange_rates-23QJXVO5.js → open_exchange_rates-4CLN7O2N.js} +5 -5
- package/dist/{openai-ZS7GLSLH.js → openai-HLFGPVI5.js} +6 -6
- package/dist/{opengraph_io-PMVH7OYI.js → opengraph_io-57JDHT3M.js} +5 -5
- package/dist/{openrouter-ONRGFNB6.js → openrouter-WDAVB2OP.js} +6 -6
- package/dist/{outline-UCUYZZ7J.js → outline-A6MDLZVH.js} +6 -6
- package/dist/{paddle-35HTKTUL.js → paddle-WX5ULOPP.js} +6 -6
- package/dist/{perplexity-NVOBYN24.js → perplexity-LYTWWWCZ.js} +6 -6
- package/dist/{pinecone-55CJY73C.js → pinecone-7KAF3S7U.js} +6 -6
- package/dist/{pipedrive-WMCAKS72.js → pipedrive-YQY243G7.js} +6 -6
- package/dist/{polar-SM4ZM53B.js → polar-A5HKXSQY.js} +6 -6
- package/dist/{posthog-NWCXVXNJ.js → posthog-CF2LHLS4.js} +6 -6
- package/dist/{postmark-QJV5PHUQ.js → postmark-W756TMJM.js} +6 -6
- package/dist/{prerender-2W7UT4SC.js → prerender-ZYM4UQ5R.js} +5 -5
- package/dist/{pubmed-VVV7XYLU.js → pubmed-QXTUQCTQ.js} +4 -4
- package/dist/{railway-KGI57S3O.js → railway-F4MOZ3LQ.js} +4 -4
- package/dist/{readwise-AGHTQB42.js → readwise-S7MF5SR5.js} +6 -6
- package/dist/{render-O4HBROCK.js → render-D7EIVDUA.js} +6 -6
- package/dist/{replicate-KWBOMX7D.js → replicate-ABNKPZR7.js} +6 -6
- package/dist/{resend-DRH6Y6I4.js → resend-7VJEY4KC.js} +6 -6
- package/dist/{rootly-XGCUDW6X.js → rootly-UMFJOKXC.js} +6 -6
- package/dist/{scrapfly-OIQ3OY6L.js → scrapfly-UDT4KNFL.js} +5 -5
- package/dist/{scrapingbee-OCZO4FHX.js → scrapingbee-XTFD54NB.js} +5 -5
- package/dist/{screenshot_fyi-CUNGFZOC.js → screenshot_fyi-5GTW3SFY.js} +5 -5
- package/dist/{semantic_scholar-3UJRLKES.js → semantic_scholar-Y6WK2MST.js} +6 -6
- package/dist/{sentry-5BWVZFJV.js → sentry-ZFPGDA6C.js} +6 -6
- package/dist/{shodan-HI37CTEW.js → shodan-3SCDBOQ3.js} +5 -5
- package/dist/{shopify-LJ2EV2HH.js → shopify-LMTBS2I2.js} +6 -6
- package/dist/{stripe-3LHMV55K.js → stripe-4JQJ2CUG.js} +4 -4
- package/dist/{supabase-H2KPX3Q2.js → supabase-7HA3BEFK.js} +6 -6
- package/dist/{tavily-FBEWGH3Z.js → tavily-H34ZBPGC.js} +6 -6
- package/dist/{telegram-MYYO3JND.js → telegram-CRX4YWQ3.js} +5 -5
- package/dist/{telnyx-H4ALEGAX.js → telnyx-TIKGEU34.js} +6 -6
- package/dist/{todoist-OBWICA5Q.js → todoist-LU563DGZ.js} +6 -6
- package/dist/{trello-GUFUJRWO.js → trello-NTRGEROX.js} +5 -5
- package/dist/{turso-NIAK4UMS.js → turso-EY3CNVPZ.js} +6 -6
- package/dist/{twilio-K6SLK2CX.js → twilio-ICX3WRQH.js} +4 -4
- package/dist/{umami-42RS2EPS.js → umami-NPMRVI3M.js} +6 -6
- package/dist/{unsplash-V7TOTETT.js → unsplash-TIHBZFIM.js} +6 -6
- package/dist/{upstash_redis-AWQMB6Y3.js → upstash_redis-2DO6EHCN.js} +6 -6
- package/dist/{uptimerobot-AZC2DHOT.js → uptimerobot-BGYOCKGI.js} +4 -4
- package/dist/{v2ex-4TVRNMLS.js → v2ex-GOWDPGGA.js} +6 -6
- package/dist/{vercel-DPHTJ3XR.js → vercel-G33RXVBI.js} +6 -6
- package/dist/{wolfram_alpha_api-XAG7IXBW.js → wolfram_alpha_api-IRZSMD3P.js} +5 -5
- package/dist/{wordpress-KMPKVGUX.js → wordpress-ATWGGUC3.js} +6 -6
- package/dist/{workos-PKB2YR7S.js → workos-LHJDETBX.js} +6 -6
- package/dist/{zhihu-Y4H4XYPB.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,206 +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
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
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 =
|
|
2999
|
+
var deviceOperationStateSchema = z15.enum(
|
|
2983
3000
|
DEVICE_OPERATION_STATES
|
|
2984
3001
|
);
|
|
2985
|
-
var deviceOperationCallerSchema =
|
|
2986
|
-
keyId:
|
|
2987
|
-
owner:
|
|
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:
|
|
3007
|
+
attempt: z15.number().int().nonnegative(),
|
|
2991
3008
|
caller: deviceOperationCallerSchema,
|
|
2992
|
-
cancelRequestedAt:
|
|
2993
|
-
createdAt:
|
|
2994
|
-
deviceId:
|
|
2995
|
-
executionMayHaveOccurred:
|
|
2996
|
-
expiresAt:
|
|
2997
|
-
leaseUntil:
|
|
2998
|
-
mountPath:
|
|
2999
|
-
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),
|
|
3000
3017
|
state: deviceOperationStateSchema,
|
|
3001
|
-
targetPath:
|
|
3002
|
-
terminalAt:
|
|
3003
|
-
traceId:
|
|
3004
|
-
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 })
|
|
3005
3022
|
};
|
|
3006
|
-
var deviceOperationSummarySchema =
|
|
3023
|
+
var deviceOperationSummarySchema = z15.object(
|
|
3007
3024
|
deviceOperationSummaryShape
|
|
3008
3025
|
);
|
|
3009
|
-
var deviceOperationDetailSchema =
|
|
3026
|
+
var deviceOperationDetailSchema = z15.object({
|
|
3010
3027
|
...deviceOperationSummaryShape,
|
|
3011
3028
|
error: tbErrorBodySchema.optional(),
|
|
3012
|
-
result:
|
|
3029
|
+
result: z15.json().optional()
|
|
3013
3030
|
});
|
|
3014
|
-
var deviceOperationListRequestSchema =
|
|
3015
|
-
deviceId:
|
|
3016
|
-
opts:
|
|
3017
|
-
cursor:
|
|
3018
|
-
limit:
|
|
3019
|
-
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()
|
|
3020
3037
|
}).optional()
|
|
3021
3038
|
});
|
|
3022
3039
|
var deviceOperationListResponseSchema = pageSchema(deviceOperationSummarySchema);
|
|
3023
|
-
var deviceOperationIdentityRequestSchema =
|
|
3024
|
-
deviceId:
|
|
3025
|
-
operationId:
|
|
3040
|
+
var deviceOperationIdentityRequestSchema = z15.strictObject({
|
|
3041
|
+
deviceId: z15.string().min(1),
|
|
3042
|
+
operationId: z15.string().min(1)
|
|
3026
3043
|
});
|
|
3027
|
-
var deviceOperationClaimRequestSchema =
|
|
3028
|
-
cursor:
|
|
3029
|
-
deviceId:
|
|
3030
|
-
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()
|
|
3031
3048
|
});
|
|
3032
|
-
var deviceOperationClaimSchema =
|
|
3033
|
-
arguments:
|
|
3034
|
-
attempt:
|
|
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:
|
|
3037
|
-
createdAt:
|
|
3038
|
-
expiresAt:
|
|
3039
|
-
leaseId:
|
|
3040
|
-
leaseUntil:
|
|
3041
|
-
operationId:
|
|
3042
|
-
path:
|
|
3043
|
-
targetPath:
|
|
3044
|
-
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)
|
|
3045
3062
|
});
|
|
3046
|
-
var deviceOperationClaimResponseSchema =
|
|
3047
|
-
cursor:
|
|
3063
|
+
var deviceOperationClaimResponseSchema = z15.object({
|
|
3064
|
+
cursor: z15.string().optional(),
|
|
3048
3065
|
operation: deviceOperationClaimSchema.optional(),
|
|
3049
|
-
serverNow:
|
|
3066
|
+
serverNow: z15.iso.datetime({ offset: true })
|
|
3050
3067
|
});
|
|
3051
3068
|
var deviceOperationLeaseShape = {
|
|
3052
|
-
deviceId:
|
|
3053
|
-
leaseId:
|
|
3054
|
-
operationId:
|
|
3069
|
+
deviceId: z15.string().min(1),
|
|
3070
|
+
leaseId: z15.string().min(1),
|
|
3071
|
+
operationId: z15.string().min(1)
|
|
3055
3072
|
};
|
|
3056
|
-
var deviceOperationRenewRequestSchema =
|
|
3057
|
-
var deviceOperationRenewResponseSchema =
|
|
3058
|
-
cancelRequestedAt:
|
|
3059
|
-
leaseUntil:
|
|
3060
|
-
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 })
|
|
3061
3078
|
});
|
|
3062
|
-
var deviceOperationCompleteRequestSchema =
|
|
3063
|
-
|
|
3079
|
+
var deviceOperationCompleteRequestSchema = z15.discriminatedUnion("outcome", [
|
|
3080
|
+
z15.strictObject({
|
|
3064
3081
|
...deviceOperationLeaseShape,
|
|
3065
|
-
outcome:
|
|
3066
|
-
result:
|
|
3082
|
+
outcome: z15.literal("succeeded"),
|
|
3083
|
+
result: z15.json()
|
|
3067
3084
|
}),
|
|
3068
|
-
|
|
3085
|
+
z15.strictObject({
|
|
3069
3086
|
...deviceOperationLeaseShape,
|
|
3070
3087
|
error: tbErrorBodySchema,
|
|
3071
|
-
outcome:
|
|
3088
|
+
outcome: z15.literal("rejected")
|
|
3072
3089
|
}),
|
|
3073
|
-
|
|
3090
|
+
z15.strictObject({
|
|
3074
3091
|
...deviceOperationLeaseShape,
|
|
3075
3092
|
error: tbErrorBodySchema,
|
|
3076
|
-
outcome:
|
|
3093
|
+
outcome: z15.literal("failed")
|
|
3077
3094
|
}),
|
|
3078
|
-
|
|
3095
|
+
z15.strictObject({
|
|
3079
3096
|
...deviceOperationLeaseShape,
|
|
3080
3097
|
error: tbErrorBodySchema.optional(),
|
|
3081
|
-
outcome:
|
|
3098
|
+
outcome: z15.literal("result_unknown")
|
|
3082
3099
|
})
|
|
3083
3100
|
]);
|
|
3084
|
-
var registryNodeSchema =
|
|
3085
|
-
config:
|
|
3086
|
-
createdAt:
|
|
3087
|
-
description:
|
|
3088
|
-
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(),
|
|
3089
3108
|
kind: nodeKindSchema,
|
|
3090
|
-
lastSeenAt:
|
|
3091
|
-
online:
|
|
3092
|
-
path:
|
|
3093
|
-
registeredBy:
|
|
3094
|
-
updatedAt:
|
|
3095
|
-
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()
|
|
3096
3115
|
});
|
|
3097
3116
|
var feedbackViewShape = {
|
|
3098
|
-
at:
|
|
3099
|
-
by:
|
|
3100
|
-
down:
|
|
3101
|
-
id:
|
|
3102
|
-
score:
|
|
3103
|
-
title:
|
|
3104
|
-
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()
|
|
3105
3124
|
};
|
|
3106
|
-
var feedbackViewSchema =
|
|
3107
|
-
var feedbackDetailSchema =
|
|
3125
|
+
var feedbackViewSchema = z15.object(feedbackViewShape);
|
|
3126
|
+
var feedbackDetailSchema = z15.object({
|
|
3108
3127
|
...feedbackViewShape,
|
|
3109
|
-
detail:
|
|
3110
|
-
path:
|
|
3128
|
+
detail: z15.string(),
|
|
3129
|
+
path: z15.string()
|
|
3111
3130
|
});
|
|
3112
|
-
var feedbackListSchema =
|
|
3113
|
-
var feedbackSubmitRequestSchema =
|
|
3114
|
-
detail:
|
|
3115
|
-
title:
|
|
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 =
|
|
3118
|
-
at:
|
|
3119
|
-
id:
|
|
3120
|
-
path:
|
|
3121
|
-
title:
|
|
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 =
|
|
3124
|
-
vote:
|
|
3142
|
+
var feedbackVoteRequestSchema = z15.strictObject({
|
|
3143
|
+
vote: z15.enum(["up", "down", "clear"])
|
|
3125
3144
|
});
|
|
3126
|
-
var feedbackRemoveResponseSchema =
|
|
3127
|
-
var oauthAuthorizeRequestSchema =
|
|
3128
|
-
redirectUri:
|
|
3145
|
+
var feedbackRemoveResponseSchema = z15.object({ ok: z15.literal(true) });
|
|
3146
|
+
var oauthAuthorizeRequestSchema = z15.strictObject({
|
|
3147
|
+
redirectUri: z15.string().optional()
|
|
3129
3148
|
});
|
|
3130
|
-
var oauthAuthorizeResponseSchema =
|
|
3131
|
-
|
|
3132
|
-
|
|
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 =
|
|
3135
|
-
catalog:
|
|
3136
|
-
count:
|
|
3137
|
-
digest:
|
|
3153
|
+
var healthResponseSchema = z15.object({
|
|
3154
|
+
catalog: z15.object({
|
|
3155
|
+
count: z15.number().int().nonnegative(),
|
|
3156
|
+
digest: z15.string()
|
|
3138
3157
|
}).optional(),
|
|
3139
|
-
healthy:
|
|
3140
|
-
version:
|
|
3158
|
+
healthy: z15.boolean(),
|
|
3159
|
+
version: z15.string()
|
|
3141
3160
|
});
|
|
3142
|
-
var livenessResponseSchema =
|
|
3143
|
-
var readinessResponseSchema =
|
|
3144
|
-
checks:
|
|
3145
|
-
detail:
|
|
3146
|
-
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()
|
|
3147
3166
|
})),
|
|
3148
|
-
ready:
|
|
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:
|
|
3172
|
-
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:
|
|
3189
|
-
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:
|
|
3214
|
-
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:
|
|
3226
|
-
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
|
|
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:
|
|
3256
|
-
name:
|
|
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:
|
|
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:
|
|
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:
|
|
3285
|
-
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
|
|
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:
|
|
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
|
|
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 =
|
|
3328
|
-
var scopeSchema =
|
|
3329
|
-
pattern:
|
|
3330
|
-
actions:
|
|
3331
|
-
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"')
|
|
3332
3351
|
});
|
|
3333
|
-
var ownerSchema =
|
|
3352
|
+
var ownerSchema = z19.string().min(1).describe(
|
|
3334
3353
|
'owner ref: "user:<name>" | "agent:<name>" | "device:<id>"'
|
|
3335
3354
|
);
|
|
3336
|
-
var descriptionSchema =
|
|
3337
|
-
var scopesSchema =
|
|
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 =
|
|
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 =
|
|
3362
|
+
var expiresAtSchema = z19.string().optional().describe(
|
|
3344
3363
|
"expiry, ISO 8601 timestamp with timezone; omit = never"
|
|
3345
3364
|
);
|
|
3346
|
-
var writeSchema =
|
|
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 =
|
|
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:
|
|
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:
|
|
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:
|
|
3394
|
-
id:
|
|
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:
|
|
3414
|
-
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:
|
|
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
|
|
3458
|
+
import { z as z21 } from "zod";
|
|
3440
3459
|
|
|
3441
3460
|
// ../core/src/keyManagement.ts
|
|
3442
|
-
import { z as
|
|
3443
|
-
var keyRotateSchema =
|
|
3444
|
-
expectedRevision:
|
|
3445
|
-
target:
|
|
3446
|
-
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()
|
|
3447
3466
|
});
|
|
3448
|
-
var keyRetireSchema =
|
|
3449
|
-
expectedRevision:
|
|
3450
|
-
keyId:
|
|
3451
|
-
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"])
|
|
3452
3471
|
});
|
|
3453
|
-
var keyResumeSchema =
|
|
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:
|
|
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
|
|
3520
|
+
import { z as z23 } from "zod";
|
|
3502
3521
|
|
|
3503
3522
|
// ../core/src/deployment.ts
|
|
3504
|
-
import { z as
|
|
3505
|
-
var directory =
|
|
3506
|
-
var deploymentSettingsSchema =
|
|
3507
|
-
image:
|
|
3508
|
-
hostPort:
|
|
3509
|
-
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"),
|
|
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 =
|
|
3514
|
-
var deploymentClaimSchema =
|
|
3515
|
-
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() });
|
|
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:
|
|
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
|
|
3541
|
+
import { z as z25 } from "zod";
|
|
3523
3542
|
|
|
3524
3543
|
// ../core/src/maintenance.ts
|
|
3525
|
-
import { z as
|
|
3526
|
-
var revision =
|
|
3527
|
-
var databaseUrl =
|
|
3528
|
-
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({
|
|
3529
3548
|
expectedRevision: revision,
|
|
3530
|
-
expectedInstanceId:
|
|
3549
|
+
expectedInstanceId: z24.string().min(1),
|
|
3531
3550
|
databaseUrl
|
|
3532
3551
|
});
|
|
3533
|
-
var databaseCredentialRotationSchema =
|
|
3552
|
+
var databaseCredentialRotationSchema = z24.strictObject({
|
|
3534
3553
|
databaseAdminUrl: databaseUrl.optional(),
|
|
3535
3554
|
expectedRevision: revision,
|
|
3536
|
-
expectedInstanceId:
|
|
3537
|
-
password:
|
|
3555
|
+
expectedInstanceId: z24.string().min(1),
|
|
3556
|
+
password: z24.string().min(24).max(4096)
|
|
3538
3557
|
});
|
|
3539
|
-
var redisMaintenanceSchema =
|
|
3558
|
+
var redisMaintenanceSchema = z24.strictObject({
|
|
3540
3559
|
expectedRevision: revision,
|
|
3541
|
-
redisUrl:
|
|
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:
|
|
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
|
|
3607
|
+
import { z as z27 } from "zod";
|
|
3589
3608
|
|
|
3590
3609
|
// ../core/src/managedConfig.ts
|
|
3591
|
-
import { z as
|
|
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 =
|
|
3616
|
+
var positive = z26.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
3598
3617
|
var ttl = positive.max(604800);
|
|
3599
|
-
var runtimeConfigSchema =
|
|
3600
|
-
canonicalOrigin:
|
|
3601
|
-
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"),
|
|
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:
|
|
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:
|
|
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 =
|
|
3628
|
-
expectedRevision:
|
|
3646
|
+
var configUpdateSchema = z26.strictObject({
|
|
3647
|
+
expectedRevision: z26.number().int().nonnegative(),
|
|
3629
3648
|
settings: runtimeConfigSchema
|
|
3630
3649
|
});
|
|
3631
|
-
var revisionSchema =
|
|
3632
|
-
var s3ConnectionSchema =
|
|
3633
|
-
endpoint:
|
|
3634
|
-
bucket:
|
|
3635
|
-
region:
|
|
3636
|
-
accessKeyId:
|
|
3637
|
-
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)
|
|
3638
3657
|
});
|
|
3639
|
-
var storageWriteSchema =
|
|
3640
|
-
name:
|
|
3658
|
+
var storageWriteSchema = z26.strictObject({
|
|
3659
|
+
name: z26.string().min(1).max(120),
|
|
3641
3660
|
connection: s3ConnectionSchema
|
|
3642
3661
|
});
|
|
3643
|
-
var storageIdSchema =
|
|
3662
|
+
var storageIdSchema = z26.strictObject({ id: z26.string().min(1).max(128) });
|
|
3644
3663
|
var storageRevisionSchema = storageIdSchema.extend({
|
|
3645
|
-
expectedRevision:
|
|
3664
|
+
expectedRevision: z26.number().int().nonnegative()
|
|
3646
3665
|
});
|
|
3647
3666
|
var storageActivateSchema = storageRevisionSchema.extend({
|
|
3648
|
-
expectedActiveRevision:
|
|
3667
|
+
expectedActiveRevision: z26.number().int().nonnegative()
|
|
3649
3668
|
});
|
|
3650
3669
|
var storageRotateSchema = storageRevisionSchema.extend({
|
|
3651
|
-
accessKeyId:
|
|
3652
|
-
secretAccessKey:
|
|
3670
|
+
accessKeyId: z26.string().min(1),
|
|
3671
|
+
secretAccessKey: z26.string().min(1)
|
|
3653
3672
|
});
|
|
3654
|
-
var setupInputSchema =
|
|
3655
|
-
databaseUrl:
|
|
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:
|
|
3682
|
+
redisUrl: z26.string().optional(),
|
|
3664
3683
|
settings: runtimeConfigSchema.default(() => runtimeConfigSchema.parse({}))
|
|
3665
3684
|
});
|
|
3666
|
-
var setupStatusSchema =
|
|
3667
|
-
state:
|
|
3668
|
-
instanceId:
|
|
3669
|
-
pairingRequired:
|
|
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 =
|
|
3672
|
-
databaseConfigured:
|
|
3673
|
-
databaseHost:
|
|
3674
|
-
redisConfigured:
|
|
3675
|
-
storageConfigured:
|
|
3676
|
-
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()
|
|
3677
3696
|
});
|
|
3678
|
-
var setupResultSchema =
|
|
3679
|
-
state:
|
|
3680
|
-
adminSk:
|
|
3681
|
-
baseUrl:
|
|
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 =
|
|
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:
|
|
3686
|
-
version:
|
|
3687
|
-
instanceId:
|
|
3688
|
-
exportedAt:
|
|
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:
|
|
3692
|
-
signingRetireAfter:
|
|
3710
|
+
oauthKey: z26.string().min(1),
|
|
3711
|
+
signingRetireAfter: z26.record(z26.string(), z26.string()).optional()
|
|
3693
3712
|
}).optional()
|
|
3694
3713
|
});
|
|
3695
|
-
var recoveryResultSchema =
|
|
3696
|
-
state:
|
|
3697
|
-
baseUrl:
|
|
3698
|
-
adminSk:
|
|
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:
|
|
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:
|
|
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
|
|
4109
|
-
var deviceNodeCmdSchema =
|
|
4110
|
-
name:
|
|
4111
|
-
delivery:
|
|
4112
|
-
description:
|
|
4113
|
-
inputSchema:
|
|
4114
|
-
outputSchema:
|
|
4115
|
-
effect:
|
|
4116
|
-
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()
|
|
4117
4136
|
}).passthrough();
|
|
4118
|
-
var nodeInputSchema2 =
|
|
4119
|
-
path:
|
|
4120
|
-
kind:
|
|
4121
|
-
description:
|
|
4122
|
-
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()
|
|
4123
4142
|
}).passthrough();
|
|
4124
|
-
var deviceExposeSchema =
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
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:
|
|
4130
|
-
roots:
|
|
4131
|
-
readOnly:
|
|
4149
|
+
fs: z28.object({
|
|
4150
|
+
roots: z28.array(z28.string().min(1)).min(1),
|
|
4151
|
+
readOnly: z28.boolean().optional()
|
|
4132
4152
|
}).optional(),
|
|
4133
|
-
nodes:
|
|
4153
|
+
nodes: z28.array(nodeInputSchema2).optional()
|
|
4134
4154
|
});
|
|
4135
|
-
var idSchema =
|
|
4136
|
-
var deviceCallContextSchema =
|
|
4137
|
-
caller:
|
|
4138
|
-
keyId:
|
|
4139
|
-
owner:
|
|
4140
|
-
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()
|
|
4141
4161
|
}).passthrough(),
|
|
4142
|
-
traceId:
|
|
4143
|
-
createdAt:
|
|
4144
|
-
expiresAt:
|
|
4145
|
-
upload:
|
|
4146
|
-
token:
|
|
4147
|
-
expiresAt:
|
|
4148
|
-
maxBytes:
|
|
4149
|
-
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()
|
|
4150
4170
|
}).strict().optional()
|
|
4151
4171
|
}).passthrough();
|
|
4152
4172
|
var schemaByType = {
|
|
4153
|
-
hello:
|
|
4154
|
-
type:
|
|
4155
|
-
deviceId:
|
|
4156
|
-
mountPath:
|
|
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:
|
|
4160
|
-
error:
|
|
4161
|
-
call:
|
|
4162
|
-
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"),
|
|
4163
4183
|
id: idSchema,
|
|
4164
|
-
path:
|
|
4165
|
-
arguments:
|
|
4184
|
+
path: z28.string().min(1),
|
|
4185
|
+
arguments: z28.record(z28.string(), z28.unknown()),
|
|
4166
4186
|
context: deviceCallContextSchema.optional()
|
|
4167
4187
|
}),
|
|
4168
|
-
result:
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
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"),
|
|
4172
4192
|
id: idSchema,
|
|
4173
|
-
ok:
|
|
4193
|
+
ok: z28.literal(false),
|
|
4174
4194
|
error: tbErrorBodySchema
|
|
4175
4195
|
})
|
|
4176
4196
|
]),
|
|
4177
|
-
ping:
|
|
4178
|
-
pong:
|
|
4179
|
-
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 })
|
|
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
|
|
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 =
|
|
5023
|
-
var persistedOwner =
|
|
5024
|
-
var persistedTimestamp =
|
|
5025
|
-
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);
|
|
5026
5057
|
var persistedPositiveInt = persistedNonNegativeInt.refine((value) => value > 0);
|
|
5027
|
-
var persistedHash =
|
|
5028
|
-
var persistedChecksum =
|
|
5029
|
-
algorithm:
|
|
5030
|
-
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)
|
|
5031
5062
|
});
|
|
5032
5063
|
function stateParser(kind, shape) {
|
|
5033
|
-
const schema =
|
|
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:
|
|
5075
|
+
contentType: z29.string().min(1),
|
|
5045
5076
|
createdAt: persistedTimestamp,
|
|
5046
5077
|
driverKey: persistedId,
|
|
5047
|
-
etag:
|
|
5078
|
+
etag: z29.string().optional(),
|
|
5048
5079
|
expectedChecksum: persistedChecksum.optional(),
|
|
5049
5080
|
expectedSize: persistedNonNegativeInt.optional(),
|
|
5050
5081
|
expiresAt: persistedTimestamp.optional(),
|
|
5051
|
-
filename:
|
|
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:
|
|
5059
|
-
store:
|
|
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:
|
|
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:
|
|
5108
|
+
status: z29.enum(["created", "completed", "aborted", "expired", "failed"]),
|
|
5078
5109
|
terminalAt: persistedTimestamp.optional(),
|
|
5079
|
-
transport:
|
|
5110
|
+
transport: z29.enum(["relay", "presigned-put"])
|
|
5080
5111
|
});
|
|
5081
5112
|
var parseCallCapabilityRecord = stateParser("call capability", {
|
|
5082
5113
|
signingKeyId: persistedId,
|
|
5083
|
-
allowedContentTypes:
|
|
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:
|
|
5124
|
+
reservations: z29.array(z29.looseObject({
|
|
5094
5125
|
maxBytes: persistedPositiveInt,
|
|
5095
5126
|
objectId: persistedId
|
|
5096
5127
|
})),
|
|
5097
5128
|
reservedBytes: persistedNonNegativeInt,
|
|
5098
|
-
status:
|
|
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:
|
|
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:
|
|
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
|
|
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 =
|
|
6328
|
-
keyId:
|
|
6329
|
-
owner:
|
|
6330
|
-
scopes:
|
|
6331
|
-
|
|
6332
|
-
pattern:
|
|
6333
|
-
actions:
|
|
6334
|
-
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()
|
|
6335
6366
|
})
|
|
6336
6367
|
),
|
|
6337
|
-
registerPaths:
|
|
6338
|
-
traceId:
|
|
6339
|
-
mountPath:
|
|
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:
|
|
6382
|
+
mountConfig: z30.record(z30.string(), z30.unknown()).optional(),
|
|
6352
6383
|
/** v2 多 export 路由:本次调用命中 plugin 的哪个 export。 */
|
|
6353
|
-
exportId:
|
|
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 =
|
|
6382
|
-
tool:
|
|
6383
|
-
arguments:
|
|
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
|
|
7398
|
-
var publishFileSchema =
|
|
7399
|
-
path:
|
|
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:
|
|
7403
|
-
contentType:
|
|
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:
|
|
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:
|
|
7419
|
-
id:
|
|
7420
|
-
file:
|
|
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:
|
|
7433
|
-
query:
|
|
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:
|
|
7445
|
-
id:
|
|
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:
|
|
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:
|
|
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,
|