@caddis/cli 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/bundles/antigravity-plugin/agents/claude-md-curator.md +1 -1
  2. package/bundles/antigravity-plugin/caddis_statusline.py +803 -0
  3. package/bundles/antigravity-plugin/claude-md/folder-agents.md.tmpl +21 -0
  4. package/bundles/antigravity-plugin/guard_agy.py +23 -4
  5. package/bundles/antigravity-plugin/plugin.json +1 -1
  6. package/bundles/antigravity-plugin/scripts/caddis_gate.py +524 -0
  7. package/bundles/antigravity-plugin/scripts/caddis_inventory.py +369 -0
  8. package/bundles/antigravity-plugin/scripts/caddis_migrate_dir.py +270 -0
  9. package/bundles/antigravity-plugin/scripts/caddis_spawn.py +300 -0
  10. package/bundles/antigravity-plugin/scripts/caddis_statusline.py +803 -0
  11. package/bundles/antigravity-plugin/scripts/caddis_tidy.py +366 -0
  12. package/bundles/antigravity-plugin/scripts/check_doc_coverage.py +924 -0
  13. package/bundles/antigravity-plugin/scripts/claude-deepseek.ps1 +4 -0
  14. package/bundles/antigravity-plugin/scripts/claude-deepseek.sh +3 -0
  15. package/bundles/antigravity-plugin/scripts/claude-glm.ps1 +4 -0
  16. package/bundles/antigravity-plugin/scripts/claude-glm.sh +3 -0
  17. package/bundles/antigravity-plugin/scripts/claude-oss.ps1 +64 -0
  18. package/bundles/antigravity-plugin/scripts/claude-oss.sh +60 -0
  19. package/bundles/antigravity-plugin/scripts/claudster_config.py +126 -0
  20. package/bundles/antigravity-plugin/scripts/claudster_doctor.py +356 -0
  21. package/bundles/antigravity-plugin/scripts/claudster_init.py +400 -0
  22. package/bundles/antigravity-plugin/scripts/claudster_migrate_rules.py +300 -0
  23. package/bundles/antigravity-plugin/scripts/dream_capture.py +249 -0
  24. package/bundles/antigravity-plugin/scripts/dream_memory.py +438 -0
  25. package/bundles/antigravity-plugin/scripts/enforcement_inventory.py +261 -0
  26. package/bundles/antigravity-plugin/scripts/hook_log.py +156 -0
  27. package/bundles/antigravity-plugin/scripts/oss_ask.py +98 -0
  28. package/bundles/antigravity-plugin/scripts/oss_model.py +166 -0
  29. package/bundles/antigravity-plugin/scripts/oss_review.py +718 -0
  30. package/bundles/antigravity-plugin/scripts/setup_project_ai.py +1429 -0
  31. package/bundles/antigravity-plugin/scripts/usage_review.py +1323 -0
  32. package/bundles/antigravity-plugin/session_end_agy.py +21 -2
  33. package/bundles/antigravity-plugin/skills/_registry.md +1 -0
  34. package/bundles/antigravity-plugin/skills/fastapi-dev/SKILL.md +1 -1
  35. package/bundles/antigravity-plugin/skills/ship/SKILL.md +1 -1
  36. package/bundles/antigravity-plugin/skills/ship-merge/SKILL.md +1 -1
  37. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +1 -1
  38. package/bundles/antigravity-plugin/skills/statusline/SKILL.md +105 -0
  39. package/bundles/antigravity-plugin/skills/use-model/SKILL.md +15 -3
  40. package/bundles/antigravity-plugin/warm_start_agy.py +21 -2
  41. package/bundles/antigravity-plugin-extras/plugin.json +1 -1
  42. package/bundles/antigravity-plugin-extras/skills/architecture-design/SKILL.md +1 -1
  43. package/bundles/antigravity-plugin-extras/skills/caching-patterns/SKILL.md +1 -1
  44. package/bundles/antigravity-plugin-extras/skills/webapp-development/SKILL.md +1 -1
  45. package/bundles/manifest.json +3 -3
  46. package/dist/claude-deepseek.js +544 -0
  47. package/dist/claude-glm.js +544 -0
  48. package/dist/claude-oss.js +544 -0
  49. package/dist/cli.js +365 -44
  50. package/package.json +5 -2
  51. package/bundles/antigravity-plugin/statusline-command-agy.sh +0 -91
@@ -22,6 +22,25 @@ def _artifact_root(root: str) -> str:
22
22
  return os.path.join(str(root), ".caddis")
23
23
 
24
24
 
25
+
26
+ def _hook_note(feature, exc, root=None):
27
+ """Record a swallowed failure in the caddis hook ledger. Never raises, never prints.
28
+
29
+ agy hooks ship FLAT at the plugin root while hook_log.py ships under scripts/, and in
30
+ the source repo this file sits in claude-harness/agy/ with hook_log.py one level up in
31
+ claude-harness/scripts/. Try both layouts.
32
+ """
33
+ try:
34
+ _here = os.path.dirname(os.path.abspath(__file__))
35
+ for _cand in (os.path.join(_here, "scripts"),
36
+ os.path.join(os.path.dirname(_here), "scripts")):
37
+ if os.path.isdir(_cand) and _cand not in sys.path:
38
+ sys.path.insert(0, _cand)
39
+ import hook_log as _hl # noqa: E402
40
+ _hl.record(os.path.basename(__file__).replace(".py", ""), feature, exc, root)
41
+ except Exception:
42
+ pass
43
+
25
44
  def main() -> None:
26
45
  try:
27
46
  data = json.load(sys.stdin)
@@ -43,8 +62,8 @@ def main() -> None:
43
62
  }
44
63
  with open(os.path.join(art, "usage-log.jsonl"), "a", encoding="utf-8") as fh:
45
64
  fh.write(json.dumps(record) + "\n")
46
- except Exception:
47
- pass # never fail the turn
65
+ except Exception as _exc:
66
+ _hook_note("agy usage-log write", _exc) # never fail the turn
48
67
  # No stdout: agy interprets a Stop hook's stdout as a decision object.
49
68
 
50
69
 
@@ -86,6 +86,7 @@
86
86
  | Ship Pr | `ship-pr/` | Open a reviewed PR for the current feature branch — rebase-safe push, PR create/update, monitor CI, STOP at green. Never merges, never deploys (that's /ship-merge). |
87
87
  | Spawn Hub | `spawn-hub/` | Hand the Advisory Hub role to a fresh session — run the mechanical audit, then generate the succession prompt with a context self-check the new Hub must pass |
88
88
  | Spawn Session | `spawn-session/` | Hand the WORK to a fresh session — generate the handover from the repo, then validate the successor by re-deriving its answers |
89
+ | Statusline | `statusline/` | Install the caddis status line into Claude Code and agy — one renderer, once per machine |
89
90
  | Tdd | `tdd/` | Run a strict red-green-refactor TDD cycle for a unit of behavior |
90
91
  | Ui Brief | `ui-brief/` | Design-first UI brief — lock the aesthetic before writing any code |
91
92
  | Usage Review | `usage-review/` | Review local caddis usage over a window, surface prioritised recommendations, and apply config changes in one step |
@@ -295,6 +295,6 @@ async def create_record(record: RecordCreate, service: ...):
295
295
  | Resource | Path |
296
296
  |----------|------|
297
297
  | FastAPI instructions | `instructions/fastapi.instructions.md` |
298
- | SQL expert skill | `skills/coding/sql/SKILL.md` |
298
+ | SQL expert skill | the `sql` skill |
299
299
  | Python instructions | `instructions/python.instructions.md` |
300
300
  | Security instructions | `instructions/security.instructions.md` |
@@ -103,5 +103,5 @@ Release tag: <tag> → <sha> | n/a
103
103
 
104
104
  ## Skill reference
105
105
  Full procedures for the Gitea lane (CI monitoring, prod validation, queue triage, failure remediation)
106
- are in `skills/devops/deploy-local/SKILL.md`. For the GitHub lane, the `gh-cli` skill covers `gh run`
106
+ are in the `deploy-local` skill (ships in the optional `caddis-extras` plugin — enable it with `claude plugin enable caddis-extras`). For the GitHub lane, the `gh-cli` skill covers `gh run`
107
107
  usage. Load whichever matches the detected lane when a step needs more detail.
@@ -99,5 +99,5 @@ Cleanup: remote branch ✗ deleted / local ✗ deleted / backup ref droppe
99
99
  - Local-only lane: no PR, no merge — refuse and point at `/ship`.
100
100
 
101
101
  ## Skill reference
102
- Gitea deploy monitoring, prod validation, failure triage: `skills/devops/deploy-local/SKILL.md`.
102
+ Gitea deploy monitoring, prod validation, failure triage: the `deploy-local` skill (ships in the optional `caddis-extras` plugin — enable it with `claude plugin enable caddis-extras`).
103
103
  GitHub `gh pr merge` / `gh run` usage: the `gh-cli` skill.
@@ -98,5 +98,5 @@ human-confirmed door.
98
98
  - Local-only lane: refuse + point at `/ship`. On the default branch: stop + point at `/ship`.
99
99
 
100
100
  ## Skill reference
101
- Gitea API monitoring + failure triage: `skills/devops/deploy-local/SKILL.md`. GitHub `gh pr` / `gh run`
101
+ Gitea API monitoring + failure triage: the `deploy-local` skill (ships in the optional `caddis-extras` plugin — enable it with `claude plugin enable caddis-extras`). GitHub `gh pr` / `gh run`
102
102
  usage: the `gh-cli` skill. Load whichever matches the detected lane.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: statusline
3
+ description: Install the caddis status line into Claude Code and agy — one renderer, once per machine
4
+ ---
5
+
6
+ # /statusline — set up the status bar
7
+
8
+ Wire the caddis status line into every coding agent on this machine. One Python renderer serves
9
+ both hosts. It installs at **user scope**, so every project gets the line and no project holds a
10
+ copy that can drift.
11
+
12
+ ## What the user gets
13
+
14
+ Claude Code:
15
+
16
+ ```
17
+ ⌂ claudster-source | saajunaid/caddis ⎇ main +2 ●1 ?3 ↑1 | ◆ Opus 5 (1M context) v2.1.239 |
18
+ ◉ 412k/1M [███░░░░░] 41% | ⚡ 386k cached | effort:high | style:Plain | thinking |
19
+ 5h:12% 7d:40% | 💻 57% (37 GB) | ⏺ relay | ◷ 07:58
20
+ ```
21
+
22
+ agy (Antigravity):
23
+
24
+ ```
25
+ ▛▜ agy | ● idle | 🧠 Gemini 3.6 Flash (High) (high) | 📁 claudster-source | ⎇ main ?3 |
26
+ ◉ 48.5k/1M [░░░░░░░░] 5% | ⚡ 40k cached | q 62% | 💻 57% (37 GB) | ⏺ relay | ◷ 08:01
27
+ ```
28
+
29
+ Both lines come from `caddis_statusline.py`. It has two profiles, because the two hosts send
30
+ different field names — agy's payload is a sibling of Claude Code's, not a copy.
31
+
32
+ ## Run it
33
+
34
+ Find the renderer in this install and run it. Try these paths in order and use the first that exists:
35
+
36
+ - `${CLAUDE_PLUGIN_ROOT}/scripts/caddis_statusline.py`
37
+ - `claude-harness/scripts/caddis_statusline.py` (working inside the caddis source repo)
38
+
39
+ Then:
40
+
41
+ ```bash
42
+ python <path>/caddis_statusline.py --install # both hosts
43
+ python <path>/caddis_statusline.py --install --host claude
44
+ python <path>/caddis_statusline.py --install --host agy
45
+ python <path>/caddis_statusline.py --install --dry-run # print, write nothing
46
+ ```
47
+
48
+ `--install` does four things:
49
+
50
+ 1. Copies the renderer to `~/.caddis/statusline.py` — a **stable** path. Pointing the host
51
+ settings at the plugin cache would break on every caddis upgrade, because the version number
52
+ is in that path.
53
+ 2. Creates `~/.caddis/statusline.json` with the default toggles. It never overwrites an existing one.
54
+ 3. Backs up each host's `settings.json` to `settings.json.bak-caddis-statusline`.
55
+ 4. Sets `statusLine` in `~/.claude/settings.json` and `~/.gemini/antigravity-cli/settings.json`,
56
+ preserving every other key. A host that is not installed is skipped, not failed.
57
+
58
+ Report the tool's own output to the user. Then tell them the line appears on the **next** session —
59
+ neither host re-reads `settings.json` mid-session.
60
+
61
+ ## Verify
62
+
63
+ ```bash
64
+ python ~/.caddis/statusline.py --check # what is wired where
65
+ python ~/.caddis/statusline.py --sample --profile claude # preview, no host needed
66
+ python ~/.caddis/statusline.py --sample --profile agy
67
+ ```
68
+
69
+ `--check` exits non-zero when a host's `statusLine` is missing or points somewhere else.
70
+
71
+ ## Change the look
72
+
73
+ Edit `~/.caddis/statusline.json`. Every key is optional; a missing file means defaults.
74
+
75
+ | key | default | what it controls |
76
+ |---|---|---|
77
+ | `color` | `true` | ANSI colour |
78
+ | `icons` | `true` | Unicode segment icons. These are plain Unicode, **not** Nerd Font glyphs |
79
+ | `progress_bar` | `true` | the `[███░░░░░]` context bar |
80
+ | `bar_width` | `8` | bar cells |
81
+ | `token_counts` | `true` | `◉ 412k/1M` |
82
+ | `cached_tokens` | `true` | `⚡ 386k cached` — bold and bright by design, never width-gated |
83
+ | `ram` | `true` | `💻 57% (37 GB)` |
84
+ | `ram_min_width` | `0` | hide RAM below this terminal width; `0` always shows it |
85
+ | `clock` | `true` | `◷ 07:58` |
86
+ | `relay` | `true` | `⏺ relay` when a parked resume pointer exists |
87
+ | `rate_limits` | `true` | `5h:12% 7d:40%` (Claude Code only) |
88
+ | `session_id` | `false` | `#a1b2c3d4` |
89
+ | `git` | `true` | branch, staged/unstaged/untracked counts, ahead/behind |
90
+ | `separator` | `"\|"` | segment separator |
91
+
92
+ Config changes take effect on the next render. No reinstall needed.
93
+
94
+ ## Notes for you, not the user
95
+
96
+ - Do **not** hand-edit either `settings.json` to wire this. `--install` reads, merges and writes
97
+ back, so it cannot drop an unrelated key. Hand edits have dropped `trustedWorkspaces` before.
98
+ - The renderer never crashes the host. A bad payload, a missing field, or an unreadable config
99
+ degrades to fewer segments; a hard failure degrades to the directory name.
100
+ - RAM on Windows uses `ctypes` `GlobalMemoryStatusEx`, an in-process call. Do not replace it with
101
+ `Get-CimInstance Win32_OperatingSystem` — that cost about 300 ms on **every** render in the
102
+ PowerShell line this replaced.
103
+ - If the user asks why their old `~/.claude/statusline-custom.sh` or
104
+ `~/.gemini/statusline/statusline.ps1` no longer runs: nothing points at them any more. They are
105
+ superseded, not deleted. Both are safe to remove once the user is happy with the new line.
@@ -55,9 +55,21 @@ A wholly new provider: add a row to `PROVIDERS` in `oss_model.py` (base_url, mod
55
55
  pass an unknown provider name with `OSS_BASE_URL`+`OSS_MODEL` set — no table edit required.
56
56
 
57
57
  ## First-time install
58
- Put `claude-harness/scripts/` (or your plugin's `scripts/` dir) on `PATH`, or add a shell profile
59
- function. `/setup-project-ai` documents the one-liner for your platform (PowerShell profile function /
60
- bash alias) — it does not silently edit your shell profile.
58
+
59
+ ```
60
+ npm i -g @caddis/cli # puts claude-oss / claude-glm / claude-deepseek on PATH
61
+ caddis keys # prompts for each provider key, validates it, writes ~/.caddis/keys.env
62
+ claude-glm --print-config # zero-token check: endpoint, model, key all resolved
63
+ ```
64
+
65
+ npm does the PATH work on Windows, macOS and Linux. No profile edit, no script copying, no
66
+ Python needed on the lane path — the resolver is ported into the CLI, because the npm tarball
67
+ ships only `dist` and `bundles`.
68
+
69
+ `npx` runs the default `caddis` binary only; the lane binaries need the global install above.
70
+
71
+ **Plugin-only installs** (no npm CLI) keep the original route: put the plugin's `scripts/`
72
+ directory on `PATH`, or add a shell profile function. caddis never silently edits your profile.
61
73
 
62
74
  ## Exit codes
63
75
  `claude-oss`/`claude-glm` propagate the wrapped `claude` process's exit code, except a resolver failure
@@ -131,14 +131,33 @@ def truncate_relay(text: str) -> str:
131
131
  return text
132
132
 
133
133
 
134
+
135
+ def _hook_note(feature, exc, root=None):
136
+ """Record a swallowed failure in the caddis hook ledger. Never raises, never prints.
137
+
138
+ agy hooks ship FLAT at the plugin root while hook_log.py ships under scripts/, and in
139
+ the source repo this file sits in claude-harness/agy/ with hook_log.py one level up in
140
+ claude-harness/scripts/. Try both layouts.
141
+ """
142
+ try:
143
+ _here = os.path.dirname(os.path.abspath(__file__))
144
+ for _cand in (os.path.join(_here, "scripts"),
145
+ os.path.join(os.path.dirname(_here), "scripts")):
146
+ if os.path.isdir(_cand) and _cand not in sys.path:
147
+ sys.path.insert(0, _cand)
148
+ import hook_log as _hl # noqa: E402
149
+ _hl.record(os.path.basename(__file__).replace(".py", ""), feature, exc, root)
150
+ except Exception:
151
+ pass
152
+
134
153
  def main() -> None:
135
154
  try:
136
155
  _reconfig = getattr(sys.stdout, "reconfigure", None)
137
156
  if _reconfig:
138
157
  try:
139
158
  _reconfig(encoding="utf-8")
140
- except Exception:
141
- pass
159
+ except Exception as _exc:
160
+ _hook_note("agy stdout utf-8 reconfigure", _exc)
142
161
  try:
143
162
  data = json.load(sys.stdin)
144
163
  except Exception:
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "caddis-extras",
3
- "version": "1.3.24",
3
+ "version": "1.3.25",
4
4
  "description": "caddis-extras — the long-tail skills for the Antigravity (agy) caddis plugin; install alongside caddis for the full set."
5
5
  }
@@ -241,4 +241,4 @@ def fetch_records(status: str = None, page: int = 1):
241
241
  | Architect agent | `agents/architect.agent.md` |
242
242
  | FastAPI dev skill | `skills/coding/fastapi-dev/SKILL.md` |
243
243
  | Streamlit dev skill | `skills/frontend/streamlit-dev/SKILL.md` |
244
- | SQL expert skill | `skills/coding/sql/SKILL.md` |
244
+ | SQL expert skill | the `sql` skill |
@@ -382,4 +382,4 @@ This pattern is complementary to chunk retry (Step 6 + Gotcha 6) — the 3-layer
382
382
  |----------|------|
383
383
  | Streamlit dev skill | `skills/frontend/streamlit-dev/SKILL.md` |
384
384
  | Streamlit instructions | `instructions/streamlit.instructions.md` |
385
- | SQL expert skill | `skills/coding/sql/SKILL.md` |
385
+ | SQL expert skill | the `sql` skill |
@@ -283,6 +283,6 @@ st.plotly_chart(create_trend_chart(filter_type), use_container_width=True)
283
283
  |----------|------|
284
284
  | Streamlit dev skill | `skills/frontend/streamlit-dev/SKILL.md` |
285
285
  | FastAPI dev skill | `skills/coding/fastapi-dev/SKILL.md` |
286
- | SQL expert skill | `skills/coding/sql/SKILL.md` |
286
+ | SQL expert skill | the `sql` skill |
287
287
  | Caching patterns | `skills/coding/caching-patterns/SKILL.md` |
288
288
  | UX design skill | `skills/frontend/ux-design/SKILL.md` |
@@ -1,7 +1,7 @@
1
1
  {
2
- "poolVersion": "1.3.75",
2
+ "poolVersion": "1.3.77",
3
3
  "bundles": {
4
- "antigravity-plugin": "1.3.75",
5
- "antigravity-plugin-extras": "1.3.24"
4
+ "antigravity-plugin": "1.3.77",
5
+ "antigravity-plugin-extras": "1.3.25"
6
6
  }
7
7
  }