@chipschat/acp 1.0.10 → 1.0.11
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 +2 -2
- package/dist/THIRD-PARTY-NOTICES.md +3 -3
- package/dist/main.js +160 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@ runs the agent's process, so the bridge is the harness (Chips ADR 0041), built o
|
|
|
8
8
|
Phase 4 of Chips's `docs/proposals/open-source-harnesses-plan.md`, and Chips's
|
|
9
9
|
`docs/proposals/acp-agents-made-from-chips-plan.md`.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
The `@chipschat/*` SDK packages come from npm, at the version `package.json` pins, and the build
|
|
12
|
+
bundles them into `dist/main.js`.
|
|
13
13
|
|
|
14
14
|
## From Chips's gallery
|
|
15
15
|
|
|
@@ -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.11 carries these packages, bundled in. Each one's
|
|
4
4
|
licence follows.
|
|
5
5
|
|
|
6
|
-
## @chipschat/harness
|
|
6
|
+
## @chipschat/harness 1.0.1 (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
|
|
210
|
+
## @chipschat/protocol 1.0.1 (Apache-2.0)
|
|
211
211
|
|
|
212
212
|
Apache License
|
|
213
213
|
Version 2.0, January 2004
|
package/dist/main.js
CHANGED
|
@@ -20354,7 +20354,14 @@ var HARNESS_CAPABILITIES = {
|
|
|
20354
20354
|
* and `context_window.change`, does them in its own way, and answers with its copy. What makes
|
|
20355
20355
|
* an agent's Context window group worth drawing.
|
|
20356
20356
|
*/
|
|
20357
|
-
contextWindows: "context_windows"
|
|
20357
|
+
contextWindows: "context_windows",
|
|
20358
|
+
/**
|
|
20359
|
+
* The harness sends Chips a copy of the jobs it runs on its own, outside any space, and posts
|
|
20360
|
+
* each run with what it cost, and takes a person's switch (ADR 0252): a socket of it says `jobs`
|
|
20361
|
+
* in its `hello`, hears `job.change`, switches the job in its own way, and answers with its
|
|
20362
|
+
* copy. What makes the harness page's "Its own jobs" group worth drawing.
|
|
20363
|
+
*/
|
|
20364
|
+
jobs: "jobs"
|
|
20358
20365
|
};
|
|
20359
20366
|
|
|
20360
20367
|
// node_modules/@chipschat/protocol/dist/src/connectors.js
|
|
@@ -22530,6 +22537,115 @@ var AGENT_FIRST_NAMES = [
|
|
|
22530
22537
|
"Zaid Zane Zeke Zeno Zev Ziggy"
|
|
22531
22538
|
].flatMap((line) => line.split(" "));
|
|
22532
22539
|
|
|
22540
|
+
// node_modules/@chipschat/protocol/dist/src/harness-jobs.js
|
|
22541
|
+
var HARNESS_JOBS_MAX = 24;
|
|
22542
|
+
var JOB_CHOICES_MAX = 12;
|
|
22543
|
+
var JOB_EVERY_MAX = 525600;
|
|
22544
|
+
var JOB_RUNS_POST_MAX = 200;
|
|
22545
|
+
var JOB_KINDS = ["heartbeat", "memory", "skills", "other"];
|
|
22546
|
+
var jobKind = external_exports.enum(JOB_KINDS);
|
|
22547
|
+
var JOB_RUN_OUTCOMES = ["done", "failed", "stopped"];
|
|
22548
|
+
var jobRunOutcome = external_exports.enum(JOB_RUN_OUTCOMES);
|
|
22549
|
+
var jobId = external_exports.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,79}$/, "expected a job id").describe("The harness's own id for a job: stable, up to 80 letters, digits, `.`, `_`, `:` or `-`.");
|
|
22550
|
+
var minutes2 = external_exports.int().min(1).max(JOB_EVERY_MAX);
|
|
22551
|
+
var ascending3 = (choices) => choices.every((each, at) => at === 0 || each > (choices[at - 1] ?? 0));
|
|
22552
|
+
var jobFields = {
|
|
22553
|
+
job_id: jobId,
|
|
22554
|
+
name: external_exports.string().min(1).max(40).describe('What the harness calls it: "Dreaming".'),
|
|
22555
|
+
about: external_exports.string().min(1).max(240).describe("What it does, in a sentence, for its page."),
|
|
22556
|
+
kind: jobKind.describe("What it does, for its mark: `other` for anything else."),
|
|
22557
|
+
every: minutes2.optional().describe("How often it runs, in minutes. Chips says it in words, with `next_at` for the time of day."),
|
|
22558
|
+
when: external_exports.string().min(1).max(60).optional().describe("How often, in the harness's words, for a schedule that is not an interval."),
|
|
22559
|
+
next_at: isoTimestamp.optional().describe("When it runs next, while it is on."),
|
|
22560
|
+
for_agents: external_exports.array(id("agent")).max(200).optional().describe("The harness's agents it runs for, if it runs for some rather than the harness."),
|
|
22561
|
+
on: external_exports.boolean().describe("Whether it runs now."),
|
|
22562
|
+
editable: external_exports.boolean().describe("Whether a person may switch it from Chips."),
|
|
22563
|
+
why_read_only: external_exports.string().min(1).max(120).optional().describe("Why not, in the harness's words, only when it is not `editable`."),
|
|
22564
|
+
choices: external_exports.array(minutes2).min(1).max(JOB_CHOICES_MAX).refine(ascending3, { message: "The intervals go up, each named once." }).optional().describe("The intervals a person may pick, in minutes, shortest first, `every` among them.")
|
|
22565
|
+
};
|
|
22566
|
+
var harnessJob = external_exports.object(jobFields).refine((job) => job.every !== void 0 || job.when !== void 0, {
|
|
22567
|
+
path: ["every"],
|
|
22568
|
+
message: "Say how often it runs: `every` in minutes, or `when` in words."
|
|
22569
|
+
}).refine((job) => job.choices === void 0 || job.choices.includes(job.every ?? -1), {
|
|
22570
|
+
path: ["choices"],
|
|
22571
|
+
message: "`every` is one of `choices`."
|
|
22572
|
+
}).refine((job) => job.why_read_only === void 0 || !job.editable, {
|
|
22573
|
+
path: ["why_read_only"],
|
|
22574
|
+
message: "Say why only for a job that can't be switched."
|
|
22575
|
+
});
|
|
22576
|
+
var uniqueJobs = (jobs) => new Set(jobs.map((job) => job.job_id)).size === jobs.length;
|
|
22577
|
+
var harnessJobsPut = external_exports.object({
|
|
22578
|
+
jobs: external_exports.array(harnessJob).max(HARNESS_JOBS_MAX).refine(uniqueJobs, { message: "Each job is named once." }).describe("Every job the harness runs on its own, whole: one left out is gone, runs and all."),
|
|
22579
|
+
answers: id("change").optional().describe("The change this copy answers: made, and these are the jobs as they are now."),
|
|
22580
|
+
refuses: external_exports.object({
|
|
22581
|
+
change_id: id("change"),
|
|
22582
|
+
message: external_exports.string().min(1).max(300).optional().describe("Why not, for the person.")
|
|
22583
|
+
}).optional().describe("A change not made. The copy beside it is the jobs as they are now.")
|
|
22584
|
+
}).describe("`PUT /v1/harnesses/:id/jobs`: a harness's copy of the jobs it runs on its own.");
|
|
22585
|
+
var jobRun = external_exports.object({
|
|
22586
|
+
job_id: jobId,
|
|
22587
|
+
run_id: external_exports.string().min(1).max(160).describe("The harness's own id for the run."),
|
|
22588
|
+
started_at: isoTimestamp,
|
|
22589
|
+
ended_at: isoTimestamp,
|
|
22590
|
+
outcome: jobRunOutcome.describe("`done`, `failed`, or `stopped` when something else ended it, such as a restart."),
|
|
22591
|
+
quiet: external_exports.boolean().optional().describe("It did its work and had nothing to say: a heartbeat with nothing for anyone."),
|
|
22592
|
+
waited: external_exports.boolean().optional().describe("It waited for an approval that nobody gave."),
|
|
22593
|
+
error: external_exports.string().min(1).max(200).optional().describe("What went wrong, in the harness's words, for a run that failed or was stopped."),
|
|
22594
|
+
agent_id: id("agent").optional().describe("The agent it ran for, when it runs for some."),
|
|
22595
|
+
cost_usd: external_exports.number().min(0).max(1e4).optional().describe("What it cost, as the harness priced it: absent when the harness doesn't know."),
|
|
22596
|
+
tokens: external_exports.int().min(0).optional().describe("Its tokens, in and out."),
|
|
22597
|
+
model: external_exports.string().min(1).max(80).optional().describe("The model it ran on, in its words.")
|
|
22598
|
+
}).refine((run2) => Date.parse(run2.ended_at) >= Date.parse(run2.started_at), {
|
|
22599
|
+
path: ["ended_at"],
|
|
22600
|
+
message: "A run ends after it starts."
|
|
22601
|
+
}).describe("One run of a job, once it ended.");
|
|
22602
|
+
var jobRunsPost = external_exports.object({ runs: external_exports.array(jobRun).min(1).max(JOB_RUNS_POST_MAX) }).describe("`POST /v1/harnesses/:id/jobs/runs`: runs the harness finished. A run posted again says what it says over what was posted before, and what it leaves out stays: so a run may be posted once more with its cost, and never loses one.");
|
|
22603
|
+
var jobChangeAsk = external_exports.object({
|
|
22604
|
+
on: external_exports.boolean(),
|
|
22605
|
+
every: minutes2.optional().describe("One of the job's choices; its own when left out.")
|
|
22606
|
+
}).describe("`POST /v1/harnesses/:id/jobs/:job/changes`: on or off, and how often.");
|
|
22607
|
+
var JOB_CHANGE_STATES = ["waiting", "saved", "failed", "missed"];
|
|
22608
|
+
var jobChangeState = external_exports.enum(JOB_CHANGE_STATES);
|
|
22609
|
+
var jobChangeView = external_exports.object({
|
|
22610
|
+
change_id: id("change"),
|
|
22611
|
+
state: jobChangeState.describe("`missed` once `JOB_CHANGE_WAIT_MS` has passed with no answer; read, never stored."),
|
|
22612
|
+
on: external_exports.boolean(),
|
|
22613
|
+
every: minutes2.optional(),
|
|
22614
|
+
asked_at: isoTimestamp,
|
|
22615
|
+
answered_at: isoTimestamp.optional(),
|
|
22616
|
+
message: external_exports.string().max(300).optional().describe("The harness's words, for a refusal.")
|
|
22617
|
+
}).describe("The last change a person asked of a job, and what became of it (ADR 0252).");
|
|
22618
|
+
var harnessJobView = external_exports.object({
|
|
22619
|
+
...jobFields,
|
|
22620
|
+
week_usd: external_exports.number().min(0).optional().describe("What its runs of the last seven days cost: absent when none of them had a cost."),
|
|
22621
|
+
week_runs: external_exports.int().min(0).describe("How many runs it made in the last seven days."),
|
|
22622
|
+
runs_total: external_exports.int().min(0).describe("How many of its runs Chips holds."),
|
|
22623
|
+
last_run: jobRun.optional(),
|
|
22624
|
+
change: jobChangeView.optional()
|
|
22625
|
+
}).describe("One job as a person reads it: the harness's copy, what Chips counted, its change.");
|
|
22626
|
+
var harnessJobsView = external_exports.object({
|
|
22627
|
+
harness_id: id("harness"),
|
|
22628
|
+
jobs: external_exports.array(harnessJobView),
|
|
22629
|
+
read_at: isoTimestamp.describe("When the harness last sent its copy."),
|
|
22630
|
+
away: external_exports.boolean().describe("No socket of the harness hears changes now: read, not switched.")
|
|
22631
|
+
}).describe("`GET /v1/harnesses/:id/jobs`, for the harness's owner or an admin.");
|
|
22632
|
+
var jobRunsView = external_exports.object({
|
|
22633
|
+
harness_id: id("harness"),
|
|
22634
|
+
job_id: jobId,
|
|
22635
|
+
runs: external_exports.array(jobRun).describe("Newest first."),
|
|
22636
|
+
more: external_exports.boolean().describe("Whether older runs are left, for `before` the last one's start.")
|
|
22637
|
+
}).describe("`GET /v1/harnesses/:id/jobs/:job/runs?since=&before=&limit=`.");
|
|
22638
|
+
var jobChangeFrame = external_exports.object({
|
|
22639
|
+
frame: external_exports.literal("job.change"),
|
|
22640
|
+
change_id: id("change"),
|
|
22641
|
+
harness_id: id("harness"),
|
|
22642
|
+
job_id: jobId,
|
|
22643
|
+
on: external_exports.boolean(),
|
|
22644
|
+
every: minutes2.optional().describe("For a job with choices: one of them, the copy's own when the person named none."),
|
|
22645
|
+
asked_by: id("person"),
|
|
22646
|
+
asked_at: isoTimestamp
|
|
22647
|
+
}).describe("A person switched one of a harness's own jobs, or changed how often it runs (ADR 0252). Sent to a harness's socket that said `jobs` in its `hello`, now or never: it is not in the log. The harness answers with its copy of all its jobs, `answers` or `refuses` naming `change_id`.");
|
|
22648
|
+
|
|
22533
22649
|
// node_modules/@chipschat/protocol/dist/src/frames.js
|
|
22534
22650
|
var clientHelloFrame = external_exports.object({
|
|
22535
22651
|
frame: external_exports.literal("hello"),
|
|
@@ -22546,7 +22662,7 @@ var clientHelloFrame = external_exports.object({
|
|
|
22546
22662
|
autonomy: autonomyLevel.optional().describe("The level the harness believes it has.")
|
|
22547
22663
|
})).max(64).optional().describe("Not read by Chips: a connection is its token's, and the server's `hello` names the token's harness and its agents (ADR 0087). Absent for a person's client."),
|
|
22548
22664
|
since: external_exports.int().nonnegative().optional().describe("Not read by Chips: a stream resumes from `subscribe`'s `since`."),
|
|
22549
|
-
accepts: external_exports.array(external_exports.string().min(1).max(40)).max(32).optional().describe("Server frames beyond the base set this client understands, by the names in `SERVER_EXTENSIONS`. A name the server does not know is ignored rather than refused, so a client may name a frame a newer server sends and still be answered by an older one (ADR 0211, Phase 3). A client that says `events` is sent its replay in pages rather than one frame per event; one that says `presence` is sent an agent's state as it changes (ADR 0083); a harness's socket that says `restart` is sent `restart` when a person asks it to restart (ADR 0094); an owner's or admin's that says `join` is sent each join request as it changes (ADR 0122); a harness's that says `context` is sent `context.edit` when a person changes one of its context files (ADR 0134); a harness's that says `models` is sent `model.change` when a person changes an agent's model or effort (ADR 0140); a harness's that says `heartbeats` is sent `heartbeat.change` when a person switches an agent's heartbeat or changes how often it beats (ADR 0143); a harness's that says `context_windows` is sent `context_window.compact` and `context_window.change` when a person asks an agent to compact now or changes the limit it compacts itself at (ADR 0146); a person's that says `folders` is sent `folder.open` when they ask, from another of their devices, for a room's folder to be opened in Finder (ADR 0225), and `folder.run` when they ask for its project to be run or stopped there (ADR 0226); a person's that says `folder_runs` is sent `folder.run_state` when their Mac says how a run of theirs stands (ADR 0226); one that says nothing is sent what it was always sent, since an unknown frame is dropped in silence."),
|
|
22665
|
+
accepts: external_exports.array(external_exports.string().min(1).max(40)).max(32).optional().describe("Server frames beyond the base set this client understands, by the names in `SERVER_EXTENSIONS`. A name the server does not know is ignored rather than refused, so a client may name a frame a newer server sends and still be answered by an older one (ADR 0211, Phase 3). A client that says `events` is sent its replay in pages rather than one frame per event; one that says `presence` is sent an agent's state as it changes (ADR 0083); a harness's socket that says `restart` is sent `restart` when a person asks it to restart (ADR 0094); an owner's or admin's that says `join` is sent each join request as it changes (ADR 0122); a harness's that says `context` is sent `context.edit` when a person changes one of its context files (ADR 0134); a harness's that says `models` is sent `model.change` when a person changes an agent's model or effort (ADR 0140); a harness's that says `heartbeats` is sent `heartbeat.change` when a person switches an agent's heartbeat or changes how often it beats (ADR 0143); a harness's that says `context_windows` is sent `context_window.compact` and `context_window.change` when a person asks an agent to compact now or changes the limit it compacts itself at (ADR 0146); a harness's that says `jobs` is sent `job.change` when a person switches one of the jobs it runs on its own (ADR 0252); a person's that says `folders` is sent `folder.open` when they ask, from another of their devices, for a room's folder to be opened in Finder (ADR 0225), and `folder.run` when they ask for its project to be run or stopped there (ADR 0226); a person's that says `folder_runs` is sent `folder.run_state` when their Mac says how a run of theirs stands (ADR 0226); one that says nothing is sent what it was always sent, since an unknown frame is dropped in silence."),
|
|
22550
22666
|
context: contextBudget.optional().describe("How much of a room a harness is handed with each message for it (ADR 0088): 40 lines and 16,000 characters when absent, 200 and 32,000 at most. For this connection. A person's client is handed none.")
|
|
22551
22667
|
}).describe("The first frame a client sends.");
|
|
22552
22668
|
var subscribeFrame = external_exports.object({
|
|
@@ -22677,6 +22793,7 @@ var serverFrame = external_exports.discriminatedUnion("frame", [
|
|
|
22677
22793
|
heartbeatChangeFrame,
|
|
22678
22794
|
windowCompactFrame,
|
|
22679
22795
|
windowChangeFrame,
|
|
22796
|
+
jobChangeFrame,
|
|
22680
22797
|
pingFrame,
|
|
22681
22798
|
pongFrame,
|
|
22682
22799
|
errorFrame
|
|
@@ -23804,6 +23921,14 @@ var Run = class {
|
|
|
23804
23921
|
...cost2(input2.costUsd)
|
|
23805
23922
|
});
|
|
23806
23923
|
}
|
|
23924
|
+
/**
|
|
23925
|
+
* That this turn heard a message said in the room while it worked (ADR 0106): one that
|
|
23926
|
+
* `message.overheard` named this run for in `working_turns`, handed to the turn at a step. The
|
|
23927
|
+
* room shows its agent heard it while working. Say it once the turn has the words, never before.
|
|
23928
|
+
*/
|
|
23929
|
+
heard(messageId) {
|
|
23930
|
+
return this.wire.send("message.heard", { message_id: messageId });
|
|
23931
|
+
}
|
|
23807
23932
|
checkpoint(label2, next, compacted) {
|
|
23808
23933
|
return this.wire.send("checkpoint", {
|
|
23809
23934
|
label: label2,
|
|
@@ -23853,7 +23978,8 @@ function acceptsFor(handlers) {
|
|
|
23853
23978
|
...handlers.context === void 0 ? [] : ["context"],
|
|
23854
23979
|
...handlers.models === void 0 ? [] : ["models"],
|
|
23855
23980
|
...handlers.heartbeats === void 0 ? [] : ["heartbeats"],
|
|
23856
|
-
...handlers.contextWindows === void 0 ? [] : ["context_windows"]
|
|
23981
|
+
...handlers.contextWindows === void 0 ? [] : ["context_windows"],
|
|
23982
|
+
...handlers.jobs === void 0 ? [] : ["jobs"]
|
|
23857
23983
|
];
|
|
23858
23984
|
}
|
|
23859
23985
|
var PATHS = {
|
|
@@ -23861,28 +23987,32 @@ var PATHS = {
|
|
|
23861
23987
|
"harness-context": (id2) => `/v1/harnesses/${encodeURIComponent(id2)}/context`,
|
|
23862
23988
|
model: (id2) => `/v1/agents/${encodeURIComponent(id2)}/model`,
|
|
23863
23989
|
heartbeat: (id2) => `/v1/agents/${encodeURIComponent(id2)}/heartbeat`,
|
|
23864
|
-
"context-window": (id2) => `/v1/agents/${encodeURIComponent(id2)}/context-window
|
|
23990
|
+
"context-window": (id2) => `/v1/agents/${encodeURIComponent(id2)}/context-window`,
|
|
23991
|
+
jobs: (id2) => `/v1/harnesses/${encodeURIComponent(id2)}/jobs`
|
|
23865
23992
|
};
|
|
23866
23993
|
var FRAMES = {
|
|
23867
23994
|
"context.edit": contextEditFrame,
|
|
23868
23995
|
"model.change": modelChangeFrame,
|
|
23869
23996
|
"heartbeat.change": heartbeatChangeFrame,
|
|
23870
23997
|
"context_window.compact": windowCompactFrame,
|
|
23871
|
-
"context_window.change": windowChangeFrame
|
|
23998
|
+
"context_window.change": windowChangeFrame,
|
|
23999
|
+
"job.change": jobChangeFrame
|
|
23872
24000
|
};
|
|
23873
24001
|
var Settings = class {
|
|
23874
24002
|
put;
|
|
23875
24003
|
harnessId;
|
|
23876
24004
|
handlers;
|
|
24005
|
+
post;
|
|
23877
24006
|
/** The copy last given for each `kind:id`, for a refusal to carry. */
|
|
23878
24007
|
sent = /* @__PURE__ */ new Map();
|
|
23879
24008
|
/** The copy Chips last took for each `kind:id`, as JSON. */
|
|
23880
24009
|
landed = /* @__PURE__ */ new Map();
|
|
23881
24010
|
chains = /* @__PURE__ */ new Map();
|
|
23882
|
-
constructor(put, harnessId, handlers) {
|
|
24011
|
+
constructor(put, harnessId, handlers, post) {
|
|
23883
24012
|
this.put = put;
|
|
23884
24013
|
this.harnessId = harnessId;
|
|
23885
24014
|
this.handlers = handlers;
|
|
24015
|
+
this.post = post;
|
|
23886
24016
|
}
|
|
23887
24017
|
/** An agent's context files (`context_files`). */
|
|
23888
24018
|
context(agentId2, copy) {
|
|
@@ -23904,6 +24034,24 @@ var Settings = class {
|
|
|
23904
24034
|
contextWindow(agentId2, copy) {
|
|
23905
24035
|
return this.send("context-window", agentId2, copy, {});
|
|
23906
24036
|
}
|
|
24037
|
+
/** The jobs the harness runs on its own, all of them (`jobs`). */
|
|
24038
|
+
jobs(copy) {
|
|
24039
|
+
return this.send("jobs", this.harnessId(), copy, {});
|
|
24040
|
+
}
|
|
24041
|
+
/**
|
|
24042
|
+
* Runs of its jobs the harness finished (`jobs`), two hundred to a post. A run sent again says
|
|
24043
|
+
* what it says over the one before, and what it leaves out stays, so send it once more when its
|
|
24044
|
+
* cost is known, and again without one does no harm. Send the copy first:
|
|
24045
|
+
* Chips refuses runs of a job its copy doesn't list.
|
|
24046
|
+
*/
|
|
24047
|
+
async jobRuns(runs) {
|
|
24048
|
+
if (this.post === void 0)
|
|
24049
|
+
throw new Error("This connection can't post a job's runs.");
|
|
24050
|
+
const path = `${PATHS.jobs(this.harnessId())}/runs`;
|
|
24051
|
+
for (let at = 0; at < runs.length; at += JOB_RUNS_POST_MAX) {
|
|
24052
|
+
await this.post(path, { runs: runs.slice(at, at + JOB_RUNS_POST_MAX) });
|
|
24053
|
+
}
|
|
24054
|
+
}
|
|
23907
24055
|
/** An agent deleted: nothing is remembered of it, so a copy for an agent made again is sent. */
|
|
23908
24056
|
forget(agentId2) {
|
|
23909
24057
|
for (const kind2 of Object.keys(PATHS)) {
|
|
@@ -23951,6 +24099,8 @@ var Settings = class {
|
|
|
23951
24099
|
return this.answer("model", frame.agent_id, frame.change_id, "change_id", () => handlers?.models?.(frame));
|
|
23952
24100
|
case "heartbeat.change":
|
|
23953
24101
|
return this.answer("heartbeat", frame.agent_id, frame.change_id, "change_id", () => handlers?.heartbeats?.(frame));
|
|
24102
|
+
case "job.change":
|
|
24103
|
+
return this.answer("jobs", this.harnessId(), frame.change_id, "change_id", () => handlers?.jobs?.(frame));
|
|
23954
24104
|
case "context_window.compact":
|
|
23955
24105
|
return this.answer("context-window", frame.agent_id, frame.change_id, "change_id", () => handlers?.contextWindows?.compact(frame));
|
|
23956
24106
|
default:
|
|
@@ -24066,7 +24216,7 @@ var Chips = class _Chips {
|
|
|
24066
24216
|
this.outbox.add(String(event["idempotency_key"]), event).catch(() => void 0);
|
|
24067
24217
|
}
|
|
24068
24218
|
this.orphans = [...kept2?.runs ?? []];
|
|
24069
|
-
this.settings = new Settings((path, body) => this.request("PUT", path, body), () => this.harnessId, options.settings);
|
|
24219
|
+
this.settings = new Settings((path, body) => this.request("PUT", path, body), () => this.harnessId, options.settings, (path, body) => this.request("POST", path, body));
|
|
24070
24220
|
}
|
|
24071
24221
|
/**
|
|
24072
24222
|
* The harness's copies of what a person changes from an agent's page (ADRs 0134, 0140, 0143,
|
|
@@ -26410,7 +26560,7 @@ var HEADROOM = 33e3;
|
|
|
26410
26560
|
var LEAST_WINDOW = 1e5;
|
|
26411
26561
|
var COMPACT_TITLE = "Compact conversation";
|
|
26412
26562
|
var CODEX_COMPACTED = "*Context compacted to fit the model's context window.*";
|
|
26413
|
-
var
|
|
26563
|
+
var ascending4 = (values) => [...new Set(values)].sort((a, b) => a - b);
|
|
26414
26564
|
function percentOf(tokens2, window) {
|
|
26415
26565
|
const at = Math.round((Math.min(tokens2, window) - HEADROOM) / window * 100);
|
|
26416
26566
|
return Math.min(99, Math.max(1, at));
|
|
@@ -26437,7 +26587,7 @@ function claudeLimit(kept2, own2) {
|
|
|
26437
26587
|
};
|
|
26438
26588
|
}
|
|
26439
26589
|
const at = kept2.limit !== void 0 ? kept2.limit : own2.at;
|
|
26440
|
-
const choices =
|
|
26590
|
+
const choices = ascending4([
|
|
26441
26591
|
...LIMITS.filter((each) => reachable(each, kept2.window)),
|
|
26442
26592
|
...own2.at === null ? [] : [own2.at],
|
|
26443
26593
|
...typeof at === "number" ? [at] : []
|
|
@@ -26448,7 +26598,7 @@ function claudeLimit(kept2, own2) {
|
|
|
26448
26598
|
function bridgeLimit(kept2) {
|
|
26449
26599
|
const at = kept2.limit ?? null;
|
|
26450
26600
|
return {
|
|
26451
|
-
limit: { at, choices:
|
|
26601
|
+
limit: { at, choices: ascending4([...LIMITS, ...typeof at === "number" ? [at] : []]), default: null, may_turn_off: true },
|
|
26452
26602
|
editable: true
|
|
26453
26603
|
};
|
|
26454
26604
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipschat/acp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
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": "
|
|
37
|
-
"@chipschat/harness": "
|
|
38
|
-
"@chipschat/protocol": "
|
|
36
|
+
"@chipschat/conformance": "1.0.1",
|
|
37
|
+
"@chipschat/harness": "1.0.1",
|
|
38
|
+
"@chipschat/protocol": "1.0.1",
|
|
39
39
|
"@types/node": "22.19.0",
|
|
40
40
|
"esbuild": "0.27.7",
|
|
41
41
|
"tsx": "4.21.0",
|