@introspection-ai/recipes 0.40.1 → 0.42.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 (54) hide show
  1. package/dist/artifact-viewer-tui.d.ts +74 -0
  2. package/dist/artifact-viewer-tui.d.ts.map +1 -0
  3. package/dist/artifact-viewer-tui.js +179 -0
  4. package/dist/artifact-viewer-tui.js.map +1 -0
  5. package/dist/artifact-viewer.d.ts +148 -0
  6. package/dist/artifact-viewer.d.ts.map +1 -0
  7. package/dist/artifact-viewer.js +538 -0
  8. package/dist/artifact-viewer.js.map +1 -0
  9. package/dist/ask-user-question.d.ts +5 -1
  10. package/dist/ask-user-question.d.ts.map +1 -1
  11. package/dist/ask-user-question.js +43 -10
  12. package/dist/ask-user-question.js.map +1 -1
  13. package/dist/connector-tools.d.ts +2 -0
  14. package/dist/connector-tools.d.ts.map +1 -1
  15. package/dist/connector-tools.js +1 -0
  16. package/dist/connector-tools.js.map +1 -1
  17. package/dist/inspect.d.ts +3 -0
  18. package/dist/inspect.d.ts.map +1 -1
  19. package/dist/inspect.js +2 -0
  20. package/dist/inspect.js.map +1 -1
  21. package/dist/interaction-tui.d.ts +25 -3
  22. package/dist/interaction-tui.d.ts.map +1 -1
  23. package/dist/interaction-tui.js +145 -31
  24. package/dist/interaction-tui.js.map +1 -1
  25. package/dist/interactions.d.ts.map +1 -1
  26. package/dist/interactions.js +5 -0
  27. package/dist/interactions.js.map +1 -1
  28. package/dist/pi-extension.d.ts.map +1 -1
  29. package/dist/pi-extension.js +62 -4
  30. package/dist/pi-extension.js.map +1 -1
  31. package/dist/recipe/skills-prompt.d.ts +29 -1
  32. package/dist/recipe/skills-prompt.d.ts.map +1 -1
  33. package/dist/recipe/skills-prompt.js +42 -1
  34. package/dist/recipe/skills-prompt.js.map +1 -1
  35. package/dist/recipe/skills.d.ts +13 -0
  36. package/dist/recipe/skills.d.ts.map +1 -1
  37. package/dist/recipe/skills.js +37 -2
  38. package/dist/recipe/skills.js.map +1 -1
  39. package/dist/recipe/suggestions.d.ts +58 -0
  40. package/dist/recipe/suggestions.d.ts.map +1 -0
  41. package/dist/recipe/suggestions.js +157 -0
  42. package/dist/recipe/suggestions.js.map +1 -0
  43. package/dist/session.d.ts +5 -1
  44. package/dist/session.d.ts.map +1 -1
  45. package/dist/session.js +19 -4
  46. package/dist/session.js.map +1 -1
  47. package/dist/suggestion-picker.d.ts +30 -0
  48. package/dist/suggestion-picker.d.ts.map +1 -0
  49. package/dist/suggestion-picker.js +124 -0
  50. package/dist/suggestion-picker.js.map +1 -0
  51. package/docs/host-api.md +3 -0
  52. package/docs/pi-extension.md +41 -0
  53. package/docs/recipe-format.md +63 -1
  54. package/package.json +9 -5
@@ -0,0 +1,124 @@
1
+ /**
2
+ * The first-run picker: a new Recipe session in the terminal asks once
3
+ * "What would you like to do?" with up to three of the Recipe's prompt
4
+ * templates marked `suggest: true`, through the same terminal helper
5
+ * `ask_user_question` uses. With none marked, it does not ask.
6
+ * Picking one sends it as the first message; typing an answer sends that;
7
+ * Esc leaves the empty prompt. An initial message given on the command line
8
+ * dismisses the picker before it can send anything.
9
+ */
10
+ import { askInTerminal } from "./ask-user-question.js";
11
+ import { expandWithoutArguments, fillSuggestion, pickSuggestions, readRecipeSuggestions, seededRandom, } from "./recipe/suggestions.js";
12
+ export const SUGGESTIONS_QUESTION = "What would you like to do?";
13
+ /** Pins which three suggestions show, for tests and evals. */
14
+ export const SUGGESTIONS_SEED_ENV = "PI_RECIPES_SUGGESTIONS_SEED";
15
+ function hasMessages(ctx) {
16
+ const entries = ctx.sessionManager?.getEntries?.() ?? [];
17
+ return entries.some((entry) => entry.type === "message");
18
+ }
19
+ function localDate(now = new Date()) {
20
+ const pad = (value) => String(value).padStart(2, "0");
21
+ return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
22
+ }
23
+ /** What Pi can fill locally: today's date and the git author name. */
24
+ async function localValues(pi) {
25
+ const values = { today: localDate() };
26
+ try {
27
+ const result = await pi.exec("git", ["config", "user.name"], { timeout: 2000 });
28
+ const name = result.code === 0 ? result.stdout.trim() : "";
29
+ if (name)
30
+ values["member.name"] = name;
31
+ }
32
+ catch {
33
+ // No git, or no name configured: leave {{member.name}} as written.
34
+ }
35
+ return values;
36
+ }
37
+ function suggestionOptions(suggestions) {
38
+ const seen = new Set();
39
+ return suggestions.map((suggestion) => {
40
+ const command = `/${suggestion.name}`;
41
+ const label = suggestion.description && !seen.has(suggestion.description)
42
+ ? suggestion.description
43
+ : command;
44
+ seen.add(label);
45
+ return label === command ? { label } : { label, description: command };
46
+ });
47
+ }
48
+ /** Ask once and send the answer; resolves when the picker has settled. */
49
+ export async function offerRecipeSuggestions(pi, ctx, suggestions, signal) {
50
+ const options = suggestionOptions(suggestions);
51
+ let outcome;
52
+ try {
53
+ outcome = await askInTerminal(SUGGESTIONS_QUESTION, options, false, ctx.ui, signal ? { signal } : {}, signal, true);
54
+ }
55
+ catch {
56
+ return; // Dismissed by an initial message.
57
+ }
58
+ const answer = outcome.type === "answered" ? outcome.answer : undefined;
59
+ if (!answer)
60
+ return;
61
+ const picked = suggestions[options.findIndex((option) => option.label === answer)];
62
+ if (!picked) {
63
+ // A typed answer behaves like text typed in the editor.
64
+ pi.sendUserMessage(answer, { expandPromptTemplates: true });
65
+ return;
66
+ }
67
+ if (picked.argumentHint?.includes("<")) {
68
+ // A required argument: put the command in the editor for the user to finish.
69
+ ctx.ui.setEditorText(`/${picked.name} `);
70
+ return;
71
+ }
72
+ const values = picked.placeholders.length > 0 ? await localValues(pi) : {};
73
+ // An initial message or a session change can abort the picker while git runs.
74
+ if (signal?.aborted)
75
+ return;
76
+ pi.sendUserMessage(fillSuggestion(expandWithoutArguments(picked.text), values));
77
+ }
78
+ /**
79
+ * Create the picker and register the `input` handler that lets a
80
+ * command-line or typed message dismiss it.
81
+ */
82
+ export function createRecipeSuggestionPicker(pi, env) {
83
+ let pending;
84
+ const cancel = () => {
85
+ pending?.abort();
86
+ pending = undefined;
87
+ };
88
+ pi.on("input", (event) => {
89
+ if (event.source !== "extension")
90
+ cancel();
91
+ return { action: "continue" };
92
+ });
93
+ return {
94
+ cancel,
95
+ sessionStarted(event, ctx, promptPaths) {
96
+ cancel();
97
+ if (ctx.mode !== "tui")
98
+ return;
99
+ if (event.reason !== "startup" && event.reason !== "new")
100
+ return;
101
+ if (promptPaths.length === 0 || hasMessages(ctx))
102
+ return;
103
+ const seed = env[SUGGESTIONS_SEED_ENV]?.trim();
104
+ const suggestions = pickSuggestions(readRecipeSuggestions(promptPaths), 3, seed ? seededRandom(seed) : Math.random);
105
+ if (suggestions.length === 0)
106
+ return;
107
+ const controller = new AbortController();
108
+ pending = controller;
109
+ // Pi sends a command-line message only after session_start returns, so
110
+ // ask on the next tick; that message's input event dismisses the picker.
111
+ setTimeout(() => {
112
+ if (controller.signal.aborted)
113
+ return;
114
+ if (hasMessages(ctx) || ctx.isIdle?.() === false)
115
+ return;
116
+ void offerRecipeSuggestions(pi, ctx, suggestions, controller.signal).finally(() => {
117
+ if (pending === controller)
118
+ pending = undefined;
119
+ });
120
+ }, 0);
121
+ },
122
+ };
123
+ }
124
+ //# sourceMappingURL=suggestion-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestion-picker.js","sourceRoot":"","sources":["../src/suggestion-picker.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,YAAY,GAGb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AACjE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,6BAA6B,CAAC;AAElE,SAAS,WAAW,CAAC,GAAqB;IACxC,MAAM,OAAO,GAAG,GAAG,CAAC,cAAc,EAAE,UAAU,E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I,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK;gBAAE,OAAO;YACjE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,GAAG,CAAC;gBAAE,OAAO;YACzD,MAAM,IAAI,GAAG,GAAG,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAC;YAC/C,MAAM,WAAW,GAAG,eAAe,CACjC,qBAAqB,CAAC,WAAW,CAAC,EAClC,CAAC,EACD,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CACxC,CAAC;YACF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YACrC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;YACzC,OAAO,GAAG,UAAU,CAAC;YACrB,uEAAuE;YACvE,yEAAyE;YACzE,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,UAAU,CAAC,MAAM,CAAC,OAAO;oBAAE,OAAO;gBACtC,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,KAAK,KAAK;oBAAE,OAAO;gBACzD,KAAK,sBAAsB,CAAC,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;oBAChF,IAAI,OAAO,KAAK,UAAU;wBAAE,OAAO,GAAG,SAAS,CAAC;gBAClD,CAAC,CAAC,CAAC;YACL,CAAC,EAAE,CAAC,CAAC,CAAC;QACR,CAAC;KACF,CAAC;AACJ,CAAC"}
package/docs/host-api.md CHANGED
@@ -98,6 +98,9 @@ It:
98
98
  to prepare a session that does no work;
99
99
  - loads the complete ordered Recipe extension closure, selected skills, and
100
100
  package prompts;
101
+ - offers only the Recipe's selected skills, the `documents` tool's skills, and
102
+ any `additionalSkillPaths` the host passes; a skill an extension adds through
103
+ `resources_discover` is not offered;
101
104
  - registers the shared subagent tool;
102
105
  - creates and binds the Pi `AgentSession`;
103
106
  - returns one idempotent `dispose()` boundary.
@@ -73,6 +73,47 @@ For the selected agent, the extension:
73
73
  See [Recipe Format](recipe-format.md) for the authored contract and
74
74
  [Agent composition](agent-composition.md) for inheritance and selection.
75
75
 
76
+ ## Artifact panel
77
+
78
+ List `show_artifact` in an agent's `tools` and the agent can show the user a
79
+ markdown file it wrote, such as a design brief, `evals/cases/*.md` or a
80
+ report, rendered in a panel on the right of Pi's terminal, instead of only
81
+ printing its path. Agents that do not list it never see the tool or `/recipe view`.
82
+
83
+ ```yaml
84
+ tools: [read, write, edit, ask_user_question, show_artifact]
85
+ ```
86
+
87
+ ```ts
88
+ show_artifact({ path: "evals/cases/refund.md" }) // relative to the working directory
89
+ ```
90
+
91
+ The tool refuses a path outside the working directory (including a symlink
92
+ that leads out of it), a missing file, and anything that is not `.md` or
93
+ `.markdown`. The panel takes the top-right 45% of the terminal at full height
94
+ and shows the file name and the visible line range. It opens without taking
95
+ the keyboard, so the user keeps typing in the editor. Showing another file
96
+ replaces the content, and the panel re-renders when the file changes on disk.
97
+
98
+ | Key | Where | Does |
99
+ | --- | --- | --- |
100
+ | `Alt+R` | editor or panel | Moves the keyboard to the panel and back; with no panel open, reopens the last file |
101
+ | `Up` / `Down`, `PgUp` / `PgDn`, `Home` / `End` | panel | Scroll |
102
+ | `o` | panel | Opens the file with the system's default app (`open`, `xdg-open` or `start`) |
103
+ | `Esc` / `q` | panel | Closes the panel |
104
+
105
+ `/recipe view <file>` opens a file the same way; `/recipe view` on its own opens
106
+ the last markdown file the agent showed or wrote with `write` or `edit` in this
107
+ session, and `/recipe close` closes the panel from the editor. They are
108
+ subcommands of `/recipe`, so they never clash with another extension's or your
109
+ own commands.
110
+
111
+ The panel exists only in Pi's interactive terminal. In print, RPC and embedded
112
+ sessions the tool returns `The file is at <path>. The artifact panel is only
113
+ available in Pi's interactive terminal, ...` so the model can tell the user
114
+ where to look. If a Recipe extension registers its own `show_artifact`, the
115
+ host keeps it and registers neither the built-in tool nor `/recipe view`.
116
+
76
117
  ## Structured child events
77
118
 
78
119
  Pi's JSON mode emits root session events directly. Recipes appends one Pi
@@ -299,10 +299,71 @@ A skill is named by its `SKILL.md` frontmatter `name`, then by its containing
299
299
  directory; a root-level unnamed `SKILL.md` uses the portable fallback name
300
300
  `skill`.
301
301
 
302
+ In recipe mode the agent sees only the Recipe's skills: the ones its agent
303
+ selects from the Recipe and its dependency and peer packages, plus the
304
+ `documents` tool's core skill and profile, wherever the format package comes
305
+ from (a dependency, a peer, or the copy beside Recipes). These arrive through
306
+ Recipes' own resolution, so Pi's `--no-skills` does not remove them. Skills
307
+ Pi discovers anywhere else (an installed Pi package, the user or project
308
+ skills folder, `--skill <path>`) never reach the prompt or a `/skill:`
309
+ command, under `pi --recipe` and the session API alike. To use a skill, add
310
+ it to the Recipe or a package it depends on.
311
+
302
312
  Prompt templates are declared by `pi.prompts`. They retain Pi's normal SDK and
303
313
  TUI behavior: hosts expose them through `AgentSession.promptTemplates`, and a
304
314
  caller invokes one by prompting with its slash command and arguments.
305
315
 
316
+ ### Prompt templates are suggestions
317
+
318
+ A Recipe's suggestions are the things a new user can ask it to do. They are
319
+ the prompt templates marked with `suggest: true` in their frontmatter; there
320
+ is no separate manifest field. Templates without the mark still work as
321
+ `/name` commands and are never suggested. Give each suggested template a
322
+ short `description` (ten words or fewer), because that is what people see:
323
+
324
+ ```markdown
325
+ ---
326
+ suggest: true
327
+ description: Redline a contract against our playbook
328
+ argument-hint: "[contract]"
329
+ ---
330
+ Redline ${1:-the attached contract} against the playbook. Today is {{today}}.
331
+ ```
332
+
333
+ - **In Pi.** A new session in the terminal (`pi --recipe <dir>`, or
334
+ `introspection local`) with no messages asks once, "What would you like to
335
+ do?", with up to three marked templates (a random three, in file order,
336
+ when more are marked) and a row to type your own request. With none
337
+ marked, it does not ask. Picking one sends it as the first message;
338
+ a template whose `argument-hint` has a required `<argument>` is put in the
339
+ editor instead, for you to finish. Typing sends what you typed, and Esc
340
+ leaves the empty prompt. Set `PI_RECIPES_SUGGESTIONS_SEED` to pin which
341
+ three show. The picker never appears on resume, outside the terminal UI,
342
+ or when Pi starts with a message.
343
+ - **Starting with one.** Pi expands a template given as the initial message,
344
+ so `pi --recipe <dir> "/redline nda.docx"` (or
345
+ `introspection local -- "/redline nda.docx"`) starts with it expanded.
346
+ - **Placeholders.** Besides Pi's `$1` and `${1:-default}` arguments, a
347
+ template may use `{{member.name}}`, `{{member.email}}`, `{{org.name}}` and
348
+ `{{today}}` (an ISO date). A host fills the ones it knows and leaves the rest
349
+ as written. Pi's picker fills `{{today}}`, and `{{member.name}}` from
350
+ `git config user.name`; a template typed as `/name` is sent unfilled.
351
+ - **Other surfaces.** `listRecipeSuggestions(recipeDir)` returns the marked
352
+ templates as `{ name, description, argumentHint?, text, placeholders }[]`, and
353
+ `fillSuggestion(text, values)` fills placeholders; both are exported from
354
+ `@introspection-ai/recipes/suggestions`.
355
+ `inspectRecipe` includes the same list as `suggestions`. A host that holds
356
+ the Recipe's files rather than a directory, such as the control plane when
357
+ it validates a version, reads the same list with `list_recipe_suggestions`
358
+ from `introspection-recipe-check` (Rust or Python).
359
+ - **YAML 1.2.** Only `suggest: true` marks a template. As in Pi, `yes`, `on`
360
+ and `"true"` are not booleans, so they don't count.
361
+ - **Checks.** For a marked template, the checker warns when it has no
362
+ `description` (`prompts.description_missing`), when the description is over
363
+ ten words (`prompts.description_long`), or when it uses a placeholder outside
364
+ the list above (`prompts.placeholder_unknown`). A `suggest` value that is not
365
+ a boolean is also a warning (`prompts.suggest_invalid`).
366
+
306
367
  Recipe-owned Pi extensions are declared by `pi.extensions`. The deterministically
307
368
  resolved set forms the package's executable trust boundary and loads for every
308
369
  root and child session. Package membership means execution; agent YAML cannot
@@ -407,9 +468,10 @@ lists them in `tools`:
407
468
  | Tool | What it does |
408
469
  | --- | --- |
409
470
  | `ask_user_question` | Asks the user one to four multiple-choice questions and waits for the answers; the user can always type their own answer. Works in Pi's terminal, on pause/resume hosts and headless. See [Interactions](interactions.md#the-built-in-ask_user_question-tool). |
471
+ | `show_artifact` | Shows a markdown file the agent wrote (a brief, test cases, a report) in a panel on the right of Pi's terminal, and adds `/recipe view` and `/recipe close`. Elsewhere it returns the file's path as text. See [Pi extension](pi-extension.md#artifact-panel). |
410
472
 
411
473
  ```yaml
412
- tools: [read, bash, ask_user_question]
474
+ tools: [read, bash, ask_user_question, show_artifact]
413
475
  ```
414
476
 
415
477
  If a Recipe extension registers its own `ask_user_question`, the host keeps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@introspection-ai/recipes",
3
- "version": "0.40.1",
3
+ "version": "0.42.0",
4
4
  "description": "The open format for vertical agents, built on Pi.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -82,6 +82,10 @@
82
82
  "./inspect": {
83
83
  "types": "./dist/inspect.d.ts",
84
84
  "import": "./dist/inspect.js"
85
+ },
86
+ "./suggestions": {
87
+ "types": "./dist/recipe/suggestions.d.ts",
88
+ "import": "./dist/recipe/suggestions.js"
85
89
  }
86
90
  },
87
91
  "pi": {
@@ -102,10 +106,10 @@
102
106
  "@introspection-ai/recipe-channel-slack": ">=0.6.0",
103
107
  "@introspection-ai/recipe-documents-docx": ">=0.3.0",
104
108
  "@introspection-ai/recipe-documents-pdf": ">=0.2.0",
105
- "@introspection-ai/mcp-client-linux-x64": "0.40.1",
106
- "@introspection-ai/mcp-client-linux-arm64": "0.40.1",
107
- "@introspection-ai/mcp-client-darwin-arm64": "0.40.1",
108
- "@introspection-ai/mcp-client-darwin-x64": "0.40.1"
109
+ "@introspection-ai/mcp-client-linux-x64": "0.42.0",
110
+ "@introspection-ai/mcp-client-linux-arm64": "0.42.0",
111
+ "@introspection-ai/mcp-client-darwin-arm64": "0.42.0",
112
+ "@introspection-ai/mcp-client-darwin-x64": "0.42.0"
109
113
  },
110
114
  "peerDependencies": {
111
115
  "@earendil-works/pi-agent-core": ">=1.1.0 <2.0.0",