@introspection-ai/recipes 0.53.0 → 0.54.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/connector-tools.d.ts +1 -1
- package/dist/connector-tools.d.ts.map +1 -1
- package/dist/connector-tools.js +1 -0
- package/dist/connector-tools.js.map +1 -1
- package/dist/introspection-open.d.ts +2 -2
- package/dist/introspection-open.d.ts.map +1 -1
- package/dist/introspection-open.js +27 -9
- package/dist/introspection-open.js.map +1 -1
- package/dist/issues/index.d.ts +1 -1
- package/dist/issues/index.d.ts.map +1 -1
- package/dist/issues/index.js +1 -1
- package/dist/issues/index.js.map +1 -1
- package/dist/issues/module.d.ts +3 -0
- package/dist/issues/module.d.ts.map +1 -1
- package/dist/issues/module.js +4 -0
- package/dist/issues/module.js.map +1 -1
- package/dist/mcp/cli/command-context.d.ts +13 -0
- package/dist/mcp/cli/command-context.d.ts.map +1 -1
- package/dist/mcp/cli/command-context.js +56 -16
- package/dist/mcp/cli/command-context.js.map +1 -1
- package/dist/mcp/cli/core.d.ts +1 -1
- package/dist/mcp/cli/core.d.ts.map +1 -1
- package/dist/mcp/cli/core.js +25 -16
- package/dist/mcp/cli/core.js.map +1 -1
- package/dist/mcp/client-entry.js +1 -1
- package/dist/mcp/client-entry.js.map +1 -1
- package/dist/mcp/daemon/client.d.ts +10 -1
- package/dist/mcp/daemon/client.d.ts.map +1 -1
- package/dist/mcp/daemon/client.js +41 -17
- package/dist/mcp/daemon/client.js.map +1 -1
- package/dist/mcp/daemon/hosted.d.ts +22 -0
- package/dist/mcp/daemon/hosted.d.ts.map +1 -0
- package/dist/mcp/daemon/hosted.js +98 -0
- package/dist/mcp/daemon/hosted.js.map +1 -0
- package/dist/mcp/daemon/index.js +18 -423
- package/dist/mcp/daemon/index.js.map +1 -1
- package/dist/mcp/daemon/protocol.d.ts +4 -0
- package/dist/mcp/daemon/protocol.d.ts.map +1 -1
- package/dist/mcp/daemon/protocol.js +10 -0
- package/dist/mcp/daemon/protocol.js.map +1 -1
- package/dist/mcp/daemon/server.d.ts +41 -0
- package/dist/mcp/daemon/server.d.ts.map +1 -0
- package/dist/mcp/daemon/server.js +547 -0
- package/dist/mcp/daemon/server.js.map +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +5 -3
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/pi-runtime.d.ts +4 -2
- package/dist/mcp/pi-runtime.d.ts.map +1 -1
- package/dist/mcp/pi-runtime.js +12 -6
- package/dist/mcp/pi-runtime.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +16 -5
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp-chunks/chunk-53T5TVPR.js +546 -0
- package/dist/mcp-chunks/{chunk-QUDOU7MQ.js → chunk-757ZF552.js} +1 -1
- package/dist/mcp-chunks/{chunk-T5BPTC3T.js → chunk-D6OGGMWS.js} +89 -45
- package/dist/mcp-chunks/{chunk-IMG2JMBS.js → chunk-MYAMG6VL.js} +1 -1
- package/dist/mcp-chunks/{chunk-LQKMNWDE.js → chunk-OIK5AH2S.js} +5 -5
- package/dist/mcp-chunks/{chunk-3UVHZECT.js → chunk-OWGTNJNR.js} +9 -7
- package/dist/mcp-chunks/chunk-TUPFPO4L.js +400 -0
- package/dist/mcp-chunks/{cli-BM23ZXPJ.js → cli-UQ5QXFXU.js} +31 -31
- package/dist/mcp-chunks/{client-RKTAKDAY.js → client-SBELHRAE.js} +3 -3
- package/dist/mcp-chunks/{daemon-command-VU6WTFCJ.js → daemon-command-MQS6AP2W.js} +5 -5
- package/dist/mcp-chunks/dist-SDPPH7XQ.js +65 -0
- package/dist/mcp-chunks/{generate-cli-runner-JAAPSWGX.js → generate-cli-runner-LQBBQ7F5.js} +3 -3
- package/dist/mcp-chunks/{generated-daemon-runtime-LX4L2X7Z.js → generated-daemon-runtime-TUCZ3JEP.js} +4 -4
- package/dist/mcp-chunks/{pi-mcp-runtime-GHDEPXUL.js → pi-mcp-runtime-OLO25D7A.js} +1 -29
- package/dist/mcp-chunks/{runtime-T63YI7TC.js → runtime-5SOGEUTQ.js} +2 -2
- package/dist/mcp-chunks/{serve-command-75P4VBJ6.js → serve-command-YKSIXG7K.js} +3 -3
- package/dist/mcp-chunks/server-SLD55EBC.js +41 -0
- package/dist/mcp-daemon.js +29 -432
- package/dist/mcp-run-worker.js +9 -8
- package/dist/open.d.ts +9 -2
- package/dist/open.d.ts.map +1 -1
- package/dist/open.js +31 -3
- package/dist/open.js.map +1 -1
- package/dist/pi-extension.d.ts.map +1 -1
- package/dist/pi-extension.js +1 -1
- package/dist/pi-extension.js.map +1 -1
- package/dist/recipe/companions.d.ts +6 -0
- package/dist/recipe/companions.d.ts.map +1 -1
- package/dist/recipe/companions.js +22 -4
- package/dist/recipe/companions.js.map +1 -1
- package/dist/recipe/manifest.generated.d.ts +1 -1
- package/dist/recipe/manifest.generated.js +1 -1
- package/dist/recipe/suggestions.d.ts +15 -7
- package/dist/recipe/suggestions.d.ts.map +1 -1
- package/dist/recipe/suggestions.js +33 -11
- package/dist/recipe/suggestions.js.map +1 -1
- package/dist/suggestion-picker.d.ts +2 -2
- package/dist/suggestion-picker.d.ts.map +1 -1
- package/dist/suggestion-picker.js +3 -3
- package/dist/suggestion-picker.js.map +1 -1
- package/docs/interactions.md +20 -15
- package/docs/issues/README.md +6 -1
- package/docs/mcp-configuration.md +11 -3
- package/docs/recipe-format.md +30 -13
- package/package.json +5 -5
- package/skills/issues/SKILL.md +108 -0
- package/dist/mcp-chunks/{auth-command-UYFOGGQR.js → auth-command-PZLSOYAT.js} +6 -6
- package/dist/mcp-chunks/{call-command-6U5BNDR7.js → call-command-VILJIFYG.js} +6 -6
- package/dist/mcp-chunks/{chunk-36D4FILJ.js → chunk-ORJND4AI.js} +3 -3
- package/dist/mcp-chunks/{resource-command-DUY4SVE5.js → resource-command-SRFQQROJ.js} +4 -4
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
createCallResult
|
|
4
|
+
} from "./chunk-3SXP4S2A.js";
|
|
5
|
+
import {
|
|
6
|
+
readJsonFile,
|
|
7
|
+
writeJsonFile
|
|
8
|
+
} from "./chunk-3LENTPGE.js";
|
|
9
|
+
import {
|
|
10
|
+
mcporterDir
|
|
11
|
+
} from "./chunk-IWCVZ46B.js";
|
|
12
|
+
|
|
13
|
+
// node_modules/.pnpm/mcporter@0.16.1/node_modules/mcporter/dist/schema-cache.js
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
var SCHEMA_FILENAME = "schema.json";
|
|
16
|
+
function resolveSchemaCacheDir(definition) {
|
|
17
|
+
return definition.tokenCacheDir ?? path.join(mcporterDir("cache"), definition.name);
|
|
18
|
+
}
|
|
19
|
+
function resolveSchemaCachePath(definition) {
|
|
20
|
+
return path.join(resolveSchemaCacheDir(definition), SCHEMA_FILENAME);
|
|
21
|
+
}
|
|
22
|
+
async function readSchemaCache(definition) {
|
|
23
|
+
const filePath = resolveSchemaCachePath(definition);
|
|
24
|
+
try {
|
|
25
|
+
const parsed = await readJsonFile(filePath);
|
|
26
|
+
if (!parsed || typeof parsed !== "object") {
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
if (!parsed.tools || typeof parsed.tools !== "object") {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
return parsed;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
if (error.code === "ENOENT") {
|
|
35
|
+
return void 0;
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function writeSchemaCache(definition, snapshot) {
|
|
41
|
+
await writeJsonFile(resolveSchemaCachePath(definition), snapshot);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// node_modules/.pnpm/mcporter@0.16.1/node_modules/mcporter/dist/server-proxy.js
|
|
45
|
+
var KNOWN_OPTION_KEYS = /* @__PURE__ */ new Set([
|
|
46
|
+
"disableOAuth",
|
|
47
|
+
"tailLog",
|
|
48
|
+
"timeout",
|
|
49
|
+
"timeoutMs",
|
|
50
|
+
"stream",
|
|
51
|
+
"streamLog",
|
|
52
|
+
"mimeType",
|
|
53
|
+
"metadata",
|
|
54
|
+
"log"
|
|
55
|
+
]);
|
|
56
|
+
function defaultToolNameMapper(propertyKey) {
|
|
57
|
+
if (typeof propertyKey !== "string") {
|
|
58
|
+
throw new TypeError("Tool name must be a string when using server proxy.");
|
|
59
|
+
}
|
|
60
|
+
return propertyKey.replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase();
|
|
61
|
+
}
|
|
62
|
+
function canonicalizeToolName(name) {
|
|
63
|
+
return name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
64
|
+
}
|
|
65
|
+
function isPlainObject(value) {
|
|
66
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
67
|
+
}
|
|
68
|
+
function isProxyOptionKey(key) {
|
|
69
|
+
return key === "args" || KNOWN_OPTION_KEYS.has(key);
|
|
70
|
+
}
|
|
71
|
+
function inferMetadataOptions(callArgs) {
|
|
72
|
+
const options = {};
|
|
73
|
+
const optionObjects = /* @__PURE__ */ new Set();
|
|
74
|
+
for (const [index, arg] of callArgs.entries()) {
|
|
75
|
+
if (!isPlainObject(arg) || arg.disableOAuth !== true) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const keys = Object.keys(arg);
|
|
79
|
+
const isOptionsOnlyObject = keys.length > 0 && keys.every(isProxyOptionKey);
|
|
80
|
+
const hasClearlySeparateToolArgs = callArgs.some((other, otherIndex) => {
|
|
81
|
+
if (otherIndex === index) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (!isPlainObject(other)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return Object.hasOwn(other, "args") || Object.keys(other).some((key) => !isProxyOptionKey(key));
|
|
88
|
+
});
|
|
89
|
+
const hasExplicitArgsEnvelope = Object.hasOwn(arg, "args");
|
|
90
|
+
const isUnambiguousOptionsObject = isOptionsOnlyObject && (hasClearlySeparateToolArgs || hasExplicitArgsEnvelope);
|
|
91
|
+
if (isUnambiguousOptionsObject) {
|
|
92
|
+
options.disableOAuth = true;
|
|
93
|
+
} else if (isOptionsOnlyObject && callArgs.length > 1 && options.disableOAuth !== true) {
|
|
94
|
+
options.autoAuthorize = false;
|
|
95
|
+
}
|
|
96
|
+
if (isUnambiguousOptionsObject) {
|
|
97
|
+
optionObjects.add(arg);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { options, optionObjects };
|
|
101
|
+
}
|
|
102
|
+
function createToolSchemaInfo(schemaRaw) {
|
|
103
|
+
if (!schemaRaw || typeof schemaRaw !== "object") {
|
|
104
|
+
return void 0;
|
|
105
|
+
}
|
|
106
|
+
const schema = schemaRaw;
|
|
107
|
+
const propertiesRaw = schema.properties;
|
|
108
|
+
const propertyKeys = propertiesRaw && typeof propertiesRaw === "object" ? Object.keys(propertiesRaw) : [];
|
|
109
|
+
const requiredKeys = Array.isArray(schema.required) ? schema.required : [];
|
|
110
|
+
const orderedKeys = [];
|
|
111
|
+
const seen = /* @__PURE__ */ new Set();
|
|
112
|
+
for (const key of requiredKeys) {
|
|
113
|
+
if (typeof key === "string" && !seen.has(key)) {
|
|
114
|
+
orderedKeys.push(key);
|
|
115
|
+
seen.add(key);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (const key of propertyKeys) {
|
|
119
|
+
if (!seen.has(key)) {
|
|
120
|
+
orderedKeys.push(key);
|
|
121
|
+
seen.add(key);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
schema,
|
|
126
|
+
orderedKeys,
|
|
127
|
+
requiredKeys,
|
|
128
|
+
propertySet: /* @__PURE__ */ new Set([...propertyKeys, ...requiredKeys])
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function applyDefaults(meta, args) {
|
|
132
|
+
const propertiesRaw = meta.schema.properties;
|
|
133
|
+
if (!propertiesRaw || typeof propertiesRaw !== "object") {
|
|
134
|
+
return args;
|
|
135
|
+
}
|
|
136
|
+
const result = new Map(Object.entries(isPlainObject(args) ? args : {}));
|
|
137
|
+
for (const [key, value] of Object.entries(propertiesRaw)) {
|
|
138
|
+
if (value && typeof value === "object" && "default" in value && result.get(key) === void 0) {
|
|
139
|
+
result.set(key, value.default);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (result.size === 0 && !isPlainObject(args)) {
|
|
143
|
+
return args;
|
|
144
|
+
}
|
|
145
|
+
return Object.fromEntries(result);
|
|
146
|
+
}
|
|
147
|
+
function validateRequired(meta, args) {
|
|
148
|
+
if (meta.requiredKeys.length === 0) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (!isPlainObject(args)) {
|
|
152
|
+
throw new Error(`Missing required arguments: ${meta.requiredKeys.join(", ")}`);
|
|
153
|
+
}
|
|
154
|
+
const missing = meta.requiredKeys.filter((key) => !Object.hasOwn(args, key) || args[key] === void 0);
|
|
155
|
+
if (missing.length > 0) {
|
|
156
|
+
throw new Error(`Missing required arguments: ${missing.join(", ")}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function createServerProxy(runtime, serverName, mapOrOptions, maybeOptions) {
|
|
160
|
+
let mapPropertyToTool = defaultToolNameMapper;
|
|
161
|
+
let options;
|
|
162
|
+
if (typeof mapOrOptions === "function") {
|
|
163
|
+
mapPropertyToTool = mapOrOptions;
|
|
164
|
+
options = maybeOptions;
|
|
165
|
+
} else if (mapOrOptions) {
|
|
166
|
+
options = mapOrOptions;
|
|
167
|
+
if (typeof mapOrOptions.mapPropertyToTool === "function") {
|
|
168
|
+
mapPropertyToTool = mapOrOptions.mapPropertyToTool;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const cacheSchemas = options?.cacheSchemas ?? true;
|
|
172
|
+
const initialSchemas = options?.initialSchemas ?? void 0;
|
|
173
|
+
const toolSchemaCache = /* @__PURE__ */ new Map();
|
|
174
|
+
const persistedSchemas = /* @__PURE__ */ new Map();
|
|
175
|
+
const toolAliasMap = /* @__PURE__ */ new Map();
|
|
176
|
+
const schemaFetches = /* @__PURE__ */ new Map();
|
|
177
|
+
let diskLoad = null;
|
|
178
|
+
let persistPromise = null;
|
|
179
|
+
let refreshPending = false;
|
|
180
|
+
let definitionForCache;
|
|
181
|
+
if (cacheSchemas) {
|
|
182
|
+
try {
|
|
183
|
+
definitionForCache = runtime.getDefinition(serverName);
|
|
184
|
+
} catch {
|
|
185
|
+
definitionForCache = void 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (cacheSchemas && !initialSchemas && definitionForCache) {
|
|
189
|
+
diskLoad = loadSchemasFromDisk(definitionForCache);
|
|
190
|
+
refreshPending = true;
|
|
191
|
+
}
|
|
192
|
+
if (initialSchemas) {
|
|
193
|
+
for (const [key, schemaRaw] of Object.entries(initialSchemas)) {
|
|
194
|
+
storeSchema(key, schemaRaw);
|
|
195
|
+
}
|
|
196
|
+
persistPromise = persistSchemas();
|
|
197
|
+
}
|
|
198
|
+
async function consumePersist() {
|
|
199
|
+
if (!persistPromise) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
await persistPromise;
|
|
204
|
+
} finally {
|
|
205
|
+
persistPromise = null;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
async function ensureMetadata(toolName, metadataOptions = {}) {
|
|
209
|
+
await consumePersist();
|
|
210
|
+
const cached = toolSchemaCache.get(toolName);
|
|
211
|
+
if (cached && !refreshPending) {
|
|
212
|
+
return cached;
|
|
213
|
+
}
|
|
214
|
+
if (diskLoad) {
|
|
215
|
+
try {
|
|
216
|
+
await diskLoad;
|
|
217
|
+
} finally {
|
|
218
|
+
diskLoad = null;
|
|
219
|
+
}
|
|
220
|
+
if (toolSchemaCache.has(toolName) && !refreshPending) {
|
|
221
|
+
return toolSchemaCache.get(toolName);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const disableOAuth = metadataOptions.disableOAuth === true;
|
|
225
|
+
const schemaFetchKey = disableOAuth ? "disable-oauth" : metadataOptions.autoAuthorize === false ? "no-authorize" : "default";
|
|
226
|
+
let schemaFetch = schemaFetches.get(schemaFetchKey);
|
|
227
|
+
if (!schemaFetch) {
|
|
228
|
+
const listToolsOptions = {
|
|
229
|
+
includeSchema: true
|
|
230
|
+
};
|
|
231
|
+
if (disableOAuth) {
|
|
232
|
+
listToolsOptions.disableOAuth = true;
|
|
233
|
+
} else if (metadataOptions.autoAuthorize === false) {
|
|
234
|
+
listToolsOptions.autoAuthorize = false;
|
|
235
|
+
}
|
|
236
|
+
schemaFetch = runtime.listTools(serverName, listToolsOptions).then((tools) => {
|
|
237
|
+
for (const tool of tools) {
|
|
238
|
+
if (!tool.inputSchema || typeof tool.inputSchema !== "object") {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
storeSchema(tool.name, tool.inputSchema);
|
|
242
|
+
}
|
|
243
|
+
persistPromise = persistSchemas();
|
|
244
|
+
refreshPending = false;
|
|
245
|
+
}).catch((error) => {
|
|
246
|
+
if (schemaFetches.get(schemaFetchKey) === schemaFetch) {
|
|
247
|
+
schemaFetches.delete(schemaFetchKey);
|
|
248
|
+
}
|
|
249
|
+
throw error;
|
|
250
|
+
});
|
|
251
|
+
schemaFetches.set(schemaFetchKey, schemaFetch);
|
|
252
|
+
}
|
|
253
|
+
await schemaFetch;
|
|
254
|
+
await consumePersist();
|
|
255
|
+
return toolSchemaCache.get(toolName);
|
|
256
|
+
}
|
|
257
|
+
function storeSchema(key, schemaRaw) {
|
|
258
|
+
const info = createToolSchemaInfo(schemaRaw);
|
|
259
|
+
if (!info) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const canonical = mapPropertyToTool(key);
|
|
263
|
+
toolSchemaCache.set(key, info);
|
|
264
|
+
const canonicalAlias = canonicalizeToolName(key);
|
|
265
|
+
if (!toolAliasMap.has(canonicalAlias)) {
|
|
266
|
+
toolAliasMap.set(canonicalAlias, key);
|
|
267
|
+
}
|
|
268
|
+
const mapperAlias = canonicalizeToolName(canonical);
|
|
269
|
+
if (!toolAliasMap.has(mapperAlias)) {
|
|
270
|
+
toolAliasMap.set(mapperAlias, key);
|
|
271
|
+
}
|
|
272
|
+
if (cacheSchemas && definitionForCache && isPlainObject(schemaRaw)) {
|
|
273
|
+
persistedSchemas.set(key, schemaRaw);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async function loadSchemasFromDisk(definition) {
|
|
277
|
+
try {
|
|
278
|
+
const snapshot = await readSchemaCache(definition);
|
|
279
|
+
if (!snapshot) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
for (const [key, schemaRaw] of Object.entries(snapshot.tools)) {
|
|
283
|
+
storeSchema(key, schemaRaw);
|
|
284
|
+
}
|
|
285
|
+
} catch {
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function persistSchemas() {
|
|
289
|
+
if (!cacheSchemas || !definitionForCache || persistedSchemas.size === 0) {
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
const definition = definitionForCache;
|
|
293
|
+
const snapshot = {
|
|
294
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
295
|
+
tools: Object.fromEntries(persistedSchemas.entries())
|
|
296
|
+
};
|
|
297
|
+
return writeSchemaCache(definition, snapshot).catch(() => {
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
const base = {
|
|
301
|
+
call: async (toolName, callOptions) => {
|
|
302
|
+
const result = await runtime.callTool(serverName, toolName, callOptions ?? {});
|
|
303
|
+
return createCallResult(result);
|
|
304
|
+
},
|
|
305
|
+
listTools: (listOptions) => runtime.listTools(serverName, listOptions)
|
|
306
|
+
};
|
|
307
|
+
return new Proxy(base, {
|
|
308
|
+
get(target, property, receiver) {
|
|
309
|
+
if (Object.hasOwn(target, property)) {
|
|
310
|
+
return Reflect.get(target, property, receiver);
|
|
311
|
+
}
|
|
312
|
+
const propertyKey = property;
|
|
313
|
+
const canonicalKey = typeof propertyKey === "string" ? canonicalizeToolName(propertyKey) : null;
|
|
314
|
+
let resolvedToolName = typeof propertyKey === "string" && canonicalKey ? mapPropertyToTool === defaultToolNameMapper && toolSchemaCache.has(propertyKey) ? propertyKey : toolAliasMap.get(canonicalKey) ?? mapPropertyToTool(propertyKey) : mapPropertyToTool(propertyKey);
|
|
315
|
+
return async (...callArgs) => {
|
|
316
|
+
const { options: metadataOptions, optionObjects } = inferMetadataOptions(callArgs);
|
|
317
|
+
let schemaInfo;
|
|
318
|
+
try {
|
|
319
|
+
schemaInfo = await ensureMetadata(resolvedToolName, metadataOptions);
|
|
320
|
+
} catch {
|
|
321
|
+
schemaInfo = void 0;
|
|
322
|
+
}
|
|
323
|
+
if (typeof propertyKey === "string" && canonicalKey) {
|
|
324
|
+
const alias = mapPropertyToTool === defaultToolNameMapper && toolSchemaCache.has(propertyKey) ? propertyKey : toolAliasMap.get(canonicalKey);
|
|
325
|
+
if (alias && alias !== resolvedToolName) {
|
|
326
|
+
resolvedToolName = alias;
|
|
327
|
+
try {
|
|
328
|
+
schemaInfo = await ensureMetadata(resolvedToolName, metadataOptions);
|
|
329
|
+
} catch {
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
const positional = [];
|
|
334
|
+
const argsAccumulator = /* @__PURE__ */ Object.create(null);
|
|
335
|
+
const optionsAccumulator = /* @__PURE__ */ Object.create(null);
|
|
336
|
+
for (const arg of callArgs) {
|
|
337
|
+
if (isPlainObject(arg)) {
|
|
338
|
+
const keys = Object.keys(arg);
|
|
339
|
+
const treatAsArgs = !optionObjects.has(arg) && keys.length > 0 && (schemaInfo ? keys.every((key) => schemaInfo.propertySet.has(key)) || keys.every((key) => !KNOWN_OPTION_KEYS.has(key)) : keys.every((key) => !isProxyOptionKey(key)));
|
|
340
|
+
if (treatAsArgs) {
|
|
341
|
+
Object.assign(argsAccumulator, arg);
|
|
342
|
+
} else {
|
|
343
|
+
Object.assign(optionsAccumulator, arg);
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
positional.push(arg);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const explicitArgs = optionsAccumulator.args;
|
|
350
|
+
if (explicitArgs !== void 0) {
|
|
351
|
+
delete optionsAccumulator.args;
|
|
352
|
+
}
|
|
353
|
+
const finalOptions = { ...optionsAccumulator };
|
|
354
|
+
let combinedArgs = explicitArgs;
|
|
355
|
+
if (schemaInfo) {
|
|
356
|
+
const schema = schemaInfo;
|
|
357
|
+
if (positional.length > schema.orderedKeys.length) {
|
|
358
|
+
throw new Error(`Too many positional arguments for tool "${resolvedToolName}"`);
|
|
359
|
+
}
|
|
360
|
+
if (positional.length > 0) {
|
|
361
|
+
combinedArgs = Object.fromEntries([
|
|
362
|
+
...Object.entries(isPlainObject(combinedArgs) ? combinedArgs : {}),
|
|
363
|
+
...schema.orderedKeys.slice(0, positional.length).map((key, index) => [key, positional[index]])
|
|
364
|
+
]);
|
|
365
|
+
}
|
|
366
|
+
if (Object.keys(argsAccumulator).length > 0) {
|
|
367
|
+
const baseArgs = isPlainObject(combinedArgs) ? { ...combinedArgs } : {};
|
|
368
|
+
combinedArgs = { ...baseArgs, ...argsAccumulator };
|
|
369
|
+
}
|
|
370
|
+
if (combinedArgs !== void 0) {
|
|
371
|
+
combinedArgs = applyDefaults(schema, combinedArgs);
|
|
372
|
+
} else {
|
|
373
|
+
const defaults = applyDefaults(schema, void 0);
|
|
374
|
+
if (defaults && typeof defaults === "object") {
|
|
375
|
+
combinedArgs = defaults;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
validateRequired(schema, combinedArgs);
|
|
379
|
+
} else {
|
|
380
|
+
if (positional.length > 0) {
|
|
381
|
+
combinedArgs = positional;
|
|
382
|
+
}
|
|
383
|
+
if (Object.keys(argsAccumulator).length > 0) {
|
|
384
|
+
const baseArgs = isPlainObject(combinedArgs) ? { ...combinedArgs } : {};
|
|
385
|
+
combinedArgs = { ...baseArgs, ...argsAccumulator };
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
if (combinedArgs !== void 0) {
|
|
389
|
+
finalOptions.args = combinedArgs;
|
|
390
|
+
}
|
|
391
|
+
const result = await runtime.callTool(serverName, resolvedToolName, finalOptions);
|
|
392
|
+
return createCallResult(result);
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export {
|
|
399
|
+
createServerProxy
|
|
400
|
+
};
|
|
@@ -38,12 +38,6 @@ import {
|
|
|
38
38
|
parsePositiveInteger,
|
|
39
39
|
resolveCallTimeout
|
|
40
40
|
} from "./chunk-TC2JPBFB.js";
|
|
41
|
-
import "./chunk-L2MSWQDL.js";
|
|
42
|
-
import {
|
|
43
|
-
looksLikeHttpUrl,
|
|
44
|
-
splitHttpToolSelector
|
|
45
|
-
} from "./chunk-US63Y6XE.js";
|
|
46
|
-
import "./chunk-MEQXX43K.js";
|
|
47
41
|
import {
|
|
48
42
|
getActiveLogLevel,
|
|
49
43
|
getActiveLogger,
|
|
@@ -51,6 +45,12 @@ import {
|
|
|
51
45
|
logInfo,
|
|
52
46
|
setLogLevel
|
|
53
47
|
} from "./chunk-DU4SDPEV.js";
|
|
48
|
+
import "./chunk-L2MSWQDL.js";
|
|
49
|
+
import {
|
|
50
|
+
looksLikeHttpUrl,
|
|
51
|
+
splitHttpToolSelector
|
|
52
|
+
} from "./chunk-US63Y6XE.js";
|
|
53
|
+
import "./chunk-MEQXX43K.js";
|
|
54
54
|
import {
|
|
55
55
|
createInteractiveElicitationResponder
|
|
56
56
|
} from "./chunk-F2X4Y2TQ.js";
|
|
@@ -62,11 +62,11 @@ import {
|
|
|
62
62
|
resolveConfigPath
|
|
63
63
|
} from "./chunk-JEHI2YU4.js";
|
|
64
64
|
import "./chunk-IWCVZ46B.js";
|
|
65
|
-
import "./chunk-T4MQCFIK.js";
|
|
66
|
-
import "./chunk-BHXCAVFP.js";
|
|
67
65
|
import {
|
|
68
66
|
parseLogLevel
|
|
69
67
|
} from "./chunk-O3RTM5HD.js";
|
|
68
|
+
import "./chunk-T4MQCFIK.js";
|
|
69
|
+
import "./chunk-BHXCAVFP.js";
|
|
70
70
|
import "./chunk-LRKZP7DJ.js";
|
|
71
71
|
|
|
72
72
|
// node_modules/.pnpm/mcporter@0.16.1/node_modules/mcporter/dist/cli/cli-factory.js
|
|
@@ -453,19 +453,19 @@ function flushStdioThenForceExit() {
|
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
async function handleAuth(...args) {
|
|
456
|
-
const { handleAuth: imported } = await import("./auth-command-
|
|
456
|
+
const { handleAuth: imported } = await import("./auth-command-PZLSOYAT.js");
|
|
457
457
|
return imported(...args);
|
|
458
458
|
}
|
|
459
459
|
async function printAuthHelp() {
|
|
460
|
-
const { printAuthHelp: imported } = await import("./auth-command-
|
|
460
|
+
const { printAuthHelp: imported } = await import("./auth-command-PZLSOYAT.js");
|
|
461
461
|
imported();
|
|
462
462
|
}
|
|
463
463
|
async function handleCall(...args) {
|
|
464
|
-
const { handleCall: imported } = await import("./call-command-
|
|
464
|
+
const { handleCall: imported } = await import("./call-command-VILJIFYG.js");
|
|
465
465
|
return imported(...args);
|
|
466
466
|
}
|
|
467
467
|
async function handleGenerateCli(...args) {
|
|
468
|
-
const { handleGenerateCli: imported } = await import("./generate-cli-runner-
|
|
468
|
+
const { handleGenerateCli: imported } = await import("./generate-cli-runner-LQBBQ7F5.js");
|
|
469
469
|
return imported(...args);
|
|
470
470
|
}
|
|
471
471
|
async function handleInspectCli(...args) {
|
|
@@ -477,7 +477,7 @@ async function handleList(...args) {
|
|
|
477
477
|
return imported(...args);
|
|
478
478
|
}
|
|
479
479
|
async function handleResource(...args) {
|
|
480
|
-
const { handleResource: imported } = await import("./resource-command-
|
|
480
|
+
const { handleResource: imported } = await import("./resource-command-SRFQQROJ.js");
|
|
481
481
|
return imported(...args);
|
|
482
482
|
}
|
|
483
483
|
async function runCli(argv) {
|
|
@@ -510,12 +510,12 @@ async function runCli(argv) {
|
|
|
510
510
|
}
|
|
511
511
|
if (command === "generate-cli") {
|
|
512
512
|
if (consumeHelpTokens(args)) {
|
|
513
|
-
const { printGenerateCliHelp } = await import("./generate-cli-runner-
|
|
513
|
+
const { printGenerateCliHelp } = await import("./generate-cli-runner-LQBBQ7F5.js");
|
|
514
514
|
printGenerateCliHelp();
|
|
515
515
|
process.exitCode = 0;
|
|
516
516
|
return;
|
|
517
517
|
}
|
|
518
|
-
const { handleGenerateCli: importedHandleGenerateCli } = await import("./generate-cli-runner-
|
|
518
|
+
const { handleGenerateCli: importedHandleGenerateCli } = await import("./generate-cli-runner-LQBBQ7F5.js");
|
|
519
519
|
await importedHandleGenerateCli(args, globalFlags);
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
@@ -541,7 +541,7 @@ async function runCli(argv) {
|
|
|
541
541
|
...interactiveElicitation ? { elicitationHandler: interactiveElicitation.handler } : {}
|
|
542
542
|
};
|
|
543
543
|
if (command === "daemon") {
|
|
544
|
-
const { handleDaemonCli } = await import("./daemon-command-
|
|
544
|
+
const { handleDaemonCli } = await import("./daemon-command-MQS6AP2W.js");
|
|
545
545
|
await handleDaemonCli(args, {
|
|
546
546
|
configPath: configPathResolved,
|
|
547
547
|
configExplicit: configResolution.explicit,
|
|
@@ -550,7 +550,7 @@ async function runCli(argv) {
|
|
|
550
550
|
return;
|
|
551
551
|
}
|
|
552
552
|
if (command === "serve") {
|
|
553
|
-
const { handleServeCli, printServeHelp } = await import("./serve-command-
|
|
553
|
+
const { handleServeCli, printServeHelp } = await import("./serve-command-YKSIXG7K.js");
|
|
554
554
|
if (consumeHelpTokens(args)) {
|
|
555
555
|
printServeHelp();
|
|
556
556
|
process.exitCode = 0;
|
|
@@ -599,7 +599,7 @@ async function runCli(argv) {
|
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
601
|
const [{ createRuntime: createRuntime2 }, { handleEmitTs }] = await Promise.all([
|
|
602
|
-
import("./runtime-
|
|
602
|
+
import("./runtime-5SOGEUTQ.js"),
|
|
603
603
|
import("./emit-ts-command-SY4LQE4S.js")
|
|
604
604
|
]);
|
|
605
605
|
const runtime2 = await createRuntime2(runtimeOptionsWithPath);
|
|
@@ -615,8 +615,8 @@ async function runCli(argv) {
|
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
617
|
const [{ createRuntime }, { DaemonClient }, { createKeepAliveRuntime }, { isKeepAliveServer }] = await Promise.all([
|
|
618
|
-
import("./runtime-
|
|
619
|
-
import("./client-
|
|
618
|
+
import("./runtime-5SOGEUTQ.js"),
|
|
619
|
+
import("./client-SBELHRAE.js"),
|
|
620
620
|
import("./runtime-wrapper-7HYO3NM5.js"),
|
|
621
621
|
import("./lifecycle-QBYGUHQ3.js")
|
|
622
622
|
]);
|
|
@@ -651,23 +651,23 @@ async function runCli(argv) {
|
|
|
651
651
|
}
|
|
652
652
|
if (resolvedCommand === "call") {
|
|
653
653
|
if (consumeHelpTokens(resolvedArgs)) {
|
|
654
|
-
const { printCallHelp } = await import("./call-command-
|
|
654
|
+
const { printCallHelp } = await import("./call-command-VILJIFYG.js");
|
|
655
655
|
printCallHelp();
|
|
656
656
|
process.exitCode = 0;
|
|
657
657
|
return;
|
|
658
658
|
}
|
|
659
|
-
const { handleCall: runHandleCall } = await import("./call-command-
|
|
659
|
+
const { handleCall: runHandleCall } = await import("./call-command-VILJIFYG.js");
|
|
660
660
|
await runHandleCall(runtime, resolvedArgs);
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
663
|
if (resolvedCommand === "auth") {
|
|
664
664
|
if (consumeHelpTokens(resolvedArgs)) {
|
|
665
|
-
const { printAuthHelp: importedPrintAuthHelp } = await import("./auth-command-
|
|
665
|
+
const { printAuthHelp: importedPrintAuthHelp } = await import("./auth-command-PZLSOYAT.js");
|
|
666
666
|
importedPrintAuthHelp();
|
|
667
667
|
process.exitCode = 0;
|
|
668
668
|
return;
|
|
669
669
|
}
|
|
670
|
-
const { handleAuth: importedHandleAuth } = await import("./auth-command-
|
|
670
|
+
const { handleAuth: importedHandleAuth } = await import("./auth-command-PZLSOYAT.js");
|
|
671
671
|
await importedHandleAuth(runtime, resolvedArgs, { oauthTimeoutMs: runtimeOptionsWithPath.oauthTimeoutMs });
|
|
672
672
|
return;
|
|
673
673
|
}
|
|
@@ -684,12 +684,12 @@ async function runCli(argv) {
|
|
|
684
684
|
}
|
|
685
685
|
if (resolvedCommand === "resource" || resolvedCommand === "resources") {
|
|
686
686
|
if (consumeHelpTokens(resolvedArgs)) {
|
|
687
|
-
const { printResourceHelp } = await import("./resource-command-
|
|
687
|
+
const { printResourceHelp } = await import("./resource-command-SRFQQROJ.js");
|
|
688
688
|
printResourceHelp();
|
|
689
689
|
process.exitCode = 0;
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
|
-
const { handleResource: importedHandleResource } = await import("./resource-command-
|
|
692
|
+
const { handleResource: importedHandleResource } = await import("./resource-command-SRFQQROJ.js");
|
|
693
693
|
await importedHandleResource(runtime, resolvedArgs);
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
@@ -772,8 +772,8 @@ if (process.env.MCPORTER_DISABLE_AUTORUN !== "1") {
|
|
|
772
772
|
}
|
|
773
773
|
async function invokeAuthCommand(runtimeOptions, args) {
|
|
774
774
|
const [{ createRuntime }, { handleAuth: importedHandleAuth }] = await Promise.all([
|
|
775
|
-
import("./runtime-
|
|
776
|
-
import("./auth-command-
|
|
775
|
+
import("./runtime-5SOGEUTQ.js"),
|
|
776
|
+
import("./auth-command-PZLSOYAT.js")
|
|
777
777
|
]);
|
|
778
778
|
const runtime = await createRuntime(runtimeOptions);
|
|
779
779
|
try {
|
|
@@ -799,8 +799,8 @@ async function maybeHandleDaemonFastCall(command, args, configResolution, rootDi
|
|
|
799
799
|
return true;
|
|
800
800
|
}
|
|
801
801
|
const [{ DaemonClient }, { handleCall: importedHandleCall }] = await Promise.all([
|
|
802
|
-
import("./client-
|
|
803
|
-
import("./call-command-
|
|
802
|
+
import("./client-SBELHRAE.js"),
|
|
803
|
+
import("./call-command-VILJIFYG.js")
|
|
804
804
|
]);
|
|
805
805
|
const daemonClient = new DaemonClient({
|
|
806
806
|
configPath: configResolution.path,
|
|
@@ -825,7 +825,7 @@ async function maybeHandleSimpleDaemonFastCall(callArgs, configResolution, rootD
|
|
|
825
825
|
return false;
|
|
826
826
|
}
|
|
827
827
|
const [{ DaemonClient }, { wrapCallResult }, { printCallOutput }] = await Promise.all([
|
|
828
|
-
import("./client-
|
|
828
|
+
import("./client-SBELHRAE.js"),
|
|
829
829
|
import("./result-utils-JASGNHXK.js"),
|
|
830
830
|
import("./output-utils-YTMZTA7J.js")
|
|
831
831
|
]);
|
|
@@ -2,8 +2,8 @@ import { createRequire as __createRequire } from "node:module"; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
DaemonClient,
|
|
4
4
|
resolveDaemonPaths
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-MYAMG6VL.js";
|
|
6
|
+
import "./chunk-ORJND4AI.js";
|
|
7
7
|
import "./chunk-2AKSS7WR.js";
|
|
8
8
|
import "./chunk-6P3KAQ5N.js";
|
|
9
9
|
import "./chunk-F2X4Y2TQ.js";
|
|
@@ -18,9 +18,9 @@ import "./chunk-7U5NSQ5T.js";
|
|
|
18
18
|
import "./chunk-3LENTPGE.js";
|
|
19
19
|
import "./chunk-JEHI2YU4.js";
|
|
20
20
|
import "./chunk-IWCVZ46B.js";
|
|
21
|
+
import "./chunk-O3RTM5HD.js";
|
|
21
22
|
import "./chunk-T4MQCFIK.js";
|
|
22
23
|
import "./chunk-BHXCAVFP.js";
|
|
23
|
-
import "./chunk-O3RTM5HD.js";
|
|
24
24
|
import "./chunk-MHUMLEBO.js";
|
|
25
25
|
import "./chunk-IRSL7JRH.js";
|
|
26
26
|
import "./chunk-UVRJ3AAD.js";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
handleDaemonCli
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-36D4FILJ.js";
|
|
4
|
+
} from "./chunk-OIK5AH2S.js";
|
|
5
|
+
import "./chunk-MYAMG6VL.js";
|
|
6
|
+
import "./chunk-ORJND4AI.js";
|
|
8
7
|
import "./chunk-2AKSS7WR.js";
|
|
9
8
|
import "./chunk-6P3KAQ5N.js";
|
|
10
9
|
import "./chunk-F2X4Y2TQ.js";
|
|
@@ -19,13 +18,14 @@ import "./chunk-7U5NSQ5T.js";
|
|
|
19
18
|
import "./chunk-3LENTPGE.js";
|
|
20
19
|
import "./chunk-JEHI2YU4.js";
|
|
21
20
|
import "./chunk-IWCVZ46B.js";
|
|
21
|
+
import "./chunk-O3RTM5HD.js";
|
|
22
22
|
import "./chunk-T4MQCFIK.js";
|
|
23
23
|
import "./chunk-BHXCAVFP.js";
|
|
24
|
-
import "./chunk-O3RTM5HD.js";
|
|
25
24
|
import "./chunk-MHUMLEBO.js";
|
|
26
25
|
import "./chunk-IRSL7JRH.js";
|
|
27
26
|
import "./chunk-UVRJ3AAD.js";
|
|
28
27
|
import "./chunk-O7SIXJM6.js";
|
|
28
|
+
import "./chunk-B6S43WID.js";
|
|
29
29
|
import "./chunk-LRKZP7DJ.js";
|
|
30
30
|
export {
|
|
31
31
|
handleDaemonCli
|