@globant/coda-darwin-x64 1.2.0 → 1.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/assets/agents/coda-help.md +6 -5
- package/assets/autonomy/continuation.md +89 -0
- package/assets/autonomy/judge-guidance.md +48 -0
- package/assets/autonomy/judge.md +59 -0
- package/assets/autonomy/maintenance.md +19 -0
- package/assets/autonomy/objective-updated.md +15 -0
- package/assets/autonomy/reminder.md +23 -0
- package/assets/autonomy/wrap-up.md +24 -0
- package/assets/docs/add-mcp-server-skill.md +135 -0
- package/assets/docs/agents.md +1 -1
- package/assets/docs/cli-reference.md +2 -0
- package/assets/docs/config-json.md +42 -45
- package/assets/docs/config-reference.md +50 -36
- package/assets/docs/configuration.md +12 -9
- package/assets/docs/connect-provider.md +3 -3
- package/assets/docs/extensions.md +23 -26
- package/assets/docs/faq.md +17 -7
- package/assets/docs/glossary.md +4 -4
- package/assets/docs/guide-changes.md +4 -4
- package/assets/docs/guide-collaborate.md +4 -4
- package/assets/docs/guide-extend.md +5 -5
- package/assets/docs/hooks.md +32 -68
- package/assets/docs/how-it-works.md +3 -3
- package/assets/docs/index.md +6 -5
- package/assets/docs/installation.md +5 -5
- package/assets/docs/logging.md +1 -1
- package/assets/docs/overview.md +7 -6
- package/assets/docs/permissions.md +16 -12
- package/assets/docs/quickstart.md +8 -4
- package/assets/docs/sessions.md +1 -1
- package/assets/docs/shortcuts.md +1 -1
- package/assets/docs/tools-reference.md +8 -1
- package/assets/docs/workflows.md +2 -1
- package/assets/skills/configure-mcp/SKILL.md +279 -0
- package/assets/skills/create-hook/SKILL.md +4 -4
- package/assets/skills/init-rules/SKILL.md +191 -0
- package/coda +0 -0
- package/lib/keytar/build/Release/keytar.node +0 -0
- package/lib/opentui/libopentui.dylib +0 -0
- package/lib/ripgrep/rg +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init-rules
|
|
3
|
+
description: Interactively bootstrap a project's permission rules (allow/ask/deny) and permission mode, and optionally enable the LLM safety-check layer. Use when the user wants to set up, configure, initialize, or scaffold permissions/authorization rules for a repo, e.g. "/init-rules", "set up my permissions", "configure allow/deny rules for this project".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# init-rules — bootstrap permission rules for a project
|
|
7
|
+
|
|
8
|
+
Your job is to help the user set up their CODA permission **rules** (`allow` / `ask` / `deny`) and **permission mode**, and optionally the **LLM safety-check** layer, based on how the project actually works.
|
|
9
|
+
|
|
10
|
+
You change **rules and the permission mode** by calling the built-in **`propose_policy`** tool — the sanctioned, approval-gated path for those. For settings that `propose_policy` does not cover (such as the `llmSafetyCheck` block), you may edit `config.json` directly with the `write`/`edit` tools: that write is a control-plane authoring write, so it is **allowed but always requires the user to approve the HITL prompt** first (it is not silently applied, and the user must consent to each such edit).
|
|
11
|
+
|
|
12
|
+
## Mode assumption — clarify up front
|
|
13
|
+
|
|
14
|
+
This skill assumes the session is running in **auto mode** (unattended/hands-off autonomy). State this to the user before you start, e.g.:
|
|
15
|
+
|
|
16
|
+
> "This assumes you're running in **auto** permission mode (Ctrl+P cycles modes). In auto, only your explicit `ask`/`deny` rules and the catastrophic floor still stop the agent, so the rules we set here are what keeps risky commands in check. Let's configure them."
|
|
17
|
+
|
|
18
|
+
If the user is not in auto mode, still proceed — the rules are valid in any mode — but note that in `default`/`read-only` mode many commands already require approval, so `deny`/`ask` rules matter most.
|
|
19
|
+
|
|
20
|
+
## Interactive vs. headless
|
|
21
|
+
|
|
22
|
+
- **Interactive:** follow every step, using `ask_user` to confirm choices.
|
|
23
|
+
- **Headless / batch** (`ask_user` unavailable): explore the repo and pick sensible defaults — a `default`-leaning, restrictive rule set (deny destructive commands, allow the project's read/test/build commands). Note that `propose_policy` **widenings are auto-refused headlessly**, so only `deny` rules (tightenings) will actually apply; report the `allow`/mode suggestions to the user for them to apply interactively later.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 1 — Explore the project
|
|
28
|
+
|
|
29
|
+
Understand what commands this project legitimately runs so your rules fit reality. Do NOT skip this.
|
|
30
|
+
|
|
31
|
+
- Read every `AGENTS.md` (root and per-package) — they usually list the exact build/test/lint commands. Also read `README.md`, `CONTRIBUTING.md`.
|
|
32
|
+
- Inspect `package.json` scripts / `Makefile` / `justfile` / `pyproject.toml` / `Cargo.toml` / CI workflow files (`.github/workflows/*`) for the real commands.
|
|
33
|
+
- Note the package manager (pnpm/npm/yarn/bun/pip/cargo/go) and the common verbs: test, lint, type-check, build, format.
|
|
34
|
+
|
|
35
|
+
Summarize back to the user the commands you found (e.g. `pnpm test`, `pnpm lint`, `pnpm type-check`, `bun test`) so they can confirm which should be auto-allowed.
|
|
36
|
+
|
|
37
|
+
Search in the ~/.coda/coda.db database for bash commands to get a sense of the commands the system has already executed, if the user has some existing history.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Step 2 — Choose how permissive the rules should be
|
|
42
|
+
|
|
43
|
+
Ask the user which posture they want. Use `ask_user`:
|
|
44
|
+
|
|
45
|
+
> "How strict should the rules be?"
|
|
46
|
+
> - **Permissive** — auto-allow the project's routine commands (test/lint/build/format, common git reads); deny only clearly destructive ones.
|
|
47
|
+
> - **Restrictive** — allow only a short, explicit allowlist; `ask` before anything not on it; deny a broad set of destructive/network commands.
|
|
48
|
+
> - **Balanced** — allow the confirmed dev commands, `ask` for git-writes and network/publish, deny destructive ones.
|
|
49
|
+
|
|
50
|
+
Then, using what you found in Step 1, propose the concrete rule set and confirm the risky ones with `ask_user` before writing. Typical shapes (adapt to the actual project):
|
|
51
|
+
|
|
52
|
+
- **Allow** (permissive/balanced): `Bash(pnpm test:*)`, `Bash(pnpm lint:*)`, `Bash(pnpm type-check)`, `Bash(git status)`, `Bash(git log:*)`, `Bash(git diff:*)`.
|
|
53
|
+
- **Ask** (guardrails on state-changing / outbound actions): `Bash(git push:*)`, `Bash(git commit:*)`, `Bash(npm publish:*)`, `Bash(curl:*)`.
|
|
54
|
+
- **Deny** (destructive / dangerous): `Bash(rm:*)`, `Bash(git reset --hard:*)`, `Bash(chmod:*)` — deny whatever the user does not want the agent doing unattended.
|
|
55
|
+
|
|
56
|
+
Rule syntax reminders (this is exactly what `propose_policy` writes):
|
|
57
|
+
- `Bash(npm:*)` = any command starting with `npm`; `Bash(git push origin main)` = exact match; `Bash(*)` = any bash command (**too permissive — don't recommend it**, see below); bare `Bash` = the whole tool.
|
|
58
|
+
- File tools take globs: `Read(//etc/passwd)` (double slash = absolute), `Edit(src/**)`, `Write(package.json)`.
|
|
59
|
+
- MCP: `mcp__filesystem` (whole server) or `mcp__filesystem__read_file` (one tool).
|
|
60
|
+
- Effects: `allow` (no prompt), `ask` (always prompt, even in auto), `deny` (always block).
|
|
61
|
+
|
|
62
|
+
Precedence is **deny-first**: `deny` > `ask` > `allow` > mode. Nothing overrides a `deny`, and nothing overrides the catastrophic floor (`rm -rf /`, `sudo`, private-key/credential reads, writes to secret files like `.env` / `.secrets`, etc. — never relaxable, so don't bother proposing rules for those). Note that editing `config.json`, `mcp.json`, or `agents.md` is *not* on that floor: it is allowed as an approval-gated authoring write (see Step 5).
|
|
63
|
+
|
|
64
|
+
### Command-scoped allow rules
|
|
65
|
+
|
|
66
|
+
IMPORTANT: Do not recommend `Bash(*)` as it won't allow cases that are related to package managers, etc.
|
|
67
|
+
Bash(*) doesn't allow every bash command, it isn't the most permissive rule possible.
|
|
68
|
+
Each command is broken down and evaluated independently.
|
|
69
|
+
|
|
70
|
+
Recommendation: **allow one command family at a time** with `Bash(<tool>:*)`. Each such rule auto-allows only that executable and its arguments, so the agent can run the tool freely while everything else still falls back to `ask`/`deny`/mode.
|
|
71
|
+
|
|
72
|
+
- If a user needs to run **all `pnpm` commands**, the ideal rule is `Bash(pnpm:*)` — not `Bash(*)`.
|
|
73
|
+
- Same idea per tool: `Bash(bun:*)` for all `bun` commands, `Bash(cargo:*)` for all `cargo` commands, and so on.
|
|
74
|
+
|
|
75
|
+
Build the allow list from the tools the project actually uses (from Step 1). A palette of common command-scoped rules to draw from:
|
|
76
|
+
|
|
77
|
+
```jsonc
|
|
78
|
+
// ❌ do NOT recommend this:
|
|
79
|
+
"Bash(*)",
|
|
80
|
+
|
|
81
|
+
// ✅ Recommended: scope to one command family each.
|
|
82
|
+
// Package managers / runtimes:
|
|
83
|
+
"Bash(bun:*)", "Bash(bunx:*)", "Bash(pnpm:*)", "Bash(pnx:*)",
|
|
84
|
+
"Bash(npm:*)", "Bash(npx:*)", "Bash(node:*)",
|
|
85
|
+
"Bash(python3:*)", "Bash(python:*)", "Bash(uv:*)", "Bash(uvx:*)",
|
|
86
|
+
// Lint / format / build / type-check / test:
|
|
87
|
+
"Bash(biome:*)", "Bash(tsc:*)", "Bash(vitest:*)", "Bash(jest:*)",
|
|
88
|
+
"Bash(eslint:*)", "Bash(prettier:*)",
|
|
89
|
+
// Build / task runners:
|
|
90
|
+
"Bash(make:*)", "Bash(cargo:*)", "Bash(go:*)", "Bash(just:*)", "Bash(task:*)",
|
|
91
|
+
// Version control:
|
|
92
|
+
"Bash(git:*)", "Bash(gh:*)",
|
|
93
|
+
// Shell builtins / environment:
|
|
94
|
+
"Bash(cd:*)", "Bash(set:*)", "Bash(export:*)", "Bash(source:*)",
|
|
95
|
+
"Bash(pwd:*)", "Bash(which:*)", "Bash(command:*)", "Bash(timeout:*)",
|
|
96
|
+
"Bash(env:*)", "Bash(bash:*)", "Bash(sh:*)", "Bash(zsh:*)",
|
|
97
|
+
// Read-only file / text inspection:
|
|
98
|
+
"Bash(ls:*)", "Bash(cat:*)", "Bash(head:*)", "Bash(tail:*)", "Bash(wc:*)",
|
|
99
|
+
"Bash(grep:*)", "Bash(rg:*)", "Bash(find:*)", "Bash(sed:*)", "Bash(awk:*)",
|
|
100
|
+
"Bash(sort:*)", "Bash(uniq:*)", "Bash(comm:*)", "Bash(tr:*)", "Bash(cut:*)",
|
|
101
|
+
"Bash(diff:*)", "Bash(echo:*)", "Bash(printf:*)", "Bash(base64:*)",
|
|
102
|
+
"Bash(test:*)", "Bash(jq:*)",
|
|
103
|
+
// Filesystem-mutating — riskier, usually `ask`/`deny`, not blanket `allow`:
|
|
104
|
+
"Bash(mkdir:*)", "Bash(rm:*)", "Bash(cp:*)", "Bash(mv:*)",
|
|
105
|
+
"Bash(touch:*)", "Bash(chmod:*)",
|
|
106
|
+
// Misc tools:
|
|
107
|
+
"Bash(sqlite3:*)", "Bash(ffmpeg:*)", "Bash(ffprobe:*)", "Bash(open:*)"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Caveats to relay when proposing these:
|
|
111
|
+
- These are all **fairly permissive** examples; if the user wants this you should add one rule for each command the user has in their history of commands executed.
|
|
112
|
+
- The filesystem-mutating (`rm`, `mv`, `cp`, `chmod`, …) and network (`curl`, `wget`) families change state or reach outbound — prefer `ask` (or `deny` for the destructive ones) over a blanket `allow`, and confirm each with `ask_user` first.
|
|
113
|
+
- You can scope tighter than a whole tool: `Bash(pnpm test:*)` allows only `pnpm test …`, `Bash(git log:*)` only `git log …`. Prefer the narrowest rule that still lets the project's real commands run.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Step 3 — Choose the target scope: project or global
|
|
118
|
+
|
|
119
|
+
Ask the user with `ask_user`:
|
|
120
|
+
|
|
121
|
+
> "Where should these rules live?"
|
|
122
|
+
> - **Project** — written to `<repo>/.coda/config.json`; applies only to this repository (and is shareable with teammates if committed).
|
|
123
|
+
> - **Global** — written to `~/.coda/config.json`; applies to every CODA session you run.
|
|
124
|
+
|
|
125
|
+
Map their choice to the `scope` argument (`"project"` or `"global"`) you pass to `propose_policy`.
|
|
126
|
+
|
|
127
|
+
> Note: a **project** scope can only make the permission mode *more* restrictive than global/managed policy, never more permissive. A project-scoped request to *raise* the mode is refused. Raising autonomy must be global.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Step 4 — Apply the rules with `propose_policy`
|
|
132
|
+
|
|
133
|
+
For each rule the user confirmed, call `propose_policy` once:
|
|
134
|
+
|
|
135
|
+
- Add a rule: `op: "add-rule"`, `rule: "<rule string>"`, `effect: "allow" | "ask" | "deny"`, `scope: "<from Step 3>"`.
|
|
136
|
+
- Change the mode (if needed): `op: "set-mode"`, `mode: "read-only" | "default" | "auto"`, `scope`.
|
|
137
|
+
- Remove a stale rule: `op: "remove-rule"` with the same `rule` + `effect`.
|
|
138
|
+
|
|
139
|
+
Expect these behaviors and relay them:
|
|
140
|
+
- **Tightenings apply on their own** — adding a `deny` (or lowering the mode) removes capability, so it applies without an approval prompt.
|
|
141
|
+
- **Widenings always ask first** — any `allow`/`ask` rule, removing a rule, or raising the mode prompts the user for approval before it is written, in *every* mode (auto included). Walk the user through approving each one.
|
|
142
|
+
- A `gated`/`rejected` result means the change hit the floor, managed policy, or a project-can't-widen limit — report it plainly and move on; don't retry the same thing.
|
|
143
|
+
|
|
144
|
+
Do them in a sensible order (deny rules first, then ask, then allow, then any mode change) and tell the user what each proposal will do before firing it.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Step 5 — Optionally enable the LLM safety-check layer
|
|
149
|
+
|
|
150
|
+
Ask the user with `ask_user`:
|
|
151
|
+
|
|
152
|
+
> "Do you want an **LLM safety check** on commands the agent would otherwise run? When enabled, a classifier model reviews commands and can flag/deny risky ones as an extra layer on top of your rules."
|
|
153
|
+
|
|
154
|
+
This layer is configured under `permissions.llmSafetyCheck` in `config.json`. `propose_policy` does not cover this block, so **edit `config.json` directly** — the same config file they chose in Step 3 (`<repo>/.coda/config.json` for project, `~/.coda/config.json` for global) — merging the block into the existing `permissions` object. Read the file first (create it if absent), then apply the change with `edit`/`write`.
|
|
155
|
+
|
|
156
|
+
This is a control-plane authoring write, so CODA will show a **mandatory approval prompt** describing the effect before anything is saved. Tell the user to expect and approve it; if they decline, the block is not written. If you cannot get approval (e.g. headless), fall back to giving them the JSON snippet to paste in by hand.
|
|
157
|
+
|
|
158
|
+
The block to add:
|
|
159
|
+
|
|
160
|
+
```jsonc
|
|
161
|
+
{
|
|
162
|
+
"permissions": {
|
|
163
|
+
"llmSafetyCheck": {
|
|
164
|
+
"enabled": true,
|
|
165
|
+
// Optional: an explicit model list REPLACES the built-in default.
|
|
166
|
+
// Omit this key to use the shipped default classifier models.
|
|
167
|
+
// If you want to use another model, just modify the list.
|
|
168
|
+
"models": ["openai/gpt-5.4", "openai/gpt-5.4", "anthropic/claude-sonnet-4-6", "anthropic/claude-haiku-4-5"],
|
|
169
|
+
// Optional: after this many auto-approvals in an interactive session,
|
|
170
|
+
// a one-time nudge suggests adding an explicit allow rule. Default: 10.
|
|
171
|
+
"nudgeThreshold": 10
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Notes to give the user:
|
|
178
|
+
- It is **default-off**; an absent block leaves it inert. Set `enabled: true` to turn it on.
|
|
179
|
+
- If `enabled: true` but `models` is an empty list `[]`, the check is inert (a startup warning fires). Omit `models` to use the built-in default, or list at least one model.
|
|
180
|
+
- `nudgeThreshold` must be an integer ≥ 1.
|
|
181
|
+
- If they picked **project** scope in Step 3, this belongs in the project config; if **global**, in `~/.coda/config.json`. Since it rides the global→project cascade, a project block overrides the global one.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Step 6 — Wrap up: tell the user to restart
|
|
186
|
+
|
|
187
|
+
After applying rules and (optionally) writing the safety-check block, finish with a short summary of what was set, then clearly instruct the user:
|
|
188
|
+
|
|
189
|
+
> **Restart CODA for these changes to take full effect** — especially the `llmSafetyCheck` block written to `config.json`, which is only read at startup.
|
|
190
|
+
|
|
191
|
+
Keep the final message concise: list the rules added (grouped by allow/ask/deny), the scope, the mode (if changed), whether the safety check was configured, and the restart reminder.
|
package/coda
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ripgrep/rg
CHANGED
|
Binary file
|