@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.
Files changed (222) hide show
  1. package/README.md +46 -57
  2. package/dist/{agent-tool.d.ts → agents.d.ts} +4 -1
  3. package/dist/agents.d.ts.map +1 -0
  4. package/dist/{agent-tool.js → agents.js} +1 -1
  5. package/dist/agents.js.map +1 -0
  6. package/dist/api/extensions.d.ts +3 -0
  7. package/dist/api/extensions.d.ts.map +1 -0
  8. package/dist/api/extensions.js +2 -0
  9. package/dist/api/extensions.js.map +1 -0
  10. package/dist/api/mcp.d.ts +4 -0
  11. package/dist/api/mcp.d.ts.map +1 -0
  12. package/dist/api/mcp.js +2 -0
  13. package/dist/api/mcp.js.map +1 -0
  14. package/dist/api/session.d.ts +3 -0
  15. package/dist/api/session.d.ts.map +1 -0
  16. package/dist/api/session.js +2 -0
  17. package/dist/api/session.js.map +1 -0
  18. package/dist/child-agent.d.ts +5 -4
  19. package/dist/child-agent.d.ts.map +1 -1
  20. package/dist/child-agent.js +26 -117
  21. package/dist/child-agent.js.map +1 -1
  22. package/dist/child-session.d.ts +23 -0
  23. package/dist/child-session.d.ts.map +1 -0
  24. package/dist/child-session.js +48 -0
  25. package/dist/child-session.js.map +1 -0
  26. package/dist/extensions.d.ts +29 -0
  27. package/dist/extensions.d.ts.map +1 -0
  28. package/dist/extensions.js +119 -0
  29. package/dist/extensions.js.map +1 -0
  30. package/dist/index.d.ts +4 -13
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2 -13
  33. package/dist/index.js.map +1 -1
  34. package/dist/inspect.d.ts +38 -5
  35. package/dist/inspect.d.ts.map +1 -1
  36. package/dist/inspect.js +92 -41
  37. package/dist/inspect.js.map +1 -1
  38. package/dist/interactions.d.ts +18 -2
  39. package/dist/interactions.d.ts.map +1 -1
  40. package/dist/interactions.js +41 -10
  41. package/dist/interactions.js.map +1 -1
  42. package/dist/mcp-catalog.d.ts +1 -0
  43. package/dist/mcp-catalog.d.ts.map +1 -1
  44. package/dist/mcp-catalog.js +14 -6
  45. package/dist/mcp-catalog.js.map +1 -1
  46. package/dist/mcp-chunks/auth-command-ZLGYIEUY.js +273 -0
  47. package/dist/mcp-chunks/call-arguments-LU3W6D3K.js +13 -0
  48. package/dist/mcp-chunks/call-command-LKTKSYTH.js +612 -0
  49. package/dist/mcp-chunks/chunk-2U4BSDC4.js +3951 -0
  50. package/dist/mcp-chunks/chunk-2XL7MG7R.js +272 -0
  51. package/dist/mcp-chunks/chunk-3BJA27PY.js +2321 -0
  52. package/dist/mcp-chunks/chunk-4SQKWYFF.js +15 -0
  53. package/dist/mcp-chunks/chunk-5QOSCSQB.js +290 -0
  54. package/dist/mcp-chunks/chunk-6W5QFASN.js +77 -0
  55. package/dist/mcp-chunks/chunk-6XCZGU3G.js +1004 -0
  56. package/dist/mcp-chunks/chunk-7FHEBT5G.js +149 -0
  57. package/dist/mcp-chunks/chunk-7KA2VJVZ.js +114 -0
  58. package/dist/mcp-chunks/chunk-7UDVSOOF.js +138 -0
  59. package/dist/mcp-chunks/chunk-BNV3TPE4.js +66 -0
  60. package/dist/mcp-chunks/chunk-BTLAWHTA.js +129 -0
  61. package/dist/mcp-chunks/chunk-BV56DXPW.js +13 -0
  62. package/dist/mcp-chunks/chunk-BWHIA4PC.js +90 -0
  63. package/dist/mcp-chunks/chunk-BZIQOWE6.js +267 -0
  64. package/dist/mcp-chunks/chunk-D3MRAZ6H.js +16140 -0
  65. package/dist/mcp-chunks/chunk-DHBE7UBH.js +750 -0
  66. package/dist/mcp-chunks/chunk-E22DYOW5.js +251 -0
  67. package/dist/mcp-chunks/chunk-ECIVB7P4.js +139 -0
  68. package/dist/mcp-chunks/chunk-HKRJ6O36.js +1076 -0
  69. package/dist/mcp-chunks/chunk-IABRYROW.js +44 -0
  70. package/dist/mcp-chunks/chunk-J6LYIZXN.js +45 -0
  71. package/dist/mcp-chunks/chunk-L7NTQVYN.js +161 -0
  72. package/dist/mcp-chunks/chunk-LEZSACDE.js +141 -0
  73. package/dist/mcp-chunks/chunk-LKIBAYKU.js +208 -0
  74. package/dist/mcp-chunks/chunk-LNH5LAJD.js +152 -0
  75. package/dist/mcp-chunks/chunk-LQQEYD76.js +124 -0
  76. package/dist/mcp-chunks/chunk-LRKZP7DJ.js +47 -0
  77. package/dist/mcp-chunks/chunk-LS7PMWSR.js +109 -0
  78. package/dist/mcp-chunks/chunk-M3TPODXI.js +95 -0
  79. package/dist/mcp-chunks/chunk-MZ2NARG7.js +400 -0
  80. package/dist/mcp-chunks/chunk-N46NEFAF.js +45 -0
  81. package/dist/mcp-chunks/chunk-NNOEGEUZ.js +17273 -0
  82. package/dist/mcp-chunks/chunk-NRAJX5E4.js +69 -0
  83. package/dist/mcp-chunks/chunk-P3PSC54P.js +869 -0
  84. package/dist/mcp-chunks/chunk-PIIYJR44.js +6341 -0
  85. package/dist/mcp-chunks/chunk-PWYFKGKG.js +385 -0
  86. package/dist/mcp-chunks/chunk-SJCCBNZ4.js +45 -0
  87. package/dist/mcp-chunks/chunk-TATVT5IT.js +194 -0
  88. package/dist/mcp-chunks/chunk-TEUKFFQL.js +29 -0
  89. package/dist/mcp-chunks/chunk-UKYNQGNE.js +150 -0
  90. package/dist/mcp-chunks/chunk-UNKB4SBV.js +37 -0
  91. package/dist/mcp-chunks/chunk-WD6BOD24.js +138 -0
  92. package/dist/mcp-chunks/chunk-WQJZMCJN.js +73 -0
  93. package/dist/mcp-chunks/chunk-XANPGTLI.js +364 -0
  94. package/dist/mcp-chunks/chunk-XQK2JSW4.js +35 -0
  95. package/dist/mcp-chunks/chunk-YHQUTU6L.js +571 -0
  96. package/dist/mcp-chunks/chunk-YVZKMV5H.js +57 -0
  97. package/dist/mcp-chunks/cli-UV4QJZZM.js +929 -0
  98. package/dist/mcp-chunks/client-S7RQUG5U.js +13 -0
  99. package/dist/mcp-chunks/config-command-NLAGKID5.js +1101 -0
  100. package/dist/mcp-chunks/daemon-command-U242Z6VY.js +26 -0
  101. package/dist/mcp-chunks/dist-LK3SHAMX.js +6478 -0
  102. package/dist/mcp-chunks/emit-ts-command-VBXVXO6V.js +386 -0
  103. package/dist/mcp-chunks/generate-cli-runner-6CAZZA3P.js +1426 -0
  104. package/dist/mcp-chunks/inspect-cli-command-3ZORTOR7.js +111 -0
  105. package/dist/mcp-chunks/launch-YKRXHXJI.js +10 -0
  106. package/dist/mcp-chunks/lifecycle-XVKRHPH3.js +16 -0
  107. package/dist/mcp-chunks/list-command-2MEGGNFQ.js +4190 -0
  108. package/dist/mcp-chunks/output-utils-NKESLAJ6.js +12 -0
  109. package/dist/mcp-chunks/prompt-B1Yc1NPt-VGOTWJMN.js +918 -0
  110. package/dist/mcp-chunks/record-command-YXHTTTT5.js +17 -0
  111. package/dist/mcp-chunks/replay-command-25HJ6AQU.js +85 -0
  112. package/dist/mcp-chunks/resource-command-OO4NYF5C.js +97 -0
  113. package/dist/mcp-chunks/result-utils-MOHHLNM7.js +15 -0
  114. package/dist/mcp-chunks/runtime-5WJ3G25Y.js +33 -0
  115. package/dist/mcp-chunks/runtime-wrapper-RPWDIDBF.js +10 -0
  116. package/dist/mcp-chunks/serve-command-DHXJZMMN.js +3302 -0
  117. package/dist/mcp-chunks/timeouts-W2XWCCXR.js +18 -0
  118. package/dist/mcp-chunks/vault-command-PIYIUEZL.js +154 -0
  119. package/dist/mcp-daemon-client.d.ts +6 -1
  120. package/dist/mcp-daemon-client.d.ts.map +1 -1
  121. package/dist/mcp-daemon-client.js +119 -2
  122. package/dist/mcp-daemon-client.js.map +1 -1
  123. package/dist/mcp-daemon-protocol.d.ts +18 -1
  124. package/dist/mcp-daemon-protocol.d.ts.map +1 -1
  125. package/dist/mcp-daemon-protocol.js +31 -0
  126. package/dist/mcp-daemon-protocol.js.map +1 -1
  127. package/dist/mcp-daemon.js +169 -76602
  128. package/dist/mcp-daemon.js.map +1 -1
  129. package/dist/mcp-policy.d.ts +11 -0
  130. package/dist/mcp-policy.d.ts.map +1 -0
  131. package/dist/mcp-policy.js +27 -0
  132. package/dist/mcp-policy.js.map +1 -0
  133. package/dist/mcp-run-worker.js +38 -76540
  134. package/dist/mcp-tools.d.ts +39 -0
  135. package/dist/mcp-tools.d.ts.map +1 -0
  136. package/dist/mcp-tools.js +493 -0
  137. package/dist/mcp-tools.js.map +1 -0
  138. package/dist/mcp.d.ts +21 -9
  139. package/dist/mcp.d.ts.map +1 -1
  140. package/dist/mcp.js +101 -31
  141. package/dist/mcp.js.map +1 -1
  142. package/dist/model-binding.d.ts +39 -0
  143. package/dist/model-binding.d.ts.map +1 -0
  144. package/dist/model-binding.js +103 -0
  145. package/dist/model-binding.js.map +1 -0
  146. package/dist/pi-extension.d.ts +2 -22
  147. package/dist/pi-extension.d.ts.map +1 -1
  148. package/dist/pi-extension.js +296 -71
  149. package/dist/pi-extension.js.map +1 -1
  150. package/dist/recipe/resolve.d.ts +43 -20
  151. package/dist/recipe/resolve.d.ts.map +1 -1
  152. package/dist/recipe/resolve.js +215 -70
  153. package/dist/recipe/resolve.js.map +1 -1
  154. package/dist/recipe-agent.d.ts +24 -27
  155. package/dist/recipe-agent.d.ts.map +1 -1
  156. package/dist/recipe-agent.js +278 -230
  157. package/dist/recipe-agent.js.map +1 -1
  158. package/dist/recipe-check.d.ts +18 -0
  159. package/dist/recipe-check.d.ts.map +1 -0
  160. package/dist/recipe-check.js +261 -0
  161. package/dist/recipe-check.js.map +1 -0
  162. package/dist/recipe-extensions.d.ts.map +1 -1
  163. package/dist/recipe-extensions.js +0 -3
  164. package/dist/recipe-extensions.js.map +1 -1
  165. package/dist/recipe-model.d.ts +3 -1
  166. package/dist/recipe-model.d.ts.map +1 -1
  167. package/dist/recipe-model.js +15 -12
  168. package/dist/recipe-model.js.map +1 -1
  169. package/dist/recipe-package.d.ts +6 -28
  170. package/dist/recipe-package.d.ts.map +1 -1
  171. package/dist/recipe-package.js +248 -191
  172. package/dist/recipe-package.js.map +1 -1
  173. package/dist/recipe-skills.d.ts.map +1 -1
  174. package/dist/recipe-skills.js +42 -29
  175. package/dist/recipe-skills.js.map +1 -1
  176. package/dist/run-controller.d.ts +10 -9
  177. package/dist/run-controller.d.ts.map +1 -1
  178. package/dist/run-controller.js +28 -21
  179. package/dist/run-controller.js.map +1 -1
  180. package/dist/session.d.ts +40 -53
  181. package/dist/session.d.ts.map +1 -1
  182. package/dist/session.js +312 -173
  183. package/dist/session.js.map +1 -1
  184. package/dist/test-utils.d.ts +7 -7
  185. package/dist/test-utils.d.ts.map +1 -1
  186. package/dist/test-utils.js +32 -15
  187. package/dist/test-utils.js.map +1 -1
  188. package/docs/agent-composition.md +41 -35
  189. package/docs/host-api.md +201 -0
  190. package/docs/index.md +9 -14
  191. package/docs/interactions.md +12 -11
  192. package/docs/mcp-auth.md +6 -6
  193. package/docs/mcp-configuration.md +73 -25
  194. package/docs/pi-extension.md +39 -11
  195. package/docs/recipe-flow.md +9 -9
  196. package/docs/recipe-format.md +106 -41
  197. package/docs/recipe-judges.md +24 -36
  198. package/package.json +23 -17
  199. package/vendor/mcp-client/darwin-arm64/mcp-client +0 -0
  200. package/vendor/mcp-client/darwin-x64/mcp-client +0 -0
  201. package/vendor/mcp-client/linux-arm64/mcp-client +0 -0
  202. package/vendor/recipe-check/darwin-arm64/recipe-check +0 -0
  203. package/vendor/recipe-check/darwin-x64/recipe-check +0 -0
  204. package/vendor/recipe-check/linux-arm64/recipe-check +0 -0
  205. package/vendor/recipe-check/linux-x64/recipe-check +0 -0
  206. package/vendor/recipe-check/linux-x64-musl/recipe-check +0 -0
  207. package/vendor/recipe-check/win32-x64/recipe-check.exe +0 -0
  208. package/dist/agent-tool.d.ts.map +0 -1
  209. package/dist/agent-tool.js.map +0 -1
  210. package/dist/run.d.ts +0 -28
  211. package/dist/run.d.ts.map +0 -1
  212. package/dist/run.js +0 -84
  213. package/dist/run.js.map +0 -1
  214. package/dist/testing.d.ts +0 -25
  215. package/dist/testing.d.ts.map +0 -1
  216. package/dist/testing.js +0 -96
  217. package/dist/testing.js.map +0 -1
  218. package/docs/deployment-configuration.md +0 -65
  219. package/docs/migration.md +0 -70
  220. package/docs/python-bindings-release.md +0 -47
  221. package/docs/recipe-evals.md +0 -70
  222. package/docs/runtime-library.md +0 -171
package/dist/testing.js DELETED
@@ -1,96 +0,0 @@
1
- export function createMockExtensionAPI() {
2
- const commands = new Map();
3
- const tools = new Map();
4
- const flags = new Map();
5
- const flagValues = new Map();
6
- const handlers = new Map();
7
- const messages = [];
8
- const sentMessages = [];
9
- const messageRenderers = new Map();
10
- const api = {
11
- commands,
12
- tools,
13
- flags,
14
- flagValues,
15
- handlers,
16
- messages,
17
- sentMessages,
18
- messageRenderers,
19
- activeTools: [],
20
- on(event, handler) {
21
- const list = handlers.get(event) ?? [];
22
- list.push(handler);
23
- handlers.set(event, list);
24
- },
25
- registerTool(tool) {
26
- tools.set(tool.name, tool);
27
- },
28
- registerCommand(name, options) {
29
- commands.set(name, options);
30
- },
31
- registerShortcut() { },
32
- registerFlag(name, options) {
33
- flags.set(name, options);
34
- if (options.default !== undefined && !flagValues.has(name)) {
35
- flagValues.set(name, options.default);
36
- }
37
- },
38
- getFlag(name) {
39
- return flagValues.get(name);
40
- },
41
- registerMessageRenderer(customType, renderer) {
42
- messageRenderers.set(customType, renderer);
43
- },
44
- sendMessage(message, options) {
45
- messages.push(message);
46
- sentMessages.push({ message, options });
47
- },
48
- sendUserMessage() { },
49
- setSessionName(name) {
50
- api.sessionName = name;
51
- },
52
- getSessionName() {
53
- return api.sessionName;
54
- },
55
- setActiveTools(toolNames) {
56
- api.activeTools = toolNames;
57
- },
58
- getActiveTools() {
59
- return api.activeTools;
60
- },
61
- getAllTools() {
62
- return [...tools.values()].map((tool) => ({
63
- name: tool.name,
64
- description: tool.description,
65
- parameters: tool.parameters,
66
- sourceInfo: { path: "<test>", source: "test", scope: "temporary", origin: "top-level" },
67
- }));
68
- },
69
- setThinkingLevel(level) {
70
- api.thinkingLevel = level;
71
- },
72
- getThinkingLevel() {
73
- return api.thinkingLevel ?? "off";
74
- },
75
- async setModel(model) {
76
- api.model = model;
77
- return true;
78
- },
79
- async emitExtensionEvent(event, ctx) {
80
- const results = [];
81
- for (const handler of handlers.get(event.type) ?? []) {
82
- results.push(await handler(event, ctx));
83
- }
84
- return results;
85
- },
86
- events: {
87
- emit() { },
88
- on() {
89
- return () => { };
90
- },
91
- off() { },
92
- },
93
- };
94
- return api;
95
- }
96
- //# sourceMappingURL=testing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"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"}
@@ -1,65 +0,0 @@
1
- # Deployment configuration
2
-
3
- How a recipe declares what its tasks need from the platform that runs them —
4
- compute resources and scratch disk — and what an implementing platform does
5
- with those declarations.
6
-
7
- This spec is defined here, in Recipes, because it describes *Recipe
8
- intent*: portable, platform-neutral declarations that any host can honor.
9
- The validation grammar lives in `pi_recipe_check::resources`
10
- (`validate_resources`) so every host — the Introspection CLI, a
11
- platform's manifest validator, wasm/Python bindings — applies identical
12
- rules with stable diagnostic codes. Platform-specific enforcement (floors,
13
- caps, billing) is the implementer's job, not part of the grammar.
14
-
15
- ## Where the declarations live
16
-
17
- Recipe *package* contents (`package.json#pi`, `agents/*.yaml`) are
18
- materialized inside a running sandbox, after the machine that runs them
19
- already exists — so deployment configuration cannot live there. It lives in
20
- the host's deployment manifest, the file the platform reads *before*
21
- provisioning. On Introspection that is the repo-root
22
- `.introspection/<slug>.yaml` manifest's `runtime:` block:
23
-
24
- ```yaml
25
- runtime:
26
- resources:
27
- requests: { cpu: 500m, memory: 1.5Gi, storage: 10Gi }
28
- limits: { cpu: 1500m, memory: 1.5Gi }
29
- ```
30
-
31
- ## `resources`
32
-
33
- Kubernetes-style `requests`/`limits` (`validate_resources`). Grammar:
34
- `500m` millicores or decimal cores for CPU; bytes with binary
35
- (`Ki`/`Mi`/`Gi`/`Ti`) or decimal (`k`/`M`/`G`/`T`) suffixes for memory and
36
- storage (`0.1T` works). Quantities may also be JSON numbers — `cpu: 1.5`
37
- (cores) or an integer byte count for memory. A request must not exceed its limit.
38
-
39
- `storage` is the sandbox scratch-volume size and follows the PVC
40
- convention (`spec.resources.requests.storage`): request-only — declaring
41
- it under `limits` is rejected. Whether the scratch volume is persistent
42
- (survives sandbox teardown for warm restore) or ephemeral stays a
43
- *deployment* setting on the implementing platform — the recipe only sizes
44
- it. Future io characteristics (e.g. a storage class) would be siblings in
45
- the manifest, mirroring how Kubernetes expresses them outside the
46
- quantity.
47
-
48
- ## How Introspection implements this
49
-
50
- The reference implementation treats every declaration as an **upward
51
- request** merged onto deployment-configured floors:
52
-
53
- - cpu/memory requests: `max(recipe, deployment floor)`, capped by a
54
- schedulability guard; limits raise to the resolved request.
55
- - `requests.storage`: taken as declared — rounded up to whole GiB
56
- (smaller scratch bills less; 1Gi is the validated minimum) and capped
57
- at 300 GiB; undeclared uses the deployment default (10 GiB). Applied to
58
- the sandbox's scratch volume (a persistent PVC when the deployment
59
- enables warm storage, ephemeral emptyDir at the same mount path
60
- otherwise).
61
-
62
- Invalid declarations fail manifest validation at push — a recipe never
63
- silently spawns with defaults because of a typo. Other platforms may
64
- choose different enforcement; the declarations and their grammar are the
65
- portable part.
package/docs/migration.md DELETED
@@ -1,70 +0,0 @@
1
- # Migration to Recipes
2
-
3
- The project and npm package are now **Recipes**:
4
-
5
- ```text
6
- @introspection-ai/pi-recipes → @introspection-ai/recipes
7
- Pi Recipes → Recipes
8
- ```
9
-
10
- The artifact remains **a Recipe**. The package format and focused runtime
11
- entrypoints remain source-compatible unless noted below.
12
-
13
- ## Package imports
14
-
15
- ```diff
16
- - import { resolveRecipe } from "@introspection-ai/pi-recipes/recipe";
17
- + import { resolveRecipe } from "@introspection-ai/recipes/recipe";
18
-
19
- - import { createRecipeSession } from "@introspection-ai/pi-recipes/session";
20
- + import { createRecipeSession } from "@introspection-ai/recipes/session";
21
- ```
22
-
23
- The same replacement applies to `/run`, `/pi`, `/interactions`, and
24
- `/test-utils`. The former `/tracing` entrypoint is removed: pass a host-owned
25
- tracer through `createRecipeSession({ otel })` instead.
26
-
27
- ## Pi extension
28
-
29
- ```bash
30
- pi remove npm:@introspection-ai/pi-recipes
31
- pi install npm:@introspection-ai/recipes
32
- ```
33
-
34
- The Recipe extension factory is now `createRecipesExtension`.
35
- `createPiRecipesExtension` remains as a deprecated source-compatible alias.
36
-
37
- Recipe-owned extensions that still import
38
- `@introspection-ai/pi-recipes/interactions` are aliased to the current runtime
39
- while they migrate.
40
-
41
- ## CLI
42
-
43
- The standalone `recipes` executable has been retired. Use:
44
-
45
- ```bash
46
- introspection init
47
- introspection check
48
- introspection local
49
- introspection dev
50
- ```
51
-
52
- Use ordinary Git and filesystem operations to clone, fork, copy, and publish
53
- Recipe source.
54
-
55
- ## Hosting
56
-
57
- `serveRecipe` and `@introspection-ai/recipes/serve` are not part of the new
58
- package. Hosts integrate at `createRecipeSession`; HTTP protocols, persistence,
59
- auth, and deployment adapters belong to the host.
60
-
61
- `runRecipe` remains as the small one-turn convenience above the session API.
62
-
63
- ## Validation
64
-
65
- The root npm package no longer downloads a platform-specific
66
- `recipe-check` executable. Validation remains available through:
67
-
68
- - `introspection check`;
69
- - the `pi-recipe-check` Rust crate and binary;
70
- - the `pi-recipe-check` Python package.
@@ -1,47 +0,0 @@
1
- # Python bindings release
2
-
3
- The `pi-recipe-check` Rust crate and Python distribution are two artifacts of
4
- one validator product and always use the same version. The binding's Cargo
5
- package and dependency on the core must both match the core crate version.
6
- `scripts/check-recipe-check-versions.mjs` enforces this invariant in CI.
7
-
8
- Release Please owns both versions, changelogs, component tags, and GitHub
9
- releases. Its `linked-versions` plugin advances both components to the same
10
- version whenever either has a releasable change. The `cargo-workspace` plugin
11
- keeps the local dependency current, but leaves candidate merging to
12
- `linked-versions`. A Python-only fix therefore creates a patch release for
13
- both artifacts, and a core release always includes a matching Python release.
14
- Routine releases must not bump either Cargo version manually.
15
-
16
- When Release Please creates a Python binding release, the release workflow:
17
-
18
- 1. Builds `abi3` wheels compatible with CPython 3.10 and newer for Linux
19
- x86-64 and ARM64, macOS Apple Silicon and Intel, and Windows x86-64.
20
- 2. Builds a source distribution containing the local Rust workspace
21
- dependency.
22
- 3. Waits for the matching `pi-recipe-check` crate publication to succeed.
23
- 4. Publishes all Python artifacts to PyPI through trusted publishing.
24
-
25
- ## One-time PyPI setup
26
-
27
- Before the first release, create a pending trusted publisher for the unclaimed
28
- `pi-recipe-check` project on PyPI with:
29
-
30
- - Owner: `introspection-org`
31
- - Repository: `pi-recipes`
32
- - Workflow: `release-please.yml`
33
- - Environment: `publish`
34
-
35
- The GitHub `publish` environment should retain its existing deployment
36
- protection. No long-lived PyPI API token is required.
37
-
38
- Local release artifact checks use the locked development environment and the
39
- same pinned maturin version as CI:
40
-
41
- ```sh
42
- uv sync --project bindings/python --locked
43
- uv run --project bindings/python --locked maturin build --locked --release --out dist \
44
- --manifest-path bindings/python/Cargo.toml
45
- uv run --project bindings/python --locked maturin sdist --out dist \
46
- --manifest-path bindings/python/Cargo.toml
47
- ```
@@ -1,70 +0,0 @@
1
- # Recipe eval declarations
2
-
3
- A Recipe may pin offline evaluation suites without owning the evaluation
4
- runner. The declaration makes quality inputs portable and reproducible; a host
5
- or external tool decides when and where to execute them.
6
-
7
- ## Registry suite
8
-
9
- ```json
10
- {
11
- "pi": {
12
- "evals": {
13
- "suites": [
14
- {
15
- "name": "smoke",
16
- "type": "registry",
17
- "dataset": "acme/coding-smoke",
18
- "version": "1.2.0"
19
- }
20
- ]
21
- }
22
- }
23
- }
24
- ```
25
-
26
- Registry suites MUST pin an exact dataset version. Mutable aliases such as
27
- `latest` are invalid.
28
-
29
- ## Git suite
30
-
31
- ```json
32
- {
33
- "pi": {
34
- "evals": {
35
- "suites": [
36
- {
37
- "name": "terminal",
38
- "type": "git",
39
- "repo": "https://github.com/acme/agent-evals.git",
40
- "rev": "4f7c2b0d6d8a...",
41
- "dataset": "terminal"
42
- }
43
- ]
44
- }
45
- }
46
- }
47
- ```
48
-
49
- Git suites SHOULD pin a commit SHA. The dataset path MUST stay inside the
50
- checkout.
51
-
52
- ## Validation
53
-
54
- ```bash
55
- introspection check
56
- ```
57
-
58
- The validator checks declaration shape, unique suite names, immutable pins,
59
- safe paths, and supported suite types without cloning or running the suite.
60
-
61
- ## Runtime boundary
62
-
63
- Recipe sessions do not load or execute eval suites. The declaration belongs to
64
- the portable artifact because it identifies the authored evidence associated
65
- with that agent. Harbor, CI, Introspection, or another evaluation system may
66
- adapt that declaration into its own execution model.
67
-
68
- The selected Recipe agent remains the source of truth for model and behavior.
69
- An eval runner MUST make any override explicit rather than silently changing
70
- the agent under test.
@@ -1,171 +0,0 @@
1
- # Runtime library
2
-
3
- The Recipes runtime library turns Recipe source into a live Pi agent. It is a
4
- library boundary, not a hosting framework.
5
-
6
- ## The embedding ladder
7
-
8
- ```text
9
- resolveRecipe() read and resolve the portable package
10
- │
11
- ▼
12
- createRecipeSession() construct the complete live Pi session
13
- │
14
- └── runRecipe() execute one turn and dispose
15
- ```
16
-
17
- Hosts should use the lowest layer that preserves their control.
18
-
19
- ## `resolveRecipe`
20
-
21
- ```ts
22
- import { resolveRecipe } from "@introspection-ai/recipes/recipe";
23
-
24
- const recipe = resolveRecipe({
25
- recipeDir,
26
- agentName,
27
- });
28
- ```
29
-
30
- The result contains the selected agent, visible subagents, model settings,
31
- tools, MCP policy, skills, prompts, extensions, and system-prompt composition.
32
- It does not create a model client or start a session.
33
-
34
- ## `createRecipeSession`
35
-
36
- ```ts
37
- import { createRecipeSession } from "@introspection-ai/recipes/session";
38
-
39
- const handle = await createRecipeSession({
40
- recipeDir,
41
- agentName,
42
- cwd: workspaceDir,
43
- credentials,
44
- modelOverride,
45
- mcpBindings,
46
- eventBus,
47
- customTools,
48
- extensionFactories,
49
- runController,
50
- agentToolOptions,
51
- settingsManager,
52
- sessionManager,
53
- additionalSkillPaths,
54
- skillPaths,
55
- systemPrompt,
56
- onDiagnostics,
57
- onEvent,
58
- otel: {
59
- tracer,
60
- meter,
61
- meta: { conversationId },
62
- runSpans: false,
63
- getParentContext: () => currentTurnContext,
64
- },
65
- });
66
- ```
67
-
68
- This is the primary host integration point. It:
69
-
70
- - resolves the Recipe and selected agent;
71
- - resolves model credentials fail-closed;
72
- - materializes required MCP bindings fail-closed;
73
- - loads Recipe skills, prompts, and extensions;
74
- - registers the shared subagent tool;
75
- - creates and binds the Pi `AgentSession`;
76
- - returns one idempotent `dispose()` boundary.
77
-
78
- The returned `RecipeSessionHandle` exposes:
79
-
80
- - `session` — Pi prompt, steer, follow-up, abort, messages, and events;
81
- - `recipe` — the resolved portable definition;
82
- - `runs` — the subagent run controller;
83
- - `dispose()` — child, session, instrumentation, and MCP cleanup.
84
-
85
- Host injection is intentional. A managed host can supply durable session state,
86
- cross-process subagent execution, inline endpoint bindings, platform
87
- extensions, its own settings, an event bus, host tools, and a
88
- gateway-decorated model without reimplementing Recipe semantics. The Recipe
89
- continues to own model configuration and tool selection; host seams replace
90
- transport and materialized resources, not the portable definition.
91
-
92
- Default MCP materialization leases the supplied `env` object until the handle
93
- is disposed and restores its prior MCP/PATH state afterward. Concurrent
94
- materialized sessions must receive separate environment objects. A host that
95
- materializes one process-wide MCP runtime instead passes `mcpMode: "inherit"`
96
- to its sessions, as runtime-agent does.
97
-
98
- ## `runRecipe`
99
-
100
- ```ts
101
- import { runRecipe } from "@introspection-ai/recipes/run";
102
-
103
- const result = await runRecipe({
104
- recipeDir,
105
- cwd: workspaceDir,
106
- prompt,
107
- timeoutMs: 120_000,
108
- });
109
- ```
110
-
111
- `runRecipe` creates one session, executes one prompt, returns the transcript and
112
- final text, and always disposes. It is suitable for tests, cron jobs, and queue
113
- workers that do not need a durable conversational host.
114
-
115
- ## Inspection
116
-
117
- ```ts
118
- import { inspectRecipe } from "@introspection-ai/recipes/inspect";
119
-
120
- const requirements = inspectRecipe(recipeDir);
121
- ```
122
-
123
- Inspection derives agents, providers, expected credential variables, required
124
- and optional MCP servers, and resource counts without creating a session.
125
-
126
- ## OpenTelemetry
127
-
128
- Pass a tracer through `otel` to attach the JS SDK's OpenTelemetry GenAI
129
- semantic-convention instrumentation to the session. Recipes derives default
130
- agent identity from the resolved package and generates a conversation id when
131
- the host does not provide one. The default in-process subagent controller
132
- inherits that conversation id while each child derives its own Recipe agent
133
- identity. Injected run controllers own their child-session instrumentation.
134
-
135
- Recipes does not create or register an OTel provider, processor, exporter, or
136
- global context manager. The host owns that pipeline and its content policy. A
137
- standalone host can therefore use the same standard OTLP exporter for
138
- Braintrust, Langfuse, an OTel Collector, or another compatible backend. A host
139
- that needs structure-only infrastructure traces can wrap that exporter with
140
- `GenAiContentScrubbingExporter` from
141
- `@introspection-sdk/introspection-pi`.
142
-
143
- Short-lived hosts must flush their own provider after `runRecipe` completes;
144
- long-lived hosts should flush and shut it down with the host lifecycle.
145
-
146
- ## Host conformance
147
-
148
- ```ts
149
- import { hostConformanceCases } from "@introspection-ai/recipes/test-utils";
150
-
151
- for (const testCase of hostConformanceCases(myHostAdapter)) {
152
- it(testCase.name, testCase.run);
153
- }
154
- ```
155
-
156
- Passing the suite means the host is using the same session construction
157
- contract as Pi and Introspection. Protocol behavior, persistence, tenancy, and
158
- deployment remain host-specific and require their own tests.
159
-
160
- ## Deliberate non-features
161
-
162
- The package does not provide:
163
-
164
- - an HTTP server or wire protocol;
165
- - a task database or task state machine;
166
- - a scheduler or queue;
167
- - sandbox or tenant isolation;
168
- - a deployment CLI;
169
- - provider-specific hosting adapters.
170
-
171
- Those layers compose above `createRecipeSession`.