@introspection-ai/recipes 0.13.0 → 0.14.1
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.
- package/README.md +46 -57
- package/dist/{agent-tool.d.ts → agents.d.ts} +4 -1
- package/dist/agents.d.ts.map +1 -0
- package/dist/{agent-tool.js → agents.js} +1 -1
- package/dist/agents.js.map +1 -0
- package/dist/api/extensions.d.ts +3 -0
- package/dist/api/extensions.d.ts.map +1 -0
- package/dist/api/extensions.js +2 -0
- package/dist/api/extensions.js.map +1 -0
- package/dist/api/mcp.d.ts +4 -0
- package/dist/api/mcp.d.ts.map +1 -0
- package/dist/api/mcp.js +2 -0
- package/dist/api/mcp.js.map +1 -0
- package/dist/api/session.d.ts +3 -0
- package/dist/api/session.d.ts.map +1 -0
- package/dist/api/session.js +2 -0
- package/dist/api/session.js.map +1 -0
- package/dist/child-agent.d.ts +5 -4
- package/dist/child-agent.d.ts.map +1 -1
- package/dist/child-agent.js +26 -117
- package/dist/child-agent.js.map +1 -1
- package/dist/child-session.d.ts +23 -0
- package/dist/child-session.d.ts.map +1 -0
- package/dist/child-session.js +48 -0
- package/dist/child-session.js.map +1 -0
- package/dist/extensions.d.ts +29 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +119 -0
- package/dist/extensions.js.map +1 -0
- package/dist/index.d.ts +4 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -13
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +38 -5
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +92 -41
- package/dist/inspect.js.map +1 -1
- package/dist/interactions.d.ts +18 -2
- package/dist/interactions.d.ts.map +1 -1
- package/dist/interactions.js +41 -10
- package/dist/interactions.js.map +1 -1
- package/dist/mcp-catalog.d.ts +1 -0
- package/dist/mcp-catalog.d.ts.map +1 -1
- package/dist/mcp-catalog.js +14 -6
- package/dist/mcp-catalog.js.map +1 -1
- package/dist/mcp-chunks/auth-command-ZLGYIEUY.js +273 -0
- package/dist/mcp-chunks/call-arguments-LU3W6D3K.js +13 -0
- package/dist/mcp-chunks/call-command-LKTKSYTH.js +612 -0
- package/dist/mcp-chunks/chunk-2U4BSDC4.js +3951 -0
- package/dist/mcp-chunks/chunk-2XL7MG7R.js +272 -0
- package/dist/mcp-chunks/chunk-3BJA27PY.js +2321 -0
- package/dist/mcp-chunks/chunk-4SQKWYFF.js +15 -0
- package/dist/mcp-chunks/chunk-5QOSCSQB.js +290 -0
- package/dist/mcp-chunks/chunk-6W5QFASN.js +77 -0
- package/dist/mcp-chunks/chunk-6XCZGU3G.js +1004 -0
- package/dist/mcp-chunks/chunk-7FHEBT5G.js +149 -0
- package/dist/mcp-chunks/chunk-7KA2VJVZ.js +114 -0
- package/dist/mcp-chunks/chunk-7UDVSOOF.js +138 -0
- package/dist/mcp-chunks/chunk-BNV3TPE4.js +66 -0
- package/dist/mcp-chunks/chunk-BTLAWHTA.js +129 -0
- package/dist/mcp-chunks/chunk-BV56DXPW.js +13 -0
- package/dist/mcp-chunks/chunk-BWHIA4PC.js +90 -0
- package/dist/mcp-chunks/chunk-BZIQOWE6.js +267 -0
- package/dist/mcp-chunks/chunk-D3MRAZ6H.js +16140 -0
- package/dist/mcp-chunks/chunk-DHBE7UBH.js +750 -0
- package/dist/mcp-chunks/chunk-E22DYOW5.js +251 -0
- package/dist/mcp-chunks/chunk-ECIVB7P4.js +139 -0
- package/dist/mcp-chunks/chunk-HKRJ6O36.js +1076 -0
- package/dist/mcp-chunks/chunk-IABRYROW.js +44 -0
- package/dist/mcp-chunks/chunk-J6LYIZXN.js +45 -0
- package/dist/mcp-chunks/chunk-L7NTQVYN.js +161 -0
- package/dist/mcp-chunks/chunk-LEZSACDE.js +141 -0
- package/dist/mcp-chunks/chunk-LKIBAYKU.js +208 -0
- package/dist/mcp-chunks/chunk-LNH5LAJD.js +152 -0
- package/dist/mcp-chunks/chunk-LQQEYD76.js +124 -0
- package/dist/mcp-chunks/chunk-LRKZP7DJ.js +47 -0
- package/dist/mcp-chunks/chunk-LS7PMWSR.js +109 -0
- package/dist/mcp-chunks/chunk-M3TPODXI.js +95 -0
- package/dist/mcp-chunks/chunk-MZ2NARG7.js +400 -0
- package/dist/mcp-chunks/chunk-N46NEFAF.js +45 -0
- package/dist/mcp-chunks/chunk-NNOEGEUZ.js +17273 -0
- package/dist/mcp-chunks/chunk-NRAJX5E4.js +69 -0
- package/dist/mcp-chunks/chunk-P3PSC54P.js +869 -0
- package/dist/mcp-chunks/chunk-PIIYJR44.js +6341 -0
- package/dist/mcp-chunks/chunk-PWYFKGKG.js +385 -0
- package/dist/mcp-chunks/chunk-SJCCBNZ4.js +45 -0
- package/dist/mcp-chunks/chunk-TATVT5IT.js +194 -0
- package/dist/mcp-chunks/chunk-TEUKFFQL.js +29 -0
- package/dist/mcp-chunks/chunk-UKYNQGNE.js +150 -0
- package/dist/mcp-chunks/chunk-UNKB4SBV.js +37 -0
- package/dist/mcp-chunks/chunk-WD6BOD24.js +138 -0
- package/dist/mcp-chunks/chunk-WQJZMCJN.js +73 -0
- package/dist/mcp-chunks/chunk-XANPGTLI.js +364 -0
- package/dist/mcp-chunks/chunk-XQK2JSW4.js +35 -0
- package/dist/mcp-chunks/chunk-YHQUTU6L.js +571 -0
- package/dist/mcp-chunks/chunk-YVZKMV5H.js +57 -0
- package/dist/mcp-chunks/cli-UV4QJZZM.js +929 -0
- package/dist/mcp-chunks/client-S7RQUG5U.js +13 -0
- package/dist/mcp-chunks/config-command-NLAGKID5.js +1101 -0
- package/dist/mcp-chunks/daemon-command-U242Z6VY.js +26 -0
- package/dist/mcp-chunks/dist-LK3SHAMX.js +6478 -0
- package/dist/mcp-chunks/emit-ts-command-VBXVXO6V.js +386 -0
- package/dist/mcp-chunks/generate-cli-runner-6CAZZA3P.js +1426 -0
- package/dist/mcp-chunks/inspect-cli-command-3ZORTOR7.js +111 -0
- package/dist/mcp-chunks/launch-YKRXHXJI.js +10 -0
- package/dist/mcp-chunks/lifecycle-XVKRHPH3.js +16 -0
- package/dist/mcp-chunks/list-command-2MEGGNFQ.js +4190 -0
- package/dist/mcp-chunks/output-utils-NKESLAJ6.js +12 -0
- package/dist/mcp-chunks/prompt-B1Yc1NPt-VGOTWJMN.js +918 -0
- package/dist/mcp-chunks/record-command-YXHTTTT5.js +17 -0
- package/dist/mcp-chunks/replay-command-25HJ6AQU.js +85 -0
- package/dist/mcp-chunks/resource-command-OO4NYF5C.js +97 -0
- package/dist/mcp-chunks/result-utils-MOHHLNM7.js +15 -0
- package/dist/mcp-chunks/runtime-5WJ3G25Y.js +33 -0
- package/dist/mcp-chunks/runtime-wrapper-RPWDIDBF.js +10 -0
- package/dist/mcp-chunks/serve-command-DHXJZMMN.js +3302 -0
- package/dist/mcp-chunks/timeouts-W2XWCCXR.js +18 -0
- package/dist/mcp-chunks/vault-command-PIYIUEZL.js +154 -0
- package/dist/mcp-daemon-client.d.ts +6 -1
- package/dist/mcp-daemon-client.d.ts.map +1 -1
- package/dist/mcp-daemon-client.js +119 -2
- package/dist/mcp-daemon-client.js.map +1 -1
- package/dist/mcp-daemon-protocol.d.ts +18 -1
- package/dist/mcp-daemon-protocol.d.ts.map +1 -1
- package/dist/mcp-daemon-protocol.js +31 -0
- package/dist/mcp-daemon-protocol.js.map +1 -1
- package/dist/mcp-daemon.js +169 -76602
- package/dist/mcp-daemon.js.map +1 -1
- package/dist/mcp-policy.d.ts +11 -0
- package/dist/mcp-policy.d.ts.map +1 -0
- package/dist/mcp-policy.js +27 -0
- package/dist/mcp-policy.js.map +1 -0
- package/dist/mcp-run-worker.js +38 -76540
- package/dist/mcp-tools.d.ts +39 -0
- package/dist/mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools.js +493 -0
- package/dist/mcp-tools.js.map +1 -0
- package/dist/mcp.d.ts +21 -9
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +101 -31
- package/dist/mcp.js.map +1 -1
- package/dist/model-binding.d.ts +39 -0
- package/dist/model-binding.d.ts.map +1 -0
- package/dist/model-binding.js +103 -0
- package/dist/model-binding.js.map +1 -0
- package/dist/pi-extension.d.ts +2 -22
- package/dist/pi-extension.d.ts.map +1 -1
- package/dist/pi-extension.js +296 -71
- package/dist/pi-extension.js.map +1 -1
- package/dist/recipe/resolve.d.ts +43 -20
- package/dist/recipe/resolve.d.ts.map +1 -1
- package/dist/recipe/resolve.js +215 -70
- package/dist/recipe/resolve.js.map +1 -1
- package/dist/recipe-agent.d.ts +24 -27
- package/dist/recipe-agent.d.ts.map +1 -1
- package/dist/recipe-agent.js +278 -230
- package/dist/recipe-agent.js.map +1 -1
- package/dist/recipe-check.d.ts +18 -0
- package/dist/recipe-check.d.ts.map +1 -0
- package/dist/recipe-check.js +261 -0
- package/dist/recipe-check.js.map +1 -0
- package/dist/recipe-extensions.d.ts.map +1 -1
- package/dist/recipe-extensions.js +0 -3
- package/dist/recipe-extensions.js.map +1 -1
- package/dist/recipe-model.d.ts +3 -1
- package/dist/recipe-model.d.ts.map +1 -1
- package/dist/recipe-model.js +15 -12
- package/dist/recipe-model.js.map +1 -1
- package/dist/recipe-package.d.ts +6 -28
- package/dist/recipe-package.d.ts.map +1 -1
- package/dist/recipe-package.js +248 -191
- package/dist/recipe-package.js.map +1 -1
- package/dist/recipe-skills.d.ts.map +1 -1
- package/dist/recipe-skills.js +42 -29
- package/dist/recipe-skills.js.map +1 -1
- package/dist/run-controller.d.ts +10 -9
- package/dist/run-controller.d.ts.map +1 -1
- package/dist/run-controller.js +28 -21
- package/dist/run-controller.js.map +1 -1
- package/dist/session.d.ts +40 -53
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +312 -173
- package/dist/session.js.map +1 -1
- package/dist/test-utils.d.ts +7 -7
- package/dist/test-utils.d.ts.map +1 -1
- package/dist/test-utils.js +32 -15
- package/dist/test-utils.js.map +1 -1
- package/docs/agent-composition.md +41 -35
- package/docs/host-api.md +201 -0
- package/docs/index.md +9 -14
- package/docs/interactions.md +12 -11
- package/docs/mcp-auth.md +6 -6
- package/docs/mcp-configuration.md +73 -25
- package/docs/pi-extension.md +39 -11
- package/docs/recipe-flow.md +9 -9
- package/docs/recipe-format.md +106 -41
- package/docs/recipe-judges.md +24 -36
- package/package.json +23 -17
- package/vendor/mcp-client/darwin-arm64/mcp-client +0 -0
- package/vendor/mcp-client/darwin-x64/mcp-client +0 -0
- package/vendor/mcp-client/linux-arm64/mcp-client +0 -0
- package/vendor/recipe-check/darwin-arm64/recipe-check +0 -0
- package/vendor/recipe-check/darwin-x64/recipe-check +0 -0
- package/vendor/recipe-check/linux-arm64/recipe-check +0 -0
- package/vendor/recipe-check/linux-x64/recipe-check +0 -0
- package/vendor/recipe-check/linux-x64-musl/recipe-check +0 -0
- package/vendor/recipe-check/win32-x64/recipe-check.exe +0 -0
- package/dist/agent-tool.d.ts.map +0 -1
- package/dist/agent-tool.js.map +0 -1
- package/dist/run.d.ts +0 -28
- package/dist/run.d.ts.map +0 -1
- package/dist/run.js +0 -84
- package/dist/run.js.map +0 -1
- package/dist/testing.d.ts +0 -25
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js +0 -96
- package/dist/testing.js.map +0 -1
- package/docs/deployment-configuration.md +0 -65
- package/docs/migration.md +0 -70
- package/docs/python-bindings-release.md +0 -47
- package/docs/recipe-evals.md +0 -70
- package/docs/runtime-library.md +0 -171
package/docs/index.md
CHANGED
|
@@ -10,16 +10,14 @@ task lifecycle, protocols, and deployment.
|
|
|
10
10
|
|
|
11
11
|
| Goal | Document |
|
|
12
12
|
| --- | --- |
|
|
13
|
+
| Create, validate, and run a Recipe | [Recipe workflow](recipe-flow.md) |
|
|
13
14
|
| Understand the portable artifact contract | [Recipe Format](recipe-format.md) |
|
|
14
|
-
|
|
|
15
|
+
| Run a Recipe in your host | [Host API](host-api.md) |
|
|
15
16
|
| Run a Recipe in Pi | [Pi extension](pi-extension.md) |
|
|
16
17
|
| Compose agents and subagents | [Agent composition](agent-composition.md) |
|
|
17
18
|
| Ask for user input across hosts | [Interactions](interactions.md) |
|
|
18
19
|
| Declare capability policy and bindings | [MCP configuration](mcp-configuration.md) |
|
|
19
|
-
|
|
|
20
|
-
| Package quality definitions | [Recipe judges](recipe-judges.md) |
|
|
21
|
-
| Declare offline evaluation suites | [Recipe evals](recipe-evals.md) |
|
|
22
|
-
| Move from the previous package | [Migration](migration.md) |
|
|
20
|
+
| Define portable evaluation judges | [Recipe judges](recipe-judges.md) |
|
|
23
21
|
|
|
24
22
|
## Boundary
|
|
25
23
|
|
|
@@ -30,20 +28,17 @@ Recipe source
|
|
|
30
28
|
resolveRecipe() format interpretation
|
|
31
29
|
│
|
|
32
30
|
▼
|
|
33
|
-
|
|
31
|
+
createAgentSession() complete live Pi agent
|
|
34
32
|
│
|
|
35
|
-
|
|
36
|
-
│
|
|
37
|
-
└── host tasks, persistence, auth, protocols, deployment
|
|
33
|
+
└── host tasks, persistence, auth, protocols, deployment
|
|
38
34
|
```
|
|
39
35
|
|
|
40
36
|
Recipes stops at the live session boundary. It does not ship a generic server,
|
|
41
|
-
task store, scheduler, sandbox, or provider-specific
|
|
37
|
+
task store, scheduler, sandbox, or provider-specific hosting integration.
|
|
42
38
|
|
|
43
|
-
The
|
|
39
|
+
The same contracts power:
|
|
44
40
|
|
|
45
41
|
- the Pi terminal harness through the Recipes extension;
|
|
46
|
-
-
|
|
42
|
+
- Node.js hosts through `createAgentSession()`.
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
conformance suite.
|
|
44
|
+
Every host can run the exported conformance suite against its integration.
|
package/docs/interactions.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Recipe Interactions
|
|
2
2
|
|
|
3
|
-
`@introspection-ai/recipes/interactions` gives
|
|
4
|
-
asking the user a question or requesting approval that works on every
|
|
3
|
+
`@introspection-ai/recipes/interactions` gives Recipe tools one contract for
|
|
4
|
+
asking the user a question or requesting approval that works on every Pi host:
|
|
5
5
|
the local TUI, RPC-driven UIs, headless runs, and hosts that stream tool
|
|
6
6
|
results to a remote frontend and can pause/resume a run.
|
|
7
7
|
|
|
@@ -77,7 +77,7 @@ Pi's native tool-result shape is `content` plus arbitrary structured
|
|
|
77
77
|
`details`. Recipes stores its interaction state at `details.interrupt`.
|
|
78
78
|
A host that supports pause/resume treats
|
|
79
79
|
`details.interrupt.outcome.type === "awaiting_user"` as a pause request.
|
|
80
|
-
|
|
80
|
+
Hosts generate their own pause state from this record.
|
|
81
81
|
|
|
82
82
|
| Field | Meaning |
|
|
83
83
|
| --- | --- |
|
|
@@ -90,26 +90,26 @@ Runtime adapters generate their own pause state from this record.
|
|
|
90
90
|
| `outcome` | Local result, or `{ type: "awaiting_user" }` when the host must pause |
|
|
91
91
|
|
|
92
92
|
Question options are suggestions, not a closed enum. Local Pi shows them in a
|
|
93
|
-
selector plus an `Other` input path, and
|
|
93
|
+
selector plus an `Other` input path, and hosts should preserve that
|
|
94
94
|
same custom-answer path unless a specific tool explicitly does something else.
|
|
95
95
|
|
|
96
96
|
Resume payloads are single-question: `{ answer }` for questions,
|
|
97
97
|
`{ approved, feedback? }` for confirmations. A decline is a resume with
|
|
98
98
|
status `cancelled` and **no payload**. Any host-specific pause/resume state
|
|
99
|
-
should be generated by the host
|
|
100
|
-
|
|
99
|
+
should be generated by the host from this request, not authored inside a
|
|
100
|
+
Recipe.
|
|
101
101
|
|
|
102
102
|
## AG-UI compatibility
|
|
103
103
|
|
|
104
104
|
`details.interrupt` is intentionally close to the shape needed by AG-UI-style
|
|
105
|
-
frontends, while remaining Pi-native
|
|
106
|
-
|
|
105
|
+
frontends, while remaining Pi-native Recipe metadata. A host that deploys a
|
|
106
|
+
Recipe behind the Agent User Interaction Protocol can map an awaiting
|
|
107
107
|
`details.interrupt` request into `RUN_FINISHED` with
|
|
108
108
|
`outcome: { type: "interrupt", interrupts: [...] }`, then resume with the
|
|
109
109
|
same `{ answer }`, `{ approved, feedback? }`, or cancelled payloads described
|
|
110
110
|
above.
|
|
111
111
|
|
|
112
|
-
Recipes should still emit only `details.interrupt`. The host
|
|
112
|
+
Recipes should still emit only `details.interrupt`. The host owns ids,
|
|
113
113
|
tool-call binding, response schemas, transport events, persistence, and any
|
|
114
114
|
frontend-specific rendering.
|
|
115
115
|
|
|
@@ -157,7 +157,7 @@ options.
|
|
|
157
157
|
The envelope is the tool-result text the model sees after the user responds.
|
|
158
158
|
It is a byte-exact wire contract: the local dialog walk and every pause/resume
|
|
159
159
|
host must synthesize identical text for the same outcome,
|
|
160
|
-
so
|
|
160
|
+
so Recipe tools cannot tell where the answer came from. Do not reword these
|
|
161
161
|
without a coordinated protocol change across all hosts.
|
|
162
162
|
|
|
163
163
|
| Outcome | Envelope |
|
|
@@ -178,7 +178,8 @@ best judgment.
|
|
|
178
178
|
- **`executionMode: "sequential"` is mandatory.** A host pause must never
|
|
179
179
|
race concurrently executing tools.
|
|
180
180
|
- **Prefer the wrappers.** Use `askUserQuestion()` and `askUserApproval()` so
|
|
181
|
-
|
|
181
|
+
Recipe tools do not hand-author interrupt details, reasons, or display
|
|
182
|
+
metadata.
|
|
182
183
|
- **Never format envelopes yourself.** Return the helper result as-is; envelope
|
|
183
184
|
authorship must not split across layers.
|
|
184
185
|
- **Thread the tool's `signal`** into the helper and check for aborts after any
|
package/docs/mcp-auth.md
CHANGED
|
@@ -7,7 +7,7 @@ endpoint model.
|
|
|
7
7
|
Recipe MCP authentication follows the endpoint source that made an
|
|
8
8
|
already-approved server reachable: a configured package manifest or a local/host
|
|
9
9
|
binding. Authentication never selects a server or grants tools; the package and
|
|
10
|
-
|
|
10
|
+
selected-agent policies still determine the final server/tool inventory.
|
|
11
11
|
|
|
12
12
|
## Local OAuth
|
|
13
13
|
|
|
@@ -49,13 +49,13 @@ cannot initiate authentication.
|
|
|
49
49
|
|
|
50
50
|
## Hosted bindings
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Hosts adapt their endpoint and credential systems into the same
|
|
53
53
|
`.pi/mcp.local.json` shape before starting Recipes. Header values remain
|
|
54
54
|
environment references, so credentials are resolved at runtime rather than
|
|
55
55
|
written into the recipe workspace. Deployment-specific bootstrap, token, and
|
|
56
|
-
egress behavior belongs to the
|
|
56
|
+
egress behavior belongs to the host, not this package.
|
|
57
57
|
|
|
58
|
-
Regardless of where a
|
|
58
|
+
Regardless of where a Recipe runs, the agent sees one rule: MCP operations are
|
|
59
59
|
headless. When authentication is missing, it receives a deployment-neutral
|
|
60
60
|
recovery telling it to ask the user to authenticate the connection outside the
|
|
61
61
|
agent session and then retry; `mcp run --json-errors` reports this as
|
|
@@ -75,6 +75,6 @@ reads an absolute local path supplied by an MCP result; server output must not
|
|
|
75
75
|
choose files for an agent session to read.
|
|
76
76
|
|
|
77
77
|
This command policy prevents accidental escape from the materialized MCP
|
|
78
|
-
surface. It is not an OS or network sandbox: the enclosing local shell or
|
|
79
|
-
|
|
78
|
+
surface. It is not an OS or network sandbox: the enclosing local shell or host
|
|
79
|
+
remains responsible for filesystem, process, and egress
|
|
80
80
|
isolation.
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
# MCP configuration
|
|
2
2
|
|
|
3
3
|
MCP authorization is the intersection of two fail-closed policy gates: the
|
|
4
|
-
package boundary and the
|
|
5
|
-
subagents. The authorized server must
|
|
4
|
+
package boundary and the subset selected by an agent. The authorized server must
|
|
6
5
|
also have a reachable endpoint, supplied either by a package-declared MCP
|
|
7
6
|
manifest or by a local/host binding. A binding supplies connectivity; it never
|
|
8
7
|
expands authorization.
|
|
9
8
|
|
|
10
9
|
```text
|
|
11
|
-
package policy ∩
|
|
10
|
+
package policy ∩ selected-agent policy = authorized tools
|
|
12
11
|
package.json#pi.mcp agents/*.yaml#mcp
|
|
13
12
|
+
|
|
14
13
|
endpoint from package manifest or local/host binding
|
|
15
14
|
↓
|
|
16
|
-
|
|
15
|
+
CLI or Pi-registered tools
|
|
17
16
|
```
|
|
18
17
|
|
|
19
18
|
## 1. Declare the package boundary
|
|
20
19
|
|
|
21
|
-
`package.json#pi.mcp` declares the servers a
|
|
20
|
+
`package.json#pi.mcp` declares the servers a Recipe may use and the maximum
|
|
22
21
|
tool set available from each one. It can also reference portable MCP manifests.
|
|
23
22
|
|
|
24
23
|
```json
|
|
25
24
|
{
|
|
26
25
|
"pi": {
|
|
27
26
|
"mcp": {
|
|
28
|
-
"
|
|
27
|
+
"manifests": ["mcp.json"],
|
|
29
28
|
"servers": [
|
|
30
29
|
{
|
|
31
30
|
"id": "contacts",
|
|
@@ -44,13 +43,12 @@ tool set available from each one. It can also reference portable MCP manifests.
|
|
|
44
43
|
Prefer exact tool names. `"*"` explicitly permits the package-visible tool set,
|
|
45
44
|
including tools a server may add later; patterns such as `search_*` are invalid.
|
|
46
45
|
|
|
47
|
-
`
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
without the capability.
|
|
46
|
+
`manifests` is always an array of Recipe-relative paths or globs. Singular
|
|
47
|
+
`manifest` and string shorthand are invalid. A server marked
|
|
48
|
+
`"required": true` must resolve to a bound endpoint at session materialization
|
|
49
|
+
or the session fails closed rather than starting without the capability.
|
|
52
50
|
|
|
53
|
-
## 2.
|
|
51
|
+
## 2. Choose an agent mode and narrow access
|
|
54
52
|
|
|
55
53
|
An agent selects a subset of the package-permitted servers and tools. It cannot
|
|
56
54
|
add capability that the package did not declare.
|
|
@@ -59,15 +57,51 @@ add capability that the package did not declare.
|
|
|
59
57
|
tools:
|
|
60
58
|
- bash
|
|
61
59
|
mcp:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
mode: cli
|
|
61
|
+
servers:
|
|
62
|
+
contacts:
|
|
63
|
+
include:
|
|
64
|
+
- search_contacts
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Omitting a server—or the entire agent `mcp` block—means no access. `exclude`
|
|
68
68
|
removes exact names after inclusion and always wins. MCP tools are selected here,
|
|
69
69
|
not in the agent's ordinary `tools` list.
|
|
70
70
|
|
|
71
|
+
`mode: cli` creates the session-local `mcp` command.
|
|
72
|
+
|
|
73
|
+
`mode: tools` registers every authorized MCP tool with Pi. Server-local
|
|
74
|
+
`defer` selectors control which authorized tools start hidden from the model;
|
|
75
|
+
`eager` subtracts exceptions from that deferred set:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
mcp:
|
|
79
|
+
mode: tools
|
|
80
|
+
servers:
|
|
81
|
+
contacts:
|
|
82
|
+
include: ["*"]
|
|
83
|
+
defer: ["*"]
|
|
84
|
+
eager:
|
|
85
|
+
- search_contacts
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Omit `defer` to expose every authorized tool immediately. Use `defer: ["*"]`
|
|
89
|
+
to hide all authorized tools for a server, then optionally list exact tools in
|
|
90
|
+
`eager` to expose those tools at startup. Both fields accept exact tool names
|
|
91
|
+
or a sole `"*"` selector. `eager` wins when a tool matches both fields, but
|
|
92
|
+
neither field can authorize a tool excluded by `include`/`exclude`.
|
|
93
|
+
|
|
94
|
+
Deferred tools remain authorized and discoverable. When at least one exists,
|
|
95
|
+
Recipes registers `mcp_search`; calling it searches only the authorized
|
|
96
|
+
deferred catalog and adds matches to Pi's current active tool set for the next
|
|
97
|
+
model request. It never grants access beyond `servers`.
|
|
98
|
+
|
|
99
|
+
`defer` and `eager` are invalid in CLI mode. An omitted agent `mcp` block
|
|
100
|
+
inherits its base policy. Once a child declares `mcp`, the complete block
|
|
101
|
+
replaces the inherited policy; restate its mode, servers, authorization, and
|
|
102
|
+
activation selectors. This makes external capability changes reviewable at the
|
|
103
|
+
derived agent. Every resolved agent owns its mode independently.
|
|
104
|
+
|
|
71
105
|
## 3. Supply endpoint configuration
|
|
72
106
|
|
|
73
107
|
A referenced MCP manifest can carry a portable configured endpoint and catalog.
|
|
@@ -97,12 +131,12 @@ export CONTACTS_MCP_TOKEN='...'
|
|
|
97
131
|
pi --recipe . --agent agent
|
|
98
132
|
```
|
|
99
133
|
|
|
100
|
-
Do not commit or distribute `.pi/mcp.local.json`;
|
|
134
|
+
Do not commit or distribute `.pi/mcp.local.json`; Recipe validation rejects
|
|
101
135
|
local configuration. Commit `.pi/mcp.local.example.json` when a binding template
|
|
102
|
-
is helpful. A
|
|
103
|
-
|
|
104
|
-
but a server that the package does not permit
|
|
105
|
-
|
|
136
|
+
is helpful. A host binds its own endpoint and credential system to the same
|
|
137
|
+
shape. A binding overrides a package-manifest endpoint with the same id,
|
|
138
|
+
but a server that the package or selected agent does not permit remains
|
|
139
|
+
unavailable.
|
|
106
140
|
|
|
107
141
|
When the local file is absent, manifest-supplied endpoints remain usable.
|
|
108
142
|
Required servers that need environment-specific bindings fail closed until the
|
|
@@ -110,9 +144,10 @@ local Pi environment or embedding host supplies them.
|
|
|
110
144
|
|
|
111
145
|
## Use capabilities from an agent
|
|
112
146
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
147
|
+
In CLI mode, Recipes creates a session-local `mcp` command containing only the
|
|
148
|
+
selected agent's authorized tools. Delegating to another agent does not grant
|
|
149
|
+
the parent direct access to that child's MCP capabilities. Discover narrowly,
|
|
150
|
+
inspect one schema, then call or compose:
|
|
116
151
|
|
|
117
152
|
```bash
|
|
118
153
|
mcp search "contact lookup"
|
|
@@ -122,5 +157,18 @@ mcp call contacts.search_contacts query="Ada Lovelace"
|
|
|
122
157
|
|
|
123
158
|
The command is headless and cannot add servers, mutate configuration, or start
|
|
124
159
|
browser authentication. See [MCP authentication](mcp-auth.md) for OAuth and
|
|
125
|
-
hosted binding details, and [Recipes extension](pi-extension.md
|
|
126
|
-
full
|
|
160
|
+
hosted binding details, and [Recipes extension](pi-extension.md) for the
|
|
161
|
+
full session contract.
|
|
162
|
+
|
|
163
|
+
In tools mode, each Pi session—including each delegated child session—gets its
|
|
164
|
+
own registered tool catalog and active set. The MCP daemon and mcporter config
|
|
165
|
+
remain private to those wrappers; shell tools do not receive an `mcp` command,
|
|
166
|
+
`MCPORTER_CONFIG`, or MCP session path.
|
|
167
|
+
|
|
168
|
+
Pi receives each tool's MCP input schema. If the server declares
|
|
169
|
+
`outputSchema`, Recipes retains and validates it locally against successful
|
|
170
|
+
`structuredContent`; providers do not currently receive it as a tool
|
|
171
|
+
declaration field. Text, image, resource, resource-link, audio, and structured
|
|
172
|
+
results are normalized to Pi tool results. Duplicate structured JSON text is
|
|
173
|
+
removed, errors become ordinary failed tool calls, and model-visible text is
|
|
174
|
+
bounded to 50 KiB or 2,000 lines by default.
|
package/docs/pi-extension.md
CHANGED
|
@@ -9,7 +9,8 @@ pi --recipe ./path/to/recipe --agent agent
|
|
|
9
9
|
|
|
10
10
|
Pi is the harness. The extension resolves the selected Recipe, configures its
|
|
11
11
|
model and tools, loads its skills and extensions, materializes its declared
|
|
12
|
-
capabilities, and registers its subagents.
|
|
12
|
+
capabilities, and registers its subagents. Every launch with `--recipe`
|
|
13
|
+
validates the authored package first.
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -52,7 +53,7 @@ For the selected agent, the extension:
|
|
|
52
53
|
1. reads the root `package.json#pi` resource declarations;
|
|
53
54
|
2. resolves the agent YAML, including `from:` inheritance;
|
|
54
55
|
3. selects the model, thinking level, and tool allowlist;
|
|
55
|
-
4. loads selected skills, prompts, and Recipe
|
|
56
|
+
4. loads selected skills, package prompts, and the complete Recipe extension closure;
|
|
56
57
|
5. materializes declared MCP bindings from host or local configuration;
|
|
57
58
|
6. exposes only the declared subagents through the shared `agent` tool.
|
|
58
59
|
|
|
@@ -71,24 +72,51 @@ remain unavailable. See [MCP configuration](mcp-configuration.md).
|
|
|
71
72
|
## Recipe-owned extensions
|
|
72
73
|
|
|
73
74
|
TypeScript extension sources declared by `package.json#pi.extensions` are
|
|
74
|
-
loaded
|
|
75
|
-
|
|
75
|
+
resolved deterministically and loaded for every Recipe session. This complete
|
|
76
|
+
set is one executable closure; agent YAML only controls which registered tools
|
|
77
|
+
the model may call.
|
|
78
|
+
|
|
79
|
+
Recipe extensions can import `forAgent`, `forRecipeSession`, and
|
|
80
|
+
`getRecipeSessionContext` from `@introspection-ai/recipes/extensions` for
|
|
81
|
+
session-local conditional behavior:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import { forAgent } from "@introspection-ai/recipes/extensions";
|
|
85
|
+
|
|
86
|
+
export default function reviewerHooks(pi) {
|
|
87
|
+
forAgent(pi, "reviewer", () => {
|
|
88
|
+
pi.on("tool_call", reviewPolicy);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The context distinguishes `root` and `subagent` roles. Conditional behavior is
|
|
94
|
+
not code isolation: the extension module still executes with the Pi process's
|
|
95
|
+
authority. `forAgent` matches the final resolved `agent.name` exactly; `from`
|
|
96
|
+
is configuration inheritance and does not make a derived agent match its
|
|
97
|
+
ancestor's hooks.
|
|
76
98
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
99
|
+
The closure contains every extension declared by the Recipe. It does not claim
|
|
100
|
+
exclusive ownership of the surrounding Pi process: trusted global or project
|
|
101
|
+
extensions already loaded by interactive Pi may still run hooks, providers,
|
|
102
|
+
commands, and other non-tool behavior. Recipe `tools` remains the exact
|
|
103
|
+
model-callable allowlist. Embedded Recipe sessions disable ambient extensions,
|
|
104
|
+
skills, prompt templates, and context files by default.
|
|
80
105
|
|
|
81
106
|
## Validation
|
|
82
107
|
|
|
83
|
-
|
|
108
|
+
Every `pi --recipe` launch automatically runs the shared Recipe Format
|
|
109
|
+
validator. Invalid Recipes are rendered in Pi and stop the session before any
|
|
110
|
+
model call.
|
|
111
|
+
|
|
112
|
+
For an explicit manual or CI check, run:
|
|
84
113
|
|
|
85
114
|
```bash
|
|
86
115
|
introspection check
|
|
87
116
|
```
|
|
88
117
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
job.
|
|
118
|
+
Both paths use the same Rust validation core. The binary embedded in the npm
|
|
119
|
+
package is an internal bridge for Pi startup, not a second user-facing CLI.
|
|
92
120
|
|
|
93
121
|
## Host parity
|
|
94
122
|
|
package/docs/recipe-flow.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Recipe workflow
|
|
2
2
|
|
|
3
3
|
The `introspection` CLI owns the developer workflow. The Recipes npm package is
|
|
4
|
-
the format implementation and Pi
|
|
4
|
+
the format implementation, Host API, and Pi extension; it does not install a
|
|
5
5
|
second CLI.
|
|
6
6
|
|
|
7
7
|
## Create and run locally
|
|
@@ -15,10 +15,11 @@ introspection local
|
|
|
15
15
|
|
|
16
16
|
`introspection init` scaffolds a Recipe and ensures compatible versions of Pi
|
|
17
17
|
and the Recipes extension are present. `introspection check` runs the Recipe
|
|
18
|
-
Format validator. `introspection local` resolves the repository's
|
|
19
|
-
manifest and launches Pi with the Recipe path.
|
|
18
|
+
Format validator. `introspection local` resolves the repository's project
|
|
19
|
+
manifest and launches Pi with the Recipe path. Pi automatically runs the same
|
|
20
|
+
validator whenever `--recipe` is present.
|
|
20
21
|
|
|
21
|
-
The local path requires no login
|
|
22
|
+
The local path requires no login or Introspection cloud service.
|
|
22
23
|
|
|
23
24
|
## Run Pi directly
|
|
24
25
|
|
|
@@ -33,9 +34,8 @@ publish command.
|
|
|
33
34
|
|
|
34
35
|
## Deploy
|
|
35
36
|
|
|
36
|
-
The Recipe remains unchanged across hosts. A host
|
|
37
|
-
`
|
|
38
|
-
persistence, isolation, and protocol surface.
|
|
37
|
+
The Recipe remains unchanged across hosts. A long-lived host resolves the Recipe
|
|
38
|
+
once, calls `createAgentSession()`, and supplies its own credentials, task
|
|
39
|
+
lifecycle, persistence, isolation, and protocol surface.
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
want to operate the same Recipe on another platform.
|
|
41
|
+
Integrate the Host API with the platform that will operate the Recipe.
|