@introspection-ai/recipes 0.18.0 → 0.19.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.
Files changed (146) hide show
  1. package/dist/inspect.d.ts +1 -0
  2. package/dist/inspect.d.ts.map +1 -1
  3. package/dist/inspect.js +3 -0
  4. package/dist/inspect.js.map +1 -1
  5. package/dist/mcp-chunks/{auth-command-ZLGYIEUY.js → auth-command-3K7V3VCW.js} +31 -35
  6. package/dist/mcp-chunks/call-arguments-TX3F2TEE.js +15 -0
  7. package/dist/mcp-chunks/{call-command-LKTKSYTH.js → call-command-OFPHPFM5.js} +36 -34
  8. package/dist/mcp-chunks/chunk-2FSDGCHW.js +3299 -0
  9. package/dist/mcp-chunks/{chunk-BV56DXPW.js → chunk-2JHHONW4.js} +1 -1
  10. package/dist/mcp-chunks/chunk-2MEHGB7D.js +63 -0
  11. package/dist/mcp-chunks/chunk-3IZQW4H4.js +929 -0
  12. package/dist/mcp-chunks/{chunk-MZ2NARG7.js → chunk-54EWGONA.js} +5 -5
  13. package/dist/mcp-chunks/{chunk-LQQEYD76.js → chunk-55JIHDU3.js} +1 -1
  14. package/dist/mcp-chunks/chunk-64EP2BVO.js +39 -0
  15. package/dist/mcp-chunks/{chunk-LS7PMWSR.js → chunk-6D6KPSXN.js} +1 -1
  16. package/dist/mcp-chunks/{chunk-2XL7MG7R.js → chunk-7A63PAGP.js} +15 -9
  17. package/dist/mcp-chunks/chunk-7DH57OKF.js +28 -0
  18. package/dist/mcp-chunks/{chunk-BTLAWHTA.js → chunk-7RDLPFIO.js} +2 -2
  19. package/dist/mcp-chunks/chunk-C2PQFLWS.js +422 -0
  20. package/dist/mcp-chunks/chunk-CA5WFJZA.js +197 -0
  21. package/dist/mcp-chunks/{chunk-LNH5LAJD.js → chunk-CNDY7WB4.js} +2 -2
  22. package/dist/mcp-chunks/{chunk-UKYNQGNE.js → chunk-DEUU7WSN.js} +34 -8
  23. package/dist/mcp-chunks/{chunk-LKIBAYKU.js → chunk-DXPHJFSA.js} +25 -35
  24. package/dist/mcp-chunks/{chunk-J6LYIZXN.js → chunk-E6RVTWJY.js} +1 -1
  25. package/dist/mcp-chunks/{chunk-7FHEBT5G.js → chunk-E6T37ED6.js} +18 -13
  26. package/dist/mcp-chunks/chunk-ETWN4IIA.js +57 -0
  27. package/dist/mcp-chunks/{chunk-YVZKMV5H.js → chunk-F3LL4EBL.js} +1 -1
  28. package/dist/mcp-chunks/chunk-FWP4RACK.js +42 -0
  29. package/dist/mcp-chunks/{chunk-6W5QFASN.js → chunk-GFYTST6N.js} +1 -1
  30. package/dist/mcp-chunks/{chunk-TEUKFFQL.js → chunk-GIF7LOYU.js} +2 -2
  31. package/dist/mcp-chunks/{chunk-QXJUA3ND.js → chunk-GSZOK5TS.js} +828 -7
  32. package/dist/mcp-chunks/chunk-H7F5RZXS.js +26 -0
  33. package/dist/mcp-chunks/{chunk-ECIVB7P4.js → chunk-HAO6PL7Z.js} +2 -37
  34. package/dist/mcp-chunks/{chunk-WQJZMCJN.js → chunk-HTZ2URXW.js} +5 -3
  35. package/dist/mcp-chunks/{chunk-BWHIA4PC.js → chunk-JAKI24KR.js} +1 -1
  36. package/dist/mcp-chunks/{chunk-PWYFKGKG.js → chunk-KSGYBW3F.js} +180 -89
  37. package/dist/mcp-chunks/{chunk-SJCCBNZ4.js → chunk-KSMY7PXI.js} +1 -1
  38. package/dist/mcp-chunks/{chunk-2U4BSDC4.js → chunk-L4VKBFYI.js} +48 -29
  39. package/dist/mcp-chunks/{chunk-LEZSACDE.js → chunk-LICH4Q7A.js} +4 -4
  40. package/dist/mcp-chunks/{chunk-PIIYJR44.js → chunk-LNSUME65.js} +29 -33
  41. package/dist/mcp-chunks/{chunk-D3MRAZ6H.js → chunk-LWVFSQYX.js} +13974 -15562
  42. package/dist/mcp-chunks/{chunk-7KA2VJVZ.js → chunk-NCXEJ35U.js} +10 -5
  43. package/dist/mcp-chunks/{chunk-5QOSCSQB.js → chunk-NZOIX6XW.js} +2 -2
  44. package/dist/mcp-chunks/{chunk-XANPGTLI.js → chunk-P3RN22HQ.js} +11 -4
  45. package/dist/mcp-chunks/{chunk-IABRYROW.js → chunk-PKOJCYNA.js} +3 -3
  46. package/dist/mcp-chunks/{chunk-BNV3TPE4.js → chunk-QJACOI2W.js} +5 -13
  47. package/dist/mcp-chunks/{chunk-UNKB4SBV.js → chunk-RBVYCKCD.js} +2 -2
  48. package/dist/mcp-chunks/{chunk-DHBE7UBH.js → chunk-SB2UUURE.js} +12 -42
  49. package/dist/mcp-chunks/{chunk-4SQKWYFF.js → chunk-SFREPU3D.js} +1 -1
  50. package/dist/mcp-chunks/{chunk-BZIQOWE6.js → chunk-SRZZQ6TL.js} +35 -36
  51. package/dist/mcp-chunks/{chunk-M3TPODXI.js → chunk-UENXT3NE.js} +1 -1
  52. package/dist/mcp-chunks/chunk-UHOKCTZT.js +37 -0
  53. package/dist/mcp-chunks/{chunk-E22DYOW5.js → chunk-WWO5WGH5.js} +5 -5
  54. package/dist/mcp-chunks/{chunk-6XCZGU3G.js → chunk-WXBPMFSN.js} +149 -192
  55. package/dist/mcp-chunks/{chunk-XQK2JSW4.js → chunk-XRGLP3Z2.js} +14 -2
  56. package/dist/mcp-chunks/{chunk-L7NTQVYN.js → chunk-XTL4MHFH.js} +28 -10
  57. package/dist/mcp-chunks/{chunk-N46NEFAF.js → chunk-XUF6KARU.js} +1 -1
  58. package/dist/mcp-chunks/{chunk-WD6BOD24.js → chunk-YCYSQA5V.js} +23 -4
  59. package/dist/mcp-chunks/chunk-YPJ5EHXR.js +17394 -0
  60. package/dist/mcp-chunks/{chunk-NRAJX5E4.js → chunk-YSPT6F7K.js} +3 -3
  61. package/dist/mcp-chunks/{chunk-7UDVSOOF.js → chunk-YTKRAHO6.js} +54 -46
  62. package/dist/mcp-chunks/chunk-ZBFZ5UFE.js +67 -0
  63. package/dist/mcp-chunks/{cli-UV4QJZZM.js → cli-E4P6SZLQ.js} +89 -76
  64. package/dist/mcp-chunks/client-2EJC4PLL.js +18 -0
  65. package/dist/mcp-chunks/{config-command-NLAGKID5.js → config-command-MWF3RHPQ.js} +38 -59
  66. package/dist/mcp-chunks/daemon-command-6CJ26MKI.js +33 -0
  67. package/dist/mcp-chunks/{dist-LK3SHAMX.js → dist-ZIPUENTM.js} +527 -469
  68. package/dist/mcp-chunks/{emit-ts-command-VBXVXO6V.js → emit-ts-command-GOVJJ64A.js} +16 -13
  69. package/dist/mcp-chunks/{generate-cli-runner-6CAZZA3P.js → generate-cli-runner-L5OQIMEY.js} +242 -247
  70. package/dist/mcp-chunks/{inspect-cli-command-3ZORTOR7.js → inspect-cli-command-7OMMREPE.js} +10 -9
  71. package/dist/mcp-chunks/{launch-YKRXHXJI.js → launch-BWXPLPB7.js} +1 -1
  72. package/dist/mcp-chunks/{lifecycle-XVKRHPH3.js → lifecycle-B5UC65PT.js} +1 -1
  73. package/dist/mcp-chunks/{list-command-2MEGGNFQ.js → list-command-ZO4HVFQK.js} +74 -43
  74. package/dist/mcp-chunks/{output-utils-NKESLAJ6.js → output-utils-M3TJ2N4M.js} +3 -3
  75. package/dist/mcp-chunks/{prompt-B1Yc1NPt-VGOTWJMN.js → prompt-CH6TK0bC-C7OTKGRD.js} +1 -3
  76. package/dist/mcp-chunks/{record-command-YXHTTTT5.js → record-command-VD3HUQIC.js} +5 -4
  77. package/dist/mcp-chunks/replay-command-AX6IN7YD.js +42 -0
  78. package/dist/mcp-chunks/{resource-command-OO4NYF5C.js → resource-command-JEZ2DW2G.js} +10 -10
  79. package/dist/mcp-chunks/{result-utils-MOHHLNM7.js → result-utils-3YHYGS45.js} +4 -4
  80. package/dist/mcp-chunks/runtime-HSYVOME7.js +37 -0
  81. package/dist/mcp-chunks/{runtime-wrapper-RPWDIDBF.js → runtime-wrapper-UREU7GC3.js} +7 -3
  82. package/dist/mcp-chunks/serve-command-M47YZ6JN.js +16018 -0
  83. package/dist/mcp-chunks/{timeouts-W2XWCCXR.js → timeouts-THZRYP4B.js} +3 -1
  84. package/dist/mcp-chunks/{vault-command-PIYIUEZL.js → vault-command-53P7MLCB.js} +7 -6
  85. package/dist/mcp-chunks/webapi-PHEQZQKH.js +3316 -0
  86. package/dist/mcp-client.js +11 -1
  87. package/dist/mcp-client.js.map +1 -1
  88. package/dist/mcp-daemon-client.d.ts.map +1 -1
  89. package/dist/mcp-daemon-client.js +3 -0
  90. package/dist/mcp-daemon-client.js.map +1 -1
  91. package/dist/mcp-daemon-protocol.d.ts +6 -0
  92. package/dist/mcp-daemon-protocol.d.ts.map +1 -1
  93. package/dist/mcp-daemon-protocol.js.map +1 -1
  94. package/dist/mcp-daemon.js +43 -22
  95. package/dist/mcp-daemon.js.map +1 -1
  96. package/dist/mcp-run-worker.js +29 -22
  97. package/dist/mcp-trace-context.d.ts +6 -0
  98. package/dist/mcp-trace-context.d.ts.map +1 -0
  99. package/dist/mcp-trace-context.js +31 -0
  100. package/dist/mcp-trace-context.js.map +1 -0
  101. package/dist/model-binding.d.ts.map +1 -1
  102. package/dist/model-binding.js +8 -4
  103. package/dist/model-binding.js.map +1 -1
  104. package/dist/pi-extension.d.ts.map +1 -1
  105. package/dist/pi-extension.js +12 -0
  106. package/dist/pi-extension.js.map +1 -1
  107. package/dist/recipe/resolve.d.ts +2 -0
  108. package/dist/recipe/resolve.d.ts.map +1 -1
  109. package/dist/recipe/resolve.js +2 -1
  110. package/dist/recipe/resolve.js.map +1 -1
  111. package/dist/recipe-agent.d.ts +5 -2
  112. package/dist/recipe-agent.d.ts.map +1 -1
  113. package/dist/recipe-agent.js +20 -4
  114. package/dist/recipe-agent.js.map +1 -1
  115. package/dist/recipe-model.d.ts +7 -1
  116. package/dist/recipe-model.d.ts.map +1 -1
  117. package/dist/recipe-model.js +89 -20
  118. package/dist/recipe-model.js.map +1 -1
  119. package/dist/recipe-session.d.ts +14 -0
  120. package/dist/recipe-session.d.ts.map +1 -0
  121. package/dist/recipe-session.js +181 -0
  122. package/dist/recipe-session.js.map +1 -0
  123. package/dist/session.d.ts.map +1 -1
  124. package/dist/session.js +23 -1
  125. package/dist/session.js.map +1 -1
  126. package/docs/agent-composition.md +46 -22
  127. package/docs/pi-extension.md +9 -3
  128. package/docs/recipe-format.md +41 -5
  129. package/package.json +7 -7
  130. package/vendor/introspection-recipe-check/darwin-arm64/introspection-recipe-check +0 -0
  131. package/vendor/introspection-recipe-check/darwin-x64/introspection-recipe-check +0 -0
  132. package/vendor/introspection-recipe-check/linux-arm64/introspection-recipe-check +0 -0
  133. package/vendor/introspection-recipe-check/linux-x64/introspection-recipe-check +0 -0
  134. package/vendor/introspection-recipe-check/linux-x64-musl/introspection-recipe-check +0 -0
  135. package/vendor/introspection-recipe-check/win32-x64/introspection-recipe-check.exe +0 -0
  136. package/dist/mcp-chunks/call-arguments-LU3W6D3K.js +0 -13
  137. package/dist/mcp-chunks/chunk-HKRJ6O36.js +0 -1076
  138. package/dist/mcp-chunks/chunk-NNOEGEUZ.js +0 -17273
  139. package/dist/mcp-chunks/chunk-P3PSC54P.js +0 -869
  140. package/dist/mcp-chunks/chunk-TATVT5IT.js +0 -194
  141. package/dist/mcp-chunks/chunk-YHQUTU6L.js +0 -571
  142. package/dist/mcp-chunks/client-S7RQUG5U.js +0 -13
  143. package/dist/mcp-chunks/daemon-command-U242Z6VY.js +0 -26
  144. package/dist/mcp-chunks/replay-command-25HJ6AQU.js +0 -85
  145. package/dist/mcp-chunks/runtime-5WJ3G25Y.js +0 -33
  146. package/dist/mcp-chunks/serve-command-DHXJZMMN.js +0 -3302
@@ -1,11 +1,11 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
2
 
3
- // node_modules/.pnpm/mcporter@0.12.3/node_modules/mcporter/dist/daemon/launch.js
3
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/daemon/launch.js
4
4
  import { spawn } from "node:child_process";
5
5
  import path from "node:path";
6
- function launchDaemonDetached(options) {
6
+ function launchDaemonDetached(options, launch = spawn) {
7
7
  const invocation = buildDaemonLaunchInvocation(options);
8
- const child = spawn(invocation.command, invocation.args, {
8
+ const child = launch(invocation.command, invocation.args, {
9
9
  detached: true,
10
10
  stdio: "ignore",
11
11
  env: invocation.env
@@ -1,76 +1,45 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  buildRecordCommandEnv
4
- } from "./chunk-J6LYIZXN.js";
4
+ } from "./chunk-E6RVTWJY.js";
5
5
  import {
6
6
  PRIVATE_RECORDING_FILE_MODE,
7
7
  ensurePrivateRecordingDir,
8
8
  resolveRecordingConfigPath,
9
9
  resolveRecordingPath
10
- } from "./chunk-7FHEBT5G.js";
10
+ } from "./chunk-E6T37ED6.js";
11
11
 
12
- // node_modules/.pnpm/mcporter@0.12.3/node_modules/mcporter/dist/cli/record-command.js
12
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/cli/record-replay-command.js
13
13
  import { spawn } from "node:child_process";
14
14
  import fs from "node:fs/promises";
15
- async function handleRecordCli(args) {
16
- const parsed = parseRecordArgs(args);
17
- const recordPath = resolveRecordingPath(parsed.sessionName);
18
- if (parsed.command.length > 0) {
19
- await runWithRecordingEnv(parsed, buildRecordCommandEnv(parsed.sessionName, parsed.server));
20
- return;
21
- }
22
- await writeModeConfig(parsed, {
23
- mode: "record",
24
- recordPath,
25
- env: {
26
- MCPORTER_RECORD: parsed.sessionName,
27
- ...parsed.server ? { MCPORTER_RECORD_SERVER: parsed.server } : {},
28
- MCPORTER_DISABLE_KEEPALIVE: "*"
29
- }
30
- });
31
- console.log(`Recording configuration written to ${resolveRecordingConfigPath(parsed.sessionName)}`);
32
- const envInstructions = [
33
- `MCPORTER_RECORD=${parsed.sessionName}`,
34
- ...parsed.server ? [`MCPORTER_RECORD_SERVER=${parsed.server}`] : [],
35
- "MCPORTER_DISABLE_KEEPALIVE=*"
36
- ];
37
- console.log(`Set ${envInstructions.join(" and ")} before the next mcporter call to record ${recordPath}.`);
38
- }
39
- function printRecordHelp() {
40
- console.log(`Usage: mcporter record <session-name> [--server <name>] [-- <command-to-run>]
41
-
42
- Capture MCP JSON-RPC traffic to ~/.mcporter/recordings/<session-name>.ndjson.
43
-
44
- Flags:
45
- --server <name> Restrict recording to one configured server.`);
46
- }
47
- function parseRecordArgs(args) {
48
- return parseSessionCommandArgs(args, "record");
49
- }
50
- function parseReplayArgs(args) {
51
- return parseSessionCommandArgs(args, "replay");
52
- }
53
- async function writeModeConfig(parsed, extra) {
15
+ async function writeRecordReplayConfig(parsed, mode) {
54
16
  const configPath = resolveRecordingConfigPath(parsed.sessionName);
17
+ const recordingPath = resolveRecordingPath(parsed.sessionName);
55
18
  await ensurePrivateRecordingDir(configPath);
56
19
  await fs.writeFile(configPath, `${JSON.stringify({
57
20
  session: parsed.sessionName,
58
21
  server: parsed.server,
59
- ...extra
22
+ mode,
23
+ ...mode === "record" ? { recordPath: recordingPath } : { replayPath: recordingPath },
24
+ env: buildRecordReplayInstructionEnv(mode, parsed.sessionName, parsed.server)
60
25
  }, null, 2)}
61
26
  `, {
62
27
  encoding: "utf8",
63
28
  mode: PRIVATE_RECORDING_FILE_MODE
64
29
  });
65
30
  await fs.chmod(configPath, PRIVATE_RECORDING_FILE_MODE);
31
+ return configPath;
32
+ }
33
+ function buildRecordReplayInstructions(mode, sessionName, server) {
34
+ return Object.entries(buildRecordReplayInstructionEnv(mode, sessionName, server)).map(([key, value]) => `${key}=${value}`);
66
35
  }
67
- async function runWithRecordingEnv(parsed, env) {
68
- const [command, ...commandArgs] = parsed.command;
36
+ async function runRecordReplayCommand(commandAndArgs, env) {
37
+ const [command, ...args] = commandAndArgs;
69
38
  if (!command) {
70
39
  return;
71
40
  }
72
41
  await new Promise((resolve, reject) => {
73
- const child = spawn(command, commandArgs, {
42
+ const child = spawn(command, args, {
74
43
  stdio: "inherit",
75
44
  env
76
45
  });
@@ -85,6 +54,42 @@ async function runWithRecordingEnv(parsed, env) {
85
54
  });
86
55
  });
87
56
  }
57
+ function buildRecordReplayInstructionEnv(mode, sessionName, server) {
58
+ const prefix = mode === "record" ? "MCPORTER_RECORD" : "MCPORTER_REPLAY";
59
+ return {
60
+ [prefix]: sessionName,
61
+ ...server ? { [`${prefix}_SERVER`]: server } : {},
62
+ MCPORTER_DISABLE_KEEPALIVE: "*"
63
+ };
64
+ }
65
+
66
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/cli/record-command.js
67
+ async function handleRecordCli(args) {
68
+ const parsed = parseRecordArgs(args);
69
+ const recordPath = resolveRecordingPath(parsed.sessionName);
70
+ if (parsed.command.length > 0) {
71
+ await runRecordReplayCommand(parsed.command, buildRecordCommandEnv(parsed.sessionName, parsed.server));
72
+ return;
73
+ }
74
+ await writeRecordReplayConfig(parsed, "record");
75
+ console.log(`Recording configuration written to ${resolveRecordingConfigPath(parsed.sessionName)}`);
76
+ const envInstructions = buildRecordReplayInstructions("record", parsed.sessionName, parsed.server);
77
+ console.log(`Set ${envInstructions.join(" and ")} before the next mcporter call to record ${recordPath}.`);
78
+ }
79
+ function printRecordHelp() {
80
+ console.log(`Usage: mcporter record <session-name> [--server <name>] [-- <command-to-run>]
81
+
82
+ Capture MCP JSON-RPC traffic to ~/.mcporter/recordings/<session-name>.ndjson.
83
+
84
+ Flags:
85
+ --server <name> Restrict recording to one configured server.`);
86
+ }
87
+ function parseRecordArgs(args) {
88
+ return parseSessionCommandArgs(args, "record");
89
+ }
90
+ function parseReplayArgs(args) {
91
+ return parseSessionCommandArgs(args, "replay");
92
+ }
88
93
  function parseSessionCommandArgs(args, commandName) {
89
94
  let server;
90
95
  const tokens = [...args];
@@ -131,6 +136,9 @@ function parseSessionCommandArgs(args, commandName) {
131
136
  }
132
137
 
133
138
  export {
139
+ writeRecordReplayConfig,
140
+ buildRecordReplayInstructions,
141
+ runRecordReplayCommand,
134
142
  handleRecordCli,
135
143
  printRecordHelp,
136
144
  parseRecordArgs,
@@ -0,0 +1,67 @@
1
+ import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
+
3
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/daemon/protocol.js
4
+ var DAEMON_PROTOCOL_VERSION = 2;
5
+ var DAEMON_OPERATION_TIMEOUT_CODE = "operation_timeout";
6
+ var DAEMON_PROGRESS_INTERVAL_MS = 250;
7
+ function resolveProgressInterval(idleTimeoutMs) {
8
+ if (!Number.isFinite(idleTimeoutMs) || idleTimeoutMs <= 0) {
9
+ return DAEMON_PROGRESS_INTERVAL_MS;
10
+ }
11
+ return Math.min(DAEMON_PROGRESS_INTERVAL_MS, Math.max(1, Math.floor(idleTimeoutMs / 3)));
12
+ }
13
+ function isDaemonProgressFrame(frame) {
14
+ return frame.type === "progress";
15
+ }
16
+ function encodeDaemonFrame(frame) {
17
+ return `${JSON.stringify(frame)}
18
+ `;
19
+ }
20
+ var DaemonFrameDecoder = class {
21
+ buffer = "";
22
+ sawMalformedLine = false;
23
+ push(chunk) {
24
+ this.buffer += chunk;
25
+ const frames = [];
26
+ let newlineIndex = this.buffer.indexOf("\n");
27
+ while (newlineIndex !== -1) {
28
+ const line = this.buffer.slice(0, newlineIndex);
29
+ this.buffer = this.buffer.slice(newlineIndex + 1);
30
+ this.collect(line, frames);
31
+ newlineIndex = this.buffer.indexOf("\n");
32
+ }
33
+ return frames;
34
+ }
35
+ /** Flushes a final bare frame written by a protocol-v1 daemon. */
36
+ flush() {
37
+ const remainder = this.buffer;
38
+ this.buffer = "";
39
+ const frames = [];
40
+ this.collect(remainder, frames);
41
+ return frames;
42
+ }
43
+ get malformed() {
44
+ return this.sawMalformedLine;
45
+ }
46
+ collect(line, frames) {
47
+ const trimmed = line.trim();
48
+ if (!trimmed) {
49
+ return;
50
+ }
51
+ try {
52
+ frames.push(JSON.parse(trimmed));
53
+ } catch {
54
+ this.sawMalformedLine = true;
55
+ }
56
+ }
57
+ };
58
+
59
+ export {
60
+ DAEMON_PROTOCOL_VERSION,
61
+ DAEMON_OPERATION_TIMEOUT_CODE,
62
+ DAEMON_PROGRESS_INTERVAL_MS,
63
+ resolveProgressInterval,
64
+ isDaemonProgressFrame,
65
+ encodeDaemonFrame,
66
+ DaemonFrameDecoder
67
+ };
@@ -1,67 +1,76 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
3
  import {
4
+ consumeMatchingTokens,
4
5
  extractFlags
5
- } from "./chunk-XQK2JSW4.js";
6
+ } from "./chunk-XRGLP3Z2.js";
6
7
  import {
7
8
  isRecordReplayModeActive,
8
9
  isReplayModeActive
9
- } from "./chunk-J6LYIZXN.js";
10
+ } from "./chunk-E6RVTWJY.js";
10
11
  import {
11
12
  extractListFlags
12
- } from "./chunk-LEZSACDE.js";
13
+ } from "./chunk-LICH4Q7A.js";
13
14
  import {
14
15
  DEBUG_HANG,
15
16
  dumpActiveHandles,
16
17
  terminateChildProcesses
17
- } from "./chunk-BTLAWHTA.js";
18
+ } from "./chunk-7RDLPFIO.js";
18
19
  import {
19
20
  parseCallArguments
20
- } from "./chunk-PIIYJR44.js";
21
+ } from "./chunk-LNSUME65.js";
21
22
  import {
22
23
  CliUsageError
23
- } from "./chunk-BV56DXPW.js";
24
+ } from "./chunk-2JHHONW4.js";
24
25
  import {
25
26
  getActiveLogLevel,
26
27
  getActiveLogger,
27
28
  logError,
28
29
  logInfo,
29
30
  setLogLevel
30
- } from "./chunk-UNKB4SBV.js";
31
+ } from "./chunk-RBVYCKCD.js";
31
32
  import {
32
33
  chooseClosestIdentifier,
33
34
  renderIdentifierResolutionMessages
34
- } from "./chunk-BWHIA4PC.js";
35
+ } from "./chunk-JAKI24KR.js";
35
36
  import {
36
37
  boldText,
37
38
  dimText,
38
39
  extraDimText,
39
40
  supportsAnsiColor,
40
41
  yellowText
41
- } from "./chunk-N46NEFAF.js";
42
+ } from "./chunk-XUF6KARU.js";
42
43
  import {
43
44
  parsePositiveInteger,
44
45
  resolveCallTimeout
45
- } from "./chunk-BNV3TPE4.js";
46
- import "./chunk-LQQEYD76.js";
46
+ } from "./chunk-QJACOI2W.js";
47
+ import "./chunk-55JIHDU3.js";
47
48
  import {
48
49
  looksLikeHttpUrl,
49
50
  splitHttpToolSelector
50
- } from "./chunk-M3TPODXI.js";
51
- import "./chunk-YVZKMV5H.js";
51
+ } from "./chunk-UENXT3NE.js";
52
+ import "./chunk-F3LL4EBL.js";
53
+ import {
54
+ configureAutoSelectFamilyAttemptTimeout
55
+ } from "./chunk-64EP2BVO.js";
56
+ import {
57
+ createInteractiveElicitationResponder
58
+ } from "./chunk-CA5WFJZA.js";
52
59
  import {
53
60
  MCPORTER_VERSION
54
- } from "./chunk-4SQKWYFF.js";
61
+ } from "./chunk-SFREPU3D.js";
55
62
  import {
56
63
  parseLogLevel
57
- } from "./chunk-6W5QFASN.js";
64
+ } from "./chunk-GFYTST6N.js";
65
+ import "./chunk-ETWN4IIA.js";
58
66
  import {
59
67
  resolveConfigPath
60
- } from "./chunk-WQJZMCJN.js";
61
- import "./chunk-ECIVB7P4.js";
68
+ } from "./chunk-HTZ2URXW.js";
69
+ import "./chunk-FWP4RACK.js";
70
+ import "./chunk-HAO6PL7Z.js";
62
71
  import "./chunk-LRKZP7DJ.js";
63
72
 
64
- // node_modules/.pnpm/mcporter@0.12.3/node_modules/mcporter/dist/cli/cli-factory.js
73
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/cli/cli-factory.js
65
74
  function buildGlobalContext(argv) {
66
75
  const globalFlags = extractFlags(argv, ["--config", "--root", "--log-level", "--oauth-timeout"]);
67
76
  if (globalFlags["--log-level"]) {
@@ -94,7 +103,7 @@ function buildGlobalContext(argv) {
94
103
  return { globalFlags, oauthTimeoutOverride, runtimeOptions };
95
104
  }
96
105
 
97
- // node_modules/.pnpm/mcporter@0.12.3/node_modules/mcporter/dist/cli/command-inference.js
106
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/cli/command-inference.js
98
107
  var CALL_TOKEN_PATTERN = /[.(]/;
99
108
  function inferCommandRouting(token, args, definitions) {
100
109
  if (!token) {
@@ -166,7 +175,7 @@ function isHttpToolToken(token) {
166
175
  return splitHttpToolSelector(token) !== null;
167
176
  }
168
177
 
169
- // node_modules/.pnpm/mcporter@0.12.3/node_modules/mcporter/dist/cli/help-output.js
178
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/cli/help-output.js
170
179
  import fsPromises from "node:fs/promises";
171
180
  function printHelp(message) {
172
181
  if (message) {
@@ -349,15 +358,7 @@ function isHelpToken(token) {
349
358
  return token === "--help" || token === "-h" || token === "help";
350
359
  }
351
360
  function consumeHelpTokens(args) {
352
- let found = false;
353
- for (let index = args.length - 1; index >= 0; index -= 1) {
354
- const token = args[index];
355
- if (token && isHelpToken(token)) {
356
- args.splice(index, 1);
357
- found = true;
358
- }
359
- }
360
- return found;
361
+ return consumeMatchingTokens(args, isHelpToken);
361
362
  }
362
363
  function isVersionToken(token) {
363
364
  return token === "--version" || token === "-v" || token === "-V";
@@ -376,7 +377,8 @@ async function resolveCliVersion() {
376
377
  }
377
378
  }
378
379
 
379
- // node_modules/.pnpm/mcporter@0.12.3/node_modules/mcporter/dist/cli.js
380
+ // node_modules/.pnpm/mcporter@0.13.0/node_modules/mcporter/dist/cli.js
381
+ configureAutoSelectFamilyAttemptTimeout();
380
382
  var FORCE_EXIT_GRACE_MS = 50;
381
383
  var STDOUT_FLUSH_TIMEOUT_MS = 2e3;
382
384
  var DAEMON_FAST_PATH_SERVERS = /* @__PURE__ */ new Set(["chrome-devtools", "mobile-mcp", "playwright"]);
@@ -418,31 +420,31 @@ function flushStdioThenForceExit() {
418
420
  });
419
421
  }
420
422
  async function handleAuth(...args) {
421
- const { handleAuth: imported } = await import("./auth-command-ZLGYIEUY.js");
423
+ const { handleAuth: imported } = await import("./auth-command-3K7V3VCW.js");
422
424
  return imported(...args);
423
425
  }
424
426
  async function printAuthHelp() {
425
- const { printAuthHelp: imported } = await import("./auth-command-ZLGYIEUY.js");
427
+ const { printAuthHelp: imported } = await import("./auth-command-3K7V3VCW.js");
426
428
  imported();
427
429
  }
428
430
  async function handleCall(...args) {
429
- const { handleCall: imported } = await import("./call-command-LKTKSYTH.js");
431
+ const { handleCall: imported } = await import("./call-command-OFPHPFM5.js");
430
432
  return imported(...args);
431
433
  }
432
434
  async function handleGenerateCli(...args) {
433
- const { handleGenerateCli: imported } = await import("./generate-cli-runner-6CAZZA3P.js");
435
+ const { handleGenerateCli: imported } = await import("./generate-cli-runner-L5OQIMEY.js");
434
436
  return imported(...args);
435
437
  }
436
438
  async function handleInspectCli(...args) {
437
- const { handleInspectCli: imported } = await import("./inspect-cli-command-3ZORTOR7.js");
439
+ const { handleInspectCli: imported } = await import("./inspect-cli-command-7OMMREPE.js");
438
440
  return imported(...args);
439
441
  }
440
442
  async function handleList(...args) {
441
- const { handleList: imported } = await import("./list-command-2MEGGNFQ.js");
443
+ const { handleList: imported } = await import("./list-command-ZO4HVFQK.js");
442
444
  return imported(...args);
443
445
  }
444
446
  async function handleResource(...args) {
445
- const { handleResource: imported } = await import("./resource-command-OO4NYF5C.js");
447
+ const { handleResource: imported } = await import("./resource-command-JEZ2DW2G.js");
446
448
  return imported(...args);
447
449
  }
448
450
  async function runCli(argv) {
@@ -475,23 +477,23 @@ async function runCli(argv) {
475
477
  }
476
478
  if (command === "generate-cli") {
477
479
  if (consumeHelpTokens(args)) {
478
- const { printGenerateCliHelp } = await import("./generate-cli-runner-6CAZZA3P.js");
480
+ const { printGenerateCliHelp } = await import("./generate-cli-runner-L5OQIMEY.js");
479
481
  printGenerateCliHelp();
480
482
  process.exitCode = 0;
481
483
  return;
482
484
  }
483
- const { handleGenerateCli: importedHandleGenerateCli } = await import("./generate-cli-runner-6CAZZA3P.js");
485
+ const { handleGenerateCli: importedHandleGenerateCli } = await import("./generate-cli-runner-L5OQIMEY.js");
484
486
  await importedHandleGenerateCli(args, globalFlags);
485
487
  return;
486
488
  }
487
489
  if (command === "inspect-cli") {
488
490
  if (consumeHelpTokens(args)) {
489
- const { printInspectCliHelp } = await import("./inspect-cli-command-3ZORTOR7.js");
491
+ const { printInspectCliHelp } = await import("./inspect-cli-command-7OMMREPE.js");
490
492
  printInspectCliHelp();
491
493
  process.exitCode = 0;
492
494
  return;
493
495
  }
494
- const { handleInspectCli: importedHandleInspectCli } = await import("./inspect-cli-command-3ZORTOR7.js");
496
+ const { handleInspectCli: importedHandleInspectCli } = await import("./inspect-cli-command-7OMMREPE.js");
495
497
  await importedHandleInspectCli(args);
496
498
  return;
497
499
  }
@@ -499,12 +501,14 @@ async function runCli(argv) {
499
501
  const configPath = runtimeOptions.configPath ?? globalFlags["--config"];
500
502
  const configResolution = resolveConfigPath(globalFlags["--config"], rootOverride ?? process.cwd());
501
503
  const configPathResolved = configPath ?? configResolution.path;
504
+ const interactiveElicitation = process.stdin.isTTY && process.stderr.isTTY && !isReplayModeActive() ? createInteractiveElicitationResponder() : void 0;
502
505
  const runtimeOptionsWithPath = {
503
506
  ...runtimeOptions,
504
- configPath: configResolution.explicit ? configPathResolved : runtimeOptions.configPath
507
+ configPath: configResolution.explicit ? configPathResolved : runtimeOptions.configPath,
508
+ ...interactiveElicitation ? { elicitationHandler: interactiveElicitation.handler } : {}
505
509
  };
506
510
  if (command === "daemon") {
507
- const { handleDaemonCli } = await import("./daemon-command-U242Z6VY.js");
511
+ const { handleDaemonCli } = await import("./daemon-command-6CJ26MKI.js");
508
512
  await handleDaemonCli(args, {
509
513
  configPath: configPathResolved,
510
514
  configExplicit: configResolution.explicit,
@@ -513,7 +517,7 @@ async function runCli(argv) {
513
517
  return;
514
518
  }
515
519
  if (command === "serve") {
516
- const { handleServeCli, printServeHelp } = await import("./serve-command-DHXJZMMN.js");
520
+ const { handleServeCli, printServeHelp } = await import("./serve-command-M47YZ6JN.js");
517
521
  if (consumeHelpTokens(args)) {
518
522
  printServeHelp();
519
523
  process.exitCode = 0;
@@ -527,7 +531,7 @@ async function runCli(argv) {
527
531
  return;
528
532
  }
529
533
  if (command === "record") {
530
- const { handleRecordCli, printRecordHelp } = await import("./record-command-YXHTTTT5.js");
534
+ const { handleRecordCli, printRecordHelp } = await import("./record-command-VD3HUQIC.js");
531
535
  if (consumeHelpTokens(wrapperArgsBeforeSeparator(args))) {
532
536
  printRecordHelp();
533
537
  process.exitCode = 0;
@@ -537,7 +541,7 @@ async function runCli(argv) {
537
541
  return;
538
542
  }
539
543
  if (command === "replay") {
540
- const { handleReplayCli, printReplayHelp } = await import("./replay-command-25HJ6AQU.js");
544
+ const { handleReplayCli, printReplayHelp } = await import("./replay-command-AX6IN7YD.js");
541
545
  if (consumeHelpTokens(wrapperArgsBeforeSeparator(args))) {
542
546
  printReplayHelp();
543
547
  process.exitCode = 0;
@@ -547,7 +551,7 @@ async function runCli(argv) {
547
551
  return;
548
552
  }
549
553
  if (command === "config") {
550
- const { handleConfigCli } = await import("./config-command-NLAGKID5.js");
554
+ const { handleConfigCli } = await import("./config-command-MWF3RHPQ.js");
551
555
  await handleConfigCli({
552
556
  loadOptions: { configPath, rootDir: rootOverride },
553
557
  invokeAuth: (authArgs) => invokeAuthCommand(runtimeOptionsWithPath, authArgs)
@@ -556,14 +560,14 @@ async function runCli(argv) {
556
560
  }
557
561
  if (command === "emit-ts") {
558
562
  if (consumeHelpTokens(args)) {
559
- const { printEmitTsHelp } = await import("./emit-ts-command-VBXVXO6V.js");
563
+ const { printEmitTsHelp } = await import("./emit-ts-command-GOVJJ64A.js");
560
564
  printEmitTsHelp();
561
565
  process.exitCode = 0;
562
566
  return;
563
567
  }
564
568
  const [{ createRuntime: createRuntime2 }, { handleEmitTs }] = await Promise.all([
565
- import("./runtime-5WJ3G25Y.js"),
566
- import("./emit-ts-command-VBXVXO6V.js")
569
+ import("./runtime-HSYVOME7.js"),
570
+ import("./emit-ts-command-GOVJJ64A.js")
567
571
  ]);
568
572
  const runtime2 = await createRuntime2(runtimeOptionsWithPath);
569
573
  try {
@@ -578,10 +582,10 @@ async function runCli(argv) {
578
582
  return;
579
583
  }
580
584
  const [{ createRuntime }, { DaemonClient }, { createKeepAliveRuntime }, { isKeepAliveServer }] = await Promise.all([
581
- import("./runtime-5WJ3G25Y.js"),
582
- import("./client-S7RQUG5U.js"),
583
- import("./runtime-wrapper-RPWDIDBF.js"),
584
- import("./lifecycle-XVKRHPH3.js")
585
+ import("./runtime-HSYVOME7.js"),
586
+ import("./client-2EJC4PLL.js"),
587
+ import("./runtime-wrapper-UREU7GC3.js"),
588
+ import("./lifecycle-B5UC65PT.js")
585
589
  ]);
586
590
  const baseRuntime = await createRuntime(runtimeOptionsWithPath);
587
591
  const recordReplayModeActive = isRecordReplayModeActive();
@@ -603,56 +607,56 @@ async function runCli(argv) {
603
607
  const resolvedArgs = inference.args;
604
608
  if (resolvedCommand === "list") {
605
609
  if (consumeHelpTokens(resolvedArgs)) {
606
- const { printListHelp } = await import("./list-command-2MEGGNFQ.js");
610
+ const { printListHelp } = await import("./list-command-ZO4HVFQK.js");
607
611
  printListHelp();
608
612
  process.exitCode = 0;
609
613
  return;
610
614
  }
611
- const { handleList: importedHandleList } = await import("./list-command-2MEGGNFQ.js");
615
+ const { handleList: importedHandleList } = await import("./list-command-ZO4HVFQK.js");
612
616
  await importedHandleList(runtime, resolvedArgs);
613
617
  return;
614
618
  }
615
619
  if (resolvedCommand === "call") {
616
620
  if (consumeHelpTokens(resolvedArgs)) {
617
- const { printCallHelp } = await import("./call-command-LKTKSYTH.js");
621
+ const { printCallHelp } = await import("./call-command-OFPHPFM5.js");
618
622
  printCallHelp();
619
623
  process.exitCode = 0;
620
624
  return;
621
625
  }
622
- const { handleCall: runHandleCall } = await import("./call-command-LKTKSYTH.js");
626
+ const { handleCall: runHandleCall } = await import("./call-command-OFPHPFM5.js");
623
627
  await runHandleCall(runtime, resolvedArgs);
624
628
  return;
625
629
  }
626
630
  if (resolvedCommand === "auth") {
627
631
  if (consumeHelpTokens(resolvedArgs)) {
628
- const { printAuthHelp: importedPrintAuthHelp } = await import("./auth-command-ZLGYIEUY.js");
632
+ const { printAuthHelp: importedPrintAuthHelp } = await import("./auth-command-3K7V3VCW.js");
629
633
  importedPrintAuthHelp();
630
634
  process.exitCode = 0;
631
635
  return;
632
636
  }
633
- const { handleAuth: importedHandleAuth } = await import("./auth-command-ZLGYIEUY.js");
634
- await importedHandleAuth(runtime, resolvedArgs);
637
+ const { handleAuth: importedHandleAuth } = await import("./auth-command-3K7V3VCW.js");
638
+ await importedHandleAuth(runtime, resolvedArgs, { oauthTimeoutMs: runtimeOptionsWithPath.oauthTimeoutMs });
635
639
  return;
636
640
  }
637
641
  if (resolvedCommand === "vault") {
638
642
  if (consumeHelpTokens(resolvedArgs)) {
639
- const { printVaultHelp } = await import("./vault-command-PIYIUEZL.js");
643
+ const { printVaultHelp } = await import("./vault-command-53P7MLCB.js");
640
644
  printVaultHelp();
641
645
  process.exitCode = 0;
642
646
  return;
643
647
  }
644
- const { handleVault } = await import("./vault-command-PIYIUEZL.js");
648
+ const { handleVault } = await import("./vault-command-53P7MLCB.js");
645
649
  await handleVault(runtime, resolvedArgs);
646
650
  return;
647
651
  }
648
652
  if (resolvedCommand === "resource" || resolvedCommand === "resources") {
649
653
  if (consumeHelpTokens(resolvedArgs)) {
650
- const { printResourceHelp } = await import("./resource-command-OO4NYF5C.js");
654
+ const { printResourceHelp } = await import("./resource-command-JEZ2DW2G.js");
651
655
  printResourceHelp();
652
656
  process.exitCode = 0;
653
657
  return;
654
658
  }
655
- const { handleResource: importedHandleResource } = await import("./resource-command-OO4NYF5C.js");
659
+ const { handleResource: importedHandleResource } = await import("./resource-command-JEZ2DW2G.js");
656
660
  await importedHandleResource(runtime, resolvedArgs);
657
661
  return;
658
662
  }
@@ -710,6 +714,13 @@ function wrapperArgsBeforeSeparator(args) {
710
714
  const separatorIndex = args.indexOf("--");
711
715
  return separatorIndex === -1 ? [...args] : args.slice(0, separatorIndex);
712
716
  }
717
+ var __cliInternals = {
718
+ flushStdioThenForceExit,
719
+ flushWriteStreamForExit,
720
+ handleStdioError,
721
+ installStdioErrorHandlers,
722
+ wrapperArgsBeforeSeparator
723
+ };
713
724
  async function main() {
714
725
  await runCli(process.argv.slice(2));
715
726
  }
@@ -728,12 +739,12 @@ if (process.env.MCPORTER_DISABLE_AUTORUN !== "1") {
728
739
  }
729
740
  async function invokeAuthCommand(runtimeOptions, args) {
730
741
  const [{ createRuntime }, { handleAuth: importedHandleAuth }] = await Promise.all([
731
- import("./runtime-5WJ3G25Y.js"),
732
- import("./auth-command-ZLGYIEUY.js")
742
+ import("./runtime-HSYVOME7.js"),
743
+ import("./auth-command-3K7V3VCW.js")
733
744
  ]);
734
745
  const runtime = await createRuntime(runtimeOptions);
735
746
  try {
736
- await importedHandleAuth(runtime, args);
747
+ await importedHandleAuth(runtime, args, { oauthTimeoutMs: runtimeOptions.oauthTimeoutMs });
737
748
  } finally {
738
749
  await runtime.close().catch(() => {
739
750
  });
@@ -755,8 +766,8 @@ async function maybeHandleDaemonFastCall(command, args, configResolution, rootDi
755
766
  return true;
756
767
  }
757
768
  const [{ DaemonClient }, { handleCall: importedHandleCall }] = await Promise.all([
758
- import("./client-S7RQUG5U.js"),
759
- import("./call-command-LKTKSYTH.js")
769
+ import("./client-2EJC4PLL.js"),
770
+ import("./call-command-OFPHPFM5.js")
760
771
  ]);
761
772
  const daemonClient = new DaemonClient({
762
773
  configPath: configResolution.path,
@@ -768,8 +779,8 @@ async function maybeHandleDaemonFastCall(command, args, configResolution, rootDi
768
779
  }
769
780
  async function maybeHandleSimpleDaemonFastCall(callArgs, configResolution, rootDir) {
770
781
  const [{ parseCallArguments: parseCallArguments2 }, { resolveCallTimeout: resolveCallTimeout2 }] = await Promise.all([
771
- import("./call-arguments-LU3W6D3K.js"),
772
- import("./timeouts-W2XWCCXR.js")
782
+ import("./call-arguments-TX3F2TEE.js"),
783
+ import("./timeouts-THZRYP4B.js")
773
784
  ]);
774
785
  let parsed;
775
786
  try {
@@ -781,9 +792,9 @@ async function maybeHandleSimpleDaemonFastCall(callArgs, configResolution, rootD
781
792
  return false;
782
793
  }
783
794
  const [{ DaemonClient }, { wrapCallResult }, { printCallOutput }] = await Promise.all([
784
- import("./client-S7RQUG5U.js"),
785
- import("./result-utils-MOHHLNM7.js"),
786
- import("./output-utils-NKESLAJ6.js")
795
+ import("./client-2EJC4PLL.js"),
796
+ import("./result-utils-3YHYGS45.js"),
797
+ import("./output-utils-M3TJ2N4M.js")
787
798
  ]);
788
799
  const daemonClient = new DaemonClient({
789
800
  configPath: configResolution.path,
@@ -876,7 +887,8 @@ function createDaemonOnlyRuntime(daemonClient) {
876
887
  includeSchema: options?.includeSchema,
877
888
  autoAuthorize: options?.autoAuthorize,
878
889
  allowCachedAuth: options?.allowCachedAuth,
879
- disableOAuth: options?.disableOAuth
890
+ disableOAuth: options?.disableOAuth,
891
+ timeoutMs: options?.timeoutMs
880
892
  }),
881
893
  callTool: (server, toolName, options) => daemonClient.callTool({
882
894
  server,
@@ -915,6 +927,7 @@ function createDaemonOnlyRuntime(daemonClient) {
915
927
  };
916
928
  }
917
929
  export {
930
+ __cliInternals,
918
931
  extractListFlags,
919
932
  handleAuth,
920
933
  handleCall,