@tranhoangnguyen0310/pi-flow-external 3.1.1-external.0 → 3.2.1-external.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/CHANGELOG.md +46 -0
- package/README.md +129 -648
- package/docs/README.md +59 -0
- package/docs/configuration-reference.md +189 -0
- package/docs/harness-reference.md +133 -0
- package/docs/migration-v4-to-v5.md +85 -0
- package/docs/public-contract.md +110 -0
- package/docs/supervision-and-runtime.md +154 -0
- package/docs/troubleshooting.md +81 -0
- package/docs/workflows.md +114 -0
- package/package.json +11 -10
- package/src/contract/agent.ts +29 -0
- package/src/contract/envelope.ts +97 -0
- package/src/contract/run.ts +157 -0
- package/src/contract/runs.ts +34 -0
- package/src/contract/workflow.ts +31 -0
- package/src/core/errors.ts +6 -1
- package/src/core/run-inspection.ts +92 -57
- package/src/core/run-projection.ts +1 -1
- package/src/external-command.ts +71 -28
- package/src/external-runs.ts +266 -157
- package/src/pi-subagent.ts +2 -1
- package/src/types.ts +2 -0
- package/src/workflow/journal.ts +40 -17
- package/src/workflow/registry.ts +10 -7
- package/src/workflow/runtime.ts +2 -0
- package/src/workflow/source.ts +16 -13
- package/src/workflow/tool.ts +48 -13
- package/src/workflow/types.ts +6 -0
- package/AGENTS.md +0 -78
- package/CLAUDE.md +0 -1
- package/CONTEXT.md +0 -69
- package/docs/ARCHITECTURE_SNAPSHOT.md +0 -113
- package/docs/agent-public-contract.md +0 -21
- package/docs/field-testing.md +0 -245
- package/docs/releasing.md +0 -185
- package/src/public-contract.ts +0 -73
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to pi-flow external are documented here.
|
|
4
4
|
|
|
5
|
+
## [3.2.1-external.0] - 2026-10-05
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Reorganized documentation suite: user guides remain in `docs/`, maintainer specifications and runbooks moved to `docs/maintainer/`, and historical planning documents moved to `docs/archive/`.
|
|
9
|
+
- Published package no longer includes internal agent instructions (`AGENTS.md`, `CONTEXT.md`, `CLAUDE.md`), maintainer runbooks, or historical plans.
|
|
10
|
+
- Explicit file listing in `package.json` replaces globs to ensure strict CI release check tracking.
|
|
11
|
+
|
|
12
|
+
## [3.2.0-external.0] - 2026-10-02
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Versioned public contracts for `workflow` and every `external_runs` action (issue #77), sharing the `Agent` envelope from 3.1.0: `outputSchema`, matching `structuredContent`, and `isError === !ok`. `ok` describes the operation, so inspecting or waiting on a failed run is `ok: true`. See [docs/public-contract.md](docs/public-contract.md), which replaces `docs/agent-public-contract.md`.
|
|
16
|
+
- `external_runs` payloads:
|
|
17
|
+
|
|
18
|
+
| Action | `data` |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `list` | `{runs, workflows, nextCursor?, nextWorkflowCursor?}` |
|
|
21
|
+
| batch `inspect` | `{mode: "batch", entries, nextCursor?}` |
|
|
22
|
+
| single `inspect` | `{mode: "single", runId, view, page: {text, encoding, complete, nextCursor?}, finalAvailable?, outputStatus?}` |
|
|
23
|
+
| `wait` | `{mode, completed, pending}` |
|
|
24
|
+
| `cancel` | `{runId, status}` |
|
|
25
|
+
|
|
26
|
+
Every row is one `PublicRun` shape, with evidence integrity and callable `refs`. In `wait`, a structured value is inline only when it is in memory, its text result was delivered whole, and its encoded JSON fits both 16 KiB and what remains of the structured channel's own copy of `limitBytes`, spent in request order. Otherwise it is delivered by reference.
|
|
27
|
+
- An agent's `final` view now serves a settled successful result still held in the registry, so a `refs.final` reference resolves even when the run's evidence was never saved.
|
|
28
|
+
- Workflow receipts. A foreground root that failed, was cancelled or timed out is `ok: false` and keeps its run. A background launch is `ok: true` once accepted. A root that succeeded after catching child failures stays `ok: true`, reports `run.children.failed`, and adds the warning `handled_child_failures` and a sentence in its text result. Failures are counted where the script receives them, including calls that fail before a child is indexed; always-fatal failures are excluded. Journals record the count (`childFailures`) and report integrity: a torn last line is `incomplete`, a bad line mid-file is `damaged`.
|
|
29
|
+
- New error codes: `request_invalid`, `run_unavailable`, `run_not_live`, `cursor_invalid`, `cursor_stale`, `page_too_small`, `session_unavailable`, `script_invalid`, `storage_unavailable`.
|
|
30
|
+
|
|
31
|
+
### Changed (compatibility)
|
|
32
|
+
- **Expected `external_runs` and `workflow` failures are returned, not thrown.** Messages are unchanged except where noted. Direct callers and scripts that relied on a rejection must check `ok` or `isError`. Interrupted waits, unexpected exceptions, schema validation and `tool_call` blocks still throw.
|
|
33
|
+
|
|
34
|
+
| Previously thrown message | Now returned with code |
|
|
35
|
+
|---|---|
|
|
36
|
+
| "Invalid run ID"; "Invalid workflow run ID"; "inspect accepts either runId or runIds, not both"; "cancel accepts either runId or runIds, not both"; "cancel targets one run at a time"; "inspect runIds requires 1-20 run IDs"; "wait requires 1-100 run IDs"; 'Batch inspect (runIds) only supports view: "summary"'; "limitBytes must be finite" | `request_invalid` |
|
|
37
|
+
| "Run is unknown or unavailable in this session" | `run_unavailable` |
|
|
38
|
+
| "Run is no longer live in this session; cancellation cannot be confirmed"; "Run … is unavailable for live waiting" | `run_not_live` |
|
|
39
|
+
| "Invalid cursor"; "Cursor belongs to a different run/view/list scope"; "Batch cursor does not match the requested run IDs…"; a batch cursor from another session (message is now "Cursor belongs to a different session or project") | `cursor_invalid` |
|
|
40
|
+
| "Run changed while paging; restart inspection without a cursor"; "Cursor points past available evidence"/"outside available workflow content" (message is now the "Run changed while paging" text) | `cursor_stale` |
|
|
41
|
+
| "Batch summary for … does not fit within limitBytes…" | `page_too_small` |
|
|
42
|
+
| "external_runs requires a persisted originating session" | `session_unavailable` |
|
|
43
|
+
|
|
44
|
+
- Failed workflow rows now set `isError`, so they render red like failed `Agent` calls.
|
|
45
|
+
- **Output and diagnostics pages concatenate losslessly.** Each new message after the first carries a leading `\n` separator inside the page text and items; agy/muse streaming deltas still join into one message. Previously, two messages split across a page boundary ran together. Byte offsets shift, so inspection cursors issued by earlier versions fail with `cursor_stale`; restart without a cursor.
|
|
46
|
+
- Batch `inspect` serves an entry only when it fits `limitBytes` in both the text and the structured result, so text pages may hold fewer entries than before.
|
|
47
|
+
- Live output pages, in-memory wait results and workflow views (from memory or the journal) are now redacted in full before they are measured or sliced. Previously they were served unredacted.
|
|
48
|
+
- `/external runs` reads the structured contract. Stale cursors restart from page 1 by code, now including paged summaries. Other failures show a notice and keep the navigator open instead of closing it.
|
|
49
|
+
- An unreadable workflow journal in this project is reported as `run_unavailable` with its read error; another project's journal is reported like an unknown run.
|
|
50
|
+
|
|
5
51
|
## [3.1.1-external.0] - 2026-10-02
|
|
6
52
|
|
|
7
53
|
### Fixed
|