@hop-top/kit 0.5.0-alpha.0 → 0.5.0-alpha.10
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/CHANGELOG.md +262 -0
- package/LICENSE +1 -1
- package/LICENSE-cobra.txt +174 -0
- package/NOTICE +15 -0
- package/README.md +55 -259
- package/dist/aim-DZHwwiIc.d.ts +139 -0
- package/dist/aim.d.ts +1 -116
- package/dist/aim.js +13 -414
- package/dist/alias-D9_qFlyP.d.ts +174 -0
- package/dist/alias.d.ts +2 -73
- package/dist/alias.js +27 -207
- package/dist/api-DAexsu2H.d.ts +77 -0
- package/dist/api.d.ts +1 -62
- package/dist/api.js +10 -164
- package/dist/auth-2-jfgiHn.d.ts +34 -0
- package/dist/auth.d.ts +1 -26
- package/dist/auth.js +6 -40
- package/dist/chunk-2JV3A7OP.js +1894 -0
- package/dist/chunk-3FIKGFKI.js +54 -0
- package/dist/chunk-4UE5TCMQ.js +104 -0
- package/dist/chunk-6HFAEZ52.js +29 -0
- package/dist/chunk-6SVOHNIC.js +17 -0
- package/dist/chunk-72XZWQX7.js +504 -0
- package/dist/chunk-ABQSE7AI.js +513 -0
- package/dist/chunk-BDNNPRX6.js +41 -0
- package/dist/chunk-BLS2OBIQ.js +263 -0
- package/dist/chunk-BRNEKPWX.js +37 -0
- package/dist/chunk-CSJWB6D3.js +151 -0
- package/dist/chunk-GGWJRWWA.js +309 -0
- package/dist/chunk-GHPJJV5L.js +613 -0
- package/dist/chunk-IXVQ62NZ.js +334 -0
- package/dist/chunk-JKMQSAJP.js +174 -0
- package/dist/chunk-JZ22ZUFA.js +1131 -0
- package/dist/chunk-K7VCKJ27.js +814 -0
- package/dist/chunk-KVG7YCTS.js +115 -0
- package/dist/chunk-L23O2FFE.js +51 -0
- package/dist/chunk-MQXYDYRD.js +968 -0
- package/dist/chunk-MUIQVU6E.js +251 -0
- package/dist/chunk-NLMS7HGP.js +178 -0
- package/dist/chunk-POR5L2DG.js +247 -0
- package/dist/chunk-PSFYJGDG.js +1445 -0
- package/dist/chunk-QJVSKKRQ.js +369 -0
- package/dist/chunk-QPUCXQXT.js +67 -0
- package/dist/chunk-QQQYCWSC.js +240 -0
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/chunk-SNVGDYX7.js +187 -0
- package/dist/chunk-T46YPHKN.js +669 -0
- package/dist/chunk-UKZIAQA7.js +26 -0
- package/dist/chunk-WBVO43HU.js +355 -0
- package/dist/chunk-WUOAQVOA.js +86 -0
- package/dist/chunk-WWUKGJB5.js +90 -0
- package/dist/chunk-XJTRY453.js +868 -0
- package/dist/chunk-YGYQUFGY.js +219 -0
- package/dist/chunk-YOBAUCVN.js +583 -0
- package/dist/cli-C5B5tnpA.d.ts +400 -0
- package/dist/cli.d.ts +7 -309
- package/dist/cli.js +70 -885
- package/dist/completion-csVun6SP.d.ts +112 -0
- package/dist/completion-values-By-mnjNt.d.ts +142 -0
- package/dist/completion-values.d.ts +1 -0
- package/dist/completion-values.js +29 -0
- package/dist/completion.d.ts +3 -0
- package/dist/completion.js +34 -0
- package/dist/compliance-AxFf-uMy.d.ts +60 -0
- package/dist/compliance.d.ts +1 -0
- package/dist/compliance.js +17 -0
- package/dist/config-CaK60ByQ.d.ts +241 -0
- package/dist/config.d.ts +1 -97
- package/dist/config.js +8 -78
- package/dist/errcorrect-BcX1Ft0K.d.ts +44 -0
- package/dist/errcorrect.d.ts +1 -37
- package/dist/errcorrect.js +8 -68
- package/dist/error-Do8Qji43.d.ts +231 -0
- package/dist/id/index.d.ts +2 -83
- package/dist/id/index.js +14 -65
- package/dist/index-BKJZClJx.d.ts +1486 -0
- package/dist/index-C3Zw4wDJ.d.ts +359 -0
- package/dist/index-DCe1boBz.d.ts +328 -0
- package/dist/index-VLDcI5NF.d.ts +95 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +132 -0
- package/dist/llm-DYuR7_uX.d.ts +1069 -0
- package/dist/llm-anthropic-Cd_I2xXB.d.ts +67 -0
- package/dist/llm-anthropic.d.ts +2 -0
- package/dist/llm-anthropic.js +13 -0
- package/dist/llm-openai-DyFrucmV.d.ts +87 -0
- package/dist/llm-openai.d.ts +2 -0
- package/dist/llm-openai.js +19 -0
- package/dist/llm.d.ts +1 -188
- package/dist/llm.js +101 -356
- package/dist/log-CkaxMX3U.d.ts +115 -0
- package/dist/log.d.ts +2 -0
- package/dist/log.js +14 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.js +184 -0
- package/dist/netpolicy-Brx5XZUB.d.ts +151 -0
- package/dist/netpolicy.d.ts +1 -0
- package/dist/netpolicy.js +25 -0
- package/dist/output-CjZWmL8s.d.ts +420 -0
- package/dist/output.d.ts +3 -213
- package/dist/output.js +137 -447
- package/dist/parity-CvMuYcVI.d.ts +61 -0
- package/dist/progress-CAzyxeWl.d.ts +38 -0
- package/dist/progress.d.ts +1 -30
- package/dist/progress.js +6 -55
- package/dist/provenance-SMFHm5gx.d.ts +30 -0
- package/dist/provenance.d.ts +1 -24
- package/dist/provenance.js +6 -31
- package/dist/routellm-B0nv59mH.d.ts +111 -0
- package/dist/routellm.d.ts +2 -64
- package/dist/routellm.js +13 -255
- package/dist/rpc-D31Lg0Kc.d.ts +32 -0
- package/dist/rpc.d.ts +2 -25
- package/dist/rpc.js +4 -98
- package/dist/safety-CUaYEjZc.d.ts +30 -0
- package/dist/safety.d.ts +1 -24
- package/dist/safety.js +6 -43
- package/dist/scope-BrhYB4ij.d.ts +141 -0
- package/dist/scope.d.ts +1 -121
- package/dist/scope.js +20 -377
- package/dist/serve-D8yWMrTc.d.ts +646 -0
- package/dist/serve.d.ts +3 -0
- package/dist/serve.js +75 -0
- package/dist/sqlstore.js +6 -39
- package/dist/stream-CrjeCp0M.d.ts +44 -0
- package/dist/stream.d.ts +1 -35
- package/dist/stream.js +8 -51
- package/dist/telemetry/index.d.ts +1 -315
- package/dist/telemetry/index.js +26 -599
- package/dist/toolspec-DcPwwoAZ.d.ts +368 -0
- package/dist/toolspec.d.ts +2 -0
- package/dist/toolspec.js +37 -0
- package/dist/tui/index.d.ts +6 -298
- package/dist/tui/index.js +18 -322
- package/dist/upgrade-p_zh3pvV.d.ts +102 -0
- package/dist/upgrade.d.ts +1 -95
- package/dist/upgrade.js +6 -114
- package/dist/xdg-DB7Shoib.d.ts +179 -0
- package/dist/xdg.d.ts +1 -169
- package/dist/xdg.js +14 -128
- package/package.json +236 -46
- package/src/README.md +15 -0
- package/src/alias.conformance.test.ts +250 -0
- package/src/alias.test.ts +206 -2
- package/src/alias.ts +196 -21
- package/src/cli.help-command.test.ts +105 -0
- package/src/cli.offline.test.ts +93 -0
- package/src/cli.parity.test.ts +192 -0
- package/src/cli.test.ts +95 -1
- package/src/cli.ts +195 -25
- package/src/completion-scripts.ts +16 -0
- package/src/completion-values.test.ts +76 -16
- package/src/completion-values.ts +170 -66
- package/src/completion.conformance.test.ts +297 -0
- package/src/completion.test.ts +256 -145
- package/src/completion.ts +767 -121
- package/src/compliance.test.ts +196 -2
- package/src/compliance.ts +440 -20
- package/src/config-merge.test.ts +425 -0
- package/src/config.test.ts +228 -1
- package/src/config.ts +429 -16
- package/src/gen/crud_pb.ts +7 -7
- package/src/id/README.md +38 -0
- package/src/id/contract.test.ts +1 -1
- package/src/id/index.test.ts +1 -1
- package/src/id/index.ts +3 -2
- package/src/index.test.ts +71 -0
- package/src/index.ts +46 -0
- package/src/llm-anthropic.conformance.test.ts +1135 -0
- package/src/llm-anthropic.test.ts +152 -0
- package/src/llm-anthropic.ts +940 -0
- package/src/llm-choice-hermetic.test.ts +335 -0
- package/src/llm-config.test.ts +232 -0
- package/src/llm-config.ts +106 -0
- package/src/llm-endpoint.ts +254 -0
- package/src/llm-error.ts +17 -0
- package/src/llm-errors.ts +152 -0
- package/src/llm-file.ts +126 -0
- package/src/llm-http.ts +317 -0
- package/src/llm-keys.ts +167 -0
- package/src/llm-media.conformance.test.ts +87 -0
- package/src/llm-media.test.ts +279 -0
- package/src/llm-media.ts +322 -0
- package/src/llm-openai.conformance.test.ts +407 -0
- package/src/llm-openai.test.ts +510 -0
- package/src/llm-openai.ts +708 -0
- package/src/llm-payload.ts +155 -0
- package/src/llm-quote.ts +46 -0
- package/src/llm-routellm.conformance.test.ts +44 -0
- package/src/llm-toolnames.conformance.test.ts +112 -0
- package/src/llm-toolnames.test.ts +132 -0
- package/src/llm-toolnames.ts +298 -0
- package/src/llm-uri.ts +99 -0
- package/src/llm.test.ts +43 -15
- package/src/llm.toolcall.test.ts +175 -0
- package/src/llm.ts +602 -190
- package/src/log.parity.test.ts +105 -0
- package/src/log.test.ts +270 -1
- package/src/log.ts +228 -49
- package/src/mcp/README.md +63 -0
- package/src/mcp/args-separator.test.ts +164 -0
- package/src/mcp/args.test.ts +223 -0
- package/src/mcp/args.ts +160 -0
- package/src/mcp/audit.test.ts +520 -0
- package/src/mcp/audit.ts +70 -0
- package/src/mcp/bridge.test.ts +222 -0
- package/src/mcp/bridge.ts +291 -0
- package/src/mcp/conformance.test.ts +357 -0
- package/src/mcp/dispatch.ts +359 -0
- package/src/mcp/identity.test.ts +166 -0
- package/src/mcp/identity.ts +72 -0
- package/src/mcp/index.ts +176 -0
- package/src/mcp/legacy-notify.test.ts +59 -0
- package/src/mcp/legacy.ts +367 -0
- package/src/mcp/mcp.test.ts +707 -0
- package/src/mcp/modern-confirm.test.ts +520 -0
- package/src/mcp/modern-confirm.ts +484 -0
- package/src/mcp/modern.ts +788 -0
- package/src/mcp/stdio.test.ts +313 -0
- package/src/mcp/stdio.ts +254 -0
- package/src/mcp/tasks.ts +82 -0
- package/src/mcp/testtree.ts +250 -0
- package/src/mcp/toolname.test.ts +147 -0
- package/src/mcp/types.ts +689 -0
- package/src/netpolicy.test.ts +280 -0
- package/src/netpolicy.ts +256 -0
- package/src/output/README.md +46 -0
- package/src/output/builtins.ts +5 -5
- package/src/output/dispatch.ts +10 -2
- package/src/output/error.ts +459 -0
- package/src/output/formatter.ts +29 -5
- package/src/output/formatters/README.md +50 -0
- package/src/output/formatters/csv.ts +48 -12
- package/src/output/formatters/json.ts +4 -25
- package/src/output/formatters/project.ts +34 -0
- package/src/output/formatters/table.ts +8 -6
- package/src/output/formatters/text.ts +7 -3
- package/src/output/formatters/yaml.ts +5 -22
- package/src/output/projection.test.ts +298 -0
- package/src/output/projection.ts +33 -59
- package/src/output/template.ts +11 -21
- package/src/output.surface.test.ts +41 -0
- package/src/output.ts +64 -3
- package/src/published-types.test.ts +133 -0
- package/src/routellm.test.ts +209 -28
- package/src/routellm.toolcall.test.ts +521 -0
- package/src/routellm.ts +213 -177
- package/src/router/README.md +44 -0
- package/src/router/server.test.ts +41 -0
- package/src/router/server.ts +11 -0
- package/src/safety.test.ts +19 -9
- package/src/scope-defaults.json +29 -29
- package/src/serve.test.ts +1257 -0
- package/src/serve.ts +1665 -0
- package/src/telemetry/README.md +48 -0
- package/src/telemetry/client.test.ts +31 -0
- package/src/telemetry/client.ts +12 -6
- package/src/telemetry/offline.test.ts +64 -0
- package/src/toolspec-internal.ts +279 -0
- package/src/toolspec-manifest.test.ts +167 -0
- package/src/toolspec-manifest.ts +410 -0
- package/src/toolspec-spec-schemas.ts +12 -0
- package/src/toolspec-spec.test.ts +273 -0
- package/src/toolspec-spec.ts +458 -0
- package/src/toolspec.from-command.test.ts +350 -0
- package/src/toolspec.test.ts +2 -2
- package/src/toolspec.ts +222 -0
- package/src/triton/README.md +34 -0
- package/src/tui/README.md +42 -0
- package/src/tui/parity.test.ts +142 -0
- package/src/tui/parity.ts +59 -13
- package/src/wizard.test.ts +7 -7
- package/test/llm/conformance-helpers.ts +100 -0
- package/test/output/csv.test.ts +164 -0
- package/test/output/dispatch.test.ts +1 -2
- package/test/output/error.test.ts +277 -0
- package/test/output/smoke-capture.ts +2 -2
- package/test/output/smoke.test.ts +2 -2
- package/test/output/taxonomy-contract.test.ts +148 -0
- package/test/setup-env.ts +16 -0
- package/test/toolspec/fixture.ts +79 -0
- package/tsconfig.json +3 -1
- package/tsconfig.test.json +10 -0
- package/vitest.config.ts +9 -0
package/dist/llm.js
CHANGED
|
@@ -1,356 +1,101 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
const code = err.code;
|
|
104
|
-
if (code && isConnectionError(code)) return true;
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
var CONNECTION_CODES = /* @__PURE__ */ new Set([
|
|
108
|
-
"ECONNREFUSED",
|
|
109
|
-
"ETIMEDOUT",
|
|
110
|
-
"ECONNRESET",
|
|
111
|
-
"ENETUNREACH",
|
|
112
|
-
"EHOSTUNREACH"
|
|
113
|
-
]);
|
|
114
|
-
function isConnectionError(code) {
|
|
115
|
-
return CONNECTION_CODES.has(code);
|
|
116
|
-
}
|
|
117
|
-
function parseURI(raw) {
|
|
118
|
-
const sep = "://";
|
|
119
|
-
const idx = raw.indexOf(sep);
|
|
120
|
-
if (idx < 0) {
|
|
121
|
-
throw new LLMError(`invalid LLM URI (missing "://"): ${raw}`);
|
|
122
|
-
}
|
|
123
|
-
const scheme = raw.slice(0, idx);
|
|
124
|
-
if (!scheme) {
|
|
125
|
-
throw new LLMError(`invalid LLM URI (empty scheme): ${raw}`);
|
|
126
|
-
}
|
|
127
|
-
let rest = raw.slice(idx + sep.length);
|
|
128
|
-
if (!rest) {
|
|
129
|
-
throw new LLMError(`invalid LLM URI (empty model): ${raw}`);
|
|
130
|
-
}
|
|
131
|
-
let params;
|
|
132
|
-
const qIdx = rest.indexOf("?");
|
|
133
|
-
if (qIdx >= 0) {
|
|
134
|
-
const qs = rest.slice(qIdx + 1);
|
|
135
|
-
rest = rest.slice(0, qIdx);
|
|
136
|
-
params = {};
|
|
137
|
-
for (const pair of qs.split("&")) {
|
|
138
|
-
const eqIdx = pair.indexOf("=");
|
|
139
|
-
if (eqIdx > 0) {
|
|
140
|
-
params[pair.slice(0, eqIdx)] = decodeURIComponent(
|
|
141
|
-
pair.slice(eqIdx + 1)
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (!rest) {
|
|
147
|
-
throw new LLMError(`invalid LLM URI (empty model): ${raw}`);
|
|
148
|
-
}
|
|
149
|
-
let host;
|
|
150
|
-
let model;
|
|
151
|
-
const hostPortMatch = rest.match(/^([^/]+:\d+)\/(.+)$/);
|
|
152
|
-
if (hostPortMatch) {
|
|
153
|
-
host = hostPortMatch[1];
|
|
154
|
-
model = hostPortMatch[2];
|
|
155
|
-
} else {
|
|
156
|
-
model = rest;
|
|
157
|
-
}
|
|
158
|
-
const uri = { scheme, model };
|
|
159
|
-
if (host) uri.host = host;
|
|
160
|
-
if (params && Object.keys(params).length > 0) uri.params = params;
|
|
161
|
-
return uri;
|
|
162
|
-
}
|
|
163
|
-
function loadConfig(uriStr) {
|
|
164
|
-
const effective = uriStr || process.env["LLM_PROVIDER"];
|
|
165
|
-
if (!effective) {
|
|
166
|
-
throw new LLMError(
|
|
167
|
-
"no LLM URI provided and LLM_PROVIDER env var is not set"
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
const uri = parseURI(effective);
|
|
171
|
-
const fallbackEnv = process.env["LLM_FALLBACK"];
|
|
172
|
-
const fallbacks = fallbackEnv ? fallbackEnv.split(",").map((s) => s.trim()).filter(Boolean) : [];
|
|
173
|
-
const provider = {
|
|
174
|
-
model: uri.model
|
|
175
|
-
};
|
|
176
|
-
if (uri.params) provider.params = { ...uri.params };
|
|
177
|
-
if (uri.params?.api_key) {
|
|
178
|
-
provider.apiKey = uri.params.api_key;
|
|
179
|
-
}
|
|
180
|
-
if (uri.params?.base_url) {
|
|
181
|
-
provider.baseURL = uri.params.base_url;
|
|
182
|
-
}
|
|
183
|
-
if (uri.host) {
|
|
184
|
-
provider.baseURL = `http://${uri.host}`;
|
|
185
|
-
}
|
|
186
|
-
const envApiKey = process.env["LLM_API_KEY"] || void 0;
|
|
187
|
-
const envBaseURL = process.env["LLM_BASE_URL"] || void 0;
|
|
188
|
-
if (envApiKey) provider.apiKey = envApiKey;
|
|
189
|
-
if (envBaseURL) provider.baseURL = envBaseURL;
|
|
190
|
-
return { uri, provider, fallbacks };
|
|
191
|
-
}
|
|
192
|
-
var registry = /* @__PURE__ */ new Map();
|
|
193
|
-
function register(scheme, factory) {
|
|
194
|
-
if (registry.has(scheme)) {
|
|
195
|
-
throw new LLMError(`provider already registered for scheme: ${scheme}`);
|
|
196
|
-
}
|
|
197
|
-
registry.set(scheme, factory);
|
|
198
|
-
}
|
|
199
|
-
function resolve(uriStr) {
|
|
200
|
-
const cfg = loadConfig(uriStr);
|
|
201
|
-
const factory = registry.get(cfg.uri.scheme);
|
|
202
|
-
if (!factory) {
|
|
203
|
-
throw new ProviderNotFoundError(cfg.uri.scheme);
|
|
204
|
-
}
|
|
205
|
-
return factory(cfg);
|
|
206
|
-
}
|
|
207
|
-
function clearRegistry() {
|
|
208
|
-
registry.clear();
|
|
209
|
-
}
|
|
210
|
-
function createLLM(uri, opts) {
|
|
211
|
-
const cfg = loadConfig(uri);
|
|
212
|
-
const fallbackURIs = opts?.fallback ?? cfg.fallbacks;
|
|
213
|
-
const primary = resolve(uri);
|
|
214
|
-
const allURIs = [uri, ...fallbackURIs];
|
|
215
|
-
const resolvedProviders = /* @__PURE__ */ new Map();
|
|
216
|
-
resolvedProviders.set(0, primary);
|
|
217
|
-
function resolveAt(index) {
|
|
218
|
-
let p = resolvedProviders.get(index);
|
|
219
|
-
if (!p) {
|
|
220
|
-
p = resolve(allURIs[index]);
|
|
221
|
-
resolvedProviders.set(index, p);
|
|
222
|
-
}
|
|
223
|
-
return p;
|
|
224
|
-
}
|
|
225
|
-
async function withFallback(op, fn) {
|
|
226
|
-
const errors = [];
|
|
227
|
-
for (let i = 0; i < allURIs.length; i++) {
|
|
228
|
-
try {
|
|
229
|
-
const p = resolveAt(i);
|
|
230
|
-
if (!(op in p) || typeof p[op] !== "function") {
|
|
231
|
-
throw new CapabilityNotSupportedError(
|
|
232
|
-
op,
|
|
233
|
-
parseURI(allURIs[i]).scheme
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
return await fn(p);
|
|
237
|
-
} catch (err) {
|
|
238
|
-
const e = err instanceof Error ? err : new Error(String(err));
|
|
239
|
-
errors.push(e);
|
|
240
|
-
opts?.onError?.(e);
|
|
241
|
-
const canContinue = isFallbackable(e) || e instanceof CapabilityNotSupportedError;
|
|
242
|
-
if (!canContinue || i === allURIs.length - 1) {
|
|
243
|
-
if (errors.length > 1) {
|
|
244
|
-
throw new FallbackExhaustedError(errors);
|
|
245
|
-
}
|
|
246
|
-
throw e;
|
|
247
|
-
}
|
|
248
|
-
opts?.onFallback?.(i, i + 1, e);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
throw new FallbackExhaustedError(errors);
|
|
252
|
-
}
|
|
253
|
-
return {
|
|
254
|
-
async complete(request) {
|
|
255
|
-
opts?.onRequest?.(request);
|
|
256
|
-
const start = Date.now();
|
|
257
|
-
const resp = await withFallback(
|
|
258
|
-
"complete",
|
|
259
|
-
(p) => p.complete(request)
|
|
260
|
-
);
|
|
261
|
-
opts?.onResponse?.(resp, Date.now() - start);
|
|
262
|
-
return resp;
|
|
263
|
-
},
|
|
264
|
-
stream(request) {
|
|
265
|
-
return {
|
|
266
|
-
[Symbol.asyncIterator]() {
|
|
267
|
-
let inner = null;
|
|
268
|
-
let initialized = false;
|
|
269
|
-
return {
|
|
270
|
-
async next() {
|
|
271
|
-
if (!initialized) {
|
|
272
|
-
initialized = true;
|
|
273
|
-
opts?.onRequest?.(request);
|
|
274
|
-
const errors = [];
|
|
275
|
-
for (let i = 0; i < allURIs.length; i++) {
|
|
276
|
-
try {
|
|
277
|
-
const p = resolveAt(i);
|
|
278
|
-
if (!("stream" in p) || typeof p.stream !== "function") {
|
|
279
|
-
throw new CapabilityNotSupportedError(
|
|
280
|
-
"stream",
|
|
281
|
-
parseURI(allURIs[i]).scheme
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
const iterable = p.stream(request);
|
|
285
|
-
const iter = iterable[Symbol.asyncIterator]();
|
|
286
|
-
const first = await iter.next();
|
|
287
|
-
inner = iter;
|
|
288
|
-
return first;
|
|
289
|
-
} catch (err) {
|
|
290
|
-
const e = err instanceof Error ? err : new Error(String(err));
|
|
291
|
-
errors.push(e);
|
|
292
|
-
opts?.onError?.(e);
|
|
293
|
-
const canContinue = isFallbackable(e) || e instanceof CapabilityNotSupportedError;
|
|
294
|
-
if (!canContinue || i === allURIs.length - 1) {
|
|
295
|
-
if (errors.length > 1)
|
|
296
|
-
throw new FallbackExhaustedError(errors);
|
|
297
|
-
throw e;
|
|
298
|
-
}
|
|
299
|
-
opts?.onFallback?.(i, i + 1, e);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
throw new FallbackExhaustedError(errors);
|
|
303
|
-
}
|
|
304
|
-
return inner.next();
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
},
|
|
310
|
-
async callWithTools(request, tools) {
|
|
311
|
-
opts?.onRequest?.(request);
|
|
312
|
-
const start = Date.now();
|
|
313
|
-
const resp = await withFallback(
|
|
314
|
-
"callWithTools",
|
|
315
|
-
(p) => p.callWithTools(request, tools)
|
|
316
|
-
);
|
|
317
|
-
opts?.onResponse?.(
|
|
318
|
-
{ content: resp.content, role: "assistant" },
|
|
319
|
-
Date.now() - start
|
|
320
|
-
);
|
|
321
|
-
return resp;
|
|
322
|
-
},
|
|
323
|
-
capabilities() {
|
|
324
|
-
const caps = [];
|
|
325
|
-
if (primary.complete) caps.push("complete");
|
|
326
|
-
if (primary.stream) caps.push("stream");
|
|
327
|
-
if (primary.callWithTools) caps.push("callWithTools");
|
|
328
|
-
return caps;
|
|
329
|
-
},
|
|
330
|
-
provider() {
|
|
331
|
-
return primary;
|
|
332
|
-
},
|
|
333
|
-
close() {
|
|
334
|
-
for (const p of resolvedProviders.values()) {
|
|
335
|
-
p.close();
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
341
|
-
0 && (module.exports = {
|
|
342
|
-
AuthError,
|
|
343
|
-
CapabilityNotSupportedError,
|
|
344
|
-
FallbackExhaustedError,
|
|
345
|
-
LLMError,
|
|
346
|
-
ModelError,
|
|
347
|
-
ProviderNotFoundError,
|
|
348
|
-
RateLimitError,
|
|
349
|
-
clearRegistry,
|
|
350
|
-
createLLM,
|
|
351
|
-
isFallbackable,
|
|
352
|
-
loadConfig,
|
|
353
|
-
parseURI,
|
|
354
|
-
register,
|
|
355
|
-
resolve
|
|
356
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
var _chunkPSFYJGDGjs = require('./chunk-PSFYJGDG.js');
|
|
50
|
+
require('./chunk-4UE5TCMQ.js');
|
|
51
|
+
require('./chunk-KVG7YCTS.js');
|
|
52
|
+
require('./chunk-R5U7XKVJ.js');
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
exports.ANTHROPIC_TOOL_NAMES = _chunkPSFYJGDGjs.ANTHROPIC_TOOL_NAMES; exports.APIError = _chunkPSFYJGDGjs.APIError; exports.AuthError = _chunkPSFYJGDGjs.AuthError; exports.CapabilityNotSupportedError = _chunkPSFYJGDGjs.CapabilityNotSupportedError; exports.DEFAULT_MAX_MEDIA_BYTES = _chunkPSFYJGDGjs.DEFAULT_MAX_MEDIA_BYTES; exports.FallbackExhaustedError = _chunkPSFYJGDGjs.FallbackExhaustedError; exports.GEMINI_TOOL_NAMES = _chunkPSFYJGDGjs.GEMINI_TOOL_NAMES; exports.HTTPStatusError = _chunkPSFYJGDGjs.HTTPStatusError; exports.KeyEndpointError = _chunkPSFYJGDGjs.KeyEndpointError; exports.LLMError = _chunkPSFYJGDGjs.LLMError; exports.MediaTooLargeError = _chunkPSFYJGDGjs.MediaTooLargeError; exports.MediaURLRefusedError = _chunkPSFYJGDGjs.MediaURLRefusedError; exports.MissingKeyError = _chunkPSFYJGDGjs.MissingKeyError; exports.ModelError = _chunkPSFYJGDGjs.ModelError; exports.OPENAI_TOOL_NAMES = _chunkPSFYJGDGjs.OPENAI_TOOL_NAMES; exports.PermissionDeniedError = _chunkPSFYJGDGjs.PermissionDeniedError; exports.ProviderNotFoundError = _chunkPSFYJGDGjs.ProviderNotFoundError; exports.RateLimitError = _chunkPSFYJGDGjs.RateLimitError; exports.ResponseTooLargeError = _chunkPSFYJGDGjs.ResponseTooLargeError; exports.StreamTruncatedError = _chunkPSFYJGDGjs.StreamTruncatedError; exports.TOOL_NAMES_PARAM = _chunkPSFYJGDGjs.TOOL_NAMES_PARAM; exports.ToolNameError = _chunkPSFYJGDGjs.ToolNameError; exports.ToolNames = _chunkPSFYJGDGjs.ToolNames; exports.applyAPIKey = _chunkPSFYJGDGjs.applyAPIKey; exports.checkKeyEndpoint = _chunkPSFYJGDGjs.checkKeyEndpoint; exports.checkToolChoice = _chunkPSFYJGDGjs.checkToolChoice; exports.checkToolLinkage = _chunkPSFYJGDGjs.checkToolLinkage; exports.clearRegistry = _chunkPSFYJGDGjs.clearRegistry; exports.createLLM = _chunkPSFYJGDGjs.createLLM; exports.credentialsTrusted = _chunkPSFYJGDGjs.credentialsTrusted; exports.declarationOf = _chunkPSFYJGDGjs.declarationOf; exports.fileSource = _chunkPSFYJGDGjs.fileSource; exports.inlineSource = _chunkPSFYJGDGjs.inlineSource; exports.isFallbackable = _chunkPSFYJGDGjs.isFallbackable; exports.isPublicAddress = _chunkPSFYJGDGjs.isPublicAddress; exports.isValidToolName = _chunkPSFYJGDGjs.isValidToolName; exports.loadConfig = _chunkPSFYJGDGjs.loadConfig; exports.parseURI = _chunkPSFYJGDGjs.parseURI; exports.redactURI = _chunkPSFYJGDGjs.redactURI; exports.register = _chunkPSFYJGDGjs.register; exports.requestStartedPayload = _chunkPSFYJGDGjs.requestStartedPayload; exports.resolve = _chunkPSFYJGDGjs.resolve; exports.responseReceivedPayload = _chunkPSFYJGDGjs.responseReceivedPayload; exports.sanitizeToolName = _chunkPSFYJGDGjs.sanitizeToolName; exports.toolNameModeOf = _chunkPSFYJGDGjs.toolNameModeOf; exports.urlSource = _chunkPSFYJGDGjs.urlSource; exports.usageCost = _chunkPSFYJGDGjs.usageCost;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { P as ParityData } from './parity-CvMuYcVI.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Structured logger wrapping pino — applies kit's charmtone theme
|
|
5
|
+
* colors to stderr output (or an injected `output` sink).
|
|
6
|
+
*
|
|
7
|
+
* API: `logger.info('msg', 'key', val, 'key2', val2)` (variadic key-value)
|
|
8
|
+
* This matches Go's charm/log API, not pino's native object API.
|
|
9
|
+
* Pino handles transports, serialization, and performance under the hood.
|
|
10
|
+
*
|
|
11
|
+
* The `-V` count → level mapping and the `--quiet` override both come from
|
|
12
|
+
* the parity contract (`parity.json` verbosity block), so the level
|
|
13
|
+
* vocabulary stays identical across the Go, TypeScript and Python ports.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
interface Logger {
|
|
17
|
+
info(msg: string, ...keyvals: any[]): void;
|
|
18
|
+
warn(msg: string, ...keyvals: any[]): void;
|
|
19
|
+
error(msg: string, ...keyvals: any[]): void;
|
|
20
|
+
debug(msg: string, ...keyvals: any[]): void;
|
|
21
|
+
trace(msg: string, ...keyvals: any[]): void;
|
|
22
|
+
/**
|
|
23
|
+
* Info-level line marked as a success: label `SUCC` in the theme's
|
|
24
|
+
* success colour. Filtered exactly like `info` (not a new level).
|
|
25
|
+
*/
|
|
26
|
+
success(msg: string, ...keyvals: any[]): void;
|
|
27
|
+
}
|
|
28
|
+
/** Minimal sink the logger writes rendered lines to. */
|
|
29
|
+
interface LogOutput {
|
|
30
|
+
write(chunk: string): unknown;
|
|
31
|
+
}
|
|
32
|
+
/** Kit level vocabulary (same spellings as Go/py and `parity.json`). */
|
|
33
|
+
type LogLevelName = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
34
|
+
/** One log line, as handed to a custom `formatter`. */
|
|
35
|
+
interface LogRecord {
|
|
36
|
+
level: LogLevelName;
|
|
37
|
+
msg: string;
|
|
38
|
+
/** Key-value pairs in call order (after pino serialization). */
|
|
39
|
+
fields: Record<string, unknown>;
|
|
40
|
+
/** Set on `success()` lines, whose `level` is `'info'`. */
|
|
41
|
+
kind?: 'success';
|
|
42
|
+
}
|
|
43
|
+
/** Renders a record to one line; a missing trailing newline is appended. */
|
|
44
|
+
type LogFormatter = (rec: LogRecord) => string;
|
|
45
|
+
interface LoggerOptions {
|
|
46
|
+
quiet?: boolean;
|
|
47
|
+
noColor?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Explicit threshold; wins over the factory default and the `-V` count.
|
|
50
|
+
* `'silent'` drops everything. `quiet` only raises it (to the contract's
|
|
51
|
+
* `quiet_override`), never lowers it — same as Go's `WithLevel`.
|
|
52
|
+
* TS-only option; not a parity verbosity entry.
|
|
53
|
+
*/
|
|
54
|
+
level?: LogLevelName | 'silent';
|
|
55
|
+
/**
|
|
56
|
+
* Where rendered lines go. Defaults to `process.stderr`, resolved at
|
|
57
|
+
* write time. Mirrors Go's `(*log.Logger).SetOutput`; useful for
|
|
58
|
+
* capturing output in tests.
|
|
59
|
+
*/
|
|
60
|
+
output?: LogOutput;
|
|
61
|
+
/**
|
|
62
|
+
* Line format. `'text'` (default) is `LEVEL msg k=v`; `'json'` is one
|
|
63
|
+
* object per line shaped like Go charm/log's JSONFormatter:
|
|
64
|
+
* `{"level":"info","msg":"...",...kv}` (no time/pid/hostname, no ANSI).
|
|
65
|
+
* `success` lines carry `"level":"info","kind":"success"`. Selected by
|
|
66
|
+
* this option only — no env var or flag.
|
|
67
|
+
*/
|
|
68
|
+
format?: 'text' | 'json';
|
|
69
|
+
/**
|
|
70
|
+
* TS extension point: render each line yourself (glyph prefixes, house
|
|
71
|
+
* styles). The returned string is written as-is, plus `\n` if missing.
|
|
72
|
+
* Wins over `format` and `noColor`; level filtering still applies.
|
|
73
|
+
*/
|
|
74
|
+
formatter?: LogFormatter;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Resolve a `-V` count against a parity contract's `verbosity.levels`
|
|
78
|
+
* table. Counts above the highest declared key clamp to that key's level;
|
|
79
|
+
* an empty or unresolvable table falls back to `info`.
|
|
80
|
+
*
|
|
81
|
+
* Taking the contract as a parameter (rather than reading the module-level
|
|
82
|
+
* `parity`) keeps the mapping testable against a constructed `ParityData`
|
|
83
|
+
* without mutating the shared `parity.json`.
|
|
84
|
+
*/
|
|
85
|
+
declare function verbosityLevel(d: ParityData, verbose: number): string;
|
|
86
|
+
/**
|
|
87
|
+
* Resolve a parity contract's `verbosity.quiet_override` to a pino level
|
|
88
|
+
* name. An unrecognized or absent override falls back to `warn`.
|
|
89
|
+
*/
|
|
90
|
+
declare function quietLevel(d: ParityData): string;
|
|
91
|
+
declare function createLogger(opts?: LoggerOptions): Logger;
|
|
92
|
+
/**
|
|
93
|
+
* Map verbose count to a pino level through the parity contract's
|
|
94
|
+
* `verbosity.levels` table. An explicit `level` wins over the count.
|
|
95
|
+
* Quiet raises to the contract's `quiet_override` level.
|
|
96
|
+
*/
|
|
97
|
+
declare function withVerbose(opts: LoggerOptions & {
|
|
98
|
+
verbose?: number;
|
|
99
|
+
}): Logger;
|
|
100
|
+
|
|
101
|
+
type log_LogFormatter = LogFormatter;
|
|
102
|
+
type log_LogLevelName = LogLevelName;
|
|
103
|
+
type log_LogOutput = LogOutput;
|
|
104
|
+
type log_LogRecord = LogRecord;
|
|
105
|
+
type log_Logger = Logger;
|
|
106
|
+
type log_LoggerOptions = LoggerOptions;
|
|
107
|
+
declare const log_createLogger: typeof createLogger;
|
|
108
|
+
declare const log_quietLevel: typeof quietLevel;
|
|
109
|
+
declare const log_verbosityLevel: typeof verbosityLevel;
|
|
110
|
+
declare const log_withVerbose: typeof withVerbose;
|
|
111
|
+
declare namespace log {
|
|
112
|
+
export { type log_LogFormatter as LogFormatter, type log_LogLevelName as LogLevelName, type log_LogOutput as LogOutput, type log_LogRecord as LogRecord, type log_Logger as Logger, type log_LoggerOptions as LoggerOptions, log_createLogger as createLogger, log_quietLevel as quietLevel, log_verbosityLevel as verbosityLevel, log_withVerbose as withVerbose };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { type LogFormatter as L, type LogLevelName as a, type LogOutput as b, type LogRecord as c, type Logger as d, type LoggerOptions as e, createLogger as f, log as l, quietLevel as q, verbosityLevel as v, withVerbose as w };
|
package/dist/log.d.ts
ADDED
package/dist/log.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkNLMS7HGPjs = require('./chunk-NLMS7HGP.js');
|
|
7
|
+
require('./chunk-QPUCXQXT.js');
|
|
8
|
+
require('./chunk-R5U7XKVJ.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.createLogger = _chunkNLMS7HGPjs.createLogger; exports.quietLevel = _chunkNLMS7HGPjs.quietLevel; exports.verbosityLevel = _chunkNLMS7HGPjs.verbosityLevel; exports.withVerbose = _chunkNLMS7HGPjs.withVerbose;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { C as CommanderBridgeOptions, D as DEFAULT_MCP_PATH, a as DEFAULT_MCP_SERVER_NAME, b as DEFAULT_MCP_SERVER_VERSION, c as DEFAULT_TOOL_NAME_SEPARATOR, d as DestructiveBlockedError, E as ElicitationConfirmGate, F as FlagSchema, H as HEADER_MCP_METHOD, e as HEADER_MCP_NAME, f as HEADER_MCP_PROTOCOL_VERSION, I as Invocation, g as InvocationMeta, h as InvokeResult, J as JsonRpcErrorObject, j as JsonRpcRequest, L as Leaf, k as LeafArg, l as LegacyMcpHandler, M as MCP_ARGS_PROPERTY, m as MCP_AUDIT_AUTH_REFUSED, n as MCP_AUDIT_CONFIRMATION_DECLINED, o as MCP_AUDIT_CONFIRMATION_REQUIRED, p as MCP_AUDIT_CONFIRMATION_STATE_REJECTED, q as MCP_AUDIT_DESTRUCTIVE_BLOCKED, r as MCP_AUTH_CHALLENGE, s as MCP_CONFIRM_KEY, t as MCP_CONFIRM_REJECTION_STATE, u as MCP_CONFIRM_STATE_TTL_SECONDS, v as MCP_CONFIRM_STATE_VERSION, w as MCP_ERR_HEADER_MISMATCH, x as MCP_ERR_INTERNAL, y as MCP_ERR_INVALID_PARAMS, z as MCP_ERR_INVALID_REQUEST, A as MCP_ERR_METHOD_NOT_FOUND, B as MCP_ERR_MISSING_CLIENT_CAPABILITY, G as MCP_ERR_PARSE, K as MCP_ERR_UNSUPPORTED_VERSION, N as MCP_SPEC_2024_11_05, O as MCP_SPEC_2026_07_28, P as META_KEY_CLIENT_CAPABILITIES, Q as META_KEY_CLIENT_INFO, R as META_KEY_PROTOCOL_VERSION, S as META_KEY_SERVER_INFO, T as McpAuditHook, U as McpAuditRecord, V as McpBridge, W as McpCacheScope, X as McpConfirmBinding, Y as McpConfirmDecision, Z as McpConfirmRejection, _ as McpConfirmStateStatus, $ as McpDispatcher, a0 as McpEra, a1 as McpEstablishment, a2 as McpHandler, a3 as McpHttpRequest, a4 as McpHttpResponse, a5 as McpIdentity, a6 as McpMountOptions, a7 as McpSpecVersion, a8 as McpSplitResult, a9 as McpStdioOptions, aa as McpStdioServer, ab as McpTransport, ac as McpVerifier, ad as ModernMcpHandler, ae as ModernRequestMeta, af as Policy, ag as RESULT_TYPE_COMPLETE, ah as RESULT_TYPE_INPUT_REQUIRED, ai as RawJSON, aj as ResolvedMcpConfig, ak as SCOPES_EXTRA_KEY, al as SURFACE_CLI, am as SURFACE_LIB, an as SURFACE_MCP, ao as SafetyClass, ap as Surface, aq as SurfaceNotEnabledError, ar as TASKS_EXTENSION, as as TASKS_SUPPORTED, at as TASK_METHODS, au as TaskMethod, av as UnknownCommandError, aw as auditRefusal, ax as buildToolEnvelope, ay as canonicalJSONStringify, az as clientSupportsFormElicitation, aA as commanderBridge, aB as createMcpHandler, aC as decodeMcpSentinel, aD as defaultPolicy, aE as detectMcpEra, aF as discoverCapabilities, aG as encodeEnvelope, aH as errorResultBlock, aI as establishCaller, aJ as hasModernMetaMarker, aK as headerConfirmationGate, aL as invocationMeta, aM as isTaskMethod, aN as mcpArgsPublished, aO as mcpConfirmArgsDigest, aP as mcpConfirmPrincipal, aQ as mcpInputSchema, aR as mcpMountConfig, aS as mcpSplitArguments, aT as mcpToolDescription, aU as methodNotAllowedResponse, aV as mintMcpConfirmState, aW as modernInvocationExtra, aX as parseJsonRpcRequest, aY as parseMcpConfirmRetry, aZ as parseModernMeta, a_ as pathFromToolName, a$ as policyAllowed, b0 as rawToolCallName, b1 as renderCallResult, b2 as resolveMcpConfig, b3 as serveStdio, b4 as singleHeaderValue, b5 as toolName, b6 as validModernRequestId, b7 as verifyMcpConfirmState } from '../index-BKJZClJx.js';
|
|
2
|
+
import '@modelcontextprotocol/server';
|
|
3
|
+
import 'node:stream';
|
|
4
|
+
import 'commander';
|