@introspection-ai/recipes 0.53.0 → 0.55.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 +16 -0
- package/dist/connector-tools.js.map +1 -1
- package/dist/documents/arguments.d.ts +17 -0
- package/dist/documents/arguments.d.ts.map +1 -1
- package/dist/documents/arguments.generated.d.ts +2 -1
- package/dist/documents/arguments.generated.d.ts.map +1 -1
- package/dist/documents/arguments.generated.js +22 -0
- package/dist/documents/arguments.generated.js.map +1 -1
- package/dist/documents/index.d.ts +1 -1
- package/dist/documents/index.d.ts.map +1 -1
- package/dist/documents/module.d.ts.map +1 -1
- package/dist/documents/module.js +2 -0
- package/dist/documents/module.js.map +1 -1
- package/dist/documents/tools.d.ts +1 -1
- package/dist/documents/tools.d.ts.map +1 -1
- package/dist/documents/tools.js +71 -6
- package/dist/documents/tools.js.map +1 -1
- package/dist/documents/types.d.ts +96 -0
- package/dist/documents/types.d.ts.map +1 -1
- package/dist/interactions.d.ts +6 -0
- package/dist/interactions.d.ts.map +1 -1
- package/dist/interactions.js +9 -0
- package/dist/interactions.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-QUDOU7MQ.js → chunk-757ZF552.js} +1 -1
- package/dist/mcp-chunks/chunk-AJDK5Z7O.js +546 -0
- package/dist/mcp-chunks/{chunk-T5BPTC3T.js → chunk-KZGUH7E2.js} +90 -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-HQBFWAJR.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 +2 -1
- package/dist/recipe/manifest.generated.d.ts.map +1 -1
- package/dist/recipe/manifest.generated.js +3 -2
- package/dist/recipe/manifest.generated.js.map +1 -1
- package/dist/recipe/package.d.ts +12 -0
- package/dist/recipe/package.d.ts.map +1 -1
- package/dist/recipe/package.js +32 -0
- package/dist/recipe/package.js.map +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/signature/arguments.d.ts +78 -0
- package/dist/signature/arguments.d.ts.map +1 -0
- package/dist/signature/arguments.generated.d.ts +9 -0
- package/dist/signature/arguments.generated.d.ts.map +1 -0
- package/dist/signature/arguments.generated.js +129 -0
- package/dist/signature/arguments.generated.js.map +1 -0
- package/dist/signature/arguments.js +8 -0
- package/dist/signature/arguments.js.map +1 -0
- package/dist/signature/docx.d.ts +41 -0
- package/dist/signature/docx.d.ts.map +1 -0
- package/dist/signature/docx.js +449 -0
- package/dist/signature/docx.js.map +1 -0
- package/dist/signature/index.d.ts +9 -0
- package/dist/signature/index.d.ts.map +1 -0
- package/dist/signature/index.js +5 -0
- package/dist/signature/index.js.map +1 -0
- package/dist/signature/module.d.ts +39 -0
- package/dist/signature/module.d.ts.map +1 -0
- package/dist/signature/module.js +111 -0
- package/dist/signature/module.js.map +1 -0
- package/dist/signature/tool.d.ts +137 -0
- package/dist/signature/tool.d.ts.map +1 -0
- package/dist/signature/tool.js +677 -0
- package/dist/signature/tool.js.map +1 -0
- package/dist/signature/types.d.ts +259 -0
- package/dist/signature/types.d.ts.map +1 -0
- package/dist/signature/types.js +69 -0
- package/dist/signature/types.js.map +1 -0
- 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/README.md +2 -1
- package/docs/documents/README.md +152 -6
- package/docs/interactions.md +20 -15
- package/docs/issues/README.md +6 -1
- package/docs/mcp-configuration.md +11 -3
- package/docs/providers.md +3 -1
- package/docs/recipe-format.md +30 -13
- package/docs/signature/README.md +311 -0
- package/docs/signature/docusign.md +139 -0
- package/docs/signature/dropbox-sign.md +76 -0
- package/docs/signature/pandadoc.md +76 -0
- package/package.json +10 -5
- package/skills/documents/SKILL.md +17 -1
- package/skills/issues/SKILL.md +108 -0
- package/skills/signature/SKILL.md +97 -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
|
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from "node:module"; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
createMcpRuntime,
|
|
4
4
|
usesPiMcpClient
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OWGTNJNR.js";
|
|
6
6
|
import {
|
|
7
7
|
createCallResult,
|
|
8
8
|
describeConnectionIssue
|
|
@@ -10105,32 +10105,66 @@ var storage = new AsyncLocalStorage();
|
|
|
10105
10105
|
function currentMcpCommandContext() {
|
|
10106
10106
|
return storage.getStore();
|
|
10107
10107
|
}
|
|
10108
|
+
var envStorage = new AsyncLocalStorage();
|
|
10109
|
+
function mcpCommandEnv() {
|
|
10110
|
+
return envStorage.getStore() ?? process.env;
|
|
10111
|
+
}
|
|
10112
|
+
function runWithMcpCommandEnv(env, task) {
|
|
10113
|
+
return envStorage.run(env, task);
|
|
10114
|
+
}
|
|
10108
10115
|
function runWithMcpCommandContext(context2, task) {
|
|
10109
10116
|
return storage.run(context2, task);
|
|
10110
10117
|
}
|
|
10118
|
+
var ioRoutingHolders = 0;
|
|
10119
|
+
var restoreIoRouting;
|
|
10111
10120
|
function installMcpCommandIoRouting() {
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
const
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10121
|
+
if (ioRoutingHolders === 0) {
|
|
10122
|
+
const stdoutWrite = process.stdout.write;
|
|
10123
|
+
const stderrWrite = process.stderr.write;
|
|
10124
|
+
const boundStdout = stdoutWrite.bind(process.stdout);
|
|
10125
|
+
const boundStderr = stderrWrite.bind(process.stderr);
|
|
10126
|
+
const routedStdout = ((chunk, ...args) => {
|
|
10127
|
+
const target = currentMcpCommandContext()?.stdout;
|
|
10128
|
+
return target ? target.write(chunk) : boundStdout(chunk, ...args);
|
|
10129
|
+
});
|
|
10130
|
+
const routedStderr = ((chunk, ...args) => {
|
|
10131
|
+
const target = currentMcpCommandContext()?.stderr;
|
|
10132
|
+
return target ? target.write(chunk) : boundStderr(chunk, ...args);
|
|
10133
|
+
});
|
|
10134
|
+
process.stdout.write = routedStdout;
|
|
10135
|
+
process.stderr.write = routedStderr;
|
|
10136
|
+
restoreIoRouting = () => {
|
|
10137
|
+
if (process.stdout.write === routedStdout)
|
|
10138
|
+
process.stdout.write = stdoutWrite;
|
|
10139
|
+
if (process.stderr.write === routedStderr)
|
|
10140
|
+
process.stderr.write = stderrWrite;
|
|
10141
|
+
};
|
|
10142
|
+
}
|
|
10143
|
+
ioRoutingHolders += 1;
|
|
10144
|
+
let released = false;
|
|
10122
10145
|
return () => {
|
|
10123
|
-
|
|
10124
|
-
|
|
10146
|
+
if (released) return;
|
|
10147
|
+
released = true;
|
|
10148
|
+
ioRoutingHolders -= 1;
|
|
10149
|
+
if (ioRoutingHolders === 0) {
|
|
10150
|
+
restoreIoRouting?.();
|
|
10151
|
+
restoreIoRouting = void 0;
|
|
10152
|
+
}
|
|
10125
10153
|
};
|
|
10126
10154
|
}
|
|
10127
10155
|
|
|
10128
10156
|
// src/mcp/daemon/protocol.ts
|
|
10157
|
+
import { basename, join } from "node:path";
|
|
10129
10158
|
var MCP_DAEMON_SOCKET_ENV = "PI_RECIPES_MCP_DAEMON_SOCKET";
|
|
10130
10159
|
var MCP_DAEMON_TOKEN_ENV = "PI_RECIPES_MCP_DAEMON_TOKEN";
|
|
10131
10160
|
var MCP_DAEMON_FINGERPRINT_ENV = "PI_RECIPES_MCP_DAEMON_FINGERPRINT";
|
|
10132
10161
|
var MCP_DAEMON_PARENT_PID_ENV = "PI_RECIPES_MCP_DAEMON_PARENT_PID";
|
|
10162
|
+
var MCP_SESSION_ROOT_ENV = "PI_RECIPES_MCP_SESSION_ROOT";
|
|
10133
10163
|
var MCP_DAEMON_MAX_FRAME_BYTES = 10 * 1024 * 1024;
|
|
10164
|
+
var SOCKET_DIRECTORY = /^recipes-mcp-[0-9a-f]{20}$/;
|
|
10165
|
+
function isMcpDaemonSocketDirectory(directory) {
|
|
10166
|
+
return SOCKET_DIRECTORY.test(basename(directory));
|
|
10167
|
+
}
|
|
10134
10168
|
function serializeMcpDaemonEnvelope(envelope, maxBytes = MCP_DAEMON_MAX_FRAME_BYTES) {
|
|
10135
10169
|
let estimatedBytes = 0;
|
|
10136
10170
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
@@ -10188,7 +10222,7 @@ import {
|
|
|
10188
10222
|
stat,
|
|
10189
10223
|
writeFile
|
|
10190
10224
|
} from "node:fs/promises";
|
|
10191
|
-
import { dirname as
|
|
10225
|
+
import { dirname as dirname3, join as join4, resolve as resolve2 } from "node:path";
|
|
10192
10226
|
import { setTimeout as delay2 } from "node:timers/promises";
|
|
10193
10227
|
import { stdin as input, stderr, stdout } from "node:process";
|
|
10194
10228
|
import { inspect, parseArgs as parseArgs2 } from "node:util";
|
|
@@ -11065,7 +11099,7 @@ function mcpRunHelpText() {
|
|
|
11065
11099
|
}
|
|
11066
11100
|
|
|
11067
11101
|
// src/mcp/index.ts
|
|
11068
|
-
import { delimiter, dirname, join, resolve } from "node:path";
|
|
11102
|
+
import { delimiter, dirname as dirname2, join as join3, resolve } from "node:path";
|
|
11069
11103
|
|
|
11070
11104
|
// node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
11071
11105
|
var balanced = (a, b, str) => {
|
|
@@ -12942,6 +12976,7 @@ var import_yaml = __toESM(require_dist(), 1);
|
|
|
12942
12976
|
|
|
12943
12977
|
// src/recipe/companions.ts
|
|
12944
12978
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
12979
|
+
import { dirname, join as join2 } from "node:path";
|
|
12945
12980
|
import { fileURLToPath } from "node:url";
|
|
12946
12981
|
|
|
12947
12982
|
// src/recipe/extensions.ts
|
|
@@ -12949,9 +12984,7 @@ import { createRequire, findPackageJSON } from "node:module";
|
|
|
12949
12984
|
var require2 = createRequire(import.meta.url);
|
|
12950
12985
|
|
|
12951
12986
|
// src/recipe/companions.ts
|
|
12952
|
-
var
|
|
12953
|
-
new URL("../../package.json", import.meta.url)
|
|
12954
|
-
);
|
|
12987
|
+
var recipesModuleDir = dirname(fileURLToPath(import.meta.url));
|
|
12955
12988
|
|
|
12956
12989
|
// src/recipe/package.ts
|
|
12957
12990
|
var RESOURCE_KEYS = [
|
|
@@ -12967,6 +13000,7 @@ var PI_KEYS = /* @__PURE__ */ new Set([
|
|
|
12967
13000
|
"productivity",
|
|
12968
13001
|
"search",
|
|
12969
13002
|
"issues",
|
|
13003
|
+
"signature",
|
|
12970
13004
|
"evals",
|
|
12971
13005
|
"mcp",
|
|
12972
13006
|
"runtime"
|
|
@@ -12993,10 +13027,10 @@ var MCP_SESSION_ENV = `${RECIPE_ENV_PREFIX}MCP_SESSION`;
|
|
|
12993
13027
|
var MCP_LOCAL_CONFIG_ENV = `${RECIPE_ENV_PREFIX}MCP_LOCAL_CONFIG`;
|
|
12994
13028
|
var MCP_BIN_DIR_ENV = `${RECIPE_ENV_PREFIX}MCP_BIN_DIR`;
|
|
12995
13029
|
function defaultMcpSessionPath(cwd) {
|
|
12996
|
-
return
|
|
13030
|
+
return join3(cwd, ".pi", "mcp-session.json");
|
|
12997
13031
|
}
|
|
12998
13032
|
function defaultMcporterConfigPath(cwd) {
|
|
12999
|
-
return
|
|
13033
|
+
return join3(cwd, ".pi", "mcporter.json");
|
|
13000
13034
|
}
|
|
13001
13035
|
function mcpSessionAllowsTool(server, toolName) {
|
|
13002
13036
|
return mcpSelectionAllowsTool(server.package_tools, toolName) && server.agent_tools.some(
|
|
@@ -13268,7 +13302,7 @@ function loadMcporterCli() {
|
|
|
13268
13302
|
if (mcporterCliPromise) return mcporterCliPromise;
|
|
13269
13303
|
const previousDisableAutorun = process.env.MCPORTER_DISABLE_AUTORUN;
|
|
13270
13304
|
process.env.MCPORTER_DISABLE_AUTORUN = "1";
|
|
13271
|
-
mcporterCliPromise = import("./cli-
|
|
13305
|
+
mcporterCliPromise = import("./cli-UQ5QXFXU.js").finally(() => {
|
|
13272
13306
|
if (previousDisableAutorun === void 0) {
|
|
13273
13307
|
delete process.env.MCPORTER_DISABLE_AUTORUN;
|
|
13274
13308
|
} else {
|
|
@@ -13279,7 +13313,13 @@ function loadMcporterCli() {
|
|
|
13279
13313
|
}
|
|
13280
13314
|
async function acquireRuntime() {
|
|
13281
13315
|
const shared = currentMcpCommandContext()?.runtime;
|
|
13282
|
-
return shared ? { runtime: shared, owned: false } : {
|
|
13316
|
+
return shared ? { runtime: shared, owned: false } : {
|
|
13317
|
+
runtime: await createMcpRuntime(
|
|
13318
|
+
mcpCommandEnv().MCPORTER_CONFIG,
|
|
13319
|
+
mcpCommandEnv()
|
|
13320
|
+
),
|
|
13321
|
+
owned: true
|
|
13322
|
+
};
|
|
13283
13323
|
}
|
|
13284
13324
|
async function closeOwnedRuntime(runtime, owned) {
|
|
13285
13325
|
if (owned) await runtime.close();
|
|
@@ -13328,13 +13368,13 @@ function isHelpArg(value) {
|
|
|
13328
13368
|
function readStdin() {
|
|
13329
13369
|
const source = currentMcpCommandContext()?.stdin ?? input;
|
|
13330
13370
|
source.setEncoding("utf8");
|
|
13331
|
-
return new Promise((
|
|
13371
|
+
return new Promise((resolve3, reject) => {
|
|
13332
13372
|
let data = "";
|
|
13333
13373
|
source.on("data", (chunk) => {
|
|
13334
13374
|
data += chunk;
|
|
13335
13375
|
});
|
|
13336
13376
|
source.on("error", reject);
|
|
13337
|
-
source.on("end", () =>
|
|
13377
|
+
source.on("end", () => resolve3(data));
|
|
13338
13378
|
});
|
|
13339
13379
|
}
|
|
13340
13380
|
function checkedCallResult(callResult) {
|
|
@@ -13403,7 +13443,7 @@ var ToolCallQueue = class {
|
|
|
13403
13443
|
return Promise.resolve(this.releaseHandle());
|
|
13404
13444
|
}
|
|
13405
13445
|
return new Promise(
|
|
13406
|
-
(
|
|
13446
|
+
(resolve3, reject) => this.waiting.push({ resolve: resolve3, reject })
|
|
13407
13447
|
);
|
|
13408
13448
|
}
|
|
13409
13449
|
cancel(error) {
|
|
@@ -13543,17 +13583,17 @@ async function readSession() {
|
|
|
13543
13583
|
}
|
|
13544
13584
|
function sessionPolicyPath() {
|
|
13545
13585
|
const workspacePath = defaultMcpSessionPath(sessionRoot());
|
|
13546
|
-
return existsSync(workspacePath) ? workspacePath :
|
|
13586
|
+
return existsSync(workspacePath) ? workspacePath : mcpCommandEnv()[MCP_SESSION_ENV2] || workspacePath;
|
|
13547
13587
|
}
|
|
13548
13588
|
function sessionMcporterConfigPath() {
|
|
13549
13589
|
const workspacePath = defaultMcporterConfigPath(sessionRoot());
|
|
13550
|
-
return existsSync(workspacePath) ? workspacePath :
|
|
13590
|
+
return existsSync(workspacePath) ? workspacePath : mcpCommandEnv().MCPORTER_CONFIG || workspacePath;
|
|
13551
13591
|
}
|
|
13552
13592
|
function sessionRoot() {
|
|
13553
|
-
return
|
|
13593
|
+
return mcpCommandEnv().PI_RECIPES_MCP_SESSION_ROOT || process.cwd();
|
|
13554
13594
|
}
|
|
13555
13595
|
function pinSessionMcporterConfig() {
|
|
13556
|
-
|
|
13596
|
+
mcpCommandEnv().MCPORTER_CONFIG = sessionMcporterConfigPath();
|
|
13557
13597
|
}
|
|
13558
13598
|
async function sessionCliPolicy() {
|
|
13559
13599
|
return createMcpCliSessionPolicy(await readSession());
|
|
@@ -13569,7 +13609,7 @@ function catalogFingerprint(server) {
|
|
|
13569
13609
|
).digest("hex").slice(0, 20);
|
|
13570
13610
|
}
|
|
13571
13611
|
function catalogCachePath(server) {
|
|
13572
|
-
return
|
|
13612
|
+
return join4(
|
|
13573
13613
|
sessionRoot(),
|
|
13574
13614
|
".pi",
|
|
13575
13615
|
"mcp-catalogs",
|
|
@@ -13588,7 +13628,7 @@ async function readCachedCatalog(server) {
|
|
|
13588
13628
|
}
|
|
13589
13629
|
}
|
|
13590
13630
|
async function writeCachedCatalog(server, tools) {
|
|
13591
|
-
const directory =
|
|
13631
|
+
const directory = join4(sessionRoot(), ".pi", "mcp-catalogs");
|
|
13592
13632
|
await mkdir(directory, { recursive: true });
|
|
13593
13633
|
const path2 = catalogCachePath(server);
|
|
13594
13634
|
const temporary = `${path2}.${process.pid}.${randomUUID()}.tmp`;
|
|
@@ -13655,7 +13695,7 @@ async function discoverServerCatalog(runtime, server, timeoutMs) {
|
|
|
13655
13695
|
const cached = await readCachedCatalog(server);
|
|
13656
13696
|
if (cached) return cached;
|
|
13657
13697
|
const lock = `${catalogCachePath(server)}.lock`;
|
|
13658
|
-
await mkdir(
|
|
13698
|
+
await mkdir(dirname3(lock), { recursive: true });
|
|
13659
13699
|
let ownsLock = false;
|
|
13660
13700
|
const deadline = Date.now() + timeoutMs;
|
|
13661
13701
|
while (!ownsLock && Date.now() < deadline) {
|
|
@@ -13887,7 +13927,7 @@ function toolCount(count) {
|
|
|
13887
13927
|
return `${count} tool${count === 1 ? "" : "s"}`;
|
|
13888
13928
|
}
|
|
13889
13929
|
function parseListTimeoutMs(args) {
|
|
13890
|
-
const configured =
|
|
13930
|
+
const configured = mcpCommandEnv().MCPORTER_LIST_TIMEOUT;
|
|
13891
13931
|
let raw = configured && /^[1-9]\d*$/.test(configured) ? configured : String(DEFAULT_LIST_TIMEOUT_MS);
|
|
13892
13932
|
const { values } = parseArgs2({
|
|
13893
13933
|
args: [...args.slice(1)],
|
|
@@ -13908,7 +13948,7 @@ function parseListTimeoutMs(args) {
|
|
|
13908
13948
|
return Number.isSafeInteger(timeout) ? timeout : "mcp list: --timeout must be a positive integer (milliseconds).";
|
|
13909
13949
|
}
|
|
13910
13950
|
function withListTimeout(promise, timeoutMs) {
|
|
13911
|
-
return new Promise((
|
|
13951
|
+
return new Promise((resolve3, reject) => {
|
|
13912
13952
|
const timer = setTimeout(
|
|
13913
13953
|
() => reject(new Error(`timed out after ${timeoutMs}ms`)),
|
|
13914
13954
|
timeoutMs
|
|
@@ -13916,7 +13956,7 @@ function withListTimeout(promise, timeoutMs) {
|
|
|
13916
13956
|
promise.then(
|
|
13917
13957
|
(value) => {
|
|
13918
13958
|
clearTimeout(timer);
|
|
13919
|
-
|
|
13959
|
+
resolve3(value);
|
|
13920
13960
|
},
|
|
13921
13961
|
(error) => {
|
|
13922
13962
|
clearTimeout(timer);
|
|
@@ -14415,22 +14455,22 @@ function positiveInteger(value, label, fallback) {
|
|
|
14415
14455
|
}
|
|
14416
14456
|
async function runMcpJavaScript(code, opts = {}) {
|
|
14417
14457
|
const timeoutMs = positiveInteger(
|
|
14418
|
-
opts.timeoutMs ??
|
|
14458
|
+
opts.timeoutMs ?? mcpCommandEnv().PI_RECIPES_MCP_RUN_TIMEOUT_MS,
|
|
14419
14459
|
"PI_RECIPES_MCP_RUN_TIMEOUT_MS",
|
|
14420
14460
|
DEFAULT_RUN_TIMEOUT_MS
|
|
14421
14461
|
);
|
|
14422
14462
|
const callTimeoutMs = positiveInteger(
|
|
14423
|
-
opts.callTimeoutMs ??
|
|
14463
|
+
opts.callTimeoutMs ?? mcpCommandEnv().PI_RECIPES_MCP_RUN_CALL_TIMEOUT_MS,
|
|
14424
14464
|
"PI_RECIPES_MCP_RUN_CALL_TIMEOUT_MS",
|
|
14425
14465
|
Math.min(DEFAULT_TOOL_CALL_TIMEOUT_MS, timeoutMs)
|
|
14426
14466
|
);
|
|
14427
14467
|
const maxCalls = positiveInteger(
|
|
14428
|
-
opts.maxCalls ??
|
|
14468
|
+
opts.maxCalls ?? mcpCommandEnv().PI_RECIPES_MCP_RUN_MAX_CALLS,
|
|
14429
14469
|
"PI_RECIPES_MCP_RUN_MAX_CALLS",
|
|
14430
14470
|
DEFAULT_MAX_RUN_TOOL_CALLS
|
|
14431
14471
|
);
|
|
14432
14472
|
const maxConcurrentCalls = positiveInteger(
|
|
14433
|
-
opts.maxConcurrentCalls ??
|
|
14473
|
+
opts.maxConcurrentCalls ?? mcpCommandEnv().PI_RECIPES_MCP_RUN_MAX_CONCURRENCY,
|
|
14434
14474
|
"PI_RECIPES_MCP_RUN_MAX_CONCURRENCY",
|
|
14435
14475
|
DEFAULT_MAX_CONCURRENT_TOOL_CALLS
|
|
14436
14476
|
);
|
|
@@ -14484,8 +14524,8 @@ async function runMcpJavaScript(code, opts = {}) {
|
|
|
14484
14524
|
try {
|
|
14485
14525
|
await Promise.race([
|
|
14486
14526
|
Promise.allSettled(unsafeAtExit.map((call) => call.promise)),
|
|
14487
|
-
new Promise((
|
|
14488
|
-
settleTimer = setTimeout(
|
|
14527
|
+
new Promise((resolve3) => {
|
|
14528
|
+
settleTimer = setTimeout(resolve3, remainingSettleMs);
|
|
14489
14529
|
})
|
|
14490
14530
|
]);
|
|
14491
14531
|
} finally {
|
|
@@ -14569,7 +14609,10 @@ async function runCode(args) {
|
|
|
14569
14609
|
stderr.write("mcp run accepts at most one file path.\n");
|
|
14570
14610
|
return 2;
|
|
14571
14611
|
}
|
|
14572
|
-
const code = file ? await readFile(
|
|
14612
|
+
const code = file ? await readFile(
|
|
14613
|
+
resolve2(mcpCommandEnv()[MCP_SESSION_ROOT_ENV] || process.cwd(), file),
|
|
14614
|
+
"utf8"
|
|
14615
|
+
) : await readStdin();
|
|
14573
14616
|
if (!code.trim()) {
|
|
14574
14617
|
stderr.write(
|
|
14575
14618
|
"mcp run: empty script. Pass a file path or pipe JavaScript on stdin (see `mcp run --help`).\n"
|
|
@@ -14579,7 +14622,7 @@ async function runCode(args) {
|
|
|
14579
14622
|
let timeoutMs;
|
|
14580
14623
|
try {
|
|
14581
14624
|
timeoutMs = positiveInteger(
|
|
14582
|
-
|
|
14625
|
+
mcpCommandEnv().PI_RECIPES_MCP_RUN_TIMEOUT_MS,
|
|
14583
14626
|
"PI_RECIPES_MCP_RUN_TIMEOUT_MS",
|
|
14584
14627
|
DEFAULT_RUN_TIMEOUT_MS
|
|
14585
14628
|
);
|
|
@@ -14696,7 +14739,7 @@ async function callWithMcporter(args) {
|
|
|
14696
14739
|
let owned = false;
|
|
14697
14740
|
try {
|
|
14698
14741
|
({ runtime, owned } = await acquireRuntime());
|
|
14699
|
-
if (usesPiMcpClient() || args.includes("--help") || args.includes("-h"))
|
|
14742
|
+
if (usesPiMcpClient(mcpCommandEnv()) || args.includes("--help") || args.includes("-h"))
|
|
14700
14743
|
return await callWithSharedRuntime(runtime, args);
|
|
14701
14744
|
const words2 = takeOptions(args.slice(1), CALL_OPTIONS).rest;
|
|
14702
14745
|
try {
|
|
@@ -14811,7 +14854,7 @@ async function callWithSharedRuntime(runtime, args) {
|
|
|
14811
14854
|
const result = createCallResult(raw);
|
|
14812
14855
|
const rendered = selectCallOutput(result, raw, options2.output);
|
|
14813
14856
|
const serialized = serializeCallOutput(rendered, options2.output);
|
|
14814
|
-
const configuredLimit =
|
|
14857
|
+
const configuredLimit = mcpCommandEnv().PI_RECIPES_MCP_MAX_OUTPUT_BYTES;
|
|
14815
14858
|
if (configuredLimit !== void 0) {
|
|
14816
14859
|
const limit = Number(configuredLimit);
|
|
14817
14860
|
if (!Number.isSafeInteger(limit) || limit <= 0) {
|
|
@@ -15039,12 +15082,14 @@ async function executeMcpCommand(opts) {
|
|
|
15039
15082
|
|
|
15040
15083
|
export {
|
|
15041
15084
|
context,
|
|
15085
|
+
runWithMcpCommandEnv,
|
|
15042
15086
|
installMcpCommandIoRouting,
|
|
15043
15087
|
MCP_DAEMON_SOCKET_ENV,
|
|
15044
15088
|
MCP_DAEMON_TOKEN_ENV,
|
|
15045
15089
|
MCP_DAEMON_FINGERPRINT_ENV,
|
|
15046
15090
|
MCP_DAEMON_PARENT_PID_ENV,
|
|
15047
15091
|
MCP_DAEMON_MAX_FRAME_BYTES,
|
|
15092
|
+
isMcpDaemonSocketDirectory,
|
|
15048
15093
|
serializeMcpDaemonEnvelope,
|
|
15049
15094
|
mcpDaemonRequestContext,
|
|
15050
15095
|
discoverMcpCatalogs,
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
launchDaemonDetached
|
|
4
|
-
} from "./chunk-B6S43WID.js";
|
|
5
2
|
import {
|
|
6
3
|
BrokerError,
|
|
7
4
|
DAEMON_PROTOCOL_VERSION,
|
|
@@ -20,12 +17,12 @@ import {
|
|
|
20
17
|
resolveProgressInterval,
|
|
21
18
|
stopVerifiedLegacyDaemons,
|
|
22
19
|
waitForDaemonReady
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MYAMG6VL.js";
|
|
24
21
|
import {
|
|
25
22
|
canonicalUserConfiguration,
|
|
26
23
|
getDaemonLogPath,
|
|
27
24
|
secureDaemonDirectory
|
|
28
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ORJND4AI.js";
|
|
29
26
|
import {
|
|
30
27
|
ChromeDevtoolsRelayDiscoveryError
|
|
31
28
|
} from "./chunk-6O42UGLI.js";
|
|
@@ -36,6 +33,9 @@ import {
|
|
|
36
33
|
import {
|
|
37
34
|
expandHome
|
|
38
35
|
} from "./chunk-BHXCAVFP.js";
|
|
36
|
+
import {
|
|
37
|
+
launchDaemonDetached
|
|
38
|
+
} from "./chunk-B6S43WID.js";
|
|
39
39
|
|
|
40
40
|
// node_modules/.pnpm/mcporter@0.16.1/node_modules/mcporter/dist/cli/daemon-command.js
|
|
41
41
|
import fsPromises from "node:fs/promises";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
createRuntime
|
|
4
|
-
} from "./chunk-36D4FILJ.js";
|
|
5
2
|
|
|
6
3
|
// src/mcp/pi-runtime.ts
|
|
7
4
|
import { readFileSync } from "node:fs";
|
|
@@ -16,11 +13,16 @@ function piMcpServes(configPath) {
|
|
|
16
13
|
(server) => server.auth === "oauth" || server.httpFetch === "node-http1"
|
|
17
14
|
);
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
function mcpRuntimeKind(configPath = process.env.MCPORTER_CONFIG, env = process.env) {
|
|
17
|
+
return usesPiMcpClient(env) && piMcpServes(configPath) ? "pi-mcp" : "mcporter";
|
|
18
|
+
}
|
|
19
|
+
async function createMcpRuntime(configPath = process.env.MCPORTER_CONFIG, env = process.env) {
|
|
20
|
+
if (mcpRuntimeKind(configPath, env) === "pi-mcp")
|
|
21
|
+
return (await import("./pi-mcp-runtime-OLO25D7A.js")).PiMcpRuntime.fromConfigFile(
|
|
22
|
+
configPath,
|
|
23
|
+
env
|
|
23
24
|
);
|
|
25
|
+
const { createRuntime } = await import("./dist-SDPPH7XQ.js");
|
|
24
26
|
return await createRuntime(configPath ? { configPath } : {});
|
|
25
27
|
}
|
|
26
28
|
|