@introspection-ai/recipes 0.53.0 → 0.55.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/connector-tools.d.ts +1 -1
- package/dist/connector-tools.d.ts.map +1 -1
- package/dist/connector-tools.js +16 -0
- package/dist/connector-tools.js.map +1 -1
- package/dist/documents/arguments.d.ts +17 -0
- package/dist/documents/arguments.d.ts.map +1 -1
- package/dist/documents/arguments.generated.d.ts +2 -1
- package/dist/documents/arguments.generated.d.ts.map +1 -1
- package/dist/documents/arguments.generated.js +22 -0
- package/dist/documents/arguments.generated.js.map +1 -1
- package/dist/documents/index.d.ts +1 -1
- package/dist/documents/index.d.ts.map +1 -1
- package/dist/documents/module.d.ts.map +1 -1
- package/dist/documents/module.js +2 -0
- package/dist/documents/module.js.map +1 -1
- package/dist/documents/tools.d.ts +1 -1
- package/dist/documents/tools.d.ts.map +1 -1
- package/dist/documents/tools.js +71 -6
- package/dist/documents/tools.js.map +1 -1
- package/dist/documents/types.d.ts +96 -0
- package/dist/documents/types.d.ts.map +1 -1
- package/dist/interactions.d.ts +6 -0
- package/dist/interactions.d.ts.map +1 -1
- package/dist/interactions.js +9 -0
- package/dist/interactions.js.map +1 -1
- package/dist/introspection-open.d.ts +2 -2
- package/dist/introspection-open.d.ts.map +1 -1
- package/dist/introspection-open.js +27 -9
- package/dist/introspection-open.js.map +1 -1
- package/dist/issues/index.d.ts +1 -1
- package/dist/issues/index.d.ts.map +1 -1
- package/dist/issues/index.js +1 -1
- package/dist/issues/index.js.map +1 -1
- package/dist/issues/module.d.ts +3 -0
- package/dist/issues/module.d.ts.map +1 -1
- package/dist/issues/module.js +4 -0
- package/dist/issues/module.js.map +1 -1
- package/dist/mcp/cli/command-context.d.ts +13 -0
- package/dist/mcp/cli/command-context.d.ts.map +1 -1
- package/dist/mcp/cli/command-context.js +56 -16
- package/dist/mcp/cli/command-context.js.map +1 -1
- package/dist/mcp/cli/core.d.ts +1 -1
- package/dist/mcp/cli/core.d.ts.map +1 -1
- package/dist/mcp/cli/core.js +25 -16
- package/dist/mcp/cli/core.js.map +1 -1
- package/dist/mcp/client-entry.js +1 -1
- package/dist/mcp/client-entry.js.map +1 -1
- package/dist/mcp/daemon/client.d.ts +10 -1
- package/dist/mcp/daemon/client.d.ts.map +1 -1
- package/dist/mcp/daemon/client.js +41 -17
- package/dist/mcp/daemon/client.js.map +1 -1
- package/dist/mcp/daemon/hosted.d.ts +22 -0
- package/dist/mcp/daemon/hosted.d.ts.map +1 -0
- package/dist/mcp/daemon/hosted.js +98 -0
- package/dist/mcp/daemon/hosted.js.map +1 -0
- package/dist/mcp/daemon/index.js +18 -423
- package/dist/mcp/daemon/index.js.map +1 -1
- package/dist/mcp/daemon/protocol.d.ts +4 -0
- package/dist/mcp/daemon/protocol.d.ts.map +1 -1
- package/dist/mcp/daemon/protocol.js +10 -0
- package/dist/mcp/daemon/protocol.js.map +1 -1
- package/dist/mcp/daemon/server.d.ts +41 -0
- package/dist/mcp/daemon/server.d.ts.map +1 -0
- package/dist/mcp/daemon/server.js +547 -0
- package/dist/mcp/daemon/server.js.map +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +5 -3
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/pi-runtime.d.ts +4 -2
- package/dist/mcp/pi-runtime.d.ts.map +1 -1
- package/dist/mcp/pi-runtime.js +12 -6
- package/dist/mcp/pi-runtime.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +16 -5
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp-chunks/{chunk-QUDOU7MQ.js → chunk-757ZF552.js} +1 -1
- package/dist/mcp-chunks/chunk-AJDK5Z7O.js +546 -0
- package/dist/mcp-chunks/{chunk-T5BPTC3T.js → chunk-KZGUH7E2.js} +90 -45
- package/dist/mcp-chunks/{chunk-IMG2JMBS.js → chunk-MYAMG6VL.js} +1 -1
- package/dist/mcp-chunks/{chunk-LQKMNWDE.js → chunk-OIK5AH2S.js} +5 -5
- package/dist/mcp-chunks/{chunk-3UVHZECT.js → chunk-OWGTNJNR.js} +9 -7
- package/dist/mcp-chunks/chunk-TUPFPO4L.js +400 -0
- package/dist/mcp-chunks/{cli-BM23ZXPJ.js → cli-UQ5QXFXU.js} +31 -31
- package/dist/mcp-chunks/{client-RKTAKDAY.js → client-SBELHRAE.js} +3 -3
- package/dist/mcp-chunks/{daemon-command-VU6WTFCJ.js → daemon-command-MQS6AP2W.js} +5 -5
- package/dist/mcp-chunks/dist-SDPPH7XQ.js +65 -0
- package/dist/mcp-chunks/{generate-cli-runner-JAAPSWGX.js → generate-cli-runner-LQBBQ7F5.js} +3 -3
- package/dist/mcp-chunks/{generated-daemon-runtime-LX4L2X7Z.js → generated-daemon-runtime-TUCZ3JEP.js} +4 -4
- package/dist/mcp-chunks/{pi-mcp-runtime-GHDEPXUL.js → pi-mcp-runtime-OLO25D7A.js} +1 -29
- package/dist/mcp-chunks/{runtime-T63YI7TC.js → runtime-5SOGEUTQ.js} +2 -2
- package/dist/mcp-chunks/{serve-command-75P4VBJ6.js → serve-command-YKSIXG7K.js} +3 -3
- package/dist/mcp-chunks/server-HQBFWAJR.js +41 -0
- package/dist/mcp-daemon.js +29 -432
- package/dist/mcp-run-worker.js +9 -8
- package/dist/open.d.ts +9 -2
- package/dist/open.d.ts.map +1 -1
- package/dist/open.js +31 -3
- package/dist/open.js.map +1 -1
- package/dist/pi-extension.d.ts.map +1 -1
- package/dist/pi-extension.js +1 -1
- package/dist/pi-extension.js.map +1 -1
- package/dist/recipe/companions.d.ts +6 -0
- package/dist/recipe/companions.d.ts.map +1 -1
- package/dist/recipe/companions.js +22 -4
- package/dist/recipe/companions.js.map +1 -1
- package/dist/recipe/manifest.generated.d.ts +2 -1
- package/dist/recipe/manifest.generated.d.ts.map +1 -1
- package/dist/recipe/manifest.generated.js +3 -2
- package/dist/recipe/manifest.generated.js.map +1 -1
- package/dist/recipe/package.d.ts +12 -0
- package/dist/recipe/package.d.ts.map +1 -1
- package/dist/recipe/package.js +32 -0
- package/dist/recipe/package.js.map +1 -1
- package/dist/recipe/suggestions.d.ts +15 -7
- package/dist/recipe/suggestions.d.ts.map +1 -1
- package/dist/recipe/suggestions.js +33 -11
- package/dist/recipe/suggestions.js.map +1 -1
- package/dist/signature/arguments.d.ts +78 -0
- package/dist/signature/arguments.d.ts.map +1 -0
- package/dist/signature/arguments.generated.d.ts +9 -0
- package/dist/signature/arguments.generated.d.ts.map +1 -0
- package/dist/signature/arguments.generated.js +129 -0
- package/dist/signature/arguments.generated.js.map +1 -0
- package/dist/signature/arguments.js +8 -0
- package/dist/signature/arguments.js.map +1 -0
- package/dist/signature/docx.d.ts +41 -0
- package/dist/signature/docx.d.ts.map +1 -0
- package/dist/signature/docx.js +449 -0
- package/dist/signature/docx.js.map +1 -0
- package/dist/signature/index.d.ts +9 -0
- package/dist/signature/index.d.ts.map +1 -0
- package/dist/signature/index.js +5 -0
- package/dist/signature/index.js.map +1 -0
- package/dist/signature/module.d.ts +39 -0
- package/dist/signature/module.d.ts.map +1 -0
- package/dist/signature/module.js +111 -0
- package/dist/signature/module.js.map +1 -0
- package/dist/signature/tool.d.ts +137 -0
- package/dist/signature/tool.d.ts.map +1 -0
- package/dist/signature/tool.js +677 -0
- package/dist/signature/tool.js.map +1 -0
- package/dist/signature/types.d.ts +259 -0
- package/dist/signature/types.d.ts.map +1 -0
- package/dist/signature/types.js +69 -0
- package/dist/signature/types.js.map +1 -0
- package/dist/suggestion-picker.d.ts +2 -2
- package/dist/suggestion-picker.d.ts.map +1 -1
- package/dist/suggestion-picker.js +3 -3
- package/dist/suggestion-picker.js.map +1 -1
- package/docs/README.md +2 -1
- package/docs/documents/README.md +152 -6
- package/docs/interactions.md +20 -15
- package/docs/issues/README.md +6 -1
- package/docs/mcp-configuration.md +11 -3
- package/docs/providers.md +3 -1
- package/docs/recipe-format.md +30 -13
- package/docs/signature/README.md +311 -0
- package/docs/signature/docusign.md +139 -0
- package/docs/signature/dropbox-sign.md +76 -0
- package/docs/signature/pandadoc.md +76 -0
- package/package.json +10 -5
- package/skills/documents/SKILL.md +17 -1
- package/skills/issues/SKILL.md +108 -0
- package/skills/signature/SKILL.md +97 -0
- package/dist/mcp-chunks/{auth-command-UYFOGGQR.js → auth-command-PZLSOYAT.js} +6 -6
- package/dist/mcp-chunks/{call-command-6U5BNDR7.js → call-command-VILJIFYG.js} +6 -6
- package/dist/mcp-chunks/{chunk-36D4FILJ.js → chunk-ORJND4AI.js} +3 -3
- package/dist/mcp-chunks/{resource-command-DUY4SVE5.js → resource-command-SRFQQROJ.js} +4 -4
package/docs/documents/README.md
CHANGED
|
@@ -16,7 +16,8 @@ Two properties follow, as for [channels](../channels/README.md):
|
|
|
16
16
|
- **The original is never changed.** Every write takes the document to read
|
|
17
17
|
(`path`) and a new file under `outputs/` to save (`output`). Later calls
|
|
18
18
|
edit that saved file in place by passing it as `path`. The tool refuses to
|
|
19
|
-
write outside `outputs/` or over a file it did not save.
|
|
19
|
+
write outside `outputs/` or over a file it did not save. `convert` follows
|
|
20
|
+
the same rule: it reads one file and saves a new one in another format.
|
|
20
21
|
|
|
21
22
|
Agents select `tools: [documents]`.
|
|
22
23
|
|
|
@@ -207,6 +208,7 @@ doesn't ship fails when the Recipe loads, with the names it does ship.
|
|
|
207
208
|
| `respond` | `path`, `output?`, `author`, `responses[]` | `respond` | not registered |
|
|
208
209
|
| `remove_section` | `path`, `output?`, `author`, `from`, `through`, `keep?`, `rationale` | `removeSection` | not registered |
|
|
209
210
|
| `render` | `path`, `pages?` | `render` | With a browser, the full page light and dark and each chart as its own element screenshot, at 2x; without one, each inline `<svg>` chart through resvg, naming what it could not draw. `pages` picks charts. |
|
|
211
|
+
| `convert` | `path`, `output`, `pages?` | `export` on the format of `path`, `create` on the format of `output` | A new file in the output's format, rebuilt from the source's headings, paragraphs and tables. See [PDF to Word](#pdf-to-word-convert). |
|
|
210
212
|
|
|
211
213
|
An edit is `{ op: "replace" | "delete" | "insert_after", quote, paragraph?,
|
|
212
214
|
near?, occurrence?, new?, rationale }`. A response is `{ action: "accept" |
|
|
@@ -228,6 +230,7 @@ candidate paragraphs. It never returns the whole document; `read` does that.
|
|
|
228
230
|
| `respond` | Accept or reject by change number (tracked moves resolve as a pair), reply, or counter | not registered | not registered |
|
|
229
231
|
| `remove_section` | Strikes the paragraphs, leaves `Reserved.` after `keep`, keeps numbering | not registered | not registered |
|
|
230
232
|
| `render` | not registered | PNG files of pages, at most 10 per call; returns their paths for Pi's `read` tool | With a browser, the full page light and dark and each chart as its own element screenshot, at 2x; without one, each inline `<svg>` chart through resvg, naming what it could not draw. `pages` picks charts. |
|
|
233
|
+
| `convert` | `create`: a new `.docx` from an outline, with Heading 1–3, Normal paragraphs and Table Grid tables | `export`: the outline of the pages' text, as headings, paragraphs and, with the `tables` extra, tables | not registered |
|
|
231
234
|
|
|
232
235
|
### docx: revise or propose_edits
|
|
233
236
|
|
|
@@ -241,10 +244,11 @@ sits inside someone else's change. A revision whose text is unchanged becomes a
|
|
|
241
244
|
comment on that paragraph, and a revision without a rationale fails alone rather
|
|
242
245
|
than failing the batch's schema check.
|
|
243
246
|
|
|
244
|
-
`compare` is used only when its result keeps the body's block structure
|
|
245
|
-
paper-docx 0.2.0 inserts empty paragraphs for some
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
`compare` is used only when its result keeps the body's block structure and
|
|
248
|
+
each table's rows and cells: paper-docx 0.2.0 inserts empty paragraphs for some
|
|
249
|
+
multi-paragraph batches, and rebuilds a table whose cells it changes by deleting
|
|
250
|
+
and re-inserting whole rows, the other party's cells included. Either would move
|
|
251
|
+
paragraph ids, so such a result is discarded for the tracked path.
|
|
248
252
|
|
|
249
253
|
### docx: anchors
|
|
250
254
|
|
|
@@ -306,7 +310,8 @@ Every PDF `read` starts with `Path:` and the route it took:
|
|
|
306
310
|
directory, or under `pagesDir` when the host passes one to
|
|
307
311
|
`registerDocumentTools`.
|
|
308
312
|
|
|
309
|
-
PDFs are never changed: every write command is absent for `.pdf`.
|
|
313
|
+
PDFs are never changed: every write command is absent for `.pdf`. To redline
|
|
314
|
+
one, `convert` it to Word (below).
|
|
310
315
|
|
|
311
316
|
#### The `tables` extra
|
|
312
317
|
|
|
@@ -324,10 +329,104 @@ then `uv lock`. The helper imports pdfplumber only when a read asks for tables,
|
|
|
324
329
|
and nothing is fetched at run time. A profile for contract or pricing work may
|
|
325
330
|
recommend the extra; a Recipe that only reads briefs can leave it out.
|
|
326
331
|
|
|
332
|
+
### PDF to Word: `convert`
|
|
333
|
+
|
|
334
|
+
A PDF can't hold tracked changes, so to redline one the agent converts it to
|
|
335
|
+
Word and marks up the Word file like any other:
|
|
336
|
+
|
|
337
|
+
```text
|
|
338
|
+
documents convert { path: "msa.pdf", output: "outputs/msa.docx" }
|
|
339
|
+
documents read { path: "outputs/msa.docx" }
|
|
340
|
+
documents revise { path: "outputs/msa.docx", author, revisions }
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
The converted file is one this tool saved, so later commands edit it in place
|
|
344
|
+
with no `output`, and its tracked changes are the only markup in it.
|
|
345
|
+
|
|
346
|
+
`convert` rebuilds the document's structure, then sets it as the source set
|
|
347
|
+
it. Headings, paragraphs and tables come over as Word headings, paragraphs and
|
|
348
|
+
tables, which is what paragraph ids, quotes and tracked changes need. They
|
|
349
|
+
come over with:
|
|
350
|
+
|
|
351
|
+
- **the formatting of their text:** the body font as the Normal style, and runs
|
|
352
|
+
for what differs (bold, italic, underline, family, size, colour), so a bold
|
|
353
|
+
run-in clause heading stays bold inside its paragraph;
|
|
354
|
+
- **the layout of the page:** page size and margins, line pitch, space before
|
|
355
|
+
each paragraph, centring, and left, hanging and first-line indents, with a
|
|
356
|
+
tab after a clause number or bullet set off by more than a space;
|
|
357
|
+
- **the running header and footer,** as Word's own, with the page number and
|
|
358
|
+
count as fields;
|
|
359
|
+
- **tables as drawn:** ruled or not, their text size, and a bold header row.
|
|
360
|
+
- **filled form fields:** a completed form's values live in its fields, not its
|
|
361
|
+
text, so they are set into the page where the PDF shows them, in the body
|
|
362
|
+
font, and the result counts them so the agent checks each one.
|
|
363
|
+
|
|
364
|
+
The right margin is the one the source wrapped at: past its longest line,
|
|
365
|
+
and short of every word it pushed to the next line. Printed back to PDF, the
|
|
366
|
+
Word file broke 91% of its lines where the original did on a two-page
|
|
367
|
+
statement of work, on the same number of pages, and 90% on a twelve-page one,
|
|
368
|
+
whose text it kept to 98%.
|
|
369
|
+
|
|
370
|
+
Images, columns and drawn lines that underline nothing do not come over, and
|
|
371
|
+
page breaks fall where Word puts them. A converter that reproduces the page,
|
|
372
|
+
such as LibreOffice's PDF import or pdf2docx, places text in positioned boxes
|
|
373
|
+
and line by line. The file looks right but redlines badly, because a sentence
|
|
374
|
+
split across boxes can't be quoted or revised as one paragraph.
|
|
375
|
+
|
|
376
|
+
The work runs in two halves, each in its own format's Python environment, so
|
|
377
|
+
neither environment gains a library and the runtime image needs nothing new:
|
|
378
|
+
|
|
379
|
+
- **The PDF adapter exports an outline.** It reads pypdfium2's characters with
|
|
380
|
+
their positions, fonts, sizes (after the page's scale) and colours, and
|
|
381
|
+
underlines from the thin paths beneath them, and joins them into
|
|
382
|
+
paragraphs. It starts a
|
|
383
|
+
new paragraph at a wider vertical gap, at a change of indent, at a line
|
|
384
|
+
that opens with a clause number such as `1.2`, `(a)` or `(iv)`, or after a
|
|
385
|
+
line the next line's first word would have fit on. A paragraph
|
|
386
|
+
that runs across a page break is joined back, and a word hyphenated at a line
|
|
387
|
+
end is rejoined. Lines repeated at the top or bottom of the pages (running
|
|
388
|
+
headers, footers and page numbers) are dropped. Lines set larger than the
|
|
389
|
+
body text, or bold lines on their own, become headings, the largest (and
|
|
390
|
+
centred before left) at level 1. Columns that line up across two or more
|
|
391
|
+
lines, such as a signature block, become a table. With the `tables`
|
|
392
|
+
extra, pdfplumber's tables become table blocks and their text is left out of
|
|
393
|
+
the paragraphs. Without it, a table's text comes over as paragraphs and the
|
|
394
|
+
result says the extra was missing.
|
|
395
|
+
- **The Word adapter creates the file.** It builds the `.docx` from the
|
|
396
|
+
outline with paper-docx, sets the page, fonts and spacing above, and records
|
|
397
|
+
the source's file name in the file's core properties.
|
|
398
|
+
|
|
399
|
+
The host runs the export, passes the outline to the creating format and
|
|
400
|
+
writes only `output`. That must be a new file under `outputs/`, with the
|
|
401
|
+
extension of a format that creates. The source is never changed.
|
|
402
|
+
|
|
403
|
+
Clause numbers stay as the text the PDF shows, not Word list numbering, so
|
|
404
|
+
they never renumber under an edit.
|
|
405
|
+
|
|
406
|
+
`convert` fails, and writes nothing, when:
|
|
407
|
+
|
|
408
|
+
- **A page in range has no text layer (a scan).** The error names the pages.
|
|
409
|
+
A contract with a page silently missing is worse than none: the agent
|
|
410
|
+
renders those pages and tells the person the PDF needs a text layer (OCR)
|
|
411
|
+
first. OCR is not part of the tool.
|
|
412
|
+
- **The PDF is password-protected,** with the same message as `read`.
|
|
413
|
+
- **The output's format doesn't create files,** or the source's format doesn't
|
|
414
|
+
export. The error names the formats that do.
|
|
415
|
+
|
|
416
|
+
The result reports the pages converted and the counts of headings, paragraphs
|
|
417
|
+
and tables. It also reports how many repeated lines were dropped and whether
|
|
418
|
+
tables were detected, and reminds the agent that the layout was rebuilt.
|
|
419
|
+
|
|
420
|
+
In a `commands` allowlist, `convert` on the PDF declaration allows exporting
|
|
421
|
+
and on the Word declaration allows creating. The command is registered when
|
|
422
|
+
some declared format exports and some creates, and a call needs both of its
|
|
423
|
+
ends allowed.
|
|
424
|
+
|
|
327
425
|
## Limits
|
|
328
426
|
|
|
329
427
|
- `read` returns about 50,000 characters per part; pass the `offset` it gives.
|
|
330
428
|
- A batch takes at most 60 edits or responses.
|
|
429
|
+
- `convert` takes the whole PDF unless `pages` narrows it.
|
|
331
430
|
- Paragraph ids are body-block positions. Edits never add or remove blocks, so
|
|
332
431
|
ids hold for a whole redline; a document edited elsewhere gets new ids.
|
|
333
432
|
- Change numbers for `respond` are positions in the file as read: read again
|
|
@@ -391,6 +490,46 @@ const pdf: RecipeDocumentFormatModule = {
|
|
|
391
490
|
export default pdf;
|
|
392
491
|
```
|
|
393
492
|
|
|
493
|
+
Two optional capabilities connect formats for `convert`. `export` means the
|
|
494
|
+
adapter returns a document's content as a `DocumentOutline`, and `create`
|
|
495
|
+
means it builds a new file from one:
|
|
496
|
+
|
|
497
|
+
```ts
|
|
498
|
+
interface DocumentOutline {
|
|
499
|
+
/** The source's file name, recorded in the new file. */
|
|
500
|
+
source: string;
|
|
501
|
+
font?: { family: string; size: number };
|
|
502
|
+
page?: { width: number; height: number; margins: { top: number; bottom: number; left: number; right: number } };
|
|
503
|
+
line_pitch?: number;
|
|
504
|
+
header?: DocumentRunningLine[]; // `{PAGE}` and `{NUMPAGES}` stand for fields
|
|
505
|
+
footer?: DocumentRunningLine[];
|
|
506
|
+
blocks: DocumentBlock[];
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
type DocumentBlock =
|
|
510
|
+
| { type: "heading"; level: 1 | 2 | 3; text: string; page: number; runs?: DocumentRun[]; /* layout */ }
|
|
511
|
+
| { type: "paragraph"; text: string; page: number; runs?: DocumentRun[]; /* layout */ }
|
|
512
|
+
| { type: "table"; rows: string[][]; page: number; ruled?: boolean; size?: number; header?: boolean };
|
|
513
|
+
|
|
514
|
+
// layout: align?: "center", indent?, first_line?, space_before? (points)
|
|
515
|
+
// DocumentRun: { text, bold?, italic?, underline?, family?, size?, color? }, naming only what differs from `font`
|
|
516
|
+
|
|
517
|
+
interface DocumentAdapter {
|
|
518
|
+
// ...
|
|
519
|
+
export?(ctx: DocumentAdapterContext, input: DocumentExportInput): Promise<DocumentExport>;
|
|
520
|
+
create?(ctx: DocumentAdapterContext, input: DocumentCreateInput): Promise<DocumentResult>;
|
|
521
|
+
}
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
`text` always holds a block's whole text, so a creating format that ignores
|
|
525
|
+
formatting still builds a correct file. `DocumentExport` is a `DocumentResult`
|
|
526
|
+
with the `outline` beside its `text`.
|
|
527
|
+
A Python helper answers with an `outline` key beside `text` and `details`. The
|
|
528
|
+
host keeps the outline out of what the model sees and passes the export's
|
|
529
|
+
`text` (its notes, such as a missing extra) through with the create's result.
|
|
530
|
+
Both capabilities are additive, so the contract stays at `apiVersion` 1. A
|
|
531
|
+
host that predates them loads such a format without `convert`.
|
|
532
|
+
|
|
394
533
|
`apiVersion` names the contract the format was written against; the host
|
|
395
534
|
refuses a different one, naming the package, both versions and the fix.
|
|
396
535
|
`createDocumentFormatModule` from `@introspection-ai/recipes/documents` builds
|
|
@@ -420,6 +559,13 @@ a pinned one.
|
|
|
420
559
|
A skill that teaches a format library, such as Paper's `docx` skill, is a
|
|
421
560
|
dependency of the Recipe that uses it, installed when the runtime is baked.
|
|
422
561
|
|
|
562
|
+
## After review: sending for signature
|
|
563
|
+
|
|
564
|
+
The document tools never send a file anywhere. Once a person has reviewed the
|
|
565
|
+
redline and every change is resolved, the [signature tool](../signature/README.md)
|
|
566
|
+
sends the final `.docx` under `outputs/` for e-signature, and refuses one that
|
|
567
|
+
still has tracked changes or comments.
|
|
568
|
+
|
|
423
569
|
## Format pages
|
|
424
570
|
|
|
425
571
|
- Word: this page; `packages/documents/docx/README.md`.
|
package/docs/interactions.md
CHANGED
|
@@ -96,6 +96,7 @@ introspection_open({
|
|
|
96
96
|
| { kind: "binding"; runtime: string; name: string; environment?: string }
|
|
97
97
|
| { kind: "runtime"; runtime: string }
|
|
98
98
|
| { kind: "task"; task: string }
|
|
99
|
+
| { kind: "issue"; issue: string } // introspection:I-7 as the issues tool returned it, or the issue's id
|
|
99
100
|
| { kind: "repository"; provider: "github"; name: string; template?: string },
|
|
100
101
|
reason: string, // one line the card shows
|
|
101
102
|
wait?: boolean, // default false
|
|
@@ -109,29 +110,33 @@ label, e.g. `Install GitHub`). A host with no renderer for this kind still
|
|
|
109
110
|
shows a plain question, which stays usable. The answers use the existing
|
|
110
111
|
envelopes:
|
|
111
112
|
|
|
112
|
-
| Outcome
|
|
113
|
-
|
|
|
114
|
-
| Connected
|
|
115
|
-
| Came back from a `runtime` or `
|
|
116
|
-
| The provider failed
|
|
117
|
-
| Not now
|
|
118
|
-
| Reply in chat
|
|
113
|
+
| Outcome | Resume | The model sees |
|
|
114
|
+
| -------------------------------------------------- | ---------------------------------------------------------------- | ------------------------- |
|
|
115
|
+
| Connected | `{ status: "resolved", payload: { answer: "connected" } }` | `Answer: connected` |
|
|
116
|
+
| Came back from a `runtime`, `task` or `issue` page | `{ status: "resolved", payload: { answer: "returned" } }` | `Answer: returned` |
|
|
117
|
+
| The provider failed | `{ status: "resolved", payload: { answer: "failed: <error>" } }` | `Answer: failed: <error>` |
|
|
118
|
+
| Not now | `{ status: "cancelled" }` | the declined envelope |
|
|
119
|
+
| Reply in chat | `{ status: "cancelled", payload: { dismissed: true } }` | the dismissed text |
|
|
119
120
|
|
|
120
121
|
The answer is what the person did, not proof: the agent reads the real state
|
|
121
122
|
before it says something is connected.
|
|
122
123
|
|
|
123
|
-
| Host | With `wait: true`
|
|
124
|
-
| ------------------------- |
|
|
125
|
-
| Pi terminal (TUI) and RPC | Runs the Introspection CLI (`INTROSPECTION_CLI`, else `introspection` on `PATH`) until it returns: `connectors authorize <provider> --subject user` for a `connection`, `open --integrations <provider> --wait` for an `integration`, `open --runtime <runtime> --wait` for a `binding`, `open --repository --name <name> [--template <owner/repo>] --wait` for a `repository`. A `runtime` or `
|
|
126
|
-
| Pause/resume host | The interrupt above; the host renders it and resumes with the answer; for a `runtime` or `
|
|
127
|
-
| Headless and child agents | Declined.
|
|
128
|
-
| No channel | The unavailable envelope.
|
|
124
|
+
| Host | With `wait: true` |
|
|
125
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
126
|
+
| Pi terminal (TUI) and RPC | Runs the Introspection CLI (`INTROSPECTION_CLI`, else `introspection` on `PATH`) until it returns: `connectors authorize <provider> --subject user` for a `connection`, `open --integrations <provider> --wait` for an `integration`, `open --runtime <runtime> --wait` for a `binding`, `open --repository --name <name> [--template <owner/repo>] --wait` for a `repository`. A `runtime`, `task` or `issue` page has nothing to finish, so, like the hosted card, it runs `open --runtime <runtime>`, `open --task <task>` or `open --issue <issue>` without `--wait` and answers `returned` once the page opens. Exit 0 answers `connected` (`returned` for a page); another exit answers `failed:` with the CLI's last error line. A `connector` or `sso` target, or a missing CLI, shows a Done / Not now dialog instead. The wait lasts up to an hour. |
|
|
127
|
+
| Pause/resume host | The interrupt above; the host renders it and resumes with the answer; for a `runtime`, `task` or `issue` page, opening it is the answer (`returned`). |
|
|
128
|
+
| Headless and child agents | Declined. |
|
|
129
|
+
| No channel | The unavailable envelope. |
|
|
129
130
|
|
|
130
|
-
Without `wait`, nothing pauses: Pi's terminal opens a `runtime`, `task
|
|
131
|
-
`binding` page, or starts an `integration` install, through the CLI, and the
|
|
131
|
+
Without `wait`, nothing pauses: Pi's terminal opens a `runtime`, `task`,
|
|
132
|
+
`issue` or `binding` page, or starts an `integration` install, through the CLI, and the
|
|
132
133
|
result says the person has not acted yet; elsewhere the result tells the model
|
|
133
134
|
to ask in its reply.
|
|
134
135
|
|
|
136
|
+
An `issue` target names an Introspection issue only. A handle from another
|
|
137
|
+
tracker (`linear:ENG-123`) fails, telling the agent to share that tracker's
|
|
138
|
+
own link instead.
|
|
139
|
+
|
|
135
140
|
The target helpers (`parseIntrospectionOpenTarget`,
|
|
136
141
|
`introspectionOpenTargetOf`, `introspectionOpenAction`,
|
|
137
142
|
`INTROSPECTION_OPEN_ANSWER`) are exported from
|
package/docs/issues/README.md
CHANGED
|
@@ -42,6 +42,11 @@ mcp:
|
|
|
42
42
|
Nothing about issues loads, and no `issues` tool is offered, unless a Recipe
|
|
43
43
|
declares `pi.issues` and its agent selects `issues`.
|
|
44
44
|
|
|
45
|
+
When it does, the host also offers the `issues` skill
|
|
46
|
+
(`skills/issues/SKILL.md`), as it offers `skills/productivity/SKILL.md` with
|
|
47
|
+
`mail`: handles, statuses and priorities, and a workflow for tracking the
|
|
48
|
+
agent's own work.
|
|
49
|
+
|
|
45
50
|
A declaration takes only these fields:
|
|
46
51
|
|
|
47
52
|
| Field | Applies to | Meaning |
|
|
@@ -115,7 +120,7 @@ Every issue comes back in one shape, with a handle every later command takes:
|
|
|
115
120
|
|
|
116
121
|
| Field | Linear | Jira | Introspection |
|
|
117
122
|
| ------------------------ | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
118
|
-
| `handle` | `linear:ENG-123` | `jira:PROJ-45` | `introspection
|
|
123
|
+
| `handle` | `linear:ENG-123` | `jira:PROJ-45` | `introspection:I-7`, the project's issue key |
|
|
119
124
|
| `title` | title | summary | title |
|
|
120
125
|
| `description` (markdown) | description | description, from Atlassian Document Format (best-effort) | description |
|
|
121
126
|
| `status.name` | workflow state | status | status |
|
|
@@ -110,8 +110,7 @@ neither field can authorize a tool excluded by `include`/`exclude`.
|
|
|
110
110
|
Deferred tools remain authorized and discoverable. Recipes registers them with
|
|
111
111
|
Pi's `deferred` exposure and, when at least one connector or MCP tool is
|
|
112
112
|
deferred, activates Pi's `tool_search`. Calling it ranks the deferred tools by
|
|
113
|
-
the words in their names, descriptions and input schemas (BM25, default limit
|
|
114
|
-
8) and declares the best matches for the next model request. Pi records the
|
|
113
|
+
the words in their names, descriptions and input schemas (BM25, default limit 8) and declares the best matches for the next model request. Pi records the
|
|
115
114
|
change in the session, so loaded tools survive resume. It never grants access
|
|
116
115
|
beyond the Recipe manifest and agent policy. Recipes also registers `mcp_search` as a
|
|
117
116
|
compatibility alias when MCP tools are deferred.
|
|
@@ -321,10 +320,19 @@ cancels a call on the server when the command is interrupted. See [MCP authentic
|
|
|
321
320
|
hosted binding details, and [Recipes extension](pi-extension.md) for the
|
|
322
321
|
full session contract.
|
|
323
322
|
|
|
323
|
+
On pi-mcp, the Pi process serves the command's socket for the life of the
|
|
324
|
+
session, in a directory only its user can enter, and closes it when the
|
|
325
|
+
session ends. It runs up to 32 commands and calls at once and queues the rest.
|
|
326
|
+
A shell with no session listening, such as a process that outlives its
|
|
327
|
+
session, starts the same server as a standalone daemon, and a session on
|
|
328
|
+
mcporter always uses the standalone daemon.
|
|
329
|
+
|
|
324
330
|
In tools mode, each Pi session—including each delegated child session—gets its
|
|
325
331
|
own registered tool catalog and active set. The MCP daemon and mcporter config
|
|
326
332
|
remain private to those wrappers; shell tools do not receive an `mcp` command,
|
|
327
|
-
`MCPORTER_CONFIG`, or MCP session path.
|
|
333
|
+
`MCPORTER_CONFIG`, or MCP session path. On pi-mcp a tool call goes straight to the server
|
|
334
|
+
the session's process hosts, with the same authorization, timeout and
|
|
335
|
+
cancellation, rather than through its socket.
|
|
328
336
|
|
|
329
337
|
In codemode, Pi's MCP support connects each server in the background when the
|
|
330
338
|
session starts and keeps no state outside the session: no `mcp.json` is read
|
package/docs/providers.md
CHANGED
|
@@ -16,6 +16,7 @@ versioned contract for the providers behind them:
|
|
|
16
16
|
| `search` | `web_search` | tavily, exa, brave, keenable, parallel, perplexity |
|
|
17
17
|
| `productivity` | `mail`, `calendar`, `drive` | google, microsoft |
|
|
18
18
|
| `issues` | `issues` | linear, jira, introspection |
|
|
19
|
+
| `signature` | `signature` | docusign, dropbox-sign, pandadoc |
|
|
19
20
|
|
|
20
21
|
A **provider module** implements one family's contract: `{ kind, apiVersion,
|
|
21
22
|
id, capabilities, … }` plus the family's calls (`search` for search,
|
|
@@ -52,7 +53,7 @@ dependency; nothing is loaded from a file in the Recipe at run time.
|
|
|
52
53
|
|
|
53
54
|
| Source | Resolves to |
|
|
54
55
|
| --- | --- |
|
|
55
|
-
| none | the first-party package: `@introspection-ai/recipe-<family>-<id>`, or the family's bundle (`@introspection-ai/recipe-search`, `@introspection-ai/recipe-issues`) |
|
|
56
|
+
| none | the first-party package: `@introspection-ai/recipe-<family>-<id>`, or the family's bundle (`@introspection-ai/recipe-search`, `@introspection-ai/recipe-issues`, `@introspection-ai/recipe-signature`) |
|
|
56
57
|
| `package` | an installed package by name, such as `@acme/recipe-search`, which the Recipe lists in `dependencies` with a version, never only as a peer |
|
|
57
58
|
|
|
58
59
|
A provider kept with the Recipe's own code is a local package inside the
|
|
@@ -225,6 +226,7 @@ the adapter's tests run against a captured tool list.
|
|
|
225
226
|
| `search` | the fixed `SEARCH_PROVIDER_IDS` filter goes; `pi.search` is added; `recipe-search` serves the first-party providers through the shared loader |
|
|
226
227
|
| `productivity` | gains the `package` source; loads through the shared loader |
|
|
227
228
|
| `issues` | new: the contract and the tool in Recipes, and `@introspection-ai/recipe-issues` with `linear`, `jira` and `introspection` |
|
|
229
|
+
| `signature` | new: the contract and the tool in Recipes, and `@introspection-ai/recipe-signature` with `docusign`, `dropbox-sign` and `pandadoc`, each an MCP adapter; one provider per Recipe ([signature](signature/README.md)) |
|
|
228
230
|
|
|
229
231
|
The contract version of each family stays separate, so a breaking change to one
|
|
230
232
|
family's contract does not bump another's.
|
package/docs/recipe-format.md
CHANGED
|
@@ -344,8 +344,8 @@ caller invokes one by prompting with its slash command and arguments.
|
|
|
344
344
|
### Prompt templates are suggestions
|
|
345
345
|
|
|
346
346
|
A Recipe's suggestions are the things a new user can ask it to do. They are
|
|
347
|
-
the prompt templates marked with `suggest
|
|
348
|
-
|
|
347
|
+
the prompt templates marked with `suggest` in their frontmatter; there is no
|
|
348
|
+
separate manifest field. Templates without the mark still work as
|
|
349
349
|
`/name` commands and are never suggested. Give each suggested template a
|
|
350
350
|
short `description` (ten words or fewer), because that is what people see:
|
|
351
351
|
|
|
@@ -359,11 +359,23 @@ argument-hint: "[contract]"
|
|
|
359
359
|
Redline ${1:-the attached contract} against the playbook. Today is {{today}}.
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
+
`suggest` also says which agents offer the template:
|
|
363
|
+
|
|
364
|
+
- `suggest: true` offers it from every agent.
|
|
365
|
+
- `suggest: [reviewer]` offers it only from the agent named `reviewer`.
|
|
366
|
+
- `suggest: [agent, reviewer]` offers it from each agent listed.
|
|
367
|
+
|
|
368
|
+
A name is an agent's `name`, such as `agent` for the default agent. Agents are
|
|
369
|
+
always a list, even one: `suggest: reviewer` is not a mark.
|
|
370
|
+
`introspection check` warns (`prompts.suggest_agent_unknown`) when a name
|
|
371
|
+
matches none of the Recipe's agents. A host shows the suggestions of the
|
|
372
|
+
agent a session runs; when that agent offers none, it shows its own defaults.
|
|
373
|
+
|
|
362
374
|
- **In Pi.** A new session in the terminal (`pi --recipe <dir>`, or
|
|
363
375
|
`introspection local`) with no messages asks once, "What would you like to
|
|
364
|
-
do?", with up to three
|
|
365
|
-
when
|
|
366
|
-
|
|
376
|
+
do?", with up to three templates the session's agent offers (a random
|
|
377
|
+
three, in file order, when it offers more) and a row to type your own
|
|
378
|
+
request. When it offers none, it does not ask. Picking one sends it as the first message;
|
|
367
379
|
a template whose `argument-hint` has a required `<argument>` is put in the
|
|
368
380
|
editor instead, for you to finish. Typing sends what you typed, and Esc
|
|
369
381
|
leaves the empty prompt. Set `PI_RECIPES_SUGGESTIONS_SEED` to pin which
|
|
@@ -378,20 +390,25 @@ Redline ${1:-the attached contract} against the playbook. Today is {{today}}.
|
|
|
378
390
|
as written. Pi's picker fills `{{today}}`, and `{{member.name}}` from
|
|
379
391
|
`git config user.name`; a template typed as `/name` is sent unfilled.
|
|
380
392
|
- **Other surfaces.** `listRecipeSuggestions(recipeDir)` returns the marked
|
|
381
|
-
templates as `{ name, description, argumentHint?, text, placeholders }[]`,
|
|
382
|
-
`
|
|
383
|
-
|
|
393
|
+
templates as `{ name, description, argumentHint?, text, placeholders, agents }[]`,
|
|
394
|
+
where `agents` is `null` when every agent offers one;
|
|
395
|
+
`listRecipeSuggestions(recipeDir, { agent })` returns only those `agent`
|
|
396
|
+
offers. `fillSuggestion(text, values)` fills placeholders; both are
|
|
397
|
+
exported from `@introspection-ai/recipes/suggestions`.
|
|
384
398
|
`inspectRecipe` includes the same list as `suggestions`. A host that holds
|
|
385
399
|
the Recipe's files rather than a directory, such as the control plane when
|
|
386
400
|
it validates a version, reads the same list with `list_recipe_suggestions`
|
|
387
401
|
from `introspection-recipe-check` (Rust or Python).
|
|
388
|
-
- **YAML 1.2.** Only `suggest: true` marks a template. As in
|
|
389
|
-
and `"true"` are not booleans, so they don't count.
|
|
402
|
+
- **YAML 1.2.** Only `suggest: true` marks a template for every agent. As in
|
|
403
|
+
Pi, `yes`, `on` and `"true"` are not booleans, so they don't count. Nor do
|
|
404
|
+
`false`, a plain string, an empty list, or a list with anything but
|
|
405
|
+
non-empty names.
|
|
390
406
|
- **Checks.** For a marked template, the checker warns when it has no
|
|
391
407
|
`description` (`prompts.description_missing`), when the description is over
|
|
392
408
|
ten words (`prompts.description_long`), or when it uses a placeholder outside
|
|
393
|
-
the list above (`prompts.placeholder_unknown`). A `suggest` value that is
|
|
394
|
-
a boolean is also a warning
|
|
409
|
+
the list above (`prompts.placeholder_unknown`). A `suggest` value that is
|
|
410
|
+
neither a boolean nor a list of agent names is also a warning
|
|
411
|
+
(`prompts.suggest_invalid`).
|
|
395
412
|
|
|
396
413
|
Recipe-owned Pi extensions are declared by `pi.extensions`. The deterministically
|
|
397
414
|
resolved set forms the package's executable trust boundary and loads for every
|
|
@@ -498,7 +515,7 @@ lists them in `tools`:
|
|
|
498
515
|
| `ask_user_question` | Asks the user one to four multiple-choice questions and waits for the answers; the user can always type their own answer. Works in Pi's terminal, on pause/resume hosts and headless. See [Interactions](interactions.md#the-built-in-ask_user_question-tool). |
|
|
499
516
|
| `show_artifact` | Shows a markdown file the agent wrote (a brief, test cases, a report) in a panel on the right of Pi's terminal, and adds `/recipe view`; Esc closes it. Elsewhere it returns the file's path as text. See [Pi extension](pi-extension.md#artifact-panel). |
|
|
500
517
|
| `review_artifacts` | Asks the user to review several markdown files the agent wrote, one decision per file (approve, or request changes saying what to change). In Pi's terminal each file shows in the artifact panel; other hosts render their own review. See [Pi extension](pi-extension.md#reviewing-several-files). |
|
|
501
|
-
| `introspection_open` | Asks the person to open an Introspection page (install GitHub or Slack, add a connector, connect their own account, set up sign-in, connect a Runtime's MCP server, look at a Runtime or
|
|
518
|
+
| `introspection_open` | Asks the person to open an Introspection page (install GitHub or Slack, add a connector, connect their own account, set up sign-in, connect a Runtime's MCP server, look at a Runtime, task or Introspection issue) and, with `wait: true`, pauses until they are done. In Pi's terminal it runs the Introspection CLI's loopback; pause/resume hosts render a card. See [Interactions](interactions.md#the-built-in-introspection_open-tool). |
|
|
502
519
|
| `today` | Returns the current date, weekday and time, with the time zone and its UTC offset: the person's, or, with `time_zone`, another zone's. It reads the session's clock (see [Current date](#current-date)). |
|
|
503
520
|
|
|
504
521
|
```yaml
|