@chipschat/acp 1.0.36 → 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 +16 -4
- package/dist/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/main.js +170 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ also looks where that line puts the agent, since a terminal opened before doesn'
|
|
|
37
37
|
| `copilot` | `copilot --acp` | `curl -fsSL https://gh.io/copilot-install \| bash` | `copilot login` | none |
|
|
38
38
|
| `antigravity` | `agy acp` | `curl -fsSL https://antigravity.google/cli/install.sh \| bash` | `agy acp --login` | Default, Accept edits, Auto |
|
|
39
39
|
| `goose` | `goose acp` | Goose's `download_cli.sh` | `goose configure` (a model provider and its key) | Approve, Smart approve, Auto |
|
|
40
|
-
| `grok` | `grok
|
|
40
|
+
| `grok` | `grok agent stdio` | `curl -fsSL https://x.ai/cli/install.sh \| bash` | `grok login` | none |
|
|
41
41
|
|
|
42
42
|
- **Cursor** and **Copilot** offer modes that are ways of working (Agent, Plan, Ask; Agent, Plan,
|
|
43
43
|
Autopilot), not how much they may do, so Chips puts them in none: each session asks as the agent's
|
|
@@ -49,13 +49,25 @@ also looks where that line puts the agent, since a terminal opened before doesn'
|
|
|
49
49
|
naming `GOOSE_PROVIDER`, which the bridge says as "Goose has no model provider set up".
|
|
50
50
|
- **Grok** opens no session until it is asked to sign in (`authenticate`), as xAI's own ACP example
|
|
51
51
|
does: by its API key where `XAI_API_KEY` is set, else by what `grok login` saved. Signed out, it
|
|
52
|
-
offers neither, and its session is refused. Its ACP sessions have no mode to be put in.
|
|
52
|
+
offers neither, and its session is refused. Its ACP sessions have no mode to be put in. It is left
|
|
53
|
+
to update itself: xAI's API refuses one too old, and a Grok only Chips runs would never be updated
|
|
54
|
+
otherwise.
|
|
53
55
|
- **Antigravity**'s Auto is offered only where Antigravity has it: a personal Google account with
|
|
54
56
|
its terminal sandbox on.
|
|
55
57
|
- None of the five copies a session (`session/fork`), so their cards leave Fork off. Cursor, Copilot,
|
|
56
58
|
Goose and Grok offer their models as a session's `model` option, where they do, and the bridge
|
|
57
|
-
offers them in Chips as it does Claude Code's and Codex's
|
|
58
|
-
|
|
59
|
+
offers them in Chips as it does Claude Code's and Codex's, each once (Copilot on GitHub's free plan
|
|
60
|
+
lists Auto twice). Their files aren't read.
|
|
61
|
+
- The Permissions page shows what each one's own settings let through, read and never written:
|
|
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, 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.
|
|
69
|
+
- An agent's refusal reaches the room in its own words: where JSON-RPC's message is only "Internal
|
|
70
|
+
error", what its details say, as Grok's API answer ("Your Grok CLI version (0.2.99) is outdated …").
|
|
59
71
|
- What signs one in from the environment is carried to the copy kept running: `CURSOR_API_KEY`,
|
|
60
72
|
`COPILOT_GITHUB_TOKEN` (not `GH_TOKEN` or `GITHUB_TOKEN`, which are the gh command's too and
|
|
61
73
|
would beat Copilot's saved sign-in), `GEMINI_API_KEY`, `XAI_API_KEY`, and Goose's
|
package/dist/main.js
CHANGED
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// src/main.ts
|
|
11
|
-
import { existsSync as existsSync10, mkdirSync as mkdirSync6, readFileSync as
|
|
11
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync5 } from "node:fs";
|
|
12
12
|
import { basename as basename6, dirname as dirname7, join as join12 } from "node:path";
|
|
13
13
|
|
|
14
14
|
// node_modules/zod/v4/classic/external.js
|
|
@@ -27737,6 +27737,12 @@ var AcpError = class extends Error {
|
|
|
27737
27737
|
data;
|
|
27738
27738
|
name = "AcpError";
|
|
27739
27739
|
};
|
|
27740
|
+
function agentWords(error62) {
|
|
27741
|
+
const data = error62.data;
|
|
27742
|
+
const said = typeof data === "string" ? data : typeof data === "object" && data !== null && typeof data.message === "string" ? data.message : void 0;
|
|
27743
|
+
if (said === void 0 || said.trim() === "" || !/^internal error$/i.test(error62.message.trim())) return error62.message;
|
|
27744
|
+
return said.trim().slice(0, 600);
|
|
27745
|
+
}
|
|
27740
27746
|
function isAuthRequired(error62) {
|
|
27741
27747
|
return error62 instanceof AcpError && error62.code === -32e3 && /auth/i.test(error62.message);
|
|
27742
27748
|
}
|
|
@@ -28113,9 +28119,9 @@ var KNOWN2 = [
|
|
|
28113
28119
|
id: "grok",
|
|
28114
28120
|
name: "Grok",
|
|
28115
28121
|
program: "grok",
|
|
28116
|
-
//
|
|
28117
|
-
//
|
|
28118
|
-
args: ["
|
|
28122
|
+
// Left to update itself as it does: xAI's API refuses a Grok too old (it refused 0.2.99 with
|
|
28123
|
+
// a 426), and a Grok only Chips runs would never be updated otherwise.
|
|
28124
|
+
args: ["agent", "stdio"],
|
|
28119
28125
|
fetches: false,
|
|
28120
28126
|
agent: "grok",
|
|
28121
28127
|
installLine: "curl -fsSL https://x.ai/cli/install.sh | bash",
|
|
@@ -28528,7 +28534,7 @@ function forgetAdapter(id2, home = homedir5()) {
|
|
|
28528
28534
|
|
|
28529
28535
|
// src/bridge.ts
|
|
28530
28536
|
import { randomBytes } from "node:crypto";
|
|
28531
|
-
import { existsSync as existsSync8 } from "node:fs";
|
|
28537
|
+
import { existsSync as existsSync8, readFileSync as readFileSync9 } from "node:fs";
|
|
28532
28538
|
import { mkdir as mkdir3, writeFile as writeFile3 } from "node:fs/promises";
|
|
28533
28539
|
import { homedir as homedir7 } from "node:os";
|
|
28534
28540
|
import { join as join10 } from "node:path";
|
|
@@ -28936,6 +28942,10 @@ function currentIn(options) {
|
|
|
28936
28942
|
const value = modeOption(options)?.currentValue;
|
|
28937
28943
|
return value === void 0 || value === "" ? void 0 : value;
|
|
28938
28944
|
}
|
|
28945
|
+
function permissionsIn(options) {
|
|
28946
|
+
const value = options?.find((option) => option.category === "permissions")?.currentValue;
|
|
28947
|
+
return value === void 0 || value === "" ? void 0 : value;
|
|
28948
|
+
}
|
|
28939
28949
|
function withCurrent(options, mode) {
|
|
28940
28950
|
const option = modeOption(options);
|
|
28941
28951
|
return option === void 0 ? options : options.map((each) => each === option ? { ...each, currentValue: mode } : each);
|
|
@@ -29100,6 +29110,112 @@ function modeOwnRules(name, running, mode) {
|
|
|
29100
29110
|
if (mode === void 0) return { read_from, mode: running, runs: [] };
|
|
29101
29111
|
return { read_from, mode: mode.name, ...mode.everything === true ? { everything: true } : {}, note: mode.words, runs: [] };
|
|
29102
29112
|
}
|
|
29113
|
+
function copilotOwnRules(allowAll) {
|
|
29114
|
+
const read_from = ["Copilot's Allow all, as its sessions say it"];
|
|
29115
|
+
if (allowAll === "on") {
|
|
29116
|
+
return { read_from, mode: "Allow all", everything: true, note: "Copilot approves every tool, path and URL request without asking.", runs: [] };
|
|
29117
|
+
}
|
|
29118
|
+
return { read_from, mode: "Asks first", note: "Copilot asks before it uses a tool, reaches a path or fetches a URL.", runs: [] };
|
|
29119
|
+
}
|
|
29120
|
+
function tomlSection(toml, name) {
|
|
29121
|
+
let inside3 = false;
|
|
29122
|
+
const lines2 = [];
|
|
29123
|
+
for (const line of toml.split("\n")) {
|
|
29124
|
+
const header = /^\s*\[([^\]]+)\]\s*(?:#.*)?$/.exec(line);
|
|
29125
|
+
if (header !== null) {
|
|
29126
|
+
inside3 = header[1]?.trim() === name;
|
|
29127
|
+
continue;
|
|
29128
|
+
}
|
|
29129
|
+
if (inside3) lines2.push(line);
|
|
29130
|
+
}
|
|
29131
|
+
return lines2.join("\n");
|
|
29132
|
+
}
|
|
29133
|
+
var tomlString = (section, key) => new RegExp(`^\\s*${key}\\s*=\\s*"([^"]*)"`, "m").exec(section)?.[1];
|
|
29134
|
+
var tomlTrue = (section, key) => new RegExp(`^\\s*${key}\\s*=\\s*true\\b`, "m").test(section);
|
|
29135
|
+
function grokModeOf(toml) {
|
|
29136
|
+
const ui = tomlSection(toml ?? "", "ui");
|
|
29137
|
+
const said = tomlString(ui, "permission_mode") ?? tomlString(ui, "approval_mode");
|
|
29138
|
+
if (said === "auto" || said === "always-approve" || said === "ask") return said;
|
|
29139
|
+
return tomlTrue(ui, "yolo") ? "always-approve" : "ask";
|
|
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
|
+
}
|
|
29159
|
+
var GROK_MODES = {
|
|
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." },
|
|
29164
|
+
"always-approve": { name: "Always-approve", note: "Grok approves every step without asking: only deny rules and hooks stop one." }
|
|
29165
|
+
};
|
|
29166
|
+
function grokEntry(tool, pattern, raw) {
|
|
29167
|
+
const name = clip(tool, LONGEST_NAME);
|
|
29168
|
+
const lower = tool.toLowerCase();
|
|
29169
|
+
if (lower === "bash") {
|
|
29170
|
+
const words4 = bashWords(pattern);
|
|
29171
|
+
return { kind: "command", name, ...words4 === void 0 ? {} : { words: words4 }, raw: clip(raw, LONGEST_RAW) };
|
|
29172
|
+
}
|
|
29173
|
+
const kind2 = lower === "read" || lower === "grep" ? "read" : lower === "edit" ? "write" : lower.startsWith("web") ? "web" : "tool";
|
|
29174
|
+
return { kind: kind2, name, raw: clip(raw, LONGEST_RAW) };
|
|
29175
|
+
}
|
|
29176
|
+
function grokRulesOf(toml) {
|
|
29177
|
+
const rules = { allow: [], ask: [], deny: [] };
|
|
29178
|
+
const section = tomlSection(toml ?? "", "permission");
|
|
29179
|
+
for (const table of section.matchAll(/\{([^{}]*)\}/g)) {
|
|
29180
|
+
const body = table[1] ?? "";
|
|
29181
|
+
const field = (key) => new RegExp(`\\b${key}\\s*=\\s*"([^"]*)"`).exec(body)?.[1];
|
|
29182
|
+
const action2 = field("action");
|
|
29183
|
+
const tool = field("tool");
|
|
29184
|
+
if ((action2 === "allow" || action2 === "ask" || action2 === "deny") && tool !== void 0) {
|
|
29185
|
+
rules[action2].push(grokEntry(tool, field("pattern"), `{${body.trim()}}`));
|
|
29186
|
+
}
|
|
29187
|
+
}
|
|
29188
|
+
return { allow: rules.allow.slice(0, MOST), ask: rules.ask.slice(0, MOST), deny: rules.deny.slice(0, MOST) };
|
|
29189
|
+
}
|
|
29190
|
+
function grokOwnRules(options) {
|
|
29191
|
+
const home = options.home ?? homedir6();
|
|
29192
|
+
const { mode, from } = grokModeFrom({ path: options.configPath, toml: options.config }, options.claude);
|
|
29193
|
+
const own2 = grokRulesOf(options.config);
|
|
29194
|
+
const layers = options.claude.map((each) => each.layer);
|
|
29195
|
+
const borrowed = { allow: joined(layers, "allow"), ask: joined(layers, "ask"), deny: joined(layers, "deny") };
|
|
29196
|
+
const withClaude = borrowed.allow.length + borrowed.ask.length + borrowed.deny.length > 0;
|
|
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(" ");
|
|
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" }] : [];
|
|
29210
|
+
return {
|
|
29211
|
+
read_from,
|
|
29212
|
+
mode: GROK_MODES[mode].name,
|
|
29213
|
+
note,
|
|
29214
|
+
runs: [...allowed, ...edits].slice(0, MOST),
|
|
29215
|
+
asks: [...own2.ask, ...borrowed.ask].slice(0, MOST),
|
|
29216
|
+
refuses: [...own2.deny, ...borrowed.deny].slice(0, MOST)
|
|
29217
|
+
};
|
|
29218
|
+
}
|
|
29103
29219
|
async function sendOwnRules(settings, copy) {
|
|
29104
29220
|
const send = settings?.ownRules;
|
|
29105
29221
|
if (typeof send !== "function") return false;
|
|
@@ -29144,7 +29260,8 @@ async function lookAt(options, set2) {
|
|
|
29144
29260
|
const model = modelOption(options);
|
|
29145
29261
|
const fallback = pickOf(options);
|
|
29146
29262
|
if (model === void 0 || fallback === void 0) return { refused: [] };
|
|
29147
|
-
const
|
|
29263
|
+
const named = model.options.some((each) => each.value === fallback.model) ? model.options : [{ value: fallback.model, name: fallback.model }, ...model.options];
|
|
29264
|
+
const listed = named.filter((each, at) => named.findIndex((other) => other.value === each.value) === at);
|
|
29148
29265
|
let others = MODEL_CHOICES_MAX - 1;
|
|
29149
29266
|
const offered = listed.filter((each) => each.value === fallback.model || others-- > 0);
|
|
29150
29267
|
const choices = [];
|
|
@@ -29375,6 +29492,8 @@ var Bridge = class {
|
|
|
29375
29492
|
modeSaid = /* @__PURE__ */ new Map();
|
|
29376
29493
|
/** What it runs on its own, to send again in a moment: a mode change moves every session at once. */
|
|
29377
29494
|
ownRulesTimer;
|
|
29495
|
+
/** Its sessions' permission option, as the last to say it said: Copilot's Allow all. */
|
|
29496
|
+
permissionsNow;
|
|
29378
29497
|
/** Hear what Chips asks, learn the agents Chips has, run the agent, and close idle sessions. */
|
|
29379
29498
|
async start() {
|
|
29380
29499
|
const { chips: chips2 } = this.options;
|
|
@@ -29582,6 +29701,7 @@ var Bridge = class {
|
|
|
29582
29701
|
copied = { client, sessionId: forked.sessionId };
|
|
29583
29702
|
this.process.live.add(forked.sessionId);
|
|
29584
29703
|
this.sessionOptions.set(forked.sessionId, forked.configOptions);
|
|
29704
|
+
this.permissionsHeard(forked.configOptions);
|
|
29585
29705
|
await this.moded(client, forked.sessionId);
|
|
29586
29706
|
}
|
|
29587
29707
|
record2 = await this.made(forkName(original.name), {
|
|
@@ -30154,6 +30274,7 @@ ${files.join("\n")}`;
|
|
|
30154
30274
|
const loaded = await client.loadSession(kept2, record2.folder, [], this.sessionMeta(record2));
|
|
30155
30275
|
live.add(kept2);
|
|
30156
30276
|
this.sessionOptions.set(kept2, loaded.configOptions);
|
|
30277
|
+
this.permissionsHeard(loaded.configOptions);
|
|
30157
30278
|
await this.moded(client, kept2);
|
|
30158
30279
|
await this.modelled(client, record2, kept2);
|
|
30159
30280
|
return kept2;
|
|
@@ -30164,6 +30285,7 @@ ${files.join("\n")}`;
|
|
|
30164
30285
|
const made = await client.newSession(record2.folder, [], this.sessionMeta(record2));
|
|
30165
30286
|
live.add(made.sessionId);
|
|
30166
30287
|
this.sessionOptions.set(made.sessionId, made.configOptions);
|
|
30288
|
+
this.permissionsHeard(made.configOptions);
|
|
30167
30289
|
await this.moded(client, made.sessionId);
|
|
30168
30290
|
await this.modelled(client, record2, made.sessionId);
|
|
30169
30291
|
state2.sessions[key] = made.sessionId;
|
|
@@ -30253,6 +30375,13 @@ ${files.join("\n")}`;
|
|
|
30253
30375
|
this.modeNow = mode;
|
|
30254
30376
|
this.ownRulesSoon();
|
|
30255
30377
|
}
|
|
30378
|
+
/** A session's permission option, heard: what it runs on its own is sent again when it moved. */
|
|
30379
|
+
permissionsHeard(options) {
|
|
30380
|
+
const now = permissionsIn(options);
|
|
30381
|
+
if (now === void 0 || now === this.permissionsNow) return;
|
|
30382
|
+
this.permissionsNow = now;
|
|
30383
|
+
this.ownRulesSoon();
|
|
30384
|
+
}
|
|
30256
30385
|
/** What it runs on its own, sent again in a moment. */
|
|
30257
30386
|
ownRulesSoon() {
|
|
30258
30387
|
clearTimeout(this.ownRulesTimer);
|
|
@@ -30527,8 +30656,11 @@ ${files.join("\n")}`;
|
|
|
30527
30656
|
if (this.knownKind === "codex") return codexOwnRules(this.runningMode() ?? "workspace-write");
|
|
30528
30657
|
if (this.knownKind === void 0) {
|
|
30529
30658
|
const { kind: kind2 } = this.options;
|
|
30659
|
+
const id2 = knownOf(kind2)?.id;
|
|
30660
|
+
if (id2 === "copilot") return copilotOwnRules(this.permissionsNow);
|
|
30661
|
+
if (id2 === "grok") return this.grokOwnRules();
|
|
30530
30662
|
const running = this.runningMode();
|
|
30531
|
-
if (
|
|
30663
|
+
if (id2 === void 0 || running === void 0 || modesOf(kind2).length === 0) return void 0;
|
|
30532
30664
|
return modeOwnRules(kind2.name, running, modesOf(kind2).find((mode) => mode.id === running));
|
|
30533
30665
|
}
|
|
30534
30666
|
if (this.knownKind !== "claude-code") return void 0;
|
|
@@ -30547,6 +30679,31 @@ ${files.join("\n")}`;
|
|
|
30547
30679
|
home: this.places.home
|
|
30548
30680
|
});
|
|
30549
30681
|
}
|
|
30682
|
+
/**
|
|
30683
|
+
* Grok's: its own config, and the Claude Code settings it takes permission rules from: yours, in
|
|
30684
|
+
* `~/.claude`, and each agent folder's `.claude`.
|
|
30685
|
+
*/
|
|
30686
|
+
grokOwnRules() {
|
|
30687
|
+
const { home, claudeHome } = this.places;
|
|
30688
|
+
const configPath2 = join10(home, ".grok", "config.toml");
|
|
30689
|
+
let config2;
|
|
30690
|
+
try {
|
|
30691
|
+
config2 = readFileSync9(configPath2, "utf8");
|
|
30692
|
+
} catch {
|
|
30693
|
+
config2 = void 0;
|
|
30694
|
+
}
|
|
30695
|
+
const folders = [...new Set(this.records().map((record2) => record2.folder))];
|
|
30696
|
+
const paths = [
|
|
30697
|
+
join10(claudeHome, "settings.json"),
|
|
30698
|
+
join10(claudeHome, "settings.local.json"),
|
|
30699
|
+
...folders.flatMap((folder2) => [join10(folder2, ".claude", "settings.json"), join10(folder2, ".claude", "settings.local.json")])
|
|
30700
|
+
];
|
|
30701
|
+
const claude = paths.flatMap((path) => {
|
|
30702
|
+
const layer = readLayer(path);
|
|
30703
|
+
return layer === void 0 ? [] : [{ path, layer }];
|
|
30704
|
+
});
|
|
30705
|
+
return grokOwnRules({ configPath: configPath2, config: config2, claude, home });
|
|
30706
|
+
}
|
|
30550
30707
|
/** The harness's own set and each agent's files, as they are on disk now. */
|
|
30551
30708
|
async sendContexts() {
|
|
30552
30709
|
const files = this.files;
|
|
@@ -30668,6 +30825,7 @@ ${files.join("\n")}`;
|
|
|
30668
30825
|
const options = configOptionsOf(update);
|
|
30669
30826
|
if (this.sessionOptions.has(sessionId) && options.length > 0) {
|
|
30670
30827
|
this.sessionOptions.set(sessionId, options);
|
|
30828
|
+
this.permissionsHeard(options);
|
|
30671
30829
|
const now = currentIn(options);
|
|
30672
30830
|
if (now !== void 0) {
|
|
30673
30831
|
this.modeSaid.set(sessionId, now);
|
|
@@ -30945,6 +31103,7 @@ ${files.join("\n")}`;
|
|
|
30945
31103
|
try {
|
|
30946
31104
|
const made = await client.newSession(kind2.folder ?? kind2.folders);
|
|
30947
31105
|
sessionId = made.sessionId;
|
|
31106
|
+
this.permissionsHeard(made.configOptions);
|
|
30948
31107
|
const offered = offeredIn(made.configOptions);
|
|
30949
31108
|
if (offered !== void 0 && offered.join() !== this.offered?.join()) {
|
|
30950
31109
|
this.offered = offered;
|
|
@@ -31169,7 +31328,7 @@ function settingsFor(kind2, bridge2) {
|
|
|
31169
31328
|
};
|
|
31170
31329
|
}
|
|
31171
31330
|
function messageOf(error62) {
|
|
31172
|
-
if (error62 instanceof AcpError) return error62
|
|
31331
|
+
if (error62 instanceof AcpError) return agentWords(error62);
|
|
31173
31332
|
return error62 instanceof Error ? error62.message : String(error62);
|
|
31174
31333
|
}
|
|
31175
31334
|
function goalOf(message, name) {
|
|
@@ -31354,7 +31513,7 @@ function keepIfAsked(label2, url2, names, log2, before = () => void 0) {
|
|
|
31354
31513
|
}
|
|
31355
31514
|
|
|
31356
31515
|
// src/move.ts
|
|
31357
|
-
import { lstatSync, mkdirSync as mkdirSync5, readdirSync as readdirSync2, readFileSync as
|
|
31516
|
+
import { lstatSync, mkdirSync as mkdirSync5, readdirSync as readdirSync2, readFileSync as readFileSync10, renameSync as renameSync2, rmdirSync, writeFileSync as writeFileSync4 } from "node:fs";
|
|
31358
31517
|
import { homedir as homedir8 } from "node:os";
|
|
31359
31518
|
import { basename as basename5, dirname as dirname6, join as join11, resolve as resolve5 } from "node:path";
|
|
31360
31519
|
var there = (path) => {
|
|
@@ -31412,7 +31571,7 @@ function writeJson(path, value) {
|
|
|
31412
31571
|
}
|
|
31413
31572
|
var readJson = (path) => {
|
|
31414
31573
|
try {
|
|
31415
|
-
const read = JSON.parse(
|
|
31574
|
+
const read = JSON.parse(readFileSync10(path, "utf8"));
|
|
31416
31575
|
return typeof read === "object" && read !== null ? read : void 0;
|
|
31417
31576
|
} catch {
|
|
31418
31577
|
return void 0;
|
|
@@ -31558,7 +31717,7 @@ var joined2 = await join3({
|
|
|
31558
31717
|
onCode: (code) => log(`Allow this harness in Chips: ${code}`)
|
|
31559
31718
|
}).catch(refused2);
|
|
31560
31719
|
keepIfAsked(LABEL, joined2.url, keptEnvOf(kind), log);
|
|
31561
|
-
var kept = existsSync10(statePath) ? JSON.parse(
|
|
31720
|
+
var kept = existsSync10(statePath) ? JSON.parse(readFileSync11(statePath, "utf8")) : {};
|
|
31562
31721
|
var state = {
|
|
31563
31722
|
sessions: kept.sessions ?? {},
|
|
31564
31723
|
agents: kept.agents ?? {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipschat/acp",
|
|
3
|
-
"version": "1.0.
|
|
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": {
|