@introspection-ai/recipes 0.52.1 → 0.53.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 (67) 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/documents/arguments.d.ts +218 -0
  6. package/dist/documents/arguments.d.ts.map +1 -0
  7. package/dist/documents/arguments.generated.d.ts +12 -0
  8. package/dist/documents/arguments.generated.d.ts.map +1 -0
  9. package/dist/documents/arguments.generated.js +341 -0
  10. package/dist/documents/arguments.generated.js.map +1 -0
  11. package/dist/documents/arguments.js +8 -0
  12. package/dist/documents/arguments.js.map +1 -0
  13. package/dist/documents/tools.d.ts.map +1 -1
  14. package/dist/documents/tools.js +11 -164
  15. package/dist/documents/tools.js.map +1 -1
  16. package/dist/issues/arguments.d.ts +87 -0
  17. package/dist/issues/arguments.d.ts.map +1 -0
  18. package/dist/issues/arguments.generated.d.ts +11 -0
  19. package/dist/issues/arguments.generated.d.ts.map +1 -0
  20. package/dist/issues/arguments.generated.js +116 -0
  21. package/dist/issues/arguments.generated.js.map +1 -0
  22. package/dist/issues/arguments.js +10 -0
  23. package/dist/issues/arguments.js.map +1 -0
  24. package/dist/issues/tool.d.ts +9 -23
  25. package/dist/issues/tool.d.ts.map +1 -1
  26. package/dist/issues/tool.js +37 -35
  27. package/dist/issues/tool.js.map +1 -1
  28. package/dist/mcp/cli/core.d.ts.map +1 -1
  29. package/dist/mcp/cli/core.js +75 -92
  30. package/dist/mcp/cli/core.js.map +1 -1
  31. package/dist/mcp/cli/help.d.ts.map +1 -1
  32. package/dist/mcp/cli/help.js +3 -2
  33. package/dist/mcp/cli/help.js.map +1 -1
  34. package/dist/mcp/cli/policy.d.ts +1 -0
  35. package/dist/mcp/cli/policy.d.ts.map +1 -1
  36. package/dist/mcp/cli/policy.js +9 -7
  37. package/dist/mcp/cli/policy.js.map +1 -1
  38. package/dist/mcp-chunks/{chunk-CGJ2XOSF.js → chunk-T5BPTC3T.js} +893 -484
  39. package/dist/mcp-daemon.js +1 -1
  40. package/dist/mcp-run-worker.js +1 -1
  41. package/dist/recipe/manifest.generated.d.ts +1 -1
  42. package/dist/recipe/manifest.generated.js +1 -1
  43. package/dist/search/arguments.d.ts +35 -0
  44. package/dist/search/arguments.d.ts.map +1 -0
  45. package/dist/search/arguments.generated.d.ts +4 -0
  46. package/dist/search/arguments.generated.d.ts.map +1 -0
  47. package/dist/search/arguments.generated.js +37 -0
  48. package/dist/search/arguments.generated.js.map +1 -0
  49. package/dist/search/arguments.js +11 -0
  50. package/dist/search/arguments.js.map +1 -0
  51. package/dist/search/tool.d.ts +1 -1
  52. package/dist/search/tool.d.ts.map +1 -1
  53. package/dist/search/tool.js +16 -33
  54. package/dist/search/tool.js.map +1 -1
  55. package/dist/session.js +1 -1
  56. package/dist/session.js.map +1 -1
  57. package/dist/tools/cli.d.ts +2 -0
  58. package/dist/tools/cli.d.ts.map +1 -1
  59. package/dist/tools/cli.js +110 -38
  60. package/dist/tools/cli.js.map +1 -1
  61. package/dist/tools/shell.d.ts +7 -2
  62. package/dist/tools/shell.d.ts.map +1 -1
  63. package/dist/tools/shell.js +33 -11
  64. package/dist/tools/shell.js.map +1 -1
  65. package/docs/issues/README.md +18 -16
  66. package/docs/providers.md +38 -29
  67. package/package.json +10 -11
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,IA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AC,SAAS,KAAK,CAAC,KAAK,gCAAgC,CAAC,CAAC;QACxE,OAAO,KAAK,YAAY,UAAU,IAAI,KAAK,YAAY,eAAe;YACpE,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;AACH,CAAC;AAED,6DAA6D;AAC7D,MAAM,CAAC,KAAK,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,CA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MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,CACrD,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAC/B,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CACxD;KACc,CAAC;AACtB,CAAC"}
@@ -121,28 +121,30 @@ Every issue comes back in one shape, with a handle every later command takes:
121
121
  | `status.name` | workflow state | status | status |
122
122
  | `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
123
  | `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 |
124
+ | `assignee` | assignee | assignee | the assignee's member id |
125
125
  | `labels` | labels | labels | tags |
126
126
  | `container` | team | project, with the issue type | the project |
127
127
  | `url` | ✓ | the site's `/browse/<key>` | not yet |
128
- | `comments` (on `get`) | ✓ | ✓ | from the issue's events |
128
+ | `comments` (on `get`) | ✓ | ✓ | read with the issue |
129
129
 
130
130
  ## What each provider supports
131
131
 
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}`.
132
+ | | `linear` | `jira` | `introspection` |
133
+ | ------------ | -------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------- |
134
+ | `search` | ✓ | ✓ (JQL) | ✓; text matches the 200 most recent issues; assignee: `me` or a member id |
135
+ | `get` | ✓ | ✓ | ✓ |
136
+ | `create` | ✓, needs a team | ✓, needs a project and issue type | ✓, on the calling task |
137
+ | `update` | ✓ | ✓ | ✓; assignee: a member id, or `none` |
138
+ | `comment` | ✓ | ✓ | ✓ |
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
142
+ writes one with `POST /v1/issues/{id}/comments` and reads them with the issue
143
+ (`GET /v1/issues/{id}?include=comments`, oldest first, at most 500). An issue's
144
+ `assignee` carries the member's `id` alone; a write takes a member id and no
145
+ `me`, since the runtime does not name the caller's. On a data plane without
146
+ these, `comment` and an assignee search answer `not_supported`, and `get`
147
+ returns no comments.
146
148
 
147
149
  ## Tool maps
148
150
 
package/docs/providers.md CHANGED
@@ -144,11 +144,11 @@ One `issues` tool with these commands:
144
144
  | `transition` | move to another status |
145
145
 
146
146
  An Introspection issue is like a task: a row the issues API changes (title,
147
- status, priority, tags), with immutable values attached to it, its conversation
148
- (the issue's worker task chat) and its events (history, requests, comments).
149
- The issues API writes the events for every change through one command writer;
150
- a comment is one more, never a change to the row, and not a message in the
151
- issue's chat, which its worker agent would answer.
147
+ status, priority, tags, the people on it), with immutable values attached to
148
+ it, its conversation (the issue's worker task chat) and its events (history,
149
+ comments). The issues API writes the events for every change; a comment is one
150
+ more, never a change to the row, and not a message in the issue's chat, which
151
+ its worker agent would answer.
152
152
 
153
153
  Every issue is returned in one shape, with a provider-scoped handle that every
154
154
  later command takes:
@@ -161,7 +161,7 @@ later command takes:
161
161
  | `status.name` | workflow state | status | status |
162
162
  | `status.category` (`open`, `in_progress`, `done`, `cancelled`) | state type: backlog and unstarted → open, started → in_progress, completed → done, canceled → cancelled | status category: To Do → open, In Progress → in_progress, Done → done | open → open, waiting → in_progress, closed → done, cancelled → cancelled |
163
163
  | `priority` (`none`, `low`, `medium`, `high`, `urgent`) | 0–4 | Highest → urgent … Lowest → low | the same scale, without `none` |
164
- | `assignee` | assignee | assignee | none |
164
+ | `assignee` | assignee | assignee | the assignee's member id |
165
165
  | `labels` | labels | labels | tags |
166
166
  | `container` | team | project and issue type | the Recipe's project |
167
167
  | `url`, `created_at`, `updated_at` | ✓ | ✓ | ✓ |
@@ -169,18 +169,20 @@ later command takes:
169
169
  The providers differ, so each declares the commands and fields it supports in
170
170
  `capabilities`, as productivity providers do:
171
171
 
172
- - **Comments:** Linear and Jira have them. An Introspection comment is an
173
- attached event, written like every other change to an issue: `PATCH
174
- /v1/issues/{id}` with a nested `comment`, which the issue command writer
175
- records as an `introspection.issue.comment` event.
176
- The issues API stays CRUD on Postgres and never returns comments; the
177
- provider reads them straight from the event log
178
- (`GET /v1/events?event_name=introspection.issue&issue_id=…`, `payload.comment`)
179
- through the SDK's events client, with no helper of its own. Until the
180
- platform accepts `comment`, the provider does not offer it. `open_requests`
181
- are questions put to a person, not comments.
182
- - **Assignee:** Introspection's issues have an owner (`member_id`), not an
183
- assignee, so `update` takes no assignee there.
172
+ - **Comments:** all three have them. An Introspection comment is an event
173
+ attached to the issue, written with `POST /v1/issues/{id}/comments` and read
174
+ back with the issue (`GET /v1/issues/{id}?include=comments`, oldest first, at
175
+ most 500), so `get` makes one read and never pages the event log. A data
176
+ plane without that route answers `comment` with `not_supported`, and `get`
177
+ returns no comments from one.
178
+ - **Assignee:** an Introspection issue is assigned to a member, and the
179
+ provider knows people only by member id, so the issue's `assignee` carries an
180
+ `id` alone. `search` takes `me` (the caller) or a member id. `create` and
181
+ `update` take a member id, and `update` takes `none` to unassign; a write
182
+ takes no `me`, since the API assigns by member id and the runtime does not
183
+ name the caller's. A name or email is refused with `invalid_request`. A data
184
+ plane whose issues have no assignee answers an assignee search with
185
+ `not_supported` rather than list every issue.
184
186
  - **Moving an issue:** `transition` takes a status name or category. Linear
185
187
  sets the state, Jira applies the workflow transition that reaches it, and
186
188
  Introspection sets `status`.
@@ -193,8 +195,7 @@ Introspection issues have no `url` yet, and `/v1/issues` has no text filter, so
193
195
  the `introspection` provider's `search` matches text against the most recent
194
196
  issues it lists. The `introspection` provider uses the JavaScript SDK
195
197
  (`@introspection-sdk/introspection-node`) on the task's own session, not the
196
- CLI: its issues client for the row and its events client for comments and
197
- history. It runs in the agent's process, with typed responses and no CLI to
198
+ CLI: its issues client for the row and its comments. It runs in the agent's process, with typed responses and no CLI to
198
199
  install.
199
200
 
200
201
  All three ship in one package, `@introspection-ai/recipe-issues`, a companion of
@@ -293,25 +294,33 @@ A result that silently stops at the first page is the bug reviews kept finding.
293
294
 
294
295
  ### Tool arguments
295
296
 
296
- The arguments of a first-party command tool (`mail`, `calendar`, `drive`,
297
- `channels`) are TypeScript types, and their JSON Schemas are generated from
297
+ The arguments of a first-party tool (`mail`, `calendar`, `drive`, `channels`,
298
+ `issues`, `documents`, `web_search`) are TypeScript types, and their JSON Schemas are generated from
298
299
  them by [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator).
299
300
 
300
301
  - **One type per command,** `<Tool><Command>Arguments` in the family's
301
302
  `arguments.ts` ([`src/productivity/arguments.ts`](../src/productivity/arguments.ts),
302
- [`src/channels/arguments.ts`](../src/channels/arguments.ts)): `MailDraftArguments`
303
+ [`src/channels/arguments.ts`](../src/channels/arguments.ts),
304
+ [`src/issues/arguments.ts`](../src/issues/arguments.ts),
305
+ [`src/documents/arguments.ts`](../src/documents/arguments.ts)): `MailDraftArguments`
303
306
  is `mail draft`. A field shared by several commands is one type alias, so it
304
- reaches the model once.
307
+ reaches the model once. A tool with no commands has one type,
308
+ `WebSearchArguments` in [`src/search/arguments.ts`](../src/search/arguments.ts).
305
309
  - **A field's doc comment is its description, and its tags are its limits:**
306
310
  `@minLength`, `@maxLength`, `@minimum`, `@maximum`, `@minItems`, `@maxItems`,
307
311
  `@default`, and `@asType integer` for a whole number. Every field has a
308
- description; `test/tool-arguments.test.ts` fails on one without. A word that
312
+ description; `test/tool-arguments.test.ts` fails on one without. `web_search`
313
+ is the exception, held to a schema size budget. A word that
309
314
  varies by provider is a `{word}` placeholder the tool fills at registration
310
315
  (`{folder}`, `{labels}`).
311
- - **Regenerate with `pnpm schemas`** and commit the `arguments.generated.ts`
312
- beside the source. CI runs `pnpm schemas:check`, which fails when a
313
- generated file is stale. Never edit the generated file, and never hand-write
314
- a TypeBox schema for a tool's arguments.
316
+ - **The build generates them** (`pnpm schemas`, which runs wherever `pnpm
317
+ manifest` does) into a gitignored `arguments.generated.ts` beside the
318
+ source; it is never committed or edited. `test/tool-arguments.test.ts` checks
319
+ each tool's `--help` reads them. Never hand-write a TypeBox schema for a
320
+ tool's arguments.
321
+ - **A field's CLI flag is its name in kebab-case** (`--max-results`), which the
322
+ schema adapter derives; the exact name stays accepted, and a field whose
323
+ kebab form would collide with another keeps its exact name.
315
324
  - **The tool merges the commands with `commandParameters`**
316
325
  ([`src/command-parameters.ts`](../src/command-parameters.ts)): one flat
317
326
  object with each field once, and the commands as its `anyOf` for validators