@automagik/genie 3.260303.2 → 3.260309.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.coderabbit.yaml +29 -0
- package/.genie/wishes/resolve-dev-desync/WISH.md +116 -0
- package/.github/assets/genie-header.png +0 -0
- package/.github/workflows/ci.yml +69 -0
- package/.github/workflows/commitlint.yml +25 -0
- package/.github/workflows/release.yml +111 -0
- package/.github/workflows/rolling-pr.yml +52 -0
- package/.github/workflows/version.yml +83 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/.husky/pre-push +13 -0
- package/LICENSE +21 -0
- package/Makefile +24 -0
- package/README.md +204 -313
- package/TEAM_LEAD_PROMPT.md +69 -0
- package/biome.json +142 -0
- package/cliff.toml +75 -0
- package/commitlint.config.ts +4 -0
- package/dist/genie.js +192 -323
- package/docs/CO-ORCHESTRATION-GUIDE.md +53 -106
- package/docs/{worker-profiles.md → agent-profiles.md} +13 -31
- package/git-cliff/CHANGELOG.md +7 -0
- package/install.sh +10 -10
- package/knip.json +5 -0
- package/openclaw.plugin.json +2 -4
- package/package.json +18 -11
- package/plugins/genie/.claude-plugin/plugin.json +8 -11
- package/plugins/genie/agents/council--architect.md +12 -0
- package/plugins/genie/agents/council--benchmarker.md +12 -0
- package/plugins/genie/agents/council--deployer.md +13 -1
- package/plugins/genie/agents/council--ergonomist.md +12 -0
- package/plugins/genie/agents/council--measurer.md +12 -0
- package/plugins/genie/agents/council--operator.md +12 -0
- package/plugins/genie/agents/council--questioner.md +12 -0
- package/plugins/genie/agents/council--sentinel.md +13 -1
- package/plugins/genie/agents/council--simplifier.md +12 -0
- package/plugins/genie/agents/council--tracer.md +12 -0
- package/plugins/genie/agents/debug.md +92 -0
- package/plugins/genie/agents/docs.md +90 -0
- package/plugins/genie/agents/fix.md +48 -48
- package/plugins/genie/agents/implementor.md +40 -38
- package/plugins/genie/agents/learn.md +108 -0
- package/plugins/genie/agents/quality-reviewer.md +35 -60
- package/plugins/genie/agents/refactor.md +62 -126
- package/plugins/genie/agents/spec-reviewer.md +36 -32
- package/plugins/genie/agents/tests.md +55 -161
- package/plugins/genie/genie.ts +2 -2
- package/plugins/genie/hooks/hooks.json +16 -1
- package/plugins/genie/package.json +1 -1
- package/plugins/genie/references/dispatch-contract.md +9 -9
- package/plugins/genie/scripts/first-run-check.cjs +34 -0
- package/plugins/genie/scripts/genie.cjs +452 -91
- package/plugins/genie/scripts/smart-install.js +40 -78
- package/plugins/genie/scripts/statusline.sh +201 -0
- package/plugins/genie/scripts/worker-service.cjs +3 -3
- package/plugins/genie/settings.json +13 -0
- package/scripts/build.js +11 -12
- package/scripts/smart-install.js +20 -18
- package/scripts/sync.js +26 -22
- package/scripts/uninstall.js +9 -11
- package/scripts/version.ts +14 -27
- package/skills/debug/SKILL.md +52 -0
- package/skills/docs/SKILL.md +38 -0
- package/skills/dream/SKILL.md +3 -3
- package/skills/fix/SKILL.md +1 -1
- package/skills/learn/SKILL.md +52 -0
- package/skills/onboarding/SKILL.md +556 -0
- package/skills/review/SKILL.md +1 -1
- package/skills/work/SKILL.md +7 -7
- package/src/__tests__/beads-issues-jsonl.test.ts +5 -5
- package/src/__tests__/brainstorm-crystallize.test.ts +3 -3
- package/src/__tests__/events.test.ts +19 -18
- package/src/genie-commands/__tests__/tui.test.ts +117 -0
- package/src/genie-commands/brainstorm/crystallize.ts +7 -4
- package/src/genie-commands/doctor.ts +26 -155
- package/src/genie-commands/install.ts +64 -78
- package/src/genie-commands/ledger/validate.ts +1 -1
- package/src/genie-commands/profiles.ts +9 -49
- package/src/genie-commands/setup.ts +37 -91
- package/src/genie-commands/shortcuts.ts +4 -4
- package/src/genie-commands/tui.ts +149 -60
- package/src/genie-commands/uninstall.ts +50 -63
- package/src/genie-commands/update.ts +54 -44
- package/src/genie.ts +153 -130
- package/src/hooks/__tests__/dispatch.test.ts +162 -0
- package/src/hooks/__tests__/inject.test.ts +80 -0
- package/src/hooks/dispatch-command.ts +39 -0
- package/src/hooks/handlers/auto-spawn.ts +80 -0
- package/src/hooks/handlers/identity-inject.ts +36 -0
- package/src/hooks/index.ts +147 -0
- package/src/hooks/inject.ts +140 -0
- package/src/hooks/types.ts +85 -0
- package/src/lib/{worker-registry.test.ts → agent-registry.test.ts} +92 -86
- package/src/lib/agent-registry.ts +446 -0
- package/src/lib/auto-approve-engine.test.ts +15 -27
- package/src/lib/auto-approve-engine.ts +67 -85
- package/src/lib/auto-approve.test.ts +12 -19
- package/src/lib/auto-approve.ts +72 -119
- package/src/lib/batch-manager.test.ts +53 -18
- package/src/lib/batch-manager.ts +16 -34
- package/src/lib/beads-issues-jsonl.ts +15 -20
- package/src/lib/beads-registry.ts +19 -171
- package/src/lib/claude-logs.test.ts +9 -11
- package/src/lib/claude-logs.ts +67 -153
- package/src/lib/claude-native-teams.ts +30 -64
- package/src/lib/claude-settings.ts +7 -101
- package/src/lib/codex-config.ts +48 -44
- package/src/lib/event-aggregator.test.ts +138 -104
- package/src/lib/event-aggregator.ts +3 -3
- package/src/lib/event-listener.test.ts +6 -7
- package/src/lib/event-listener.ts +2 -4
- package/src/lib/genie-config.ts +19 -230
- package/src/lib/genie-dir.ts +4 -12
- package/src/lib/idle-timeout.test.ts +253 -0
- package/src/lib/idle-timeout.ts +147 -0
- package/src/lib/local-tasks.test.ts +52 -20
- package/src/lib/local-tasks.ts +41 -63
- package/src/lib/log-reader.ts +87 -123
- package/src/lib/mailbox.ts +9 -66
- package/src/lib/mosaic-layout.ts +2 -5
- package/src/lib/orchestrator/event-monitor.ts +58 -273
- package/src/lib/orchestrator/index.ts +0 -1
- package/src/lib/orchestrator/patterns.ts +9 -33
- package/src/lib/orchestrator/state-detector.ts +73 -114
- package/src/lib/protocol-router-spawn.ts +167 -0
- package/src/lib/protocol-router.ts +230 -161
- package/src/lib/provider-adapters.test.ts +37 -3
- package/src/lib/provider-adapters.ts +69 -71
- package/src/lib/skill-loader.ts +18 -240
- package/src/lib/spawn-command.test.ts +8 -178
- package/src/lib/spawn-command.ts +11 -57
- package/src/lib/system-detect.ts +20 -15
- package/src/lib/target-resolver.test.ts +23 -31
- package/src/lib/target-resolver.ts +122 -163
- package/src/lib/task-backend.ts +72 -60
- package/src/lib/team-auto-spawn.test.ts +109 -0
- package/src/lib/team-auto-spawn.ts +120 -0
- package/src/lib/team-lead-command.ts +93 -0
- package/src/lib/team-manager.ts +8 -12
- package/src/lib/team-shortcut.test.ts +187 -0
- package/src/lib/team-shortcut.ts +86 -0
- package/src/lib/tmux-wrapper.ts +6 -6
- package/src/lib/tmux.ts +236 -234
- package/src/lib/version.ts +1 -11
- package/src/lib/wish-editor.test.ts +18 -18
- package/src/lib/wish-editor.ts +10 -18
- package/src/lib/wish-tasks.ts +8 -83
- package/src/lib/worktree-manager.test.ts +14 -13
- package/src/lib/worktree-manager.ts +21 -25
- package/src/term-commands/agents.ts +1445 -0
- package/src/term-commands/approve.test.ts +8 -16
- package/src/term-commands/approve.ts +68 -75
- package/src/term-commands/beads-validate.ts +49 -32
- package/src/term-commands/brainstorm-beads.ts +6 -8
- package/src/term-commands/close.ts +161 -162
- package/src/term-commands/council.ts +37 -39
- package/src/term-commands/create.ts +22 -23
- package/src/term-commands/daemon.ts +33 -32
- package/src/term-commands/events.test.ts +10 -15
- package/src/term-commands/events.ts +168 -229
- package/src/term-commands/exec.ts +7 -14
- package/src/term-commands/history.test.ts +5 -9
- package/src/term-commands/history.ts +256 -282
- package/src/term-commands/msg.test.ts +200 -0
- package/src/term-commands/msg.ts +118 -51
- package/src/term-commands/orchestrate.ts +40 -769
- package/src/term-commands/read.ts +26 -15
- package/src/term-commands/ship.test.ts +18 -21
- package/src/term-commands/ship.ts +96 -105
- package/src/term-commands/shortcuts.ts +143 -169
- package/src/term-commands/task/commands.ts +150 -127
- package/src/term-commands/team.ts +39 -14
- package/src/term-commands/update.ts +61 -64
- package/src/term-commands/work.test.ts +117 -129
- package/src/term-commands/work.ts +573 -533
- package/src/types/genie-config.ts +13 -23
- package/templates/genie-config.template.json +2 -4
- package/.github/workflows/publish.yml +0 -37
- package/Jenkinsfile.fleet-cli +0 -172
- package/bun.lock +0 -164
- package/dist/claudio.js +0 -66
- package/packages/genie-pdf/README.md +0 -229
- package/packages/genie-pdf/bun.lock +0 -381
- package/packages/genie-pdf/package.json +0 -28
- package/packages/genie-pdf/src/cli.ts +0 -125
- package/packages/genie-pdf/src/components/CodeBlock.tsx +0 -82
- package/packages/genie-pdf/src/components/Document.tsx +0 -228
- package/packages/genie-pdf/src/components/Flowchart.tsx +0 -378
- package/packages/genie-pdf/src/components/Markdown.tsx +0 -341
- package/packages/genie-pdf/src/components/TOC.tsx +0 -76
- package/packages/genie-pdf/src/components/Table.tsx +0 -158
- package/packages/genie-pdf/src/components/index.ts +0 -6
- package/packages/genie-pdf/src/index.ts +0 -4
- package/packages/genie-pdf/src/markdown.ts +0 -63
- package/packages/genie-pdf/src/render.ts +0 -102
- package/packages/genie-pdf/src/templates/index.ts +0 -4
- package/packages/genie-pdf/src/templates/invoice.tsx +0 -257
- package/packages/genie-pdf/src/templates/report.tsx +0 -140
- package/packages/genie-pdf/src/templates/research.tsx +0 -203
- package/packages/genie-pdf/src/templates/resume.tsx +0 -307
- package/packages/genie-pdf/src/themes/corporate.ts +0 -38
- package/packages/genie-pdf/src/themes/dark.ts +0 -39
- package/packages/genie-pdf/src/themes/default.ts +0 -42
- package/packages/genie-pdf/src/themes/executive.ts +0 -30
- package/packages/genie-pdf/src/themes/glass.ts +0 -33
- package/packages/genie-pdf/src/themes/index.ts +0 -53
- package/packages/genie-pdf/src/themes/minimal.ts +0 -38
- package/packages/genie-pdf/templates/example-invoice.json +0 -23
- package/packages/genie-pdf/templates/example.md +0 -106
- package/packages/genie-pdf/tsconfig.json +0 -23
- package/plugins/genie/agents/git.md +0 -159
- package/skills/genie-pilot/SKILL.md +0 -85
- package/src/claudio.ts +0 -139
- package/src/commands/launch.ts +0 -86
- package/src/commands/models.ts +0 -43
- package/src/commands/profiles.ts +0 -95
- package/src/commands/setup.ts +0 -5
- package/src/genie-commands/pdf.ts +0 -119
- package/src/lib/api-client.ts +0 -109
- package/src/lib/config.ts +0 -109
- package/src/lib/hook-manager.ts +0 -130
- package/src/lib/orchestrator/completion.ts +0 -392
- package/src/lib/picker.ts +0 -62
- package/src/lib/plugin-registry.ts +0 -262
- package/src/lib/session-metadata.ts +0 -58
- package/src/lib/wizard.ts +0 -104
- package/src/lib/worker-registry.ts +0 -368
- package/src/lib/worktree.ts +0 -362
- package/src/services/worker-service.ts +0 -351
- package/src/term-commands/attach.ts +0 -23
- package/src/term-commands/batch.test.ts +0 -333
- package/src/term-commands/batch.ts +0 -324
- package/src/term-commands/command-wiring.test.ts +0 -198
- package/src/term-commands/dashboard.test.ts +0 -890
- package/src/term-commands/dashboard.ts +0 -619
- package/src/term-commands/feed.ts +0 -326
- package/src/term-commands/hook.ts +0 -42
- package/src/term-commands/kill.ts +0 -200
- package/src/term-commands/ls.ts +0 -33
- package/src/term-commands/new.ts +0 -73
- package/src/term-commands/next.ts +0 -122
- package/src/term-commands/pane.ts +0 -81
- package/src/term-commands/push.ts +0 -78
- package/src/term-commands/resolve.ts +0 -41
- package/src/term-commands/rm.ts +0 -47
- package/src/term-commands/score.ts +0 -103
- package/src/term-commands/send.ts +0 -31
- package/src/term-commands/session/commands.ts +0 -191
- package/src/term-commands/session/index.ts +0 -48
- package/src/term-commands/spawn-parallel.test.ts +0 -629
- package/src/term-commands/spawn-parallel.ts +0 -639
- package/src/term-commands/spawn.ts +0 -566
- package/src/term-commands/split.ts +0 -95
- package/src/term-commands/status.ts +0 -116
- package/src/term-commands/sync.ts +0 -212
- package/src/term-commands/term.ts +0 -629
- package/src/term-commands/window.ts +0 -72
- package/src/term-commands/wish/commands.ts +0 -338
- package/src/term-commands/work-session.test.ts +0 -168
- package/src/term-commands/workers.ts +0 -1044
- package/src/types/config.ts +0 -17
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "automagik",
|
|
3
3
|
"owner": {
|
|
4
4
|
"name": "Namastex Labs"
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
7
|
"description": "Plugins by Namastex Labs",
|
|
8
|
-
"homepage": "https://github.com/
|
|
8
|
+
"homepage": "https://github.com/automagik-dev/genie"
|
|
9
9
|
},
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "genie",
|
|
13
|
-
"version": "3.
|
|
13
|
+
"version": "3.260309.1",
|
|
14
14
|
"source": "./plugins/genie",
|
|
15
15
|
"description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, wish them into plans, make with parallel agents, ship as one team. A coding genie that grows with your project."
|
|
16
16
|
}
|
package/.coderabbit.yaml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
language: en-US
|
|
2
|
+
tone_instructions: "Be direct and concise. Focus on bugs, security, and correctness over style."
|
|
3
|
+
|
|
4
|
+
reviews:
|
|
5
|
+
profile: assertive
|
|
6
|
+
high_level_summary: true
|
|
7
|
+
poem: false
|
|
8
|
+
auto_review:
|
|
9
|
+
enabled: true
|
|
10
|
+
auto_incremental_review: true
|
|
11
|
+
ignore_title_keywords:
|
|
12
|
+
- "WIP"
|
|
13
|
+
- "DO NOT MERGE"
|
|
14
|
+
- "wip"
|
|
15
|
+
path_filters:
|
|
16
|
+
- "!.wishes/**"
|
|
17
|
+
- "!.beads/**"
|
|
18
|
+
- "!memory/**"
|
|
19
|
+
- "!.claude/**"
|
|
20
|
+
- "!*.md"
|
|
21
|
+
- "!dist/**"
|
|
22
|
+
- "!plugins/genie/scripts/**"
|
|
23
|
+
path_instructions:
|
|
24
|
+
- path: "src/**"
|
|
25
|
+
instructions: "Core CLI source. Check for breaking changes to exported types."
|
|
26
|
+
- path: "plugins/**"
|
|
27
|
+
instructions: "Claude Code plugin. Verify plugin manifest updates are consistent."
|
|
28
|
+
- path: ".github/workflows/**"
|
|
29
|
+
instructions: "CI workflows. Check for hardcoded secrets, proper caching keys, and timeout settings."
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Wish: Resolve Dev Branch Desync After Worker→Agent Rename
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
|-------|-------|
|
|
5
|
+
| **Status** | SHIPPED |
|
|
6
|
+
| **Slug** | `resolve-dev-desync` |
|
|
7
|
+
| **Date** | 2026-03-06 |
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
Local dev branch has 9 uncommitted files from cascading dead-code cleanup (biome warning elimination round 2). Meanwhile, origin/dev advanced 8 commits including a major `Worker→Agent` type rename and `worker-registry.ts→agent-registry.ts` file rename. Need to commit local changes, rebase onto origin/dev, resolve conflicts, re-apply dead-code removals to renamed files, and verify all quality gates pass.
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
|
|
15
|
+
### IN
|
|
16
|
+
|
|
17
|
+
- Commit local dead-code cleanup changes on dev branch
|
|
18
|
+
- Rebase onto origin/dev (8 commits behind)
|
|
19
|
+
- Resolve conflict in `src/lib/beads-registry.ts` (local: dead-code removal + private heartbeat; upstream: Worker→Agent type rename)
|
|
20
|
+
- Re-apply `countByTask` export removal to `src/lib/agent-registry.ts` (was `worker-registry.ts`)
|
|
21
|
+
- Verify all cascading dead-code removals still apply after upstream changes
|
|
22
|
+
- Run and pass all quality gates: typecheck, lint (0 warnings), dead-code (knip), tests (489/489)
|
|
23
|
+
|
|
24
|
+
### OUT
|
|
25
|
+
|
|
26
|
+
- No new feature work — this is purely a merge/sync operation
|
|
27
|
+
- No additional refactoring beyond what's needed for the merge
|
|
28
|
+
- No changes to upstream code that isn't part of conflict resolution
|
|
29
|
+
|
|
30
|
+
## Decisions
|
|
31
|
+
|
|
32
|
+
| Decision | Rationale |
|
|
33
|
+
|----------|-----------|
|
|
34
|
+
| Commit local changes first, then rebase | Preserves our work as a distinct commit; cleaner than stash-pop |
|
|
35
|
+
| Rebase (not merge) | Keeps linear history on dev branch |
|
|
36
|
+
| Re-apply dead-code removals to renamed files | `worker-registry.ts` → `agent-registry.ts` means our `countByTask` export removal needs to target the new filename |
|
|
37
|
+
|
|
38
|
+
## Success Criteria
|
|
39
|
+
|
|
40
|
+
- [ ] Local dev branch is up-to-date with origin/dev
|
|
41
|
+
- [ ] All 9 local file changes are preserved (dead-code removals)
|
|
42
|
+
- [ ] `bun run check` exits 0 (typecheck + lint + dead-code + tests)
|
|
43
|
+
- [ ] `bunx biome check . --max-diagnostics=300` shows 0 warnings, 0 errors
|
|
44
|
+
- [ ] `bun test` passes 489/489 (or more, if upstream added tests)
|
|
45
|
+
- [ ] `git status` shows clean working tree
|
|
46
|
+
- [ ] Changes are pushed to origin/dev
|
|
47
|
+
|
|
48
|
+
## Execution Groups
|
|
49
|
+
|
|
50
|
+
### Group 1: Commit & Rebase
|
|
51
|
+
|
|
52
|
+
**Goal:** Get local dead-code cleanup committed and rebased onto origin/dev.
|
|
53
|
+
|
|
54
|
+
**Deliverables:**
|
|
55
|
+
1. Commit all 9 local file changes with descriptive message
|
|
56
|
+
2. `git pull --rebase origin dev`
|
|
57
|
+
3. Resolve conflicts:
|
|
58
|
+
- `src/lib/beads-registry.ts`: Accept upstream Worker→Agent renames, keep local dead-code removals (delete `heartbeat` export, `listWorkers` function)
|
|
59
|
+
- `src/lib/worker-registry.ts` → `src/lib/agent-registry.ts`: Apply `countByTask` export→private change to new filename
|
|
60
|
+
|
|
61
|
+
**Acceptance criteria:**
|
|
62
|
+
- Rebase completes without unresolved conflicts
|
|
63
|
+
- `git log --oneline` shows local commit on top of upstream commits
|
|
64
|
+
|
|
65
|
+
**Validation:**
|
|
66
|
+
```bash
|
|
67
|
+
git status # clean working tree
|
|
68
|
+
git log --oneline -3 # local commit on top
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Group 2: Verify & Fix Cascading Issues
|
|
72
|
+
|
|
73
|
+
**Goal:** Ensure all quality gates pass after rebase. Upstream changes may have introduced new dead code or broken our previous fixes.
|
|
74
|
+
|
|
75
|
+
**Deliverables:**
|
|
76
|
+
1. Run `bun run typecheck` — fix any type errors from merge
|
|
77
|
+
2. Run `bunx biome check .` — fix any new warnings (upstream may have added code with warnings)
|
|
78
|
+
3. Run `bun run dead-code` — fix any new dead exports
|
|
79
|
+
4. Run `bun test` — all tests pass
|
|
80
|
+
|
|
81
|
+
**Acceptance criteria:**
|
|
82
|
+
- `bun run check` exits 0
|
|
83
|
+
- 0 biome warnings
|
|
84
|
+
- 0 knip findings
|
|
85
|
+
|
|
86
|
+
**Validation:**
|
|
87
|
+
```bash
|
|
88
|
+
bun run check # exits 0
|
|
89
|
+
bunx biome check . --max-diagnostics=300 2>&1 | grep -E 'warning|error' || echo "Clean"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Group 3: Push
|
|
93
|
+
|
|
94
|
+
**Goal:** Push resolved branch to remote.
|
|
95
|
+
|
|
96
|
+
**Deliverables:**
|
|
97
|
+
1. `git push origin dev`
|
|
98
|
+
2. Verify `git status` shows up-to-date with origin
|
|
99
|
+
|
|
100
|
+
**Acceptance criteria:**
|
|
101
|
+
- Push succeeds
|
|
102
|
+
- Branch is up-to-date with origin/dev
|
|
103
|
+
|
|
104
|
+
**Validation:**
|
|
105
|
+
```bash
|
|
106
|
+
git status # "Your branch is up to date with 'origin/dev'"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Assumptions / Risks
|
|
110
|
+
|
|
111
|
+
| Risk | Mitigation |
|
|
112
|
+
|------|------------|
|
|
113
|
+
| Upstream may have re-introduced dead code we already cleaned | Group 2 re-runs knip and fixes new findings |
|
|
114
|
+
| Worker→Agent rename may have broken imports we modified | Typecheck in Group 2 will catch this |
|
|
115
|
+
| Upstream may have added new biome warnings | Group 2 re-runs biome and fixes |
|
|
116
|
+
| Test count may have changed upstream | Accept whatever the new count is, as long as all pass |
|
|
Binary file
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, dev]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ci-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
secrets-scan:
|
|
15
|
+
name: Secrets Scan (GitGuardian)
|
|
16
|
+
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
17
|
+
timeout-minutes: 5
|
|
18
|
+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- uses: GitGuardian/ggshield-action@v1
|
|
26
|
+
if: ${{ env.GITGUARDIAN_API_KEY != '' }}
|
|
27
|
+
env:
|
|
28
|
+
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
|
|
29
|
+
GITHUB_PUSH_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
30
|
+
GITHUB_DEFAULT_BRANCH: main
|
|
31
|
+
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
|
|
32
|
+
|
|
33
|
+
quality-gate:
|
|
34
|
+
name: Quality Gate (typecheck + lint + test)
|
|
35
|
+
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
36
|
+
timeout-minutes: 15
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
|
|
41
|
+
- uses: oven-sh/setup-bun@v2
|
|
42
|
+
with:
|
|
43
|
+
bun-version: latest
|
|
44
|
+
|
|
45
|
+
- name: Cache bun packages
|
|
46
|
+
uses: actions/cache@v4
|
|
47
|
+
with:
|
|
48
|
+
path: ~/.bun/install/cache
|
|
49
|
+
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
|
|
50
|
+
restore-keys: |
|
|
51
|
+
bun-${{ runner.os }}-
|
|
52
|
+
|
|
53
|
+
- name: Install dependencies
|
|
54
|
+
run: bun install
|
|
55
|
+
|
|
56
|
+
- name: Build
|
|
57
|
+
run: bun run build
|
|
58
|
+
|
|
59
|
+
- name: Typecheck
|
|
60
|
+
run: bun run typecheck
|
|
61
|
+
|
|
62
|
+
- name: Lint
|
|
63
|
+
run: bunx biome check .
|
|
64
|
+
|
|
65
|
+
- name: Dead code check (knip)
|
|
66
|
+
run: bunx knip
|
|
67
|
+
|
|
68
|
+
- name: Test
|
|
69
|
+
run: bun test
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Commitlint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, dev]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: commitlint-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
commitlint:
|
|
15
|
+
name: Commit Messages
|
|
16
|
+
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
17
|
+
timeout-minutes: 5
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- uses: wagoid/commitlint-github-action@v6
|
|
24
|
+
with:
|
|
25
|
+
configFile: commitlint.config.ts
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
name: Create Release
|
|
14
|
+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
15
|
+
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
16
|
+
timeout-minutes: 15
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Read version from package.json
|
|
23
|
+
id: pkg
|
|
24
|
+
run: |
|
|
25
|
+
VERSION=$(jq -r '.version' package.json)
|
|
26
|
+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
27
|
+
echo "Version from package.json: ${VERSION}"
|
|
28
|
+
|
|
29
|
+
- name: Check if release already exists
|
|
30
|
+
id: exists
|
|
31
|
+
env:
|
|
32
|
+
GH_TOKEN: ${{ github.token }}
|
|
33
|
+
run: |
|
|
34
|
+
TAG="v${{ steps.pkg.outputs.version }}"
|
|
35
|
+
|
|
36
|
+
if gh release view "${TAG}" > /dev/null 2>&1; then
|
|
37
|
+
echo "Release ${TAG} already exists — skipping."
|
|
38
|
+
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
39
|
+
else
|
|
40
|
+
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
- name: Find previous release tag
|
|
44
|
+
id: prev
|
|
45
|
+
if: steps.exists.outputs.skip != 'true'
|
|
46
|
+
env:
|
|
47
|
+
GH_TOKEN: ${{ github.token }}
|
|
48
|
+
run: |
|
|
49
|
+
TAG="v${{ steps.pkg.outputs.version }}"
|
|
50
|
+
PREV=$(gh release list --limit 50 --json tagName -q '.[].tagName' | grep -v "^${TAG}$" | head -1)
|
|
51
|
+
# Verify the tag is reachable from HEAD (same history line)
|
|
52
|
+
if [ -n "$PREV" ] && git merge-base --is-ancestor "$PREV" HEAD 2>/dev/null; then
|
|
53
|
+
echo "tag=${PREV}" >> "$GITHUB_OUTPUT"
|
|
54
|
+
echo "Previous release tag: ${PREV}"
|
|
55
|
+
else
|
|
56
|
+
echo "tag=" >> "$GITHUB_OUTPUT"
|
|
57
|
+
echo "Previous release tag not reachable from HEAD — treating as initial release"
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
- name: Generate changelog
|
|
61
|
+
uses: orhun/git-cliff-action@v4
|
|
62
|
+
id: cliff
|
|
63
|
+
if: steps.exists.outputs.skip != 'true' && steps.prev.outputs.tag != ''
|
|
64
|
+
with:
|
|
65
|
+
config: cliff.toml
|
|
66
|
+
args: ${{ format('{0}..HEAD', steps.prev.outputs.tag) }}
|
|
67
|
+
env:
|
|
68
|
+
GITHUB_REPO: ${{ github.repository }}
|
|
69
|
+
|
|
70
|
+
- name: Create release
|
|
71
|
+
if: steps.exists.outputs.skip != 'true'
|
|
72
|
+
env:
|
|
73
|
+
GH_TOKEN: ${{ github.token }}
|
|
74
|
+
RELEASE_NOTES: ${{ steps.cliff.outputs.content }}
|
|
75
|
+
run: |
|
|
76
|
+
TAG="v${{ steps.pkg.outputs.version }}"
|
|
77
|
+
if [ -z "$RELEASE_NOTES" ]; then
|
|
78
|
+
RELEASE_NOTES="Initial release of genie v3 CLI."
|
|
79
|
+
fi
|
|
80
|
+
printf '%s' "$RELEASE_NOTES" > /tmp/release-notes.md
|
|
81
|
+
gh release create "${TAG}" \
|
|
82
|
+
--target "${{ github.sha }}" \
|
|
83
|
+
--title "${TAG}" \
|
|
84
|
+
--notes-file /tmp/release-notes.md
|
|
85
|
+
|
|
86
|
+
- name: Setup Bun
|
|
87
|
+
if: steps.exists.outputs.skip != 'true'
|
|
88
|
+
uses: oven-sh/setup-bun@v2
|
|
89
|
+
with:
|
|
90
|
+
bun-version: latest
|
|
91
|
+
|
|
92
|
+
- name: Install dependencies
|
|
93
|
+
if: steps.exists.outputs.skip != 'true'
|
|
94
|
+
run: bun install --frozen-lockfile
|
|
95
|
+
|
|
96
|
+
- name: Build CLI
|
|
97
|
+
if: steps.exists.outputs.skip != 'true'
|
|
98
|
+
run: bun run build
|
|
99
|
+
|
|
100
|
+
- name: Publish to npm
|
|
101
|
+
if: steps.exists.outputs.skip != 'true'
|
|
102
|
+
env:
|
|
103
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
104
|
+
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
105
|
+
HUSKY: "0"
|
|
106
|
+
run: |
|
|
107
|
+
if [ -z "$NPM_TOKEN" ]; then
|
|
108
|
+
echo "ERROR: NPM_TOKEN secret is not set. Cannot publish to npm." >&2
|
|
109
|
+
exit 1
|
|
110
|
+
fi
|
|
111
|
+
bun publish --access public
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Rolling PR Maintenance
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '0 * * * *'
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: rolling-pr
|
|
10
|
+
cancel-in-progress: false
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
maintain:
|
|
18
|
+
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
19
|
+
timeout-minutes: 5
|
|
20
|
+
steps:
|
|
21
|
+
- name: Check/Create Rolling PR
|
|
22
|
+
env:
|
|
23
|
+
# GITHUB_TOKEN cannot create PRs (org restriction).
|
|
24
|
+
# Use a PAT with contents:read + pull-requests:write scopes.
|
|
25
|
+
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
|
26
|
+
run: |
|
|
27
|
+
# Check if open PR exists (dev -> main)
|
|
28
|
+
PR=$(gh pr list --repo ${{ github.repository }} --base main --head dev --state open --json number --jq '.[0].number')
|
|
29
|
+
|
|
30
|
+
if [ -z "$PR" ]; then
|
|
31
|
+
# Create new rolling PR
|
|
32
|
+
gh pr create --repo ${{ github.repository }} \
|
|
33
|
+
--base main --head dev \
|
|
34
|
+
--title "chore: rolling promotion dev -> main" \
|
|
35
|
+
--body "$(cat <<'BODY'
|
|
36
|
+
## Rolling Promotion PR
|
|
37
|
+
|
|
38
|
+
Auto-maintained rolling promotion PR from `dev` to `main`.
|
|
39
|
+
|
|
40
|
+
**Process:**
|
|
41
|
+
- This PR is automatically created and kept open
|
|
42
|
+
- Agent monitors CI status and fixes issues
|
|
43
|
+
- Human reviews and merges when ready
|
|
44
|
+
- Label `ready-to-merge` added when all checks pass
|
|
45
|
+
|
|
46
|
+
> Human approval required for merge to production.
|
|
47
|
+
BODY
|
|
48
|
+
)"
|
|
49
|
+
echo "Created new rolling PR"
|
|
50
|
+
else
|
|
51
|
+
echo "Rolling PR #$PR exists and is up to date"
|
|
52
|
+
fi
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["CI"]
|
|
6
|
+
types: [completed]
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
# This workflow always writes to `dev`, regardless of the trigger ref.
|
|
15
|
+
group: version-dev
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
auto-version:
|
|
20
|
+
name: Auto Version
|
|
21
|
+
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
22
|
+
timeout-minutes: 5
|
|
23
|
+
if: >-
|
|
24
|
+
(github.event_name == 'workflow_dispatch') ||
|
|
25
|
+
(github.event.workflow_run.conclusion == 'success' &&
|
|
26
|
+
github.event.workflow_run.event == 'push' &&
|
|
27
|
+
github.event.workflow_run.head_branch == 'main' &&
|
|
28
|
+
startsWith(github.event.workflow_run.head_commit.message, 'Merge pull request') &&
|
|
29
|
+
contains(github.event.workflow_run.head_commit.message, '/dev') &&
|
|
30
|
+
!contains(github.event.workflow_run.head_commit.message, '[skip ci]'))
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
with:
|
|
35
|
+
ref: dev
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
|
|
39
|
+
- uses: oven-sh/setup-bun@v2
|
|
40
|
+
with:
|
|
41
|
+
bun-version: latest
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: bun install
|
|
45
|
+
|
|
46
|
+
- name: Configure git
|
|
47
|
+
run: |
|
|
48
|
+
git config user.name "github-actions[bot]"
|
|
49
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
50
|
+
|
|
51
|
+
- name: Derive version
|
|
52
|
+
id: version
|
|
53
|
+
run: |
|
|
54
|
+
TODAY=$(date -u +%y%m%d)
|
|
55
|
+
EXISTING=$(git tag --list "v3.${TODAY}.*" | wc -l)
|
|
56
|
+
BUILD_NUMBER=$((EXISTING + 1))
|
|
57
|
+
VERSION="3.${TODAY}.${BUILD_NUMBER}"
|
|
58
|
+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
59
|
+
echo "build_number=${BUILD_NUMBER}" >> "$GITHUB_OUTPUT"
|
|
60
|
+
echo "Derived version: ${VERSION}"
|
|
61
|
+
|
|
62
|
+
- name: Sync all version files
|
|
63
|
+
run: bun run version
|
|
64
|
+
env:
|
|
65
|
+
GENIE_BUILD_NUMBER: ${{ steps.version.outputs.build_number }}
|
|
66
|
+
|
|
67
|
+
- name: Format versioned JSON (Biome)
|
|
68
|
+
run: |
|
|
69
|
+
bunx biome format --write package.json openclaw.plugin.json plugins/genie/.claude-plugin/plugin.json plugins/genie/package.json .claude-plugin/marketplace.json 2>/dev/null || true
|
|
70
|
+
|
|
71
|
+
- name: Commit and tag
|
|
72
|
+
run: |
|
|
73
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
74
|
+
|
|
75
|
+
git add -A '*.json' 'src/lib/version.ts'
|
|
76
|
+
if git diff --cached --quiet; then
|
|
77
|
+
echo "No version changes to commit"
|
|
78
|
+
else
|
|
79
|
+
git commit -m "chore(version): bump to ${VERSION} [skip ci]"
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
git tag "v${VERSION}"
|
|
83
|
+
git push --atomic origin HEAD:refs/heads/dev "refs/tags/v${VERSION}"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bunx commitlint --edit "$1"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bunx biome check --staged --no-errors-on-unmatched
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
set -e
|
|
2
|
+
|
|
3
|
+
remote="$1"
|
|
4
|
+
while read local_ref local_oid remote_ref remote_oid; do
|
|
5
|
+
if echo "$remote_ref" | grep -qE 'refs/heads/(main|master)$'; then
|
|
6
|
+
echo "BLOCKED: push to $remote_ref is forbidden."
|
|
7
|
+
echo "Main is production — human merges the rolling PR."
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
done
|
|
11
|
+
|
|
12
|
+
bun run typecheck
|
|
13
|
+
bun test
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Automagik
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/Makefile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.PHONY: build lint lint-fix format typecheck test check clean
|
|
2
|
+
|
|
3
|
+
build:
|
|
4
|
+
bun run build
|
|
5
|
+
|
|
6
|
+
lint:
|
|
7
|
+
bunx biome check .
|
|
8
|
+
|
|
9
|
+
lint-fix:
|
|
10
|
+
bunx biome check --write .
|
|
11
|
+
|
|
12
|
+
format:
|
|
13
|
+
bunx biome format --write .
|
|
14
|
+
|
|
15
|
+
typecheck:
|
|
16
|
+
bun run typecheck
|
|
17
|
+
|
|
18
|
+
test:
|
|
19
|
+
bun test
|
|
20
|
+
|
|
21
|
+
check: lint typecheck test
|
|
22
|
+
|
|
23
|
+
clean:
|
|
24
|
+
rm -rf dist node_modules
|