@chipschat/acp 1.0.37 → 1.0.38

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/README.md CHANGED
@@ -60,10 +60,12 @@ also looks where that line puts the agent, since a terminal opened before doesn'
60
60
  lists Auto twice). Their files aren't read.
61
61
  - The Permissions page shows what each one's own settings let through, read and never written:
62
62
  Copilot's Allow all, as its sessions say it (off: it asks before a tool, a path or a URL; on: it
63
- never asks); Grok's mode and rules from `~/.grok/config.toml` (`[ui] permission_mode`, or the older
64
- `yolo`; `[permission] rules`) together with the permission rules it takes from Claude Code's
65
- settings, yours in `~/.claude` and each agent folder's; and for Antigravity and Goose the mode a
66
- session runs in. Cursor's own settings aren't read yet.
63
+ never asks); Grok's mode, its rules from `~/.grok/config.toml` (`[permission] rules`), and the
64
+ permission rules it takes from Claude Code's settings, yours in `~/.claude` and each agent
65
+ folder's. Grok takes its mode from a Claude Code `defaultMode` first (the most specific file's),
66
+ then from its own `[ui] permission_mode` (or the older `yolo`), else Ask, and the page says which
67
+ file set it. For Antigravity and Goose it shows the mode a session runs in. Cursor's own settings
68
+ aren't read yet.
67
69
  - An agent's refusal reaches the room in its own words: where JSON-RPC's message is only "Internal
68
70
  error", what its details say, as Grok's API answer ("Your Grok CLI version (0.2.99) is outdated …").
69
71
  - What signs one in from the environment is carried to the copy kept running: `CURSOR_API_KEY`,
@@ -1,6 +1,6 @@
1
1
  # Third-party notices
2
2
 
3
- `dist/main.js` in @chipschat/acp 1.0.37 carries these packages, bundled in. Each one's
3
+ `dist/main.js` in @chipschat/acp 1.0.38 carries these packages, bundled in. Each one's
4
4
  licence follows.
5
5
 
6
6
  ## @chipschat/harness 1.0.11 (Apache-2.0)
package/dist/main.js CHANGED
@@ -29138,9 +29138,29 @@ function grokModeOf(toml) {
29138
29138
  if (said === "auto" || said === "always-approve" || said === "ask") return said;
29139
29139
  return tomlTrue(ui, "yolo") ? "always-approve" : "ask";
29140
29140
  }
29141
+ var GROK_FROM_CLAUDE = {
29142
+ default: "ask",
29143
+ plan: "ask",
29144
+ acceptEdits: "accept-edits",
29145
+ auto: "auto",
29146
+ dontAsk: "dont-ask",
29147
+ bypassPermissions: "always-approve"
29148
+ };
29149
+ function grokModeFrom(config2, claude) {
29150
+ for (const each of [...claude].reverse()) {
29151
+ const said2 = ownDefaultMode(each.layer);
29152
+ const mode = said2 === void 0 ? void 0 : GROK_FROM_CLAUDE[said2];
29153
+ if (mode !== void 0) return { mode, from: each.path };
29154
+ }
29155
+ const ui = tomlSection(config2.toml ?? "", "ui");
29156
+ const said = tomlString(ui, "permission_mode") ?? tomlString(ui, "approval_mode") ?? (tomlTrue(ui, "yolo") ? "yolo" : void 0);
29157
+ return said === void 0 ? { mode: "ask" } : { mode: grokModeOf(config2.toml), from: config2.path };
29158
+ }
29141
29159
  var GROK_MODES = {
29142
- ask: { name: "Ask", note: "Grok asks before anything its rules don't allow." },
29143
- auto: { name: "Auto", note: "Grok's own check lets safe steps through and asks about risky ones." },
29160
+ ask: { name: "Ask", note: "Grok asks before anything but read-only steps and what its rules allow." },
29161
+ "accept-edits": { name: "Accept edits", note: "Grok edits files without asking, and asks before commands its rules don't allow." },
29162
+ auto: { name: "Auto", note: "Grok's own check lets safe steps through, and blocks or asks about the rest." },
29163
+ "dont-ask": { name: "Don't ask", note: "Grok runs only read-only steps and what its rules allow, and refuses the rest without asking." },
29144
29164
  "always-approve": { name: "Always-approve", note: "Grok approves every step without asking: only deny rules and hooks stop one." }
29145
29165
  };
29146
29166
  function grokEntry(tool, pattern, raw) {
@@ -29169,19 +29189,29 @@ function grokRulesOf(toml) {
29169
29189
  }
29170
29190
  function grokOwnRules(options) {
29171
29191
  const home = options.home ?? homedir6();
29172
- const mode = grokModeOf(options.config);
29192
+ const { mode, from } = grokModeFrom({ path: options.configPath, toml: options.config }, options.claude);
29173
29193
  const own2 = grokRulesOf(options.config);
29174
29194
  const layers = options.claude.map((each) => each.layer);
29175
29195
  const borrowed = { allow: joined(layers, "allow"), ask: joined(layers, "ask"), deny: joined(layers, "deny") };
29176
29196
  const withClaude = borrowed.allow.length + borrowed.ask.length + borrowed.deny.length > 0;
29177
- const read_from = [tilde(options.configPath, home), ...withClaude ? options.claude.map((each) => tilde(each.path, home)) : []].slice(0, MOST_PLACES);
29178
- const note = [GROK_MODES[mode].note, withClaude ? "It follows your Claude Code permission rules too, as listed here." : void 0].filter((line) => line !== void 0).join(" ");
29197
+ const fromClaude = from !== void 0 && from !== options.configPath;
29198
+ const read_from = [
29199
+ tilde(options.configPath, home),
29200
+ ...options.claude.filter((each) => withClaude || each.path === from).map((each) => tilde(each.path, home))
29201
+ ].slice(0, MOST_PLACES);
29202
+ const note = [
29203
+ GROK_MODES[mode].note,
29204
+ fromClaude ? `Grok takes this mode from defaultMode in ${tilde(from, home)}, ahead of its own config.` : void 0,
29205
+ withClaude ? "It follows your Claude Code permission rules too, as listed here." : void 0
29206
+ ].filter((line) => line !== void 0).join(" ");
29179
29207
  if (mode === "always-approve") return { read_from, mode: GROK_MODES[mode].name, everything: true, note, runs: [] };
29208
+ const allowed = [...own2.allow, ...borrowed.allow];
29209
+ const edits = mode === "accept-edits" && !allowed.some((entry) => entry.kind === "write") ? [{ kind: "write", name: "Edit", raw: "acceptEdits" }] : [];
29180
29210
  return {
29181
29211
  read_from,
29182
29212
  mode: GROK_MODES[mode].name,
29183
29213
  note,
29184
- runs: [...own2.allow, ...borrowed.allow].slice(0, MOST),
29214
+ runs: [...allowed, ...edits].slice(0, MOST),
29185
29215
  asks: [...own2.ask, ...borrowed.ask].slice(0, MOST),
29186
29216
  refuses: [...own2.deny, ...borrowed.deny].slice(0, MOST)
29187
29217
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipschat/acp",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "An agent that speaks the Agent Client Protocol, as a Chips harness of its kind: agents made from Chips, each in a folder of its own, each room a session.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {