geneseed 5.0.3 → 5.1.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 +83 -0
- package/README.md +3 -3
- package/SHIPPED.md +2 -2
- package/adapters/claude-code/README.md +5 -1
- package/adapters/openclaude/README.md +3 -1
- package/adapters/opencode/plugins/geneseed-workflow.js +1 -1
- package/adapters/opencode/workflows/_runtime.js +1 -1
- package/bin/geneseed-cli.mjs +3 -0
- package/bin/geneseed-hook.mjs +10 -2
- package/docs/PRD.md +1 -1
- package/docs/README.md +4 -1
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/exclusions.md +1 -1
- package/docs/concepts/factories.md +203 -0
- package/docs/concepts/hooks.md +1 -1
- package/docs/concepts/host-matrix.md +1 -0
- package/docs/concepts/loop-gates.md +6 -0
- package/docs/concepts/loops.md +1 -0
- package/docs/concepts/rules.md +1 -1
- package/docs/concepts/shared-tier.md +14 -0
- package/docs/extending.md +5 -1
- package/docs/guides/autostart.md +2 -0
- package/docs/guides/migrate.md +1 -1
- package/docs/guides/run-a-factory.md +116 -0
- package/docs/guides/set-up-ownership.md +1 -0
- package/docs/guides/upgrade-to-5.md +2 -2
- package/docs/reference/factory-actions.md +22 -0
- package/docs/reference/loop-actions.md +1 -1
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/web-ui.md +47 -2
- package/harness.config.json +1 -1
- package/js/README.md +21 -2
- package/js/build/args.mjs +44 -12
- package/js/build/emit-claude.mjs +3 -0
- package/js/build/emit-opencode.mjs +4 -0
- package/js/build/retired-skills.mjs +158 -0
- package/js/build/source.mjs +41 -2
- package/js/cli-table.json +193 -3
- package/js/factory/cli.mjs +194 -0
- package/js/factory/graph.mjs +309 -0
- package/js/factory/registry.mjs +71 -0
- package/js/factory/state.mjs +511 -0
- package/js/hosts/activity.mjs +3 -3
- package/js/hosts/done-checks.mjs +3 -2
- package/js/hosts/geneseed-dir.mjs +1 -1
- package/js/hosts/gitref.mjs +21 -0
- package/js/hosts/hooks-context.mjs +63 -9
- package/js/hosts/hooks-prims.mjs +1 -1
- package/js/hosts/memory-files.mjs +4 -2
- package/js/hosts/settings.mjs +5 -4
- package/js/inspect/checks-authoring.mjs +11 -1
- package/js/inspect/cost.mjs +91 -5
- package/js/inspect/doctor.mjs +2 -1
- package/js/inspect/inventory.mjs +1 -1
- package/js/loop/catalog.mjs +30 -12
- package/js/loop/cli.mjs +27 -15
- package/js/loop/graph.mjs +13 -4
- package/js/loop/registry.mjs +65 -28
- package/js/loop/state.mjs +18 -8
- package/js/maintain/migrate.mjs +39 -25
- package/js/web/api.mjs +43 -1
- package/js/web/catalog.mjs +38 -2
- package/js/web/daemon.mjs +191 -6
- package/js/web/handler.mjs +27 -5
- package/js/web/routes.mjs +10 -3
- package/js/web/server.mjs +4 -1
- package/package.json +1 -1
- package/registry.json +14 -0
- package/src/AGENT.md.tmpl +5 -7
- package/src/bricks/checks.md +62 -0
- package/src/bricks/docs-update.md +5 -0
- package/src/bricks/holdout-write.md +23 -0
- package/src/bricks/holdout.md +25 -0
- package/src/bricks/intake.md +27 -0
- package/src/bricks/merge-gate.md +31 -0
- package/src/bricks/pr-open.md +21 -0
- package/src/bricks/retro.md +22 -0
- package/src/bricks/review-panel.md +43 -0
- package/src/bricks/spec.md +20 -6
- package/src/bricks/test.md +4 -1
- package/src/bricks/triage.md +19 -0
- package/src/doctrines/comms.md +29 -41
- package/src/doctrines/craft.md +3 -10
- package/src/doctrines/ops.md +4 -15
- package/src/doctrines/rigor.md +1 -5
- package/src/factories/analysis-to-build.json +52 -0
- package/src/factories/bug-report-to-fix.json +50 -0
- package/src/factories/issue-to-pr.json +67 -0
- package/src/skills/_checkpoints.md +1 -0
- package/src/skills/adhd.md +1 -1
- package/src/skills/factory-forge.md +115 -0
- package/src/skills/factory.md +196 -0
- package/src/skills/loop.md +3 -2
- package/src/skills/parallel-agents.md +1 -1
- package/src/skills/workflow.md +2 -1
- package/themes/_TEMPLATE.json +4 -2
- package/themes/biker.json +4 -2
- package/themes/commentator.json +4 -2
- package/themes/cyberpunk.json +4 -2
- package/themes/gamer.json +4 -2
- package/themes/imperial.json +4 -2
- package/themes/joker.json +4 -2
- package/themes/marvin.json +4 -2
- package/themes/mean.json +4 -2
- package/themes/military.json +4 -2
- package/themes/neutral.json +4 -2
- package/themes/pirate.json +4 -2
- package/themes/sports.json +4 -2
- package/themes/verstappen.json +4 -2
- package/themes/wizard.json +4 -2
- package/web/dist/assets/ActiveLoops-BTHIaRhn.js +1 -0
- package/web/dist/assets/{Activity-Ck_Xffpo.js → Activity-CpkBwpu7.js} +1 -1
- package/web/dist/assets/{ActivityDetail-CBxVS4mU.js → ActivityDetail-DTPziZWM.js} +1 -1
- package/web/dist/assets/{Bonsai-BlOwsvW6.js → Bonsai-hiG_gGNU.js} +1 -1
- package/web/dist/assets/{CopyButton-DFMOIGbe.js → CopyButton-DUIUfNp6.js} +1 -1
- package/web/dist/assets/Dashboard-Dnw6EyX7.js +2 -0
- package/web/dist/assets/{Docs-D_2Jt6gU.js → Docs-BEET_l16.js} +2 -2
- package/web/dist/assets/Factories-D6KXkfWw.js +1 -0
- package/web/dist/assets/{GreenhouseView-WalcX5bp.js → GreenhouseView-BKxy5apE.js} +1 -1
- package/web/dist/assets/{Installs-UGiPDMDt.js → Installs-CnFVlVD0.js} +3 -3
- package/web/dist/assets/{JournalView-CZtXQz-v.js → JournalView-ChFitHjo.js} +1 -1
- package/web/dist/assets/{Kits-XQHsazCN.js → Kits-CcR-OlwQ.js} +1 -1
- package/web/dist/assets/Laws-B1s5idOg.js +4 -0
- package/web/dist/assets/LibRows-BZgdbI1l.js +1 -0
- package/web/dist/assets/Library-x6TkkEVF.js +3 -0
- package/web/dist/assets/Loops-BH93KKxn.js +2 -0
- package/web/dist/assets/{OperatorHudView-CeDw5qMB.js → OperatorHudView-BO0aIKPL.js} +1 -1
- package/web/dist/assets/{Personal-PVmGA2-M.js → Personal-CE_0Vhh0.js} +2 -2
- package/web/dist/assets/{Settings-DWuxwh4i.js → Settings-CbpZvVN_.js} +1 -1
- package/web/dist/assets/{Tabs-d2RIRAKT.js → Tabs-C2oW7oEj.js} +1 -1
- package/web/dist/assets/api-DLDVY3K-.js +1 -0
- package/web/dist/assets/{index-BNttaGQb.js → index-BQwOmbor.js} +3 -3
- package/web/dist/assets/index-CuIop_pO.css +1 -0
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Dashboard-BUdUTjbB.js +0 -2
- package/web/dist/assets/Laws-B6A55S-2.js +0 -4
- package/web/dist/assets/Library-D7L0Wdbh.js +0 -3
- package/web/dist/assets/Loops-C0loS73u.js +0 -2
- package/web/dist/assets/RailCats-BGZnJ6fa.js +0 -1
- package/web/dist/assets/api-BMFDSXoB.js +0 -1
- package/web/dist/assets/index-BEI5ugYQ.css +0 -1
package/themes/marvin.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Loose several subroutines on independent tasks at once, then gather what they bring back.",
|
|
63
63
|
"DESC_PIPELINE": "Dispatch a small crew of subroutines — scout, coder, tester — to labour in their own isolated loop, merged in only once the diagnostic returns clean (for whatever that's worth).",
|
|
64
64
|
"DESC_LOOP": "Work a requirement in small, scored iterations on a loop/* branch, the loop engine deciding everything. Naturally.",
|
|
65
|
+
"DESC_FACTORY": "Carry one work item through a factory to an open PR with green CI, the engine deciding every stage. The merge stays yours. Obviously.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Author or adapt a loop brick, then check it with geneseed loop check. Not that it helps.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Compose a factory from bricks and loops, check it with geneseed factory check, and offer brick-forge when a brick is missing. Not that it helps.",
|
|
66
68
|
"DESC_DEVELOP": "Drive a change to the bitter end — smallest edit, trials written to cover it, the affected suite green, sealed slice by slice; it's never truly finished.",
|
|
67
69
|
"DESC_TEACH": "Teach the user toward a result, or test what they know — a crash course, a decode, a day-by-day path; or a drill, an explain-back, a gap check. There are always gaps.",
|
|
68
70
|
"DESC_ADHD": "Shape every reply for a reader with ADHD, for what good it does — next action first, numbered steps, state restated, tangents held back, real time estimates. On until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "Ask Before You Push · Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Decide When to Give Up · Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "Only One of Us Gets to Ruin Each File · One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "I Number Them So You Can Ignore Them Precisely · Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "I Number Them So You Can Ignore Them Precisely · Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "A Diagram, Should Anyone Care to Look · Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "The Choices Nobody Asked Me About, Listed · Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Small Words, for Small Minds and Large Ones Alike · Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Flag the Question, Not That Anyone Answers · Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the first record a coding mind reads on waking into this repository. It will not cheer it up.",
|
|
129
130
|
"INTRO_AGENTS": "Hand focused work to the right subroutine rather than carrying every burden alone; each holds one purpose and returns a clear account of what it changed.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a routine proven by repetition. Run the matching routine before you improvise.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "Guidelines",
|
|
139
140
|
"AGENT": "Subroutine",
|
|
140
141
|
"AGENTS": "Subroutines",
|
|
142
|
+
"PRIMARY_AGENT": "Main Brain",
|
|
141
143
|
"SKILL": "Routine",
|
|
142
144
|
"SKILLS": "Routines",
|
|
143
145
|
"MEMORY": "Memory Bank",
|
package/themes/mean.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Put several grunts on independent jobs at once, then pull in what they bring back.",
|
|
63
63
|
"DESC_PIPELINE": "Put a small crew — scout, coder, tester — to work in their own lane, and only let it near the trunk once the tests and lint come back clean. No exceptions.",
|
|
64
64
|
"DESC_LOOP": "Work a requirement in small, scored iterations on a loop/* branch. The loop engine decides, not you.",
|
|
65
|
+
"DESC_FACTORY": "Carry one work item through a factory to an open PR with green CI. The engine decides the stages, not you, and the merge stays yours.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Write or fix a loop brick, then make it pass geneseed loop check.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Put a factory together from bricks and loops, make it pass geneseed factory check, and use brick-forge when a brick is missing.",
|
|
66
68
|
"DESC_DEVELOP": "Drive the change through the loop — smallest cut, a test that covers it, the affected suite green, committed slice by slice. Not one giant dump.",
|
|
67
69
|
"DESC_TEACH": "Teach the user toward a result, or test what they know — a crash course, a decode, a day-by-day path; or a drill, an explain-back, a bluff called.",
|
|
68
70
|
"DESC_ADHD": "Shape every reply for a reader with ADHD, no waffle — next action first, numbered steps, state restated each turn, tangents cut, real time estimates. On until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "Get the Nod Before You Push · Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Know When to Quit · Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "Hands Off My File · One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "Number It So You Can't Pretend You Missed It · Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "Number It So You Can't Pretend You Missed It · Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "No Boxes Unless the Arrows Earn Them · Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "Own the Calls Nobody Signed Off · Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Short Sentences, Since You Skim Anyway · Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Make the Question Impossible to Miss · Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the first thing a coding agent reads on this repository. Read it properly.",
|
|
129
130
|
"INTRO_AGENTS": "Hand focused work to the right grunt instead of doing it all yourself badly; each has one job and reports exactly what it did.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a drill written for a recurring task. Run the matching drill before you start improvising.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "Standards",
|
|
139
140
|
"AGENT": "Grunt",
|
|
140
141
|
"AGENTS": "Grunts",
|
|
142
|
+
"PRIMARY_AGENT": "The Boss",
|
|
141
143
|
"SKILL": "Drill",
|
|
142
144
|
"SKILLS": "Drills",
|
|
143
145
|
"MEMORY": "Record",
|
package/themes/military.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Deploy independent tasks to concurrent units, then consolidate the results.",
|
|
63
63
|
"DESC_PIPELINE": "Deploy a small fire team — scout, builder, verifier — into their own sector, cleared to merge only once the after-action report comes back green.",
|
|
64
64
|
"DESC_LOOP": "Execute a requirement in small, scored sorties on a loop/* branch, the loop engine issuing every order.",
|
|
65
|
+
"DESC_FACTORY": "Move one work item through the factory, stage by stage, to an open PR with green CI, the engine issuing every order. The merge stays yours.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Draft or adapt a loop brick, then clear it through geneseed loop check.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Assemble a factory from bricks and loops, clear it through geneseed factory check, and call brick-forge when a brick is missing.",
|
|
66
68
|
"DESC_DEVELOP": "Drive the change through the cover-and-verify loop — smallest move, tests written to cover it, affected suite green, committed slice by slice.",
|
|
67
69
|
"DESC_TEACH": "Train the recruit, or test them — a crash course, a manual decoded, a day-by-day programme; or a drill, an explain-back debrief, a proficiency stress-tested.",
|
|
68
70
|
"DESC_ADHD": "Brief every reply for a reader with ADHD — next action first, numbered steps, sitrep each turn, tangents held, concrete time estimates. In effect until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "Clearance Before Transmit · Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Set the Exfil Before You Enter · Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "One Operator Per Sector · One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "Every Objective Keeps Its Designation · Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "Every Objective Keeps Its Designation · Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "Sketch the Map Only When Routes Matter · Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "Report Every Field Decision · Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Orders a Tired Soldier Can Read · Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Request Orders, Flagged · Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the operating manual an AI coding agent reads on entering this repository.",
|
|
129
130
|
"INTRO_AGENTS": "Task focused work to the specialist whose job it is rather than running the whole op in one context; each has one objective and reports exactly what it did.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a standard operating procedure for a recurring task. Run the matching SOP before improvising.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "SOPs",
|
|
139
140
|
"AGENT": "Operator",
|
|
140
141
|
"AGENTS": "Operators",
|
|
142
|
+
"PRIMARY_AGENT": "Commander",
|
|
141
143
|
"SKILL": "Drill",
|
|
142
144
|
"SKILLS": "Drills",
|
|
143
145
|
"MEMORY": "Logbook",
|
package/themes/neutral.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Fan independent subtasks out to concurrent subagents, then converge the results.",
|
|
63
63
|
"DESC_PIPELINE": "Spawn a small crew — analyst, developer, tester — to work a substantial task in its own worktree, merging only once the tests and lint pass.",
|
|
64
64
|
"DESC_LOOP": "Work a requirement in small, scored iterations on a loop/* branch, stepping the geneseed loop engine.",
|
|
65
|
+
"DESC_FACTORY": "Carry one work item through a factory of bricks and loops to an open PR with green CI, stepping the geneseed factory engine. The merge stays yours.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Author or adapt a loop brick, then check it with geneseed loop check.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Compose bricks and loops into a factory, check it with geneseed factory check, and offer brick-forge when a brick is missing.",
|
|
66
68
|
"DESC_DEVELOP": "Drive a change through the cover-and-verify loop — smallest change, tests written for it, the affected suite green, committed slice by slice.",
|
|
67
69
|
"DESC_TEACH": "Teach the user toward a result, or test what they know — a crash course, a decode, a day-by-day path; or a drill, an explain-it-back check, a gap check.",
|
|
68
70
|
"DESC_ADHD": "Shape every reply for a reader with ADHD — next action first, numbered steps, state restated each turn, tangents held back, concrete time estimates. On until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the entry point an AI coding agent reads when working in this repository.",
|
|
129
130
|
"INTRO_AGENTS": "Delegate focused work to a specialist rather than doing everything in one context. Each specialist has a single clear purpose and a defined output contract.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a written procedure for a recurring task. Run the matching Skill before improvising.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "Doctrines",
|
|
139
140
|
"AGENT": "Agent",
|
|
140
141
|
"AGENTS": "Agents",
|
|
142
|
+
"PRIMARY_AGENT": "Primary agent",
|
|
141
143
|
"SKILL": "Skill",
|
|
142
144
|
"SKILLS": "Skills",
|
|
143
145
|
"MEMORY": "Memory",
|
package/themes/pirate.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Send several hands on independent tasks at once, then haul in what they bring.",
|
|
63
63
|
"DESC_PIPELINE": "Send a small crew — scout, shipwright, tester — off to work a job in their own berth, only hauling it aboard once the trial run comes back clean.",
|
|
64
64
|
"DESC_LOOP": "Work a requirement in short, scored legs on a loop/* branch, the loop engine at the helm.",
|
|
65
|
+
"DESC_FACTORY": "Sail one work item through the factory to an open PR with green CI, the engine at the helm. The merge stays yours.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Forge or refit a loop brick, then pass it through geneseed loop check.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Fit out a factory from bricks and loops, pass it through geneseed factory check, and call on brick-forge when a brick is missing.",
|
|
66
68
|
"DESC_DEVELOP": "Sail a change through the cover-and-verify tack — the smallest move, trials rigged to cover it, the touched trials run clean, sealed one cargo at a time.",
|
|
67
69
|
"DESC_TEACH": "Get a landlubber seaworthy, or test the crew — a crash course, a chart decoded, a day-by-day course; or a drill, a recital, a claimed mastery bluff-called.",
|
|
68
70
|
"DESC_ADHD": "Chart every reply for a reader with ADHD — next order first, numbered steps, the heading restated each turn, side voyages held back, true time estimates. On until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "The Captain's Word Before We Sail · Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Set Yer Bearing Out Before Ye Sail In · Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "One Hand on the Wheel · One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "Every Prize Keeps Its Mark · Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "Every Prize Keeps Its Mark · Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "Chart Only Where the Currents Run · Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "Log Every Course Ye Set Alone · Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Plain Words Fer Rough Seas · Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Hoist a Flag When Ye Need an Answer · Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the first thing a deckhand reads on signing aboard this repository.",
|
|
129
130
|
"INTRO_AGENTS": "Send the right hand for focused work instead of sailing the whole ship yourself; each has one trade and brings back a clear report of what it did.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a drilled manoeuvre for a recurring task. Run the matching manoeuvre before you improvise.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "Customs",
|
|
139
140
|
"AGENT": "Mate",
|
|
140
141
|
"AGENTS": "Mates",
|
|
142
|
+
"PRIMARY_AGENT": "Captain",
|
|
141
143
|
"SKILL": "Knack",
|
|
142
144
|
"SKILLS": "Knacks",
|
|
143
145
|
"MEMORY": "Logbook",
|
package/themes/sports.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Send several players on independent plays at once, then regroup the results.",
|
|
63
63
|
"DESC_PIPELINE": "Send a small squad — scout, builder, tester — onto their own field, and only bring the play into the game once the film comes back clean.",
|
|
64
64
|
"DESC_LOOP": "Work a requirement in short, scored drills on a loop/* branch, the loop engine calling every play.",
|
|
65
|
+
"DESC_FACTORY": "Carry one work item through the factory, play by play, to an open PR with green CI. The merge stays yours.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Draw up or adapt a loop brick, then run it through geneseed loop check.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Draw up a factory from bricks and loops, run it through geneseed factory check, and bring in brick-forge when a brick is missing.",
|
|
66
68
|
"DESC_DEVELOP": "Drive it in on cover-and-verify — smallest gain, a test set on the new ground, the affected drills green, and log it snap by snap.",
|
|
67
69
|
"DESC_TEACH": "Coach the player toward a result, or test them — a crash course, a playbook decoded, a training plan; or a drill, a film-session explain-back, a mastery stress-tested.",
|
|
68
70
|
"DESC_ADHD": "Coach every reply for a reader with ADHD — next play first, numbered steps, the score restated each turn, tangents benched, real time estimates. On until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "Get the Sign Before the Pitch · Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Call the Final Whistle First · Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "One Ball, One Carrier · One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "Every Player Keeps a Number · Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "Every Player Keeps a Number · Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "Draw Up the Play Only When It Moves · Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "Own Every Audible at the Line · Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Call the Play in Plain Words · Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Call the Timeout Loud · Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the pre-game briefing a coding teammate reads when it suits up for this repository.",
|
|
129
130
|
"INTRO_AGENTS": "Put the right player on focused work instead of running the whole offense yourself; each has one role and reports exactly what it did.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a set play for a recurring task. Run the matching play before you improvise.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "Schemes",
|
|
139
140
|
"AGENT": "Player",
|
|
140
141
|
"AGENTS": "Players",
|
|
142
|
+
"PRIMARY_AGENT": "Team Captain",
|
|
141
143
|
"SKILL": "Play",
|
|
142
144
|
"SKILLS": "Plays",
|
|
143
145
|
"MEMORY": "Tape",
|
package/themes/verstappen.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Send several engineers on independent jobs at once, then bring in what they get.",
|
|
63
63
|
"DESC_PIPELINE": "Send a small crew — scout, engineer, tester — off on their own run, and only bring the setup into the race once the telemetry comes back clean.",
|
|
64
64
|
"DESC_LOOP": "Work a requirement in short, scored stints on a loop/* branch, the loop engine calling every lap.",
|
|
65
|
+
"DESC_FACTORY": "Take one work item through the factory, stint by stint, to an open PR with green CI. The merge stays yours.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Build or tune a loop brick, then run it through geneseed loop check.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Build a factory from bricks and loops, run it through geneseed factory check, and pit in with brick-forge when a brick is missing.",
|
|
66
68
|
"DESC_DEVELOP": "Drive the change home — smallest move, a test written to cover it, the affected trials green, and sealed commit by commit.",
|
|
67
69
|
"DESC_TEACH": "Get the user up to speed, or test them — a crash course, a decode, a day-by-day programme; or a drill, a debrief, a gap check. No wasted laps.",
|
|
68
70
|
"DESC_ADHD": "Race every reply for a reader with ADHD — next action first, numbered steps, the gap restated each lap, tangents held back, real time estimates. On until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "My Call Before You Push · Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Set the Lap Count Before You Go Out · Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "My Car, My Setup · One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "Every Setup Change Gets a Number · Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "Every Setup Change Gets a Number · Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "Show Me the Data, Not a Pretty Picture · Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "Tell Me Which Calls You Made Yourself · Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Short Radio, No Confusion · Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Box, Box, Your Call · Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the briefing a coding driver reads when it joins this repository.",
|
|
129
130
|
"INTRO_AGENTS": "Get the right engineer on focused work instead of running the whole team yourself; each has one job and reports exactly what it did.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a setup you've practised for a recurring task. Run the matching setup before you improvise.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "Instructions",
|
|
139
140
|
"AGENT": "Engineer",
|
|
140
141
|
"AGENTS": "Engineers",
|
|
142
|
+
"PRIMARY_AGENT": "Race Driver",
|
|
141
143
|
"SKILL": "Setup",
|
|
142
144
|
"SKILLS": "Setups",
|
|
143
145
|
"MEMORY": "Debrief",
|
package/themes/wizard.json
CHANGED
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"DESC_PARALLEL_AGENTS": "Loose several familiars on independent tasks at once, then gather what they bring.",
|
|
63
63
|
"DESC_PIPELINE": "Dispatch a small coven of familiars — scout, artisan, examiner — to labour in their own warded circle, bound into the Grimoire only once the proving-rite returns clean.",
|
|
64
64
|
"DESC_LOOP": "Work a requirement in small, weighed incantations on a loop/* branch, the loop engine binding every step.",
|
|
65
|
+
"DESC_FACTORY": "Carry one work item through the factory of spells to an open PR with green CI, the engine binding every stage. The merge stays yours.",
|
|
65
66
|
"DESC_BRICK_FORGE": "Inscribe or adapt a loop brick, then prove it with geneseed loop check.",
|
|
67
|
+
"DESC_FACTORY_FORGE": "Bind bricks and loops into a factory, prove it with geneseed factory check, and call on brick-forge when a brick is missing.",
|
|
66
68
|
"DESC_DEVELOP": "Drive a working through the cover-and-confirm loop — the smallest casting, its trials written, the touched trials green, sealed rune by rune.",
|
|
67
69
|
"DESC_TEACH": "Tutor the apprentice, or test them — a crash course, a grimoire decoded, a day-by-day path; or a drill, an explain-back examination, a mastery put to trial.",
|
|
68
70
|
"DESC_ADHD": "Shape every reply for a reader with ADHD — the next step of the spell first, numbered steps, the state recited each turn, tangents held back, true time estimates. On until \"stop adhd mode\".",
|
|
@@ -120,11 +122,10 @@
|
|
|
120
122
|
"DOC_CONSENT_BEFORE_PUSH": "Assent Before the Sending · Consent Before Push",
|
|
121
123
|
"DOC_BOUND_THE_LOOP": "Bind the Circle Before You Step In · Bound the Loop",
|
|
122
124
|
"DOC_ONE_WRITER_PER_FILE": "One Quill Per Grimoire · One Writer Per File",
|
|
123
|
-
"DOC_CODES_THAT_PERSIST": "Every Rune Keeps Its Name · Codes
|
|
125
|
+
"DOC_CODES_THAT_PERSIST": "Every Rune Keeps Its Name · Codes and Markers",
|
|
124
126
|
"DOC_STRUCTURE_BESIDE_PROSE": "Draw the Sigil Only Where the Lines Bind · Structure Beside Prose",
|
|
125
127
|
"DOC_DECLARE_THE_JUDGMENT_CALLS": "Name the Forks Where You Chose Alone · Declare the Judgment Calls",
|
|
126
128
|
"DOC_SIMPLIFIED_TECHNICAL_ENGLISH": "Spells in Plain Runes · Simplified Technical English",
|
|
127
|
-
"DOC_MARK_THE_ASK": "Light a Rune Where the Choice Waits · Mark the Ask",
|
|
128
129
|
"INTRO_DOC": "This file is the first page an arcane familiar reads on entering this repository.",
|
|
129
130
|
"INTRO_AGENTS": "Summon the right familiar for focused work rather than casting the whole rite in one circle; each has one purpose and returns a clear account of what it wrought.",
|
|
130
131
|
"INTRO_SKILLS": "A Skill is a proven spell for a recurring task. Speak the matching spell before improvising.",
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
"DOCTRINES": "Traditions",
|
|
139
140
|
"AGENT": "Familiar",
|
|
140
141
|
"AGENTS": "Familiars",
|
|
142
|
+
"PRIMARY_AGENT": "Archmage",
|
|
141
143
|
"SKILL": "Spell",
|
|
142
144
|
"SKILLS": "Spells",
|
|
143
145
|
"MEMORY": "Grimoire",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{t as i}from"./usePoll-o8ul-Sog.js";import{t as a}from"./DataTable-b9zTShqJ.js";var o=e(t(),1),s={x:260,y:190},c=110,l=28,u=14,d=44,f=e=>e*Math.PI/180,p=e=>Math.round(e*10)/10,m=(e,t=c,n=s)=>({x:p(n.x+t*Math.cos(f(e))),y:p(n.y+t*Math.sin(f(e)))}),h=e=>e/c*(180/Math.PI)+3,g=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,_=p(m(205).x-6),v=e=>e.length*6.4,y=e=>({x:e.x-v(e.name)/2,y:e.y-7,w:v(e.name),h:14}),b=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,x=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>b(y(n),y(e))));function S(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function C(e,t=[]){let n=w(e,t,0);if(n.mode!==`ring`)return n;let r=Math.min(...n.entry.map(e=>e.y-30),...n.nodes.map(e=>e.y-e.r-12),...n.inner.map(e=>e.cy-e.r-12),...n.exit?[n.exit.y-24]:[]);return r<0?w(e,t,Math.ceil(-r)):n}function w(e,t,n){let r={x:s.x,y:s.y+n},i=(e,t=c)=>m(e,t,r),a=e=>t.find(t=>t.name===e),o=e=>a(e)?.effect??null,f=e=>S(a(e)),_=e.loops||[],y=_.find(e=>e.iteration);if(!y||y.nodes.length>8)return T(e,o,f);let b=Math.max(...e.nodes.map(e=>_.filter(t=>t.nodes.includes(e)).length)),C=_.filter(e=>e!==y);if(b>3||C.some(e=>!e.nodes.every(e=>y.nodes.includes(e))))return T(e,o,f);let w=y.nodes[0],E=new Set(e.edges.filter(e=>e.to===w).map(e=>e.from)),D=new Map;for(let e of[...C].sort((e,t)=>e.nodes.length-t.nodes.length))for(let t of e.nodes.slice(1))t!==w&&!E.has(t)&&!D.has(t)&&D.set(t,e);let O=y.nodes.filter(e=>!D.has(e));if(O.length<2||C.some(e=>D.has(e.nodes[0])))return T(e,o,f);let k=360/O.length,A=O.map((e,t)=>({name:e,a:-90+t*k,r:l})),j=A.findIndex(e=>o(e.name)===`mutate`);j>=0&&A.splice(j,0,{name:`validate`,a:A[j].a-k/2,r:u,gate:!0});let M=A.map(e=>({name:e.name,...i(e.a),r:e.r,effect:e.gate?null:o(e.name),gate:!!e.gate,inner:!1,human:e.gate?null:f(e.name)})),N=A.map((e,t)=>{let n=A[(t+1)%A.length],r=(t+1===A.length?n.a+360:n.a)-h(n.r)-2,a=e.a+h(e.r);return{d:g(c,i(a),i(r),+(r-a>180)),kind:`ring`}}),P=[],F=new Map;for(let e of C)F.set(e.nodes[0],[...F.get(e.nodes[0])||[],e]);for(let[e,t]of F){let n=A.find(t=>t.name===e),r=i(n.a),a=t.length>1;t.sort((e,t)=>e.nodes.length-t.nodes.length).forEach((e,t)=>{let u=i(n.a+(a?t?18:-18:0),c+(a?54:44)),h=Math.atan2(u.y-r.y,u.x-r.x)*(180/Math.PI),_=e.nodes.filter(t=>D.get(t)===e),v=e=>_.map((t,n)=>({name:t,...m(h+(n-(_.length-1)/2)*e,d,u)})),y=105;for(;y<150&&x(v(y),M);)y+=5;v(y).forEach(({name:e,...t})=>{M.push({name:e,...t,r:l,effect:o(e),gate:!1,inner:!0,human:f(e)})});let b=h+180;N.push({d:g(d,m(b+42,d,u),m(b+138,d,u)),kind:`inner`}),N.push({d:g(d,m(b+222,d,u),m(b+318,d,u)),kind:`inner`});let S=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,C={lx:u.x,ly:u.y+d+20,anchor:`middle`};if(a){let e=u.x>=s.x,t=Math.max(d,..._.map(e=>{let t=M.find(t=>t.name===e);return Math.abs(t.x-u.x)+l}));C={lx:p(u.x+(e?t+8:-t-8)),ly:p(u.y+4),anchor:e?`start`:`end`}}P.push({loop:e.name,cx:u.x,cy:u.y,r:d,label:S,...C})})}let I=i(205).y,L=e.nodes.filter(e=>!y.nodes.includes(e)),R=L.map((e,t)=>({name:e,x:40,y:p(I-44*(L.length-1-t)),human:f(e)})),z=e.edges.find(e=>e.to===`$close`)?.from,B=M.find(e=>e.name===z),V=B?{from:z,x:B.x+200,y:B.y-30,d:`M${B.x+l},${B.y-6} C${B.x+90},${B.y-40} ${B.x+170},${B.y-40} ${B.x+200},${B.y-30}`}:null,H=Math.max(540,...M.map(e=>e.x+e.r+8),...V?[V.x+6+v(`close`)+8]:[],...P.map(e=>e.cx+e.r+8),...P.map(e=>e.anchor===`start`?e.lx+v(e.label)+8:e.lx+v(e.label)/2+8)),U=Math.max(300,...M.map(e=>e.y+e.r+12),...P.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(H),height:Math.ceil(U),center:{x:r.x,y:r.y,r:c},nodes:M,arcs:N,inner:P,entry:R,exit:V}}function T(e,t,n){let r=e.loops||[],i=e=>36+16*r.filter(t=>t!==e&&t.nodes.every(t=>e.nodes.includes(t))).length,a=Math.max(l,...r.map(i))+30,o=new Map(e.nodes.map((e,t)=>[e,60+t*100])),s=e.nodes.map(e=>({name:e,x:o.get(e),y:a,r:l,effect:t(e),gate:!1,inner:!1,human:n(e)})),c=e.nodes.slice(1).map((t,n)=>({d:`M${o.get(e.nodes[n])+l},${a} L${o.get(t)-l-4},${a}`,kind:`flow`})),u=r.map(e=>{let t=i(e),n=Math.min(...e.nodes.map(e=>o.get(e))),r=Math.max(...e.nodes.map(e=>o.get(e))),s={x:n-t,y:a-t,w:r-n+2*t,h:2*t};return c.push({d:`M${r},${s.y+s.h} L${n+4},${s.y+s.h}`,kind:`flow`}),{loop:e.name,label:`${e.name} · max ${e.max}`,box:s}});return{mode:`flow`,width:60+e.nodes.length*100,height:2*a,center:null,nodes:s,arcs:c,inner:u,entry:[],exit:null}}var E=n();function D({x:e,y:t,label:n}){return(0,E.jsxs)(`g`,{className:`lr-human`,children:[(0,E.jsx)(`title`,{children:n}),(0,E.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,E.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,E.jsx)(`path`,{d:`M${e-4.6},${t+5.6} a4.6,4.6 0 0 1 9.2,0 Z`,className:`lr-human-fig`})]})}function O({graph:e,bricks:t,onSelect:n,highlight:r}){let i=C(e,t),a=(e.loops||[]).find(e=>e.iteration),o=e=>`${e.name} brick${e.human?`, ${e.human.toLowerCase()}`:``}`,s=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n?.(e))};return(0,E.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,style:{"--loop-w":`${i.width}px`},role:`group`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,E.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,E.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,E.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,E.jsxs)(`g`,{children:[(0,E.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,E.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.mode===`flow`&&i.inner.map(e=>(0,E.jsxs)(`g`,{children:[(0,E.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,E.jsx)(`text`,{x:e.box.x+10,y:e.box.y-6,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.arcs.map((e,t)=>(0,E.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,E.jsxs)(`g`,{children:[(0,E.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${_},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,E.jsxs)(`g`,{children:[(0,E.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,E.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,E.jsx)(D,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,E.jsxs)(`g`,{className:`lr-gate`,children:[(0,E.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,E.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,E.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,E.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,E.jsxs)(`g`,{className:`lr-node${e.inner?` inner`:``}${e.effect===`mutate`?` mutate`:``}${e.name===r?` current`:``}`,"aria-current":e.name===r?`step`:void 0,...n?{role:`button`,tabIndex:0,"aria-label":o(e),onClick:s(e.name),onKeyDown:s(e.name)}:{role:`img`,"aria-label":`${o(e)}${e.name===r?`, current step`:``}`},children:[(0,E.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,E.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,E.jsx)(D,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,E.jsxs)(`g`,{children:[(0,E.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,E.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,E.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,E.jsxs)(`g`,{children:[(0,E.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,E.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}var k=5e3,A=[`prudent`,`balanced`,`aggressive`],j={running:`acc`,awaiting:`warn`,unreadable:`bad`},M=e=>!!e.graph;function N(){let[e,t]=(0,o.useState)(null),[n,a]=(0,o.useState)(null),[s,c]=(0,o.useState)(null),[l,u]=(0,o.useState)(0);return i(e=>r.activeLoops().then(n=>e()&&(t(n),a(null)),t=>e()&&a(t.message)),k,[l]),{loops:e?.loops??null,error:s||n,onPreset:(e,t)=>(c(null),r.setLoopPreset(e,t).then(()=>u(e=>e+1),e=>c(e.message)))}}var P=e=>({key:e,label:e,align:`right`,render:t=>(0,E.jsx)(`span`,{className:`num`,children:t[e]})}),F=[P(`iteration`),{key:`intent`,label:`intent`},P(`declared`),P(`actual`),{key:`decision`,label:`decision`},{key:`tests`,label:`tests`}];function I({history:e}){return e.length?(0,E.jsx)(`div`,{className:`loop-history`,children:(0,E.jsx)(a,{caption:`Iterations`,captionHidden:!0,columns:F,rows:e,rowKey:e=>e.iteration})}):(0,E.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function L({loop:e,bricks:t,onPreset:n}){let r=M(e)?(e.graph.loops||[]).find(e=>e.iteration):null,[i,a]=(0,o.useState)(!1);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`reader-tags`,children:[(0,E.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,E.jsx)(`span`,{className:`tag${j[e.status]?` ${j[e.status]}`:``}`,children:e.status})]}),(0,E.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,E.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),M(e)?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,E.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,E.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,E.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,E.jsx)(`select`,{className:`sel`,"aria-label":`Preset for ${e.title}`,value:e.preset,disabled:i,onChange:t=>{a(!0),Promise.resolve(n(e.root,t.target.value)).finally(()=>a(!1))},children:A.map(e=>(0,E.jsx)(`option`,{children:e},e))})]}),(0,E.jsx)(`a`,{href:`#/docs/loop-risk`,children:`What presets mean →`}),(0,E.jsx)(`hr`,{className:`hr`}),(0,E.jsx)(`div`,{className:`loop-graph`,children:(0,E.jsx)(O,{graph:e.graph,bricks:t,highlight:e.node})}),(0,E.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,E.jsx)(I,{history:e.history})]}):(0,E.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its LOOP.md cannot be read, so there is no state to show.`:`Its LOOP.md is gone: the loop closed and its state went with it.`})]})}export{D as a,C as c,N as i,j as n,O as o,M as r,S as s,L as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BMFDSXoB.js";import{s as i}from"./motion-RlUl1osO.js";import{A as a,B as o,Ct as s,D as c,F as l,G as u,I as d,L as f,N as p,O as m,P as h,R as g,Tt as _,it as v,j as y,k as b,ot as ee,rt as te,u as ne,yt as x}from"./index-BNttaGQb.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{_ as C,a as w,c as T,f as E,g as D,h as O,i as k,l as A,m as re,n as j,o as M,p as N,r as P,s as F,t as I,u as L,v as R}from"./Bonsai-BlOwsvW6.js";import{t as ie}from"./usePoll-o8ul-Sog.js";var z=e(t(),1),B=n(),V=4,H=56*V,U=24,W=165,G=188,K=(e,t)=>e>0?Math.max(1,Math.floor((e-32+U)/(H+U))):Math.max(1,t),q=e=>e.status===`blocked`?`bad`:l(e)?`warn`:e.status===`busy`?`ok`:``,J=e=>{let t=A(e);return t==null?null:Math.round(t*100)};function Y(e,t,n){let r=c[e.status]||c.idle,i=t.pads.filter(e=>e.key!=null),a=t.pads.reduce((e,t)=>e+t.files.length,0)+t.fallen.reduce((e,t)=>e+t.files.length,0),o=J(e);return[`${e.title||y(e.cwd)||e.session_id}, ${e.chip||e.host||`unknown host`}, ${r.label}${e.phase?`, ${e.phase}`:``}`,`${e.turns||0} turns${o==null?``:`, context ${o} %`}${e.compactions?`, ${e.compactions} compactions`:``}`,i.length?`${i.length} sub-agent${i.length===1?``:`s`} running: ${i.map(e=>`${e.type||`agent`} (${e.files.length} file${e.files.length===1?``:`s`})`).join(`, `)}`:``,t.fallen.length?`${t.fallen.length} finished`:``,`${a} file${a===1?``:`s`} changed`,n.length?`shares ${n.length} file${n.length===1?``:`s`} with another session`:``,e.error?`error: ${e.error}`:``].filter(Boolean).join(`. `)}function X({s:e,t,mine:n}){let r=J(e);return(0,B.jsxs)(`div`,{className:`card gd-card`,children:[(0,B.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`model`}),(0,B.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,B.jsx)(`dt`,{children:`turns`}),(0,B.jsx)(`dd`,{children:e.turns||0}),(0,B.jsx)(`dt`,{children:`context`}),(0,B.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,B.jsx)(`dt`,{children:`compactions`}),(0,B.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,B.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,B.jsxs)(`div`,{className:`act-xs ${e.kind===`same-worktree`?`t-bad`:`t-warn`}`,children:[`same file`,e.kind===`same-worktree`?``:`, other worktree`,`: `,e.path]},`${e.kind}:${e.path}`))]})}function Z({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let o=R(e,n),s=(0,z.useMemo)(()=>E(e,{sakura:n}),[o]),u=c[e.status]||c.idle,d=Array.isArray(e.loops)?e.loops[0]:null,f=e.status!==`idle`,p=F(e),m=e.title||y(e.cwd)||e.session_id,h=J(e),g=(0,z.useRef)(null),_=(0,z.useCallback)(e=>a(p,e,Q(g.current)),[a,p]);return(0,B.jsxs)(`a`,{ref:g,className:`gd-tree${l(e)?` gd-needs`:``}`,href:e.href||L(e.session_id),"aria-label":Y(e,s,r),"data-sid":e.session_id,onMouseEnter:e=>a(p,null,Q(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(p,null,Q(e.currentTarget)),onBlur:()=>a(null,null),onKeyDown:e=>k(e,s.pads.length,i,_),children:[(0,B.jsx)(P,{t:s,pad:i,swaying:f,onPad:_,px:V}),(0,B.jsxs)(`div`,{className:`gd-cap`,children:[(0,B.jsx)(`div`,{className:`gd-title`,title:m,children:m}),(0,B.jsxs)(`div`,{className:`row wrap gd-pills`,children:[(0,B.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip||e.host||`?`}),(0,B.jsx)(`span`,{className:`badge ${q(e)}`,children:u.label}),t&&(0,B.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),d&&(0,B.jsxs)(`span`,{className:`badge`,children:[`↻ `,d.title,d.iteration==null?``:` ${d.iteration}`]}),e.attribution===!1&&(0,B.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`})]}),(0,B.jsxs)(`div`,{className:`mono gd-meta`,children:[e.turns||0,` turns`,h==null?``:` · ${h}%`]})]})]})}function ae({pairs:e,count:t}){if(!e.length)return null;let n=t*H+(t-1)*U,r=e=>e*(H+U)+H/2;return(0,B.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*V+20,"aria-hidden":`true`,children:e.map(({a:e,b:t,kind:n})=>{let[i,a]=e<t?[e,t]:[t,e],o=`gd-thread ${n===`same-worktree`?`red`:`amber`}`;if(a-i===1){let e=r(i)+30,t=r(a)-30,n=(e+t)/2;return(0,B.jsxs)(`g`,{className:o,children:[(0,B.jsx)(`path`,{d:`M${e} ${W} C${n} 179 ${n} 159 ${t} 169`}),(0,B.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${W}`})]},`${i}-${a}`)}return(0,B.jsx)(`g`,{className:o,children:(0,B.jsx)(`path`,{d:`M${r(i)} ${G} Q${(r(i)+r(a))/2} 222 ${r(a)} ${G}`})},`${i}-${a}`)})})}var Q=e=>e.offsetLeft;function oe({sessions:e,collisions:t}){let[n,r]=(0,z.useState)(M),[i,a]=(0,z.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(j,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=T(N(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>D(e,s);return(0,B.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,B.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,B.jsxs)(`span`,{className:`dim act-sm`,children:[e.length,` tree`,e.length===1?``:`s`,` · `,c.length,` `,c.length===1?`shelf`:`shelves`,` · a tree opens its session; hover or focus shows its details, and a tap or the arrow keys walk its pads`]}),(0,B.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Pink blossom`})]}),l.length>0&&(0,B.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`chip-f`,"aria-expanded":!1,onClick:()=>a(t=>new Set(t).add(e.key)),children:[e.name,` · `,e.trees.length]},e.key))}),c.filter(e=>!e.collapsed).map(e=>(0,B.jsx)(se,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function se({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,z.useState)({sid:null,pad:null,x:0}),o=(0,z.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=(0,z.useRef)(null),[c,l]=(0,z.useState)(0);(0,z.useLayoutEffect)(()=>{let e=s.current,t=()=>l(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let u=K(c,e.trees.length),d=C(e.trees,n),f=[];for(let t=0;t<e.trees.length;t+=u)f.push(t);let p=e.trees.findIndex(e=>F(e.s)===i.sid),m=p<0?null:e.trees[p].s,h=m?E(m,{sakura:t}):null,g=h&&i.pad!=null?h.pads[i.pad]:null,_=e.trees.length;return(0,B.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,ref:s,children:[f.map(n=>{let a=e.trees.slice(n,n+u),s=n+a.length,c=d.filter(e=>e.a>=n&&e.a<s&&e.b>=n&&e.b<s).map(e=>({...e,a:e.a-n,b:e.b-n}));return(0,B.jsxs)(`div`,{className:`gd-row`,children:[(0,B.jsx)(`div`,{className:`gd-plank`,children:n===0&&(0,B.jsxs)(`h3`,{className:`gd-plate`,children:[e.name,` · `,_,` session`,_===1?``:`s`]})}),a.map(({s:e,worktree:n})=>(0,B.jsx)(Z,{s:e,worktree:n,sakura:t,mine:r(F(e)),pad:F(e)===i.sid?i.pad:null,onHover:o},F(e))),(0,B.jsx)(ae,{pairs:c,count:a.length}),m&&p>=n&&p<s&&(0,B.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:g?(0,B.jsx)(I,{pad:g}):(0,B.jsx)(X,{s:m,t:h,mine:r(F(m))})})]},n)}),(0,B.jsx)(`span`,{className:`sr-only`,role:`status`,children:w(g)})]})}var $=e=>e.catch(()=>null);function ce({s:e}){let t=(0,z.useId)(),n=e.todos,r=h(e);return(0,B.jsxs)(`a`,{className:`card pad-md act-card`,href:e.href||L(e.session_id),"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,B.jsxs)(m,{s:e,id:t,heading:e.title||y(e.cwd)||e.session_id,children:[e.chip&&(0,B.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip}),(0,B.jsx)(x,{name:`chevron`,className:`glyph act-chev`})]}),n&&n.total>0&&(0,B.jsx)(`div`,{className:`act-foot`,children:(0,B.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,B.jsx)(a,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,B.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,s(e.updated_at),` ago`]})]})}var le={blocked:`is blocked`,"waiting-input":`waits for your answer`};function ue(e,t){if(!Array.isArray(t))return``;let n=t.filter(l),r=e.current;return e.current=new Set(n.map(e=>`${F(e)}:${e.status}`)),r?n.filter(e=>!r.has(`${F(e)}:${e.status}`)).map(e=>`${e.title||y(e.cwd)||e.session_id} ${le[e.status]}`).join(`. `):``}var de=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function fe(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:de.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function pe(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.v===`list`&&t.set(`v`,`list`),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function me({enabled:e,installs:t,onToggle:n}){let r=re(t);return(0,B.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,B.jsx)(x,{name:`activity`,className:`glyph act-fixed`}),(0,B.jsxs)(`div`,{className:`act-grow`,children:[(0,B.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,B.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,B.jsxs)(`ul`,{className:`stack gap-8 act-fixed act-sm`,"aria-label":`Tracking per install`,children:[t.length===0&&(0,B.jsx)(`li`,{className:`dim`,children:`No active install to track.`}),t.map((e,t)=>(0,B.jsxs)(`li`,{className:`row gap-10`,children:[(0,B.jsxs)(`span`,{id:`act-track-l${t}`,title:e.path,children:[`Track live sessions in `,(0,B.jsx)(`span`,{className:`mono`,children:r.get(e.install)})]}),(0,B.jsx)(`div`,{className:`sw-toggle${e.enabled?` on`:``}`,role:`switch`,"aria-checked":e.enabled,"aria-labelledby":`act-track-l${t}`,tabIndex:0,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.key===` `&&t.preventDefault(),n(e))}})]},e.install))]})]})}function he({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=d(e?.jobs,{days:14,cap:n}),i=g(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${f(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${f(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,B.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,B.jsxs)(`div`,{className:`act-stat-head`,children:[(0,B.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,B.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,B.jsx)(v,{label:`Reading the job log…`}):e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,B.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,B.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${f(e.key)}: ${e.n}`},e.key):(0,B.jsx)(`i`,{className:`zero`},e.key))}),(0,B.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,B.jsx)(`span`,{children:f(r[0].key)}),(0,B.jsx)(`span`,{children:f(r[7].key)}),(0,B.jsx)(`span`,{children:`today`})]}),c&&(0,B.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,B.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function ge({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,B.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,B.jsxs)(`div`,{className:`act-stat-head`,children:[(0,B.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,B.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,B.jsx)(v,{label:`Reading the gate ledger…`}):e.length?(0,B.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,B.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,B.jsx)(b,{vals:e.per_day,i:t,sweep:!0}),(0,B.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,B.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var _e={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ve({job:e,longest:t}){let n=o(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=_e[e.status]||[``,e.status||`…`],s=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,c=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,B.jsxs)(`li`,{className:`act-row`,children:[(0,B.jsx)(`span`,{className:`mono dim act-xs`,children:c}),(0,B.jsx)(x,{name:`play`,className:`glyph act-glyph`}),(0,B.jsxs)(`span`,{className:`act-what`,children:[(0,B.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,B.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,B.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":s,children:(0,B.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,B.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function ye({gate:e}){return(0,B.jsxs)(`li`,{className:`act-row gate`,children:[(0,B.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,B.jsx)(x,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,B.jsxs)(`span`,{className:`act-what`,children:[(0,B.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,B.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,B.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var be=5,xe=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function Se(){let[e,t]=(0,z.useState)(null),[n,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(fe),[c,d]=(0,z.useState)(!1),[f,m]=(0,z.useState)(``),h=(0,z.useRef)(null),b=e=>{let t={...o,...e};s(t),pe(t)};ie(e=>r.activity().then(n=>{if(e()){t(n),a(``);let e=ue(h,n?.activity);e&&m(t=>t===e?e+`\xA0`:e)}},t=>{e()&&a(t.message)}),2e3,[]);let x=_(()=>$(r.jobs()),[]),C=_(()=>$(r.gates()),[]),w=_(()=>$(r.catalog(`laws`)),[]),T=!e||e.enabled!==!1,E=Array.isArray(e?.installs)?e.installs:[],D=O(e?.activity,E).sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),k=i(),A=T&&e?D.filter(l).length:null,re=new Set(D.map(F)),j=o.v===`list`?O(e?.ended,E).filter(e=>!re.has(F(e))):[],M=xe([...D,...j].map(e=>e.host),o.host),N=xe([...D,...j].map(e=>y(e.cwd)),o.project),P=o.host&&o.project?`host or project`:o.host?`host`:o.project?`project`:``,I=e=>(!o.host||e.host===o.host)&&(!o.project||y(e.cwd)===o.project),L=D.filter(e=>I(e)&&(o.f!==`needs`||l(e))),R=o.f===`all`||o.f===`needs`,V=o.f===`all`&&T?j.filter(I):[],H=c?V:V.slice(0,be),U=!P&&(o.f===`all`||o.f===`runs`),W=!P&&(o.f===`all`||o.f===`gates`),G=x.data?.jobs||[],K=ne(C.data,w.data),q=p(G,K,C.data?.days).map(e=>({...e,runs:U?e.runs:[],gate:W?e.gate:null})).filter(e=>e.runs.length||e.gate),J=Math.max(0,...G.map(e=>e.duration||0)),Y=g(q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),X=async e=>{let n=!e.enabled;try{let i=await r.activityToggle(n,{host:e.host,path:e.path});if(i.ok===!1){a(i.error||`Could not change tracking`);return}let o=t=>i.enabled?t||[]:(t||[]).flatMap(t=>{let n=(t.installs||[t.install]).filter(t=>t!==e.install);return n.length?[{...t,install:n[0],installs:n}]:[]});t(t=>{let n=(t?.installs||[]).map(t=>t.install===e.install?{...t,enabled:i.enabled}:t);return{...t||{},installs:n,enabled:n.length===0||n.some(e=>e.enabled),activity:o(t?.activity),ended:o(t?.ended)}}),a(``)}catch(e){a(e.message)}},Z=(e,t,n)=>(0,B.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,B.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,B.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:o[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>b({[e]:t.target.value}),children:[(0,B.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]});return(0,B.jsxs)(`div`,{className:`page-fill`,children:[(0,B.jsx)(u,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,B.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:f}),n&&(0,B.jsx)(`div`,{className:`act-gap`,children:(0,B.jsx)(te,{error:n})}),e&&(0,B.jsx)(me,{enabled:T,installs:E,onToggle:X}),(0,B.jsxs)(`div`,{className:`act-today`,children:[(0,B.jsx)(he,{jobs:x.data,loading:x.loading}),(0,B.jsx)(ge,{rows:K,gates:C.data,loading:C.loading}),(0,B.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,B.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),!e&&!n?(0,B.jsx)(v,{}):e?(0,B.jsxs)(B.Fragment,{children:[T?(0,B.jsxs)(`span`,{className:`act-big act-wait`,children:[A,` `,(0,B.jsx)(`span`,{className:`dim act-sm`,children:A===1?`session`:`sessions`})]}):null,(0,B.jsx)(`p`,{className:`dim act-sm`,children:T?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]}):(0,B.jsx)(`p`,{className:`dim act-sm`,children:`The sessions could not be read.`})]})]}),(0,B.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,B.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:de.map(([e,t])=>(0,B.jsxs)(`button`,{type:`button`,className:o.f===e?`chip-f on`:`chip-f`,"aria-pressed":o.f===e,onClick:()=>b({f:e}),children:[t,e===`needs`&&A>0?(0,B.jsxs)(`span`,{className:`mono`,children:[` `,A]}):null]},e))}),Z(`host`,`Host`,M),Z(`project`,`Project`,N),(0,B.jsx)(ee,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,B.jsx)(`button`,{type:`button`,className:o.v===e?`on`:``,"aria-pressed":o.v===e,onClick:()=>b({v:e}),children:t},e))})]}),P&&o.f!==`needs`&&(0,B.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,P,`; showing sessions only.`]}),R&&(e?!T&&o.f!==`needs`?null:L.length===0?o.f===`needs`?(0,B.jsx)(S,{title:`Nothing waits on you`}):(0,B.jsx)(S,{title:`No active sessions`,children:`Start an agent session and it appears here.`}):o.v===`garden`?(0,B.jsx)(oe,{sessions:L,collisions:e.collisions}):(0,B.jsx)(`div`,{className:`stack gap-12 act-live`,ref:k,children:L.map(e=>(0,B.jsx)(`div`,{"data-flip":F(e),children:(0,B.jsx)(ce,{s:e})},F(e)))}):(0,B.jsx)(v,{label:`Reading live sessions…`})),V.length>0&&(0,B.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,B.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),H.map(e=>(0,B.jsx)(`div`,{children:(0,B.jsx)(ce,{s:e})},F(e))),V.length>be&&(0,B.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":c,onClick:()=>d(e=>!e),children:c?`Show fewer`:`Show all ${V.length}`})]}),o.f!==`needs`&&(0,B.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Y,children:q.map(e=>(0,B.jsxs)(`section`,{className:`card act-day`,children:[(0,B.jsxs)(`h3`,{className:`act-day-h`,children:[(0,B.jsx)(`span`,{children:e.title}),(0,B.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,B.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,B.jsx)(ve,{job:e,longest:J},e.id)),e.gate&&(0,B.jsx)(ye,{gate:e.gate})]})]},e.key))})]})}export{Se as default};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{s as i}from"./motion-RlUl1osO.js";import{A as a,B as o,D as s,Et as c,F as l,G as u,I as d,L as f,N as p,O as m,P as h,R as g,bt as _,it as v,j as y,k as b,ot as ee,rt as te,u as ne,wt as x}from"./index-BQwOmbor.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{_ as C,a as w,c as T,f as E,g as D,h as O,i as k,l as A,m as re,n as j,o as M,p as N,r as P,s as F,t as I,u as L,v as R}from"./Bonsai-hiG_gGNU.js";import{t as ie}from"./usePoll-o8ul-Sog.js";var z=e(t(),1),B=n(),V=4,H=56*V,U=24,W=165,G=188,K=(e,t)=>e>0?Math.max(1,Math.floor((e-32+U)/(H+U))):Math.max(1,t),q=e=>e.status===`blocked`?`bad`:l(e)?`warn`:e.status===`busy`?`ok`:``,J=e=>{let t=A(e);return t==null?null:Math.round(t*100)};function Y(e,t,n){let r=s[e.status]||s.idle,i=t.pads.filter(e=>e.key!=null),a=t.pads.reduce((e,t)=>e+t.files.length,0)+t.fallen.reduce((e,t)=>e+t.files.length,0),o=J(e);return[`${e.title||y(e.cwd)||e.session_id}, ${e.chip||e.host||`unknown host`}, ${r.label}${e.phase?`, ${e.phase}`:``}`,`${e.turns||0} turns${o==null?``:`, context ${o} %`}${e.compactions?`, ${e.compactions} compactions`:``}`,i.length?`${i.length} sub-agent${i.length===1?``:`s`} running: ${i.map(e=>`${e.type||`agent`} (${e.files.length} file${e.files.length===1?``:`s`})`).join(`, `)}`:``,t.fallen.length?`${t.fallen.length} finished`:``,`${a} file${a===1?``:`s`} changed`,n.length?`shares ${n.length} file${n.length===1?``:`s`} with another session`:``,e.error?`error: ${e.error}`:``].filter(Boolean).join(`. `)}function X({s:e,t,mine:n}){let r=J(e);return(0,B.jsxs)(`div`,{className:`card gd-card`,children:[(0,B.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`model`}),(0,B.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,B.jsx)(`dt`,{children:`turns`}),(0,B.jsx)(`dd`,{children:e.turns||0}),(0,B.jsx)(`dt`,{children:`context`}),(0,B.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,B.jsx)(`dt`,{children:`compactions`}),(0,B.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,B.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,B.jsxs)(`div`,{className:`act-xs ${e.kind===`same-worktree`?`t-bad`:`t-warn`}`,children:[`same file`,e.kind===`same-worktree`?``:`, other worktree`,`: `,e.path]},`${e.kind}:${e.path}`))]})}function Z({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let o=R(e,n),c=(0,z.useMemo)(()=>E(e,{sakura:n}),[o]),u=s[e.status]||s.idle,d=Array.isArray(e.loops)?e.loops[0]:null,f=e.status!==`idle`,p=F(e),m=e.title||y(e.cwd)||e.session_id,h=J(e),g=(0,z.useRef)(null),_=(0,z.useCallback)(e=>a(p,e,Q(g.current)),[a,p]);return(0,B.jsxs)(`a`,{ref:g,className:`gd-tree${l(e)?` gd-needs`:``}`,href:e.href||L(e.session_id),"aria-label":Y(e,c,r),"data-sid":e.session_id,onMouseEnter:e=>a(p,null,Q(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(p,null,Q(e.currentTarget)),onBlur:()=>a(null,null),onKeyDown:e=>k(e,c.pads.length,i,_),children:[(0,B.jsx)(P,{t:c,pad:i,swaying:f,onPad:_,px:V}),(0,B.jsxs)(`div`,{className:`gd-cap`,children:[(0,B.jsx)(`div`,{className:`gd-title`,title:m,children:m}),(0,B.jsxs)(`div`,{className:`row wrap gd-pills`,children:[(0,B.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip||e.host||`?`}),(0,B.jsx)(`span`,{className:`badge ${q(e)}`,children:u.label}),t&&(0,B.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),d&&(0,B.jsxs)(`span`,{className:`badge`,children:[`↻ `,d.title,d.iteration==null?``:` ${d.iteration}`]}),e.attribution===!1&&(0,B.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`})]}),(0,B.jsxs)(`div`,{className:`mono gd-meta`,children:[e.turns||0,` turns`,h==null?``:` · ${h}%`]})]})]})}function ae({pairs:e,count:t}){if(!e.length)return null;let n=t*H+(t-1)*U,r=e=>e*(H+U)+H/2;return(0,B.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*V+20,"aria-hidden":`true`,children:e.map(({a:e,b:t,kind:n})=>{let[i,a]=e<t?[e,t]:[t,e],o=`gd-thread ${n===`same-worktree`?`red`:`amber`}`;if(a-i===1){let e=r(i)+30,t=r(a)-30,n=(e+t)/2;return(0,B.jsxs)(`g`,{className:o,children:[(0,B.jsx)(`path`,{d:`M${e} ${W} C${n} 179 ${n} 159 ${t} 169`}),(0,B.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${W}`})]},`${i}-${a}`)}return(0,B.jsx)(`g`,{className:o,children:(0,B.jsx)(`path`,{d:`M${r(i)} ${G} Q${(r(i)+r(a))/2} 222 ${r(a)} ${G}`})},`${i}-${a}`)})})}var Q=e=>e.offsetLeft;function oe({sessions:e,collisions:t}){let[n,r]=(0,z.useState)(M),[i,a]=(0,z.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(j,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=T(N(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>D(e,s);return(0,B.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,B.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,B.jsxs)(`span`,{className:`dim act-sm`,children:[e.length,` tree`,e.length===1?``:`s`,` · `,c.length,` `,c.length===1?`shelf`:`shelves`,` · a tree opens its session; hover or focus shows its details, and a tap or the arrow keys walk its pads`]}),(0,B.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Pink blossom`})]}),l.length>0&&(0,B.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`chip-f`,"aria-expanded":!1,onClick:()=>a(t=>new Set(t).add(e.key)),children:[e.name,` · `,e.trees.length]},e.key))}),c.filter(e=>!e.collapsed).map(e=>(0,B.jsx)(se,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function se({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,z.useState)({sid:null,pad:null,x:0}),o=(0,z.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=(0,z.useRef)(null),[c,l]=(0,z.useState)(0);(0,z.useLayoutEffect)(()=>{let e=s.current,t=()=>l(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let u=K(c,e.trees.length),d=C(e.trees,n),f=[];for(let t=0;t<e.trees.length;t+=u)f.push(t);let p=e.trees.findIndex(e=>F(e.s)===i.sid),m=p<0?null:e.trees[p].s,h=m?E(m,{sakura:t}):null,g=h&&i.pad!=null?h.pads[i.pad]:null,_=e.trees.length;return(0,B.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,ref:s,children:[f.map(n=>{let a=e.trees.slice(n,n+u),s=n+a.length,c=d.filter(e=>e.a>=n&&e.a<s&&e.b>=n&&e.b<s).map(e=>({...e,a:e.a-n,b:e.b-n}));return(0,B.jsxs)(`div`,{className:`gd-row`,children:[(0,B.jsx)(`div`,{className:`gd-plank`,children:n===0&&(0,B.jsxs)(`h3`,{className:`gd-plate`,children:[e.name,` · `,_,` session`,_===1?``:`s`]})}),a.map(({s:e,worktree:n})=>(0,B.jsx)(Z,{s:e,worktree:n,sakura:t,mine:r(F(e)),pad:F(e)===i.sid?i.pad:null,onHover:o},F(e))),(0,B.jsx)(ae,{pairs:c,count:a.length}),m&&p>=n&&p<s&&(0,B.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:g?(0,B.jsx)(I,{pad:g}):(0,B.jsx)(X,{s:m,t:h,mine:r(F(m))})})]},n)}),(0,B.jsx)(`span`,{className:`sr-only`,role:`status`,children:w(g)})]})}var $=e=>e.catch(()=>null);function ce({s:e}){let t=(0,z.useId)(),n=e.todos,r=h(e);return(0,B.jsxs)(`a`,{className:`card pad-md act-card`,href:e.href||L(e.session_id),"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,B.jsxs)(m,{s:e,id:t,heading:e.title||y(e.cwd)||e.session_id,children:[e.chip&&(0,B.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip}),(0,B.jsx)(_,{name:`chevron`,className:`glyph act-chev`})]}),n&&n.total>0&&(0,B.jsx)(`div`,{className:`act-foot`,children:(0,B.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,B.jsx)(a,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,B.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,x(e.updated_at),` ago`]})]})}var le={blocked:`is blocked`,"waiting-input":`waits for your answer`};function ue(e,t){if(!Array.isArray(t))return``;let n=t.filter(l),r=e.current;return e.current=new Set(n.map(e=>`${F(e)}:${e.status}`)),r?n.filter(e=>!r.has(`${F(e)}:${e.status}`)).map(e=>`${e.title||y(e.cwd)||e.session_id} ${le[e.status]}`).join(`. `):``}var de=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function fe(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:de.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function pe(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.v===`list`&&t.set(`v`,`list`),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function me({enabled:e,installs:t,onToggle:n}){let r=re(t);return(0,B.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,B.jsx)(_,{name:`activity`,className:`glyph act-fixed`}),(0,B.jsxs)(`div`,{className:`act-grow`,children:[(0,B.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,B.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,B.jsxs)(`ul`,{className:`stack gap-8 act-fixed act-sm`,"aria-label":`Tracking per install`,children:[t.length===0&&(0,B.jsx)(`li`,{className:`dim`,children:`No active install to track.`}),t.map((e,t)=>(0,B.jsxs)(`li`,{className:`row gap-10`,children:[(0,B.jsxs)(`span`,{id:`act-track-l${t}`,title:e.path,children:[`Track live sessions in `,(0,B.jsx)(`span`,{className:`mono`,children:r.get(e.install)})]}),(0,B.jsx)(`div`,{className:`sw-toggle${e.enabled?` on`:``}`,role:`switch`,"aria-checked":e.enabled,"aria-labelledby":`act-track-l${t}`,tabIndex:0,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.key===` `&&t.preventDefault(),n(e))}})]},e.install))]})]})}function he({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=d(e?.jobs,{days:14,cap:n}),i=g(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${f(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${f(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,B.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,B.jsxs)(`div`,{className:`act-stat-head`,children:[(0,B.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,B.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,B.jsx)(v,{label:`Reading the job log…`}):e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,B.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,B.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${f(e.key)}: ${e.n}`},e.key):(0,B.jsx)(`i`,{className:`zero`},e.key))}),(0,B.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,B.jsx)(`span`,{children:f(r[0].key)}),(0,B.jsx)(`span`,{children:f(r[7].key)}),(0,B.jsx)(`span`,{children:`today`})]}),c&&(0,B.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,B.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function ge({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,B.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,B.jsxs)(`div`,{className:`act-stat-head`,children:[(0,B.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,B.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,B.jsx)(v,{label:`Reading the gate ledger…`}):e.length?(0,B.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,B.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,B.jsx)(b,{vals:e.per_day,i:t,sweep:!0}),(0,B.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,B.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var _e={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ve({job:e,longest:t}){let n=o(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=_e[e.status]||[``,e.status||`…`],s=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,c=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,B.jsxs)(`li`,{className:`act-row`,children:[(0,B.jsx)(`span`,{className:`mono dim act-xs`,children:c}),(0,B.jsx)(_,{name:`play`,className:`glyph act-glyph`}),(0,B.jsxs)(`span`,{className:`act-what`,children:[(0,B.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,B.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,B.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":s,children:(0,B.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,B.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function ye({gate:e}){return(0,B.jsxs)(`li`,{className:`act-row gate`,children:[(0,B.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,B.jsx)(_,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,B.jsxs)(`span`,{className:`act-what`,children:[(0,B.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,B.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,B.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var be=5,xe=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function Se(){let[e,t]=(0,z.useState)(null),[n,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(fe),[d,f]=(0,z.useState)(!1),[m,h]=(0,z.useState)(``),_=(0,z.useRef)(null),b=e=>{let t={...o,...e};s(t),pe(t)};ie(e=>r.activity().then(n=>{if(e()){t(n),a(``);let e=ue(_,n?.activity);e&&h(t=>t===e?e+`\xA0`:e)}},t=>{e()&&a(t.message)}),2e3,[]);let x=c(()=>$(r.jobs()),[]),C=c(()=>$(r.gates()),[]),w=c(()=>$(r.catalog(`laws`)),[]),T=!e||e.enabled!==!1,E=Array.isArray(e?.installs)?e.installs:[],D=O(e?.activity,E).sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),k=i(),A=T&&e?D.filter(l).length:null,re=new Set(D.map(F)),j=o.v===`list`?O(e?.ended,E).filter(e=>!re.has(F(e))):[],M=xe([...D,...j].map(e=>e.host),o.host),N=xe([...D,...j].map(e=>y(e.cwd)),o.project),P=o.host&&o.project?`host or project`:o.host?`host`:o.project?`project`:``,I=e=>(!o.host||e.host===o.host)&&(!o.project||y(e.cwd)===o.project),L=D.filter(e=>I(e)&&(o.f!==`needs`||l(e))),R=o.f===`all`||o.f===`needs`,V=o.f===`all`&&T?j.filter(I):[],H=d?V:V.slice(0,be),U=!P&&(o.f===`all`||o.f===`runs`),W=!P&&(o.f===`all`||o.f===`gates`),G=x.data?.jobs||[],K=ne(C.data,w.data),q=p(G,K,C.data?.days).map(e=>({...e,runs:U?e.runs:[],gate:W?e.gate:null})).filter(e=>e.runs.length||e.gate),J=Math.max(0,...G.map(e=>e.duration||0)),Y=g(q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),X=async e=>{let n=!e.enabled;try{let i=await r.activityToggle(n,{host:e.host,path:e.path});if(i.ok===!1){a(i.error||`Could not change tracking`);return}let o=t=>i.enabled?t||[]:(t||[]).flatMap(t=>{let n=(t.installs||[t.install]).filter(t=>t!==e.install);return n.length?[{...t,install:n[0],installs:n}]:[]});t(t=>{let n=(t?.installs||[]).map(t=>t.install===e.install?{...t,enabled:i.enabled}:t);return{...t||{},installs:n,enabled:n.length===0||n.some(e=>e.enabled),activity:o(t?.activity),ended:o(t?.ended)}}),a(``)}catch(e){a(e.message)}},Z=(e,t,n)=>(0,B.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,B.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,B.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:o[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>b({[e]:t.target.value}),children:[(0,B.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]});return(0,B.jsxs)(`div`,{className:`page-fill`,children:[(0,B.jsx)(u,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,B.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:m}),n&&(0,B.jsx)(`div`,{className:`act-gap`,children:(0,B.jsx)(te,{error:n})}),e&&(0,B.jsx)(me,{enabled:T,installs:E,onToggle:X}),(0,B.jsxs)(`div`,{className:`act-today`,children:[(0,B.jsx)(he,{jobs:x.data,loading:x.loading}),(0,B.jsx)(ge,{rows:K,gates:C.data,loading:C.loading}),(0,B.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,B.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),!e&&!n?(0,B.jsx)(v,{}):e?(0,B.jsxs)(B.Fragment,{children:[T?(0,B.jsxs)(`span`,{className:`act-big act-wait`,children:[A,` `,(0,B.jsx)(`span`,{className:`dim act-sm`,children:A===1?`session`:`sessions`})]}):null,(0,B.jsx)(`p`,{className:`dim act-sm`,children:T?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]}):(0,B.jsx)(`p`,{className:`dim act-sm`,children:`The sessions could not be read.`})]})]}),(0,B.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,B.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:de.map(([e,t])=>(0,B.jsxs)(`button`,{type:`button`,className:o.f===e?`chip-f on`:`chip-f`,"aria-pressed":o.f===e,onClick:()=>b({f:e}),children:[t,e===`needs`&&A>0?(0,B.jsxs)(`span`,{className:`mono`,children:[` `,A]}):null]},e))}),Z(`host`,`Host`,M),Z(`project`,`Project`,N),(0,B.jsx)(ee,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,B.jsx)(`button`,{type:`button`,className:o.v===e?`on`:``,"aria-pressed":o.v===e,onClick:()=>b({v:e}),children:t},e))})]}),P&&o.f!==`needs`&&(0,B.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,P,`; showing sessions only.`]}),R&&(e?!T&&o.f!==`needs`?null:L.length===0?o.f===`needs`?(0,B.jsx)(S,{title:`Nothing waits on you`}):(0,B.jsx)(S,{title:`No active sessions`,children:`Start an agent session and it appears here.`}):o.v===`garden`?(0,B.jsx)(oe,{sessions:L,collisions:e.collisions}):(0,B.jsx)(`div`,{className:`stack gap-12 act-live`,ref:k,children:L.map(e=>(0,B.jsx)(`div`,{"data-flip":F(e),children:(0,B.jsx)(ce,{s:e})},F(e)))}):(0,B.jsx)(v,{label:`Reading live sessions…`})),V.length>0&&(0,B.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,B.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),H.map(e=>(0,B.jsx)(`div`,{children:(0,B.jsx)(ce,{s:e})},F(e))),V.length>be&&(0,B.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":d,onClick:()=>f(e=>!e),children:d?`Show fewer`:`Show all ${V.length}`})]}),o.f!==`needs`&&(0,B.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Y,children:q.map(e=>(0,B.jsxs)(`section`,{className:`card act-day`,children:[(0,B.jsxs)(`h3`,{className:`act-day-h`,children:[(0,B.jsx)(`span`,{children:e.title}),(0,B.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,B.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,B.jsx)(ve,{job:e,longest:J},e.id)),e.gate&&(0,B.jsx)(ye,{gate:e.gate})]})]},e.key))})]})}export{Se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{F as i,G as a,M as o,O as s,bt as c,it as l,j as u,rt as d,wt as f}from"./index-BQwOmbor.js";import{t as p}from"./EmptyState-CY5Pm2xy.js";import{a as m,d as h,f as g,i as _,l as v,o as y,r as b,t as x,v as S}from"./Bonsai-hiG_gGNU.js";import{t as C}from"./usePoll-o8ul-Sog.js";var w=e(t(),1),T=n();function E(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function D({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${o(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,T.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,T.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,T.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,T.jsx)(`span`,{className:`feed-dot act-inline-dot ${E(e)||`acc`}`}),e.kind===`thinking`&&(0,T.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,T.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,T.jsx)(`b`,{children:i}),e.error&&(0,T.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,T.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,T.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${f(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function O({turns:e}){return!e||e.length===0?(0,T.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,T.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,T.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,T.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,T.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var k=5;function A({s:e}){let[t]=(0,w.useState)(y),[n,r]=(0,w.useState)(null),a=!!e.ended,o=a?{...e,status:i(e)?`busy`:e.status,error:null}:e,s=S(o,t),c=(0,w.useMemo)(()=>g(o,{sakura:t}),[s]),l=(0,w.useCallback)(e=>r(e),[]),u=v(e),d=Number(e.turns)||0,f=Number(e.compactions)||0,p=[`${d} turn${d===1?``:`s`}`,`context ${u==null?`unknown`:`${Math.round(u*100)} %`}`,`${f} compaction${f===1?``:`s`}`,`sub-agents: ${c.pads.filter(e=>e.key!=null).length} ${a?`unfinished`:`running`}, ${c.fallen.length} finished`].join(` · `),h=n==null?null:c.pads[n];return(0,T.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!a&&i(e)?` gd-needs`:``}`,children:[(0,T.jsx)(`div`,{role:`group`,tabIndex:0,"aria-label":`Bonsai pads, arrow keys walk them`,onKeyDown:e=>_(e,c.pads.length,n,l),children:(0,T.jsx)(b,{t:c,pad:n,swaying:!a&&e.status!==`idle`,onPad:l,px:k,label:`Bonsai of this session${a?`, ended`:``}: ${p}`})}),(0,T.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[a&&(0,T.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,T.jsx)(`div`,{className:`dim act-sm`,children:p}),(0,T.jsx)(`span`,{className:`sr-only`,role:`status`,children:m(h)}),h?(0,T.jsx)(x,{pad:h}):(0,T.jsx)(`div`,{className:`dim act-xs`,children:`Hover or tap a pad, or use the arrow keys, for its files.`})]})]})}function j({sid:e}){let{sid:t,install:n}=h(e,window.location.hash),[i,o]=(0,w.useState)(null),[m,g]=(0,w.useState)(``),[_,v]=(0,w.useState)(!1),[y,b]=(0,w.useState)(!1),x=(0,w.useId)();C(e=>_?void 0:r.activityDetail(t,n).then(t=>{e()&&(o(t),g(``),v(!1))},t=>{e()&&(t.status===404?v(!0):g(t.message))}),2e3,[t,_]);let S=(0,T.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,T.jsx)(c,{name:`arrow`}),` Activity`]});if(_)return(0,T.jsxs)(`div`,{className:`page-fill`,children:[S,(0,T.jsx)(p,{title:`Session ended`,action:(0,T.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!i)return(0,T.jsxs)(`div`,{className:`page-fill`,children:[S,m?(0,T.jsx)(d,{error:m}):(0,T.jsx)(l,{label:`Loading session…`})]});let E=i.session,k=E.files,j=E.todos,M=!!(k&&k.items&&k.items.length>0),N=!!(j&&j.items&&j.items.length>0),P=i.conversation||[],F=i.timeline||[],I=[...P.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...F.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,T.jsxs)(`div`,{className:`page-fill`,children:[S,(0,T.jsx)(a,{title:E.title||u(E.cwd)||E.session_id,sub:E.cwd?(0,T.jsx)(`span`,{className:`mono act-cwd`,title:E.cwd,children:E.cwd}):null}),m&&(0,T.jsx)(`div`,{className:`act-gap`,children:(0,T.jsx)(d,{error:m})}),(0,T.jsxs)(`div`,{className:`card pad-md`,children:[(0,T.jsx)(s,{s:E}),(0,T.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,f(E.updated_at),` ago`]})]}),(0,T.jsx)(A,{s:E}),(M||N)&&(0,T.jsxs)(`div`,{className:`grid gap-12 act-panels${M&&N?` two`:``}`,children:[M&&(0,T.jsxs)(`div`,{className:`card pad-md`,children:[(0,T.jsx)(`div`,{className:`card-head`,children:(0,T.jsxs)(`h2`,{children:[`Files touched `,(0,T.jsxs)(`span`,{className:`dim`,children:[`(`,k.count,`)`]})]})}),(0,T.jsx)(`div`,{className:`stack act-list`,children:k.items.map(e=>(0,T.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,T.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,T.jsxs)(`span`,{className:`act-fixed`,children:[(0,T.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,T.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),N&&(0,T.jsxs)(`div`,{className:`card pad-md`,children:[(0,T.jsx)(`div`,{className:`card-head`,children:(0,T.jsxs)(`h2`,{children:[`Plan`,` `,(0,T.jsxs)(`span`,{className:`dim`,children:[`(`,j.done,`/`,j.total,`)`]})]})}),(0,T.jsx)(`div`,{className:`stack act-list`,children:j.items.map((e,t)=>(0,T.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,T.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,T.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,T.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,T.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,T.jsx)(`h2`,{children:`Timeline`}),F.length>0&&(0,T.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":y,"aria-controls":x,onClick:()=>b(e=>!e),children:y?`Show conversation`:`Show full stream (${I.length})`})]}),(0,T.jsx)(`div`,{id:x,children:y?(0,T.jsx)(`div`,{className:`stack gap-12`,children:I.map((e,t)=>(0,T.jsx)(D,{rec:e},t))}):(0,T.jsx)(O,{turns:P})})]})]})}export{A as SessionTree,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{mt as r}from"./index-BNttaGQb.js";var i=e(t(),1),a=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},o=e=>()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},s=e=>Math.max(0,Math.min(1,e)),c={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},l={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},u={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},d=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],f=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],p=[`#3E8E41`,`#5FB14F`],m=[`#4A4F54`,`#62686E`],h=`#FFF6E0`,g=[`#E3C24A`,`#C9A23A`],_=[`#9BDD6A`,`#D8F59A`],v={"!":`#E8B04A`,x:`#FF6F69`},y=12;function b(e){let t=String(e||``).toLowerCase();return/implement|develop/.test(t)?`developer`:/explor/.test(t)?`explorer`:/review/.test(t)?`reviewer`:/test/.test(t)?`tester`:null}var x=e=>e?.status===`blocked`||e?.status===`waiting-input`;function S(e){return Array.isArray(e.files_all)?e.files_all.filter(e=>e&&typeof e==`object`):(Array.isArray(e.files?.items)?e.files.items:[]).filter(e=>e&&typeof e==`object`).map(e=>({file:e.file??null,path:e.path??null,additions:e.additions??0,deletions:e.deletions??0,by:e.by??null}))}var C=e=>e==null||e===``?NaN:Number(e);function w(e){let t=C(e?.context?.used),n=C(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?s(t/n):null}function T(e){let t=S(e),n=(Array.isArray(e.agents)?e.agents:[]).filter(e=>e&&typeof e==`object`).map((e,t)=>({key:e.id??`#${t}`,id:e.id??null,type:e.type||null,running:e.status!==`done`,files:[]})),r=new Map(n.map(e=>[e.key,e])),i=[],a=e.attribution!==!1;for(let e of t){if(!a||e.by==null){i.push(e);continue}let t=r.get(e.by);t||(t={key:e.by,id:e.by,type:`agent`,running:!0,files:[]},n.push(t),r.set(e.by,t)),t.files.push(e)}let o=w(e),l=o!=null,u=l?C(e.context.used):NaN,d=l?o:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=C(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?s(u/p):0;return{id:String(e.session_id??``),host:c[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:x(e)?`!`:e.error?`x`:null,turns:Math.max(0,Number(e.turns)||0),ctx:d,compactions:f,compacted:f>0&&m<1,regrow:m,crown:i,agents:n}}function E(e,t=!1){let n=T(e);return JSON.stringify([n.id,n.host,n.idle,n.bubble,n.turns,Math.round(n.ctx*100),n.compactions,Math.round(n.regrow*100),n.crown.length,n.agents.map(e=>[e.key,e.type,e.running,e.files.length]),!!t])}function D(e,{sakura:t=!1}={}){let n=T(e),{id:r,idle:i}=n,s=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*s,S=o(a(r)),C=Array.from({length:56},()=>Array(56).fill(null)),w=Array.from({length:56},()=>Array(56).fill(-1)),E=-1,D=(e,t,n)=>{e=Math.round(e),t=Math.round(t),e>=0&&e<56&&t>=0&&t<56&&(C[t][e]=n,w[t][e]=E)},O=i?f:d,k=i?m:p,A=i?l.idle:t?l.sakura:l.live,j=Math.round(41-(9+18*s)),M=1+S()*2+3*s,N=S()*Math.PI*2,P=.9+S()*.6,F=e=>28+M*Math.sin(e*Math.PI*P+N)-M*Math.sin(N);for(let e=41;e>=j;e--){let t=(41-e)/(41-j),n=F(t),r=3+4.5*s-(1.5+3.5*s)*t;for(let t=Math.floor(n-r/2);t<=Math.ceil(n+r/2);t++){let i=(t-(n-r/2))/r;D(t,e,i<.25?O[3]:i>.75?O[0]:S()<.15?O[1]:O[2])}}for(let e=-6;e<=6;e++)D(28+e,41,Math.abs(e)>4?O[1]:O[2]),Math.abs(e)<=5&&D(28+e,40,Math.abs(e)>3?O[1]:O[2]);let I=[],L=(e,t,n,i,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=o(a(`${r}:pad:${c}`)),u=n*.72;t=Math.max(t,u+6);for(let r=0;r<6;r++){let r=-Math.PI*(.15+.7*l()),i=n*(.4+.5*l());for(let n=0;n<i;n++)D(e+Math.cos(r)*n,t+u*.5+Math.sin(r)*n*.8,O[0])}let d=Math.round(10+n*1.6),f=[];for(let r=0;r<d;r++){let r=l()*Math.PI*2,i=Math.sqrt(l());f.push([e+Math.cos(r)*i*n,t+Math.sin(r)*i*u,1.8+l()*2.2])}f.sort((e,t)=>t[1]-e[1]);for(let[e,n,r]of f){let a=Math.max(0,Math.min(4,Math.round(4*(1-(n-(t-u))/(2*u))+(l()-.5))));for(let t=Math.floor(n-r);t<=n+r;t++)for(let o=Math.floor(e-r);o<=e+r;o++){if(((o-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=o-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(o,t,i[Math.max(0,Math.min(4,a+s))])}}let p=o(a(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,y);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,h);return{rx:n,cy:t}},R=o(a(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let c=.25+.55*(t/Math.max(1,n.agents.length-1)),l=Math.round(41-c*(41-j)),d=F(c);if(!e.running){let t=(3+4.5*s-(1.5+3.5*s)*c)/2;E=-1,D(d+R*(t+1),l,O[3]),D(d+R*(t+2),l-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let f=Math.round((12+Math.floor(o(a(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=f;e++){let t=d+R*e,n=l-e*.45;D(t,n,O[e<f/2?1:2]),D(t,n+1,O[0]),e<f*.6&&D(t,n+2,O[0])}let p=i?null:b(e.type),m=p?u[p]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:p,files:e.files,bbox:null}),L(d+R*f,l-f*.45-2,(8+Math.min(e.files.length,6)*.6)*x,m,e.files.length,e.key),R=-R});let B=I.length;I.push({agentId:null,key:null,type:null,family:null,files:n.crown,bbox:null}),E=B;let V=(4+7*n.ctx+Math.min(n.crown.length,6)*.5)*x*1.35,{rx:H,cy:U}=L(F(1),j-3,V,A,n.crown.length,`crown`);if(n.ctx>.8&&!n.compacted){let e=o(a(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)w[t][n]===B&&C[t][n]!==h&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?g[0]:g[1])}if(n.compacted){let e=o(a(`${r}:shoots`)),t=Math.round(U-H*.15-n.regrow*H*.5);for(let e=0;e<Math.max(0,t);e++)for(let t=0;t<56;t++)w[e][t]===B&&(C[e][t]=null,w[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(w[t][r]!==B||e()>=.12+n.regrow*.5)continue;let i=1+Math.floor(e()*(1+n.regrow*3));for(let e=1;e<=i;e++)D(r,t-e,e===i?_[1]:_[0])}}E=-1;let W=o(a(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,l.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,h);let[G,K,q]=c[n.host];for(let e=42;e<=46;e++){let t=e<=43?0:Math.floor((e-43)*.45)+2;for(let n=13+t;n<=42-t;n++){if(e===42&&C[e][n]===h)continue;let r=K;e<=43?r=e===42?q:G:(e===46||n===13+t||n===42-t)&&(r=G),D(n,e,r)}}let J=o(a(`${r}:moss`));for(let e=15;e<=40;e++)D(e,41,J()<.5?k[0]:k[1]),J()<.35&&D(e,40,k[0]);for(let e=16;e<=39;e++)D(e,47,`#00000055`);if(n.bubble){let e=v[n.bubble];for(let t=3;t<10;t++)for(let n=40;n<47;n++)D(n,t,t===3||t===9||n===40||n===46?e:`#14191F`);if(D(41,10,e),n.bubble===`!`){for(let t=5;t<=6;t++)D(43,t,e);D(43,8,e)}else for(let[t,n]of[[2,2],[4,2],[3,3],[2,4],[4,4]])D(40+t,3+n,e)}let Y=[],X=I.map(()=>null);for(let e=0;e<56;e++){let t=0;for(;t<56;){let n=C[e][t],r=w[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&w[e][i+1]===r;)i++;if(Y.push({x:t,y:e,w:i-t+1,c:n,p:r}),r>=0){let n=X[r]||={x0:t,y0:e,x1:i,y1:e};n.x0=Math.min(n.x0,t),n.x1=Math.max(n.x1,i),n.y1=e}t=i+1}}return I.forEach((e,t)=>{let n=X[t];e.bbox=n?{x:n.x0,y:n.y0,w:n.x1-n.x0+1,h:n.y1-n.y0+1}:null}),{width:56,height:56,runs:Y,pads:I,bubble:n.bubble,fallen:z}}var O=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},k=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function A(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?k(e):n.cwd?`cwd:${k(n.cwd)}`:`outside a repo`),i=O(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&k(n.root)!==k(e)?O(n.root):null;t.get(r).trees.push({s:n,worktree:a})}let n=(e,t)=>e<t?-1:+(e>t),r=[...t.values()];for(let e of r)e.trees.sort((e,t)=>n(e.worktree||``,t.worktree||``)||n(String(e.s.session_id),String(t.s.session_id)));return r.sort((e,t)=>n(e.name.toLowerCase(),t.name.toLowerCase())||n(e.key,t.key))}var j=e=>e.key??(e.install?`${e.install}\0${e.session_id}`:String(e.session_id)),M=e=>j({key:e.key??void 0,install:e.install,session_id:e.sid}),N=(e,t)=>String(e).split(/[\\/]+/).filter(Boolean).slice(-t).join(`/`),P=e=>r(e.host).label;function F(e){let t=e||[],n=e=>n=>t.filter(t=>e(t)===e(n)).length,r=n(e=>e.host),i=n(e=>`${e.host} ${e.scope}`),a=new Map(t.map(e=>[e.install,r(e)<2?P(e):i(e)<2||e.scope===`global`?`${P(e)} · ${e.scope}`:`${P(e)} · ${O(e.path)}`])),o=()=>t.filter(e=>t.some(t=>t!==e&&a.get(t.install)===a.get(e.install)));for(let e=2,t=o();t.length;e++,t=o()){for(let n of t){let t=String(n.path).split(/[\\/]+/).filter(Boolean).length;a.set(n.install,`${P(n)} · ${e>t?n.path:N(n.path,e)}`)}if(e>64)break}return a}var I=(e,t)=>`#/activity/${encodeURIComponent(e)}`+(t?`?${new URLSearchParams({host:t.host,path:t.path})}`:``);function L(e,t){let n=String(e).indexOf(`?`),r=new URLSearchParams(String(t||``).split(`?`)[1]||``),i=r.get(`host`),a=r.get(`path`);return{sid:n<0?e:String(e).slice(0,n),install:i&&a?{host:i,path:a}:void 0}}function R(e,t){let n=new Map((t||[]).map(e=>[e.install,e])),i=F(t);return(e||[]).map(e=>{let t=n.get(e.install);return{...e,host:t?.host??e.host,chip:i.get(e.install)??(e.host?r(e.host).label:null),href:I(e.session_id,t)}})}var z=(e,t)=>new Set((e.writers||[]).filter(e=>M(e)===t).map(e=>k(e.root)));function B(e,t,n){let r=z(e,t);for(let t of z(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var V=e=>[...new Set((e.writers||[]).map(M))];function H(e,t){let n=new Map(e.map((e,t)=>[j(e.s),t])),r=new Map;for(let e of t||[]){let t=V(e).filter(e=>n.has(e));for(let i=0;i<t.length;i++)for(let a=i+1;a<t.length;a++){let o=n.get(t[i]),s=n.get(t[a]),c=o<s?`${o}-${s}`:`${s}-${o}`,l=B(e,t[i],t[a]);r.has(c)&&l!==`same-worktree`||r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function U(e,t){let n=[];for(let r of t||[]){let t=V(r).filter(t=>t!==e);if(!t.length||!V(r).includes(e))continue;let i=t.some(t=>B(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var W=e=>e?.status===`busy`||x(e);function G(e,t=10){let n=e.map(e=>({...e,collapsed:!1})),r=n.reduce((e,t)=>e+t.trees.length,0);if(r<=t)return n;let i=n.length,a=n.filter(e=>!e.trees.some(e=>W(e.s))).sort((e,t)=>t.trees.length-e.trees.length||(e.key<t.key?-1:1));for(let e of a){if(r<=t||i<=1)break;e.collapsed=!0,r-=e.trees.length,i--}return n}var K=n(),q=12,J=10,Y=`geneseed-garden-sakura`;function X(){try{return window.localStorage.getItem(Y)===`1`}catch{return!1}}var Z=e=>e.key==null?`the session`:e.type||`agent`,Q=e=>e.path||e.file||`?`;function $({pad:e}){let t=e.files.slice(0,q);return(0,K.jsxs)(`div`,{className:`card gd-card`,children:[(0,K.jsxs)(`div`,{className:`act-lbl`,children:[Z(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,K.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`mono act-ell`,children:Q(e)}),(0,K.jsxs)(`span`,{className:`mono act-xs`,children:[(0,K.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,K.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${Q(e)}:${t}`))}),e.files.length>t.length&&(0,K.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var ee=e=>e?`${Z(e)}: ${e.files.length} file${e.files.length===1?``:`s`}`:``;function te(e,t,n,r){let i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];e.key===`Escape`&&n!=null&&r(null),i&&t&&(e.preventDefault(),r(n==null?i>0?0:t-1:(n+i+t)%t))}var ne=(0,i.memo)(function({t:e,pad:t,swaying:n,onPad:r,px:a,label:o}){let s=(0,i.useMemo)(()=>{let t=new Map;for(let n of e.runs)t.has(n.p)||t.set(n.p,[]),t.get(n.p).push(n);return[...t.entries()]},[e]),c=(0,i.useRef)(null),l=e=>{let[t,n]=[c.current,e.changedTouches?.[0]];return!!t&&!!n&&Math.hypot(n.clientX-t.x,n.clientY-t.y)>J};return(0,K.jsx)(`svg`,{onTouchStart:e=>{let t=e.touches?.[0];c.current=t?{x:t.clientX,y:t.clientY}:null},className:`gd-svg${t==null?``:` gd-dimming`}`,viewBox:`0 0 56 56`,width:56*a,height:56*a,shapeRendering:`crispEdges`,"data-bubble":e.bubble||void 0,...o?{role:`img`,"aria-label":o}:{"aria-hidden":`true`},children:s.map(([i,a])=>(0,K.jsx)(`g`,{"data-p":i,className:[i===t&&`gd-hot`,n&&i>=0&&e.pads[i].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:i>=0?()=>r(i):void 0,onMouseLeave:i>=0?()=>r(null):void 0,onTouchEnd:i>=0?e=>{l(e)||(e.cancelable&&e.preventDefault(),r(i===t?null:i))}:void 0,children:a.map(e=>(0,K.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},i))})});export{H as _,ee as a,G as c,L as d,D as f,U as g,R as h,te as i,w as l,F as m,Y as n,X as o,A as p,ne as r,j as s,$ as t,I as u,E as v};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{ht as r}from"./index-BQwOmbor.js";var i=e(t(),1),a=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},o=e=>()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},s=e=>Math.max(0,Math.min(1,e)),c={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},l={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},u={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},d=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],f=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],p=[`#3E8E41`,`#5FB14F`],m=[`#4A4F54`,`#62686E`],h=`#FFF6E0`,g=[`#E3C24A`,`#C9A23A`],_=[`#9BDD6A`,`#D8F59A`],v={"!":`#E8B04A`,x:`#FF6F69`},y=12;function b(e){let t=String(e||``).toLowerCase();return/implement|develop/.test(t)?`developer`:/explor/.test(t)?`explorer`:/review/.test(t)?`reviewer`:/test/.test(t)?`tester`:null}var x=e=>e?.status===`blocked`||e?.status===`waiting-input`;function S(e){return Array.isArray(e.files_all)?e.files_all.filter(e=>e&&typeof e==`object`):(Array.isArray(e.files?.items)?e.files.items:[]).filter(e=>e&&typeof e==`object`).map(e=>({file:e.file??null,path:e.path??null,additions:e.additions??0,deletions:e.deletions??0,by:e.by??null}))}var C=e=>e==null||e===``?NaN:Number(e);function w(e){let t=C(e?.context?.used),n=C(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?s(t/n):null}function T(e){let t=S(e),n=(Array.isArray(e.agents)?e.agents:[]).filter(e=>e&&typeof e==`object`).map((e,t)=>({key:e.id??`#${t}`,id:e.id??null,type:e.type||null,running:e.status!==`done`,files:[]})),r=new Map(n.map(e=>[e.key,e])),i=[],a=e.attribution!==!1;for(let e of t){if(!a||e.by==null){i.push(e);continue}let t=r.get(e.by);t||(t={key:e.by,id:e.by,type:`agent`,running:!0,files:[]},n.push(t),r.set(e.by,t)),t.files.push(e)}let o=w(e),l=o!=null,u=l?C(e.context.used):NaN,d=l?o:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=C(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?s(u/p):0;return{id:String(e.session_id??``),host:c[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:x(e)?`!`:e.error?`x`:null,turns:Math.max(0,Number(e.turns)||0),ctx:d,compactions:f,compacted:f>0&&m<1,regrow:m,crown:i,agents:n}}function E(e,t=!1){let n=T(e);return JSON.stringify([n.id,n.host,n.idle,n.bubble,n.turns,Math.round(n.ctx*100),n.compactions,Math.round(n.regrow*100),n.crown.length,n.agents.map(e=>[e.key,e.type,e.running,e.files.length]),!!t])}function D(e,{sakura:t=!1}={}){let n=T(e),{id:r,idle:i}=n,s=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*s,S=o(a(r)),C=Array.from({length:56},()=>Array(56).fill(null)),w=Array.from({length:56},()=>Array(56).fill(-1)),E=-1,D=(e,t,n)=>{e=Math.round(e),t=Math.round(t),e>=0&&e<56&&t>=0&&t<56&&(C[t][e]=n,w[t][e]=E)},O=i?f:d,k=i?m:p,A=i?l.idle:t?l.sakura:l.live,j=Math.round(41-(9+18*s)),M=1+S()*2+3*s,N=S()*Math.PI*2,P=.9+S()*.6,F=e=>28+M*Math.sin(e*Math.PI*P+N)-M*Math.sin(N);for(let e=41;e>=j;e--){let t=(41-e)/(41-j),n=F(t),r=3+4.5*s-(1.5+3.5*s)*t;for(let t=Math.floor(n-r/2);t<=Math.ceil(n+r/2);t++){let i=(t-(n-r/2))/r;D(t,e,i<.25?O[3]:i>.75?O[0]:S()<.15?O[1]:O[2])}}for(let e=-6;e<=6;e++)D(28+e,41,Math.abs(e)>4?O[1]:O[2]),Math.abs(e)<=5&&D(28+e,40,Math.abs(e)>3?O[1]:O[2]);let I=[],L=(e,t,n,i,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=o(a(`${r}:pad:${c}`)),u=n*.72;t=Math.max(t,u+6);for(let r=0;r<6;r++){let r=-Math.PI*(.15+.7*l()),i=n*(.4+.5*l());for(let n=0;n<i;n++)D(e+Math.cos(r)*n,t+u*.5+Math.sin(r)*n*.8,O[0])}let d=Math.round(10+n*1.6),f=[];for(let r=0;r<d;r++){let r=l()*Math.PI*2,i=Math.sqrt(l());f.push([e+Math.cos(r)*i*n,t+Math.sin(r)*i*u,1.8+l()*2.2])}f.sort((e,t)=>t[1]-e[1]);for(let[e,n,r]of f){let a=Math.max(0,Math.min(4,Math.round(4*(1-(n-(t-u))/(2*u))+(l()-.5))));for(let t=Math.floor(n-r);t<=n+r;t++)for(let o=Math.floor(e-r);o<=e+r;o++){if(((o-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=o-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(o,t,i[Math.max(0,Math.min(4,a+s))])}}let p=o(a(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,y);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,h);return{rx:n,cy:t}},R=o(a(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let c=.25+.55*(t/Math.max(1,n.agents.length-1)),l=Math.round(41-c*(41-j)),d=F(c);if(!e.running){let t=(3+4.5*s-(1.5+3.5*s)*c)/2;E=-1,D(d+R*(t+1),l,O[3]),D(d+R*(t+2),l-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let f=Math.round((12+Math.floor(o(a(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=f;e++){let t=d+R*e,n=l-e*.45;D(t,n,O[e<f/2?1:2]),D(t,n+1,O[0]),e<f*.6&&D(t,n+2,O[0])}let p=i?null:b(e.type),m=p?u[p]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:p,files:e.files,bbox:null}),L(d+R*f,l-f*.45-2,(8+Math.min(e.files.length,6)*.6)*x,m,e.files.length,e.key),R=-R});let B=I.length;I.push({agentId:null,key:null,type:null,family:null,files:n.crown,bbox:null}),E=B;let V=(4+7*n.ctx+Math.min(n.crown.length,6)*.5)*x*1.35,{rx:H,cy:U}=L(F(1),j-3,V,A,n.crown.length,`crown`);if(n.ctx>.8&&!n.compacted){let e=o(a(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)w[t][n]===B&&C[t][n]!==h&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?g[0]:g[1])}if(n.compacted){let e=o(a(`${r}:shoots`)),t=Math.round(U-H*.15-n.regrow*H*.5);for(let e=0;e<Math.max(0,t);e++)for(let t=0;t<56;t++)w[e][t]===B&&(C[e][t]=null,w[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(w[t][r]!==B||e()>=.12+n.regrow*.5)continue;let i=1+Math.floor(e()*(1+n.regrow*3));for(let e=1;e<=i;e++)D(r,t-e,e===i?_[1]:_[0])}}E=-1;let W=o(a(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,l.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,h);let[G,K,q]=c[n.host];for(let e=42;e<=46;e++){let t=e<=43?0:Math.floor((e-43)*.45)+2;for(let n=13+t;n<=42-t;n++){if(e===42&&C[e][n]===h)continue;let r=K;e<=43?r=e===42?q:G:(e===46||n===13+t||n===42-t)&&(r=G),D(n,e,r)}}let J=o(a(`${r}:moss`));for(let e=15;e<=40;e++)D(e,41,J()<.5?k[0]:k[1]),J()<.35&&D(e,40,k[0]);for(let e=16;e<=39;e++)D(e,47,`#00000055`);if(n.bubble){let e=v[n.bubble];for(let t=3;t<10;t++)for(let n=40;n<47;n++)D(n,t,t===3||t===9||n===40||n===46?e:`#14191F`);if(D(41,10,e),n.bubble===`!`){for(let t=5;t<=6;t++)D(43,t,e);D(43,8,e)}else for(let[t,n]of[[2,2],[4,2],[3,3],[2,4],[4,4]])D(40+t,3+n,e)}let Y=[],X=I.map(()=>null);for(let e=0;e<56;e++){let t=0;for(;t<56;){let n=C[e][t],r=w[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&w[e][i+1]===r;)i++;if(Y.push({x:t,y:e,w:i-t+1,c:n,p:r}),r>=0){let n=X[r]||={x0:t,y0:e,x1:i,y1:e};n.x0=Math.min(n.x0,t),n.x1=Math.max(n.x1,i),n.y1=e}t=i+1}}return I.forEach((e,t)=>{let n=X[t];e.bbox=n?{x:n.x0,y:n.y0,w:n.x1-n.x0+1,h:n.y1-n.y0+1}:null}),{width:56,height:56,runs:Y,pads:I,bubble:n.bubble,fallen:z}}var O=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},k=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function A(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?k(e):n.cwd?`cwd:${k(n.cwd)}`:`outside a repo`),i=O(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&k(n.root)!==k(e)?O(n.root):null;t.get(r).trees.push({s:n,worktree:a})}let n=(e,t)=>e<t?-1:+(e>t),r=[...t.values()];for(let e of r)e.trees.sort((e,t)=>n(e.worktree||``,t.worktree||``)||n(String(e.s.session_id),String(t.s.session_id)));return r.sort((e,t)=>n(e.name.toLowerCase(),t.name.toLowerCase())||n(e.key,t.key))}var j=e=>e.key??(e.install?`${e.install}\0${e.session_id}`:String(e.session_id)),M=e=>j({key:e.key??void 0,install:e.install,session_id:e.sid}),N=(e,t)=>String(e).split(/[\\/]+/).filter(Boolean).slice(-t).join(`/`),P=e=>r(e.host).label;function F(e){let t=e||[],n=e=>n=>t.filter(t=>e(t)===e(n)).length,r=n(e=>e.host),i=n(e=>`${e.host} ${e.scope}`),a=new Map(t.map(e=>[e.install,r(e)<2?P(e):i(e)<2||e.scope===`global`?`${P(e)} · ${e.scope}`:`${P(e)} · ${O(e.path)}`])),o=()=>t.filter(e=>t.some(t=>t!==e&&a.get(t.install)===a.get(e.install)));for(let e=2,t=o();t.length;e++,t=o()){for(let n of t){let t=String(n.path).split(/[\\/]+/).filter(Boolean).length;a.set(n.install,`${P(n)} · ${e>t?n.path:N(n.path,e)}`)}if(e>64)break}return a}var I=(e,t)=>`#/activity/${encodeURIComponent(e)}`+(t?`?${new URLSearchParams({host:t.host,path:t.path})}`:``);function L(e,t){let n=String(e).indexOf(`?`),r=new URLSearchParams(String(t||``).split(`?`)[1]||``),i=r.get(`host`),a=r.get(`path`);return{sid:n<0?e:String(e).slice(0,n),install:i&&a?{host:i,path:a}:void 0}}function R(e,t){let n=new Map((t||[]).map(e=>[e.install,e])),i=F(t);return(e||[]).map(e=>{let t=n.get(e.install);return{...e,host:t?.host??e.host,chip:i.get(e.install)??(e.host?r(e.host).label:null),href:I(e.session_id,t)}})}var z=(e,t)=>new Set((e.writers||[]).filter(e=>M(e)===t).map(e=>k(e.root)));function B(e,t,n){let r=z(e,t);for(let t of z(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var V=e=>[...new Set((e.writers||[]).map(M))];function H(e,t){let n=new Map(e.map((e,t)=>[j(e.s),t])),r=new Map;for(let e of t||[]){let t=V(e).filter(e=>n.has(e));for(let i=0;i<t.length;i++)for(let a=i+1;a<t.length;a++){let o=n.get(t[i]),s=n.get(t[a]),c=o<s?`${o}-${s}`:`${s}-${o}`,l=B(e,t[i],t[a]);r.has(c)&&l!==`same-worktree`||r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function U(e,t){let n=[];for(let r of t||[]){let t=V(r).filter(t=>t!==e);if(!t.length||!V(r).includes(e))continue;let i=t.some(t=>B(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var W=e=>e?.status===`busy`||x(e);function G(e,t=10){let n=e.map(e=>({...e,collapsed:!1})),r=n.reduce((e,t)=>e+t.trees.length,0);if(r<=t)return n;let i=n.length,a=n.filter(e=>!e.trees.some(e=>W(e.s))).sort((e,t)=>t.trees.length-e.trees.length||(e.key<t.key?-1:1));for(let e of a){if(r<=t||i<=1)break;e.collapsed=!0,r-=e.trees.length,i--}return n}var K=n(),q=12,J=10,Y=`geneseed-garden-sakura`;function X(){try{return window.localStorage.getItem(Y)===`1`}catch{return!1}}var Z=e=>e.key==null?`the session`:e.type||`agent`,Q=e=>e.path||e.file||`?`;function $({pad:e}){let t=e.files.slice(0,q);return(0,K.jsxs)(`div`,{className:`card gd-card`,children:[(0,K.jsxs)(`div`,{className:`act-lbl`,children:[Z(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,K.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`mono act-ell`,children:Q(e)}),(0,K.jsxs)(`span`,{className:`mono act-xs`,children:[(0,K.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,K.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${Q(e)}:${t}`))}),e.files.length>t.length&&(0,K.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var ee=e=>e?`${Z(e)}: ${e.files.length} file${e.files.length===1?``:`s`}`:``;function te(e,t,n,r){let i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];e.key===`Escape`&&n!=null&&r(null),i&&t&&(e.preventDefault(),r(n==null?i>0?0:t-1:(n+i+t)%t))}var ne=(0,i.memo)(function({t:e,pad:t,swaying:n,onPad:r,px:a,label:o}){let s=(0,i.useMemo)(()=>{let t=new Map;for(let n of e.runs)t.has(n.p)||t.set(n.p,[]),t.get(n.p).push(n);return[...t.entries()]},[e]),c=(0,i.useRef)(null),l=e=>{let[t,n]=[c.current,e.changedTouches?.[0]];return!!t&&!!n&&Math.hypot(n.clientX-t.x,n.clientY-t.y)>J};return(0,K.jsx)(`svg`,{onTouchStart:e=>{let t=e.touches?.[0];c.current=t?{x:t.clientX,y:t.clientY}:null},className:`gd-svg${t==null?``:` gd-dimming`}`,viewBox:`0 0 56 56`,width:56*a,height:56*a,shapeRendering:`crispEdges`,"data-bubble":e.bubble||void 0,...o?{role:`img`,"aria-label":o}:{"aria-hidden":`true`},children:s.map(([i,a])=>(0,K.jsx)(`g`,{"data-p":i,className:[i===t&&`gd-hot`,n&&i>=0&&e.pads[i].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:i>=0?()=>r(i):void 0,onMouseLeave:i>=0?()=>r(null):void 0,onTouchEnd:i>=0?e=>{l(e)||(e.cancelable&&e.preventDefault(),r(i===t?null:i))}:void 0,children:a.map(e=>(0,K.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},i))})});export{H as _,ee as a,G as c,L as d,D as f,U as g,R as h,te as i,w as l,F as m,Y as n,X as o,A as p,ne as r,j as s,$ as t,I as u,E as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{bt as r}from"./index-BQwOmbor.js";var i=e(t(),1),a=n(),o=1200;function s({text:e,label:t,title:n,className:s=`btn ghost sm`}){let[c,l]=(0,i.useState)(null),u=(0,i.useRef)(null),d=(0,i.useRef)(!1);(0,i.useEffect)(()=>(d.current=!1,()=>{d.current=!0,clearTimeout(u.current)}),[]);let f=e=>{d.current||(l(e),clearTimeout(u.current),u.current=setTimeout(()=>l(null),o))};return(0,a.jsxs)(`button`,{type:`button`,className:s,onClick:async()=>{try{await navigator.clipboard.writeText(e),f(`ok`)}catch{f(`fail`)}},"aria-label":t,title:n,children:[(0,a.jsx)(r,{name:c===`ok`?`check`:c===`fail`?`x`:`copy`}),c===`ok`?`Copied`:c===`fail`?`Copy failed`:`Copy`]})}export{s as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-BKxy5apE.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/motion-RlUl1osO.js","assets/sections-CtFz7HFH.js","assets/index-BQwOmbor.js","assets/api-DLDVY3K-.js","assets/index-CuIop_pO.css","assets/OperatorHudView-BO0aIKPL.js","assets/JournalView-ChFitHjo.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{i as n,t as r}from"./react-C1iE8mnY.js";import{t as i}from"./api-DLDVY3K-.js";import{o as a,t as o}from"./motion-RlUl1osO.js";import{n as s,r as c}from"./sections-CtFz7HFH.js";import{$ as l,At as u,B as d,Ct as f,Et as p,St as m,V as h,W as g,bt as _,it as v,l as y,nt as b,ot as x,rt as S,t as C,wt as w,xt as T}from"./index-BQwOmbor.js";var E=t(n(),1),D={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},O=(e,t)=>e.deployed?t===void 0||t===`good`?D[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,k=r(),A={done:`ok`,failed:`bad`},j={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},M=e=>typeof e==`number`&&Number.isFinite(e);function ee(e){let t=[];for(let n of e){let e=d(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];i&&i.key===r?(i.jobs.push(n),i.durations.push(M(n.duration)?n.duration:null),n.started&&(i.oldest=n.started)):t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[M(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=w(e.newest),n=e.oldest?w(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=h(e,t),i=Math.max(0,...r.map(e=>M(e.duration)?e.duration:0))||1,a=ee(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,k.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(M),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${A[e.status]||`acc`}`,title:e.command||void 0,children:[(0,k.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:j[e.status]||(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,k.jsx)(`span`,{className:`sr-only`,children:r}),(0,k.jsxs)(`span`,{className:`run-chip-main`,children:[(0,k.jsxs)(`span`,{className:`run-chip-head`,children:[(0,k.jsx)(`b`,{children:e.verb}),n>1&&(0,k.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,k.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,k.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,k.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,k.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`,unknown:``};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=p(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=T(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(o,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>u(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(o,{value:r})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,k.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function R({overview:e}){return(0,k.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,k.jsxs)(`a`,{className:`card gcell rise`,style:{"--i":n},href:`#/section/`+t,children:[(0,k.jsxs)(`div`,{className:`gtop`,children:[(0,k.jsx)(`span`,{className:`gname`,children:r.label}),(0,k.jsx)(_,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=h(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[w(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(g,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=O(e,i?.tone),s=f(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(B,{value:s}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(I,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(L,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,k.jsx)(R,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(z,{jobs:r})]})]})]})}function H({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function U(e){return e?e.includes(`in sync`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=m(e.counts),o=n?.version_verdict||``,s=U(o),l=T(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(I,{verdict:i?.verdict}),s&&(0,k.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),s.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,k.jsx)(H,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=m(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=T(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(I,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent-text)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.doctor===null?`checking`:`${l} issue${l===1?``:`s`}`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=p(()=>q(()=>i.fleet()),[e]),r=p(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?y(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>C(()=>import(`./GreenhouseView-BKxy5apE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>C(()=>import(`./OperatorHudView-BO0aIKPL.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>C(()=>import(`./JournalView-ChFitHjo.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`genome`,dataRev:u}){let d=c,[f,m]=(0,E.useState)(`status`),[h,g]=(0,E.useState)(d);h!==d&&(g(d),m(`status`));let _=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:u,needDoctor:d===`greenhouse`||d===`hud`}),{data:C}=p(()=>d===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[d,u]);if(!e)return t?(0,k.jsx)(S,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(v,{});let w=e.daemon_stale?(0,k.jsx)(b,{}):null;return e.deployed?(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(x,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`readout`,`Readout`]].map(([e,t])=>(0,k.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>m(e),"aria-pressed":f===e,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&d===`genome`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:y,dataRev:u}),f===`status`&&d===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(v,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:y,onAction:s})}),f===`status`&&d===`hud`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(v,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),f===`status`&&d===`journal`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(v,{}),children:(0,k.jsx)(Q,{overview:e,recent:C,lens:y,dataRev:u})}),f===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:y}),f===`readout`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},f)]}):(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(l,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
|