@chipschat/acp 1.0.29 → 1.0.31
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 +9 -2
- package/dist/THIRD-PARTY-NOTICES.md +3 -3
- package/dist/main.js +310 -52
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -39,10 +39,13 @@ need not be there: without them the bridge runs Claude Code or Codex, in the mod
|
|
|
39
39
|
|
|
40
40
|
Before it takes the link up, which works once, it checks:
|
|
41
41
|
- the config is there, or is one of those two;
|
|
42
|
-
- its command is on this machine's PATH (else how to install it)
|
|
42
|
+
- its command is on this machine's PATH (else how to install it). Claude Code and Codex are also
|
|
43
|
+
looked for in `~/.local/bin`, where their makers' installers put them, since the terminal an
|
|
44
|
+
installer ran in doesn't have that folder on its PATH until a new one is opened;
|
|
43
45
|
- the agent starts, makes a session, and is signed in: Codex refuses a session while signed out,
|
|
44
46
|
and Claude Code says it is signed in as nobody (`_auth/status_update`). Signed out, it says how
|
|
45
|
-
to sign in: `codex login
|
|
47
|
+
to sign in: `codex login` (`codex login --device-auth` on a machine with no screen), or
|
|
48
|
+
`claude auth login`.
|
|
46
49
|
|
|
47
50
|
Anything missing stops it with what to do, and the link is still good. Joined, it says hello in its
|
|
48
51
|
room once, which the card waits for; a new link from Chips replaces the key it kept. Without a
|
|
@@ -124,6 +127,10 @@ its asks). Then nothing reaches Chips as a card. Put them where they ask:
|
|
|
124
127
|
does without asking, and read-only commands never ask.
|
|
125
128
|
- Codex in `workspace-write` changes its folder freely and asks before the network or anything
|
|
126
129
|
outside it. `read-only` asks before any change.
|
|
130
|
+
- The bridge tells Chips what those settings let through (Chips ADR 0299), for the harness's
|
|
131
|
+
Permissions page: Claude Code's `permissions` lists from your settings and each agent's folder,
|
|
132
|
+
and the mode; for Codex, its mode. It reads them and never writes them. Needs Chips SDK 1.0.10;
|
|
133
|
+
on an older one nothing is sent.
|
|
127
134
|
|
|
128
135
|
## Live
|
|
129
136
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
`dist/main.js` in @chipschat/acp 1.0.
|
|
3
|
+
`dist/main.js` in @chipschat/acp 1.0.31 carries these packages, bundled in. Each one's
|
|
4
4
|
licence follows.
|
|
5
5
|
|
|
6
|
-
## @chipschat/harness 1.0.
|
|
6
|
+
## @chipschat/harness 1.0.10 (Apache-2.0)
|
|
7
7
|
|
|
8
8
|
Apache License
|
|
9
9
|
Version 2.0, January 2004
|
|
@@ -207,7 +207,7 @@ Apache License
|
|
|
207
207
|
See the License for the specific language governing permissions and
|
|
208
208
|
limitations under the License.
|
|
209
209
|
|
|
210
|
-
## @chipschat/protocol 1.0.
|
|
210
|
+
## @chipschat/protocol 1.0.10 (Apache-2.0)
|
|
211
211
|
|
|
212
212
|
Apache License
|
|
213
213
|
Version 2.0, January 2004
|
package/dist/main.js
CHANGED
|
@@ -687,9 +687,9 @@ function assertNever(_x) {
|
|
|
687
687
|
}
|
|
688
688
|
function assert(_) {
|
|
689
689
|
}
|
|
690
|
-
function getEnumValues(
|
|
691
|
-
const numericValues = Object.values(
|
|
692
|
-
const values = Object.entries(
|
|
690
|
+
function getEnumValues(entries2) {
|
|
691
|
+
const numericValues = Object.values(entries2).filter((v) => typeof v === "number");
|
|
692
|
+
const values = Object.entries(entries2).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
693
693
|
return values;
|
|
694
694
|
}
|
|
695
695
|
function joinValues(array2, separator = "|") {
|
|
@@ -2524,16 +2524,16 @@ var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (i
|
|
|
2524
2524
|
hide(inst, Symbol.iterator, function* () {
|
|
2525
2525
|
yield inst;
|
|
2526
2526
|
});
|
|
2527
|
-
let
|
|
2527
|
+
let entries2;
|
|
2528
2528
|
inst._zod.check = (payload) => {
|
|
2529
2529
|
if (payload.value == null) {
|
|
2530
2530
|
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
2531
2531
|
return void 0;
|
|
2532
2532
|
}
|
|
2533
|
-
|
|
2533
|
+
entries2 ?? (entries2 = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
2534
2534
|
const input2 = payload.value;
|
|
2535
2535
|
let proms;
|
|
2536
|
-
for (const [key, schema] of
|
|
2536
|
+
for (const [key, schema] of entries2) {
|
|
2537
2537
|
const result = schema._zod.run({ value: input2[key], issues: [] }, {});
|
|
2538
2538
|
if (result instanceof Promise) {
|
|
2539
2539
|
proms ?? (proms = []);
|
|
@@ -15351,18 +15351,18 @@ function _set(Class2, valueType, params) {
|
|
|
15351
15351
|
}
|
|
15352
15352
|
// @__NO_SIDE_EFFECTS__
|
|
15353
15353
|
function _enum(Class2, values, params) {
|
|
15354
|
-
const
|
|
15354
|
+
const entries2 = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
15355
15355
|
return new Class2({
|
|
15356
15356
|
type: "enum",
|
|
15357
|
-
entries,
|
|
15357
|
+
entries: entries2,
|
|
15358
15358
|
...normalizeParams(params)
|
|
15359
15359
|
});
|
|
15360
15360
|
}
|
|
15361
15361
|
// @__NO_SIDE_EFFECTS__
|
|
15362
|
-
function _nativeEnum(Class2,
|
|
15362
|
+
function _nativeEnum(Class2, entries2, params) {
|
|
15363
15363
|
return new Class2({
|
|
15364
15364
|
type: "enum",
|
|
15365
|
-
entries,
|
|
15365
|
+
entries: entries2,
|
|
15366
15366
|
...normalizeParams(params)
|
|
15367
15367
|
});
|
|
15368
15368
|
}
|
|
@@ -18345,17 +18345,17 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
18345
18345
|
};
|
|
18346
18346
|
});
|
|
18347
18347
|
function _enum2(values, params) {
|
|
18348
|
-
const
|
|
18348
|
+
const entries2 = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
18349
18349
|
return new ZodEnum({
|
|
18350
18350
|
type: "enum",
|
|
18351
|
-
entries,
|
|
18351
|
+
entries: entries2,
|
|
18352
18352
|
...util_exports.normalizeParams(params)
|
|
18353
18353
|
});
|
|
18354
18354
|
}
|
|
18355
|
-
function nativeEnum(
|
|
18355
|
+
function nativeEnum(entries2, params) {
|
|
18356
18356
|
return new ZodEnum({
|
|
18357
18357
|
type: "enum",
|
|
18358
|
-
entries,
|
|
18358
|
+
entries: entries2,
|
|
18359
18359
|
...util_exports.normalizeParams(params)
|
|
18360
18360
|
});
|
|
18361
18361
|
}
|
|
@@ -19952,9 +19952,17 @@ var policyRule = external_exports.object({
|
|
|
19952
19952
|
made_by: external_exports.string().min(1).max(120).optional().describe("Who made it by answering an ask with Always (ADR 0195). Filled in by Chips."),
|
|
19953
19953
|
made_at: isoTimestamp.optional().describe("When a person's answer made it (ADR 0195): Always, or This session. Filled in by Chips. A rule a person's answer made never allows an action that matters.")
|
|
19954
19954
|
}).describe("A rule the policy engine evaluates.");
|
|
19955
|
+
var policyHold = external_exports.object({
|
|
19956
|
+
until: isoTimestamp.optional().describe("When its asks come back. Absent: when a person turns them back on."),
|
|
19957
|
+
matters: external_exports.boolean().optional().describe("Whether the yes covers asks that matter too: money, a message outside the workspace, anything that can't be undone. Absent or false, those still wait for a person."),
|
|
19958
|
+
by: external_exports.string().min(1).max(120).optional().describe("Who turned its asks off. Filled in by Chips from the credential that sent it."),
|
|
19959
|
+
at: isoTimestamp.optional().describe("When they were turned off. Filled in by Chips.")
|
|
19960
|
+
}).describe("A harness's asks turned off: Chips says yes for it until `until`.");
|
|
19955
19961
|
var policy = external_exports.object({
|
|
19956
19962
|
autonomy: autonomyLevel,
|
|
19957
|
-
rules: external_exports.array(policyRule).max(200).describe("Evaluated in order; the workspace cap always wins.")
|
|
19963
|
+
rules: external_exports.array(policyRule).max(200).describe("Evaluated in order; the workspace cap always wins."),
|
|
19964
|
+
hold: policyHold.nullable().optional().describe("Its asks turned off (ADR 0299), for every space: kept only with no `space_id`. `null` turns them back on; absent leaves it as it was."),
|
|
19965
|
+
chips_rules: external_exports.boolean().optional().describe("Whether Chips's rules answer any of its asks (ADR 0300): off, every ask it sends goes to a person and a don't-ask-again is the harness's own. Kept only with no `space_id`; absent leaves it as it was, and never set it reads as on for a harness with a rule or a hold, or whose workspace has one.")
|
|
19958
19966
|
}).describe("A harness's autonomy level and the rules that fill in the details.");
|
|
19959
19967
|
var cost = external_exports.object({
|
|
19960
19968
|
usd: external_exports.number().nonnegative().describe("An estimate, in US dollars."),
|
|
@@ -21159,6 +21167,7 @@ var approvalResolved = defineEvent({
|
|
|
21159
21167
|
approval_id: id("approval"),
|
|
21160
21168
|
decision: external_exports.enum(["approved", "edited", "denied", "expired"]).describe("`expired` means nobody answered and the fallback applied."),
|
|
21161
21169
|
scope: external_exports.enum(["once", "session", "always"]).default("once").describe("How far the answer reaches. `always` becomes a policy rule."),
|
|
21170
|
+
keeps: external_exports.literal("harness").optional().describe("With `always`: the harness keeps it as its own always, since its Chips's rules are off (ADR 0300), and Chips writes no rule. Filled in by Chips."),
|
|
21162
21171
|
everywhere: external_exports.boolean().optional().describe("With `always`: the rule is the harness's in every space, not only this one (ADR 0239). An owner or an admin only."),
|
|
21163
21172
|
for_minutes: external_exports.number().int().min(5).max(240).optional().describe("With `once` and a yes: for this many minutes, everything the asking agent asks in this space goes ahead without a card (ADR 0239, addendum of 6 November 2026; ADR 0281), commands Chips can't read too. An ask that matters still waits for a person. Chips keeps the rule, so the harness is answered once."),
|
|
21164
21173
|
until_stopped: external_exports.literal(true).optional().describe("With `once` and a yes, instead of `for_minutes`: everything the asking agent asks in this space goes ahead without a card until a person stops it (`approval.held_stopped`, ADR 0281). An ask that matters still waits for a person. Chips keeps the rule, so the harness is answered once."),
|
|
@@ -22460,6 +22469,19 @@ var exchangeLimitsSet = defineEvent({
|
|
|
22460
22469
|
circles: external_exports.boolean().describe("Whether agents going in circles (the same two or three taking turns and saying again what they said) are told to stop then, whatever the count.")
|
|
22461
22470
|
})
|
|
22462
22471
|
});
|
|
22472
|
+
var policyWorkspaceUpdated = defineEvent({
|
|
22473
|
+
type: "policy.workspace_updated",
|
|
22474
|
+
direction: "workspace",
|
|
22475
|
+
sender: "person",
|
|
22476
|
+
summary: "An owner or an admin set the rules for every harness, or turned every harness's asks off for a while (ADR 0299).",
|
|
22477
|
+
requiresRun: false,
|
|
22478
|
+
payload: external_exports.object({
|
|
22479
|
+
rules: external_exports.array(policyRule).max(200).describe("Read before any harness's own, in order. Each rule a person adds is kept with who made it and when."),
|
|
22480
|
+
hold: policyHold.nullable().optional().describe("Every harness's asks turned off. `null` turns them back on; absent leaves it as it was."),
|
|
22481
|
+
workspace_max_autonomy: autonomyLevel.describe("The workspace cap as it stands, which this doesn't change. Filled in by Chips."),
|
|
22482
|
+
changed_by: external_exports.string().min(1).max(120).describe("Who changed them. Filled in by Chips from the credential that sent it.")
|
|
22483
|
+
})
|
|
22484
|
+
});
|
|
22463
22485
|
var workspaceRenamed = defineEvent({
|
|
22464
22486
|
type: "workspace.renamed",
|
|
22465
22487
|
direction: "workspace",
|
|
@@ -22529,7 +22551,8 @@ var WORKSPACE_EVENTS = [
|
|
|
22529
22551
|
attachmentLimitsSet,
|
|
22530
22552
|
exchangeLimitsSet,
|
|
22531
22553
|
workspaceRenamed,
|
|
22532
|
-
relaySet
|
|
22554
|
+
relaySet,
|
|
22555
|
+
policyWorkspaceUpdated
|
|
22533
22556
|
];
|
|
22534
22557
|
|
|
22535
22558
|
// node_modules/@chipschat/protocol/dist/src/events/catalogue.js
|
|
@@ -22967,6 +22990,36 @@ var notificationSettings = external_exports.object({
|
|
|
22967
22990
|
spaces: external_exports.record(external_exports.string().min(1).max(120), spaceNotifications).optional()
|
|
22968
22991
|
});
|
|
22969
22992
|
|
|
22993
|
+
// node_modules/@chipschat/protocol/dist/src/own-rules.js
|
|
22994
|
+
var OWN_RULES_MAX = 200;
|
|
22995
|
+
var OWN_KINDS = ["read", "write", "web", "command", "tool"];
|
|
22996
|
+
var ownKind = external_exports.enum(OWN_KINDS);
|
|
22997
|
+
var ownEntry = external_exports.object({
|
|
22998
|
+
kind: ownKind.describe("What it lets through: reading files, writing them, the web, commands, or another tool."),
|
|
22999
|
+
name: external_exports.string().min(1).max(120).describe("The tool or program as the harness names it: `Read`, `WebFetch`, `git`."),
|
|
23000
|
+
words: external_exports.array(external_exports.string().min(1).max(120)).max(8).optional().describe('For a command: the words every command it lets through starts with, `["git"]`. Absent on a command entry: any command.'),
|
|
23001
|
+
raw: external_exports.string().min(1).max(400).optional().describe("The entry as its settings write it: `Bash(git:*)`.")
|
|
23002
|
+
}).describe("One thing a harness's own settings let through, ask about, or refuse.");
|
|
23003
|
+
var entries = external_exports.array(ownEntry).max(OWN_RULES_MAX);
|
|
23004
|
+
var ownRules = external_exports.object({
|
|
23005
|
+
read_from: external_exports.array(external_exports.string().min(1).max(300)).min(1).max(8).describe("Where it read them, in the order they apply: `~/.claude/settings.json`."),
|
|
23006
|
+
note: external_exports.string().min(1).max(400).optional().describe("A sentence in the harness's own words about them: who else reads the same file, what its mode means."),
|
|
23007
|
+
mode: external_exports.string().min(1).max(80).optional().describe("The mode its sessions run in, as the harness names it: `Default`."),
|
|
23008
|
+
everything: external_exports.boolean().optional().describe("It runs everything without asking, so nothing it does reaches Chips as an ask."),
|
|
23009
|
+
runs: entries.describe("What it runs without asking."),
|
|
23010
|
+
asks: entries.optional().describe("What it always asks about, whatever else it lets through."),
|
|
23011
|
+
refuses: entries.optional().describe("What it never does."),
|
|
23012
|
+
ask_line: external_exports.object({
|
|
23013
|
+
entry: external_exports.string().min(1).max(200).describe("One entry that asks, with `{words}` where a command's start goes."),
|
|
23014
|
+
line: external_exports.string().min(1).max(300).describe("The line those entries go in, with `{entries}` where they go, comma-separated."),
|
|
23015
|
+
where: external_exports.string().min(1).max(300).describe("Where the line goes, in words.")
|
|
23016
|
+
}).optional().describe("How to make a command ask in its own settings, for the page's Copy.")
|
|
23017
|
+
}).describe("What a harness's own settings let through, in its own terms (ADR 0299).");
|
|
23018
|
+
var ownRulesRead = external_exports.object({
|
|
23019
|
+
own_rules: ownRules.nullable().describe("The latest copy; `null` before the harness sent one."),
|
|
23020
|
+
heard_at: isoTimestamp.nullable().describe("When Chips heard it.")
|
|
23021
|
+
}).describe("What a harness last said it runs on its own.");
|
|
23022
|
+
|
|
22970
23023
|
// node_modules/@chipschat/protocol/dist/src/pages.js
|
|
22971
23024
|
var HTML_POLICY = "default-src 'none'; img-src data: blob:; font-src data:; media-src data: blob:; style-src 'unsafe-inline'; script-src 'unsafe-inline'";
|
|
22972
23025
|
var PAGE_SANDBOX = "allow-scripts allow-popups allow-popups-to-escape-sandbox";
|
|
@@ -24032,6 +24085,7 @@ var Run = class {
|
|
|
24032
24085
|
decision: event.decision,
|
|
24033
24086
|
allowed: event.decision === "approved" || event.decision === "edited",
|
|
24034
24087
|
scope: event.scope ?? "once",
|
|
24088
|
+
...event.keeps === "harness" ? { keeps: "harness" } : {},
|
|
24035
24089
|
input: event.decision === "edited" ? event.updated_input : input2.action.input,
|
|
24036
24090
|
reason: event.reason,
|
|
24037
24091
|
by: event.resolved_by,
|
|
@@ -24184,7 +24238,8 @@ var PATHS = {
|
|
|
24184
24238
|
model: (id2) => `/v1/agents/${encodeURIComponent(id2)}/model`,
|
|
24185
24239
|
heartbeat: (id2) => `/v1/agents/${encodeURIComponent(id2)}/heartbeat`,
|
|
24186
24240
|
"context-window": (id2) => `/v1/agents/${encodeURIComponent(id2)}/context-window`,
|
|
24187
|
-
jobs: (id2) => `/v1/harnesses/${encodeURIComponent(id2)}/jobs
|
|
24241
|
+
jobs: (id2) => `/v1/harnesses/${encodeURIComponent(id2)}/jobs`,
|
|
24242
|
+
"own-rules": (id2) => `/v1/harnesses/${encodeURIComponent(id2)}/own-rules`
|
|
24188
24243
|
};
|
|
24189
24244
|
var FRAMES = {
|
|
24190
24245
|
"context.edit": contextEditFrame,
|
|
@@ -24234,6 +24289,15 @@ var Settings = class {
|
|
|
24234
24289
|
jobs(copy) {
|
|
24235
24290
|
return this.send("jobs", this.harnessId(), copy, {});
|
|
24236
24291
|
}
|
|
24292
|
+
/**
|
|
24293
|
+
* What the harness's own settings let through without asking (ADR 0299): where it read them, the
|
|
24294
|
+
* mode it runs in, and each entry. Chips decides nothing from it; a person reads it on the
|
|
24295
|
+
* harness's Permissions page. Send it when connected and whenever the settings are read again;
|
|
24296
|
+
* a copy the same as the last is not sent again. An older Chips has no such page and refuses it.
|
|
24297
|
+
*/
|
|
24298
|
+
ownRules(copy) {
|
|
24299
|
+
return this.send("own-rules", this.harnessId(), copy, {});
|
|
24300
|
+
}
|
|
24237
24301
|
/**
|
|
24238
24302
|
* Runs of its jobs the harness finished (`jobs`), two hundred to a post. A run sent again says
|
|
24239
24303
|
* what it says over the one before, and what it leaves out stays, so send it once more when its
|
|
@@ -25648,10 +25712,10 @@ function keptAtAny(store, accounts) {
|
|
|
25648
25712
|
}
|
|
25649
25713
|
return void 0;
|
|
25650
25714
|
}
|
|
25651
|
-
function rehomed(store, account,
|
|
25652
|
-
const here2 = hereInstead(
|
|
25653
|
-
if (here2 === void 0 || here2 ===
|
|
25654
|
-
return
|
|
25715
|
+
function rehomed(store, account, joined3, env2) {
|
|
25716
|
+
const here2 = hereInstead(joined3.url, env2);
|
|
25717
|
+
if (here2 === void 0 || here2 === joined3.url)
|
|
25718
|
+
return joined3;
|
|
25655
25719
|
if (store !== false) {
|
|
25656
25720
|
try {
|
|
25657
25721
|
const record2 = JSON.parse(store.get(account) ?? "{}");
|
|
@@ -25659,7 +25723,7 @@ function rehomed(store, account, joined2, env2) {
|
|
|
25659
25723
|
} catch {
|
|
25660
25724
|
}
|
|
25661
25725
|
}
|
|
25662
|
-
return { ...
|
|
25726
|
+
return { ...joined3, url: here2 };
|
|
25663
25727
|
}
|
|
25664
25728
|
function keptAt(store, account) {
|
|
25665
25729
|
if (store === false)
|
|
@@ -25776,10 +25840,10 @@ async function join3(options) {
|
|
|
25776
25840
|
throw error62;
|
|
25777
25841
|
}
|
|
25778
25842
|
const answered = joinedOf(answer);
|
|
25779
|
-
const
|
|
25843
|
+
const joined3 = { ...answered, url: hereInstead(answered.url, env2) ?? answered.url };
|
|
25780
25844
|
if (store !== false)
|
|
25781
|
-
keepTheKey(store, account, { ...
|
|
25782
|
-
return
|
|
25845
|
+
keepTheKey(store, account, { ...joined3, from, hello: "due" });
|
|
25846
|
+
return joined3;
|
|
25783
25847
|
}
|
|
25784
25848
|
function keepTheKey(store, account, record2) {
|
|
25785
25849
|
try {
|
|
@@ -25790,12 +25854,12 @@ function keepTheKey(store, account, record2) {
|
|
|
25790
25854
|
`);
|
|
25791
25855
|
}
|
|
25792
25856
|
}
|
|
25793
|
-
async function helloOnce(
|
|
25794
|
-
const { spaceId } =
|
|
25857
|
+
async function helloOnce(joined3, options) {
|
|
25858
|
+
const { spaceId } = joined3;
|
|
25795
25859
|
if (spaceId === void 0)
|
|
25796
25860
|
return false;
|
|
25797
25861
|
const store = options.keep ?? openKeyStore(options.env ?? process.env);
|
|
25798
|
-
const account = accountOf(
|
|
25862
|
+
const account = accountOf(joined3.url, options.name);
|
|
25799
25863
|
let record2;
|
|
25800
25864
|
try {
|
|
25801
25865
|
const kept2 = store === false ? void 0 : store.get(account);
|
|
@@ -25803,7 +25867,7 @@ async function helloOnce(joined2, options) {
|
|
|
25803
25867
|
} catch {
|
|
25804
25868
|
record2 = void 0;
|
|
25805
25869
|
}
|
|
25806
|
-
const due = store === false || record2?.["hello"] === "due" && record2["token"] ===
|
|
25870
|
+
const due = store === false || record2?.["hello"] === "due" && record2["token"] === joined3.token;
|
|
25807
25871
|
if (!due)
|
|
25808
25872
|
return false;
|
|
25809
25873
|
await options.say(spaceId);
|
|
@@ -26658,6 +26722,7 @@ var KNOWN2 = [
|
|
|
26658
26722
|
fetches: false,
|
|
26659
26723
|
agent: "claude",
|
|
26660
26724
|
installLine: "curl -fsSL https://claude.ai/install.sh | bash",
|
|
26725
|
+
installedIn: ".local/bin",
|
|
26661
26726
|
mode: "default",
|
|
26662
26727
|
signIn: "run `claude auth login`",
|
|
26663
26728
|
signInLine: "claude auth login",
|
|
@@ -26672,8 +26737,11 @@ var KNOWN2 = [
|
|
|
26672
26737
|
fetches: true,
|
|
26673
26738
|
agent: "codex",
|
|
26674
26739
|
installLine: "curl -fsSL https://chatgpt.com/codex/install.sh | sh",
|
|
26740
|
+
installedIn: ".local/bin",
|
|
26675
26741
|
mode: "workspace-write",
|
|
26676
26742
|
signIn: "run `codex login`",
|
|
26743
|
+
// Over SSH no browser opens, and the address `codex login` prints calls back to that machine.
|
|
26744
|
+
signInNoScreen: "`codex login --device-auth`",
|
|
26677
26745
|
signInLine: "codex login",
|
|
26678
26746
|
signInDoing: SIGN_IN_DOING
|
|
26679
26747
|
}
|
|
@@ -26719,7 +26787,10 @@ function installWords(kind2) {
|
|
|
26719
26787
|
}
|
|
26720
26788
|
function signedOutWords(kind2, info) {
|
|
26721
26789
|
const known = knownBy(kind2);
|
|
26722
|
-
if (known !== void 0)
|
|
26790
|
+
if (known !== void 0) {
|
|
26791
|
+
const noScreen = known.signInNoScreen === void 0 ? "" : `, or ${known.signInNoScreen} on a machine with no screen`;
|
|
26792
|
+
return `${kind2.name} isn't signed in on this machine: ${known.signIn} in a new terminal${noScreen}.`;
|
|
26793
|
+
}
|
|
26723
26794
|
const ways = (info?.authMethods ?? []).map((method) => method.name);
|
|
26724
26795
|
return `${kind2.name} isn't signed in on this machine: sign it in its own way${ways.length > 0 ? ` (${ways.join(", ")})` : ""}.`;
|
|
26725
26796
|
}
|
|
@@ -26930,10 +27001,18 @@ async function checkSignIn(kind2, wire, cwd, options = {}) {
|
|
|
26930
27001
|
}
|
|
26931
27002
|
|
|
26932
27003
|
// src/adapter.ts
|
|
27004
|
+
var inNewTerminal = (name) => `If ${name} still isn't found, run that command in a new terminal.`;
|
|
26933
27005
|
var PATIENCE_MS = 20 * 6e4;
|
|
26934
27006
|
var adapterFolder = (id2, home = homedir5()) => join7(placesOf(home).settings, "adapters", id2);
|
|
26935
27007
|
var fetchedAt = (id2, program, home) => join7(adapterFolder(id2, home), "node_modules", ".bin", program);
|
|
26936
27008
|
var pathOf2 = (kind2, env2) => ({ ...env2, ...kind2.env })["PATH"] ?? "";
|
|
27009
|
+
function makersFolder(kind2, env2 = process.env, home = homedir5()) {
|
|
27010
|
+
const known = knownOf(kind2);
|
|
27011
|
+
if (known === void 0 || onPath(known.agent, pathOf2(kind2, env2))) return void 0;
|
|
27012
|
+
const folder2 = join7(home, known.installedIn);
|
|
27013
|
+
return runnable(join7(folder2, known.agent)) ? folder2 : void 0;
|
|
27014
|
+
}
|
|
27015
|
+
var pathWithLast = (path, folder2) => [...(path ?? "").split(delimiter3).filter((each) => each !== ""), folder2].join(delimiter3);
|
|
26937
27016
|
function withFetchedAdapter(kind2, env2 = process.env, home = homedir5()) {
|
|
26938
27017
|
const known = knownOf(kind2);
|
|
26939
27018
|
if (known === void 0 || kind2.command[0] !== known.program || onPath(known.program, pathOf2(kind2, env2))) return kind2;
|
|
@@ -26984,7 +27063,10 @@ async function readyAdapter(kind2, options = {}) {
|
|
|
26984
27063
|
const path = pathOf2(kind2, env2);
|
|
26985
27064
|
if (onPath(known.program, path)) return kind2;
|
|
26986
27065
|
if (!onPath(known.agent, path)) {
|
|
26987
|
-
throw new SetupError(
|
|
27066
|
+
throw new SetupError(
|
|
27067
|
+
`${kind2.name} isn't installed on this machine: run \`${known.installLine}\`. ${STILL_GOOD} ${inNewTerminal(kind2.name)}`,
|
|
27068
|
+
agentMissingStop(known)
|
|
27069
|
+
);
|
|
26988
27070
|
}
|
|
26989
27071
|
const npm = env2["CHIPS_NPM"];
|
|
26990
27072
|
if (!known.fetches || npm === void 0 || npm === "") return kind2;
|
|
@@ -27021,7 +27103,7 @@ function forgetAdapter(id2, home = homedir5()) {
|
|
|
27021
27103
|
import { randomBytes } from "node:crypto";
|
|
27022
27104
|
import { existsSync as existsSync8 } from "node:fs";
|
|
27023
27105
|
import { mkdir as mkdir3, writeFile as writeFile3 } from "node:fs/promises";
|
|
27024
|
-
import { homedir as
|
|
27106
|
+
import { homedir as homedir7 } from "node:os";
|
|
27025
27107
|
import { join as join10 } from "node:path";
|
|
27026
27108
|
|
|
27027
27109
|
// src/claude-settings.ts
|
|
@@ -27405,6 +27487,147 @@ function keepHeard(since, heard) {
|
|
|
27405
27487
|
if (since.length > CONTEXT_BUDGET.lines) since.shift();
|
|
27406
27488
|
}
|
|
27407
27489
|
|
|
27490
|
+
// src/own-rules.ts
|
|
27491
|
+
import { homedir as homedir6 } from "node:os";
|
|
27492
|
+
var MOST = 200;
|
|
27493
|
+
var MOST_PLACES = 8;
|
|
27494
|
+
var LONGEST_NAME = 120;
|
|
27495
|
+
var LONGEST_RAW = 400;
|
|
27496
|
+
var READS = /* @__PURE__ */ new Set(["Read", "Glob", "Grep", "LS", "NotebookRead"]);
|
|
27497
|
+
var WRITES = /* @__PURE__ */ new Set(["Edit", "Write", "MultiEdit", "NotebookEdit"]);
|
|
27498
|
+
var WEB = /* @__PURE__ */ new Set(["WebFetch", "WebSearch"]);
|
|
27499
|
+
var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27500
|
+
var clip = (text, most) => text.length > most ? text.slice(0, most) : text;
|
|
27501
|
+
function bashWords(inner) {
|
|
27502
|
+
if (inner === void 0) return void 0;
|
|
27503
|
+
const pattern = inner.trim().replace(/:\*$/, "").replace(/\s+\*$/, "");
|
|
27504
|
+
if (pattern === "" || pattern === "*") return void 0;
|
|
27505
|
+
const words4 = pattern.split(/\s+/).map((word) => clip(word, LONGEST_NAME));
|
|
27506
|
+
return words4.slice(0, 8);
|
|
27507
|
+
}
|
|
27508
|
+
function claudeEntry(rule) {
|
|
27509
|
+
const said = /^\s*([^()\s]+)\s*(?:\((.*)\))?\s*$/s.exec(rule);
|
|
27510
|
+
const name = said?.[1];
|
|
27511
|
+
if (name === void 0) return void 0;
|
|
27512
|
+
const raw = clip(rule.trim(), LONGEST_RAW);
|
|
27513
|
+
const tool = clip(name, LONGEST_NAME);
|
|
27514
|
+
if (name === "Bash") {
|
|
27515
|
+
const words4 = bashWords(said?.[2]);
|
|
27516
|
+
return { kind: "command", name: tool, ...words4 === void 0 ? {} : { words: words4 }, raw };
|
|
27517
|
+
}
|
|
27518
|
+
const kind2 = READS.has(name) ? "read" : WRITES.has(name) ? "write" : WEB.has(name) ? "web" : "tool";
|
|
27519
|
+
return { kind: kind2, name: tool, raw };
|
|
27520
|
+
}
|
|
27521
|
+
function joined(layers, list) {
|
|
27522
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27523
|
+
const entries2 = [];
|
|
27524
|
+
for (const layer of layers) {
|
|
27525
|
+
const permissions = layer["permissions"];
|
|
27526
|
+
const rules = isRecord2(permissions) ? permissions[list] : void 0;
|
|
27527
|
+
if (!Array.isArray(rules)) continue;
|
|
27528
|
+
for (const rule of rules) {
|
|
27529
|
+
if (typeof rule !== "string" || seen.has(rule.trim())) continue;
|
|
27530
|
+
seen.add(rule.trim());
|
|
27531
|
+
const entry = claudeEntry(rule);
|
|
27532
|
+
if (entry !== void 0) entries2.push(entry);
|
|
27533
|
+
}
|
|
27534
|
+
}
|
|
27535
|
+
return entries2.slice(0, MOST);
|
|
27536
|
+
}
|
|
27537
|
+
function ownDefaultMode(layer) {
|
|
27538
|
+
const permissions = layer?.["permissions"];
|
|
27539
|
+
const mode = isRecord2(permissions) ? permissions["defaultMode"] : void 0;
|
|
27540
|
+
return typeof mode === "string" && mode !== "" ? mode : void 0;
|
|
27541
|
+
}
|
|
27542
|
+
var CLAUDE_MODES = {
|
|
27543
|
+
default: "Default",
|
|
27544
|
+
acceptEdits: "Accept edits",
|
|
27545
|
+
plan: "Plan",
|
|
27546
|
+
bypassPermissions: "Bypass permissions",
|
|
27547
|
+
dontAsk: "Don't ask",
|
|
27548
|
+
auto: "Auto"
|
|
27549
|
+
};
|
|
27550
|
+
function claudeModeName(mode) {
|
|
27551
|
+
return CLAUDE_MODES[mode] ?? mode;
|
|
27552
|
+
}
|
|
27553
|
+
function tilde(path, home = homedir6()) {
|
|
27554
|
+
return path === home ? "~" : path.startsWith(`${home}/`) ? `~${path.slice(home.length)}` : path;
|
|
27555
|
+
}
|
|
27556
|
+
function claudeOwnRules(options) {
|
|
27557
|
+
const home = options.home ?? homedir6();
|
|
27558
|
+
const layers = [...options.user === void 0 ? [] : [options.user], ...options.folders.map((each) => each.layer)];
|
|
27559
|
+
const userPlace = tilde(options.userPath, home);
|
|
27560
|
+
const read_from = [userPlace, ...options.folders.map((each) => tilde(each.path, home))].slice(0, MOST_PLACES);
|
|
27561
|
+
const own2 = ownDefaultMode(options.user);
|
|
27562
|
+
const notes = [
|
|
27563
|
+
"Your own Claude Code reads the same file, so a change there changes both.",
|
|
27564
|
+
own2 !== void 0 && own2 !== options.mode ? `Your own Claude Code runs in ${claudeModeName(own2)} mode; Chips puts each session in ${claudeModeName(options.mode)}.` : void 0
|
|
27565
|
+
].filter((note) => note !== void 0);
|
|
27566
|
+
const ask_line = {
|
|
27567
|
+
entry: '"Bash({words}:*)"',
|
|
27568
|
+
line: '"ask": [{entries}]',
|
|
27569
|
+
where: `\`permissions\` in \`${userPlace}\``
|
|
27570
|
+
};
|
|
27571
|
+
if (options.mode === "bypassPermissions") {
|
|
27572
|
+
return { read_from, note: notes.join(" "), mode: claudeModeName(options.mode), everything: true, runs: [] };
|
|
27573
|
+
}
|
|
27574
|
+
const allowed = joined(layers, "allow");
|
|
27575
|
+
const edits = options.mode === "acceptEdits" ? ["Edit", "Write", "MultiEdit"].filter((name) => !allowed.some((entry) => entry.name === name)).map((name) => ({ kind: "write", name, raw: "acceptEdits" })) : [];
|
|
27576
|
+
return {
|
|
27577
|
+
read_from,
|
|
27578
|
+
note: notes.join(" "),
|
|
27579
|
+
mode: claudeModeName(options.mode),
|
|
27580
|
+
runs: [...allowed, ...edits].slice(0, MOST),
|
|
27581
|
+
asks: joined(layers, "ask"),
|
|
27582
|
+
refuses: joined(layers, "deny"),
|
|
27583
|
+
ask_line
|
|
27584
|
+
};
|
|
27585
|
+
}
|
|
27586
|
+
var CODEX_MODES = {
|
|
27587
|
+
"read-only": "Read only",
|
|
27588
|
+
"workspace-write": "Workspace write",
|
|
27589
|
+
auto: "Auto",
|
|
27590
|
+
"full-access": "Full access",
|
|
27591
|
+
"danger-full-access": "Full access"
|
|
27592
|
+
};
|
|
27593
|
+
function codexOwnRules(mode) {
|
|
27594
|
+
const read_from = ["the mode Chips starts each Codex session in"];
|
|
27595
|
+
const name = CODEX_MODES[mode] ?? mode;
|
|
27596
|
+
if (mode === "full-access" || mode === "danger-full-access") {
|
|
27597
|
+
return {
|
|
27598
|
+
read_from,
|
|
27599
|
+
mode: name,
|
|
27600
|
+
everything: true,
|
|
27601
|
+
note: "Codex runs with full access, so it never asks.",
|
|
27602
|
+
runs: []
|
|
27603
|
+
};
|
|
27604
|
+
}
|
|
27605
|
+
if (mode === "read-only") {
|
|
27606
|
+
return {
|
|
27607
|
+
read_from,
|
|
27608
|
+
mode: name,
|
|
27609
|
+
note: "Codex reads on its own and asks before it changes a file or runs anything else.",
|
|
27610
|
+
runs: []
|
|
27611
|
+
};
|
|
27612
|
+
}
|
|
27613
|
+
return {
|
|
27614
|
+
read_from,
|
|
27615
|
+
mode: name,
|
|
27616
|
+
note: "Codex edits files and runs commands inside the agent's folder in its own sandbox, and asks before the network or anything outside that folder.",
|
|
27617
|
+
runs: []
|
|
27618
|
+
};
|
|
27619
|
+
}
|
|
27620
|
+
async function sendOwnRules(settings, copy) {
|
|
27621
|
+
const send = settings?.ownRules;
|
|
27622
|
+
if (typeof send !== "function") return false;
|
|
27623
|
+
try {
|
|
27624
|
+
await send.call(settings, copy);
|
|
27625
|
+
return true;
|
|
27626
|
+
} catch {
|
|
27627
|
+
return false;
|
|
27628
|
+
}
|
|
27629
|
+
}
|
|
27630
|
+
|
|
27408
27631
|
// src/models.ts
|
|
27409
27632
|
var SETTINGS_LEVEL = "default";
|
|
27410
27633
|
var LEVEL_WORDS = { xhigh: "Extra high" };
|
|
@@ -27615,7 +27838,7 @@ var Bridge = class {
|
|
|
27615
27838
|
this.knew = resolve5;
|
|
27616
27839
|
});
|
|
27617
27840
|
this.env = options.env ?? adapterEnv(options.kind, { ...process.env, ...options.kind.env });
|
|
27618
|
-
this.places = placesOf2(this.env, options.home ??
|
|
27841
|
+
this.places = placesOf2(this.env, options.home ?? homedir7());
|
|
27619
27842
|
this.knownKind = knownIdOf(options.kind);
|
|
27620
27843
|
this.files = this.knownKind === void 0 ? void 0 : new ContextFiles(this.knownKind, options.kind, this.places, codexDocBytes(this.env));
|
|
27621
27844
|
}
|
|
@@ -27680,6 +27903,7 @@ var Bridge = class {
|
|
|
27680
27903
|
await this.know(await chips2.agents.list(), { forget: true });
|
|
27681
27904
|
this.knew();
|
|
27682
27905
|
await this.sendContexts();
|
|
27906
|
+
await this.sendOwnRules();
|
|
27683
27907
|
for (const record2 of this.records()) await this.sendWindow(record2);
|
|
27684
27908
|
await this.sendModels();
|
|
27685
27909
|
await this.run();
|
|
@@ -28317,14 +28541,14 @@ var Bridge = class {
|
|
|
28317
28541
|
project
|
|
28318
28542
|
};
|
|
28319
28543
|
const rules = rulesFor(message, asked);
|
|
28320
|
-
const
|
|
28544
|
+
const joined3 = `${speakerId ?? record2.agentId}|${spaceId}`;
|
|
28321
28545
|
let words4 = promptFor(message, {
|
|
28322
28546
|
...asked,
|
|
28323
28547
|
rulesHeld: this.rules.holds(sessionId, rules),
|
|
28324
28548
|
earlier,
|
|
28325
28549
|
since,
|
|
28326
28550
|
answered: room.answered,
|
|
28327
|
-
before: this.caughtUp.get(
|
|
28551
|
+
before: this.caughtUp.get(joined3),
|
|
28328
28552
|
heldPost: room.heldPost
|
|
28329
28553
|
});
|
|
28330
28554
|
const files = [];
|
|
@@ -28352,7 +28576,7 @@ ${files.join("\n")}`;
|
|
|
28352
28576
|
turn.prompting = false;
|
|
28353
28577
|
if (prompt === words4) {
|
|
28354
28578
|
keepAnswered(room.answered, [...earlier, message]);
|
|
28355
|
-
this.caughtUp.delete(
|
|
28579
|
+
this.caughtUp.delete(joined3);
|
|
28356
28580
|
room.heldPost = void 0;
|
|
28357
28581
|
}
|
|
28358
28582
|
if (turn.cancelled) return;
|
|
@@ -28679,8 +28903,8 @@ ${files.join("\n")}`;
|
|
|
28679
28903
|
}).catch(() => void 0);
|
|
28680
28904
|
}
|
|
28681
28905
|
async planned(turn, update) {
|
|
28682
|
-
const
|
|
28683
|
-
const steps =
|
|
28906
|
+
const entries2 = Array.isArray(update["entries"]) ? update["entries"] : [];
|
|
28907
|
+
const steps = entries2.filter((entry) => entry["status"] !== "completed").slice(0, 20).map((entry, index) => ({ stepId: `plan-${index + 1}`, title: String(entry["content"] ?? "").slice(0, 300) })).filter((step) => step.title !== "");
|
|
28684
28908
|
if (steps.length > 0) await turn.run.plan(steps).catch(() => void 0);
|
|
28685
28909
|
}
|
|
28686
28910
|
// ------------------------------------------------------------------ what the agents read (Chips ADRs 0134, 0238)
|
|
@@ -28691,8 +28915,36 @@ ${files.join("\n")}`;
|
|
|
28691
28915
|
/** The agents came or went: the copies sent again where they changed (Chips takes the same copy once). */
|
|
28692
28916
|
agentsChanged() {
|
|
28693
28917
|
if (this.files !== void 0) void this.sendContexts();
|
|
28918
|
+
void this.sendOwnRules();
|
|
28694
28919
|
void this.sendModels();
|
|
28695
28920
|
}
|
|
28921
|
+
/**
|
|
28922
|
+
* What its own settings let through without asking (Chips ADR 0299), read again with the agents'
|
|
28923
|
+
* folders: Claude Code's lists, Codex's mode. Chips takes the same copy once; an older Chips, or
|
|
28924
|
+
* an SDK before 1.0.10, takes none, and nothing else changes.
|
|
28925
|
+
*/
|
|
28926
|
+
async sendOwnRules() {
|
|
28927
|
+
const copy = this.ownRules();
|
|
28928
|
+
if (copy !== void 0) await sendOwnRules(this.options.chips.settings, copy);
|
|
28929
|
+
}
|
|
28930
|
+
ownRules() {
|
|
28931
|
+
if (this.knownKind === "codex") return codexOwnRules(this.options.kind.mode ?? "workspace-write");
|
|
28932
|
+
if (this.knownKind !== "claude-code") return void 0;
|
|
28933
|
+
const userPath = join10(this.places.claudeHome, "settings.json");
|
|
28934
|
+
const folders = [...new Set(this.records().map((record2) => record2.folder))].flatMap(
|
|
28935
|
+
(folder2) => [join10(folder2, ".claude", "settings.json"), join10(folder2, ".claude", "settings.local.json")].flatMap((path) => {
|
|
28936
|
+
const layer = readLayer(path);
|
|
28937
|
+
return layer === void 0 ? [] : [{ path, layer }];
|
|
28938
|
+
})
|
|
28939
|
+
);
|
|
28940
|
+
return claudeOwnRules({
|
|
28941
|
+
userPath,
|
|
28942
|
+
user: readLayer(userPath),
|
|
28943
|
+
folders,
|
|
28944
|
+
mode: this.options.kind.mode ?? "default",
|
|
28945
|
+
home: this.places.home
|
|
28946
|
+
});
|
|
28947
|
+
}
|
|
28696
28948
|
/** The harness's own set and each agent's files, as they are on disk now. */
|
|
28697
28949
|
async sendContexts() {
|
|
28698
28950
|
const files = this.files;
|
|
@@ -29350,17 +29602,17 @@ function questionFor(title2, input2) {
|
|
|
29350
29602
|
const fields = typeof input2 === "object" && input2 !== null ? input2 : {};
|
|
29351
29603
|
const said = oneLine(fields["description"])?.replace(/[\s.?!:;,]+$/, "");
|
|
29352
29604
|
if (said === void 0 || said === "") return `Allow it to ${lowerFirst(title2)}?`.slice(0, QUESTION_MAX);
|
|
29353
|
-
const asked = `${
|
|
29605
|
+
const asked = `${clip2(said, QUESTION_MAX - 1)}?`;
|
|
29354
29606
|
const command = oneLine(Array.isArray(fields["command"]) ? fields["command"].join(" ") : fields["command"]);
|
|
29355
29607
|
const room = QUESTION_MAX - asked.length - 3;
|
|
29356
29608
|
if (command === void 0 || command.includes("`") || room < 12) return asked;
|
|
29357
|
-
return `${asked} \`${
|
|
29609
|
+
return `${asked} \`${clip2(command, room)}\``;
|
|
29358
29610
|
}
|
|
29359
29611
|
function oneLine(value) {
|
|
29360
29612
|
const line = typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "";
|
|
29361
29613
|
return line === "" ? void 0 : line;
|
|
29362
29614
|
}
|
|
29363
|
-
function
|
|
29615
|
+
function clip2(text, max) {
|
|
29364
29616
|
return text.length <= max ? text : `${text.slice(0, max - 1)}\u2026`;
|
|
29365
29617
|
}
|
|
29366
29618
|
function riskOf(kind2) {
|
|
@@ -29371,7 +29623,10 @@ function riskOf(kind2) {
|
|
|
29371
29623
|
function optionFor(decision, options, command) {
|
|
29372
29624
|
const find = (kind2) => options.find((option) => option.kind === kind2)?.optionId;
|
|
29373
29625
|
if (!decision.allowed) return find("reject_once") ?? find("reject_always");
|
|
29374
|
-
|
|
29626
|
+
const harnessKeeps = decision.keeps === "harness";
|
|
29627
|
+
if (decision.scope === "always" && (!command || harnessKeeps)) {
|
|
29628
|
+
return find("allow_always") ?? find("allow_once");
|
|
29629
|
+
}
|
|
29375
29630
|
return find("allow_once") ?? find("allow_always");
|
|
29376
29631
|
}
|
|
29377
29632
|
function carriesCommand(input2) {
|
|
@@ -29458,7 +29713,7 @@ function keepIfAsked(label2, url2, names, log2, before = () => void 0) {
|
|
|
29458
29713
|
|
|
29459
29714
|
// src/move.ts
|
|
29460
29715
|
import { lstatSync, mkdirSync as mkdirSync5, readdirSync as readdirSync2, readFileSync as readFileSync9, renameSync as renameSync2, rmdirSync, writeFileSync as writeFileSync4 } from "node:fs";
|
|
29461
|
-
import { homedir as
|
|
29716
|
+
import { homedir as homedir8 } from "node:os";
|
|
29462
29717
|
import { basename as basename5, dirname as dirname6, join as join11, resolve as resolve4 } from "node:path";
|
|
29463
29718
|
var there = (path) => {
|
|
29464
29719
|
try {
|
|
@@ -29470,7 +29725,7 @@ var there = (path) => {
|
|
|
29470
29725
|
};
|
|
29471
29726
|
var isFolder = (path) => lstatSync(path).isDirectory();
|
|
29472
29727
|
var shown = (path, home) => path.startsWith(`${home}/`) ? `~${path.slice(home.length)}` : path;
|
|
29473
|
-
function merge2(from, to, log2, home =
|
|
29728
|
+
function merge2(from, to, log2, home = homedir8(), quiet = false) {
|
|
29474
29729
|
if (!there(from)) return;
|
|
29475
29730
|
try {
|
|
29476
29731
|
if (!there(to)) {
|
|
@@ -29496,7 +29751,7 @@ function removeIfEmpty(path) {
|
|
|
29496
29751
|
} catch {
|
|
29497
29752
|
}
|
|
29498
29753
|
}
|
|
29499
|
-
function claudeStoreOf(folder2, env2, home =
|
|
29754
|
+
function claudeStoreOf(folder2, env2, home = homedir8()) {
|
|
29500
29755
|
const name = folder2.replace(/[^a-zA-Z0-9]/g, "-");
|
|
29501
29756
|
if (name.length > 200) return void 0;
|
|
29502
29757
|
return join11(env2["CLAUDE_CONFIG_DIR"] ? resolve4(fromHome(env2["CLAUDE_CONFIG_DIR"], home)) : join11(home, ".claude"), "projects", name);
|
|
@@ -29521,7 +29776,7 @@ var readJson = (path) => {
|
|
|
29521
29776
|
return void 0;
|
|
29522
29777
|
}
|
|
29523
29778
|
};
|
|
29524
|
-
function moveOld(configPath2, log2, home =
|
|
29779
|
+
function moveOld(configPath2, log2, home = homedir8(), env2 = process.env) {
|
|
29525
29780
|
const places = placesOf(home);
|
|
29526
29781
|
const keptIn = join11(dirname6(configPath2), basename5(configPath2, ".json"));
|
|
29527
29782
|
const name = inside2(places.settings, configPath2);
|
|
@@ -29609,7 +29864,10 @@ if (!handsOver) moveOld(configTargetOf(words3[0]), log);
|
|
|
29609
29864
|
var configPath = configPathOf(words3[0]);
|
|
29610
29865
|
var kind;
|
|
29611
29866
|
try {
|
|
29612
|
-
kind =
|
|
29867
|
+
kind = readConfig(configPath);
|
|
29868
|
+
const makers = link === void 0 ? void 0 : makersFolder(kind);
|
|
29869
|
+
if (makers !== void 0) process.env["PATH"] = pathWithLast(process.env["PATH"], makers);
|
|
29870
|
+
kind = withFetchedAdapter(kind);
|
|
29613
29871
|
mkdirSync6(kind.folder ?? kind.folders, { recursive: true });
|
|
29614
29872
|
if (link !== void 0) {
|
|
29615
29873
|
reportStep("checking", { detail: `Looking for ${kind.name}` });
|
|
@@ -29638,7 +29896,7 @@ var refused2 = (error62) => {
|
|
|
29638
29896
|
`);
|
|
29639
29897
|
process.exit(1);
|
|
29640
29898
|
};
|
|
29641
|
-
var
|
|
29899
|
+
var joined2 = await join3({
|
|
29642
29900
|
link,
|
|
29643
29901
|
url: process.env["CHIPS_URL"],
|
|
29644
29902
|
name: kind.name,
|
|
@@ -29656,7 +29914,7 @@ var joined = await join3({
|
|
|
29656
29914
|
],
|
|
29657
29915
|
onCode: (code) => log(`Allow this harness in Chips: ${code}`)
|
|
29658
29916
|
}).catch(refused2);
|
|
29659
|
-
keepIfAsked(LABEL,
|
|
29917
|
+
keepIfAsked(LABEL, joined2.url, ["ANTHROPIC_API_KEY", "OPENAI_API_KEY", "CODEX_HOME", "CLAUDE_CONFIG_DIR"], log);
|
|
29660
29918
|
var kept = existsSync10(statePath) ? JSON.parse(readFileSync10(statePath, "utf8")) : {};
|
|
29661
29919
|
var state = {
|
|
29662
29920
|
sessions: kept.sessions ?? {},
|
|
@@ -29673,8 +29931,8 @@ var waitingSaid = (why) => {
|
|
|
29673
29931
|
};
|
|
29674
29932
|
var bridge;
|
|
29675
29933
|
var chips = await connect({
|
|
29676
|
-
url:
|
|
29677
|
-
token:
|
|
29934
|
+
url: joined2.url,
|
|
29935
|
+
token: joined2.token,
|
|
29678
29936
|
client: { name: "chips-acp", version: VERSION },
|
|
29679
29937
|
store: fileStore(join12(folder, "chips-state.json")),
|
|
29680
29938
|
// The copy this machine keeps running starts at login, perhaps before its server is up: it waits
|
|
@@ -29708,7 +29966,7 @@ closing.push(() => bridge?.stop());
|
|
|
29708
29966
|
await bridge.start();
|
|
29709
29967
|
started = true;
|
|
29710
29968
|
log(`connected as ${chips.harnessId} (${kind.name}), ${Object.keys(state.agents).length} agent(s)`);
|
|
29711
|
-
await helloOnce(
|
|
29969
|
+
await helloOnce(joined2, {
|
|
29712
29970
|
name: kind.name,
|
|
29713
29971
|
say: (spaceId) => (
|
|
29714
29972
|
// In the shape every bridge's hello has: "Hi, I'm …", then what to do (the onboarding audit, item 39).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipschat/acp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
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": {
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"release": "npm run build && npm test && npm pack"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@chipschat/conformance": "1.0.
|
|
37
|
-
"@chipschat/harness": "1.0.
|
|
38
|
-
"@chipschat/protocol": "1.0.
|
|
36
|
+
"@chipschat/conformance": "1.0.10",
|
|
37
|
+
"@chipschat/harness": "1.0.10",
|
|
38
|
+
"@chipschat/protocol": "1.0.10",
|
|
39
39
|
"@types/node": "22.19.0",
|
|
40
40
|
"esbuild": "0.27.7",
|
|
41
41
|
"tsx": "4.21.0",
|