@gavin-hu/my-pi-agent 0.18.0 → 0.20.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 +66 -52
- package/README.zh-CN.md +56 -46
- package/docs/extensions/README.md +34 -0
- package/docs/extensions/board.md +507 -0
- package/{extensions/bytefly/README.md → docs/extensions/bytefly.md} +774 -574
- package/{extensions/check/README.md → docs/extensions/check.md} +83 -68
- package/{extensions/context/README.md → docs/extensions/context.md} +40 -23
- package/docs/extensions/file-browse.md +561 -0
- package/{extensions/file-open/README.md → docs/extensions/file-open.md} +31 -23
- package/{extensions/file-read/README.md → docs/extensions/file-read.md} +47 -55
- package/{extensions/goal/README.md → docs/extensions/goal.md} +115 -131
- package/{extensions/job/README.md → docs/extensions/job.md} +62 -52
- package/{extensions/memory/README.md → docs/extensions/memory.md} +71 -60
- package/{extensions/plan/README.md → docs/extensions/plan.md} +440 -322
- package/{extensions/question/README.md → docs/extensions/question.md} +54 -31
- package/{extensions/rewind/README.md → docs/extensions/rewind.md} +115 -122
- package/docs/extensions/session-bus.md +298 -0
- package/{extensions/subagent/README.md → docs/extensions/subagent.md} +165 -118
- package/docs/extensions/team.md +254 -0
- package/{extensions/todo/README.md → docs/extensions/todo.md} +85 -88
- package/{extensions/watch/README.md → docs/extensions/watch.md} +54 -36
- package/{extensions/web-access/README.md → docs/extensions/web-access.md} +93 -50
- package/{extensions/wechat/README.md → docs/extensions/wechat.md} +260 -163
- package/{extensions/worktree/README.md → docs/extensions/worktree.md} +137 -79
- package/extensions/board/commands.ts +105 -0
- package/extensions/board/config.ts +36 -0
- package/extensions/board/format.ts +170 -0
- package/extensions/board/index.ts +40 -0
- package/extensions/board/input.ts +54 -0
- package/extensions/board/join.ts +42 -0
- package/extensions/board/page.ts +388 -0
- package/extensions/board/result.ts +108 -0
- package/extensions/board/rows.ts +48 -0
- package/extensions/board/schema.ts +90 -0
- package/extensions/board/seat.ts +28 -0
- package/extensions/board/snapshot.ts +42 -0
- package/extensions/board/tools.ts +444 -0
- package/extensions/board/transport/router.ts +91 -0
- package/extensions/board/transport/server.ts +138 -0
- package/extensions/board/types.ts +121 -0
- package/extensions/board/view/client.ts +51 -0
- package/extensions/board/view/dialog.ts +43 -0
- package/extensions/board/view/keys.ts +125 -0
- package/extensions/board/view/live.ts +231 -0
- package/extensions/board/view/names.ts +91 -0
- package/extensions/board/view/page.ts +118 -0
- package/extensions/board/view/render.ts +519 -0
- package/extensions/board/view/styles.ts +228 -0
- package/extensions/board/view/team.ts +327 -0
- package/extensions/bytefly/footer/budget.ts +6 -5
- package/extensions/bytefly/footer/collect/entries.ts +12 -4
- package/extensions/bytefly/footer/collect/snapshot.ts +8 -17
- package/extensions/bytefly/footer/config.ts +19 -8
- package/extensions/bytefly/footer/price/price.ts +30 -8
- package/extensions/bytefly/footer/register.ts +5 -5
- package/extensions/bytefly/footer/render/format.ts +18 -0
- package/extensions/bytefly/footer/render/lines.ts +23 -7
- package/extensions/bytefly/footer/render/segments.ts +117 -31
- package/extensions/bytefly/footer/types.ts +29 -5
- package/extensions/bytefly/footer/unpriced.ts +42 -17
- package/extensions/bytefly/panel/commands.ts +67 -7
- package/extensions/bytefly/panel/filter.ts +68 -0
- package/extensions/bytefly/panel/format.ts +16 -15
- package/extensions/bytefly/panel/join.ts +56 -13
- package/extensions/bytefly/panel/prices.ts +43 -0
- package/extensions/bytefly/panel/settings-runtime.ts +0 -6
- package/extensions/bytefly/panel/settings.ts +75 -43
- package/extensions/bytefly/panel/tui/entries.ts +26 -8
- package/extensions/bytefly/panel/tui/frame.ts +130 -93
- package/extensions/bytefly/panel/tui/keys.ts +352 -0
- package/extensions/bytefly/panel/tui/list-view.ts +25 -46
- package/extensions/bytefly/panel/tui/panes.ts +76 -0
- package/extensions/bytefly/panel/tui/section-view.ts +126 -0
- package/extensions/bytefly/panel/tui/settings-section.ts +54 -125
- package/extensions/bytefly/panel/tui/settings-view.ts +30 -131
- package/extensions/bytefly/panel/tui/side-pane.ts +224 -0
- package/extensions/bytefly/panel/tui.ts +306 -259
- package/extensions/bytefly/picker/discovery.ts +0 -2
- package/extensions/bytefly/picker/types.ts +0 -2
- package/extensions/bytefly/update/check.ts +39 -0
- package/extensions/bytefly/update/format.ts +15 -0
- package/extensions/bytefly/update/register.ts +73 -34
- package/extensions/bytefly/update/state.ts +6 -3
- package/extensions/check/commands.ts +2 -1
- package/extensions/context/tui.ts +1 -1
- package/extensions/file-browse/{config.ts → config/config.ts} +1 -1
- package/extensions/file-browse/files/classify.ts +136 -0
- package/extensions/file-browse/files/files.ts +12 -0
- package/extensions/file-browse/files/index.ts +90 -0
- package/extensions/file-browse/files/list.ts +261 -0
- package/extensions/file-browse/{paths.ts → files/paths.ts} +1 -1
- package/extensions/file-browse/files/tree.ts +101 -0
- package/extensions/file-browse/{git.ts → git/git.ts} +10 -3
- package/extensions/file-browse/index.ts +4 -4
- package/extensions/file-browse/{live.ts → live/live.ts} +20 -69
- package/extensions/file-browse/{router.ts → transport/router.ts} +21 -17
- package/extensions/file-browse/transport/server.ts +110 -0
- package/extensions/file-browse/{chrome.ts → view/chrome.ts} +4 -4
- package/extensions/file-browse/{client.ts → view/client.ts} +1 -1
- package/extensions/file-browse/{diff-html.ts → view/diff-html.ts} +3 -3
- package/extensions/file-browse/view/emit.ts +51 -0
- package/extensions/file-browse/{html.ts → view/html.ts} +19 -18
- package/extensions/file-browse/{icons.ts → view/icons.ts} +1 -1
- package/extensions/file-browse/{markdown.ts → view/markdown.ts} +18 -20
- package/extensions/file-browse/{raw-html.ts → view/raw-html.ts} +19 -14
- package/extensions/file-browse/{styles.ts → view/styles.ts} +29 -5
- package/extensions/file-browse/{tree.ts → view/tree.ts} +1 -1
- package/extensions/file-browse/{urls.ts → view/urls.ts} +1 -1
- package/extensions/file-read/schema.ts +2 -1
- package/extensions/job/runtime.ts +4 -4
- package/extensions/memory/store.ts +12 -5
- package/extensions/plan/blocks.ts +23 -2
- package/extensions/plan/commands.ts +21 -16
- package/extensions/plan/feedback.ts +185 -52
- package/extensions/plan/format.ts +10 -3
- package/extensions/plan/index.ts +23 -5
- package/extensions/plan/plan-files.ts +88 -0
- package/extensions/plan/plan-index.ts +43 -9
- package/extensions/plan/plan-text.ts +33 -23
- package/extensions/plan/plans.ts +27 -34
- package/extensions/plan/policy.ts +30 -17
- package/extensions/plan/review.ts +3 -27
- package/extensions/plan/runtime.ts +52 -11
- package/extensions/plan/sections.ts +112 -0
- package/extensions/plan/steps.ts +3 -22
- package/extensions/plan/todos.ts +51 -3
- package/extensions/plan/tools/exit.ts +20 -95
- package/extensions/plan/tools/todo-seed.ts +4 -2
- package/extensions/plan/tools/write.ts +12 -1
- package/extensions/plan/tui.ts +5 -34
- package/extensions/plan/types.ts +15 -8
- package/extensions/plan/web-blocks.ts +89 -0
- package/extensions/plan/web-chrome.ts +3 -5
- package/extensions/plan/web-client.ts +179 -330
- package/extensions/plan/web-collab.ts +3 -3
- package/extensions/plan/web-comments.ts +18 -8
- package/extensions/plan/web-composer.ts +80 -0
- package/extensions/plan/web-draft.ts +40 -0
- package/extensions/plan/web-keys.ts +134 -0
- package/extensions/plan/web-outline.ts +192 -0
- package/extensions/plan/web-page.ts +4 -8
- package/extensions/plan/web-plan.ts +150 -0
- package/extensions/plan/web-router.ts +3 -58
- package/extensions/plan/web-settle.ts +194 -0
- package/extensions/plan/web-share-session.ts +24 -30
- package/extensions/plan/web-streams.ts +14 -14
- package/extensions/plan/web-tokens.ts +2 -2
- package/extensions/plan/web.ts +66 -120
- package/extensions/rewind/{commands.ts → commands/commands.ts} +5 -5
- package/extensions/rewind/{review.ts → commands/review.ts} +15 -14
- package/extensions/rewind/{rewind.ts → commands/rewind.ts} +6 -6
- package/extensions/rewind/{config.ts → config/config.ts} +1 -1
- package/extensions/rewind/index.ts +3 -3
- package/extensions/rewind/{policy.ts → state/policy.ts} +4 -4
- package/extensions/rewind/{runtime.ts → state/runtime.ts} +11 -11
- package/extensions/rewind/{snapshot-run.ts → state/snapshot-run.ts} +1 -1
- package/extensions/rewind/{timeline.ts → state/timeline.ts} +2 -2
- package/extensions/rewind/{format.ts → text/format.ts} +3 -3
- package/extensions/rewind/{git.ts → transport/git.ts} +2 -2
- package/extensions/rewind/{restore.ts → transport/restore.ts} +2 -2
- package/extensions/rewind/{snapshot.ts → transport/snapshot.ts} +1 -1
- package/extensions/rewind/{store.ts → transport/store.ts} +1 -1
- package/extensions/rewind/{checklist.ts → view/checklist.ts} +6 -6
- package/extensions/rewind/{hunk-picker.ts → view/hunk-picker.ts} +8 -8
- package/extensions/rewind/{path-picker.ts → view/path-picker.ts} +7 -7
- package/extensions/rewind/{review-tui.ts → view/review-tui.ts} +11 -11
- package/extensions/rewind/{rewind-tui.ts → view/rewind-tui.ts} +17 -11
- package/extensions/rewind/{status.ts → view/status.ts} +4 -4
- package/extensions/session-bus/commands.ts +17 -69
- package/extensions/session-bus/format.ts +22 -45
- package/extensions/session-bus/index.ts +13 -7
- package/extensions/session-bus/join-request.ts +40 -0
- package/extensions/session-bus/mail-watch.ts +134 -0
- package/extensions/session-bus/notice.ts +32 -4
- package/{lib/claims → extensions/session-bus}/overlap.ts +11 -18
- package/extensions/session-bus/protocol.ts +19 -49
- package/extensions/session-bus/resolve.ts +67 -0
- package/extensions/session-bus/result.ts +16 -51
- package/extensions/session-bus/rows.ts +11 -5
- package/extensions/session-bus/runtime.ts +220 -267
- package/extensions/session-bus/store.ts +55 -7
- package/extensions/session-bus/tools.ts +31 -66
- package/extensions/session-bus/tui.ts +5 -5
- package/extensions/session-bus/types.ts +23 -14
- package/extensions/subagent/agents.ts +9 -8
- package/extensions/subagent/commands.ts +2 -1
- package/extensions/subagent/invocation.ts +4 -2
- package/extensions/team/commands.ts +145 -0
- package/extensions/team/dispatch.ts +133 -0
- package/extensions/team/format.ts +119 -0
- package/extensions/team/index.ts +34 -0
- package/extensions/team/schema.ts +29 -0
- package/extensions/team/tools.ts +267 -0
- package/extensions/team/types.ts +65 -0
- package/extensions/todo/index.ts +4 -1
- package/extensions/todo/nudge.ts +8 -2
- package/extensions/web-access/fetch/page.ts +4 -1
- package/extensions/web-access/fetch/structured.ts +447 -0
- package/extensions/web-access/fetch/tool.ts +2 -1
- package/extensions/web-access/search/tool.ts +2 -1
- package/extensions/wechat/bridge.ts +106 -251
- package/extensions/wechat/{commands.ts → commands/commands.ts} +26 -18
- package/extensions/wechat/{doctor.ts → commands/doctor.ts} +5 -5
- package/extensions/wechat/{history.ts → commands/history.ts} +1 -1
- package/extensions/wechat/{login.ts → commands/login.ts} +3 -3
- package/extensions/wechat/{slash.ts → commands/slash.ts} +38 -2
- package/extensions/wechat/dialog/channels.ts +136 -0
- package/extensions/wechat/{interaction.ts → dialog/interaction.ts} +37 -37
- package/extensions/wechat/{prompt.ts → dialog/prompt.ts} +2 -2
- package/extensions/wechat/{remote-ui.ts → dialog/remote-ui.ts} +1 -1
- package/extensions/wechat/index.ts +10 -10
- package/extensions/wechat/intake.ts +245 -0
- package/extensions/wechat/{admission.ts → peer/admission.ts} +2 -2
- package/extensions/wechat/{peer-session.ts → peer/peer-session.ts} +2 -2
- package/extensions/wechat/{peer-worker.ts → peer/peer-worker.ts} +100 -22
- package/extensions/wechat/{presence.ts → peer/presence.ts} +8 -7
- package/extensions/wechat/{reply-pipeline.ts → peer/reply-pipeline.ts} +1 -1
- package/extensions/wechat/{credentials.ts → state/credentials.ts} +2 -2
- package/extensions/wechat/{state.ts → state/state.ts} +14 -2
- package/extensions/wechat/{format.ts → text/format.ts} +3 -3
- package/extensions/wechat/{notices.ts → text/notices.ts} +8 -0
- package/extensions/wechat/tools.ts +29 -12
- package/extensions/wechat/{client.ts → transport/client.ts} +26 -2
- package/extensions/wechat/{deliver.ts → transport/deliver.ts} +72 -28
- package/extensions/wechat/{inbound.ts → transport/inbound.ts} +5 -5
- package/extensions/wechat/{media.ts → transport/media.ts} +11 -5
- package/extensions/wechat/transport/outbound.ts +142 -0
- package/extensions/wechat/{poll.ts → transport/poll.ts} +3 -3
- package/extensions/wechat/types.ts +10 -1
- package/extensions/wechat/{login-screen.ts → view/login-screen.ts} +4 -4
- package/extensions/wechat/{status-screen.ts → view/status-screen.ts} +31 -26
- package/extensions/worktree/commands.ts +24 -17
- package/extensions/worktree/exit.ts +12 -6
- package/extensions/worktree/git.ts +22 -14
- package/extensions/worktree/guard.ts +18 -290
- package/extensions/worktree/handoff.ts +10 -2
- package/extensions/worktree/index.ts +2 -1
- package/extensions/worktree/lifecycle.ts +2 -0
- package/extensions/worktree/registry.ts +20 -11
- package/extensions/worktree/root-tools.ts +13 -3
- package/extensions/worktree/runtime.ts +8 -2
- package/extensions/worktree/screen.ts +15 -8
- package/extensions/worktree/shell.ts +303 -0
- package/extensions/worktree/state.ts +1 -1
- package/extensions/worktree/status.ts +42 -9
- package/extensions/worktree/tools.ts +19 -13
- package/lib/README.md +11 -8
- package/lib/board/card.ts +479 -0
- package/lib/board/links.ts +141 -0
- package/lib/board/page-pointer.ts +310 -0
- package/lib/board/round-text.ts +81 -0
- package/lib/board/round.ts +94 -0
- package/lib/board/rules.ts +437 -0
- package/lib/board/session.ts +105 -0
- package/lib/board/store.ts +497 -0
- package/lib/board/view.ts +234 -0
- package/lib/errors.ts +12 -4
- package/lib/format.ts +35 -0
- package/lib/http/guard.ts +112 -0
- package/lib/http/index.ts +16 -5
- package/lib/http/serve.ts +237 -0
- package/lib/http/server.ts +12 -10
- package/lib/http/sink.ts +135 -0
- package/lib/http/token.ts +38 -0
- package/lib/plan-entry.ts +11 -0
- package/lib/policy.ts +25 -2
- package/lib/requirements.ts +6 -7
- package/lib/session-label.ts +64 -0
- package/lib/session-roster.ts +201 -0
- package/lib/session-tool.ts +184 -0
- package/lib/spawn.ts +37 -3
- package/lib/stray-fields.ts +45 -0
- package/lib/tool-names.ts +38 -2
- package/lib/tui/glyphs.ts +3 -2
- package/lib/web/README.md +57 -4
- package/lib/web/client-runtime.ts +123 -0
- package/lib/web/components.ts +5 -0
- package/lib/web/index.ts +4 -2
- package/lib/web/markup.ts +88 -1
- package/lib/web/names.ts +42 -0
- package/lib/web/runtime.ts +7 -1
- package/lib/web/tokens.ts +25 -2
- package/package.json +26 -14
- package/skills/next/SKILL.md +4 -3
- package/skills/project-docs/SKILL.md +133 -0
- package/skills/project-docs/references/audit.md +131 -0
- package/skills/project-docs/references/changelog.md +105 -0
- package/skills/project-docs/references/discovery.md +127 -0
- package/skills/project-docs/references/readme.md +80 -0
- package/skills/project-docs/references/release.md +84 -0
- package/skills/project-docs/references/roadmap.md +93 -0
- package/skills/project-docs/scripts/state.ts +316 -0
- package/skills/refactor/SKILL.md +100 -125
- package/skills/refactor/references/handoff.md +35 -0
- package/skills/refactor/references/signals.md +54 -0
- package/skills/refactor/scripts/inventory.ts +587 -0
- package/extensions/bytefly/panel/tui/extensions-view.ts +0 -40
- package/extensions/bytefly/panel/tui/skills-view.ts +0 -50
- package/extensions/file-browse/README.md +0 -506
- package/extensions/file-browse/files.ts +0 -564
- package/extensions/file-browse/server.ts +0 -141
- package/extensions/job/process.ts +0 -35
- package/extensions/plan/split.ts +0 -87
- package/extensions/session-bus/README.md +0 -247
- package/extensions/session-bus/team.ts +0 -102
- package/extensions/wechat/outbound.ts +0 -100
- package/lib/plans/sections.ts +0 -172
- package/lib/plans/setting.ts +0 -52
- package/lib/plans/split.ts +0 -215
- package/lib/plans/store.ts +0 -19
- package/lib/plans/team.ts +0 -151
- package/skills/changelog/SKILL.md +0 -148
- package/skills/parallel-dev/SKILL.md +0 -150
- /package/extensions/file-browse/{rev.ts → live/rev.ts} +0 -0
- /package/extensions/file-browse/{diff.ts → text/diff.ts} +0 -0
- /package/extensions/file-browse/{fuzzy.ts → text/fuzzy.ts} +0 -0
- /package/extensions/file-browse/{live-client.ts → view/live-client.ts} +0 -0
- /package/extensions/file-browse/{palette.ts → view/palette.ts} +0 -0
- /package/extensions/rewind/{patch.ts → text/patch.ts} +0 -0
- /package/extensions/rewind/{paths.ts → text/paths.ts} +0 -0
- /package/extensions/rewind/{queue.ts → transport/queue.ts} +0 -0
- /package/extensions/rewind/{temp-index.ts → transport/temp-index.ts} +0 -0
- /package/extensions/wechat/{lock.ts → state/lock.ts} +0 -0
- /package/extensions/wechat/{channel.ts → text/channel.ts} +0 -0
|
@@ -5,47 +5,51 @@ the background and manage them without blocking the turn. A job starts
|
|
|
5
5
|
immediately and keeps running across tool calls; poll it, tail its output, wait
|
|
6
6
|
for it, or kill it.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
## Capabilities
|
|
9
|
+
|
|
10
|
+
Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
|
|
11
|
+
|
|
12
|
+
| Capability | How | What you get | Status |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| Background execution | `job` (`start`) | A long build, test suite, server, or watcher keeps running while the turn moves on. | Shipped |
|
|
15
|
+
| Job listing | `job` (`list`), `/jobs` | This session's jobs with status and elapsed time, and a live peer session's tagged `peer`. | Shipped |
|
|
16
|
+
| Polling and waiting | `job` (`status`, `logs`, `wait`) | One call returns a job's status, a bounded output tail, or blocks until it finishes. | Shipped |
|
|
17
|
+
| Stopping jobs | `job` (`kill` with `signal`) | A running job receives `SIGTERM`, `SIGKILL`, or `SIGINT`, and a finished one can be cleared. | Shipped |
|
|
18
|
+
| Selective clear | `job` (`clear` with `id`, `all`) | Clear one finished record by id, or remove running jobs with `all` after a confirmation in the screen. | Shipped |
|
|
19
|
+
| Start deadline | `timeoutMs` on `start` | A job is killed after the requested wall-clock limit instead of running until the session ends. | Shipped |
|
|
20
|
+
| Kill escalation | `killGraceMs` | A kill sends `SIGTERM` first, then `SIGKILL` after the grace period, on a user kill and on shutdown. | Shipped |
|
|
21
|
+
| Stdin driving | `job` (`send` with `input`, `newline`, `eof`) | A line or a bare keystroke reaches a running job started with `stdin: true`, and `eof` closes its input. | Shipped |
|
|
22
|
+
| Rotating logs | `job` (`logs`), `job.maxLogBytes` | stdout and stderr stream to an append-only log that rotates at 8 MiB, so a chatty job cannot fill the disk. | Shipped |
|
|
23
|
+
| Status chips | `job.showStatus` | `▸ N` running and `✗ N` unreported-failure counts in the footer. | Shipped |
|
|
24
|
+
| Completion reporting | `job` (`wake`), `job.wakeOnFinish` | A finished job is reported at the next turn, or triggers one as soon as the agent is idle. | Shipped |
|
|
25
|
+
| Job screen | `/jobs` | Select a job, open its log, kill it, or clear finished ones, with a confirmation on the destructive verbs. | Shipped |
|
|
26
|
+
| Detached lifetime | `job` (`start`, `detached`) | A POSIX job outlives the session and is reattached next time; Windows refuses the detach instead of faking one. | Shipped |
|
|
27
|
+
| Finished-job pruning | `maxJobs` | The registry drops the oldest finished records once the configured count is exceeded. | Shipped |
|
|
28
|
+
| Structured result | tool-result `details` | Every call returns a `JobDetails` record of the job and the action's outcome. | Shipped |
|
|
29
|
+
|
|
30
|
+
## Quickstart
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pi --extension ./extensions/job # load just this extension
|
|
34
|
+
pi -e . # load the whole @gavin-hu/my-pi-agent package
|
|
35
|
+
pi install ./ # install the package
|
|
10
36
|
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
/jobs # this session's jobs, and their logs
|
|
14
40
|
```
|
|
15
41
|
|
|
16
|
-
|
|
42
|
+
The model starts a job with `job start` and collects it with `job status`,
|
|
43
|
+
`job logs`, or `job wait`.
|
|
17
44
|
|
|
18
|
-
|
|
45
|
+
## Tool
|
|
19
46
|
|
|
20
47
|
<img src="../../assets/tools/job.png" alt="The job tool's result: the call line and an indented body with a finished and a failed job row, each with its status glyph and elapsed time" width="100%">
|
|
21
48
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- Shows this session's jobs, and — tagged `peer` — a live peer session's, so two
|
|
27
|
-
Pi sessions on one repo can see each other's builds; the peer's rows are
|
|
28
|
-
read-only on the screen.
|
|
29
|
-
- Runs each command in its own process group, streaming stdout and stderr to an
|
|
30
|
-
append-only log file under `~/.pi/agent/jobs/<project>/`. A segment rotates
|
|
31
|
-
to `<id>.log.1` at `maxLogBytes` (8 MiB by default), so a chatty job cannot
|
|
32
|
-
fill the disk, and `logs` reads across the boundary.
|
|
33
|
-
- Feeds a running job input when it was started with `stdin: true`: `send`
|
|
34
|
-
writes a line (or a bare keystroke) to its stdin, and `eof: true` closes it, so
|
|
35
|
-
a REPL, a debugger prompt, or a `read` can be driven without a TTY.
|
|
36
|
-
- Shows a `▸ N` running status chip and a separate `✗ N` unreported-failure
|
|
37
|
-
chip for this session's jobs, plus a `/jobs` screen for selecting, tailing,
|
|
38
|
-
killing, and clearing.
|
|
39
|
-
- Reports finished jobs to the model at the start of the next turn, or — for
|
|
40
|
-
jobs started with `wake: true` — by triggering one turn as soon as the agent is
|
|
41
|
-
idle, including right after a running turn settles.
|
|
42
|
-
- Kills session-owned jobs on shutdown so no process is left behind; on POSIX,
|
|
43
|
-
start a job with `detached: true` to keep it running and reattach next session.
|
|
44
|
-
A detached job points its own output straight at its log file, so it keeps
|
|
45
|
-
logging after this process ends. Windows has neither a process group to leave
|
|
46
|
-
nor a shell `EXIT` trap, so it refuses the detach instead of faking one.
|
|
47
|
-
|
|
48
|
-
## Tool
|
|
49
|
+
`job` — `executionMode: "sequential"`, `readOnlyHint: false`,
|
|
50
|
+
`destructiveHint: true`, `idempotentHint: false`, `openWorldHint: true`. One
|
|
51
|
+
tool with eight actions: `start` returns immediately with an id, and the rest
|
|
52
|
+
act on it.
|
|
49
53
|
|
|
50
54
|
| Field | Value |
|
|
51
55
|
|---|---|
|
|
@@ -147,20 +151,27 @@ job status j1
|
|
|
147
151
|
✓ j1 tests · exit 0 · 12.0s
|
|
148
152
|
```
|
|
149
153
|
|
|
150
|
-
|
|
154
|
+
## Commands
|
|
151
155
|
|
|
152
156
|
`/jobs` opens an interactive list in the TUI, and prints a text summary
|
|
153
|
-
elsewhere.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
elsewhere.
|
|
158
|
+
|
|
159
|
+
<img src="../../assets/screens/job.png" alt="The /jobs screen: a summary line, the job rows with status glyphs and elapsed times, and the focused job's command, cwd, and last output line" width="100%">
|
|
160
|
+
|
|
161
|
+
| Command | What it does |
|
|
162
|
+
|---|---|
|
|
163
|
+
| `/jobs` | Show and manage background jobs: an interactive list in the TUI, a text summary elsewhere. |
|
|
164
|
+
|
|
165
|
+
The list shows the jobs this session started, a dead session's records adopted
|
|
166
|
+
into it, and a live peer session's jobs tagged `peer`. On the screen: `↑`/`↓` or
|
|
167
|
+
`j`/`k` select, `PgUp`/`PgDn` page, `Home`/`End` jump, `Enter`/`l` opens the log
|
|
168
|
+
pane, `d` (or `K`) kills the selected running job, `x` clears finished jobs,
|
|
169
|
+
`Esc`/`q` closes. `d` and `x` ask for a `y`/`N` confirmation before acting, so a
|
|
170
|
+
stray key cannot kill a build; when `x` would drop an unreported result, the
|
|
171
|
+
prompt says how many. A `d` on a finished job (or an `x` with nothing finished)
|
|
172
|
+
says so instead of doing nothing. Another session's row opens its log but is
|
|
173
|
+
otherwise left alone: `d` answers `j9 is another session's job; not killed.`,
|
|
174
|
+
and `x` counts and clears only this session's finished jobs. In the log pane,
|
|
164
175
|
`↑`/`↓`, `PgUp`/`PgDn`, `Home`/`End`, and `g`/`G` scroll; the view follows the
|
|
165
176
|
tail until you scroll up, and `Esc`/`Backspace`/`q` returns to the list. The
|
|
166
177
|
pane's subheader names the job's log file, notes when only a bounded tail is
|
|
@@ -172,8 +183,7 @@ chips count only this session's. Running jobs come first, then recent finished
|
|
|
172
183
|
ones, and a focused detail pane follows (command, cwd, outcome, the owner when
|
|
173
184
|
it is another session, and the last output line). Selection is tracked by job
|
|
174
185
|
id, so the live re-sort cannot move the cursor or switch the open log out from
|
|
175
|
-
under the user.
|
|
176
|
-
Any dock screen (`/todos`, `/jobs`, `/rewind`, or the
|
|
186
|
+
under the user. Any dock screen (`/todos`, `/jobs`, `/rewind`, or the
|
|
177
187
|
`question` questionnaire) hides the above-editor goal/todo rails for its
|
|
178
188
|
lifetime and restores them on close.
|
|
179
189
|
|
|
@@ -185,8 +195,9 @@ notifications instead.
|
|
|
185
195
|
|
|
186
196
|
## Configuration
|
|
187
197
|
|
|
188
|
-
The `job` section of the shared `bytefly.json
|
|
189
|
-
|
|
198
|
+
The keys live in the `job` section of the shared `bytefly.json`; resolution rules
|
|
199
|
+
are in
|
|
200
|
+
[`../configuration.md`](../configuration.md#job--background-jobs).
|
|
190
201
|
|
|
191
202
|
| Key | Default | Meaning |
|
|
192
203
|
|---|---|---|
|
|
@@ -354,7 +365,7 @@ rewritten.
|
|
|
354
365
|
cached from the stdout stream for `status`/`wait`/completion notes; only the
|
|
355
366
|
`/jobs` log pane reads the file.
|
|
356
367
|
- **Pure logic split from IO.** `format.ts` and the reconciliation in
|
|
357
|
-
`registry.ts` are pure;
|
|
368
|
+
`registry.ts` are pure; the runtime takes injectable
|
|
358
369
|
spawn/liveness/kill/clock functions, so the whole suite runs without
|
|
359
370
|
launching a process.
|
|
360
371
|
- **The transcript reuses the `/jobs` grammar.** `job list` renders the same
|
|
@@ -377,7 +388,6 @@ rewritten.
|
|
|
377
388
|
| `schema.ts` | Parameter schema and pure validation (a `JobCall` union). |
|
|
378
389
|
| `config.ts` | The `job` section of `bytefly.json`: loading and clamping. |
|
|
379
390
|
| `format.ts` | Pure formatting, duration, and transcript outcome-line helpers; sanitization is `lib/format.ts`'s `sanitizeUntrustedLine`. |
|
|
380
|
-
| `process.ts` | The job-only process remainder: the `LivenessFn` seam and the `ps` start-time token. Spawn, tree-kill, and liveness itself come from `lib/spawn.ts`. |
|
|
381
391
|
| `paths.ts` | Session/marker/registry/status file-name helpers. |
|
|
382
392
|
| `registry.ts` | Per-session registry load/merge, legacy migration, and pure reconciliation. |
|
|
383
393
|
| `reservations.ts` | Atomic `O_EXCL` job-id reservation and release. |
|
|
@@ -7,7 +7,28 @@ live as human-editable markdown, not in the session branch, so they survive
|
|
|
7
7
|
`AGENTS.md`; `memory` is for the one-liners the model should not have to be
|
|
8
8
|
reminded of twice.
|
|
9
9
|
|
|
10
|
-
<img src="../../assets/memory.png" alt="The /memory picker: a Memory title rule, an `All · 3 project, 2 global` summary, five notes tagged by scope with the focused one marked, and the key hints" width="100%">
|
|
10
|
+
<img src="../../assets/screens/memory.png" alt="The /memory picker: a Memory title rule, an `All · 3 project, 2 global` summary, five notes tagged by scope with the focused one marked, and the key hints" width="100%">
|
|
11
|
+
|
|
12
|
+
## Capabilities
|
|
13
|
+
|
|
14
|
+
Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
|
|
15
|
+
|
|
16
|
+
| Capability | How | What you get | Status |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| Automatic recall | the `[MEMORY]` context message | Stored notes arrive before each run, bounded by a byte cap, without the user asking. | Shipped |
|
|
19
|
+
| Durable notes | `memory` | The model adds, updates, forgets, or lists short facts that outlive the session branch. | Shipped |
|
|
20
|
+
| Two scopes | the `scope` parameter, `/memory path` | Notes are global or per-project, each a plain markdown file you can edit by hand. | Shipped |
|
|
21
|
+
| Repo-root anchor | the `project` store | The project store is anchored at the repository root, so a subdirectory and every worktree read the same file. | Shipped |
|
|
22
|
+
| Note picker | `/memory` | Add, edit, forget, merge, or move a note in the TUI, with a scope filter and a reload. | Shipped |
|
|
23
|
+
| Whole-file editing | `/memory edit`, `/memory clear` | The file in the multi-line editor, or a scope cleared behind a confirm. | Shipped |
|
|
24
|
+
| Duplicate guard | `memory` `add` | Re-stating a stored fact in new words is a no-op that names the existing note. | Shipped |
|
|
25
|
+
| Store health | `/memory doctor` | Counts, file bytes, the injection budget with its omissions, and near-duplicate pairs. | Shipped |
|
|
26
|
+
| Store freshness | `memory`, `/memory reload` | A hand edit is picked up on the next read, and `reload` forces it. | Shipped |
|
|
27
|
+
| Recall off switch | `memory.inject` | Injection can be turned off without deleting the notes, for a session that must not receive them. | Shipped |
|
|
28
|
+
| Trust-gated project store | the `project` scope | The project file is read and written only when the project is trusted. | Shipped |
|
|
29
|
+
| Headless coverage | `list`, `path`, `reload`, `doctor` outside `tui` | Read-only verbs notify everywhere; picker, edit, and clear require an interactive session. | Shipped |
|
|
30
|
+
|
|
31
|
+
## Quickstart
|
|
11
32
|
|
|
12
33
|
```bash
|
|
13
34
|
pi --extension ./extensions/memory # load just this extension
|
|
@@ -15,61 +36,42 @@ pi -e . # load the whole @gavin-hu/my-pi-agent pac
|
|
|
15
36
|
pi install ./ # install the package
|
|
16
37
|
```
|
|
17
38
|
|
|
18
|
-
|
|
39
|
+
```text
|
|
40
|
+
/memory # open the picker (a listing elsewhere)
|
|
41
|
+
/memory doctor # check the stores and the injection budget
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Tool
|
|
19
45
|
|
|
20
46
|
How the `memory` call and its result look in the transcript — the call line as a headline and the body indented under it:
|
|
21
47
|
|
|
22
48
|
<img src="../../assets/tools/memory.png" alt="The memory tool's result: the call line and an indented body confirming the write and the new project and global counts" width="100%">
|
|
23
49
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
punctuation, so re-stating a fact in new words does not grow the store.
|
|
30
|
-
- Keeps two stores, both plain markdown with one bullet per note:
|
|
31
|
-
|
|
32
|
-
| Scope | File |
|
|
33
|
-
|---|---|
|
|
34
|
-
| `global` | `<agent-dir>/memory.md` |
|
|
35
|
-
| `project` | `<repo-root>/.pi/memory.md` |
|
|
36
|
-
|
|
37
|
-
The project store is anchored at the **repository root**, so it is stable when
|
|
38
|
-
Pi runs from a subdirectory and shared across git worktrees.
|
|
39
|
-
- Injects the stored notes as a hidden `[MEMORY]` context message before each
|
|
40
|
-
run, bounded by a byte cap, so the model recalls them without being asked.
|
|
41
|
-
- Re-reads each store when its file changes on disk (compared by mtime and size),
|
|
42
|
-
so an external edit lands in the same session without a restart.
|
|
43
|
-
- Exposes `/memory`: in the TUI it opens a picker to add, edit, or forget a
|
|
44
|
-
single note, merge two notes into one, move a note to the other scope, filter
|
|
45
|
-
by scope, and reload; elsewhere it lists the store. `/memory path`, `edit`, and `clear` print the file paths,
|
|
46
|
-
open the multi-line editor, and clear a scope; `/memory doctor` reports store
|
|
47
|
-
health.
|
|
48
|
-
- Reports store health with `/memory doctor`: note counts and file bytes per
|
|
49
|
-
scope, how much of the `maxInjectBytes` budget the injection uses and which
|
|
50
|
-
scope overflowed it, and the near-duplicate pairs the conservative key already
|
|
51
|
-
considers one fact. It is read-only — the report names the pair and the picker
|
|
52
|
-
merges it.
|
|
53
|
-
- Loads and writes the project store only when the project is trusted, sanitizes
|
|
54
|
-
every note to one terminal-safe line, and writes atomically.
|
|
50
|
+
`memory` — direct exposure (the default), `executionMode: "sequential"`,
|
|
51
|
+
annotations `readOnlyHint: false`, `destructiveHint: true` (forget deletes),
|
|
52
|
+
`idempotentHint: true`, `openWorldHint: false`. It is a singleton tool with an
|
|
53
|
+
action switch (like `job`); `list` reads both stores, and the other three
|
|
54
|
+
mutate one.
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
| Parameter | Type | Meaning |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `action` | `add` \| `update` \| `forget` \| `list` | What to do with the store. |
|
|
59
|
+
| `text` | string | The note to add, or the exact note to update or forget. Required for `add`/`update`/`forget`. |
|
|
60
|
+
| `to` | string | The replacement note for `update`. Required for `update`. |
|
|
61
|
+
| `scope` | `project` (default) \| `global` | Which store `add`/`update`/`forget` changes. |
|
|
57
62
|
|
|
58
|
-
`
|
|
59
|
-
|
|
60
|
-
(`{ action, scope, project, global, changed, entry?, to?, existing?, error? }`).
|
|
63
|
+
Result (`details` / `structuredContent`, `MemoryResult`): `{ action, scope,
|
|
64
|
+
project, global, changed, entry?, to?, existing?, error? }`.
|
|
61
65
|
|
|
62
|
-
|
|
66
|
+
The two stores are plain markdown with one bullet per note:
|
|
67
|
+
|
|
68
|
+
| Scope | File |
|
|
63
69
|
|---|---|
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
| `exposure` | `direct` (default). |
|
|
70
|
-
| `executionMode` | `sequential` — calls share the cached stores. |
|
|
71
|
-
| `annotations` | `readOnlyHint: false`, `destructiveHint: true` (forget deletes), `idempotentHint: true`, `openWorldHint: false`. |
|
|
72
|
-
| `outputSchema` | `MemoryResult` — also returned as `structuredContent`. |
|
|
70
|
+
| `global` | `<agent-dir>/memory.md` |
|
|
71
|
+
| `project` | `<repo-root>/.pi/memory.md` |
|
|
72
|
+
|
|
73
|
+
The project store is anchored at the **repository root**, so it is stable when
|
|
74
|
+
Pi runs from a subdirectory and shared across git worktrees.
|
|
73
75
|
|
|
74
76
|
Validation happens before anything is written (a violation returns an error
|
|
75
77
|
result carrying the unchanged notes, never a half-apply): a known action; a
|
|
@@ -97,6 +99,10 @@ or stem both survive.
|
|
|
97
99
|
|
|
98
100
|
## Commands
|
|
99
101
|
|
|
102
|
+
`/memory` opens the picker in the TUI and notifies the stored notes elsewhere.
|
|
103
|
+
`list`, `path`, `reload`, and `doctor` report through `notify` in every mode;
|
|
104
|
+
`edit` and `clear` need an interactive session.
|
|
105
|
+
|
|
100
106
|
| Command | What it does |
|
|
101
107
|
|---|---|
|
|
102
108
|
| `/memory` | In the TUI, open the picker (add, edit, forget, merge, or move notes; `s`/Tab filters by scope; `r` reloads). Other modes notify the stored notes. |
|
|
@@ -145,9 +151,8 @@ not change it.
|
|
|
145
151
|
|
|
146
152
|
## Configuration
|
|
147
153
|
|
|
148
|
-
The `memory` section of the shared `bytefly.json
|
|
149
|
-
|
|
150
|
-
malformed documents are ignored):
|
|
154
|
+
The `memory` section of the shared `bytefly.json`; resolution rules are in
|
|
155
|
+
[`../configuration.md`](../configuration.md#memory--durable-notes):
|
|
151
156
|
|
|
152
157
|
| Key | Default | Meaning |
|
|
153
158
|
|---|---|---|
|
|
@@ -177,10 +182,13 @@ skill. Mitigations:
|
|
|
177
182
|
|
|
178
183
|
- Notes are injected whole (bounded), so a very large store is truncated with a
|
|
179
184
|
`(+N more; use the memory tool)` tail rather than summarized.
|
|
180
|
-
- External edits to a store are picked up automatically by an
|
|
181
|
-
before the next injection or tool call
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
- External edits to a store are picked up automatically by an `(mtimeNs, size)`
|
|
186
|
+
check before the next injection or tool call, so a same-size edit inside one
|
|
187
|
+
millisecond is seen. The residual case is the filesystem's own resolution: where
|
|
188
|
+
the stamp is no finer than the last one read — a one-second mtime, or a write
|
|
189
|
+
the kernel coalesced — only `/memory reload` catches the edit. A store that
|
|
190
|
+
becomes unreadable (symlinked or over the size cap) keeps its last good view
|
|
191
|
+
until fixed.
|
|
184
192
|
- Matching for `forget` is exact and case-sensitive.
|
|
185
193
|
- The near-duplicate guard on `add` is deliberately conservative: it folds
|
|
186
194
|
case, whitespace runs, and trailing sentence punctuation only, never word
|
|
@@ -188,8 +196,8 @@ skill. Mitigations:
|
|
|
188
196
|
both be stored; `/memory doctor` reports the pairs the key does consider equal,
|
|
189
197
|
and `m` in the picker merges them under wording you write.
|
|
190
198
|
- `update` replaces every exact match of `text`; a replacement that already
|
|
191
|
-
exists under a different note can leave a duplicate. Forget the old note first
|
|
192
|
-
when consolidating, or merge the pair in the picker afterward.
|
|
199
|
+
exists under a different note can leave a duplicate. Forget the old note first
|
|
200
|
+
when consolidating, or merge the pair in the picker afterward.
|
|
193
201
|
- Only one note per line; multi-line notes are collapsed to a single line.
|
|
194
202
|
|
|
195
203
|
## Non-goals
|
|
@@ -237,10 +245,13 @@ when consolidating, or merge the pair in the picker afterward.
|
|
|
237
245
|
writers for the same file, and each write lands atomically via a temp file and
|
|
238
246
|
rename; `executionMode: "sequential"` keeps in-process calls ordered as well.
|
|
239
247
|
- **Stamped cache, not a watcher.** The session cache is validated against each
|
|
240
|
-
file's `(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
248
|
+
file's `(mtimeNs, size)` stamp before every read rather than holding an
|
|
249
|
+
`fs.watch` handle. The stamp is the nanosecond field a bigint `stat` returns, so
|
|
250
|
+
a same-size edit in the same millisecond is a distinct state; a millisecond
|
|
251
|
+
stamp would have to read the file on every run to tell them apart. A mutation
|
|
252
|
+
adopts the fresh on-disk stamp, so a self-write is not mistaken for an external
|
|
253
|
+
change, and a failed re-read keeps the last good view instead of breaking the
|
|
254
|
+
run.
|
|
244
255
|
|
|
245
256
|
## Files
|
|
246
257
|
|