@henryqw/pi-subagent 22.1.0 → 22.2.1
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 +13 -8
- package/dist/git-runtime.js +21 -18
- package/dist/herdr-runtime.d.ts +3 -0
- package/dist/herdr-runtime.js +18 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/integration-git.js +7 -2
- package/dist/launch-runtime.d.ts +1 -1
- package/dist/launch-runtime.js +9 -9
- package/dist/runner.d.ts +7 -0
- package/dist/runner.js +94 -13
- package/dist/store.d.ts +3 -0
- package/dist/store.js +6 -1
- package/dist/worktree.d.ts +2 -2
- package/dist/worktree.js +8 -8
- package/docs/worker-lifecycle.html +92 -0
- package/docs/worker-lifecycle.svg +80 -0
- package/extensions/isolated.ts +71 -7
- package/extensions/role-tools.ts +8 -2
- package/extensions/subagent-command.ts +15 -6
- package/extensions/subagent.ts +45 -1
- package/package.json +1 -1
- package/skills/pi-subagent/SKILL.md +3 -3
- package/docs/delegation-routing.html +0 -89
- package/docs/delegation-routing.svg +0 -78
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720" role="img" aria-labelledby="delegation-routing-title delegation-routing-desc">
|
|
3
|
-
<title id="delegation-routing-title">Delegation routing and checked task lifecycle</title>
|
|
4
|
-
<desc id="delegation-routing-desc">A read-only Role runs direct in the current workspace; implementation uses an isolated checked graph. In that graph workers produce a checked candidate, Main stages and validates the combined tip, then explicitly promotes it. Interruptions retain work for recovery and revalidation.</desc>
|
|
5
|
-
<defs>
|
|
6
|
-
<style>@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap');</style>
|
|
7
|
-
<marker id="routing-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4c5665"/></marker>
|
|
8
|
-
<marker id="routing-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#1d4ed8"/></marker>
|
|
9
|
-
<marker id="routing-arrow-link" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4c5665"/></marker>
|
|
10
|
-
</defs>
|
|
11
|
-
<rect width="1280" height="720" fill="#f0eee9"/>
|
|
12
|
-
<text x="48" y="60" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1.5">PI SUBAGENT / ROUTING + LIFECYCLE</text>
|
|
13
|
-
<text x="48" y="99" fill="#101828" font-family="'Instrument Serif',serif" font-size="28">One explicit mode; only checked work can be promoted</text>
|
|
14
|
-
<text x="48" y="126" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Direct work returns an observed result. Isolated changesets yield a candidate that Main must validate and promote.</text>
|
|
15
|
-
<!-- Routes and transitions are drawn before nodes. -->
|
|
16
|
-
<line x1="224" y1="212" x2="248" y2="212" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
17
|
-
<path d="M336 268 V296 Q336 304 328 304 H192 Q184 304 184 312 V352" fill="none" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
18
|
-
<path d="M424 212 H488 Q496 212 496 220 V352" fill="none" stroke="#1d4ed8" stroke-width="1.4" marker-end="url(#routing-arrow-accent)"/>
|
|
19
|
-
<line x1="560" y1="400" x2="624" y2="400" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
20
|
-
<line x1="784" y1="400" x2="848" y2="400" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
21
|
-
<line x1="1008" y1="400" x2="1072" y2="400" stroke="#1d4ed8" stroke-width="1.4" marker-end="url(#routing-arrow-accent)"/>
|
|
22
|
-
<!-- Interruption / re-entry paths use separate attach points. -->
|
|
23
|
-
<line x1="448" y1="448" x2="448" y2="512" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
24
|
-
<line x1="512" y1="512" x2="512" y2="448" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
25
|
-
<line x1="896" y1="448" x2="896" y2="512" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
26
|
-
<line x1="960" y1="512" x2="960" y2="448" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
27
|
-
<!-- Arrow labels have an 8px gap to their strokes. -->
|
|
28
|
-
<g fill="#4c5665" font-family="'Geist Mono',monospace" font-size="8" text-anchor="middle">
|
|
29
|
-
<rect x="256" y="284" width="48" height="12" rx="2" fill="#f0eee9"/><text x="280" y="293">YES</text>
|
|
30
|
-
<rect x="432" y="192" width="72" height="12" rx="2" fill="#f0eee9"/><text x="468" y="201" fill="#1d4ed8">NO / GRAPH</text>
|
|
31
|
-
<rect x="568" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="592" y="389">CHECK</text>
|
|
32
|
-
<rect x="792" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="816" y="389">STAGE</text>
|
|
33
|
-
<rect x="1016" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="1040" y="389" fill="#1d4ed8">VERIFY</text>
|
|
34
|
-
<rect x="384" y="472" width="56" height="12" rx="2" fill="#f0eee9"/><text x="412" y="481">PAUSE</text>
|
|
35
|
-
<rect x="520" y="472" width="56" height="12" rx="2" fill="#f0eee9"/><text x="548" y="481">RESUME</text>
|
|
36
|
-
<rect x="816" y="472" width="72" height="12" rx="2" fill="#f0eee9"/><text x="852" y="481">MAIN DRIFT</text>
|
|
37
|
-
<rect x="968" y="472" width="72" height="12" rx="2" fill="#f0eee9"/><text x="1004" y="481">RECHECK</text>
|
|
38
|
-
</g>
|
|
39
|
-
<!-- Mode selection. -->
|
|
40
|
-
<rect x="80" y="180" width="144" height="64" rx="24" fill="#ffffff" stroke="#101828"/>
|
|
41
|
-
<text x="152" y="217" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Delegate task</text>
|
|
42
|
-
<polygon points="336,156 424,212 336,268 248,212" fill="#ffffff" stroke="#101828"/>
|
|
43
|
-
<text x="336" y="208" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Direct</text>
|
|
44
|
-
<text x="336" y="226" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">eligible?</text>
|
|
45
|
-
<!-- Direct is intentionally a single terminal branch: no worktree or candidate. -->
|
|
46
|
-
<text x="80" y="336" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">DIRECT</text>
|
|
47
|
-
<rect x="80" y="352" width="208" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
48
|
-
<text x="184" y="384" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Herdr tabs</text>
|
|
49
|
-
<text x="184" y="406" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Current workspace</text>
|
|
50
|
-
<text x="184" y="428" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Observe result</text>
|
|
51
|
-
<text x="80" y="477" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Single · parallel · chain</text>
|
|
52
|
-
<!-- Isolated changeset rail. -->
|
|
53
|
-
<text x="400" y="336" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">ISOLATED / CHECKED CHANGESET</text>
|
|
54
|
-
<rect x="400" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
55
|
-
<text x="480" y="387" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Saved + working</text>
|
|
56
|
-
<text x="480" y="411" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Durable ID</text>
|
|
57
|
-
<text x="480" y="429" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Owned worktree</text>
|
|
58
|
-
<rect x="624" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
59
|
-
<text x="704" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Ready candidate</text>
|
|
60
|
-
<text x="704" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Clean commit + checks</text>
|
|
61
|
-
<rect x="848" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
62
|
-
<text x="928" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Staged by Main</text>
|
|
63
|
-
<text x="928" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Exact candidate tip</text>
|
|
64
|
-
<rect x="1072" y="352" width="160" height="96" rx="8" fill="#1d4ed8" fill-opacity="0.08" stroke="#1d4ed8"/>
|
|
65
|
-
<text x="1152" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Promoted by Main</text>
|
|
66
|
-
<text x="1152" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">After combined checks</text>
|
|
67
|
-
<!-- Recovery states do not erase or bypass exact checks. -->
|
|
68
|
-
<text x="400" y="497" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">WAIT / RECOVERY</text>
|
|
69
|
-
<rect x="400" y="512" width="160" height="72" rx="8" fill="#e6e4de" stroke="#4c5665" stroke-dasharray="5,4"/>
|
|
70
|
-
<text x="480" y="541" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Needs attention</text>
|
|
71
|
-
<text x="480" y="562" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Status / retry</text>
|
|
72
|
-
<rect x="848" y="512" width="160" height="72" rx="8" fill="#e6e4de" stroke="#4c5665" stroke-dasharray="5,4"/>
|
|
73
|
-
<text x="928" y="541" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Revalidate</text>
|
|
74
|
-
<text x="928" y="562" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Restage if needed</text>
|
|
75
|
-
<line x1="48" y1="648" x2="1232" y2="648" stroke="#101828" stroke-opacity="0.12"/>
|
|
76
|
-
<text x="48" y="674" fill="#4c5665" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">GUARD</text>
|
|
77
|
-
<text x="128" y="674" fill="#101828" font-family="'Geist',sans-serif" font-size="12">No fallback between modes. Failed validation retains evidence; abort requires no retained work.</text>
|
|
78
|
-
</svg>
|