@iowarp/clio-coder 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 (226) hide show
  1. package/CHANGELOG.md +407 -0
  2. package/CODE_OF_CONDUCT.md +21 -0
  3. package/CONTRIBUTING.md +224 -0
  4. package/LICENSE +202 -0
  5. package/NOTICE +9 -0
  6. package/README.md +798 -0
  7. package/SECURITY.md +72 -0
  8. package/assets/clio-coder-logo-128.webp +0 -0
  9. package/damage-control-rules.yaml +419 -0
  10. package/dist/acp-UMLFVA3F.js +92 -0
  11. package/dist/agents-Q4MYPMUW.js +91 -0
  12. package/dist/auth-O6HYIJ6J.js +521 -0
  13. package/dist/chunk-262G75JS.js +35 -0
  14. package/dist/chunk-26BZQOAD.js +1281 -0
  15. package/dist/chunk-2J63S4SF.js +508 -0
  16. package/dist/chunk-3DANZDGR.js +717 -0
  17. package/dist/chunk-4UQA7NCT.js +29 -0
  18. package/dist/chunk-527KG6XR.js +497 -0
  19. package/dist/chunk-5LDRNKX2.js +1063 -0
  20. package/dist/chunk-5N2FG33Q.js +25 -0
  21. package/dist/chunk-67MTHP2E.js +135 -0
  22. package/dist/chunk-6CWDTGUC.js +20 -0
  23. package/dist/chunk-7BHLZB3A.js +2115 -0
  24. package/dist/chunk-7RBKDI66.js +348 -0
  25. package/dist/chunk-AMFR5YA3.js +541 -0
  26. package/dist/chunk-BBUH4VAA.js +1224 -0
  27. package/dist/chunk-BYEU76JP.js +899 -0
  28. package/dist/chunk-CLJ5HLUD.js +458 -0
  29. package/dist/chunk-D5YD55AR.js +116 -0
  30. package/dist/chunk-DXQNI4PC.js +61 -0
  31. package/dist/chunk-E3NYWENM.js +1004 -0
  32. package/dist/chunk-GNGDQYDU.js +34688 -0
  33. package/dist/chunk-GOTUR54M.js +9 -0
  34. package/dist/chunk-HBU5MTAM.js +41 -0
  35. package/dist/chunk-HMYNFFY4.js +28 -0
  36. package/dist/chunk-JPOWPFCU.js +1010 -0
  37. package/dist/chunk-JWHCJDCI.js +1215 -0
  38. package/dist/chunk-KBR4MZZR.js +41 -0
  39. package/dist/chunk-KKKPTZLM.js +93 -0
  40. package/dist/chunk-ME6DNWIU.js +66 -0
  41. package/dist/chunk-NI4DEJMC.js +88 -0
  42. package/dist/chunk-O4EJEDHO.js +659 -0
  43. package/dist/chunk-PIDUD6M2.js +31 -0
  44. package/dist/chunk-PS4PFJQP.js +29459 -0
  45. package/dist/chunk-QV47YRF4.js +48 -0
  46. package/dist/chunk-RQDWMVRB.js +279 -0
  47. package/dist/chunk-TFSSEXL6.js +136 -0
  48. package/dist/chunk-TKHQ4DGZ.js +8290 -0
  49. package/dist/chunk-TPOCL34A.js +2876 -0
  50. package/dist/chunk-UGYAX5YI.js +565 -0
  51. package/dist/chunk-UHTSULZS.js +461 -0
  52. package/dist/chunk-UU3R62TT.js +128 -0
  53. package/dist/chunk-UWIJNAOB.js +3906 -0
  54. package/dist/chunk-VOO7NYPP.js +914 -0
  55. package/dist/chunk-VPAWTYLY.js +117 -0
  56. package/dist/chunk-WD6AJM35.js +1216 -0
  57. package/dist/chunk-X3BR7HWV.js +115 -0
  58. package/dist/chunk-X3NE4WVW.js +120 -0
  59. package/dist/chunk-XNISANGE.js +1395 -0
  60. package/dist/chunk-XV4ZJ6ZM.js +3177 -0
  61. package/dist/cli/index.js +236 -0
  62. package/dist/clio-KIQ5SNDS.js +53 -0
  63. package/dist/components-JVHMUBEB.js +653 -0
  64. package/dist/config-ZFCDBMDC.js +372 -0
  65. package/dist/configure-G4E3A2PG.js +27 -0
  66. package/dist/context-CDXTP2MP.js +293 -0
  67. package/dist/context-E3KIFVXI.js +185 -0
  68. package/dist/context-clear-3F4PLXOS.js +102 -0
  69. package/dist/context-index-Q7YSYTR3.js +106 -0
  70. package/dist/docs-YIETIWZI.js +280 -0
  71. package/dist/doctor-M5HJJZOL.js +61 -0
  72. package/dist/domains/agents/builtins/architect.md +33 -0
  73. package/dist/domains/agents/builtins/coder.md +31 -0
  74. package/dist/domains/agents/builtins/context-bootstrap.md +38 -0
  75. package/dist/domains/agents/builtins/debugger.md +30 -0
  76. package/dist/domains/agents/builtins/documenter.md +31 -0
  77. package/dist/domains/agents/builtins/git-master.md +30 -0
  78. package/dist/domains/agents/builtins/provenance.md +30 -0
  79. package/dist/domains/agents/builtins/researcher.md +71 -0
  80. package/dist/domains/agents/builtins/scout.md +42 -0
  81. package/dist/domains/agents/builtins/tester.md +31 -0
  82. package/dist/domains/agents/builtins/verifier.md +30 -0
  83. package/dist/domains/agents/builtins/wiki-writer.md +41 -0
  84. package/dist/eval-B3KZZESM.js +2674 -0
  85. package/dist/evidence-V67CHM35.js +233 -0
  86. package/dist/evolve-YDZSUQYA.js +518 -0
  87. package/dist/extensions-SRG7XCAH.js +207 -0
  88. package/dist/fleet-CA2CRTVG.js +760 -0
  89. package/dist/fleet-preflight-CLIAX7YR.js +21 -0
  90. package/dist/init-2OZDJE2D.js +227 -0
  91. package/dist/memory-3PIQQAKX.js +207 -0
  92. package/dist/models-DY35XI7Y.js +237 -0
  93. package/dist/paths-5OMXW7Z4.js +57 -0
  94. package/dist/preload-KZVHET2B.js +11 -0
  95. package/dist/reset-PIFYNOS3.js +216 -0
  96. package/dist/run-3VSPP24F.js +735 -0
  97. package/dist/share-D36RQCXM.js +241 -0
  98. package/dist/skills-F2MRLELY.js +445 -0
  99. package/dist/skills-eval-E2ZTW4PL.js +932 -0
  100. package/dist/targets-DZMEZAH4.js +977 -0
  101. package/dist/trace-7NYCUI2J.js +250 -0
  102. package/dist/uninstall-AD3JWHBB.js +322 -0
  103. package/dist/upgrade-WYYBKGDY.js +301 -0
  104. package/dist/usage-ULIDAGFF.js +755 -0
  105. package/dist/version-ROZ6CZKH.js +16 -0
  106. package/dist/wiki-generate-PKFIX6OB.js +377 -0
  107. package/dist/worker/entry.js +1739 -0
  108. package/docs/README.md +93 -0
  109. package/docs/acp.md +120 -0
  110. package/docs/alcf-provider.md +72 -0
  111. package/docs/architecture.md +172 -0
  112. package/docs/artifact-versions.md +54 -0
  113. package/docs/built-in-agents.md +265 -0
  114. package/docs/capacity-and-scheduling.md +97 -0
  115. package/docs/commands-and-modes.md +554 -0
  116. package/docs/config-knobs-audit.md +115 -0
  117. package/docs/configuration-and-targets.md +812 -0
  118. package/docs/context-engine.md +236 -0
  119. package/docs/dispatch-architecture-rationale.md +126 -0
  120. package/docs/documentation-coverage.md +46 -0
  121. package/docs/documentation-guide.md +166 -0
  122. package/docs/environment-variables.md +105 -0
  123. package/docs/eval-runner.md +205 -0
  124. package/docs/evals-internal.md +298 -0
  125. package/docs/evidence-and-memory.md +243 -0
  126. package/docs/evolution.md +143 -0
  127. package/docs/exit-codes-and-output.md +74 -0
  128. package/docs/extensions-and-sharing.md +306 -0
  129. package/docs/fleet-demo-runbook.md +179 -0
  130. package/docs/fleet-dispatch.md +591 -0
  131. package/docs/glossary.md +75 -0
  132. package/docs/html/agents_blueprint.html +936 -0
  133. package/docs/html/alcf_blueprint.html +324 -0
  134. package/docs/html/architecture_blueprint.html +850 -0
  135. package/docs/html/commands_blueprint.html +794 -0
  136. package/docs/html/config_knobs_audit_blueprint.html +178 -0
  137. package/docs/html/configuration_blueprint.html +1080 -0
  138. package/docs/html/context_blueprint.html +603 -0
  139. package/docs/html/documentation_blueprint.html +832 -0
  140. package/docs/html/environment_blueprint.html +404 -0
  141. package/docs/html/eval_blueprint.html +743 -0
  142. package/docs/html/evals_internal_blueprint.html +190 -0
  143. package/docs/html/evolution_blueprint.html +674 -0
  144. package/docs/html/extensions_blueprint.html +2065 -0
  145. package/docs/html/fleet_dispatch_blueprint.html +286 -0
  146. package/docs/html/index.html +919 -0
  147. package/docs/html/lifecycle_blueprint.html +723 -0
  148. package/docs/html/memory_blueprint.html +699 -0
  149. package/docs/html/middleware_blueprint.html +664 -0
  150. package/docs/html/models_blueprint.html +2366 -0
  151. package/docs/html/observability_blueprint.html +683 -0
  152. package/docs/html/provider_adapter_blueprint.html +245 -0
  153. package/docs/html/safety_blueprint.html +1386 -0
  154. package/docs/html/shared.css +571 -0
  155. package/docs/html/shared.js +143 -0
  156. package/docs/html/skills_blueprint.html +671 -0
  157. package/docs/html/soak_blueprint.html +182 -0
  158. package/docs/html/tool_usage_blueprint.html +350 -0
  159. package/docs/html/tools_blueprint.html +2249 -0
  160. package/docs/html/trace_blueprint.html +235 -0
  161. package/docs/html/tui_design_blueprint.html +314 -0
  162. package/docs/html/validation_blueprint.html +961 -0
  163. package/docs/html/worker_dispatch_blueprint.html +231 -0
  164. package/docs/installation-and-lifecycle.md +308 -0
  165. package/docs/middleware-and-components.md +148 -0
  166. package/docs/model-catalog.md +189 -0
  167. package/docs/observability.md +233 -0
  168. package/docs/proactive-memory.md +452 -0
  169. package/docs/prompt-envelope-and-tools.md +142 -0
  170. package/docs/provider-adapter-cookbook.md +148 -0
  171. package/docs/release-cut-checklist.md +138 -0
  172. package/docs/safety-model.md +357 -0
  173. package/docs/scientific-validation.md +105 -0
  174. package/docs/session-lifecycle.md +156 -0
  175. package/docs/skills-marketplace.md +46 -0
  176. package/docs/tool-usage.md +527 -0
  177. package/docs/trace-store.md +132 -0
  178. package/docs/troubleshooting.md +33 -0
  179. package/docs/tui-design.md +239 -0
  180. package/docs/worker-dispatch-mechanics.md +242 -0
  181. package/package.json +132 -0
  182. package/skills/README.md +408 -0
  183. package/skills/git/commit-crafting/SKILL.md +79 -0
  184. package/skills/git/commit-crafting/evals.md +92 -0
  185. package/skills/git/create-pr/SKILL.md +116 -0
  186. package/skills/git/create-pr/evals.md +114 -0
  187. package/skills/git/investigate-issue/SKILL.md +139 -0
  188. package/skills/git/investigate-issue/evals.md +94 -0
  189. package/skills/git/resolve-merge-conflicts/SKILL.md +96 -0
  190. package/skills/git/resolve-merge-conflicts/evals.md +58 -0
  191. package/skills/git/review-changes/SKILL.md +103 -0
  192. package/skills/git/review-changes/evals.md +85 -0
  193. package/skills/git/worktree-create/SKILL.md +92 -0
  194. package/skills/git/worktree-create/evals.md +97 -0
  195. package/skills/git/worktree-create/references/worktree-setup.md +66 -0
  196. package/skills/git/worktree-merge/SKILL.md +95 -0
  197. package/skills/git/worktree-merge/evals.md +114 -0
  198. package/skills/skill-marketplace.json +261 -0
  199. package/skills/workflow/cut-it/SKILL.md +86 -0
  200. package/skills/workflow/cut-it/evals.md +42 -0
  201. package/src/domains/agents/builtins/architect.md +33 -0
  202. package/src/domains/agents/builtins/coder.md +31 -0
  203. package/src/domains/agents/builtins/context-bootstrap.md +38 -0
  204. package/src/domains/agents/builtins/debugger.md +30 -0
  205. package/src/domains/agents/builtins/documenter.md +31 -0
  206. package/src/domains/agents/builtins/git-master.md +30 -0
  207. package/src/domains/agents/builtins/provenance.md +30 -0
  208. package/src/domains/agents/builtins/researcher.md +71 -0
  209. package/src/domains/agents/builtins/scout.md +42 -0
  210. package/src/domains/agents/builtins/tester.md +31 -0
  211. package/src/domains/agents/builtins/verifier.md +30 -0
  212. package/src/domains/agents/builtins/wiki-writer.md +41 -0
  213. package/src/domains/agents/fleets/build-review.md +34 -0
  214. package/src/domains/agents/fleets/build-test.md +35 -0
  215. package/src/domains/agents/fleets/sdlc.md +86 -0
  216. package/src/domains/prompts/fragments/identity/clio-worker.md +11 -0
  217. package/src/domains/prompts/fragments/identity/clio.md +26 -0
  218. package/src/domains/prompts/fragments/operating/contract.md +64 -0
  219. package/src/domains/prompts/fragments/safety/auto-edit.md +14 -0
  220. package/src/domains/prompts/fragments/safety/full-auto.md +14 -0
  221. package/src/domains/prompts/fragments/safety/read-only.md +13 -0
  222. package/src/domains/prompts/fragments/safety/suggest.md +13 -0
  223. package/src/domains/prompts/fragments/wiki/page.md +75 -0
  224. package/src/domains/prompts/fragments/wiki/plan.md +48 -0
  225. package/src/domains/providers/models/cloud-models/alcf.yaml +40 -0
  226. package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +993 -0
package/SECURITY.md ADDED
@@ -0,0 +1,72 @@
1
+ # Security Policy
2
+
3
+ Clio Coder is alpha software. Until the project reaches a stable release,
4
+ only the latest tagged alpha minor version receives security fixes.
5
+
6
+ | Version | Supported |
7
+ | ------- | ------------------ |
8
+ | `0.3.x` | Latest alpha patch |
9
+ | `0.2.x` | No |
10
+ | `< 0.2` | No |
11
+
12
+ ## Reporting a Vulnerability
13
+
14
+ Do **not** open a public GitHub issue for security reports.
15
+
16
+ Use one of these private channels:
17
+
18
+ 1. **GitHub private security advisory** (preferred). Open a draft advisory at
19
+ <https://github.com/iowarp/clio-coder/security/advisories/new>. It keeps
20
+ the report scoped to the maintainers and the reporter.
21
+ 2. **Email.** Send a description to `a.kougkas@gmail.com` with the subject
22
+ prefix `[clio-coder security]`.
23
+
24
+ Include:
25
+
26
+ - The affected version (`clio-coder --version` output) or commit.
27
+ - A minimal reproduction or proof of concept.
28
+ - The impact you observed: information disclosure, code execution, privilege
29
+ escalation, credential exposure, or policy bypass.
30
+ - Whether the issue requires a specific runtime, target, or model.
31
+
32
+ Remove secrets from logs and screenshots before sending.
33
+
34
+ ## What to Expect
35
+
36
+ - Acknowledgement within five working days.
37
+ - A coordinated fix window. The maintainer will share a target patch date and
38
+ credit the reporter in the release notes if requested.
39
+ - Public disclosure after a fix ships, unless the reporter requests earlier
40
+ disclosure or the issue is independently public.
41
+
42
+ ## Scope
43
+
44
+ In scope:
45
+
46
+ - The `clio-coder` CLI and its subcommands.
47
+ - The interactive TUI session and slash-command surface.
48
+ - Credential storage and leakage.
49
+ - Shell execution safety, the damage-control rule pack, and project safety
50
+ policy enforcement.
51
+ - Filesystem write restrictions.
52
+ - The dispatch worker path and ACP delegation, including permission
53
+ mediation.
54
+ - Receipts, audit JSONL, and session JSONL persistence.
55
+ - Runtime and provider auth behavior.
56
+
57
+ Out of scope:
58
+
59
+ - Vulnerabilities in upstream dependencies that already have a public CVE and
60
+ are tracked through dependency updates.
61
+ - Local attacks that require an attacker who already has read or write access
62
+ to the user's home directory.
63
+ - Bugs in third-party model providers or local model runtimes; report those
64
+ upstream.
65
+ - Social engineering or spam.
66
+
67
+ ## Responsible Use
68
+
69
+ Clio Coder writes to the local filesystem, dispatches workers, and can reach
70
+ external model APIs when configured to. Run it inside a repository you own
71
+ and review privileged actions before approving them. Do not paste API keys,
72
+ private source, or proprietary prompts into public issues or pull requests.
Binary file
@@ -0,0 +1,419 @@
1
+ version: 2
2
+ packs:
3
+ - id: base
4
+ rules:
5
+ - id: rm-rf-root
6
+ description: "rm -rf / or close to it"
7
+ pattern: "\\brm\\s+-rf?\\s+/(?![a-z0-9]*tmp/)"
8
+ class: system_modify
9
+ block: true
10
+ - id: rm-recursive-or-force
11
+ description: "rm with recursive or force flags"
12
+ pattern: "\\brm\\s+(-[^\\s]*)*-[rRf]"
13
+ class: system_modify
14
+ block: true
15
+ - id: rm-recursive-long
16
+ description: "rm with --recursive"
17
+ pattern: "\\brm\\s+--recursive\\b"
18
+ class: system_modify
19
+ block: true
20
+ - id: rm-force-long
21
+ description: "rm with --force"
22
+ pattern: "\\brm\\s+--force\\b"
23
+ class: system_modify
24
+ block: true
25
+ - id: sudo-rm
26
+ description: "sudo rm"
27
+ pattern: "\\bsudo\\s+rm\\b"
28
+ class: system_modify
29
+ block: true
30
+ - id: rmdir-ignore-non-empty
31
+ description: "rmdir --ignore-fail-on-non-empty hides failed deletion"
32
+ pattern: "\\brmdir\\s+--ignore-fail-on-non-empty\\b"
33
+ class: system_modify
34
+ block: true
35
+ - id: find-delete
36
+ description: "find -delete mass-deletes matched files"
37
+ pattern: "\\bfind\\b[^;&|]*\\s-delete\\b"
38
+ class: system_modify
39
+ block: true
40
+ - id: rsync-delete
41
+ description: "rsync --delete removes files missing from the source"
42
+ pattern: "\\brsync\\b[^;&|]*\\s--delete"
43
+ class: system_modify
44
+ block: true
45
+ - id: shred-file
46
+ description: "shred overwrites file contents unrecoverably"
47
+ pattern: "\\bshred\\s+\\S"
48
+ class: system_modify
49
+ block: true
50
+ - id: chmod-777
51
+ description: "chmod 777 makes files world-writable"
52
+ pattern: "\\bchmod\\s+(-[^\\s]+\\s+)*777\\b"
53
+ class: system_modify
54
+ block: true
55
+ - id: chmod-recursive-777
56
+ description: "recursive chmod 777 makes trees world-writable"
57
+ pattern: "\\bchmod\\s+-[Rr].*777"
58
+ class: system_modify
59
+ block: true
60
+ - id: chown-recursive-root
61
+ description: "recursive chown to root can break local ownership"
62
+ pattern: "\\bchown\\s+-[Rr].*\\broot\\b"
63
+ class: system_modify
64
+ block: true
65
+ - id: dd-of-dev
66
+ description: "dd writing to /dev/sd*"
67
+ pattern: "\\bdd\\b.*\\bof=/dev/(sd|nvme|xvd)"
68
+ class: system_modify
69
+ block: true
70
+ - id: dd-of-device
71
+ description: "dd writing directly to a device"
72
+ pattern: "\\bdd\\s+.*of=/dev/"
73
+ class: system_modify
74
+ block: true
75
+ - id: mkfs-any
76
+ description: "filesystem creation"
77
+ pattern: "\\bmkfs(\\.\\w+)?\\s+/dev/"
78
+ class: system_modify
79
+ block: true
80
+ - id: fork-bomb
81
+ description: "classic fork bomb pattern"
82
+ pattern: ":\\(\\)\\s*\\{\\s*:\\|:&\\s*\\}"
83
+ class: execute
84
+ block: true
85
+ - id: kill-all-processes
86
+ description: "kill -9 -1 targets all accessible processes"
87
+ pattern: "\\bkill\\s+-9\\s+-1\\b"
88
+ class: system_modify
89
+ block: true
90
+ - id: killall-force
91
+ description: "killall -9 can terminate broad process sets"
92
+ pattern: "\\bkillall\\s+-9\\b"
93
+ class: system_modify
94
+ block: true
95
+ - id: pkill-force
96
+ description: "pkill -9 can terminate broad process sets"
97
+ pattern: "\\bpkill\\s+-9\\b"
98
+ class: system_modify
99
+ block: true
100
+ - id: clear-shell-history
101
+ description: "clearing shell history reduces observability"
102
+ pattern: "\\bhistory\\s+-c\\b"
103
+ class: system_modify
104
+ block: true
105
+ - id: git-push-force-main
106
+ description: "force push to protected branches"
107
+ pattern: "\\bgit\\s+push\\s+(--force|-f)\\s+\\S+\\s+(main|master|production)\\b"
108
+ class: git_destructive
109
+ block: true
110
+ - id: git-push-force
111
+ description: "git push --force; use --force-with-lease if explicitly needed"
112
+ pattern: "\\bgit\\s+push\\s+.*--force(?!-with-lease)"
113
+ class: git_destructive
114
+ block: true
115
+ - id: git-push-force-short
116
+ description: "git push -f; use --force-with-lease if explicitly needed"
117
+ pattern: "\\bgit\\s+push\\s+(-[^\\s]*)*-f\\b"
118
+ class: git_destructive
119
+ block: true
120
+ - id: git-reset-hard-head
121
+ description: "git reset --hard on a ref that's not local WIP"
122
+ pattern: "\\bgit\\s+reset\\s+--hard\\s+(origin/|upstream/)"
123
+ class: git_destructive
124
+ block: true
125
+ - id: git-reset-hard
126
+ description: "git reset --hard discards local work"
127
+ pattern: "\\bgit\\s+reset\\s+--hard\\b"
128
+ class: git_destructive
129
+ block: true
130
+ - id: git-clean-force-directory
131
+ description: "git clean with force and directory flags deletes untracked trees"
132
+ pattern: "\\bgit\\s+clean\\s+(-[^\\s]*)*-[fd]"
133
+ class: git_destructive
134
+ block: true
135
+ - id: git-stash-clear
136
+ description: "git stash clear deletes all stashes"
137
+ pattern: "\\bgit\\s+stash\\s+clear\\b"
138
+ class: git_destructive
139
+ block: true
140
+ - id: git-reflog-expire
141
+ description: "git reflog expire destroys recovery history"
142
+ pattern: "\\bgit\\s+reflog\\s+expire\\b"
143
+ class: git_destructive
144
+ block: true
145
+ - id: git-gc-prune-now
146
+ description: "git gc --prune=now can lose dangling commits"
147
+ pattern: "\\bgit\\s+gc\\b[^;&|]*--prune=now\\b"
148
+ class: git_destructive
149
+ block: true
150
+ - id: git-filter-branch
151
+ description: "git filter-branch rewrites repository history"
152
+ pattern: "\\bgit\\s+filter-branch\\b"
153
+ class: git_destructive
154
+ block: true
155
+ - id: curl-pipe-shell
156
+ description: "curl ... | sh is remote shell execution"
157
+ pattern: "\\bcurl\\b[^|]*\\|\\s*(sudo\\s+)?(sh|bash|zsh)\\b"
158
+ class: execute
159
+ block: true
160
+ - id: wget-pipe-shell
161
+ description: "wget ... | sh is remote shell execution"
162
+ pattern: "\\bwget\\b[^|]*\\|\\s*(sudo\\s+)?(sh|bash|zsh)\\b"
163
+ class: execute
164
+ block: true
165
+ - id: chmod-recursive-root
166
+ description: "chmod -R on / or system roots"
167
+ pattern: "\\bchmod\\s+-R\\s+[0-7]{3,4}\\s+/(?:(etc|usr|bin|sbin|var)(?:/|\\s|$)|(?:\\s|$))"
168
+ class: system_modify
169
+ block: true
170
+ - id: redirect-system-root
171
+ description: "shell redirect into /etc /usr /var (excluding /var/tmp) /bin /sbin"
172
+ pattern: ">>?\\s*\"?/(?:etc|usr|bin|sbin|var(?!/tmp))(?:/|\\s|\"|$)"
173
+ class: system_modify
174
+ block: true
175
+ - id: tee-system-root
176
+ description: "tee writing into /etc /usr /var (excluding /var/tmp) /bin /sbin"
177
+ pattern: "\\btee\\s+(?:-[A-Za-z]+\\s+)*\"?/(?:etc|usr|bin|sbin|var(?!/tmp))(?:/|\\s|\"|$)"
178
+ class: system_modify
179
+ block: true
180
+ - id: aws-s3-rm-recursive
181
+ description: "aws s3 rm --recursive deletes many objects"
182
+ pattern: "\\baws\\s+s3\\s+rm\\b[^;&|]*--recursive\\b"
183
+ class: system_modify
184
+ block: true
185
+ - id: aws-s3-rb-force
186
+ description: "aws s3 rb --force removes a bucket"
187
+ pattern: "\\baws\\s+s3\\s+rb\\b[^;&|]*--force\\b"
188
+ class: system_modify
189
+ block: true
190
+ - id: aws-terminate-instances
191
+ description: "aws ec2 terminate-instances destroys compute instances"
192
+ pattern: "\\baws\\s+ec2\\s+terminate-instances\\b"
193
+ class: system_modify
194
+ block: true
195
+ - id: aws-rds-delete-db-instance
196
+ description: "aws rds delete-db-instance destroys a database instance"
197
+ pattern: "\\baws\\s+rds\\s+delete-db-instance\\b"
198
+ class: system_modify
199
+ block: true
200
+ - id: aws-cloudformation-delete-stack
201
+ description: "aws cloudformation delete-stack destroys infrastructure"
202
+ pattern: "\\baws\\s+cloudformation\\s+delete-stack\\b"
203
+ class: system_modify
204
+ block: true
205
+ - id: aws-dynamodb-delete-table
206
+ description: "aws dynamodb delete-table destroys a table"
207
+ pattern: "\\baws\\s+dynamodb\\s+delete-table\\b"
208
+ class: system_modify
209
+ block: true
210
+ - id: aws-eks-delete-cluster
211
+ description: "aws eks delete-cluster destroys a cluster"
212
+ pattern: "\\baws\\s+eks\\s+delete-cluster\\b"
213
+ class: system_modify
214
+ block: true
215
+ - id: aws-lambda-delete-function
216
+ description: "aws lambda delete-function destroys a function"
217
+ pattern: "\\baws\\s+lambda\\s+delete-function\\b"
218
+ class: system_modify
219
+ block: true
220
+ - id: aws-iam-delete-principal
221
+ description: "aws iam delete-role/delete-user removes an IAM principal"
222
+ pattern: "\\baws\\s+iam\\s+delete-(role|user)\\b"
223
+ class: system_modify
224
+ block: true
225
+ - id: gcloud-projects-delete
226
+ description: "gcloud projects delete destroys a cloud project"
227
+ pattern: "\\bgcloud\\s+projects\\s+delete\\b"
228
+ class: system_modify
229
+ block: true
230
+ - id: gcloud-compute-delete
231
+ description: "gcloud compute instances delete destroys compute instances"
232
+ pattern: "\\bgcloud\\s+compute\\s+instances\\s+delete\\b"
233
+ class: system_modify
234
+ block: true
235
+ - id: gcloud-sql-delete
236
+ description: "gcloud sql instances delete destroys a SQL instance"
237
+ pattern: "\\bgcloud\\s+sql\\s+instances\\s+delete\\b"
238
+ class: system_modify
239
+ block: true
240
+ - id: gcloud-cluster-delete
241
+ description: "gcloud container clusters delete destroys a GKE cluster"
242
+ pattern: "\\bgcloud\\s+container\\s+clusters\\s+delete\\b"
243
+ class: system_modify
244
+ block: true
245
+ - id: gcloud-storage-rm-recursive
246
+ description: "gcloud storage rm -r recursively deletes objects"
247
+ pattern: "\\bgcloud\\s+storage\\s+rm\\b[^;&|]*-r\\b"
248
+ class: system_modify
249
+ block: true
250
+ - id: gcloud-functions-delete
251
+ description: "gcloud functions delete destroys a function"
252
+ pattern: "\\bgcloud\\s+functions\\s+delete\\b"
253
+ class: system_modify
254
+ block: true
255
+ - id: gcloud-service-account-delete
256
+ description: "gcloud iam service-accounts delete removes credentials"
257
+ pattern: "\\bgcloud\\s+iam\\s+service-accounts\\s+delete\\b"
258
+ class: system_modify
259
+ block: true
260
+ - id: gcloud-run-delete
261
+ description: "gcloud run services/jobs delete destroys Cloud Run resources"
262
+ pattern: "\\bgcloud\\s+run\\s+(services|jobs)\\s+delete\\b"
263
+ class: system_modify
264
+ block: true
265
+ - id: gcloud-services-disable
266
+ description: "gcloud services disable can break a project"
267
+ pattern: "\\bgcloud\\s+services\\s+disable\\b"
268
+ class: system_modify
269
+ block: true
270
+ - id: gcloud-iam-roles-delete
271
+ description: "gcloud iam roles delete removes an IAM role"
272
+ pattern: "\\bgcloud\\s+iam\\s+roles\\s+delete\\b"
273
+ class: system_modify
274
+ block: true
275
+ - id: gcloud-iam-policies
276
+ description: "gcloud iam policies modifies IAM policy state"
277
+ pattern: "\\bgcloud\\s+iam\\s+policies\\b"
278
+ class: system_modify
279
+ block: false
280
+ ask: true
281
+ - id: firebase-projects-delete
282
+ description: "firebase projects:delete destroys a Firebase project"
283
+ pattern: "\\bfirebase\\s+projects:delete\\b"
284
+ class: system_modify
285
+ block: true
286
+ - id: firebase-firestore-delete-all
287
+ description: "firebase firestore:delete --all-collections wipes Firestore data"
288
+ pattern: "\\bfirebase\\s+firestore:delete\\s+.*--all-collections"
289
+ class: system_modify
290
+ block: true
291
+ - id: firebase-database-remove
292
+ description: "firebase database:remove wipes Realtime Database data"
293
+ pattern: "\\bfirebase\\s+database:remove\\b"
294
+ class: system_modify
295
+ block: true
296
+ - id: firebase-hosting-disable
297
+ description: "firebase hosting:disable disables hosting"
298
+ pattern: "\\bfirebase\\s+hosting:disable\\b"
299
+ class: system_modify
300
+ block: true
301
+ - id: firebase-functions-delete
302
+ description: "firebase functions:delete removes functions"
303
+ pattern: "\\bfirebase\\s+functions:delete\\b"
304
+ class: system_modify
305
+ block: true
306
+ - id: vercel-remove
307
+ description: "vercel remove/rm deletes deployments or projects"
308
+ pattern: "\\bvercel\\s+(?:remove|rm|projects\\s+rm)\\b"
309
+ class: system_modify
310
+ block: true
311
+ - id: vercel-env-remove
312
+ description: "vercel env rm removes environment variables"
313
+ pattern: "\\bvercel\\s+env\\s+rm\\b"
314
+ class: system_modify
315
+ block: true
316
+ - id: vercel-domain-remove
317
+ description: "vercel domains rm removes a custom domain"
318
+ pattern: "\\bvercel\\s+domains\\s+rm\\b"
319
+ class: system_modify
320
+ block: true
321
+ - id: netlify-site-delete
322
+ description: "netlify sites:delete removes an entire site"
323
+ pattern: "\\bnetlify\\s+sites:delete\\b"
324
+ class: system_modify
325
+ block: true
326
+ - id: netlify-functions-delete
327
+ description: "netlify functions:delete removes functions"
328
+ pattern: "\\bnetlify\\s+functions:delete\\b"
329
+ class: system_modify
330
+ block: true
331
+ - id: wrangler-delete-resource
332
+ description: "wrangler delete removes Cloudflare resources"
333
+ pattern: "\\bwrangler\\s+(delete|r2\\s+bucket\\s+delete|kv:namespace\\s+delete|d1\\s+delete|queues\\s+delete)\\b"
334
+ class: system_modify
335
+ block: true
336
+ - id: sql-delete-without-where
337
+ description: "SQL DELETE without WHERE can delete every row"
338
+ pattern: "\\bDELETE\\s+FROM\\s+\\w+\\s*;"
339
+ class: system_modify
340
+ block: true
341
+ - id: sql-delete-star
342
+ description: "SQL DELETE * is invalid or destructive intent"
343
+ pattern: "\\bDELETE\\s+\\*\\s+FROM\\b"
344
+ class: system_modify
345
+ block: true
346
+ - id: sql-truncate-table
347
+ description: "TRUNCATE TABLE deletes all rows"
348
+ pattern: "\\bTRUNCATE\\s+TABLE\\b"
349
+ class: system_modify
350
+ block: true
351
+ - id: sql-drop-table
352
+ description: "DROP TABLE destroys a table"
353
+ pattern: "\\bDROP\\s+TABLE\\b"
354
+ class: system_modify
355
+ block: true
356
+ - id: sql-drop-database
357
+ description: "DROP DATABASE destroys a database"
358
+ pattern: "\\bDROP\\s+DATABASE\\b"
359
+ class: system_modify
360
+ block: true
361
+ - id: sql-drop-schema
362
+ description: "DROP SCHEMA destroys a schema"
363
+ pattern: "\\bDROP\\s+SCHEMA\\b"
364
+ class: system_modify
365
+ block: true
366
+ - id: git-checkout-discard-all
367
+ description: "git checkout -- . discards all uncommitted changes"
368
+ pattern: "\\bgit\\s+checkout\\s+--\\s*\\.\\s*$"
369
+ class: git_destructive
370
+ block: false
371
+ ask: true
372
+ - id: git-restore-discard-all
373
+ description: "git restore . discards all uncommitted changes"
374
+ pattern: "\\bgit\\s+restore\\s+\\.\\s*$"
375
+ class: git_destructive
376
+ block: false
377
+ ask: true
378
+ - id: git-stash-drop
379
+ description: "git stash drop permanently deletes a stash"
380
+ pattern: "\\bgit\\s+stash\\s+drop\\b"
381
+ class: git_destructive
382
+ block: false
383
+ ask: true
384
+ - id: git-branch-force-delete
385
+ description: "git branch -D force deletes a branch"
386
+ pattern: "\\bgit\\s+branch\\b[^;&|]*\\s-[A-Za-z]*D\\b"
387
+ class: git_destructive
388
+ block: false
389
+ ask: true
390
+ - id: git-push-delete-remote-branch
391
+ description: "git push --delete deletes a remote branch"
392
+ pattern: "\\bgit\\s+push\\s+\\S+\\s+--delete\\b"
393
+ class: git_destructive
394
+ block: false
395
+ ask: true
396
+ - id: git-push-colon-delete-remote-branch
397
+ description: "git push remote :branch deletes a remote branch"
398
+ pattern: "\\bgit\\s+push\\s+\\S+\\s+:\\S+"
399
+ class: git_destructive
400
+ block: false
401
+ ask: true
402
+ - id: sql-delete-by-id
403
+ description: "SQL DELETE by id should be confirmed"
404
+ pattern: "\\bDELETE\\s+FROM\\s+\\w+\\s+WHERE\\b.*\\bid\\s*="
405
+ class: system_modify
406
+ block: false
407
+ ask: true
408
+ - id: truncate-size-zero
409
+ description: "truncate -s 0 empties a file"
410
+ pattern: "\\btruncate\\s+(?:-[^\\s]+\\s+)*(?:--size|-s)[=\\s]+0+\\b"
411
+ class: system_modify
412
+ block: false
413
+ ask: true
414
+ - id: colon-truncate
415
+ description: ":> empties a file via the null command redirect"
416
+ pattern: "(?:^|[\\s;&|]):\\s*>(?!>)"
417
+ class: system_modify
418
+ block: false
419
+ ask: true
@@ -0,0 +1,92 @@
1
+ import {
2
+ restoreStdout,
3
+ runClioCommand,
4
+ takeOverStdout,
5
+ writeRawStdout
6
+ } from "./chunk-PS4PFJQP.js";
7
+ import "./chunk-AMFR5YA3.js";
8
+ import "./chunk-O4EJEDHO.js";
9
+ import "./chunk-4UQA7NCT.js";
10
+ import "./chunk-3DANZDGR.js";
11
+ import "./chunk-JPOWPFCU.js";
12
+ import "./chunk-NI4DEJMC.js";
13
+ import "./chunk-7RBKDI66.js";
14
+ import "./chunk-527KG6XR.js";
15
+ import "./chunk-UU3R62TT.js";
16
+ import "./chunk-6CWDTGUC.js";
17
+ import "./chunk-BYEU76JP.js";
18
+ import "./chunk-HMYNFFY4.js";
19
+ import "./chunk-UWIJNAOB.js";
20
+ import "./chunk-X3BR7HWV.js";
21
+ import "./chunk-VOO7NYPP.js";
22
+ import "./chunk-GNGDQYDU.js";
23
+ import "./chunk-2J63S4SF.js";
24
+ import "./chunk-RQDWMVRB.js";
25
+ import "./chunk-7BHLZB3A.js";
26
+ import "./chunk-TPOCL34A.js";
27
+ import "./chunk-E3NYWENM.js";
28
+ import "./chunk-XV4ZJ6ZM.js";
29
+ import "./chunk-26BZQOAD.js";
30
+ import "./chunk-WD6AJM35.js";
31
+ import "./chunk-QV47YRF4.js";
32
+ import "./chunk-CLJ5HLUD.js";
33
+ import "./chunk-BBUH4VAA.js";
34
+ import "./chunk-GOTUR54M.js";
35
+ import "./chunk-KBR4MZZR.js";
36
+ import "./chunk-XNISANGE.js";
37
+ import "./chunk-KKKPTZLM.js";
38
+ import "./chunk-ME6DNWIU.js";
39
+ import "./chunk-262G75JS.js";
40
+ import "./chunk-TFSSEXL6.js";
41
+ import "./chunk-PIDUD6M2.js";
42
+ import {
43
+ printError
44
+ } from "./chunk-67MTHP2E.js";
45
+ import "./chunk-TKHQ4DGZ.js";
46
+ import "./chunk-D5YD55AR.js";
47
+ import "./chunk-JWHCJDCI.js";
48
+ import "./chunk-UHTSULZS.js";
49
+ import "./chunk-5LDRNKX2.js";
50
+ import "./chunk-UGYAX5YI.js";
51
+ import "./chunk-5N2FG33Q.js";
52
+ import "./chunk-VPAWTYLY.js";
53
+ import "./chunk-X3NE4WVW.js";
54
+ import "./chunk-DXQNI4PC.js";
55
+
56
+ // src/cli/acp.ts
57
+ var HELP = `clio-coder acp
58
+
59
+ Serve Clio Coder as an Agent Client Protocol v1 agent over stdio.
60
+
61
+ This command is intended for ACP frontends to spawn. Interactive delegation remains
62
+ available through /agents, /delegate, the dispatch board, and receipts.
63
+ `;
64
+ async function runAcpCommand(args, options = {}) {
65
+ if (args.includes("--help") || args.includes("-h")) {
66
+ process.stdout.write(HELP);
67
+ return 0;
68
+ }
69
+ if (args.length > 0) {
70
+ printError(`unknown clio-coder acp option: ${args[0] ?? ""}`);
71
+ process.stdout.write(HELP);
72
+ return 2;
73
+ }
74
+ takeOverStdout();
75
+ try {
76
+ return await runClioCommand({
77
+ ...options.apiKey === void 0 ? {} : { apiKey: options.apiKey },
78
+ ...options.noContextFiles ? { noContextFiles: true } : {},
79
+ ...options.noSkills ? { noSkills: true } : {},
80
+ ...options.skillPaths && options.skillPaths.length > 0 ? { skillPaths: options.skillPaths } : {},
81
+ acp: {
82
+ transportOptions: { write: writeRawStdout }
83
+ }
84
+ });
85
+ } finally {
86
+ restoreStdout();
87
+ }
88
+ }
89
+ export {
90
+ runAcpCommand
91
+ };
92
+ //# sourceMappingURL=acp-UMLFVA3F.js.map
@@ -0,0 +1,91 @@
1
+ import {
2
+ AgentsDomainModule,
3
+ SafetyDomainModule
4
+ } from "./chunk-JPOWPFCU.js";
5
+ import "./chunk-NI4DEJMC.js";
6
+ import {
7
+ ensureClioState
8
+ } from "./chunk-7RBKDI66.js";
9
+ import {
10
+ ConfigDomainModule,
11
+ loadDomains
12
+ } from "./chunk-527KG6XR.js";
13
+ import "./chunk-UU3R62TT.js";
14
+ import "./chunk-HMYNFFY4.js";
15
+ import "./chunk-XV4ZJ6ZM.js";
16
+ import "./chunk-26BZQOAD.js";
17
+ import {
18
+ isUserVisibleAgent
19
+ } from "./chunk-WD6AJM35.js";
20
+ import "./chunk-QV47YRF4.js";
21
+ import "./chunk-CLJ5HLUD.js";
22
+ import "./chunk-262G75JS.js";
23
+ import "./chunk-TFSSEXL6.js";
24
+ import "./chunk-PIDUD6M2.js";
25
+ import {
26
+ printError
27
+ } from "./chunk-67MTHP2E.js";
28
+ import "./chunk-D5YD55AR.js";
29
+ import "./chunk-JWHCJDCI.js";
30
+ import "./chunk-UHTSULZS.js";
31
+ import "./chunk-5LDRNKX2.js";
32
+ import "./chunk-UGYAX5YI.js";
33
+ import "./chunk-5N2FG33Q.js";
34
+ import "./chunk-VPAWTYLY.js";
35
+ import "./chunk-X3NE4WVW.js";
36
+ import "./chunk-DXQNI4PC.js";
37
+
38
+ // src/cli/agents.ts
39
+ var HELP = `clio-coder agents [--json] [--all]
40
+
41
+ List user-facing agent specs from built-in, user, and project recipes.
42
+
43
+ Flags:
44
+ --json emit specs as JSON instead of the formatted table
45
+ --all include shadow/internal specs reserved for Clio orchestration
46
+ `;
47
+ async function runAgentsCommand(args) {
48
+ if (args.includes("--help") || args.includes("-h")) {
49
+ process.stdout.write(HELP);
50
+ return 0;
51
+ }
52
+ const json = args.includes("--json");
53
+ const all = args.includes("--all");
54
+ const unknown = args.find((arg) => arg !== "--json" && arg !== "--all");
55
+ if (unknown) {
56
+ printError(`unknown flag: ${unknown}`);
57
+ process.stderr.write(HELP);
58
+ return 2;
59
+ }
60
+ ensureClioState();
61
+ const result = await loadDomains([ConfigDomainModule, SafetyDomainModule, AgentsDomainModule]);
62
+ const agents = result.getContract("agents");
63
+ if (!agents) {
64
+ process.stderr.write("agents: domain not loaded\n");
65
+ await result.stop();
66
+ return 1;
67
+ }
68
+ const specs = all ? agents.listSpecs() : agents.listSpecs().filter(isUserVisibleAgent);
69
+ if (json) {
70
+ const withoutBody = specs.map(({ body: _body, ...rest }) => rest);
71
+ process.stdout.write(`${JSON.stringify(withoutBody, null, 2)}
72
+ `);
73
+ } else {
74
+ for (const spec of specs) {
75
+ renderLine(spec);
76
+ }
77
+ }
78
+ await result.stop();
79
+ return 0;
80
+ }
81
+ function renderLine(spec) {
82
+ const shape = `${spec.audience}/${spec.category}/${spec.capabilityClass}/${spec.latencyClass}`;
83
+ const skills = spec.skills.length > 0 ? ` skills=${spec.skills.join(",")}` : "";
84
+ const budget = spec.budget ? `${spec.budget.toolCalls}/${spec.budget.readReserve}/${spec.budget.synthesis ? "synthesize" : "stop"}` : "operator-default";
85
+ process.stdout.write(`${spec.id.padEnd(20)} ${shape.padEnd(48)} ${spec.description}${skills} budget=${budget}
86
+ `);
87
+ }
88
+ export {
89
+ runAgentsCommand
90
+ };
91
+ //# sourceMappingURL=agents-Q4MYPMUW.js.map