@introspection-ai/recipes 0.52.1 → 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.
Files changed (161) hide show
  1. package/dist/cli/schema-args.d.ts +74 -0
  2. package/dist/cli/schema-args.d.ts.map +1 -0
  3. package/dist/cli/schema-args.js +546 -0
  4. package/dist/cli/schema-args.js.map +1 -0
  5. package/dist/connector-tools.d.ts +1 -1
  6. package/dist/connector-tools.d.ts.map +1 -1
  7. package/dist/connector-tools.js +1 -0
  8. package/dist/connector-tools.js.map +1 -1
  9. package/dist/documents/arguments.d.ts +218 -0
  10. package/dist/documents/arguments.d.ts.map +1 -0
  11. package/dist/documents/arguments.generated.d.ts +12 -0
  12. package/dist/documents/arguments.generated.d.ts.map +1 -0
  13. package/dist/documents/arguments.generated.js +341 -0
  14. package/dist/documents/arguments.generated.js.map +1 -0
  15. package/dist/documents/arguments.js +8 -0
  16. package/dist/documents/arguments.js.map +1 -0
  17. package/dist/documents/tools.d.ts.map +1 -1
  18. package/dist/documents/tools.js +11 -164
  19. package/dist/documents/tools.js.map +1 -1
  20. package/dist/introspection-open.d.ts +2 -2
  21. package/dist/introspection-open.d.ts.map +1 -1
  22. package/dist/introspection-open.js +27 -9
  23. package/dist/introspection-open.js.map +1 -1
  24. package/dist/issues/arguments.d.ts +87 -0
  25. package/dist/issues/arguments.d.ts.map +1 -0
  26. package/dist/issues/arguments.generated.d.ts +11 -0
  27. package/dist/issues/arguments.generated.d.ts.map +1 -0
  28. package/dist/issues/arguments.generated.js +116 -0
  29. package/dist/issues/arguments.generated.js.map +1 -0
  30. package/dist/issues/arguments.js +10 -0
  31. package/dist/issues/arguments.js.map +1 -0
  32. package/dist/issues/index.d.ts +1 -1
  33. package/dist/issues/index.d.ts.map +1 -1
  34. package/dist/issues/index.js +1 -1
  35. package/dist/issues/index.js.map +1 -1
  36. package/dist/issues/module.d.ts +3 -0
  37. package/dist/issues/module.d.ts.map +1 -1
  38. package/dist/issues/module.js +4 -0
  39. package/dist/issues/module.js.map +1 -1
  40. package/dist/issues/tool.d.ts +9 -23
  41. package/dist/issues/tool.d.ts.map +1 -1
  42. package/dist/issues/tool.js +37 -35
  43. package/dist/issues/tool.js.map +1 -1
  44. package/dist/mcp/cli/command-context.d.ts +13 -0
  45. package/dist/mcp/cli/command-context.d.ts.map +1 -1
  46. package/dist/mcp/cli/command-context.js +56 -16
  47. package/dist/mcp/cli/command-context.js.map +1 -1
  48. package/dist/mcp/cli/core.d.ts +1 -1
  49. package/dist/mcp/cli/core.d.ts.map +1 -1
  50. package/dist/mcp/cli/core.js +99 -107
  51. package/dist/mcp/cli/core.js.map +1 -1
  52. package/dist/mcp/cli/help.d.ts.map +1 -1
  53. package/dist/mcp/cli/help.js +3 -2
  54. package/dist/mcp/cli/help.js.map +1 -1
  55. package/dist/mcp/cli/policy.d.ts +1 -0
  56. package/dist/mcp/cli/policy.d.ts.map +1 -1
  57. package/dist/mcp/cli/policy.js +9 -7
  58. package/dist/mcp/cli/policy.js.map +1 -1
  59. package/dist/mcp/client-entry.js +1 -1
  60. package/dist/mcp/client-entry.js.map +1 -1
  61. package/dist/mcp/daemon/client.d.ts +10 -1
  62. package/dist/mcp/daemon/client.d.ts.map +1 -1
  63. package/dist/mcp/daemon/client.js +41 -17
  64. package/dist/mcp/daemon/client.js.map +1 -1
  65. package/dist/mcp/daemon/hosted.d.ts +22 -0
  66. package/dist/mcp/daemon/hosted.d.ts.map +1 -0
  67. package/dist/mcp/daemon/hosted.js +98 -0
  68. package/dist/mcp/daemon/hosted.js.map +1 -0
  69. package/dist/mcp/daemon/index.js +18 -423
  70. package/dist/mcp/daemon/index.js.map +1 -1
  71. package/dist/mcp/daemon/protocol.d.ts +4 -0
  72. package/dist/mcp/daemon/protocol.d.ts.map +1 -1
  73. package/dist/mcp/daemon/protocol.js +10 -0
  74. package/dist/mcp/daemon/protocol.js.map +1 -1
  75. package/dist/mcp/daemon/server.d.ts +41 -0
  76. package/dist/mcp/daemon/server.d.ts.map +1 -0
  77. package/dist/mcp/daemon/server.js +547 -0
  78. package/dist/mcp/daemon/server.js.map +1 -0
  79. package/dist/mcp/index.d.ts.map +1 -1
  80. package/dist/mcp/index.js +5 -3
  81. package/dist/mcp/index.js.map +1 -1
  82. package/dist/mcp/pi-runtime.d.ts +4 -2
  83. package/dist/mcp/pi-runtime.d.ts.map +1 -1
  84. package/dist/mcp/pi-runtime.js +12 -6
  85. package/dist/mcp/pi-runtime.js.map +1 -1
  86. package/dist/mcp/tools.d.ts.map +1 -1
  87. package/dist/mcp/tools.js +16 -5
  88. package/dist/mcp/tools.js.map +1 -1
  89. package/dist/mcp-chunks/chunk-53T5TVPR.js +546 -0
  90. package/dist/mcp-chunks/{chunk-QUDOU7MQ.js → chunk-757ZF552.js} +1 -1
  91. package/dist/mcp-chunks/{chunk-CGJ2XOSF.js → chunk-D6OGGMWS.js} +981 -528
  92. package/dist/mcp-chunks/{chunk-IMG2JMBS.js → chunk-MYAMG6VL.js} +1 -1
  93. package/dist/mcp-chunks/{chunk-LQKMNWDE.js → chunk-OIK5AH2S.js} +5 -5
  94. package/dist/mcp-chunks/{chunk-3UVHZECT.js → chunk-OWGTNJNR.js} +9 -7
  95. package/dist/mcp-chunks/chunk-TUPFPO4L.js +400 -0
  96. package/dist/mcp-chunks/{cli-BM23ZXPJ.js → cli-UQ5QXFXU.js} +31 -31
  97. package/dist/mcp-chunks/{client-RKTAKDAY.js → client-SBELHRAE.js} +3 -3
  98. package/dist/mcp-chunks/{daemon-command-VU6WTFCJ.js → daemon-command-MQS6AP2W.js} +5 -5
  99. package/dist/mcp-chunks/dist-SDPPH7XQ.js +65 -0
  100. package/dist/mcp-chunks/{generate-cli-runner-JAAPSWGX.js → generate-cli-runner-LQBBQ7F5.js} +3 -3
  101. package/dist/mcp-chunks/{generated-daemon-runtime-LX4L2X7Z.js → generated-daemon-runtime-TUCZ3JEP.js} +4 -4
  102. package/dist/mcp-chunks/{pi-mcp-runtime-GHDEPXUL.js → pi-mcp-runtime-OLO25D7A.js} +1 -29
  103. package/dist/mcp-chunks/{runtime-T63YI7TC.js → runtime-5SOGEUTQ.js} +2 -2
  104. package/dist/mcp-chunks/{serve-command-75P4VBJ6.js → serve-command-YKSIXG7K.js} +3 -3
  105. package/dist/mcp-chunks/server-SLD55EBC.js +41 -0
  106. package/dist/mcp-daemon.js +29 -432
  107. package/dist/mcp-run-worker.js +9 -8
  108. package/dist/open.d.ts +9 -2
  109. package/dist/open.d.ts.map +1 -1
  110. package/dist/open.js +31 -3
  111. package/dist/open.js.map +1 -1
  112. package/dist/pi-extension.d.ts.map +1 -1
  113. package/dist/pi-extension.js +1 -1
  114. package/dist/pi-extension.js.map +1 -1
  115. package/dist/recipe/companions.d.ts +6 -0
  116. package/dist/recipe/companions.d.ts.map +1 -1
  117. package/dist/recipe/companions.js +22 -4
  118. package/dist/recipe/companions.js.map +1 -1
  119. package/dist/recipe/manifest.generated.d.ts +1 -1
  120. package/dist/recipe/manifest.generated.js +1 -1
  121. package/dist/recipe/suggestions.d.ts +15 -7
  122. package/dist/recipe/suggestions.d.ts.map +1 -1
  123. package/dist/recipe/suggestions.js +33 -11
  124. package/dist/recipe/suggestions.js.map +1 -1
  125. package/dist/search/arguments.d.ts +35 -0
  126. package/dist/search/arguments.d.ts.map +1 -0
  127. package/dist/search/arguments.generated.d.ts +4 -0
  128. package/dist/search/arguments.generated.d.ts.map +1 -0
  129. package/dist/search/arguments.generated.js +37 -0
  130. package/dist/search/arguments.generated.js.map +1 -0
  131. package/dist/search/arguments.js +11 -0
  132. package/dist/search/arguments.js.map +1 -0
  133. package/dist/search/tool.d.ts +1 -1
  134. package/dist/search/tool.d.ts.map +1 -1
  135. package/dist/search/tool.js +16 -33
  136. package/dist/search/tool.js.map +1 -1
  137. package/dist/session.js +1 -1
  138. package/dist/session.js.map +1 -1
  139. package/dist/suggestion-picker.d.ts +2 -2
  140. package/dist/suggestion-picker.d.ts.map +1 -1
  141. package/dist/suggestion-picker.js +3 -3
  142. package/dist/suggestion-picker.js.map +1 -1
  143. package/dist/tools/cli.d.ts +2 -0
  144. package/dist/tools/cli.d.ts.map +1 -1
  145. package/dist/tools/cli.js +110 -38
  146. package/dist/tools/cli.js.map +1 -1
  147. package/dist/tools/shell.d.ts +7 -2
  148. package/dist/tools/shell.d.ts.map +1 -1
  149. package/dist/tools/shell.js +33 -11
  150. package/dist/tools/shell.js.map +1 -1
  151. package/docs/interactions.md +20 -15
  152. package/docs/issues/README.md +24 -17
  153. package/docs/mcp-configuration.md +11 -3
  154. package/docs/providers.md +38 -29
  155. package/docs/recipe-format.md +30 -13
  156. package/package.json +10 -11
  157. package/skills/issues/SKILL.md +108 -0
  158. package/dist/mcp-chunks/{auth-command-UYFOGGQR.js → auth-command-PZLSOYAT.js} +6 -6
  159. package/dist/mcp-chunks/{call-command-6U5BNDR7.js → call-command-VILJIFYG.js} +6 -6
  160. package/dist/mcp-chunks/{chunk-36D4FILJ.js → chunk-ORJND4AI.js} +3 -3
  161. package/dist/mcp-chunks/{resource-command-DUY4SVE5.js → resource-command-SRFQQROJ.js} +4 -4
package/dist/tools/cli.js CHANGED
@@ -7,21 +7,32 @@
7
7
  */
8
8
  import { readFileSync } from "node:fs";
9
9
  import { createConnection } from "node:net";
10
+ import { parseSchemaArgs, SchemaArgsError, schemaGroupHelp, schemaHelp, usageOf, } from "../cli/schema-args.js";
10
11
  import { TOOLS_SOCKET_ENV, } from "./bridge.js";
12
+ /** First-party tools with no commands: each is called by its name alone. */
13
+ export const COMMANDLESS_TOOLS = ["web_search"];
11
14
  const HELP = [
12
15
  "tools: the platform's own tools (issues, mail, calendar, drive, web_search).",
13
16
  "",
14
- " tools list [tool] [--schema] What this agent has; a tool's commands.",
15
- ' tools search "what you need" [--limit N] Commands matching the words.',
16
- " tools call <tool>.<command> --json '{...}' One call; --json - reads it from stdin.",
17
- " tools run <<'JS' ... JS Two or more calls, in one script.",
17
+ " Each tool is also a command of its own:",
18
+ " <tool> --help Its commands.",
19
+ " <tool> <command> --help A command's arguments, from its schema.",
20
+ " <tool> <command> --<argument> <value> ... One call.",
21
+ " A tool with no commands takes its arguments directly: web_search --query '...'.",
22
+ "",
23
+ " tools list [tool] [--schema] What this agent has; a tool's commands.",
24
+ ' tools search "what you need" [--limit N] Commands matching the words.',
25
+ " tools <tool> <command> ... The same as <tool> <command> ...",
26
+ " tools call <tool>.<command> [--json '{...}' | --<argument> <value> ...]",
27
+ " tools run <<'JS' ... JS Two or more calls, in one script.",
28
+ "",
29
+ " Any call takes --json '{...}', or --json - to read the object from stdin.",
18
30
  "",
19
31
  " tools run <<'JS'",
20
32
  ' const found = await tools.issues.search({ query: "checkout" });',
21
33
  " return found;",
22
34
  " JS",
23
35
  "",
24
- " A tool with no commands (web_search) is called as `tools call web_search`.",
25
36
  " A Recipe's MCP servers are on the `mcp` command, not here.",
26
37
  ].join("\n");
27
38
  class UsageError extends Error {
@@ -31,39 +42,54 @@ function record(value) {
31
42
  ? value
32
43
  : {};
33
44
  }
34
- /** A tool's commands, from its schema: an enum on `command`, or one variant per command. */
45
+ /** `schema` without `command`, which the call's name carries. */
46
+ function argumentsOf(schema) {
47
+ const { command: _command, ...properties } = record(schema.properties);
48
+ const required = Array.isArray(schema.required)
49
+ ? schema.required.map(String).filter((name) => name !== "command")
50
+ : [];
51
+ return { properties, required };
52
+ }
53
+ /** A tool's commands, from its schema: one variant per command, an enum on `command`, or none. */
35
54
  function commandsOf(tool) {
36
55
  const schema = record(tool.parameters);
37
56
  const variants = (schema.anyOf ?? schema.oneOf);
38
57
  if (Array.isArray(variants))
39
- return variants.map((variant) => {
40
- const properties = record(record(variant).properties);
41
- const { command, ...args } = properties;
42
- return {
43
- tool: tool.name,
44
- command: String(record(command).const),
45
- description: String(record(variant).description ?? ""),
46
- arguments: args,
47
- };
48
- });
49
- const properties = record(schema.properties);
50
- const names = record(properties.command).enum;
51
- const { command: _command, ...args } = properties;
58
+ return variants.map((variant) => ({
59
+ tool: tool.name,
60
+ command: String(record(record(record(variant).properties).command).const),
61
+ description: String(record(variant).description ?? ""),
62
+ schema: argumentsOf(record(variant)),
63
+ }));
64
+ const names = record(record(schema.properties).command).enum;
52
65
  if (Array.isArray(names))
53
66
  return names.map((name) => ({
54
67
  tool: tool.name,
55
68
  command: String(name),
56
69
  description: "",
57
- arguments: args,
70
+ schema: argumentsOf(schema),
58
71
  }));
59
72
  return [
60
73
  {
61
74
  tool: tool.name,
62
75
  description: tool.description.split("\n")[0] ?? "",
63
- arguments: properties,
76
+ schema: argumentsOf(schema),
64
77
  },
65
78
  ];
66
79
  }
80
+ /** The adapter's command for one of a tool's commands. */
81
+ function specOf(command) {
82
+ return {
83
+ path: command.command ? [command.tool, command.command] : [command.tool],
84
+ description: command.description,
85
+ schema: command.schema,
86
+ };
87
+ }
88
+ const isHelp = (arg) => arg === "--help" || arg === "-h" || arg === "help";
89
+ /** How a command is typed in the shell: `issues search`, or `web_search`. */
90
+ function shownAs(command) {
91
+ return command.command ? `${command.tool} ${command.command}` : command.tool;
92
+ }
67
93
  function nameOf(command) {
68
94
  return command.command ? `${command.tool}.${command.command}` : command.tool;
69
95
  }
@@ -148,6 +174,54 @@ export async function runToolsCommand(argv, io) {
148
174
  return 69;
149
175
  }
150
176
  const tools = client(socket);
177
+ /** `<tool> [<command>] [arguments]`: one call, or its help. */
178
+ const invoke = async (toolName, rest) => {
179
+ const catalog = await tools.list();
180
+ const tool = catalog.find((entry) => entry.name === toolName);
181
+ if (!tool)
182
+ throw new UsageError(`${toolName} is not a first-party tool of this agent (${catalog.map((entry) => entry.name).join(", ")}); tools --help shows the commands`);
183
+ const commands = commandsOf(tool);
184
+ let command;
185
+ const first = rest[0];
186
+ if (commands.some((entry) => entry.command)) {
187
+ if (first === undefined || isHelp(first)) {
188
+ io[first ? "stdout" : "stderr"].write(`${schemaGroupHelp([tool.name], tool.description, commands.map(specOf), `tools list ${tool.name} --schema`)}\n`);
189
+ return first ? 0 : 64;
190
+ }
191
+ const found = commands.find((entry) => entry.command === first);
192
+ if (!found)
193
+ throw new UsageError(`${tool.name} has no command '${first}'; it has ${commands.map((entry) => entry.command).join(", ")}. ${tool.name} --help`);
194
+ rest.shift();
195
+ command = found;
196
+ }
197
+ else {
198
+ command = commands[0];
199
+ if (first === "help")
200
+ rest[0] = "--help";
201
+ else if (first !== undefined && !first.startsWith("-"))
202
+ throw new UsageError(`${tool.name} has no commands: pass its arguments as flags or --json -. ${tool.name} --help`);
203
+ }
204
+ const spec = specOf(command);
205
+ const usage = usageOf(spec);
206
+ const parsed = parseSchemaArgs(spec, rest, io.stdin);
207
+ if (parsed.help) {
208
+ io.stdout.write(`${schemaHelp(spec, `tools list ${command.tool} --schema`)}\n`);
209
+ return 0;
210
+ }
211
+ let answer;
212
+ try {
213
+ answer = await tools.call(nameOf(command), parsed.args);
214
+ }
215
+ catch (error) {
216
+ // The pipeline checked the arguments against the schema and refused them.
217
+ if (error instanceof Error &&
218
+ error.message.startsWith("Validation failed"))
219
+ throw new SchemaArgsError(usage, error.message);
220
+ throw error;
221
+ }
222
+ io.stdout.write(`${answer.text}\n`);
223
+ return 0;
224
+ };
151
225
  try {
152
226
  if (verb === "list") {
153
227
  const schema = args.includes("--schema");
@@ -163,8 +237,8 @@ export async function runToolsCommand(argv, io) {
163
237
  throw new UsageError(`${target} is not one of: ${catalog.map((entry) => entry.name).join(", ")}`);
164
238
  for (const command of commandsOf(tool))
165
239
  io.stdout.write(schema
166
- ? `${nameOf(command)} ${JSON.stringify(command.arguments)}\n`
167
- : `${nameOf(command)}${command.description ? ` — ${command.description}` : ""}\n`);
240
+ ? `${shownAs(command)} ${JSON.stringify(command.schema)}\n`
241
+ : `${shownAs(command)}${command.description ? ` — ${command.description}` : ""}\n`);
168
242
  return 0;
169
243
  }
170
244
  if (verb === "search") {
@@ -175,7 +249,7 @@ export async function runToolsCommand(argv, io) {
175
249
  const ranked = (await tools.list())
176
250
  .flatMap(commandsOf)
177
251
  .map((command) => {
178
- const text = `${nameOf(command)} ${command.description}`.toLowerCase();
252
+ const text = `${shownAs(command)} ${command.description}`.toLowerCase();
179
253
  return {
180
254
  command,
181
255
  score: words.filter((word) => text.includes(word)).length,
@@ -185,21 +259,15 @@ export async function runToolsCommand(argv, io) {
185
259
  .sort((a, b) => b.score - a.score)
186
260
  .slice(0, limit);
187
261
  for (const { command } of ranked)
188
- io.stdout.write(`${nameOf(command)}${command.description ? ` — ${command.description}` : ""} ${JSON.stringify(command.arguments)}\n`);
262
+ io.stdout.write(`${shownAs(command)}${command.description ? ` — ${command.description}` : ""}\n`);
189
263
  return 0;
190
264
  }
191
265
  if (verb === "call") {
192
- const json = flag(args, "--json");
193
- const name = args[0];
194
- if (!name)
195
- throw new UsageError("Usage: tools call <tool>.<command> --json '{...}', or --json - to read it from stdin");
196
- // `--json -` reads the object from stdin, as `mcp call` does.
197
- const text = json === "-" ? (io.stdin?.() ?? "") : json;
198
- const body = text ? JSON.parse(text) : {};
199
- if (!body || typeof body !== "object" || Array.isArray(body))
200
- throw new UsageError("--json must be an object");
201
- io.stdout.write(`${(await tools.call(name, body)).text}\n`);
202
- return 0;
266
+ const name = args.shift();
267
+ if (!name || name.startsWith("-"))
268
+ throw new UsageError("Usage: tools call <tool>.<command> [--json '{...}' | --<argument> <value> ...]");
269
+ const [toolName, commandName] = name.split(".", 2);
270
+ return await invoke(toolName, commandName ? [commandName, ...args] : args);
203
271
  }
204
272
  if (verb === "run") {
205
273
  const file = args[0];
@@ -227,11 +295,15 @@ export async function runToolsCommand(argv, io) {
227
295
  io.stdout.write(`${typeof value === "string" ? value : JSON.stringify(value ?? null)}\n`);
228
296
  return 0;
229
297
  }
230
- throw new UsageError(`tools: unknown command '${verb}'; tools --help`);
298
+ return await invoke(verb, args);
231
299
  }
232
300
  catch (error) {
233
301
  io.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
234
- return error instanceof UsageError ? 64 : 1;
302
+ if (error instanceof SchemaArgsError)
303
+ io.stderr.write(`Run \`${error.usage} --help\` for its arguments.\n`);
304
+ return error instanceof UsageError || error instanceof SchemaArgsError
305
+ ? 64
306
+ : 1;
235
307
  }
236
308
  }
237
309
  /** The shell entry point the session's `tools` shim runs. */
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/tools/cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EACL,gBAAgB,GAIjB,MAAM,aAAa,CAAC;AAErB,MAAM,IAAI,GAAG;IACX,8EAA8E;IAC9E,EAAE;IACF,oFAAoF;IACpF,yEAAyE;IACzE,uFAAuF;IACvF,8EAA8E;IAC9E,EAAE;IACF,oBAAoB;IACpB,mEAAmE;IACnE,iBAAiB;IACjB,MAAM;IACN,EAAE;IACF,8EAA8E;IAC9E,8DAA8D;CAC/D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,UAAW,SAAQ,KAAK;CAAG;AASjC,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAChE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,4FAA4F;AAC5F,SAAS,UAAU,CAAC,IAAqB;IACvC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAA0B,CAAC;IACzE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YAC9B,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAA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UAAU,IAAI;IACxB,OAAO,CAAC,QAAQ,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAC9D,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC;KACrC,CAAC,CAAC;AACL,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import type { ToolDefinition } from "@earendil-works/pi-coding-agent";
2
- /** Write the `tools` shim into `binDir`, for a bash call's PATH. */
3
- export declare function materializeToolsShim(binDir: string): Promise<string>;
2
+ /**
3
+ * Write the `tools` shim into `binDir`, for a bash call's PATH, and one shim
4
+ * per tool in `names`, so `issues list ...` is `tools issues list ...`. A
5
+ * tool shim shadows a system command of the same name (`mail`) in the
6
+ * agent's shell only; `tools <tool>` always reaches the tool.
7
+ */
8
+ export declare function materializeToolsShim(binDir: string, names?: readonly string[]): Promise<string>;
4
9
  /** The shell environment of a bash call that serves the `tools` command. */
5
10
  export declare function toolsShellEnv(env: NodeJS.ProcessEnv, binDir: string): NodeJS.ProcessEnv;
6
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/tools/shell.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAmBtE,oEAAoE;AACpE,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAa1E;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,UAAU,CAUnB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,cAAc,CAWhB"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/tools/shell.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAwBtE;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,SAAS,MAAM,EAAO,GAC5B,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,UAAU,CAUnB;AAeD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,cAAc,CAWhB"}
@@ -1,6 +1,7 @@
1
1
  import { chmod, mkdir, writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
+ import { COMMANDLESS_TOOLS } from "./cli.js";
4
5
  import { activeToolsSocket, TOOLS_SOCKET_ENV, withToolsBridge, } from "./bridge.js";
5
6
  function shellQuote(value) {
6
7
  return `'${value.replaceAll("'", `'\\''`)}'`;
@@ -9,17 +10,27 @@ function shellQuote(value) {
9
10
  function toolsEntrypointPath() {
10
11
  return fileURLToPath(new URL("tools/entry.js", import.meta.resolve("@introspection-ai/recipes")));
11
12
  }
12
- /** Write the `tools` shim into `binDir`, for a bash call's PATH. */
13
- export async function materializeToolsShim(binDir) {
13
+ /** A tool name that is safe as a file name and a shell word. */
14
+ const COMMAND_NAME = /^[A-Za-z][A-Za-z0-9_-]*$/;
15
+ /**
16
+ * Write the `tools` shim into `binDir`, for a bash call's PATH, and one shim
17
+ * per tool in `names`, so `issues list ...` is `tools issues list ...`. A
18
+ * tool shim shadows a system command of the same name (`mail`) in the
19
+ * agent's shell only; `tools <tool>` always reaches the tool.
20
+ */
21
+ export async function materializeToolsShim(binDir, names = []) {
14
22
  await mkdir(binDir, { recursive: true });
15
- const shimPath = join(binDir, "tools");
16
- await writeFile(shimPath, [
17
- "#!/bin/sh",
18
- `exec ${shellQuote(process.execPath)} ${shellQuote(toolsEntrypointPath())} "$@"`,
19
- "",
20
- ].join("\n"));
21
- await chmod(shimPath, 0o755);
22
- return shimPath;
23
+ const exec = `exec ${shellQuote(process.execPath)} ${shellQuote(toolsEntrypointPath())}`;
24
+ const write = async (name, line) => {
25
+ const path = join(binDir, name);
26
+ await writeFile(path, ["#!/bin/sh", line, ""].join("\n"));
27
+ await chmod(path, 0o755);
28
+ return path;
29
+ };
30
+ for (const name of names)
31
+ if (COMMAND_NAME.test(name) && name !== "tools")
32
+ await write(name, `${exec} ${shellQuote(name)} "$@"`);
33
+ return write("tools", `${exec} "$@"`);
23
34
  }
24
35
  /** The shell environment of a bash call that serves the `tools` command. */
25
36
  export function toolsShellEnv(env, binDir) {
@@ -33,6 +44,17 @@ export function toolsShellEnv(env, binDir) {
33
44
  [pathKey]: [binDir, env[pathKey]].filter(Boolean).join(":"),
34
45
  };
35
46
  }
47
+ /** The call form for each of `names` that has no commands, as the description says it. */
48
+ function commandless(names) {
49
+ const bare = names.filter((name) => COMMANDLESS_TOOLS.includes(name));
50
+ if (!bare.length)
51
+ return "";
52
+ const tools = bare.map((name) => "`" + name + "`").join(", ");
53
+ const calls = bare
54
+ .map((name) => "`" + name + " --<argument> <value>`")
55
+ .join(", ");
56
+ return `; ${tools} ${bare.length === 1 ? "has" : "have"} no commands: ${calls}`;
57
+ }
36
58
  /**
37
59
  * The bash tool with the `tools` command: each call serves the platform
38
60
  * tools `names` on a socket for its own shell, so a `tools call` in it is a
@@ -43,7 +65,7 @@ export function withToolsCommand(bash, names) {
43
65
  ...bash,
44
66
  // The tools are not declared, so this is how the model learns they exist;
45
67
  // the description reaches it even when a Recipe's SYSTEM.md replaces Pi's prompt.
46
- description: `${bash.description}\n\n${names.join(", ")} are not tools you call directly: reach them from bash with the \`tools\` command. \`tools list\` shows them, \`tools list <tool> --schema\` a tool's commands and arguments, \`tools call <tool>.<command> --json -\` with the arguments on stdin in a quoted heredoc (\`<<'JSON'\`), so quotes in them need no escaping, makes one call, and \`tools run\` with a script on stdin (\`await tools.<tool>.<command>({...})\`) makes several.`,
68
+ description: `${bash.description}\n\n${names.join(", ")} are not tools you call directly: each is a command in bash. \`<tool> --help\` lists its commands, \`<tool> <command> --help\` a command's arguments, and \`<tool> <command> --<argument> <value> ...\` makes one call${commandless(names)}. Any call takes every argument as JSON instead with \`--json -\` and the object on stdin in a quoted heredoc (\`<<'JSON'\`), so quotes in it need no escaping. \`tools list\` shows them all, and \`tools run\` with a script on stdin (\`await tools.<tool>.<command>({...})\`) makes several calls.`,
47
69
  execute: (toolCallId, params, signal, onUpdate, ctx) => withToolsBridge(ctx, names, () => bash.execute(toolCallId, params, signal, onUpdate, ctx)),
48
70
  };
49
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/tools/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC/C,CAAC;AAED,6EAA6E;AAC7E,SAAS,mBAAmB;IAC1B,OAAO,aAAa,CAClB,IAAI,GAAG,CAAC,gBAAgB,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAC5E,CAAC;AACJ,C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C;AACtB,CAAC"}
@@ -96,6 +96,7 @@ introspection_open({
96
96
  | { kind: "binding"; runtime: string; name: string; environment?: string }
97
97
  | { kind: "runtime"; runtime: string }
98
98
  | { kind: "task"; task: string }
99
+ | { kind: "issue"; issue: string } // introspection:I-7 as the issues tool returned it, or the issue's id
99
100
  | { kind: "repository"; provider: "github"; name: string; template?: string },
100
101
  reason: string, // one line the card shows
101
102
  wait?: boolean, // default false
@@ -109,29 +110,33 @@ label, e.g. `Install GitHub`). A host with no renderer for this kind still
109
110
  shows a plain question, which stays usable. The answers use the existing
110
111
  envelopes:
111
112
 
112
- | Outcome | Resume | The model sees |
113
- | ----------------------------------------- | ---------------------------------------------------------------- | ------------------------- |
114
- | Connected | `{ status: "resolved", payload: { answer: "connected" } }` | `Answer: connected` |
115
- | Came back from a `runtime` or `task` page | `{ status: "resolved", payload: { answer: "returned" } }` | `Answer: returned` |
116
- | The provider failed | `{ status: "resolved", payload: { answer: "failed: <error>" } }` | `Answer: failed: <error>` |
117
- | Not now | `{ status: "cancelled" }` | the declined envelope |
118
- | Reply in chat | `{ status: "cancelled", payload: { dismissed: true } }` | the dismissed text |
113
+ | Outcome | Resume | The model sees |
114
+ | -------------------------------------------------- | ---------------------------------------------------------------- | ------------------------- |
115
+ | Connected | `{ status: "resolved", payload: { answer: "connected" } }` | `Answer: connected` |
116
+ | Came back from a `runtime`, `task` or `issue` page | `{ status: "resolved", payload: { answer: "returned" } }` | `Answer: returned` |
117
+ | The provider failed | `{ status: "resolved", payload: { answer: "failed: <error>" } }` | `Answer: failed: <error>` |
118
+ | Not now | `{ status: "cancelled" }` | the declined envelope |
119
+ | Reply in chat | `{ status: "cancelled", payload: { dismissed: true } }` | the dismissed text |
119
120
 
120
121
  The answer is what the person did, not proof: the agent reads the real state
121
122
  before it says something is connected.
122
123
 
123
- | Host | With `wait: true` |
124
- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
125
- | Pi terminal (TUI) and RPC | Runs the Introspection CLI (`INTROSPECTION_CLI`, else `introspection` on `PATH`) until it returns: `connectors authorize <provider> --subject user` for a `connection`, `open --integrations <provider> --wait` for an `integration`, `open --runtime <runtime> --wait` for a `binding`, `open --repository --name <name> [--template <owner/repo>] --wait` for a `repository`. A `runtime` or `task` page has nothing to finish, so, like the hosted card, it runs `open --runtime <runtime>` or `open --task <task>` without `--wait` and answers `returned` once the page opens. Exit 0 answers `connected` (`returned` for a page); another exit answers `failed:` with the CLI's last error line. A `connector` or `sso` target, or a missing CLI, shows a Done / Not now dialog instead. The wait lasts up to an hour. |
126
- | Pause/resume host | The interrupt above; the host renders it and resumes with the answer; for a `runtime` or `task` page, opening it is the answer (`returned`). |
127
- | Headless and child agents | Declined. |
128
- | No channel | The unavailable envelope. |
124
+ | Host | With `wait: true` |
125
+ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
126
+ | Pi terminal (TUI) and RPC | Runs the Introspection CLI (`INTROSPECTION_CLI`, else `introspection` on `PATH`) until it returns: `connectors authorize <provider> --subject user` for a `connection`, `open --integrations <provider> --wait` for an `integration`, `open --runtime <runtime> --wait` for a `binding`, `open --repository --name <name> [--template <owner/repo>] --wait` for a `repository`. A `runtime`, `task` or `issue` page has nothing to finish, so, like the hosted card, it runs `open --runtime <runtime>`, `open --task <task>` or `open --issue <issue>` without `--wait` and answers `returned` once the page opens. Exit 0 answers `connected` (`returned` for a page); another exit answers `failed:` with the CLI's last error line. A `connector` or `sso` target, or a missing CLI, shows a Done / Not now dialog instead. The wait lasts up to an hour. |
127
+ | Pause/resume host | The interrupt above; the host renders it and resumes with the answer; for a `runtime`, `task` or `issue` page, opening it is the answer (`returned`). |
128
+ | Headless and child agents | Declined. |
129
+ | No channel | The unavailable envelope. |
129
130
 
130
- Without `wait`, nothing pauses: Pi's terminal opens a `runtime`, `task` or
131
- `binding` page, or starts an `integration` install, through the CLI, and the
131
+ Without `wait`, nothing pauses: Pi's terminal opens a `runtime`, `task`,
132
+ `issue` or `binding` page, or starts an `integration` install, through the CLI, and the
132
133
  result says the person has not acted yet; elsewhere the result tells the model
133
134
  to ask in its reply.
134
135
 
136
+ An `issue` target names an Introspection issue only. A handle from another
137
+ tracker (`linear:ENG-123`) fails, telling the agent to share that tracker's
138
+ own link instead.
139
+
135
140
  The target helpers (`parseIntrospectionOpenTarget`,
136
141
  `introspectionOpenTargetOf`, `introspectionOpenAction`,
137
142
  `INTROSPECTION_OPEN_ANSWER`) are exported from
@@ -42,6 +42,11 @@ mcp:
42
42
  Nothing about issues loads, and no `issues` tool is offered, unless a Recipe
43
43
  declares `pi.issues` and its agent selects `issues`.
44
44
 
45
+ When it does, the host also offers the `issues` skill
46
+ (`skills/issues/SKILL.md`), as it offers `skills/productivity/SKILL.md` with
47
+ `mail`: handles, statuses and priorities, and a workflow for tracking the
48
+ agent's own work.
49
+
45
50
  A declaration takes only these fields:
46
51
 
47
52
  | Field | Applies to | Meaning |
@@ -115,34 +120,36 @@ Every issue comes back in one shape, with a handle every later command takes:
115
120
 
116
121
  | Field | Linear | Jira | Introspection |
117
122
  | ------------------------ | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
118
- | `handle` | `linear:ENG-123` | `jira:PROJ-45` | `introspection:<display index>` |
123
+ | `handle` | `linear:ENG-123` | `jira:PROJ-45` | `introspection:I-7`, the project's issue key |
119
124
  | `title` | title | summary | title |
120
125
  | `description` (markdown) | description | description, from Atlassian Document Format (best-effort) | description |
121
126
  | `status.name` | workflow state | status | status |
122
127
  | `status.category` | backlog, unstarted, triage → open; started → in_progress; completed → done; canceled → cancelled | To Do → open, In Progress → in_progress, Done → done; a done status named like cancelled, won't do or rejected → cancelled | open → open, waiting → in_progress, closed → done, cancelled → cancelled |
123
128
  | `priority` | 0 none, 1 urgent, 2 high, 3 medium, 4 low | Highest → urgent, High → high, Medium → medium, Low and Lowest → low | low to urgent, no `none` |
124
- | `assignee` | assignee | assignee | none |
129
+ | `assignee` | assignee | assignee | the assignee's member id |
125
130
  | `labels` | labels | labels | tags |
126
131
  | `container` | team | project, with the issue type | the project |
127
132
  | `url` | ✓ | the site's `/browse/<key>` | not yet |
128
- | `comments` (on `get`) | ✓ | ✓ | from the issue's events |
133
+ | `comments` (on `get`) | ✓ | ✓ | read with the issue |
129
134
 
130
135
  ## What each provider supports
131
136
 
132
- | | `linear` | `jira` | `introspection` |
133
- | ------------ | -------------------------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------------- |
134
- | `search` | ✓ | ✓ (JQL) | ✓; text matches the 200 most recent issues; no assignee filter |
135
- | `get` | ✓ | ✓ | ✓ |
136
- | `create` | ✓, needs a team | ✓, needs a project and issue type | ✓, on the calling task |
137
- | `update` | ✓ | ✓ | ✓, no assignee |
138
- | `comment` | ✓ | ✓ | not yet |
139
- | `transition` | sets the state; a category picks the team's state of that type | applies the workflow transition that reaches the status | sets `status` |
140
-
141
- An Introspection comment is an event attached to the issue. The provider reads
142
- comments from `GET /v1/events?event_name=introspection.issue&issue_id=…`
143
- (`payload.comment`), and reads none from a data plane that does not record
144
- that family yet. It does not offer `comment` until the platform accepts one
145
- on `PATCH /v1/issues/{id}`.
137
+ | | `linear` | `jira` | `introspection` |
138
+ | ------------ | -------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------- |
139
+ | `search` | ✓ | ✓ (JQL) | ✓; text matches the 200 most recent issues; assignee: `me` or a member id |
140
+ | `get` | ✓ | ✓ | ✓ |
141
+ | `create` | ✓, needs a team | ✓, needs a project and issue type | ✓, on the calling task |
142
+ | `update` | ✓ | ✓ | ✓; assignee: a member id, or `none` |
143
+ | `comment` | ✓ | ✓ | ✓ |
144
+ | `transition` | sets the state; a category picks the team's state of that type | applies the workflow transition that reaches the status | sets `status` |
145
+
146
+ An Introspection comment is an event attached to the issue. The provider
147
+ writes one with `POST /v1/issues/{id}/comments` and reads them with the issue
148
+ (`GET /v1/issues/{id}?include=comments`, oldest first, at most 500). An issue's
149
+ `assignee` carries the member's `id` alone; a write takes a member id and no
150
+ `me`, since the runtime does not name the caller's. On a data plane without
151
+ these, `comment` and an assignee search answer `not_supported`, and `get`
152
+ returns no comments.
146
153
 
147
154
  ## Tool maps
148
155
 
@@ -110,8 +110,7 @@ neither field can authorize a tool excluded by `include`/`exclude`.
110
110
  Deferred tools remain authorized and discoverable. Recipes registers them with
111
111
  Pi's `deferred` exposure and, when at least one connector or MCP tool is
112
112
  deferred, activates Pi's `tool_search`. Calling it ranks the deferred tools by
113
- the words in their names, descriptions and input schemas (BM25, default limit
114
- 8) and declares the best matches for the next model request. Pi records the
113
+ the words in their names, descriptions and input schemas (BM25, default limit 8) and declares the best matches for the next model request. Pi records the
115
114
  change in the session, so loaded tools survive resume. It never grants access
116
115
  beyond the Recipe manifest and agent policy. Recipes also registers `mcp_search` as a
117
116
  compatibility alias when MCP tools are deferred.
@@ -321,10 +320,19 @@ cancels a call on the server when the command is interrupted. See [MCP authentic
321
320
  hosted binding details, and [Recipes extension](pi-extension.md) for the
322
321
  full session contract.
323
322
 
323
+ On pi-mcp, the Pi process serves the command's socket for the life of the
324
+ session, in a directory only its user can enter, and closes it when the
325
+ session ends. It runs up to 32 commands and calls at once and queues the rest.
326
+ A shell with no session listening, such as a process that outlives its
327
+ session, starts the same server as a standalone daemon, and a session on
328
+ mcporter always uses the standalone daemon.
329
+
324
330
  In tools mode, each Pi session—including each delegated child session—gets its
325
331
  own registered tool catalog and active set. The MCP daemon and mcporter config
326
332
  remain private to those wrappers; shell tools do not receive an `mcp` command,
327
- `MCPORTER_CONFIG`, or MCP session path.
333
+ `MCPORTER_CONFIG`, or MCP session path. On pi-mcp a tool call goes straight to the server
334
+ the session's process hosts, with the same authorization, timeout and
335
+ cancellation, rather than through its socket.
328
336
 
329
337
  In codemode, Pi's MCP support connects each server in the background when the
330
338
  session starts and keeps no state outside the session: no `mcp.json` is read