@introspection-ai/recipes 0.60.1 → 0.61.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.
- package/dist/documents/module.d.ts +10 -5
- package/dist/documents/module.d.ts.map +1 -1
- package/dist/documents/module.js +9 -4
- package/dist/documents/module.js.map +1 -1
- package/dist/recipe/companions.d.ts +2 -0
- package/dist/recipe/companions.d.ts.map +1 -1
- package/dist/recipe/companions.js +3 -1
- package/dist/recipe/companions.js.map +1 -1
- package/dist/recipe/manifest.generated.d.ts +1 -1
- package/dist/recipe/manifest.generated.js +1 -1
- package/dist/recipe/package.d.ts.map +1 -1
- package/dist/recipe/package.js +9 -7
- package/dist/recipe/package.js.map +1 -1
- package/dist/recipe/python.d.ts +25 -15
- package/dist/recipe/python.d.ts.map +1 -1
- package/dist/recipe/python.js +114 -33
- package/dist/recipe/python.js.map +1 -1
- package/docs/documents/README.md +44 -37
- package/docs/recipe-format.md +73 -47
- package/package.json +7 -5
- package/python/shared/pyproject.toml +15 -0
- package/python/shared/uv.lock +476 -0
package/docs/recipe-format.md
CHANGED
|
@@ -717,17 +717,21 @@ Those host concerns MUST NOT become mandatory Recipe source fields.
|
|
|
717
717
|
|
|
718
718
|
## Runtime requirements
|
|
719
719
|
|
|
720
|
-
A Recipe MAY
|
|
721
|
-
|
|
722
|
-
|
|
720
|
+
A Recipe MAY bring Python. Its requirements are fail-closed: a host MUST
|
|
721
|
+
satisfy them before the first model call or reject the Recipe with an
|
|
722
|
+
actionable diagnostic.
|
|
723
|
+
|
|
724
|
+
**A `pyproject.toml` and `uv.lock` at the Recipe root are the Recipe's Python
|
|
725
|
+
project.** They list only the Recipe's own libraries. A Recipe without them
|
|
726
|
+
has no project of its own. A root `pyproject.toml` without a `uv.lock` is an
|
|
727
|
+
error: run `uv lock` and commit the lock. `pi.runtime.python` is optional and
|
|
728
|
+
holds overrides for that project only:
|
|
723
729
|
|
|
724
730
|
```json
|
|
725
731
|
{
|
|
726
732
|
"pi": {
|
|
727
733
|
"runtime": {
|
|
728
734
|
"python": {
|
|
729
|
-
"project": "python",
|
|
730
|
-
"lockfile": "python/uv.lock",
|
|
731
735
|
"version": ">=3.12,<3.15",
|
|
732
736
|
"imports": ["pandas", "openpyxl"]
|
|
733
737
|
}
|
|
@@ -736,48 +740,68 @@ first model call or reject the Recipe with an actionable diagnostic.
|
|
|
736
740
|
}
|
|
737
741
|
```
|
|
738
742
|
|
|
739
|
-
|
|
740
|
-
`
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
`
|
|
743
|
+
Declaring it without a root `pyproject.toml` is an error
|
|
744
|
+
(`runtime.python_project_missing`); a Recipe that uses only first-party
|
|
745
|
+
packages' Python declares none. `version` is passed to uv as the interpreter
|
|
746
|
+
request. `imports` are optional
|
|
747
|
+
boot preflights, each a dotted Python module name (`docx`, `paper_docx.api`);
|
|
748
|
+
hosts import them with `PYTHONHOME` removed. Hosts MUST install with frozen
|
|
749
|
+
resolution and MUST NOT install into system Python or resolve an unlocked
|
|
750
|
+
dependency graph. `pi.runtime.python.project` (a subdirectory holding the
|
|
751
|
+
project) and `pi.runtime.python.lockfile` are legacy: still read, with
|
|
752
|
+
`recipes check` warning `runtime.python_project_legacy`; the lockfile is
|
|
753
|
+
always the project's `uv.lock`.
|
|
747
754
|
|
|
748
755
|
`pi.runtime.python` is the only runtime key; any other key under `pi.runtime`
|
|
749
756
|
is rejected. PDF and Word work goes through the `documents` tool (`pi.documents`
|
|
750
757
|
with the `pdf` or `docx` format), not shell utilities. A Recipe that only uses
|
|
751
|
-
the `documents` tool needs no `pi.runtime.python
|
|
752
|
-
|
|
758
|
+
the `documents` tool needs no `pi.runtime.python` and no Python project; the
|
|
759
|
+
host prepares the shared environment for the Word and PDF formats (below).
|
|
753
760
|
|
|
754
761
|
### Package declarations
|
|
755
762
|
|
|
756
763
|
A package the Recipe depends on MAY declare `pi.runtime.python` in its own
|
|
757
|
-
`package.json`, with
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
`
|
|
764
|
+
`package.json`, with `project` naming its Python project directory (relative
|
|
765
|
+
to the package; `lockfile`, if given, is that project's `uv.lock`). Hosts read
|
|
766
|
+
it from each direct `dependencies` or `peerDependencies` entry, found with
|
|
767
|
+
Node's package resolution from the Recipe directory (the Recipe's own
|
|
768
|
+
`node_modules`, or one above it when the platform provides a peer or an npm
|
|
769
|
+
install hoists a dependency); `devDependencies` and transitive dependencies are
|
|
762
770
|
not read, and a declared dependency that is not installed is skipped. A
|
|
763
771
|
package declaring it MUST ship the project's `pyproject.toml` and `uv.lock`:
|
|
764
772
|
when its `package.json` lists `files`, both must be covered.
|
|
765
773
|
|
|
766
|
-
Each
|
|
774
|
+
Each environment is separate:
|
|
767
775
|
|
|
768
|
-
- **The Recipe's own
|
|
769
|
-
|
|
776
|
+
- **The Recipe's own project is the shell environment.** Hosts activate it
|
|
777
|
+
for the agent's shell tools: `VIRTUAL_ENV` and `UV_PROJECT_ENVIRONMENT`
|
|
770
778
|
name it, its `bin` (`Scripts` on Windows) comes first on `PATH`, and
|
|
771
|
-
`PYTHONHOME` is removed.
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
779
|
+
`PYTHONHOME` is removed. It holds only what the Recipe's `pyproject.toml`
|
|
780
|
+
lists: a script that imports `docx` lists `paper-docx` there.
|
|
781
|
+
- **First-party packages share one environment**, Recipes' own
|
|
782
|
+
`python/shared` project, locked once in Recipes (today paper-docx for the
|
|
783
|
+
Word format, pypdfium2 and pillow for PDF). Hosts prepare it when the Recipe
|
|
784
|
+
uses a package it serves, through `pi.documents`, `pi.channels` or by
|
|
785
|
+
listing the package in `dependencies` or `peerDependencies` (installed or
|
|
786
|
+
not), and pass its interpreter to each of them (a documents format receives
|
|
787
|
+
it as `createAdapter({ env, cwd, python })`). **A Recipe with no Python of
|
|
788
|
+
its own gets it as its shell environment**, so a script the agent runs with
|
|
789
|
+
`python3` can `import docx` with no Python files in the Recipe.
|
|
790
|
+
- **For package authors:** a first-party `@introspection-ai/*` package that
|
|
791
|
+
needs Python adds its libraries to Recipes' `python/shared` project, joins
|
|
792
|
+
the one list of packages Recipes serves from it (`SHARED_PYTHON_PACKAGES`),
|
|
793
|
+
and declares no `pi.runtime.python`; a `pi.runtime.python` such a package
|
|
794
|
+
declared in an older release is not read. A third-party package declares
|
|
795
|
+
its own `pi.runtime.python` and gets its own environment.
|
|
796
|
+
- **Every other package's declaration gets a separate environment**,
|
|
797
|
+
installed with `--no-editable` from the package's own lock and never
|
|
798
|
+
activated or put on `PATH`. The host hands the package its interpreter.
|
|
776
799
|
|
|
777
800
|
A package extension asks for a package's interpreter with
|
|
778
|
-
`packagePython(name)` on its session context, by the package's name
|
|
779
|
-
|
|
780
|
-
|
|
801
|
+
`packagePython(name)` on its session context, by the package's name (a
|
|
802
|
+
shared-environment package's is the shared environment's); it is `undefined` when
|
|
803
|
+
that package declares no `pi.runtime.python` or is not a direct dependency.
|
|
804
|
+
`@introspection-ai/recipes/python` runs a script with it:
|
|
781
805
|
`pythonExecutable({ python, env, override })` picks the interpreter
|
|
782
806
|
(`env[override]`, then `python`, then `VIRTUAL_ENV`, then `python3`), and
|
|
783
807
|
`runPythonJson(script, request, { python, env, cwd, signal, timeoutMs })`
|
|
@@ -801,9 +825,6 @@ export default function tables(pi) {
|
|
|
801
825
|
}
|
|
802
826
|
```
|
|
803
827
|
|
|
804
|
-
No declaration has to agree with another: two packages may lock different
|
|
805
|
-
versions of the same library.
|
|
806
|
-
|
|
807
828
|
### Preparing environments
|
|
808
829
|
|
|
809
830
|
`prepareRecipePython(recipeDir, options)` from
|
|
@@ -820,21 +841,26 @@ versions of the same library.
|
|
|
820
841
|
- uv runs with `--no-python-downloads` unless `allowPythonDownloads` is set.
|
|
821
842
|
|
|
822
843
|
By default environments live in a shared cache,
|
|
823
|
-
`~/.introspection/python/<hash>`, keyed by the environment kind (
|
|
824
|
-
package), platform and architecture, the `uv.lock` and
|
|
825
|
-
contents, and the declared `version`. Without a declared
|
|
826
|
-
keys on what uv would pick the interpreter from:
|
|
827
|
-
`.python-version` or `.python-versions` file from the
|
|
828
|
-
the filesystem root, and uv's global pin.
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
844
|
+
`~/.introspection/python/<hash>`, keyed by the environment kind (the Recipe's,
|
|
845
|
+
shared or package), platform and architecture, the `uv.lock` and
|
|
846
|
+
`pyproject.toml` contents, and the declared `version`. Without a declared
|
|
847
|
+
`version` it also keys on what uv would pick the interpreter from:
|
|
848
|
+
`UV_PYTHON`, every `.python-version` or `.python-versions` file from the
|
|
849
|
+
project directory up to the filesystem root, and uv's global pin. The
|
|
850
|
+
shared and package environments also key on the package's directory and
|
|
851
|
+
version; a Recipe project that is itself a package (it has `[build-system]`,
|
|
852
|
+
so it installs editable) keys on its directory. `environmentRoot` (or
|
|
853
|
+
`PI_RECIPES_PYTHON_ROOT`) fixes the location instead: the Recipe's
|
|
854
|
+
environment is `<root>/python`, the shared environment
|
|
855
|
+
`<root>/python-shared` and each package's `<root>/python-packages/<name>`,
|
|
856
|
+
so a host baking environments into a Recipe image passes `<recipe>/.pi`.
|
|
857
|
+
Concurrent preparations of one environment are serialised by a lock file
|
|
858
|
+
beside it. uv never creates a `.venv` in the Recipe: the host names the
|
|
859
|
+
environment.
|
|
835
860
|
|
|
836
861
|
Each prepared environment reports its directory and interpreter, plus the
|
|
837
|
-
activation for the shell environment
|
|
862
|
+
activation for the shell environment (`kind: "shared"` when it is the
|
|
863
|
+
shared environment). Failures are named errors:
|
|
838
864
|
`RecipePythonUvMissingError` (uv not installed), `RecipePythonVersionError`
|
|
839
865
|
(no interpreter satisfies the version), `RecipePythonOutdatedError` (check
|
|
840
866
|
mode found an environment missing or not matching its lock) and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@introspection-ai/recipes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "The open format for vertical agents, built on Pi.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"skills",
|
|
13
|
+
"python/shared/pyproject.toml",
|
|
14
|
+
"python/shared/uv.lock",
|
|
13
15
|
"docs",
|
|
14
16
|
"README.md",
|
|
15
17
|
"package.json"
|
|
@@ -150,10 +152,10 @@
|
|
|
150
152
|
"@introspection-ai/recipe-productivity-microsoft": ">=0.1.0",
|
|
151
153
|
"@introspection-ai/recipe-search": ">=0.1.0",
|
|
152
154
|
"@introspection-ai/recipe-signature": ">=0.1.0",
|
|
153
|
-
"@introspection-ai/mcp-client-linux-x64": "0.
|
|
154
|
-
"@introspection-ai/mcp-client-linux-arm64": "0.
|
|
155
|
-
"@introspection-ai/mcp-client-darwin-arm64": "0.
|
|
156
|
-
"@introspection-ai/mcp-client-darwin-x64": "0.
|
|
155
|
+
"@introspection-ai/mcp-client-linux-x64": "0.61.0",
|
|
156
|
+
"@introspection-ai/mcp-client-linux-arm64": "0.61.0",
|
|
157
|
+
"@introspection-ai/mcp-client-darwin-arm64": "0.61.0",
|
|
158
|
+
"@introspection-ai/mcp-client-darwin-x64": "0.61.0"
|
|
157
159
|
},
|
|
158
160
|
"peerDependencies": {
|
|
159
161
|
"@earendil-works/pi-agent-core": ">=1.1.0 <2.0.0",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "recipes-shared"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "The one Python environment every first-party @introspection-ai package that needs Python runs in; a package adds its libraries here."
|
|
5
|
+
requires-python = ">=3.12,<3.15"
|
|
6
|
+
dependencies = ["paper-docx>=0.2.1", "pypdfium2==5.14.0", "pillow==13.0.0"]
|
|
7
|
+
|
|
8
|
+
[project.optional-dependencies]
|
|
9
|
+
# Table cells for fee schedules, SLA grids and price tables. Optional: about 41 MB
|
|
10
|
+
# installed (pdfminer.six, cryptography, Pillow, cffi). Without it, a PDF read returns text.
|
|
11
|
+
tables = ["pdfplumber==0.11.10"]
|
|
12
|
+
|
|
13
|
+
[tool.uv]
|
|
14
|
+
package = false
|
|
15
|
+
constraint-dependencies = ["python-docx<0"]
|