@introspection-ai/recipes 0.37.0 → 0.39.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/README.md +5 -2
- package/dist/child/session.d.ts +2 -0
- package/dist/child/session.d.ts.map +1 -1
- package/dist/child/session.js +3 -0
- package/dist/child/session.js.map +1 -1
- package/dist/connector-tools.d.ts +4 -0
- package/dist/connector-tools.d.ts.map +1 -1
- package/dist/connector-tools.js.map +1 -1
- package/dist/documents/index.d.ts +5 -2
- package/dist/documents/index.d.ts.map +1 -1
- package/dist/documents/index.js +3 -1
- package/dist/documents/index.js.map +1 -1
- package/dist/documents/module.d.ts +29 -10
- package/dist/documents/module.d.ts.map +1 -1
- package/dist/documents/module.js +22 -4
- package/dist/documents/module.js.map +1 -1
- package/dist/documents/profile.d.ts +34 -0
- package/dist/documents/profile.d.ts.map +1 -0
- package/dist/documents/profile.js +94 -0
- package/dist/documents/profile.js.map +1 -0
- package/dist/documents/python.d.ts +30 -0
- package/dist/documents/python.d.ts.map +1 -0
- package/dist/documents/python.js +64 -0
- package/dist/documents/python.js.map +1 -0
- package/dist/extensions.d.ts +16 -0
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +12 -0
- package/dist/extensions.js.map +1 -1
- package/dist/mcp-chunks/chunk-ZK2E4S7E.js +12520 -0
- package/dist/mcp-daemon.js +1 -1
- package/dist/mcp-run-worker.js +1 -1
- package/dist/pi-extension.d.ts.map +1 -1
- package/dist/pi-extension.js +89 -14
- package/dist/pi-extension.js.map +1 -1
- package/dist/python.d.ts +56 -0
- package/dist/python.d.ts.map +1 -0
- package/dist/python.js +100 -0
- package/dist/python.js.map +1 -0
- package/dist/recipe/package.d.ts +22 -0
- package/dist/recipe/package.d.ts.map +1 -1
- package/dist/recipe/package.js +118 -6
- package/dist/recipe/package.js.map +1 -1
- package/dist/recipe/python.d.ts +141 -0
- package/dist/recipe/python.d.ts.map +1 -0
- package/dist/recipe/python.js +698 -0
- package/dist/recipe/python.js.map +1 -0
- package/dist/recipe/resolve.d.ts +3 -0
- package/dist/recipe/resolve.d.ts.map +1 -1
- package/dist/recipe/resolve.js +2 -0
- package/dist/recipe/resolve.js.map +1 -1
- package/dist/run-controller.d.ts +2 -0
- package/dist/run-controller.d.ts.map +1 -1
- package/dist/run-controller.js +3 -0
- package/dist/run-controller.js.map +1 -1
- package/dist/session.d.ts +8 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +37 -15
- package/dist/session.js.map +1 -1
- package/docs/documents.md +134 -17
- package/docs/pi-extension.md +4 -1
- package/docs/recipe-format.md +99 -4
- package/documents/SKILL.md +63 -0
- package/package.json +16 -10
- package/dist/mcp-chunks/chunk-UVEZNUN3.js +0 -3312
package/docs/documents.md
CHANGED
|
@@ -25,8 +25,8 @@ Agents select `tools: [documents]`.
|
|
|
25
25
|
```json
|
|
26
26
|
{
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@introspection-ai/recipe-documents-docx": ">=0.1.0
|
|
29
|
-
"@introspection-ai/recipe-documents-pdf": ">=0.1.0
|
|
28
|
+
"@introspection-ai/recipe-documents-docx": ">=0.1.0",
|
|
29
|
+
"@introspection-ai/recipe-documents-pdf": ">=0.1.0"
|
|
30
30
|
},
|
|
31
31
|
"pi": {
|
|
32
32
|
"documents": [{ "format": "docx" }, { "format": "pdf" }]
|
|
@@ -55,6 +55,101 @@ Unlike channels, where each provider owns its own `channels` tool, formats
|
|
|
55
55
|
share one tool: a Recipe reads a PDF brief and edits a Word contract in the
|
|
56
56
|
same turn, and two `documents` tools would collide.
|
|
57
57
|
|
|
58
|
+
## Skills and profiles
|
|
59
|
+
|
|
60
|
+
Every agent that selects `documents` is offered a core `documents` skill: which
|
|
61
|
+
command fits which change, how to quote, and what each failure means. It is
|
|
62
|
+
generic, with nothing about any one kind of work.
|
|
63
|
+
|
|
64
|
+
A **profile** is a skill for one kind of work, offered beside the core skill.
|
|
65
|
+
A declaration selects at most one, either shipped by the format, by name, or the
|
|
66
|
+
Recipe's own, by a relative path:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{ "pi": { "documents": [{ "format": "docx", "profile": "legal-redlining-en-US" }] } }
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{ "pi": { "documents": [{ "format": "docx", "profile": "./profiles/house-style-en-gb" }] } }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The docx package ships `legal-redlining-en-US`
|
|
77
|
+
(`packages/documents/docx/profiles/`): planning a first markup of a contract,
|
|
78
|
+
answering the other side's redline with counters and replies, and writing each
|
|
79
|
+
rationale in your side's voice. A name matches regardless of case.
|
|
80
|
+
|
|
81
|
+
A profile changes what the agent is told, never what the tool does: commands,
|
|
82
|
+
schemas and the path policy are the same with or without one. Nothing in a
|
|
83
|
+
profile runs; it is only read.
|
|
84
|
+
|
|
85
|
+
### Write your own profile
|
|
86
|
+
|
|
87
|
+
A profile is a folder holding a `SKILL.md`, anywhere inside the Recipe:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
profiles/
|
|
91
|
+
house-style-en-gb/
|
|
92
|
+
SKILL.md
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The `SKILL.md` starts with frontmatter. `name` must be the folder's name, in
|
|
96
|
+
lower case; `description` says when to read it:
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
---
|
|
100
|
+
name: house-style-en-gb
|
|
101
|
+
description: How we edit internal memos in Word. Read it with the documents skill before changing a memo.
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
# Editing memos
|
|
105
|
+
|
|
106
|
+
This profile layers on the core `documents` skill.
|
|
107
|
+
|
|
108
|
+
## When it applies
|
|
109
|
+
Internal memos and policies in Word. Not contracts: those go to legal.
|
|
110
|
+
|
|
111
|
+
## Planning
|
|
112
|
+
Read the whole memo first. Change only what's wrong or unclear; keep the
|
|
113
|
+
author's structure and voice.
|
|
114
|
+
|
|
115
|
+
## Making the changes
|
|
116
|
+
- Rewrite a paragraph with `revise`: its `paragraph` id, its full new `text`,
|
|
117
|
+
and a `rationale`.
|
|
118
|
+
- Fix a word or a figure with `propose_edits`, quoting from a fresh `read`.
|
|
119
|
+
- Raise a question without changing the text with `comment`.
|
|
120
|
+
|
|
121
|
+
## Comments
|
|
122
|
+
Each rationale says why in one sentence, in plain British English. Never
|
|
123
|
+
narrate the edit; the tracked change already shows it.
|
|
124
|
+
|
|
125
|
+
## When an edit fails
|
|
126
|
+
Fix that edit from its reason and the closest text, and resubmit only it. After
|
|
127
|
+
two failures, list it for the author instead.
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Then point the declaration at the folder, or at its `SKILL.md`. The path must
|
|
131
|
+
stay inside the Recipe, by its real path too: a symlink to a folder outside it
|
|
132
|
+
is refused.
|
|
133
|
+
|
|
134
|
+
What a profile should say:
|
|
135
|
+
|
|
136
|
+
- **When it applies,** and when it doesn't, so the agent reads it at the right time.
|
|
137
|
+
- **How to plan the work** before editing: what to change, what to leave alone.
|
|
138
|
+
- **Which `documents` commands to use for which change,** and how: `revise` for
|
|
139
|
+
rewriting paragraphs, `propose_edits` for small fixes, `comment`, `respond`,
|
|
140
|
+
`remove_section`.
|
|
141
|
+
- **How to write rationales and comments:** voice, length, what they explain.
|
|
142
|
+
- **What to do when an edit fails,** and when to stop and hand it to a person.
|
|
143
|
+
|
|
144
|
+
What belongs in the Recipe's own skills instead: a team's or a client's
|
|
145
|
+
positions, playbooks, approvals and facts about a deal. A profile describes a
|
|
146
|
+
kind of work; the Recipe knows the particular case.
|
|
147
|
+
|
|
148
|
+
`recipes check` validates the shape: a name, or a relative path inside the
|
|
149
|
+
Recipe. For a path it also checks that the `SKILL.md` exists, resolves inside
|
|
150
|
+
the Recipe, and has a matching `name` and a `description`. A name the format
|
|
151
|
+
doesn't ship fails when the Recipe loads, with the names it does ship.
|
|
152
|
+
|
|
58
153
|
## Commands
|
|
59
154
|
|
|
60
155
|
| Command (`documents` + `command`) | Arguments | Requires |
|
|
@@ -141,11 +236,8 @@ engine (MIT, Crosby Legal; the licence ships beside the helpers).
|
|
|
141
236
|
`render` is absent for Word: page images need a layout engine such as
|
|
142
237
|
LibreOffice, which the runtime image does not carry. Table structure, fields,
|
|
143
238
|
content controls, headers and footers, footnotes and formatting changes are
|
|
144
|
-
not commands.
|
|
145
|
-
|
|
146
|
-
with its MIT notice and with its install instructions replaced, offered to
|
|
147
|
-
any agent that selects `documents` with the docx format. It is a fallback
|
|
148
|
-
reference, not the primary path.
|
|
239
|
+
not commands. The core `documents` skill tells the agent to say so in its
|
|
240
|
+
reply rather than work around the tool with a script or by editing the XML.
|
|
149
241
|
|
|
150
242
|
### PDF: text, tables and page images
|
|
151
243
|
|
|
@@ -200,13 +292,22 @@ recommend the extra; a Recipe that only reads briefs can leave it out.
|
|
|
200
292
|
|
|
201
293
|
## Python
|
|
202
294
|
|
|
203
|
-
The Word and PDF helpers are small Python programs
|
|
204
|
-
`pi.runtime.python` environment
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
295
|
+
The Word and PDF helpers are small Python programs. Each format package
|
|
296
|
+
declares its own `pi.runtime.python` environment, locked by the package's
|
|
297
|
+
`python/uv.lock`: paper-docx for Word, pypdfium2 and pillow for PDF. The host
|
|
298
|
+
prepares that environment for the installed package, as it does every
|
|
299
|
+
package's (see [Runtime requirements](recipe-format.md#runtime-requirements)),
|
|
300
|
+
and passes its interpreter to the adapter. A Recipe declaring `pi.documents`
|
|
301
|
+
declares and locks none of these packages itself; its own
|
|
302
|
+
`pi.runtime.python`, if any, stays its shell environment. The helpers use
|
|
303
|
+
`RECIPE_DOCUMENTS_PYTHON` first when it is set (tests, custom hosts), then the
|
|
304
|
+
interpreter the host passes, then `VIRTUAL_ENV`, then `python3`. An extension
|
|
305
|
+
that needs one of these interpreters itself reads it with
|
|
306
|
+
`packagePython("@introspection-ai/recipe-documents-docx")` on its session
|
|
307
|
+
context (see [Package declarations](recipe-format.md#package-declarations)). Package
|
|
308
|
+
environments are synced without extras, so PDF `tables: true` needs
|
|
309
|
+
pdfplumber from an environment synced with `--extra tables` and named by
|
|
310
|
+
`RECIPE_DOCUMENTS_PYTHON`.
|
|
210
311
|
|
|
211
312
|
## How a Recipe's skills should use it
|
|
212
313
|
|
|
@@ -237,11 +338,27 @@ export default createDocumentFormatModule({
|
|
|
237
338
|
});
|
|
238
339
|
```
|
|
239
340
|
|
|
341
|
+
`createAdapter` also receives `python`: the interpreter of the environment the
|
|
342
|
+
format package's own `pi.runtime.python` declares, which the host prepares
|
|
343
|
+
(see [Runtime requirements](recipe-format.md#runtime-requirements)). It is
|
|
344
|
+
absent when the package declares none; an adapter that ignores it keeps
|
|
345
|
+
working.
|
|
346
|
+
|
|
347
|
+
A Python helper runs with `runDocumentHelper(script, request, { env, cwd,
|
|
348
|
+
python, signal })` from `@introspection-ai/recipes/documents`. It is
|
|
349
|
+
`runPythonJson` from `@introspection-ai/recipes/python` with the document
|
|
350
|
+
contract on top: the interpreter order above, including
|
|
351
|
+
`RECIPE_DOCUMENTS_PYTHON`; a helper that prints `{ "error": "..." }` fails the
|
|
352
|
+
call with that message; and the result is a `DocumentResult` (`text`,
|
|
353
|
+
`details`, `images`) whose `details.timing.call_ms` records the round trip.
|
|
354
|
+
The Word and PDF packages use it and re-export it as `runHelper`, with
|
|
355
|
+
`documentPythonExecutable` as `pythonExecutable`.
|
|
356
|
+
|
|
240
357
|
Registration checks that the adapter implements every method its
|
|
241
358
|
capabilities claim, and that the adapter returns the declared capabilities.
|
|
242
|
-
A format package ships code
|
|
243
|
-
as Paper's `docx` skill, is a
|
|
244
|
-
when the runtime is baked.
|
|
359
|
+
A format package ships its code and its profiles (see Skills and profiles).
|
|
360
|
+
A skill that teaches a format library, such as Paper's `docx` skill, is a
|
|
361
|
+
dependency of the Recipe that uses it, installed when the runtime is baked.
|
|
245
362
|
|
|
246
363
|
## Format pages
|
|
247
364
|
|
package/docs/pi-extension.md
CHANGED
|
@@ -44,7 +44,10 @@ The extension no longer maintains a separate installed-Recipe store. Git,
|
|
|
44
44
|
package managers, and ordinary paths own distribution.
|
|
45
45
|
|
|
46
46
|
The selected path and agent are exposed to Recipe-owned tools as
|
|
47
|
-
`PI_RECIPE_DIR` and `PI_AGENT_NAME`.
|
|
47
|
+
`PI_RECIPE_DIR` and `PI_AGENT_NAME`. A launch without `--recipe` or `--agent`
|
|
48
|
+
reads them as its defaults, but an agent name only counts for the Recipe it
|
|
49
|
+
came with: `pi --recipe <another Recipe>` run from a Recipe session's shell
|
|
50
|
+
selects that Recipe's default agent, not the parent's.
|
|
48
51
|
|
|
49
52
|
## GenAI spans
|
|
50
53
|
|
package/docs/recipe-format.md
CHANGED
|
@@ -382,10 +382,105 @@ first model call or reject the Recipe with an actionable diagnostic.
|
|
|
382
382
|
```
|
|
383
383
|
|
|
384
384
|
`python.project` names a Recipe-relative Python project directory and
|
|
385
|
-
`python.lockfile` names its committed `uv.lock
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
dependency graph.
|
|
385
|
+
`python.lockfile` names its committed `uv.lock`, which must be the
|
|
386
|
+
`uv.lock` beside the project's `pyproject.toml`. Hosts MUST install with
|
|
387
|
+
frozen resolution (`uv sync --frozen --no-dev`) and MUST NOT install into
|
|
388
|
+
system Python or resolve an unlocked dependency graph. `version` is passed to
|
|
389
|
+
uv as the interpreter request. `imports` are optional boot preflights, each a
|
|
390
|
+
dotted Python module name (`docx`, `paper_docx.api`); hosts import them with
|
|
391
|
+
`PYTHONHOME` removed.
|
|
392
|
+
|
|
393
|
+
### Package declarations
|
|
394
|
+
|
|
395
|
+
A package the Recipe depends on MAY declare `pi.runtime.python` in its own
|
|
396
|
+
`package.json`, with the same fields relative to the package. Hosts read it
|
|
397
|
+
from each direct `dependencies` or `peerDependencies` entry installed in the
|
|
398
|
+
Recipe's `node_modules`; `devDependencies` and transitive dependencies are
|
|
399
|
+
not read, and a declared dependency that is not installed is skipped. A
|
|
400
|
+
package declaring it MUST ship the project's `pyproject.toml` and `uv.lock`:
|
|
401
|
+
when its `package.json` lists `files`, both must be covered. `pi.runtime.system`
|
|
402
|
+
is a Recipe-only declaration.
|
|
403
|
+
|
|
404
|
+
Each declaration gets its own environment:
|
|
405
|
+
|
|
406
|
+
- **The Recipe's own declaration is the shell environment.** Hosts activate
|
|
407
|
+
it for the agent's shell tools: `VIRTUAL_ENV` and `UV_PROJECT_ENVIRONMENT`
|
|
408
|
+
name it, its `bin` (`Scripts` on Windows) comes first on `PATH`, and
|
|
409
|
+
`PYTHONHOME` is removed.
|
|
410
|
+
- **Each package's declaration gets a separate environment**, installed with
|
|
411
|
+
`--no-editable` and never activated or put on `PATH`. The host hands the
|
|
412
|
+
package its interpreter; a documents format receives it as
|
|
413
|
+
`createAdapter({ env, cwd, python })`.
|
|
414
|
+
|
|
415
|
+
A package extension asks for a package's interpreter with
|
|
416
|
+
`packagePython(name)` on its session context, by the package's name; it is
|
|
417
|
+
`undefined` when that package declares no `pi.runtime.python` or is not a
|
|
418
|
+
direct dependency. `@introspection-ai/recipes/python` runs a script with it:
|
|
419
|
+
`pythonExecutable({ python, env, override })` picks the interpreter
|
|
420
|
+
(`env[override]`, then `python`, then `VIRTUAL_ENV`, then `python3`), and
|
|
421
|
+
`runPythonJson(script, request, { python, env, cwd, signal, timeoutMs })`
|
|
422
|
+
runs `python -I <script>` with the request as JSON on stdin and resolves its
|
|
423
|
+
stdout parsed as JSON (default timeout 300 s, 64 MB output):
|
|
424
|
+
|
|
425
|
+
```ts
|
|
426
|
+
import { getRecipeSessionContext } from "@introspection-ai/recipes/extensions";
|
|
427
|
+
import { pythonExecutable, runPythonJson } from "@introspection-ai/recipes/python";
|
|
428
|
+
|
|
429
|
+
export default function tables(pi) {
|
|
430
|
+
const python = pythonExecutable({
|
|
431
|
+
python: getRecipeSessionContext(pi).packagePython("@acme/recipe-tables"),
|
|
432
|
+
override: "ACME_TABLES_PYTHON",
|
|
433
|
+
});
|
|
434
|
+
// ... later, in a tool:
|
|
435
|
+
// await runPythonJson(helperScript, { path }, { python, cwd: ctx.cwd });
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
No declaration has to agree with another: two packages may lock different
|
|
440
|
+
versions of the same library.
|
|
441
|
+
|
|
442
|
+
### Preparing environments
|
|
443
|
+
|
|
444
|
+
`prepareRecipePython(recipeDir, options)` from
|
|
445
|
+
`@introspection-ai/recipes/recipe` finds every declaration and prepares it:
|
|
446
|
+
|
|
447
|
+
- `mode: "check"` runs `uv sync --frozen --no-dev --check --offline`, then
|
|
448
|
+
`uv python find` with the environment active, and the import preflight. The
|
|
449
|
+
second step catches an environment whose interpreter no longer satisfies the
|
|
450
|
+
declared version or `requires-python`, which uv's check passes. It writes
|
|
451
|
+
nothing and uses no network.
|
|
452
|
+
- `mode: "sync"` checks first and installs only a missing or outdated
|
|
453
|
+
environment, with `uv sync --frozen --no-dev --compile-bytecode`. A current
|
|
454
|
+
environment is never recompiled.
|
|
455
|
+
- uv runs with `--no-python-downloads` unless `allowPythonDownloads` is set.
|
|
456
|
+
|
|
457
|
+
By default environments live in a shared cache,
|
|
458
|
+
`~/.introspection/python/<hash>`, keyed by the environment kind (shell or
|
|
459
|
+
package), platform and architecture, the `uv.lock` and `pyproject.toml`
|
|
460
|
+
contents, and the declared `version`. Without a declared `version` it also
|
|
461
|
+
keys on what uv would pick the interpreter from: `UV_PYTHON`, every
|
|
462
|
+
`.python-version` or `.python-versions` file from the project directory up to
|
|
463
|
+
the filesystem root, and uv's global pin. A Recipe project that is itself a
|
|
464
|
+
package (it has `[build-system]`, so it installs editable) also keys on its
|
|
465
|
+
directory. `environmentRoot` (or `PI_RECIPES_PYTHON_ROOT`) fixes the
|
|
466
|
+
location instead: the shell environment is `<root>/python` and each package's
|
|
467
|
+
`<root>/python-packages/<name>`, so a host baking environments into a Recipe
|
|
468
|
+
image passes `<recipe>/.pi`. Concurrent preparations of one environment are
|
|
469
|
+
serialised by a lock file beside it.
|
|
470
|
+
|
|
471
|
+
Each prepared environment reports its directory and interpreter, plus the
|
|
472
|
+
activation for the shell environment. Failures are named errors:
|
|
473
|
+
`RecipePythonUvMissingError` (uv not installed), `RecipePythonVersionError`
|
|
474
|
+
(no interpreter satisfies the version), `RecipePythonOutdatedError` (check
|
|
475
|
+
mode found an environment missing or not matching its lock) and
|
|
476
|
+
`RecipePythonImportError`.
|
|
477
|
+
|
|
478
|
+
**Hosts fail closed.** Pi's extension prepares in sync mode with interpreter
|
|
479
|
+
downloads allowed when it loads a Recipe, tells the user when a first build
|
|
480
|
+
downloads packages, and refuses to start the session if any environment fails.
|
|
481
|
+
The session API (`createAgentSession`) only checks: it never installs, so the
|
|
482
|
+
host prepares the environments before it creates sessions, and an unprepared
|
|
483
|
+
one fails construction.
|
|
389
484
|
|
|
390
485
|
System package ids name versioned, host-approved bundles. They are not apt,
|
|
391
486
|
brew, or shell commands. A host that does not provide a declared bundle MUST
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documents
|
|
3
|
+
description: How to read Word and PDF files and mark up Word files with the documents tool. Load it before opening, editing, commenting on or responding to any document.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documents
|
|
7
|
+
|
|
8
|
+
The `documents` tool does every change to a document. It finds the text, keeps the
|
|
9
|
+
formatting, signs every change with `author`, and never touches the original.
|
|
10
|
+
|
|
11
|
+
## Choose the command
|
|
12
|
+
|
|
13
|
+
Always `read` first, every part: pass `offset` from the previous part until it ends. Then:
|
|
14
|
+
|
|
15
|
+
| You want to | Use |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Change a few words: a figure, a term, a short phrase | `propose_edits`: `{op: "replace", quote, new, rationale}`; `delete`; or `insert_after` with `new` |
|
|
18
|
+
| Rewrite most of a paragraph, or make several changes in one | `revise`: `{paragraph: "p-012", text: <its full new text>, rationale}` |
|
|
19
|
+
| Remove a whole numbered section and keep the numbering | `remove_section`: `{from, through, keep, rationale}` |
|
|
20
|
+
| Comment without changing text, or reply on a thread | `comment`: `{quote, text}`, or `{thread, text}` |
|
|
21
|
+
| Answer markup already there | `respond`: accept or reject by change number, reply on a thread, or counter with your own change |
|
|
22
|
+
| See a PDF page as an image (a scan, a signature, a chart) | `render`, then open the image it returns |
|
|
23
|
+
|
|
24
|
+
Every change carries its `rationale`, which becomes a margin comment.
|
|
25
|
+
|
|
26
|
+
## Paths
|
|
27
|
+
|
|
28
|
+
The first change takes `path` (the file you were given) and `output` (a new file under
|
|
29
|
+
`outputs/`). Every later change takes `path` set to that output and no `output`. Never
|
|
30
|
+
rebuild a file from scratch.
|
|
31
|
+
|
|
32
|
+
## Quoting
|
|
33
|
+
|
|
34
|
+
Copy quotes from the text after the paragraph id in `read`, within one paragraph, and
|
|
35
|
+
pass that `paragraph` id. Quote only enough to find the place once; `near` or
|
|
36
|
+
`occurrence` picks one match when it repeats. Spacing, curly quotes and dashes are
|
|
37
|
+
forgiven; words and capitalization are not. With `revise` there is nothing to quote:
|
|
38
|
+
copy the paragraph's current text and change only what must change.
|
|
39
|
+
|
|
40
|
+
## When something fails
|
|
41
|
+
|
|
42
|
+
Each item reports `applied` or `FAILED` with a reason; a failed item changed nothing and
|
|
43
|
+
the rest still went in. Resubmit only the failed ones, with `path` set to the saved file:
|
|
44
|
+
|
|
45
|
+
- `not_found`: use the `closest` text it lists, or `read` again; your earlier changes may
|
|
46
|
+
have moved the text. If the paragraph changed a lot, `revise` it by id.
|
|
47
|
+
- `ambiguous`: add `paragraph`, `near` or `occurrence`.
|
|
48
|
+
- `crosses_marker` or `unaddressable`: the change crosses something Word keeps (a tab, a
|
|
49
|
+
field, a content control). Change the words on each side separately, or `revise` the
|
|
50
|
+
paragraph with its full new text.
|
|
51
|
+
- `change_not_found` or `invalid_changes`: take change numbers from a fresh `read`;
|
|
52
|
+
resolving changes renumbers the rest.
|
|
53
|
+
|
|
54
|
+
Never resubmit an applied item: it would apply twice.
|
|
55
|
+
|
|
56
|
+
## Don't drop to a script
|
|
57
|
+
|
|
58
|
+
Don't write Python or shell to change a document, and don't edit its XML: the tool covers
|
|
59
|
+
the changes above, keeps the file valid and records who changed what. If it truly can't do
|
|
60
|
+
something, say so in your reply rather than working around it. Read the result back with
|
|
61
|
+
`read` before you finish.
|
|
62
|
+
|
|
63
|
+
A profile may add hints for one kind of work, as a skill beside this one; follow both.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@introspection-ai/recipes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "The open format for vertical agents, built on Pi.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
+
"documents",
|
|
12
13
|
"docs",
|
|
13
14
|
"README.md",
|
|
14
15
|
"package.json"
|
|
@@ -66,6 +67,10 @@
|
|
|
66
67
|
"types": "./dist/channels/index.d.ts",
|
|
67
68
|
"import": "./dist/channels/index.js"
|
|
68
69
|
},
|
|
70
|
+
"./python": {
|
|
71
|
+
"types": "./dist/python.d.ts",
|
|
72
|
+
"import": "./dist/python.js"
|
|
73
|
+
},
|
|
69
74
|
"./documents": {
|
|
70
75
|
"types": "./dist/documents/index.d.ts",
|
|
71
76
|
"import": "./dist/documents/index.js"
|
|
@@ -85,10 +90,11 @@
|
|
|
85
90
|
]
|
|
86
91
|
},
|
|
87
92
|
"dependencies": {
|
|
88
|
-
"@introspection-sdk/introspection-pi": "^0.
|
|
93
|
+
"@introspection-sdk/introspection-pi": "^0.43.0",
|
|
89
94
|
"@opentelemetry/api": "^1.9.1",
|
|
90
95
|
"ajv": "^8.20.0",
|
|
91
96
|
"mcporter": "0.16.1",
|
|
97
|
+
"minimatch": "^10.2.6",
|
|
92
98
|
"yaml": "^2.9.0"
|
|
93
99
|
},
|
|
94
100
|
"peerDependencies": {
|
|
@@ -99,10 +105,10 @@
|
|
|
99
105
|
"typebox": "*"
|
|
100
106
|
},
|
|
101
107
|
"devDependencies": {
|
|
102
|
-
"@earendil-works/pi-agent-core": "1.
|
|
103
|
-
"@earendil-works/pi-ai": "1.
|
|
104
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
105
|
-
"@earendil-works/pi-tui": "1.
|
|
108
|
+
"@earendil-works/pi-agent-core": "1.4.0",
|
|
109
|
+
"@earendil-works/pi-ai": "1.4.0",
|
|
110
|
+
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
111
|
+
"@earendil-works/pi-tui": "1.4.0",
|
|
106
112
|
"@types/node": "^26.1.2",
|
|
107
113
|
"esbuild": "^0.28.1",
|
|
108
114
|
"typebox": "^1.0.56",
|
|
@@ -110,10 +116,10 @@
|
|
|
110
116
|
"vitest": "^5.0.1"
|
|
111
117
|
},
|
|
112
118
|
"optionalDependencies": {
|
|
113
|
-
"@introspection-ai/mcp-client-linux-x64": "0.
|
|
114
|
-
"@introspection-ai/mcp-client-linux-arm64": "0.
|
|
115
|
-
"@introspection-ai/mcp-client-darwin-arm64": "0.
|
|
116
|
-
"@introspection-ai/mcp-client-darwin-x64": "0.
|
|
119
|
+
"@introspection-ai/mcp-client-linux-x64": "0.39.0",
|
|
120
|
+
"@introspection-ai/mcp-client-linux-arm64": "0.39.0",
|
|
121
|
+
"@introspection-ai/mcp-client-darwin-arm64": "0.39.0",
|
|
122
|
+
"@introspection-ai/mcp-client-darwin-x64": "0.39.0"
|
|
117
123
|
},
|
|
118
124
|
"scripts": {
|
|
119
125
|
"build": "pnpm build:ts && pnpm build:native",
|