@ucsandman/legcli 0.7.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.
Files changed (184) hide show
  1. package/CHANGELOG.md +560 -0
  2. package/LICENSE +58 -0
  3. package/NOTICE +4 -0
  4. package/README.md +558 -0
  5. package/bin/fake-agent.mjs +143 -0
  6. package/bin/leg.mjs +449 -0
  7. package/docs/DECISIONS.md +119 -0
  8. package/docs/DEMO.md +214 -0
  9. package/docs/DEVIATIONS.md +182 -0
  10. package/docs/ERRORS.md +326 -0
  11. package/docs/README.md +40 -0
  12. package/docs/REUSE.md +289 -0
  13. package/docs/ROADMAP-v2.md +55 -0
  14. package/docs/VOCABULARY.md +243 -0
  15. package/docs/adapters.md +300 -0
  16. package/docs/board-guide.md +579 -0
  17. package/docs/cli-contracts.md +401 -0
  18. package/docs/concepts.md +426 -0
  19. package/docs/configuration.md +220 -0
  20. package/docs/faq.md +206 -0
  21. package/docs/getting-started.md +251 -0
  22. package/docs/real-run.md +80 -0
  23. package/docs/review-2026-09-14.md +72 -0
  24. package/docs/screenshots/board-400px.png +0 -0
  25. package/docs/screenshots/board-details-open.png +0 -0
  26. package/docs/screenshots/board-done.png +0 -0
  27. package/docs/screenshots/board-drawer.png +0 -0
  28. package/docs/screenshots/board-empty.png +0 -0
  29. package/docs/screenshots/board-handoff.png +0 -0
  30. package/docs/screenshots/board-running.png +0 -0
  31. package/docs/screenshots/demo-1-claude-running.png +0 -0
  32. package/docs/screenshots/demo-2-limit-hit.png +0 -0
  33. package/docs/screenshots/demo-3-handoff-bundle.png +0 -0
  34. package/docs/screenshots/demo-4-codex-running.png +0 -0
  35. package/docs/screenshots/demo-5-done.png +0 -0
  36. package/docs/screenshots/floor-final-1280.png +0 -0
  37. package/docs/screenshots/floor-final-400.png +0 -0
  38. package/docs/screenshots/floor-landing.png +0 -0
  39. package/docs/screenshots/floor.png +0 -0
  40. package/docs/screenshots/share-guest-1280.png +0 -0
  41. package/docs/screenshots/share-owner-1280.png +0 -0
  42. package/docs/screenshots/terminals-1280.png +0 -0
  43. package/docs/screenshots/thumb-done.jpg +0 -0
  44. package/docs/screenshots/thumb-handoff-details.jpg +0 -0
  45. package/docs/screenshots/thumb-limit-hit.jpg +0 -0
  46. package/docs/screenshots/youtube-thumbnail.jpg +0 -0
  47. package/fixtures/limits/agy/agy-resource-exhausted.json +11 -0
  48. package/fixtures/limits/claude/claude-budget-limit.json +11 -0
  49. package/fixtures/limits/claude/claude-max-turns.json +11 -0
  50. package/fixtures/limits/claude/claude-model-limit.json +11 -0
  51. package/fixtures/limits/claude/claude-session-limit.json +11 -0
  52. package/fixtures/limits/claude/claude-weekly-limit.json +11 -0
  53. package/fixtures/limits/codex/codex-quota-exceeded.json +11 -0
  54. package/fixtures/limits/codex/codex-rate-limit-exceeded.json +11 -0
  55. package/fixtures/limits/codex/codex-skills-notice.json +11 -0
  56. package/fixtures/limits/codex/codex-usage-limit-reached.json +11 -0
  57. package/fixtures/limits/codex/codex-usage-limit.json +11 -0
  58. package/fixtures/limits/generic/generic-429.json +11 -0
  59. package/fixtures/limits/generic/generic-overloaded.json +11 -0
  60. package/fixtures/limits/generic/generic-quota.json +11 -0
  61. package/fixtures/limits/generic/generic-rate-limit.json +11 -0
  62. package/fixtures/limits/generic/generic-resource-exhausted.json +11 -0
  63. package/fixtures/limits/generic/generic-usage-limit.json +11 -0
  64. package/fixtures/limits/grok/grok-not-logged-in.json +11 -0
  65. package/fixtures/limits/negative/auth-source-set.json +11 -0
  66. package/fixtures/limits/negative/compile-error.json +11 -0
  67. package/fixtures/limits/negative/empty-stdout-exit-0.json +11 -0
  68. package/fixtures/live/agy/attempt-1-scratch-workspace.out.log +1 -0
  69. package/fixtures/live/agy/cmd.txt +1 -0
  70. package/fixtures/live/agy/err.log +0 -0
  71. package/fixtures/live/agy/out.log +1 -0
  72. package/fixtures/live/agy/parsed.json +5 -0
  73. package/fixtures/live/agy/run.json +18 -0
  74. package/fixtures/live/agy/supervisor.log +2 -0
  75. package/fixtures/live/claude/cmd.txt +1 -0
  76. package/fixtures/live/claude/err.log +0 -0
  77. package/fixtures/live/claude/limit-rate_limit.json +21 -0
  78. package/fixtures/live/claude/out.log +1 -0
  79. package/fixtures/live/claude/parsed.json +11 -0
  80. package/fixtures/live/claude/run.json +18 -0
  81. package/fixtures/live/claude/supervisor.log +2 -0
  82. package/fixtures/live/codex/cmd.txt +1 -0
  83. package/fixtures/live/codex/err.log +1 -0
  84. package/fixtures/live/codex/last.md +2 -0
  85. package/fixtures/live/codex/limit-usage_limit_exceeded.json +25 -0
  86. package/fixtures/live/codex/out.log +8 -0
  87. package/fixtures/live/codex/parsed.json +15 -0
  88. package/fixtures/live/codex/run.json +18 -0
  89. package/fixtures/live/codex/supervisor.log +2 -0
  90. package/fixtures/live/grok/cmd.txt +1 -0
  91. package/fixtures/live/grok/err.log +32 -0
  92. package/fixtures/live/grok/out.log +7 -0
  93. package/fixtures/live/grok/parsed.json +5 -0
  94. package/fixtures/live/grok/run.json +18 -0
  95. package/fixtures/live/grok/supervisor.log +2 -0
  96. package/fixtures/verified.json +34 -0
  97. package/package.json +68 -0
  98. package/scripts/board-shots.mjs +69 -0
  99. package/scripts/build-docs-site.mjs +308 -0
  100. package/scripts/check-claims.mjs +150 -0
  101. package/scripts/clean-clone-check.sh +42 -0
  102. package/scripts/license-sign.mjs +23 -0
  103. package/scripts/limits-table.mjs +38 -0
  104. package/scripts/live-limits.mjs +36 -0
  105. package/scripts/privacy-check.mjs +63 -0
  106. package/scripts/probe.mjs +92 -0
  107. package/scripts/seed-fake-cards.mjs +34 -0
  108. package/scripts/seed-floor-board.mjs +69 -0
  109. package/scripts/seed-wes-board.mjs +91 -0
  110. package/scripts/stripe-setup.mjs +99 -0
  111. package/scripts/vercel-env.mjs +40 -0
  112. package/src/accounts.mjs +119 -0
  113. package/src/adapters/agy.mjs +56 -0
  114. package/src/adapters/claude.mjs +54 -0
  115. package/src/adapters/codex.mjs +73 -0
  116. package/src/adapters/common.mjs +32 -0
  117. package/src/adapters/fake.mjs +48 -0
  118. package/src/adapters/grok.mjs +51 -0
  119. package/src/adapters/index.mjs +27 -0
  120. package/src/adapters/resolve.mjs +40 -0
  121. package/src/attach.mjs +592 -0
  122. package/src/auth.mjs +85 -0
  123. package/src/board/board.css +543 -0
  124. package/src/board/board.js +1307 -0
  125. package/src/board/favicon.svg +1 -0
  126. package/src/board/floor.html +127 -0
  127. package/src/board/floor.js +670 -0
  128. package/src/board/fonts/OFL-atkinson-hyperlegible-next.txt +93 -0
  129. package/src/board/fonts/OFL-azeret-mono.txt +94 -0
  130. package/src/board/fonts/atkinson-board.woff2 +0 -0
  131. package/src/board/fonts/azeret-board.woff2 +0 -0
  132. package/src/board/index.html +251 -0
  133. package/src/board/sessions.js +1451 -0
  134. package/src/bundle.mjs +103 -0
  135. package/src/cards.mjs +114 -0
  136. package/src/chain.mjs +264 -0
  137. package/src/commands.mjs +79 -0
  138. package/src/contract.mjs +73 -0
  139. package/src/env.mjs +19 -0
  140. package/src/fsx.mjs +72 -0
  141. package/src/git-snapshot.mjs +152 -0
  142. package/src/handoff.mjs +171 -0
  143. package/src/hook.mjs +49 -0
  144. package/src/land.mjs +106 -0
  145. package/src/launcher.mjs +272 -0
  146. package/src/leases.mjs +86 -0
  147. package/src/ledger.mjs +369 -0
  148. package/src/license.mjs +168 -0
  149. package/src/limits.mjs +97 -0
  150. package/src/live-capture.mjs +69 -0
  151. package/src/mergequeue.mjs +225 -0
  152. package/src/orchestrator.mjs +365 -0
  153. package/src/pipeline.mjs +100 -0
  154. package/src/preferences.mjs +47 -0
  155. package/src/presets.mjs +23 -0
  156. package/src/ratelimit.mjs +49 -0
  157. package/src/redact.mjs +47 -0
  158. package/src/resume.mjs +354 -0
  159. package/src/runner.mjs +438 -0
  160. package/src/scheduler.mjs +118 -0
  161. package/src/server.mjs +845 -0
  162. package/src/session-detail.mjs +129 -0
  163. package/src/sessions.mjs +202 -0
  164. package/src/share.mjs +163 -0
  165. package/src/stations/agent.mjs +42 -0
  166. package/src/stations/build.mjs +9 -0
  167. package/src/stations/human.mjs +5 -0
  168. package/src/stations/land.mjs +6 -0
  169. package/src/stations/plan.mjs +8 -0
  170. package/src/stations/pr.mjs +31 -0
  171. package/src/stations/review.mjs +8 -0
  172. package/src/stations/test.mjs +27 -0
  173. package/src/store.mjs +90 -0
  174. package/src/sync/dashclaw.mjs +70 -0
  175. package/src/sync/index.mjs +54 -0
  176. package/src/sync/workboard.mjs +54 -0
  177. package/src/taps/agy.mjs +64 -0
  178. package/src/taps/claude-usage.mjs +67 -0
  179. package/src/taps/claude.mjs +170 -0
  180. package/src/taps/codex.mjs +286 -0
  181. package/src/trust.mjs +323 -0
  182. package/src/usage.mjs +179 -0
  183. package/src/wait.mjs +30 -0
  184. package/src/worktree.mjs +207 -0
@@ -0,0 +1,93 @@
1
+ Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,94 @@
1
+ Copyright 2021 The Azeret Project Authors (https://github.com/displaay/azeret)
2
+
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is copied below, and is also available with a FAQ at:
6
+ https://scripts.sil.org/OFL
7
+
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font creation
16
+ efforts of academic and linguistic communities, and to provide a free and
17
+ open framework in which fonts may be shared and improved in partnership
18
+ with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply
27
+ to any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software components as
38
+ distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to, deleting,
41
+ or substituting -- in part or in whole -- any of the components of the
42
+ Original Version, by changing formats or by porting the Font Software to a
43
+ new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
51
+ redistribute, and sell modified and unmodified copies of the Font
52
+ Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components,
55
+ in Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the corresponding
66
+ Copyright Holder. This restriction only applies to the primary font name as
67
+ presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created
79
+ using the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,251 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
6
+ <title>Leg</title>
7
+ <link rel="icon" href="/favicon.svg" type="image/svg+xml">
8
+ <link rel="stylesheet" href="board.css">
9
+ </head>
10
+ <body>
11
+
12
+ <!-- board.js rewrites this line from the live bind address the moment the SSE
13
+ hello lands. The markup is static and cannot know the port, so it names
14
+ none: a sentence that says 4747 on a board bound to 4863 is worse than a
15
+ sentence that says nothing about where. -->
16
+ <div class="banner" id="banner" role="status" hidden>Connecting to Leg.</div>
17
+
18
+ <div class="wrap">
19
+
20
+ <header class="masthead">
21
+ <p class="brand"><span class="brand-glyph" aria-hidden="true">🦿</span> Leg</p>
22
+ <div class="masthead-right">
23
+ <div class="sse-status" role="status">
24
+ <span class="sse-word" id="sse-text">connecting</span>
25
+ <span class="sse-rule is-connecting" id="sse-dot" aria-hidden="true"></span>
26
+ </div>
27
+ <div class="sched-status" id="sched-status"></div>
28
+ <a class="floor-link" href="/floor">Floor</a>
29
+ </div>
30
+ </header>
31
+
32
+ <!-- The largest thing on the board is a sentence, not a number. sessions.js
33
+ writes both lines from the live view: the headline names the one fact
34
+ that decides what happens next, and the line under it carries the
35
+ staleness, because a reading taken two hours ago is a floor and never a
36
+ measurement. -->
37
+ <section class="verdict" aria-label="What the board says">
38
+ <h1 id="verdict-line">Reading the logins.</h1>
39
+ <p id="verdict-sub"></p>
40
+ </section>
41
+
42
+ <section class="logins" id="accounts" aria-label="Logins"></section>
43
+ <p class="head-caption" id="head-caption">Times are local.</p>
44
+
45
+ <section class="region-terminals" aria-labelledby="terminals-head">
46
+ <div class="section-head">
47
+ <h2 id="terminals-head">Terminals</h2>
48
+ <!-- the one ranked verdict for the whole region, and the only live region
49
+ on the board that carries product signal rather than connection
50
+ state. It changes only when the counts change, so it cannot chatter. -->
51
+ <p class="region-meta" role="status" aria-atomic="true"></p>
52
+ <!-- a fact true of every terminal is a property of the board, not of any
53
+ row, so it is said once here instead of once per row -->
54
+ <p class="hoisted" id="terminals-hoisted" hidden></p>
55
+ <span class="chip" id="whoami" hidden></span>
56
+ </div>
57
+ <div class="panel terms" id="session-grid"></div>
58
+ <p class="empty-line" hidden>No terminal is running. Start one in any repo: <code>leg claude</code>, <code>leg codex</code> or <code>leg agy</code>. It appears here within a second of the agent's first turn.</p>
59
+ </section>
60
+
61
+ <!-- Finished terminals, what landed, and what is queued are all history or
62
+ background. They sit on the ground rather than on a panel, because a
63
+ raised surface here would compete with the terminals that are live. -->
64
+ <section class="ledger" aria-label="Finished and background work">
65
+
66
+ <div class="ledger-cell region-finished">
67
+ <h3 id="finished-head">No finished terminals</h3>
68
+ <p class="region-meta"></p>
69
+ <div class="ledger-actions" id="finished-actions"></div>
70
+ </div>
71
+
72
+ <div class="ledger-cell region-trunk">
73
+ <h3 id="trunk-head">Nothing landed yet</h3>
74
+ <p class="region-meta"></p>
75
+ <div class="ledger-actions" id="trunk-actions"></div>
76
+ </div>
77
+
78
+ <div class="ledger-cell" id="board">
79
+ <h3 id="cards-head">No background tasks</h3>
80
+ <p class="region-meta"></p>
81
+ <div class="ledger-actions">
82
+ <button type="button" class="btn btn-secondary" id="new-card-btn">New card</button>
83
+ </div>
84
+ <p class="empty-line" id="empty-state" hidden>A card runs an agent headless in its own worktree. <button type="button" class="btn btn-text" id="empty-new-card-btn">New card</button> queues one.</p>
85
+ </div>
86
+
87
+ </section>
88
+
89
+ <div class="drawer" id="finished-drawer" hidden>
90
+ <h3 class="drawer-head" id="finished-drawer-head">Finished terminals</h3>
91
+ <div class="finished-list" id="finished-list"></div>
92
+ <p class="drawer-note">A terminal is lost when the board stops hearing from it. Its handoff bundle is kept either way.</p>
93
+ </div>
94
+
95
+ <div class="drawer" id="trunk-drawer" hidden>
96
+ <h3 class="drawer-head" id="trunk-drawer-head">Landed on main</h3>
97
+ <div class="trunk-list" id="trunk"></div>
98
+ </div>
99
+
100
+ <div class="drawer" id="cards-drawer" hidden>
101
+ <h3 class="drawer-head">Background tasks</h3>
102
+ <div class="card-list" id="columns"></div>
103
+ </div>
104
+
105
+ <section class="region-settings" aria-labelledby="settings-head">
106
+ <div class="section-head section-head--quiet">
107
+ <h2 id="settings-head">Settings</h2>
108
+ <p class="region-meta"></p>
109
+ <button type="button" class="btn btn-secondary disclosure" aria-expanded="false" aria-controls="settings-body">Show settings</button>
110
+ </div>
111
+ <div class="drawer settings-body" id="settings-body" hidden>
112
+ <div class="field" id="token-field" hidden>
113
+ <label for="token-input">API token</label>
114
+ <input type="password" id="token-input" autocomplete="off" spellcheck="false">
115
+ <button type="button" class="btn btn-secondary" id="token-show">Show</button>
116
+ <!-- the address belongs to the region meta above, which board.js writes
117
+ from the live bind. Naming it twice from two sources printed two
118
+ different servers in one panel, and on a board that refused the
119
+ first request there is no address above to point at. -->
120
+ <p class="field-help">Stored in this browser's localStorage and sent as a bearer token with every request. Clear the field to sign out.</p>
121
+ </div>
122
+ <fieldset class="default-order" id="default-order" hidden>
123
+ <legend>New terminal handoff order</legend>
124
+ <p class="field-help">Used by terminals started after you save.</p>
125
+ <div id="default-order-list"></div>
126
+ <button type="button" class="btn btn-secondary" id="default-order-save">Save default</button>
127
+ <span class="field-status" id="default-order-status" aria-live="polite"></span>
128
+ </fieldset>
129
+ <div class="field board-facts"></div>
130
+ </div>
131
+ </section>
132
+
133
+ </div><!-- /.wrap -->
134
+
135
+ <div class="detail" id="drawer" hidden aria-hidden="true">
136
+ <div class="detail-inner">
137
+ <button type="button" class="btn btn-secondary" id="drawer-close" aria-label="Close card details">Close</button>
138
+ <div id="drawer-content"></div>
139
+ </div>
140
+ </div>
141
+
142
+ <div class="detail" id="session-drawer" hidden role="region" aria-label="What this terminal is doing">
143
+ <div class="detail-inner" id="session-drawer-content"></div>
144
+ </div>
145
+
146
+ <dialog id="new-card-dialog" aria-label="New card">
147
+ <h2 class="dialog-title">New background card</h2>
148
+ <p class="dialog-intro">An agent works without an interactive terminal in a separate git worktree. The default Build workflow stops with changes in that worktree and does not merge them.</p>
149
+ <form id="new-card-form">
150
+ <div class="form-error" id="new-card-error" hidden></div>
151
+
152
+ <div class="form-row">
153
+ <label for="nc-repo">Repo path</label>
154
+ <input type="text" id="nc-repo" required autocomplete="off">
155
+ </div>
156
+
157
+ <div class="form-row">
158
+ <label for="nc-task">Task</label>
159
+ <span class="field-help">Describe one concrete outcome the agent can finish.</span>
160
+ <textarea id="nc-task" rows="3" required></textarea>
161
+ </div>
162
+
163
+ <div class="form-row">
164
+ <label for="nc-first-agent">First agent</label>
165
+ <select id="nc-first-agent" required></select>
166
+ <span class="field-help" id="nc-fallback-summary">If it cannot continue, Leg tries the fallback agents shown under Advanced options.</span>
167
+ </div>
168
+
169
+ <div class="form-row">
170
+ <label for="nc-queue">
171
+ <input type="checkbox" id="nc-queue" checked>
172
+ Run now
173
+ </label>
174
+ <span class="field-help">Turn this off to save a draft in Backlog.</span>
175
+ </div>
176
+
177
+ <details class="advanced-options">
178
+ <summary>Advanced options</summary>
179
+
180
+ <div class="form-row">
181
+ <label for="nc-pipeline">Workflow</label>
182
+ <select id="nc-pipeline">
183
+ <option value="build" selected>Build only, stop with worktree changes</option>
184
+ <option value="build-land">Build, test, and merge automatically</option>
185
+ <option value="factory">Plan, build, review, test, and merge automatically</option>
186
+ <option value="custom">Custom workflow JSON</option>
187
+ </select>
188
+ <textarea id="nc-custom-pipeline" rows="4" hidden aria-label="Custom workflow JSON" placeholder='[{"name":"build","kind":"agent"}]'></textarea>
189
+ </div>
190
+
191
+ <div class="form-row">
192
+ <label>First-agent permissions and limits</label>
193
+ <div id="nc-first-controls"></div>
194
+ </div>
195
+
196
+ <div class="form-row">
197
+ <label>Fallback agents</label>
198
+ <span class="field-help">Leg tries each row in order only when the agent before it cannot continue.</span>
199
+ <div id="nc-chain-rows"></div>
200
+ <button type="button" class="btn btn-secondary" id="nc-add-row">Add fallback agent</button>
201
+ </div>
202
+
203
+ <div class="form-row">
204
+ <label for="nc-test-adapter">Scripted first agent (test/demo only)</label>
205
+ <select id="nc-test-adapter"><option value="">Use the real first agent above</option></select>
206
+ </div>
207
+
208
+ <div class="form-row">
209
+ <label for="nc-leases">File leases</label>
210
+ <span class="field-help">Comma-separated paths to reserve so another overlapping card waits.</span>
211
+ <input type="text" id="nc-leases">
212
+ </div>
213
+
214
+ <div class="form-row">
215
+ <label for="nc-trunk">Trunk branch</label>
216
+ <input type="text" id="nc-trunk" value="main">
217
+ </div>
218
+
219
+ <div class="form-row">
220
+ <label for="nc-land-mode">Merge method</label>
221
+ <select id="nc-land-mode">
222
+ <option value="ff" selected>Fast-forward trunk</option>
223
+ <option value="pr">Open a pull request</option>
224
+ </select>
225
+ </div>
226
+
227
+ <div class="form-row">
228
+ <label for="nc-test-command">Test command</label>
229
+ <input type="text" id="nc-test-command">
230
+ </div>
231
+
232
+ <div class="form-row">
233
+ <label for="nc-title">Card title</label>
234
+ <span class="field-help">Optional. Leg derives one from the task when blank.</span>
235
+ <input type="text" id="nc-title">
236
+ </div>
237
+ </details>
238
+
239
+ <div class="dialog-actions">
240
+ <button type="button" class="btn btn-secondary" id="nc-cancel">Cancel</button>
241
+ <button type="submit" class="btn btn-primary">Create card</button>
242
+ </div>
243
+ </form>
244
+ </dialog>
245
+
246
+ <div class="sysmsg" id="toast" aria-live="polite"></div>
247
+
248
+ <script src="board.js" defer></script>
249
+ <script src="sessions.js" defer></script>
250
+ </body>
251
+ </html>