geneseed 5.3.0 → 5.4.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 +95 -0
- package/README.md +23 -20
- package/SHIPPED.md +7 -7
- package/adapters/bob/README.md +31 -18
- package/adapters/claude-code/README.md +27 -22
- package/adapters/openclaude/README.md +18 -8
- package/adapters/opencode/HOW-OPENCODE-LOADS.md +8 -3
- package/adapters/opencode/README.md +3 -2
- package/adapters/opencode/plugins/geneseed-activity.js +20 -21
- package/adapters/opencode/plugins/geneseed-context.js +175 -62
- package/adapters/opencode/plugins/geneseed-guard.js +419 -205
- package/adapters/opencode/plugins/geneseed-workflow.js +3 -2
- package/adapters/opencode/workflows/_runtime.js +3 -2
- package/bin/geneseed-cli.mjs +7 -0
- package/bin/geneseed-hook.mjs +59 -11
- package/docs/PRD.md +1 -1
- package/docs/README.md +1 -0
- package/docs/concepts/agents.md +1 -1
- package/docs/concepts/collaboration.md +2 -2
- package/docs/concepts/enforcement-table.md +5 -2
- package/docs/concepts/exclusions.md +18 -4
- package/docs/concepts/footprint.md +11 -1
- package/docs/concepts/foreman-mode.md +1 -1
- package/docs/concepts/hook-gates.md +5 -5
- package/docs/concepts/hooks.md +4 -3
- package/docs/concepts/host-matrix.md +24 -6
- package/docs/concepts/kits.md +12 -2
- package/docs/concepts/loop-bricks.md +3 -3
- package/docs/concepts/loops.md +6 -4
- package/docs/concepts/ownership.md +1 -1
- package/docs/concepts/rules.md +2 -2
- package/docs/concepts/skills.md +1 -1
- package/docs/design-history.md +8 -0
- package/docs/extending.md +112 -35
- package/docs/guides/auto-merge.md +100 -0
- package/docs/guides/choose-your-setup.md +1 -1
- package/docs/guides/headless.md +1 -1
- package/docs/guides/install-bob.md +2 -2
- package/docs/guides/install-clone.md +1 -1
- package/docs/guides/install-openclaude.md +1 -1
- package/docs/guides/install.md +1 -1
- package/docs/guides/loop-finish.md +3 -3
- package/docs/guides/loop-running.md +4 -4
- package/docs/guides/project-context.md +1 -1
- package/docs/guides/run-a-factory.md +2 -2
- package/docs/guides/setup-doctrines.md +2 -2
- package/docs/guides/setup-footprint.md +1 -1
- package/docs/guides/uninstall.md +3 -3
- package/docs/guides/upgrade.md +1 -1
- package/docs/guides/verify.md +12 -0
- package/docs/guides/worktree.md +1 -1
- package/docs/reference/environment.md +5 -2
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/reference/plugin-guard.md +1 -1
- package/docs/reference/plugin-learn.md +1 -1
- package/docs/reference/plugin-workflow.md +1 -1
- package/docs/reference/troubleshoot-doctor.md +2 -2
- package/docs/reference/troubleshoot-hooks.md +2 -2
- package/docs/reference/troubleshoot-install.md +3 -3
- package/docs/reference/troubleshoot-tools.md +1 -1
- package/docs/token-footprint.md +68 -4
- package/docs/understand/design-choices-hosts.md +1 -1
- package/docs/understand/design-choices-shape.md +1 -0
- package/docs/understand/enforced-vs-asked.md +2 -2
- package/docs/understand/machine-bob.md +1 -1
- package/docs/understand/machine-claude.md +2 -2
- package/docs/understand/on-your-machine.md +1 -1
- package/docs/web-ui.md +10 -5
- package/harness.config.json +1 -1
- package/js/README.md +5 -3
- package/js/build/args.mjs +13 -2
- package/js/build/driver.mjs +34 -7
- package/js/build/emit-claude.mjs +9 -5
- package/js/build/emit-opencode.mjs +13 -9
- package/js/build/generate.mjs +10 -165
- package/js/build/profile.mjs +318 -0
- package/js/build/render.mjs +81 -3
- package/js/build/retired-skills.mjs +60 -13
- package/js/build/source.mjs +15 -1
- package/js/build/stubs.mjs +4 -1
- package/js/cli-table.json +48 -3
- package/js/hosts/done-checks.mjs +6 -0
- package/js/hosts/geneseed-dir.mjs +3 -2
- package/js/hosts/gitref.mjs +5 -3
- package/js/hosts/hook-tap.mjs +104 -0
- package/js/hosts/hooks-context.mjs +4 -2
- package/js/hosts/hooks-done.mjs +345 -55
- package/js/hosts/hooks-learn.mjs +51 -19
- package/js/hosts/hooks-prims.mjs +5 -3
- package/js/hosts/hooks.mjs +172 -19
- package/js/hosts/hosts.mjs +80 -12
- package/js/hosts/installs.mjs +26 -1
- package/js/hosts/native.mjs +33 -7
- package/js/hosts/owned.mjs +7 -6
- package/js/hosts/ownership-gate.mjs +14 -1
- package/js/hosts/settings.mjs +273 -105
- package/js/hosts/shim.mjs +4 -4
- package/js/hosts/usage.mjs +9 -3
- package/js/inspect/checks-constitution.mjs +32 -0
- package/js/inspect/checks-probe.mjs +66 -5
- package/js/inspect/checks-repo.mjs +196 -2
- package/js/inspect/cost.mjs +34 -2
- package/js/inspect/diff.mjs +21 -3
- package/js/inspect/doctor.mjs +6 -1
- package/js/inspect/inventory.mjs +1 -1
- package/js/lib/machine-dir.mjs +1 -1
- package/js/lib/node-floor.mjs +46 -6
- package/js/maintain/setup.mjs +5 -1
- package/js/maintain/uninstall.mjs +42 -16
- package/js/maintain/update.mjs +4 -2
- package/js/web/actions.mjs +17 -12
- package/js/web/api.mjs +7 -2
- package/package.json +1 -1
- package/registry.json +14 -0
- package/src/AGENT.md.tmpl +15 -17
- package/src/bricks/pr-open.md +3 -2
- package/src/doctrines/ops.md +2 -2
- package/src/doctrines/process.md +40 -36
- package/src/factories/analysis-to-build.json +1 -1
- package/src/factories/bug-report-to-fix.json +1 -1
- package/src/factories/issue-to-pr.json +1 -1
- package/src/kits/terminal-tools/rules.md +10 -0
- package/src/kits/terminal-tools.json +13 -0
- package/src/licenses/herdr.txt +201 -0
- package/src/modes/foreman.md +6 -3
- package/src/skills/_self-improvement.md +9 -7
- package/src/skills/commit.md +17 -17
- package/src/skills/debug/ci.md +1 -1
- package/src/skills/dependencies.md +3 -3
- package/src/skills/document-project.md +3 -2
- package/src/skills/factory.md +13 -4
- package/src/skills/geneseed.md +4 -2
- package/src/skills/git-history.md +5 -7
- package/src/skills/herdr.md +135 -0
- package/src/skills/loop.md +3 -2
- package/src/skills/opencode-cli.md +84 -0
- package/src/skills/pipeline.md +1 -1
- package/src/skills/release.md +5 -8
- package/src/skills/review-response.md +4 -2
- package/src/skills/rule.md +27 -1
- package/src/skills/ship.md +54 -7
- package/src/skills/worktree.md +2 -2
- package/src/upstreams.json +7 -0
- package/themes/_TEMPLATE.json +2 -0
- package/themes/biker.json +2 -0
- package/themes/commentator.json +2 -0
- package/themes/cyberpunk.json +2 -0
- package/themes/gamer.json +2 -0
- package/themes/imperial.json +2 -0
- package/themes/joker.json +2 -0
- package/themes/marvin.json +2 -0
- package/themes/mean.json +2 -0
- package/themes/military.json +2 -0
- package/themes/neutral.json +2 -0
- package/themes/pirate.json +2 -0
- package/themes/sports.json +2 -0
- package/themes/verstappen.json +2 -0
- package/themes/wizard.json +2 -0
- package/web/dist/assets/Activity-D2kOc3yi.js +1 -0
- package/web/dist/assets/ActivityDetail-By3xOr21.js +1 -0
- package/web/dist/assets/{Bonsai-Bfpb6W-1.js → Bonsai-CBWDTBA4.js} +1 -1
- package/web/dist/assets/{CopyButton-ByIntFtB.js → CopyButton-BVbpriMB.js} +1 -1
- package/web/dist/assets/Dashboard-CIJLPHM9.js +2 -0
- package/web/dist/assets/{Docs-DvlMJhpu.js → Docs-CiRRIELs.js} +3 -3
- package/web/dist/assets/Factories-DhyK0O8d.js +1 -0
- package/web/dist/assets/GreenhouseView-DW3PgTPy.js +1 -0
- package/web/dist/assets/Installs-B6nlo-Ly.js +3 -0
- package/web/dist/assets/JournalView-O65qEWfp.js +1 -0
- package/web/dist/assets/Kits-C5U-yT6Z.js +1 -0
- package/web/dist/assets/Laws-CuTw_XNf.js +4 -0
- package/web/dist/assets/{LibRows-DEHjIoD-.js → LibRows-D6-CVa3K.js} +1 -1
- package/web/dist/assets/Library-CzPlerd6.js +3 -0
- package/web/dist/assets/Loops-CqNF_-nS.js +2 -0
- package/web/dist/assets/Markdown-CxkA7940.js +71 -0
- package/web/dist/assets/OperatorHudView-BNr8K5qj.js +1 -0
- package/web/dist/assets/Personal-DeDb9e8O.js +2 -0
- package/web/dist/assets/Settings-B8MPN_AD.js +1 -0
- package/web/dist/assets/{Tabs-CWeQTADL.js → Tabs-DJzAez4h.js} +1 -1
- package/web/dist/assets/index-BL3P-9Rg.js +6 -0
- package/web/dist/assets/{index-CsAZq0BQ.css → index-CRWqKxfY.css} +1 -1
- package/web/dist/index.html +2 -2
- package/adapters/claude-code/settings.json +0 -52
- package/web/dist/assets/Activity-CqJiquEq.js +0 -1
- package/web/dist/assets/ActivityDetail-BSzevynX.js +0 -1
- package/web/dist/assets/Dashboard-DBOEi9lQ.js +0 -2
- package/web/dist/assets/Factories-Bpvv7L2H.js +0 -1
- package/web/dist/assets/GreenhouseView-GpBsYn50.js +0 -1
- package/web/dist/assets/Installs-BlGmVrFK.js +0 -3
- package/web/dist/assets/JournalView-iLuLrOxE.js +0 -1
- package/web/dist/assets/Kits-DRwpxC-J.js +0 -1
- package/web/dist/assets/Laws-CZkiNOWQ.js +0 -4
- package/web/dist/assets/Library-B4K-1iNF.js +0 -3
- package/web/dist/assets/Loops-BWSzaW8E.js +0 -2
- package/web/dist/assets/Markdown-0ORz7tAc.js +0 -69
- package/web/dist/assets/OperatorHudView-BAXwCEvY.js +0 -1
- package/web/dist/assets/Personal-Bp9nV4GR.js +0 -2
- package/web/dist/assets/Settings-CWWuaIp-.js +0 -1
- package/web/dist/assets/index-How7SzDZ.js +0 -6
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# {{SKILL}}: opencode-cli
|
|
2
|
+
|
|
3
|
+
> {{DESC_OPENCODE_CLI}}
|
|
4
|
+
|
|
5
|
+
**Trigger:** you drive OpenCode V2 from another session or a script through its `opencode` CLI: a headless run, its sessions, the background service or a server, MCP servers, plugins, models, usage stats, or debug output. Not for work inside an OpenCode session itself.
|
|
6
|
+
|
|
7
|
+
**Targets OpenCode V2 only.** Gate first: `opencode --version` must print `2.x`; on 1.x, say so and stop. The V1 commands top-level `export`/`import`, `attach`, `agent create` and `mcp debug` are not in the V2 command table: use `session export|import` instead of the first two. The installed `opencode --help` (and `opencode <command> --help`) is the live authority. General references: https://opencode.ai/docs/cli/ and https://opencode.ai/docs/migrate-v1/.
|
|
8
|
+
|
|
9
|
+
## Servers: service, standalone, explicit
|
|
10
|
+
|
|
11
|
+
By default the CLI finds or starts one shared **background service** per user account. Two global flags change that on the commands that take them (the root TUI `opencode`, `run`, `mini`, `session`, `auth`, `models`, `stats`, `mcp list|auth|logout`, `plugin list|check|update`, `debug config|agents`, `api`, `reload`; `debug heap-dump` takes `--server` only):
|
|
12
|
+
|
|
13
|
+
- `--standalone`: a private server for this one command, gone when it exits.
|
|
14
|
+
- `--server <url>`: an existing server, for example one from `opencode serve`.
|
|
15
|
+
|
|
16
|
+
`run` uses the service only when it is already up, and never leaves a new one running. The others (`session`, `models`, `stats` and `mcp` among them) **start the service** when it is down. To leave no trace, check `opencode service status` first and pass `--standalone` when the service was not running.
|
|
17
|
+
|
|
18
|
+
| Command | Use |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `opencode service status` | Read whether the background service runs |
|
|
21
|
+
| `opencode service start` | Start it, only when the task needs a lasting service |
|
|
22
|
+
| `opencode service get disabled\|remote\|hostname\|port\|cors` | Read one non-secret service setting |
|
|
23
|
+
| `opencode service stop\|restart\|set\|unset` | The user's service and settings: only on the user's ask |
|
|
24
|
+
| `opencode service get password`, `get env [name]`, bare `get` | **Never**: they print the server password or the service environment, which can hold provider keys (bare `get` prints `env` too) |
|
|
25
|
+
| `opencode serve [--hostname H] [--port N] [--cors <origin>]` | A foreground V2 API and web server; stop it yourself when done |
|
|
26
|
+
| `opencode pair [--url <url>]` | One-time links for a browser or app. `--remote` exposes the server to the internet: only on the user's ask, and never add `--yes` for them |
|
|
27
|
+
|
|
28
|
+
The server password comes from `OPENCODE_PASSWORD` (V1's `OPENCODE_SERVER_PASSWORD` still works). It is the user's secret: never print it or write it to a file.
|
|
29
|
+
|
|
30
|
+
## Headless run
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
opencode run --format json --title "review" "Review the diff in this repo and list findings"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Flag | Effect |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `[message..]` | The prompt; stdin is read too (in full when no message is given, as extra context when one is) |
|
|
39
|
+
| `--format default\|json` | `json`: one JSON object per line, each with `type`, `timestamp`, `sessionID`. Types: `text`, `reasoning` (with `--thinking`), `tool_use`, `step_start`, `step_finish`, `retry`, `background_wait`, `error` |
|
|
40
|
+
| `-m, --model provider/model[#variant]` | Model; list them with `opencode models` |
|
|
41
|
+
| `--agent <name>` | Agent; list them with `opencode debug agents` |
|
|
42
|
+
| `-c, --continue` / `-s, --session <id>` | Continue the last session / a given one (created when it does not exist) |
|
|
43
|
+
| `--fork` | Fork before continuing; needs `--continue` or `--session` |
|
|
44
|
+
| `-w, --worktree [name]` | New session in a new git worktree; not with `--continue` or `--session` |
|
|
45
|
+
| `-f, --file <path>` | Attach a file (repeatable) |
|
|
46
|
+
| `--title <t>`, `--archived` | Session title; `--archived` keeps a scripted run out of session lists |
|
|
47
|
+
| `--auto` | Approve every permission not explicitly denied |
|
|
48
|
+
|
|
49
|
+
- Without `--auto`, a headless run **rejects** each permission request and the model continues without that action. Pass `--auto` only on the user's explicit ask; never the hidden `--yolo` or `--dangerously-skip-permissions`.
|
|
50
|
+
- An error sets exit code 1 (with `--format json`, an `error` line). Read the `sessionID` from the output to continue or clean up.
|
|
51
|
+
|
|
52
|
+
## Sessions
|
|
53
|
+
|
|
54
|
+
| Command | Use |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `opencode session list [-n N] [--format table\|json]` | Top-level sessions of the current project, newest first |
|
|
57
|
+
| `opencode session export <id> [--sanitize]` | Session data as JSON on stdout; `--sanitize` redacts transcript and file data. Pass the ID: without a terminal it is required |
|
|
58
|
+
| `opencode session import <file\|url> [--directory D]` | Import exported session data |
|
|
59
|
+
| `opencode session delete <id>` | Deletes the session **and its child sessions**: only sessions you created, or on the user's ask |
|
|
60
|
+
|
|
61
|
+
## MCP, plugins, models, stats, debug
|
|
62
|
+
|
|
63
|
+
| Command | Use |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `opencode mcp list` | Configured MCP servers and their status |
|
|
66
|
+
| `opencode mcp add <name> [--url U] [--header k=v] [--env k=v] [--global] [-- <command...>]` | Writes the project config (or global with `--global`): a config change, on the user's ask |
|
|
67
|
+
| `opencode mcp auth [name]` / `opencode mcp logout <name>` | OAuth for a remote MCP server: the user completes it |
|
|
68
|
+
| `opencode plugin list [--builtin]` / `opencode plugin check [target]` | Read-only plugin state and available updates |
|
|
69
|
+
| `opencode plugin add <pkg>` / `update [target]` / `remove <pkg>` | Install, update or remove plugins (`add` and `remove` edit the global config): on the user's ask |
|
|
70
|
+
| `opencode models` | Available models |
|
|
71
|
+
| `opencode stats [--days N\|--year Y\|--all] [--project .] [--models] [--tools] [--cost] [--json]` | Usage statistics |
|
|
72
|
+
| `opencode debug config` / `debug agents` / `debug paths [name]` | Config sources, agents, and paths (`db`, `config`, `log`, ...) |
|
|
73
|
+
|
|
74
|
+
## Credentials are the user's
|
|
75
|
+
|
|
76
|
+
`opencode auth login`, `auth logout` and `auth switch` are the user's to run in their own terminal: never run them, answer their prompts, or pass `--answer` values. Never run `opencode auth export` (it prints stored secrets) or `auth import`.
|
|
77
|
+
|
|
78
|
+
## Done when
|
|
79
|
+
|
|
80
|
+
- The run's output was read from its JSON or text, a server you started with `serve` or `--standalone` is stopped, a service you started is named to the user, and every session you created for a throwaway run is deleted or handed over by ID.
|
|
81
|
+
|
|
82
|
+
Verified against the V2 CLI source of anomalyco/opencode at v2.3.0, commit `a6b15d33daf6ab7d35569f6d711fdb630b9f04e7`: `packages/cli/src/commands/commands.ts` (commands and flags), `commands/handlers/` (which commands start the service), `run/` (JSON events, permissions, stdin), `env.ts` (password variables); `--version` and `--help` are built into its `effect/cli` runner.
|
|
83
|
+
|
|
84
|
+
<!-- INCLUDE: skills/_self-improvement.md -->
|
package/src/skills/pipeline.md
CHANGED
|
@@ -26,7 +26,7 @@ The minimum roster per task type. The crew lead chooses the crew from the whole
|
|
|
26
26
|
## Procedure
|
|
27
27
|
|
|
28
28
|
1. Take the trigger as given: the user's request for a crew, or foreman's judgement that the task needs several specialists. Do not weigh it again and fall back to doing the work yourself.
|
|
29
|
-
2. **Dispatch the crew lead** in the background, using the host's general-purpose {{AGENT}}. Before dispatch, record BASE and set the crew's **write set**; check it against every other pipeline in flight ({{DOCTRINE:one-writer-per-file}}) — two crews whose sets overlap do not run at once. The brief carries: the task as the user stated it, the task type, BASE, the write set, the proof commands, a pointer to this {{SKILL}},
|
|
29
|
+
2. **Dispatch the crew lead** in the background, using the host's general-purpose {{AGENT}}. Before dispatch, record BASE and set the crew's **write set**; check it against every other pipeline in flight ({{DOCTRINE:one-writer-per-file}}) — two crews whose sets overlap do not run at once. The brief carries: the task as the user stated it, the task type, BASE, the write set, the proof commands, a pointer to this {{SKILL}}, the rule that it commits only in its own worktree, never pushes, and never merges outside its own branch, and the rule that each command runs from the worktree as working directory or with absolute paths (`git -C`, `npm --prefix`), never opening with `cd <worktree> &&`, which makes the host ask the user. Tell the user the pipeline is running, then go back to the user. Do not wait on the crew lead. **Then watch what you dispatched.** An envelope without proof, or one that says the crew is still waiting, is a failure: act on it at once — resume the crew lead (`SendMessage` on Claude Code) or take over its worktree — never wait for a notification it promised. A crew member's report that reaches you directly means its crew lead has already ended; act on it the same way. Set no timer to watch a crew: where the host re-invokes you when a background agent ends (Claude Code), that notification is the watch; check every crew still out at the start of every turn. A crew is stalled when its transcript and output have not grown for 15 minutes **and** it has no live child process: ping it once; if the next check shows no change, stop it, then take over from its worktree. A crew whose output still grows, or that runs a child process, is never taken over — a long suite or canary is not a stall.
|
|
30
30
|
3. **The crew lead composes the crew** from the floor above and adds any {{AGENT}} the task needs. It dispatches each crew member as its own subagent, each handed what the previous one produced. **The crew lead never ends with a member unresolved.** Its last message is its result: once it ends, nothing wakes it, and a member that outlives it reports past it, to the parent. It may run members in parallel, but holds every member's result before it ends — returned, or failed and then redone or named as failed in the envelope. A member that returns nothing has failed. Where the crew lead holds no dispatch tool (see *Hosts* below), it plays each role in turn itself, with the same hand-offs and the same envelope. Steps 4 to 7 are the crew lead's, except where they name the parent.
|
|
31
31
|
4. Isolate the crew's work in its own git worktree/branch. Where worktrees are unavailable, fall back to a single tree, one pipeline at a time, and say so; without a worktree, the crew never commits. The crew writes only inside its write set; shared append files (registries, index tables, lockfiles, generated bundles) are the parent's to apply, never a crew's.
|
|
32
32
|
5. **The dev↔tester loop:** the developer implements, the tester validates — runs the tests and lint, produces raw logs. On failure, the findings go back to the developer — two repair rounds at most, then one fresh developer (a higher model tier where the host offers one) carrying the tester's findings ({{DOCTRINE:bound-the-loop}}); if that fails too, stop, do not merge, and report the failure with the branch left in place for inspection. A conflict or ambiguity between the plan, the findings and the code is yours to decide: decide it, record `Ruling: <choice> — <why> — <cost if wrong>` in the worklog, and continue. Stop only for what {{LAW:echo-the-intent}}, {{LAW:deletion-is-deliberate}} or {{DOCTRINE:consent-before-push}} names; every ruling goes in the final report ({{DOCTRINE:declare-the-judgment-calls}}). When the plan names a `Spec:`, the analyst reads it once; the spec outranks the plan.
|
package/src/skills/release.md
CHANGED
|
@@ -15,15 +15,12 @@
|
|
|
15
15
|
3. Update the changelog: a dated section for the new version summarising the
|
|
16
16
|
user-visible changes, grouped (added / changed / fixed), derived from the commits
|
|
17
17
|
since the last tag.
|
|
18
|
-
4. Commit the version bump and changelog as one focused commit
|
|
19
|
-
[commit {{SKILL}}](commit.md)
|
|
20
|
-
|
|
18
|
+
4. Commit the version bump and changelog as one focused commit on a release branch,
|
|
19
|
+
through the [commit {{SKILL}}](commit.md) ({{LAW:one-intent-one-act}}), and land it on
|
|
20
|
+
the main branch through a pull request with green checks ({{DOCTRINE:consent-before-push}}).
|
|
21
21
|
5. Tag the release (annotated, matching the version). Tagging and publishing are
|
|
22
|
-
**outward-facing** ({{LAW:deletion-is-deliberate}})
|
|
23
|
-
|
|
24
|
-
applies with extra care and grants no standing consent.
|
|
25
|
-
6. With that acceptance, push the commit and the tag together; trigger or verify
|
|
26
|
-
the publish/release pipeline.
|
|
22
|
+
**outward-facing** and need the user's explicit acceptance ({{LAW:deletion-is-deliberate}}).
|
|
23
|
+
6. With that acceptance, push the tag; trigger or verify the publish/release pipeline.
|
|
27
24
|
|
|
28
25
|
## Done when
|
|
29
26
|
- Version, changelog, and tag all name the same number, and the release is pushed
|
|
@@ -20,8 +20,10 @@ to be acted on; or the user wants a review criterion recorded ("add a review rul
|
|
|
20
20
|
4. Respond to each comment: the change you will make and why, or a reasoned decline
|
|
21
21
|
with evidence.
|
|
22
22
|
5. Apply the accepted changes — one intent per commit ({{LAW:one-intent-one-act}}), each through the
|
|
23
|
-
[commit {{SKILL}}](commit.md)
|
|
24
|
-
re-run the checks ({{LAW:verify-before-asserting}}).
|
|
23
|
+
[commit {{SKILL}}](commit.md), on the pull request's own branch ({{DOCTRINE:consent-before-push}}) — then
|
|
24
|
+
re-run the checks ({{LAW:verify-before-asserting}}). If the PR has auto-merge armed, disarm it
|
|
25
|
+
before you push the fixes (the commit {{SKILL}}'s push step says how), then re-arm through the
|
|
26
|
+
[ship {{SKILL}}](ship.md) on the new head.
|
|
25
27
|
6. Surface anything the review missed that you noticed while addressing it.
|
|
26
28
|
7. Upgrade the review itself. A finding that recurs, a criterion the user asks for, or a
|
|
27
29
|
defect a review should have caught becomes a rule in the nearest `REVIEW.md` above the
|
package/src/skills/rule.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
{{CREDIT:mattpocock-skills-2509:skills/engineering/retro/SKILL.md}}
|
|
7
7
|
|
|
8
|
-
**Trigger:** the user says "always…", "never…", "from now on…" or "remember that…". Anything the user wants to outlive this session counts: a standing rule ("make that a
|
|
8
|
+
**Trigger:** the user says "always…", "never…", "from now on…" or "remember that…", or "turn on auto-merge" / "turn off auto-merge". Anything the user wants to outlive this session counts: a standing rule ("make that a
|
|
9
9
|
rule") or a durable fact ("note that…", "keep in mind…"). Also fires when a
|
|
10
10
|
`feedback` {{MEMORY}} lesson keeps recurring and deserves promotion, or when
|
|
11
11
|
`user-rules.md` needs review — a trial rule past its date, a stale rule, a bloated
|
|
@@ -109,6 +109,32 @@ The asymmetry is deliberate: Branch A costs no question, Branch B costs several.
|
|
|
109
109
|
The price is the safeguard — make remembering cheap and legislating expensive, or
|
|
110
110
|
the user picks "rule" out of impatience and the set inflates.
|
|
111
111
|
|
|
112
|
+
**Auto-merge flow** (the user says "turn on auto-merge", or "turn it off"). The wording is fixed
|
|
113
|
+
so the [ship {{SKILL}}](ship.md) reads it reliably: skip reformulation and the counter-example,
|
|
114
|
+
never the consent. Ask one question — every repo (`global`) or this project (`project`) — then
|
|
115
|
+
show this text, with the next free `R<n>`, the scope chosen and today's date, and append it to the
|
|
116
|
+
file Branch B step 5 names for that scope, on explicit consent:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
## R<n> — Auto-merge green PRs
|
|
120
|
+
(scope: <global|project> | source: user, <date>)
|
|
121
|
+
Arm auto-merge on a PR I open, only when the forge has required checks.
|
|
122
|
+
- docs-tests: auto
|
|
123
|
+
- normal: human # human | reviewer
|
|
124
|
+
- sensitive: never
|
|
125
|
+
- Before any further push to a PR with auto-merge armed, disarm it first, then classify, review and arm again on the new head.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`sensitive` never arms, whatever its line says. `docs-tests` accepts `auto | human | reviewer |
|
|
129
|
+
never`, `normal` accepts `human | reviewer | never`; any other value counts as `human`. `human`
|
|
130
|
+
waits for one approving review on the forge. The last line is part of the fixed text: the rule is
|
|
131
|
+
loaded every session, so every path that pushes sees it. `reviewer` is for a solo repo, where the
|
|
132
|
+
forge forbids approving your own PR: the blind reviewer must pass first. The rule arms only the
|
|
133
|
+
forge's merge; pushes still follow {{DOCTRINE:consent-before-push}} (a plain push of your own branch is
|
|
134
|
+
free, a push onto the main branch asks). To turn it off, remove
|
|
135
|
+
the rule with the same consent; to turn it off for one project only, write the rule into that
|
|
136
|
+
project's file with all three tier lines `never` (the later layer wins).
|
|
137
|
+
|
|
112
138
|
**Review flow** (on request, or when a `trial until:` date has passed): for each rule
|
|
113
139
|
due, ask whether it actually fired since adoption — graduate it (drop the trial
|
|
114
140
|
marker), demote it back to a {{MEMORY}} fact, or delete it. Same consent gate as
|
package/src/skills/ship.md
CHANGED
|
@@ -22,11 +22,10 @@ request or merge the branch.
|
|
|
22
22
|
before pushing.
|
|
23
23
|
3. Confirm the branch carries only this change's commits and is rebased/updated on
|
|
24
24
|
the base branch; resolve any divergence before opening.
|
|
25
|
-
4. Push the branch
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
unless already authorized ({{LAW:deletion-is-deliberate}}).
|
|
25
|
+
4. Push the branch with a plain push and open the pull request: the pull request is
|
|
26
|
+
the consent the main branch needs ({{DOCTRINE:consent-before-push}}). Merge only once its
|
|
27
|
+
required checks are green — never red, pending or absent. A forced push, or a push
|
|
28
|
+
straight onto the main branch, asks ({{LAW:deletion-is-deliberate}}).
|
|
30
29
|
5. Open the PR with a three-part body. **Summary**: what changed and why, with the
|
|
31
30
|
smallest visual that makes the point (a call tree, diff sketch, file tree or
|
|
32
31
|
Mermaid diagram). **Evidence**: how it was tested, as before/after — the test that
|
|
@@ -35,9 +34,54 @@ request or merge the branch.
|
|
|
35
34
|
published contract) or two-way (cheap to roll back), the blast radius (what breaks if
|
|
36
35
|
it is wrong — consumers, layout, data), and any follow-up. Link the
|
|
37
36
|
issue it closes; keep the title an imperative one-line summary.
|
|
38
|
-
6.
|
|
37
|
+
6. **Auto-merge.** It is off unless the user's standing rule *Auto-merge green PRs* in
|
|
38
|
+
`user-rules.md` arms it (the later layer wins: project over host over shared). That rule is
|
|
39
|
+
the durable authorization {{LAW:deletion-is-deliberate}} permits for the forge's merge; it
|
|
40
|
+
arms only that merge, and pushes still follow {{DOCTRINE:consent-before-push}}. With no such rule, say once per session in
|
|
41
|
+
each repo, when you open a PR there: "Auto-merge is off; say 'turn on auto-merge' to set a
|
|
42
|
+
standing rule" — the [rule {{SKILL}}](rule.md) writes it. With the rule, arm only when all of
|
|
43
|
+
these hold; otherwise leave the merge to the user:
|
|
44
|
+
- **Tier**, from the PR's diff. Any sensitive file → `sensitive`. Else, when every file is
|
|
45
|
+
docs (prose that is neither shipped nor executed) or tests → `docs-tests`, unless the diff
|
|
46
|
+
removes, skips or loosens a test or an assertion: CI cannot see a weakened test, so that diff
|
|
47
|
+
is `normal`. Anything else → `normal`. Sensitive is each `sensitive:` zone of the ownership block in the *base* branch's
|
|
48
|
+
`AGENTS.md` (never the head's), plus by default: auth and authz, secrets and credentials,
|
|
49
|
+
data migrations and schema, CI and deploy config, dependency manifests and lockfiles,
|
|
50
|
+
release and versioning, gate and hook config, `AGENTS.md`, `CLAUDE.md`, `CODEOWNERS`, any
|
|
51
|
+
`user-rules.md`, agent, skill and instruction files, and gate machinery (check scripts, CI-only
|
|
52
|
+
harnesses, coverage thresholds; not ordinary unit tests).
|
|
53
|
+
- **The rule's line for the tier.** `sensitive` never arms, whatever the rule says.
|
|
54
|
+
`docs-tests` accepts `auto | human | reviewer | never`; `normal` accepts `human | reviewer
|
|
55
|
+
| never` (`auto` is not valid there). A missing or other value counts as `human`. `auto`
|
|
56
|
+
arms. `human` arms only when the forge requires one approving review and dismisses it on a
|
|
57
|
+
new push. `reviewer` arms only
|
|
58
|
+
after the [fresh-eyes {{SKILL}}](fresh-eyes.md) passes: first add its verdict to the PR
|
|
59
|
+
body (`gh pr edit <pr> --body-file <file>`, `glab mr update <mr> --description <text>`).
|
|
60
|
+
`never` does not arm.
|
|
61
|
+
- **Forge**, one probe each; a result you cannot read counts as absent. Required checks on
|
|
62
|
+
the base: a `required_status_checks` rule in `gh api repos/{owner}/{repo}/rules/branches/<base>`,
|
|
63
|
+
or `required_status_checks` in `gh api repos/{owner}/{repo}/branches/<base>/protection`,
|
|
64
|
+
with a non-empty list of checks (`contexts` or `checks`): an empty list requires nothing,
|
|
65
|
+
and `--auto` then merges at once; GitLab: `only_allow_merge_if_pipeline_succeeds` in
|
|
66
|
+
`glab api projects/:id`. One approving review dismissed on a new push (`human`): a
|
|
67
|
+
`pull_request` rule with `required_approving_review_count` of 1 or more and
|
|
68
|
+
`dismiss_stale_reviews_on_push`, or the same under `required_pull_request_reviews`
|
|
69
|
+
(`dismiss_stale_reviews`) in the protection; GitLab: an approval rule with
|
|
70
|
+
`approvals_required` of 1 or more in `glab api projects/:id/approval_rules`, and
|
|
71
|
+
`reset_approvals_on_push` in `glab api projects/:id/approvals`. Auto-merge allowed:
|
|
72
|
+
`gh repo view --json autoMergeAllowed` (GitHub only; GitLab has no such switch). Never judge
|
|
73
|
+
green yourself: the forge's checks are the gate ({{DOCTRINE:external-gate}}).
|
|
74
|
+
Arm with the reviewed head named: `gh pr merge <pr> --auto --squash --match-head-commit
|
|
75
|
+
<sha>`, or `glab mr merge <mr> --auto-merge --squash --sha <sha>` (a plain `glab mr merge`
|
|
76
|
+
arms it too, so always name the flag). On GitHub the pin is checked only when you arm: an
|
|
77
|
+
armed PR stays armed after a later push. So before any further push to an armed PR, disarm
|
|
78
|
+
it (`gh pr merge <pr> --disable-auto`; GitLab: `glab api --method POST
|
|
79
|
+
projects/:id/merge_requests/<iid>/cancel_merge_when_pipeline_succeeds`), then classify,
|
|
80
|
+
review and arm again on the new head. Recommend CODEOWNERS with required code-owner review on
|
|
81
|
+
sensitive paths as the forge's own backstop.
|
|
82
|
+
7. If the project merges locally instead, merge into the base branch only after
|
|
39
83
|
review/approval.
|
|
40
|
-
|
|
84
|
+
8. Once the branch is merged — locally or through the PR — delete it, local and remote
|
|
41
85
|
(`git branch -d <branch>`, `git push origin --delete <branch>`), with consent: it is a
|
|
42
86
|
deletion ({{LAW:deletion-is-deliberate}}). A PR usually merges after your turn ends,
|
|
43
87
|
with nobody left to delete its branch, so the first time you ship in a repo, check
|
|
@@ -52,6 +96,9 @@ request or merge the branch.
|
|
|
52
96
|
## Done when
|
|
53
97
|
- The diff passed review with no `blocking` finding, and the PR is open (or the branch is merged) with a Summary / Evidence / Merge danger
|
|
54
98
|
body, and nothing unrelated rides along.
|
|
99
|
+
- Auto-merge is armed only under the user's standing rule, never for a sensitive diff, on a
|
|
100
|
+
forge that requires checks, on the reviewed head, and disarmed before any later push — or it
|
|
101
|
+
is off and the user was told once this session how to turn it on.
|
|
55
102
|
- A branch merged while you are still working is deleted, local and remote, or the user
|
|
56
103
|
declined.
|
|
57
104
|
|
package/src/skills/worktree.md
CHANGED
|
@@ -32,8 +32,8 @@ not make.
|
|
|
32
32
|
state (a global config, a hook shim) run from the worktree only when they resolve
|
|
33
33
|
the repo through it; verify with the tool's own status command rather than assume.
|
|
34
34
|
5. **Integrate through the normal gate** — commit via the [commit {{SKILL}}](commit.md),
|
|
35
|
-
ship via [ship](ship.md).
|
|
36
|
-
|
|
35
|
+
ship via [ship](ship.md). The worktree's branch is your own; the main branch still
|
|
36
|
+
changes only through a green pull request ({{DOCTRINE:consent-before-push}}). Expect conflicts with a sibling tree that
|
|
37
37
|
touched the same files; resolve them on the branch, not in the other tree.
|
|
38
38
|
6. **Clean up when the branch is merged or abandoned** — with consent, since removal
|
|
39
39
|
is deletion ({{LAW:deletion-is-deliberate}}):
|
package/src/upstreams.json
CHANGED
|
@@ -70,6 +70,13 @@
|
|
|
70
70
|
"license": "MIT",
|
|
71
71
|
"licenseFile": "licenses/everything-claude-code.txt"
|
|
72
72
|
},
|
|
73
|
+
"herdr": {
|
|
74
|
+
"repo": "herdrdev/herdr",
|
|
75
|
+
"commit": "1cbd794559fb139f95f1bdb4b2a8998082017d0e",
|
|
76
|
+
"author": "herdrdev",
|
|
77
|
+
"license": "Apache-2.0",
|
|
78
|
+
"licenseFile": "licenses/herdr.txt"
|
|
79
|
+
},
|
|
73
80
|
"i-have-adhd": {
|
|
74
81
|
"repo": "ayghri/i-have-adhd",
|
|
75
82
|
"commit": "1ecea1993b7fce257ffbd686c070948b5e07eda6",
|
package/themes/_TEMPLATE.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "<one-line description: write or fix a declarative Jenkinsfile or shared library — stages, when, parallel, credentials, CPS and @NonCPS, sandbox approval, JenkinsPipelineUnit>",
|
|
166
166
|
"DESC_GITLAB_CI": "<one-line description: write or fix .gitlab-ci.yml — rules, needs DAG, include and extends, cache and artifacts, protected and masked variables, environments, CI lint>",
|
|
167
167
|
"DESC_COMPOSE_OPS": "<one-line description: write, review or run any Compose stack — healthchecks, volumes, pinned images, secrets, limits, logs, networks, safe update and rollback; not a Spring Boot image build (docker-expert)>",
|
|
168
|
+
"DESC_HERDR": "<one-line description: control Herdr workspaces, tabs, panes and agents from inside a Herdr pane (HERDR_ENV=1); only when the user names Herdr>",
|
|
169
|
+
"DESC_OPENCODE_CLI": "<one-line description: drive OpenCode V2 from another session through its CLI — headless run, sessions, background service, MCP, plugins, models, stats, debug; never auth login>",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/biker.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the ride.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/commentator.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the lights go out.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/cyberpunk.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the run.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/gamer.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the boss fight.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/imperial.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Forge and mend a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Forge and mend .gitlab-ci.yml: rules, needs, cache.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Muster and command a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Command Herdr panes and agents from within; only when Herdr is named.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Command OpenCode V2 through its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/joker.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before opening night.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/marvin.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a Jenkinsfile, which will fail anyway.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml, which will fail anyway.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write or run a Compose stack; not image builds. It'll fail.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes from inside it, if the user names Herdr. Rarely.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI. It will not thank you.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/mean.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml: rules, needs, includes, cache.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/military.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before deployment.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/neutral.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml: rules, needs, includes, cache.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/pirate.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml afore she leaves port.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/sports.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before kickoff.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/verstappen.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the real run.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
package/themes/wizard.json
CHANGED
|
@@ -165,6 +165,8 @@
|
|
|
165
165
|
"DESC_JENKINS_PIPELINE": "Cast and mend a declarative Jenkinsfile or shared library.",
|
|
166
166
|
"DESC_GITLAB_CI": "Cast and mend .gitlab-ci.yml: rules, needs, cache.",
|
|
167
167
|
"DESC_COMPOSE_OPS": "Conjure, inspect and tend a Compose stack; not image builds.",
|
|
168
|
+
"DESC_HERDR": "Bind Herdr panes and agents from within; only when Herdr is named.",
|
|
169
|
+
"DESC_OPENCODE_CLI": "Command OpenCode V2 through its CLI: run, sessions, server, MCP, plugins.",
|
|
168
170
|
"AGENT_COLORS": {
|
|
169
171
|
"architect": "primary",
|
|
170
172
|
"reviewer": "warning",
|
|
@@ -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{A as i,D as a,E as o,F as s,H as c,L as l,M as u,N as d,O as f,P as p,St as m,T as h,_t as g,et as _,j as v,o as ee,rt as te,tt as y,w as b,wt as x}from"./index-BL3P-9Rg.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 ne,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-CBWDTBA4.js";import{s as re}from"./motion-RlUl1osO.js";import{n as ie,t as ae}from"./usePoll-D5c_qIFZ.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`:u(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=b[e.status]||b.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||f(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]),c=b[e.status]||b.idle,l=Array.isArray(e.loops)?e.loops[0]:null,d=e.status!==`idle`,p=F(e),m=e.title||f(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${u(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:d,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:c.label}),t&&(0,B.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),l&&(0,B.jsxs)(`span`,{className:`badge`,children:[`↻ `,l.title,l.iteration==null?``:` ${l.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 oe({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 se({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)(ce,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function ce({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)(oe,{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 le({s:e}){let t=(0,z.useId)(),n=e.todos,r=v(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)(h,{s:e,id:t,heading:e.title||f(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)(g,{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 `,m(e.updated_at),` ago`]})]})}var ue={blocked:`is blocked`,"waiting-input":`waits for your answer`};function de(e,t){if(!Array.isArray(t))return``;let n=t.filter(u),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||f(e.cwd)||e.session_id} ${ue[e.status]}`).join(`. `):``}var fe=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function pe(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:fe.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function me(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 he({enabled:e,installs:t,onToggle:n}){let r=ne(t);return(0,B.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,B.jsx)(g,{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 ge({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=d(e?.jobs,{days:14,cap:n}),i=s(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),c=r.find(e=>!e.nodata),l=r.some(e=>e.nodata),u=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${p(e.key)}`).join(`, `)||`none`}.`+(l?c?` Days before ${p(c.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)(y,{label:`Reading the job log…`}):e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":u,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:`${p(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:p(r[0].key)}),(0,B.jsx)(`span`,{children:p(r[7].key)}),(0,B.jsx)(`span`,{children:`today`})]}),l&&(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 _e({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)(y,{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)(o,{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 ve={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ye({job:e,longest:t}){let n=l(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=ve[e.status]||[``,e.status||`…`],o=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,s=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:s}),(0,B.jsx)(g,{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":o,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 be({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)(g,{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 xe=5,Se=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function Ce(){let[e,t]=(0,z.useState)(null),[n,a]=(0,z.useState)(``),[o,l]=(0,z.useState)(pe),[d,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(``),g=(0,z.useRef)(null),v=e=>{let t={...o,...e};l(t),me(t)};ie(e=>r.activity().then(n=>{if(e()){t(ae(n)),a(``);let e=de(g,n?.activity);e&&h(t=>t===e?e+`\xA0`:e)}},t=>{e()&&a(t.message)}),2e3,[]);let b=x(()=>$(r.jobs()),[]),C=x(()=>$(r.gates()),[]),w=x(()=>$(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=re(),A=T&&e?D.filter(u).length:null,ne=new Set(D.map(F)),j=o.v===`list`?O(e?.ended,E).filter(e=>!ne.has(F(e))):[],M=Se([...D,...j].map(e=>e.host),o.host),N=Se([...D,...j].map(e=>f(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||f(e.cwd)===o.project),L=D.filter(e=>I(e)&&(o.f!==`needs`||u(e))),R=o.f===`all`||o.f===`needs`,V=o.f===`all`&&T?j.filter(I):[],H=d?V:V.slice(0,xe),U=!P&&(o.f===`all`||o.f===`runs`),W=!P&&(o.f===`all`||o.f===`gates`),G=b.data?.jobs||[],K=ee(C.data,w.data),q=i(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=s(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=>v({[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)(c,{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)(_,{error:n})}),e&&(0,B.jsx)(he,{enabled:T,installs:E,onToggle:X}),(0,B.jsxs)(`div`,{className:`act-today`,children:[(0,B.jsx)(ge,{jobs:b.data,loading:b.loading}),(0,B.jsx)(_e,{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)(y,{}):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:fe.map(([e,t])=>(0,B.jsxs)(`button`,{type:`button`,className:o.f===e?`chip-f on`:`chip-f`,"aria-pressed":o.f===e,onClick:()=>v({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)(te,{"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:()=>v({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)(se,{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)(le,{s:e})},F(e)))}):(0,B.jsx)(y,{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)(le,{s:e})},F(e))),V.length>xe&&(0,B.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":d,onClick:()=>p(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)(ye,{job:e,longest:J},e.id)),e.gate&&(0,B.jsx)(be,{gate:e.gate})]})]},e.key))})]})}export{Ce as default};
|
|
@@ -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{H as i,M as a,O as o,St as s,T as c,_t as l,et as u,k as d,tt as f}from"./index-BL3P-9Rg.js";import{a as p,d as m,f as h,i as g,l as _,o as v,r as y,t as b,v as x}from"./Bonsai-CBWDTBA4.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{n as C,t as w}from"./usePoll-D5c_qIFZ.js";var T=e(t(),1),E=n();function D(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 O({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(`${d(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,E.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,E.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,E.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,E.jsx)(`span`,{className:`feed-dot act-inline-dot ${D(e)||`acc`}`}),e.kind===`thinking`&&(0,E.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,E.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,E.jsx)(`b`,{children:i}),e.error&&(0,E.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,E.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,E.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${s(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function k({turns:e}){return!e||e.length===0?(0,E.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,E.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,E.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,E.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,E.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var A=5;function j({s:e}){let[t]=(0,T.useState)(v),[n,r]=(0,T.useState)(null),i=!!e.ended,o=i?{...e,status:a(e)?`busy`:e.status,error:null}:e,s=x(o,t),c=(0,T.useMemo)(()=>h(o,{sakura:t}),[s]),l=(0,T.useCallback)(e=>r(e),[]),u=_(e),d=Number(e.turns)||0,f=Number(e.compactions)||0,m=[`${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} ${i?`unfinished`:`running`}, ${c.fallen.length} finished`].join(` · `),S=n==null?null:c.pads[n];return(0,E.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!i&&a(e)?` gd-needs`:``}`,children:[(0,E.jsx)(`div`,{role:`group`,tabIndex:0,"aria-label":`Bonsai pads, arrow keys walk them`,onKeyDown:e=>g(e,c.pads.length,n,l),children:(0,E.jsx)(y,{t:c,pad:n,swaying:!i&&e.status!==`idle`,onPad:l,px:A,label:`Bonsai of this session${i?`, ended`:``}: ${m}`})}),(0,E.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[i&&(0,E.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,E.jsx)(`div`,{className:`dim act-sm`,children:m}),(0,E.jsx)(`span`,{className:`sr-only`,role:`status`,children:p(S)}),S?(0,E.jsx)(b,{pad:S}):(0,E.jsx)(`div`,{className:`dim act-xs`,children:`Hover or tap a pad, or use the arrow keys, for its files.`})]})]})}function M({sid:e}){let{sid:t,install:n}=m(e,window.location.hash),[a,d]=(0,T.useState)(null),[p,h]=(0,T.useState)(``),[g,_]=(0,T.useState)(!1),[v,y]=(0,T.useState)(!1),b=(0,T.useId)();C(e=>g?void 0:r.activityDetail(t,n).then(t=>{e()&&(d(w(t)),h(``),_(!1))},t=>{e()&&(t.status===404?_(!0):h(t.message))}),2e3,[t,g]);let x=(0,E.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,E.jsx)(l,{name:`arrow`}),` Activity`]});if(g)return(0,E.jsxs)(`div`,{className:`page-fill`,children:[x,(0,E.jsx)(S,{title:`Session ended`,action:(0,E.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!a)return(0,E.jsxs)(`div`,{className:`page-fill`,children:[x,p?(0,E.jsx)(u,{error:p}):(0,E.jsx)(f,{label:`Loading session…`})]});let D=a.session,A=D.files,M=D.todos,N=!!(A&&A.items&&A.items.length>0),P=!!(M&&M.items&&M.items.length>0),F=a.conversation||[],I=a.timeline||[],L=[...F.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...I.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,E.jsxs)(`div`,{className:`page-fill`,children:[x,(0,E.jsx)(i,{title:D.title||o(D.cwd)||D.session_id,sub:D.cwd?(0,E.jsx)(`span`,{className:`mono act-cwd`,title:D.cwd,children:D.cwd}):null}),p&&(0,E.jsx)(`div`,{className:`act-gap`,children:(0,E.jsx)(u,{error:p})}),(0,E.jsxs)(`div`,{className:`card pad-md`,children:[(0,E.jsx)(c,{s:D}),(0,E.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,s(D.updated_at),` ago`]})]}),(0,E.jsx)(j,{s:D}),(N||P)&&(0,E.jsxs)(`div`,{className:`grid gap-12 act-panels${N&&P?` two`:``}`,children:[N&&(0,E.jsxs)(`div`,{className:`card pad-md`,children:[(0,E.jsx)(`div`,{className:`card-head`,children:(0,E.jsxs)(`h2`,{children:[`Files touched `,(0,E.jsxs)(`span`,{className:`dim`,children:[`(`,A.count,`)`]})]})}),(0,E.jsx)(`div`,{className:`stack act-list`,children:A.items.map(e=>(0,E.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,E.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,E.jsxs)(`span`,{className:`act-fixed`,children:[(0,E.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,E.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),P&&(0,E.jsxs)(`div`,{className:`card pad-md`,children:[(0,E.jsx)(`div`,{className:`card-head`,children:(0,E.jsxs)(`h2`,{children:[`Plan`,` `,(0,E.jsxs)(`span`,{className:`dim`,children:[`(`,M.done,`/`,M.total,`)`]})]})}),(0,E.jsx)(`div`,{className:`stack act-list`,children:M.items.map((e,t)=>(0,E.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,E.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,E.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,E.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,E.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,E.jsx)(`h2`,{children:`Timeline`}),I.length>0&&(0,E.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":v,"aria-controls":b,onClick:()=>y(e=>!e),children:v?`Show conversation`:`Show full stream (${L.length})`})]}),(0,E.jsx)(`div`,{id:b,children:v?(0,E.jsx)(`div`,{className:`stack gap-12`,children:L.map((e,t)=>(0,E.jsx)(O,{rec:e},t))}):(0,E.jsx)(k,{turns:F})})]})]})}export{j as SessionTree,M 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{dt as r}from"./index-How7SzDZ.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{ft as r}from"./index-BL3P-9Rg.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{_t as r}from"./index-BL3P-9Rg.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};
|