@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,194 +0,0 @@
1
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
- import {
3
- readJsonFile,
4
- withFileLock,
5
- writeJsonFile
6
- } from "./chunk-2XL7MG7R.js";
7
- import {
8
- mcporterDir
9
- } from "./chunk-ECIVB7P4.js";
10
-
11
- // node_modules/.pnpm/mcporter@0.12.3/node_modules/mcporter/dist/oauth-vault.js
12
- import crypto from "node:crypto";
13
- import path from "node:path";
14
- function getOAuthVaultPath() {
15
- return path.join(mcporterDir("data"), "credentials.json");
16
- }
17
- async function readVaultState() {
18
- try {
19
- const existing = await readJsonFile(getOAuthVaultPath());
20
- if (existing && existing.version === 1 && existing.entries && typeof existing.entries === "object") {
21
- return { vault: existing, needsRepair: false };
22
- }
23
- if (existing !== void 0) {
24
- return { vault: emptyVault(), needsRepair: true };
25
- }
26
- } catch (error) {
27
- if (!(error instanceof SyntaxError)) {
28
- throw error;
29
- }
30
- return { vault: emptyVault(), needsRepair: true };
31
- }
32
- return { vault: emptyVault(), needsRepair: false };
33
- }
34
- async function readVault() {
35
- return (await readVaultState()).vault;
36
- }
37
- function emptyVault() {
38
- return { version: 1, entries: {} };
39
- }
40
- async function writeVault(contents) {
41
- await writeJsonFile(getOAuthVaultPath(), contents);
42
- }
43
- function vaultKeyForDefinition(definition) {
44
- const descriptor = {
45
- name: definition.name,
46
- url: definition.command.kind === "http" ? definition.command.url.toString() : null,
47
- command: definition.command.kind === "stdio" ? { command: definition.command.command, args: definition.command.args ?? [] } : null
48
- };
49
- const hash = crypto.createHash("sha256").update(JSON.stringify(descriptor)).digest("hex").slice(0, 16);
50
- return `${definition.name}|${hash}`;
51
- }
52
- async function loadVaultEntry(definition) {
53
- const vault = await readVault();
54
- const key = vaultKeyForDefinition(definition);
55
- const exact = isVaultEntry(vault.entries[key]) ? vault.entries[key] : void 0;
56
- const fallback = findSameUrlCredentials(vault, definition, key, exact);
57
- if (!fallback.tokens && !fallback.clientInfo) {
58
- return exact;
59
- }
60
- if (!exact) {
61
- return {
62
- serverName: definition.name,
63
- serverUrl: definition.command.kind === "http" ? definition.command.url.toString() : void 0,
64
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
65
- tokens: fallback.tokens,
66
- clientInfo: fallback.clientInfo
67
- };
68
- }
69
- return {
70
- ...exact,
71
- tokens: exact.tokens ?? fallback.tokens,
72
- clientInfo: exact.clientInfo ?? (exact.tokens ? void 0 : fallback.clientInfo)
73
- };
74
- }
75
- function findSameUrlCredentials(vault, definition, exactKey, exact) {
76
- if (definition.command.kind !== "http") {
77
- return { sourceKeys: [] };
78
- }
79
- const serverUrl = definition.command.url.toString();
80
- const candidates = Object.entries(vault.entries).filter(([key, entry]) => key !== exactKey && isVaultEntry(entry) && entry.serverUrl === serverUrl && isLegacyOAuthRenameCandidate(definition, entry) && (entry.tokens || entry.clientInfo)).map(([key, entry]) => ({ key, entry })).toSorted((a, b) => Date.parse(b.entry.updatedAt) - Date.parse(a.entry.updatedAt));
81
- const requiredClientId = definition.oauthClientId ?? clientIdFromEntry(exact);
82
- if (requiredClientId) {
83
- const tokenSource = candidates.find(({ entry }) => (entry.tokens || entry.clientInfo) && clientIdFromEntry(entry) === requiredClientId);
84
- return {
85
- tokens: tokenSource?.entry.tokens,
86
- clientInfo: exact?.clientInfo ? void 0 : tokenSource?.entry.clientInfo,
87
- sourceKeys: tokenSource ? [tokenSource.key] : []
88
- };
89
- }
90
- const source = candidates.find(({ entry }) => entry.clientInfo && clientIdFromEntry(entry));
91
- return {
92
- tokens: source?.entry.tokens,
93
- clientInfo: source?.entry.clientInfo,
94
- sourceKeys: source ? [source.key] : []
95
- };
96
- }
97
- function isLegacyOAuthRenameCandidate(definition, entry) {
98
- return entry.serverName === `${definition.name}-oauth`;
99
- }
100
- function legacyOAuthRenameKeys(vault, definition, exactKey) {
101
- if (definition.command.kind !== "http") {
102
- return [];
103
- }
104
- const serverUrl = definition.command.url.toString();
105
- return Object.entries(vault.entries).filter(([key, entry]) => key !== exactKey && isVaultEntry(entry) && entry.serverUrl === serverUrl && isLegacyOAuthRenameCandidate(definition, entry)).map(([key]) => key);
106
- }
107
- function isVaultEntry(entry) {
108
- return Boolean(entry && typeof entry === "object" && typeof entry.serverName === "string" && typeof entry.updatedAt === "string");
109
- }
110
- function clientIdFromEntry(entry) {
111
- const clientId = entry?.clientInfo?.client_id;
112
- return typeof clientId === "string" && clientId.length > 0 ? clientId : void 0;
113
- }
114
- async function saveVaultEntry(definition, patch) {
115
- await withFileLock(getOAuthVaultPath(), async () => {
116
- const vault = await readVault();
117
- const key = vaultKeyForDefinition(definition);
118
- const existing = isVaultEntry(vault.entries[key]) ? vault.entries[key] : void 0;
119
- const fallback = findSameUrlCredentials(vault, definition, key, existing);
120
- const current = existing ?? {
121
- serverName: definition.name,
122
- serverUrl: definition.command.kind === "http" ? definition.command.url.toString() : void 0,
123
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
124
- };
125
- vault.entries[key] = {
126
- ...current,
127
- ...patch,
128
- clientInfo: patch.clientInfo ?? current.clientInfo ?? (patch.tokens && !current.tokens ? fallback.clientInfo : void 0),
129
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
130
- };
131
- await writeVault(vault);
132
- });
133
- }
134
- async function clearVaultEntry(definition, scope) {
135
- const key = vaultKeyForDefinition(definition);
136
- await withFileLock(getOAuthVaultPath(), async () => {
137
- const { vault, needsRepair } = await readVaultState();
138
- const existing = isVaultEntry(vault.entries[key]) ? vault.entries[key] : void 0;
139
- const fallback = findSameUrlCredentials(vault, definition, key, existing);
140
- const inheritedKeys = scope === "all" ? legacyOAuthRenameKeys(vault, definition, key) : fallback.sourceKeys;
141
- if (!existing && inheritedKeys.length === 0) {
142
- if (needsRepair) {
143
- await writeVault(vault);
144
- }
145
- return;
146
- }
147
- if (scope === "all") {
148
- delete vault.entries[key];
149
- } else if (existing) {
150
- const updated = { ...existing };
151
- if (scope === "tokens") {
152
- delete updated.tokens;
153
- }
154
- if (scope === "client") {
155
- delete updated.clientInfo;
156
- }
157
- if (scope === "verifier") {
158
- delete updated.codeVerifier;
159
- }
160
- if (scope === "state") {
161
- delete updated.state;
162
- }
163
- updated.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
164
- vault.entries[key] = updated;
165
- }
166
- for (const fallbackKey of inheritedKeys) {
167
- const inherited = vault.entries[fallbackKey];
168
- if (!inherited) {
169
- continue;
170
- }
171
- if (scope === "all") {
172
- delete vault.entries[fallbackKey];
173
- continue;
174
- }
175
- const updated = { ...inherited };
176
- if (scope === "tokens") {
177
- delete updated.tokens;
178
- }
179
- if (scope === "client") {
180
- delete updated.clientInfo;
181
- }
182
- updated.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
183
- vault.entries[fallbackKey] = updated;
184
- }
185
- await writeVault(vault);
186
- });
187
- }
188
-
189
- export {
190
- getOAuthVaultPath,
191
- loadVaultEntry,
192
- saveVaultEntry,
193
- clearVaultEntry
194
- };