@chipschat/protocol 0.0.0-stage → 1.0.1
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/LICENSE +201 -0
- package/README.md +56 -2
- package/dist/generated/types.d.ts +4052 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +7 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/src/address.d.ts +106 -0
- package/dist/src/address.d.ts.map +1 -0
- package/dist/src/address.js +141 -0
- package/dist/src/address.js.map +1 -0
- package/dist/src/agent-context-windows.d.ts +235 -0
- package/dist/src/agent-context-windows.d.ts.map +1 -0
- package/dist/src/agent-context-windows.js +213 -0
- package/dist/src/agent-context-windows.js.map +1 -0
- package/dist/src/agent-heartbeats.d.ts +106 -0
- package/dist/src/agent-heartbeats.d.ts.map +1 -0
- package/dist/src/agent-heartbeats.js +111 -0
- package/dist/src/agent-heartbeats.js.map +1 -0
- package/dist/src/agent-models.d.ts +158 -0
- package/dist/src/agent-models.d.ts.map +1 -0
- package/dist/src/agent-models.js +171 -0
- package/dist/src/agent-models.js.map +1 -0
- package/dist/src/agent-place.d.ts +76 -0
- package/dist/src/agent-place.d.ts.map +1 -0
- package/dist/src/agent-place.js +80 -0
- package/dist/src/agent-place.js.map +1 -0
- package/dist/src/agents.d.ts +24 -0
- package/dist/src/agents.d.ts.map +1 -0
- package/dist/src/agents.js +58 -0
- package/dist/src/agents.js.map +1 -0
- package/dist/src/capabilities.d.ts +121 -0
- package/dist/src/capabilities.d.ts.map +1 -0
- package/dist/src/capabilities.js +120 -0
- package/dist/src/capabilities.js.map +1 -0
- package/dist/src/checklist.d.ts +19 -0
- package/dist/src/checklist.d.ts.map +1 -0
- package/dist/src/checklist.js +22 -0
- package/dist/src/checklist.js.map +1 -0
- package/dist/src/commands.d.ts +50 -0
- package/dist/src/commands.d.ts.map +1 -0
- package/dist/src/commands.js +274 -0
- package/dist/src/commands.js.map +1 -0
- package/dist/src/connectors.d.ts +90 -0
- package/dist/src/connectors.d.ts.map +1 -0
- package/dist/src/connectors.js +119 -0
- package/dist/src/connectors.js.map +1 -0
- package/dist/src/context-files.d.ts +304 -0
- package/dist/src/context-files.d.ts.map +1 -0
- package/dist/src/context-files.js +247 -0
- package/dist/src/context-files.js.map +1 -0
- package/dist/src/context.d.ts +369 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +526 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/direct-asks.d.ts +36 -0
- package/dist/src/direct-asks.d.ts.map +1 -0
- package/dist/src/direct-asks.js +43 -0
- package/dist/src/direct-asks.js.map +1 -0
- package/dist/src/envelope.d.ts +70 -0
- package/dist/src/envelope.d.ts.map +1 -0
- package/dist/src/envelope.js +46 -0
- package/dist/src/envelope.js.map +1 -0
- package/dist/src/events/catalogue.d.ts +50 -0
- package/dist/src/events/catalogue.d.ts.map +1 -0
- package/dist/src/events/catalogue.js +70 -0
- package/dist/src/events/catalogue.js.map +1 -0
- package/dist/src/events/chips-to-harness.d.ts +37 -0
- package/dist/src/events/chips-to-harness.d.ts.map +1 -0
- package/dist/src/events/chips-to-harness.js +511 -0
- package/dist/src/events/chips-to-harness.js.map +1 -0
- package/dist/src/events/harness-to-chips.d.ts +38 -0
- package/dist/src/events/harness-to-chips.d.ts.map +1 -0
- package/dist/src/events/harness-to-chips.js +593 -0
- package/dist/src/events/harness-to-chips.js.map +1 -0
- package/dist/src/events/index.d.ts +6 -0
- package/dist/src/events/index.d.ts.map +1 -0
- package/dist/src/events/index.js +5 -0
- package/dist/src/events/index.js.map +1 -0
- package/dist/src/events/workspace.d.ts +222 -0
- package/dist/src/events/workspace.d.ts.map +1 -0
- package/dist/src/events/workspace.js +1039 -0
- package/dist/src/events/workspace.js.map +1 -0
- package/dist/src/exchange.d.ts +262 -0
- package/dist/src/exchange.d.ts.map +1 -0
- package/dist/src/exchange.js +413 -0
- package/dist/src/exchange.js.map +1 -0
- package/dist/src/first-names.d.ts +29 -0
- package/dist/src/first-names.d.ts.map +1 -0
- package/dist/src/first-names.js +80 -0
- package/dist/src/first-names.js.map +1 -0
- package/dist/src/frames.d.ts +526 -0
- package/dist/src/frames.d.ts.map +1 -0
- package/dist/src/frames.js +346 -0
- package/dist/src/frames.js.map +1 -0
- package/dist/src/harness-jobs.d.ts +313 -0
- package/dist/src/harness-jobs.d.ts.map +1 -0
- package/dist/src/harness-jobs.js +210 -0
- package/dist/src/harness-jobs.js.map +1 -0
- package/dist/src/ids/index.d.ts +3 -0
- package/dist/src/ids/index.d.ts.map +1 -0
- package/dist/src/ids/index.js +2 -0
- package/dist/src/ids/index.js.map +1 -0
- package/dist/src/ids/ulid.d.ts +96 -0
- package/dist/src/ids/ulid.d.ts.map +1 -0
- package/dist/src/ids/ulid.js +212 -0
- package/dist/src/ids/ulid.js.map +1 -0
- package/dist/src/index.d.ts +81 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +47 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/invite-link.d.ts +64 -0
- package/dist/src/invite-link.d.ts.map +1 -0
- package/dist/src/invite-link.js +99 -0
- package/dist/src/invite-link.js.map +1 -0
- package/dist/src/join.d.ts +188 -0
- package/dist/src/join.d.ts.map +1 -0
- package/dist/src/join.js +190 -0
- package/dist/src/join.js.map +1 -0
- package/dist/src/limits.d.ts +50 -0
- package/dist/src/limits.d.ts.map +1 -0
- package/dist/src/limits.js +106 -0
- package/dist/src/limits.js.map +1 -0
- package/dist/src/matters.d.ts +22 -0
- package/dist/src/matters.d.ts.map +1 -0
- package/dist/src/matters.js +26 -0
- package/dist/src/matters.js.map +1 -0
- package/dist/src/mentions.d.ts +63 -0
- package/dist/src/mentions.d.ts.map +1 -0
- package/dist/src/mentions.js +129 -0
- package/dist/src/mentions.js.map +1 -0
- package/dist/src/names.d.ts +58 -0
- package/dist/src/names.d.ts.map +1 -0
- package/dist/src/names.js +192 -0
- package/dist/src/names.js.map +1 -0
- package/dist/src/no-reply.d.ts +17 -0
- package/dist/src/no-reply.d.ts.map +1 -0
- package/dist/src/no-reply.js +48 -0
- package/dist/src/no-reply.js.map +1 -0
- package/dist/src/notifications.d.ts +81 -0
- package/dist/src/notifications.d.ts.map +1 -0
- package/dist/src/notifications.js +65 -0
- package/dist/src/notifications.js.map +1 -0
- package/dist/src/pages.d.ts +32 -0
- package/dist/src/pages.d.ts.map +1 -0
- package/dist/src/pages.js +32 -0
- package/dist/src/pages.js.map +1 -0
- package/dist/src/pairing.d.ts +99 -0
- package/dist/src/pairing.d.ts.map +1 -0
- package/dist/src/pairing.js +163 -0
- package/dist/src/pairing.js.map +1 -0
- package/dist/src/primitives.d.ts +267 -0
- package/dist/src/primitives.d.ts.map +1 -0
- package/dist/src/primitives.js +279 -0
- package/dist/src/primitives.js.map +1 -0
- package/dist/src/project.d.ts +335 -0
- package/dist/src/project.d.ts.map +1 -0
- package/dist/src/project.js +499 -0
- package/dist/src/project.js.map +1 -0
- package/dist/src/ranges.d.ts +31 -0
- package/dist/src/ranges.d.ts.map +1 -0
- package/dist/src/ranges.js +51 -0
- package/dist/src/ranges.js.map +1 -0
- package/dist/src/relay.d.ts +177 -0
- package/dist/src/relay.d.ts.map +1 -0
- package/dist/src/relay.js +147 -0
- package/dist/src/relay.js.map +1 -0
- package/dist/src/room-files.d.ts +146 -0
- package/dist/src/room-files.d.ts.map +1 -0
- package/dist/src/room-files.js +135 -0
- package/dist/src/room-files.js.map +1 -0
- package/dist/src/room-note.d.ts +213 -0
- package/dist/src/room-note.d.ts.map +1 -0
- package/dist/src/room-note.js +457 -0
- package/dist/src/room-note.js.map +1 -0
- package/dist/src/space-icons.d.ts +68 -0
- package/dist/src/space-icons.d.ts.map +1 -0
- package/dist/src/space-icons.js +142 -0
- package/dist/src/space-icons.js.map +1 -0
- package/dist/src/spend.d.ts +57 -0
- package/dist/src/spend.d.ts.map +1 -0
- package/dist/src/spend.js +94 -0
- package/dist/src/spend.js.map +1 -0
- package/dist/src/visibility.d.ts +170 -0
- package/dist/src/visibility.d.ts.map +1 -0
- package/dist/src/visibility.js +218 -0
- package/dist/src/visibility.js.map +1 -0
- package/fixtures/agent.asked.json +15 -0
- package/fixtures/agent.attached.json +15 -0
- package/fixtures/agent.deleted.json +16 -0
- package/fixtures/agent.fork.json +14 -0
- package/fixtures/agent.lock_set.json +13 -0
- package/fixtures/agent.registered.json +17 -0
- package/fixtures/agent.released.json +16 -0
- package/fixtures/agent.updated.json +14 -0
- package/fixtures/approval.executed.json +16 -0
- package/fixtures/approval.request.json +45 -0
- package/fixtures/approval.resolved.json +20 -0
- package/fixtures/approval.routed.json +20 -0
- package/fixtures/artifact.create.json +18 -0
- package/fixtures/attachment.fetched.json +15 -0
- package/fixtures/attachment.limits_set.json +15 -0
- package/fixtures/budget.warning.json +20 -0
- package/fixtures/checkpoint.json +16 -0
- package/fixtures/context.compacted.json +16 -0
- package/fixtures/context.usage.json +17 -0
- package/fixtures/exchange.limits_set.json +15 -0
- package/fixtures/exchange.set.json +13 -0
- package/fixtures/feedback.json +21 -0
- package/fixtures/frames/ack.json +6 -0
- package/fixtures/frames/context.edit.json +11 -0
- package/fixtures/frames/context_window.change.json +9 -0
- package/fixtures/frames/context_window.compact.json +8 -0
- package/fixtures/frames/error.json +6 -0
- package/fixtures/frames/event.json +20 -0
- package/fixtures/frames/events.json +39 -0
- package/fixtures/frames/folder.open.json +6 -0
- package/fixtures/frames/folder.open.page.json +7 -0
- package/fixtures/frames/folder.run.json +8 -0
- package/fixtures/frames/folder.run_state.json +12 -0
- package/fixtures/frames/heartbeat.change.json +10 -0
- package/fixtures/frames/hello.json +18 -0
- package/fixtures/frames/job.change.json +9 -0
- package/fixtures/frames/join.json +19 -0
- package/fixtures/frames/model.change.json +10 -0
- package/fixtures/frames/ping.json +4 -0
- package/fixtures/frames/pong.json +4 -0
- package/fixtures/frames/presence.json +12 -0
- package/fixtures/frames/receipt.json +5 -0
- package/fixtures/frames/restart.json +5 -0
- package/fixtures/frames/subscribe.json +6 -0
- package/fixtures/handoff.json +20 -0
- package/fixtures/harness.removed.json +15 -0
- package/fixtures/harness.transferred.json +15 -0
- package/fixtures/hello.json +61 -0
- package/fixtures/join.allowed.json +20 -0
- package/fixtures/join.denied.json +17 -0
- package/fixtures/lane.updated.json +17 -0
- package/fixtures/membership.added.json +16 -0
- package/fixtures/membership.removed.json +14 -0
- package/fixtures/membership.replaced.json +15 -0
- package/fixtures/message.deleted.json +15 -0
- package/fixtures/message.edited.json +15 -0
- package/fixtures/message.handed.json +14 -0
- package/fixtures/message.heard.json +14 -0
- package/fixtures/message.held.json +14 -0
- package/fixtures/message.hidden.json +14 -0
- package/fixtures/message.new.json +96 -0
- package/fixtures/message.overheard.json +22 -0
- package/fixtures/message.pinned.json +14 -0
- package/fixtures/message.post.json +14 -0
- package/fixtures/message.shown.json +14 -0
- package/fixtures/message.unpinned.json +14 -0
- package/fixtures/person.face_set.json +17 -0
- package/fixtures/person.joined.json +16 -0
- package/fixtures/person.removed.json +16 -0
- package/fixtures/person.renamed.json +14 -0
- package/fixtures/policy.updated.json +30 -0
- package/fixtures/project.changed.json +21 -0
- package/fixtures/question.answered.json +23 -0
- package/fixtures/question.ask.json +37 -0
- package/fixtures/receipt.json +15 -0
- package/fixtures/relay.set.json +12 -0
- package/fixtures/role.changed.json +15 -0
- package/fixtures/run.cancel.json +15 -0
- package/fixtures/run.completed.json +20 -0
- package/fixtures/run.failed.json +20 -0
- package/fixtures/run.pause.json +15 -0
- package/fixtures/run.plan.json +24 -0
- package/fixtures/run.requested.json +34 -0
- package/fixtures/run.resume.json +15 -0
- package/fixtures/run.started.json +33 -0
- package/fixtures/run.status.json +17 -0
- package/fixtures/run.steer.json +21 -0
- package/fixtures/session.ended.json +15 -0
- package/fixtures/session.renamed.json +15 -0
- package/fixtures/session.started.json +17 -0
- package/fixtures/space.claimed.json +15 -0
- package/fixtures/space.created.json +14 -0
- package/fixtures/space.erased.json +13 -0
- package/fixtures/space.lead_set.json +13 -0
- package/fixtures/space.lock_set.json +13 -0
- package/fixtures/space.spend_ceiling_set.json +13 -0
- package/fixtures/space.updated.json +14 -0
- package/fixtures/step.log.json +26 -0
- package/fixtures/task.json +22 -0
- package/fixtures/turn.passed.json +14 -0
- package/fixtures/usage.json +21 -0
- package/fixtures/workspace.renamed.json +13 -0
- package/generated/agent-connect.json +13966 -0
- package/generated/schema/agent.asked.json +114 -0
- package/generated/schema/agent.attached.json +465 -0
- package/generated/schema/agent.deleted.json +127 -0
- package/generated/schema/agent.fork.json +107 -0
- package/generated/schema/agent.lock_set.json +105 -0
- package/generated/schema/agent.registered.json +130 -0
- package/generated/schema/agent.released.json +129 -0
- package/generated/schema/agent.updated.json +151 -0
- package/generated/schema/approval.executed.json +125 -0
- package/generated/schema/approval.request.json +279 -0
- package/generated/schema/approval.resolved.json +162 -0
- package/generated/schema/approval.routed.json +185 -0
- package/generated/schema/artifact.create.json +206 -0
- package/generated/schema/attachment.fetched.json +114 -0
- package/generated/schema/attachment.limits_set.json +136 -0
- package/generated/schema/budget.warning.json +152 -0
- package/generated/schema/checkpoint.json +111 -0
- package/generated/schema/context.compacted.json +124 -0
- package/generated/schema/context.usage.json +120 -0
- package/generated/schema/exchange.limits_set.json +127 -0
- package/generated/schema/exchange.set.json +144 -0
- package/generated/schema/feedback.json +173 -0
- package/generated/schema/handoff.json +122 -0
- package/generated/schema/harness.removed.json +122 -0
- package/generated/schema/harness.transferred.json +117 -0
- package/generated/schema/hello.json +509 -0
- package/generated/schema/join.allowed.json +176 -0
- package/generated/schema/join.denied.json +150 -0
- package/generated/schema/lane.updated.json +223 -0
- package/generated/schema/membership.added.json +153 -0
- package/generated/schema/membership.removed.json +126 -0
- package/generated/schema/membership.replaced.json +106 -0
- package/generated/schema/message.deleted.json +105 -0
- package/generated/schema/message.edited.json +107 -0
- package/generated/schema/message.handed.json +111 -0
- package/generated/schema/message.heard.json +100 -0
- package/generated/schema/message.held.json +181 -0
- package/generated/schema/message.hidden.json +100 -0
- package/generated/schema/message.new.json +1369 -0
- package/generated/schema/message.overheard.json +701 -0
- package/generated/schema/message.pinned.json +100 -0
- package/generated/schema/message.post.json +290 -0
- package/generated/schema/message.shown.json +100 -0
- package/generated/schema/message.unpinned.json +100 -0
- package/generated/schema/person.face_set.json +134 -0
- package/generated/schema/person.joined.json +128 -0
- package/generated/schema/person.removed.json +133 -0
- package/generated/schema/person.renamed.json +114 -0
- package/generated/schema/policy.updated.json +277 -0
- package/generated/schema/project.changed.json +199 -0
- package/generated/schema/question.answered.json +154 -0
- package/generated/schema/question.ask.json +194 -0
- package/generated/schema/receipt.json +109 -0
- package/generated/schema/relay.set.json +99 -0
- package/generated/schema/role.changed.json +116 -0
- package/generated/schema/run.cancel.json +106 -0
- package/generated/schema/run.completed.json +139 -0
- package/generated/schema/run.failed.json +135 -0
- package/generated/schema/run.pause.json +106 -0
- package/generated/schema/run.plan.json +128 -0
- package/generated/schema/run.requested.json +309 -0
- package/generated/schema/run.resume.json +106 -0
- package/generated/schema/run.started.json +142 -0
- package/generated/schema/run.status.json +120 -0
- package/generated/schema/run.steer.json +163 -0
- package/generated/schema/session.ended.json +106 -0
- package/generated/schema/session.renamed.json +108 -0
- package/generated/schema/session.started.json +116 -0
- package/generated/schema/space.claimed.json +107 -0
- package/generated/schema/space.created.json +148 -0
- package/generated/schema/space.erased.json +129 -0
- package/generated/schema/space.lead_set.json +108 -0
- package/generated/schema/space.lock_set.json +99 -0
- package/generated/schema/space.spend_ceiling_set.json +102 -0
- package/generated/schema/space.updated.json +112 -0
- package/generated/schema/step.log.json +187 -0
- package/generated/schema/task.json +268 -0
- package/generated/schema/turn.passed.json +99 -0
- package/generated/schema/usage.json +155 -0
- package/generated/schema/workspace.renamed.json +107 -0
- package/generated/types.ts +4178 -0
- package/package.json +38 -3
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An agent's context window (ADR 0146): how full it is, a person's Compact now, and the limit it
|
|
3
|
+
* compacts itself at, shown and changed on the agent's page in Chips and kept by its harness.
|
|
4
|
+
*
|
|
5
|
+
* Nothing about a context window is Chips'. A harness that declares `context_windows` sends a copy
|
|
6
|
+
* of each agent's: how many tokens it holds and its model's window, whether it is compacting, when
|
|
7
|
+
* it last compacted and from how much to how much, whether it takes a Compact now, and the limit it
|
|
8
|
+
* compacts itself at with the limits a person may pick, and how full its last long turn got.
|
|
9
|
+
* Chips puts the numbers into words itself.
|
|
10
|
+
*
|
|
11
|
+
* A person asks two things of it, each going down the harness's socket and answered by its next
|
|
12
|
+
* copy, as a model's change is (ADR 0140): Compact now, as `context_window.compact`, answered when
|
|
13
|
+
* the harness takes it on and done when a copy says it compacted since; and a new limit, as
|
|
14
|
+
* `context_window.change`. The copies live in a registry, not the log, one row per agent with the
|
|
15
|
+
* last of each ask beside it. When a copy says the agent compacted, Chips writes a quiet line in
|
|
16
|
+
* its room, `context.compacted`.
|
|
17
|
+
*/
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
/** The most limits an agent's copy offers. */
|
|
20
|
+
export declare const WINDOW_LIMIT_CHOICES_MAX = 12;
|
|
21
|
+
/**
|
|
22
|
+
* How long either ask waits for its harness's answer: the minute a model's change has. After it
|
|
23
|
+
* the ask is missed, and the person is told the harness hasn't answered; an answer after it still
|
|
24
|
+
* counts, and a new ask may be made.
|
|
25
|
+
*/
|
|
26
|
+
export declare const WINDOW_ASK_WAIT_MS = 60000;
|
|
27
|
+
export declare const COMPACTED_BY: readonly ["asked", "itself"];
|
|
28
|
+
export declare const lastCompaction: z.ZodObject<{
|
|
29
|
+
at: z.ZodISODateTime;
|
|
30
|
+
from: z.ZodInt;
|
|
31
|
+
to: z.ZodInt;
|
|
32
|
+
by: z.ZodEnum<{
|
|
33
|
+
asked: "asked";
|
|
34
|
+
itself: "itself";
|
|
35
|
+
}>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type LastCompaction = z.infer<typeof lastCompaction>;
|
|
38
|
+
/** How many times a long turn may say it compacted itself, at most. */
|
|
39
|
+
export declare const LONG_TURN_FOLDS_MAX = 1000;
|
|
40
|
+
export declare const longTurn: z.ZodObject<{
|
|
41
|
+
at: z.ZodISODateTime;
|
|
42
|
+
peak: z.ZodInt;
|
|
43
|
+
folds: z.ZodInt;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type LongTurn = z.infer<typeof longTurn>;
|
|
46
|
+
export declare const windowLimit: z.ZodObject<{
|
|
47
|
+
at: z.ZodNullable<z.ZodInt>;
|
|
48
|
+
choices: z.ZodArray<z.ZodInt>;
|
|
49
|
+
default: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
50
|
+
may_turn_off: z.ZodBoolean;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type WindowLimit = z.infer<typeof windowLimit>;
|
|
53
|
+
export declare const agentContextWindowPut: z.ZodObject<{
|
|
54
|
+
answers: z.ZodOptional<z.ZodString>;
|
|
55
|
+
refuses: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
change_id: z.ZodString;
|
|
57
|
+
message: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
used: z.ZodInt;
|
|
60
|
+
window: z.ZodInt;
|
|
61
|
+
model: z.ZodOptional<z.ZodString>;
|
|
62
|
+
as_of: z.ZodISODateTime;
|
|
63
|
+
compacting: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
queued: "queued";
|
|
65
|
+
running: "running";
|
|
66
|
+
}>>;
|
|
67
|
+
last: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
at: z.ZodISODateTime;
|
|
69
|
+
from: z.ZodInt;
|
|
70
|
+
to: z.ZodInt;
|
|
71
|
+
by: z.ZodEnum<{
|
|
72
|
+
asked: "asked";
|
|
73
|
+
itself: "itself";
|
|
74
|
+
}>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
long_turn: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
at: z.ZodISODateTime;
|
|
78
|
+
peak: z.ZodInt;
|
|
79
|
+
folds: z.ZodInt;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
compacts: z.ZodBoolean;
|
|
82
|
+
why_not: z.ZodOptional<z.ZodString>;
|
|
83
|
+
limit: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
at: z.ZodNullable<z.ZodInt>;
|
|
85
|
+
choices: z.ZodArray<z.ZodInt>;
|
|
86
|
+
default: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
87
|
+
may_turn_off: z.ZodBoolean;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
editable: z.ZodBoolean;
|
|
90
|
+
why_read_only: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type AgentContextWindowPut = z.infer<typeof agentContextWindowPut>;
|
|
93
|
+
/** The copy as Chips keeps it: what the harness sent, without what it answered. */
|
|
94
|
+
export type AgentContextWindowCopy = Omit<AgentContextWindowPut, "answers" | "refuses">;
|
|
95
|
+
export declare const windowLimitAsk: z.ZodObject<{
|
|
96
|
+
at: z.ZodNullable<z.ZodInt>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export type WindowLimitAsk = z.infer<typeof windowLimitAsk>;
|
|
99
|
+
export declare const WINDOW_CHANGE_STATES: readonly ["waiting", "saved", "failed", "missed"];
|
|
100
|
+
export declare const windowChangeState: z.ZodEnum<{
|
|
101
|
+
waiting: "waiting";
|
|
102
|
+
saved: "saved";
|
|
103
|
+
failed: "failed";
|
|
104
|
+
missed: "missed";
|
|
105
|
+
}>;
|
|
106
|
+
export type WindowChangeState = z.infer<typeof windowChangeState>;
|
|
107
|
+
export declare const windowChangeView: z.ZodObject<{
|
|
108
|
+
change_id: z.ZodString;
|
|
109
|
+
state: z.ZodEnum<{
|
|
110
|
+
waiting: "waiting";
|
|
111
|
+
saved: "saved";
|
|
112
|
+
failed: "failed";
|
|
113
|
+
missed: "missed";
|
|
114
|
+
}>;
|
|
115
|
+
at: z.ZodNullable<z.ZodInt>;
|
|
116
|
+
asked_at: z.ZodISODateTime;
|
|
117
|
+
answered_at: z.ZodOptional<z.ZodISODateTime>;
|
|
118
|
+
message: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export type WindowChangeView = z.infer<typeof windowChangeView>;
|
|
121
|
+
/**
|
|
122
|
+
* What became of a Compact now: `waiting` for the harness; `taken`, answered and under way;
|
|
123
|
+
* `done`, a copy says it compacted since or stopped compacting; `failed`, refused; `missed`, no
|
|
124
|
+
* answer within `WINDOW_ASK_WAIT_MS`.
|
|
125
|
+
*/
|
|
126
|
+
export declare const COMPACTION_STATES: readonly ["waiting", "taken", "done", "failed", "missed"];
|
|
127
|
+
export declare const compactionState: z.ZodEnum<{
|
|
128
|
+
waiting: "waiting";
|
|
129
|
+
failed: "failed";
|
|
130
|
+
missed: "missed";
|
|
131
|
+
taken: "taken";
|
|
132
|
+
done: "done";
|
|
133
|
+
}>;
|
|
134
|
+
export type CompactionState = z.infer<typeof compactionState>;
|
|
135
|
+
export declare const compactionView: z.ZodObject<{
|
|
136
|
+
change_id: z.ZodString;
|
|
137
|
+
state: z.ZodEnum<{
|
|
138
|
+
waiting: "waiting";
|
|
139
|
+
failed: "failed";
|
|
140
|
+
missed: "missed";
|
|
141
|
+
taken: "taken";
|
|
142
|
+
done: "done";
|
|
143
|
+
}>;
|
|
144
|
+
asked_at: z.ZodISODateTime;
|
|
145
|
+
answered_at: z.ZodOptional<z.ZodISODateTime>;
|
|
146
|
+
done_at: z.ZodOptional<z.ZodISODateTime>;
|
|
147
|
+
message: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
export type CompactionView = z.infer<typeof compactionView>;
|
|
150
|
+
export declare const agentContextWindowView: z.ZodObject<{
|
|
151
|
+
read_at: z.ZodISODateTime;
|
|
152
|
+
away: z.ZodBoolean;
|
|
153
|
+
change: z.ZodOptional<z.ZodObject<{
|
|
154
|
+
change_id: z.ZodString;
|
|
155
|
+
state: z.ZodEnum<{
|
|
156
|
+
waiting: "waiting";
|
|
157
|
+
saved: "saved";
|
|
158
|
+
failed: "failed";
|
|
159
|
+
missed: "missed";
|
|
160
|
+
}>;
|
|
161
|
+
at: z.ZodNullable<z.ZodInt>;
|
|
162
|
+
asked_at: z.ZodISODateTime;
|
|
163
|
+
answered_at: z.ZodOptional<z.ZodISODateTime>;
|
|
164
|
+
message: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
compaction: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
change_id: z.ZodString;
|
|
168
|
+
state: z.ZodEnum<{
|
|
169
|
+
waiting: "waiting";
|
|
170
|
+
failed: "failed";
|
|
171
|
+
missed: "missed";
|
|
172
|
+
taken: "taken";
|
|
173
|
+
done: "done";
|
|
174
|
+
}>;
|
|
175
|
+
asked_at: z.ZodISODateTime;
|
|
176
|
+
answered_at: z.ZodOptional<z.ZodISODateTime>;
|
|
177
|
+
done_at: z.ZodOptional<z.ZodISODateTime>;
|
|
178
|
+
message: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
used: z.ZodInt;
|
|
181
|
+
window: z.ZodInt;
|
|
182
|
+
model: z.ZodOptional<z.ZodString>;
|
|
183
|
+
as_of: z.ZodISODateTime;
|
|
184
|
+
compacting: z.ZodOptional<z.ZodEnum<{
|
|
185
|
+
queued: "queued";
|
|
186
|
+
running: "running";
|
|
187
|
+
}>>;
|
|
188
|
+
last: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
at: z.ZodISODateTime;
|
|
190
|
+
from: z.ZodInt;
|
|
191
|
+
to: z.ZodInt;
|
|
192
|
+
by: z.ZodEnum<{
|
|
193
|
+
asked: "asked";
|
|
194
|
+
itself: "itself";
|
|
195
|
+
}>;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
long_turn: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
at: z.ZodISODateTime;
|
|
199
|
+
peak: z.ZodInt;
|
|
200
|
+
folds: z.ZodInt;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
compacts: z.ZodBoolean;
|
|
203
|
+
why_not: z.ZodOptional<z.ZodString>;
|
|
204
|
+
limit: z.ZodOptional<z.ZodObject<{
|
|
205
|
+
at: z.ZodNullable<z.ZodInt>;
|
|
206
|
+
choices: z.ZodArray<z.ZodInt>;
|
|
207
|
+
default: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
208
|
+
may_turn_off: z.ZodBoolean;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
editable: z.ZodBoolean;
|
|
211
|
+
why_read_only: z.ZodOptional<z.ZodString>;
|
|
212
|
+
agent_id: z.ZodString;
|
|
213
|
+
harness_id: z.ZodString;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
export type AgentContextWindowView = z.infer<typeof agentContextWindowView>;
|
|
216
|
+
export declare const windowCompactFrame: z.ZodObject<{
|
|
217
|
+
frame: z.ZodLiteral<"context_window.compact">;
|
|
218
|
+
change_id: z.ZodString;
|
|
219
|
+
harness_id: z.ZodString;
|
|
220
|
+
agent_id: z.ZodString;
|
|
221
|
+
asked_by: z.ZodString;
|
|
222
|
+
asked_at: z.ZodISODateTime;
|
|
223
|
+
}, z.core.$strip>;
|
|
224
|
+
export type WindowCompactFrame = z.infer<typeof windowCompactFrame>;
|
|
225
|
+
export declare const windowChangeFrame: z.ZodObject<{
|
|
226
|
+
frame: z.ZodLiteral<"context_window.change">;
|
|
227
|
+
change_id: z.ZodString;
|
|
228
|
+
harness_id: z.ZodString;
|
|
229
|
+
agent_id: z.ZodString;
|
|
230
|
+
at: z.ZodNullable<z.ZodInt>;
|
|
231
|
+
asked_by: z.ZodString;
|
|
232
|
+
asked_at: z.ZodISODateTime;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
export type WindowChangeFrame = z.infer<typeof windowChangeFrame>;
|
|
235
|
+
//# sourceMappingURL=agent-context-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AAM,iBAAiB;;;;;EAA+B,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;iBAW8D,CAAC;AAC5F,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2DAA4D,CAAC;AAC3F,eAAO,MAAM,eAAe;;;;;;EAA4B,CAAC;AACzD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc;;;;;;;;;;;;;iBAWsE,CAAC;AAClG,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYqD,CAAC;AACzF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,eAAO,MAAM,kBAAkB;;;;;;;iBAW5B,CAAC;AACJ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,iBAAiB;;;;;;;;iBAc3B,CAAC;AACJ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An agent's context window (ADR 0146): how full it is, a person's Compact now, and the limit it
|
|
3
|
+
* compacts itself at, shown and changed on the agent's page in Chips and kept by its harness.
|
|
4
|
+
*
|
|
5
|
+
* Nothing about a context window is Chips'. A harness that declares `context_windows` sends a copy
|
|
6
|
+
* of each agent's: how many tokens it holds and its model's window, whether it is compacting, when
|
|
7
|
+
* it last compacted and from how much to how much, whether it takes a Compact now, and the limit it
|
|
8
|
+
* compacts itself at with the limits a person may pick, and how full its last long turn got.
|
|
9
|
+
* Chips puts the numbers into words itself.
|
|
10
|
+
*
|
|
11
|
+
* A person asks two things of it, each going down the harness's socket and answered by its next
|
|
12
|
+
* copy, as a model's change is (ADR 0140): Compact now, as `context_window.compact`, answered when
|
|
13
|
+
* the harness takes it on and done when a copy says it compacted since; and a new limit, as
|
|
14
|
+
* `context_window.change`. The copies live in a registry, not the log, one row per agent with the
|
|
15
|
+
* last of each ask beside it. When a copy says the agent compacted, Chips writes a quiet line in
|
|
16
|
+
* its room, `context.compacted`.
|
|
17
|
+
*/
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
import { id, isoTimestamp } from "./primitives.js";
|
|
20
|
+
/** The most limits an agent's copy offers. */
|
|
21
|
+
export const WINDOW_LIMIT_CHOICES_MAX = 12;
|
|
22
|
+
/**
|
|
23
|
+
* How long either ask waits for its harness's answer: the minute a model's change has. After it
|
|
24
|
+
* the ask is missed, and the person is told the harness hasn't answered; an answer after it still
|
|
25
|
+
* counts, and a new ask may be made.
|
|
26
|
+
*/
|
|
27
|
+
export const WINDOW_ASK_WAIT_MS = 60_000;
|
|
28
|
+
/** A limit: the percent of the window at which the agent compacts itself. */
|
|
29
|
+
const percent = z.int().min(1).max(99);
|
|
30
|
+
const tokens = z.int().nonnegative();
|
|
31
|
+
const ascending = (choices) => choices.every((each, at) => at === 0 || each > (choices[at - 1] ?? 0));
|
|
32
|
+
export const COMPACTED_BY = ["asked", "itself"];
|
|
33
|
+
export const lastCompaction = z
|
|
34
|
+
.object({
|
|
35
|
+
at: isoTimestamp.describe("When it finished compacting."),
|
|
36
|
+
from: tokens.describe("The tokens it held before."),
|
|
37
|
+
to: tokens.describe("The tokens it held after."),
|
|
38
|
+
by: z
|
|
39
|
+
.enum(COMPACTED_BY)
|
|
40
|
+
.describe("`asked`: a person asked, from Chips or elsewhere. `itself`: at its limit, or full."),
|
|
41
|
+
})
|
|
42
|
+
.describe("The agent's last compaction.");
|
|
43
|
+
/** How many times a long turn may say it compacted itself, at most. */
|
|
44
|
+
export const LONG_TURN_FOLDS_MAX = 1000;
|
|
45
|
+
export const longTurn = z
|
|
46
|
+
.object({
|
|
47
|
+
at: isoTimestamp.describe("When the turn ended."),
|
|
48
|
+
peak: tokens.describe("The most it held at once during the turn, as its harness counted it."),
|
|
49
|
+
folds: z
|
|
50
|
+
.int()
|
|
51
|
+
.nonnegative()
|
|
52
|
+
.max(LONG_TURN_FOLDS_MAX)
|
|
53
|
+
.describe("How many times it compacted itself during the turn."),
|
|
54
|
+
})
|
|
55
|
+
.describe("Its last long turn: the last whose height passed half its window. A copy between turns reads low for an agent that holds little between them; this is how full it got while working.");
|
|
56
|
+
export const windowLimit = z
|
|
57
|
+
.object({
|
|
58
|
+
at: percent
|
|
59
|
+
.nullable()
|
|
60
|
+
.describe("The percent of the window it compacts itself at, one of `choices`. `null`: only when asked, or when its harness must."),
|
|
61
|
+
choices: z
|
|
62
|
+
.array(percent)
|
|
63
|
+
.min(1)
|
|
64
|
+
.max(WINDOW_LIMIT_CHOICES_MAX)
|
|
65
|
+
.refine(ascending, { message: "The limits go up, each named once." })
|
|
66
|
+
.describe("The limits a person may pick, lowest first: twelve at most."),
|
|
67
|
+
default: percent
|
|
68
|
+
.nullable()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe("The harness's own limit, marked among the choices; `null` when its own is only when asked."),
|
|
71
|
+
may_turn_off: z.boolean().describe("Whether a person may pick only when asked (`at: null`)."),
|
|
72
|
+
})
|
|
73
|
+
.refine((limit) => limit.at === null || limit.choices.includes(limit.at), {
|
|
74
|
+
path: ["at"],
|
|
75
|
+
message: "`at` is one of `choices`, or `null`.",
|
|
76
|
+
})
|
|
77
|
+
.refine((limit) => limit.at !== null || limit.may_turn_off, {
|
|
78
|
+
path: ["at"],
|
|
79
|
+
message: "`at` is `null` only for a limit that may be turned off.",
|
|
80
|
+
})
|
|
81
|
+
.refine((limit) => limit.default === undefined ||
|
|
82
|
+
limit.default === null ||
|
|
83
|
+
limit.choices.includes(limit.default), { path: ["default"], message: "`default` is one of `choices`." })
|
|
84
|
+
.describe("The limit an agent compacts itself at, and what a person may pick.");
|
|
85
|
+
const copyFields = {
|
|
86
|
+
used: tokens.describe("The tokens the agent holds now, as its harness counts them."),
|
|
87
|
+
window: z.int().positive().describe("Its model's context window, in tokens."),
|
|
88
|
+
model: z.string().min(1).max(120).optional().describe("The model whose window it is."),
|
|
89
|
+
as_of: isoTimestamp.describe("When `used` was measured."),
|
|
90
|
+
compacting: z
|
|
91
|
+
.enum(["queued", "running"])
|
|
92
|
+
.optional()
|
|
93
|
+
.describe("While it compacts: `queued`, waiting for its turn to end; `running`, under way. Absent otherwise."),
|
|
94
|
+
last: lastCompaction.optional(),
|
|
95
|
+
long_turn: longTurn
|
|
96
|
+
.optional()
|
|
97
|
+
.describe("Absent when its harness has seen no long turn of it, or keeps no record of one."),
|
|
98
|
+
compacts: z.boolean().describe("Whether it takes a Compact now from Chips."),
|
|
99
|
+
why_not: z
|
|
100
|
+
.string()
|
|
101
|
+
.min(1)
|
|
102
|
+
.max(120)
|
|
103
|
+
.optional()
|
|
104
|
+
.describe("Why not, in the harness's words, only when it doesn't `compacts`."),
|
|
105
|
+
limit: windowLimit
|
|
106
|
+
.optional()
|
|
107
|
+
.describe("Absent: its harness keeps its own limit and offers no other."),
|
|
108
|
+
editable: z.boolean().describe("Whether a person may change its limit from Chips."),
|
|
109
|
+
why_read_only: z
|
|
110
|
+
.string()
|
|
111
|
+
.min(1)
|
|
112
|
+
.max(120)
|
|
113
|
+
.optional()
|
|
114
|
+
.describe("Why not, in the harness's words, only when it is not `editable`."),
|
|
115
|
+
};
|
|
116
|
+
const whyNotOnlyWhenNot = (copy) => copy.why_not === undefined || !copy.compacts;
|
|
117
|
+
const whyOnlyWhenReadOnly = (copy) => copy.why_read_only === undefined || !copy.editable;
|
|
118
|
+
export const agentContextWindowPut = z
|
|
119
|
+
.object({
|
|
120
|
+
...copyFields,
|
|
121
|
+
answers: id("change")
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("The ask this copy answers: a limit set, or a Compact now taken on, and this is the agent as it is now."),
|
|
124
|
+
refuses: z
|
|
125
|
+
.object({
|
|
126
|
+
change_id: id("change"),
|
|
127
|
+
message: z.string().min(1).max(300).optional().describe("Why not, for the person."),
|
|
128
|
+
})
|
|
129
|
+
.optional()
|
|
130
|
+
.describe("An ask not done. The copy beside it is the agent as it is now."),
|
|
131
|
+
})
|
|
132
|
+
.refine(whyNotOnlyWhenNot, {
|
|
133
|
+
path: ["why_not"],
|
|
134
|
+
message: "Say why not only for an agent that takes no Compact now.",
|
|
135
|
+
})
|
|
136
|
+
.refine(whyOnlyWhenReadOnly, {
|
|
137
|
+
path: ["why_read_only"],
|
|
138
|
+
message: "Say why only for a limit that can't be changed.",
|
|
139
|
+
})
|
|
140
|
+
.describe("`PUT /v1/agents/:id/context-window`: a harness's copy of one of its agents' context window.");
|
|
141
|
+
export const windowLimitAsk = z
|
|
142
|
+
.object({
|
|
143
|
+
at: percent
|
|
144
|
+
.nullable()
|
|
145
|
+
.describe("One of the copy's limit `choices`, or `null` for only when asked."),
|
|
146
|
+
})
|
|
147
|
+
.describe("`POST /v1/agents/:id/context-window/changes`: the limit it compacts itself at.");
|
|
148
|
+
export const WINDOW_CHANGE_STATES = ["waiting", "saved", "failed", "missed"];
|
|
149
|
+
export const windowChangeState = z.enum(WINDOW_CHANGE_STATES);
|
|
150
|
+
export const windowChangeView = z
|
|
151
|
+
.object({
|
|
152
|
+
change_id: id("change"),
|
|
153
|
+
state: windowChangeState.describe("`missed` once `WINDOW_ASK_WAIT_MS` has passed with no answer; read, never stored."),
|
|
154
|
+
at: percent.nullable(),
|
|
155
|
+
asked_at: isoTimestamp,
|
|
156
|
+
answered_at: isoTimestamp.optional(),
|
|
157
|
+
message: z.string().max(300).optional().describe("The harness's words, for a refusal."),
|
|
158
|
+
})
|
|
159
|
+
.describe("The last limit a person asked of an agent, and what became of it (ADR 0146).");
|
|
160
|
+
/**
|
|
161
|
+
* What became of a Compact now: `waiting` for the harness; `taken`, answered and under way;
|
|
162
|
+
* `done`, a copy says it compacted since or stopped compacting; `failed`, refused; `missed`, no
|
|
163
|
+
* answer within `WINDOW_ASK_WAIT_MS`.
|
|
164
|
+
*/
|
|
165
|
+
export const COMPACTION_STATES = ["waiting", "taken", "done", "failed", "missed"];
|
|
166
|
+
export const compactionState = z.enum(COMPACTION_STATES);
|
|
167
|
+
export const compactionView = z
|
|
168
|
+
.object({
|
|
169
|
+
change_id: id("change"),
|
|
170
|
+
state: compactionState.describe("`missed` once `WINDOW_ASK_WAIT_MS` has passed with no answer; read, never stored."),
|
|
171
|
+
asked_at: isoTimestamp,
|
|
172
|
+
answered_at: isoTimestamp.optional(),
|
|
173
|
+
done_at: isoTimestamp.optional(),
|
|
174
|
+
message: z.string().max(300).optional().describe("The harness's words, for a refusal."),
|
|
175
|
+
})
|
|
176
|
+
.describe("The last Compact now a person asked of an agent, and what became of it (ADR 0146).");
|
|
177
|
+
export const agentContextWindowView = z
|
|
178
|
+
.object({
|
|
179
|
+
agent_id: id("agent"),
|
|
180
|
+
harness_id: id("harness"),
|
|
181
|
+
...copyFields,
|
|
182
|
+
read_at: isoTimestamp.describe("When the harness last sent its copy."),
|
|
183
|
+
away: z
|
|
184
|
+
.boolean()
|
|
185
|
+
.describe("No socket of the harness hears asks now: read, not compacted or changed."),
|
|
186
|
+
change: windowChangeView.optional(),
|
|
187
|
+
compaction: compactionView.optional(),
|
|
188
|
+
})
|
|
189
|
+
.describe("`GET /v1/agents/:id/context-window`, for the harness's owner or an admin.");
|
|
190
|
+
export const windowCompactFrame = z
|
|
191
|
+
.object({
|
|
192
|
+
frame: z.literal("context_window.compact"),
|
|
193
|
+
change_id: id("change"),
|
|
194
|
+
harness_id: id("harness"),
|
|
195
|
+
agent_id: id("agent"),
|
|
196
|
+
asked_by: id("person"),
|
|
197
|
+
asked_at: isoTimestamp,
|
|
198
|
+
})
|
|
199
|
+
.describe("A person asked an agent to compact its context now (ADR 0146). Sent to a harness's socket that said `context_windows` in its `hello`, now or never: it is not in the log. The harness answers at once with the agent's copy, `answers` naming `change_id` with `compacting` set, or `refuses`; and sends a copy again when it is done.");
|
|
200
|
+
export const windowChangeFrame = z
|
|
201
|
+
.object({
|
|
202
|
+
frame: z.literal("context_window.change"),
|
|
203
|
+
change_id: id("change"),
|
|
204
|
+
harness_id: id("harness"),
|
|
205
|
+
agent_id: id("agent"),
|
|
206
|
+
at: percent
|
|
207
|
+
.nullable()
|
|
208
|
+
.describe("One of the copy's limit `choices`, or `null` for only when asked."),
|
|
209
|
+
asked_by: id("person"),
|
|
210
|
+
asked_at: isoTimestamp,
|
|
211
|
+
})
|
|
212
|
+
.describe("A person changed the limit an agent compacts itself at (ADR 0146). Sent to a harness's socket that said `context_windows` in its `hello`, now or never: it is not in the log. The harness answers with the agent's copy, `answers` or `refuses` naming `change_id`.");
|
|
213
|
+
//# sourceMappingURL=agent-context-windows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-context-windows.js","sourceRoot":"","sources":["../../src/agent-context-windows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,6EAA6E;AAC7E,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EA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ADR 0143): a turn its harness starts on its own every so often, switched
|
|
3
|
+
* on or off and timed on the agent's page in Chips, and kept by its harness.
|
|
4
|
+
*
|
|
5
|
+
* Nothing about a heartbeat is Chips'. A harness that declares `heartbeats` sends a copy of each
|
|
6
|
+
* agent's: whether it is on, how often it beats in minutes, the intervals a person may pick, and
|
|
7
|
+
* whether a person may change it. Chips puts the minutes into words itself. A person's change goes
|
|
8
|
+
* down the harness's socket as a `heartbeat.change` frame, and is done when the harness sends its
|
|
9
|
+
* copy back answering it, or refused with its words.
|
|
10
|
+
*
|
|
11
|
+
* The copies live in a registry, not the log, as a model's do (ADR 0140): one row per agent,
|
|
12
|
+
* holding the last change asked of it. What a heartbeat says in a room is an ordinary message,
|
|
13
|
+
* marked `heartbeat` on `message.post`.
|
|
14
|
+
*/
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
/** The most intervals an agent's copy offers. */
|
|
17
|
+
export declare const HEARTBEAT_CHOICES_MAX = 12;
|
|
18
|
+
/** The longest interval, in minutes: a week. */
|
|
19
|
+
export declare const HEARTBEAT_EVERY_MAX = 10080;
|
|
20
|
+
/**
|
|
21
|
+
* How long a change waits for its harness's answer: the minute a model's change has. After it the
|
|
22
|
+
* change is missed, and the person is told the harness hasn't answered; an answer after it still
|
|
23
|
+
* counts, and a new change may be asked.
|
|
24
|
+
*/
|
|
25
|
+
export declare const HEARTBEAT_CHANGE_WAIT_MS = 60000;
|
|
26
|
+
export declare const agentHeartbeatPut: z.ZodObject<{
|
|
27
|
+
answers: z.ZodOptional<z.ZodString>;
|
|
28
|
+
refuses: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
change_id: z.ZodString;
|
|
30
|
+
message: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
on: z.ZodBoolean;
|
|
33
|
+
every: z.ZodInt;
|
|
34
|
+
choices: z.ZodArray<z.ZodInt>;
|
|
35
|
+
editable: z.ZodBoolean;
|
|
36
|
+
why_read_only: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type AgentHeartbeatPut = z.infer<typeof agentHeartbeatPut>;
|
|
39
|
+
/** The copy as Chips keeps it: what the harness sent, without what it answered. */
|
|
40
|
+
export type AgentHeartbeatCopy = Omit<AgentHeartbeatPut, "answers" | "refuses">;
|
|
41
|
+
export declare const heartbeatChangeAsk: z.ZodObject<{
|
|
42
|
+
on: z.ZodBoolean;
|
|
43
|
+
every: z.ZodOptional<z.ZodInt>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type HeartbeatChangeAsk = z.infer<typeof heartbeatChangeAsk>;
|
|
46
|
+
export declare const HEARTBEAT_CHANGE_STATES: readonly ["waiting", "saved", "failed", "missed"];
|
|
47
|
+
export declare const heartbeatChangeState: z.ZodEnum<{
|
|
48
|
+
waiting: "waiting";
|
|
49
|
+
saved: "saved";
|
|
50
|
+
failed: "failed";
|
|
51
|
+
missed: "missed";
|
|
52
|
+
}>;
|
|
53
|
+
export type HeartbeatChangeState = z.infer<typeof heartbeatChangeState>;
|
|
54
|
+
export declare const heartbeatChangeView: z.ZodObject<{
|
|
55
|
+
change_id: z.ZodString;
|
|
56
|
+
state: z.ZodEnum<{
|
|
57
|
+
waiting: "waiting";
|
|
58
|
+
saved: "saved";
|
|
59
|
+
failed: "failed";
|
|
60
|
+
missed: "missed";
|
|
61
|
+
}>;
|
|
62
|
+
on: z.ZodBoolean;
|
|
63
|
+
every: z.ZodInt;
|
|
64
|
+
asked_at: z.ZodISODateTime;
|
|
65
|
+
answered_at: z.ZodOptional<z.ZodISODateTime>;
|
|
66
|
+
message: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type HeartbeatChangeView = z.infer<typeof heartbeatChangeView>;
|
|
69
|
+
export declare const agentHeartbeatView: z.ZodObject<{
|
|
70
|
+
read_at: z.ZodISODateTime;
|
|
71
|
+
away: z.ZodBoolean;
|
|
72
|
+
change: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
change_id: z.ZodString;
|
|
74
|
+
state: z.ZodEnum<{
|
|
75
|
+
waiting: "waiting";
|
|
76
|
+
saved: "saved";
|
|
77
|
+
failed: "failed";
|
|
78
|
+
missed: "missed";
|
|
79
|
+
}>;
|
|
80
|
+
on: z.ZodBoolean;
|
|
81
|
+
every: z.ZodInt;
|
|
82
|
+
asked_at: z.ZodISODateTime;
|
|
83
|
+
answered_at: z.ZodOptional<z.ZodISODateTime>;
|
|
84
|
+
message: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
on: z.ZodBoolean;
|
|
87
|
+
every: z.ZodInt;
|
|
88
|
+
choices: z.ZodArray<z.ZodInt>;
|
|
89
|
+
editable: z.ZodBoolean;
|
|
90
|
+
why_read_only: z.ZodOptional<z.ZodString>;
|
|
91
|
+
agent_id: z.ZodString;
|
|
92
|
+
harness_id: z.ZodString;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export type AgentHeartbeatView = z.infer<typeof agentHeartbeatView>;
|
|
95
|
+
export declare const heartbeatChangeFrame: z.ZodObject<{
|
|
96
|
+
frame: z.ZodLiteral<"heartbeat.change">;
|
|
97
|
+
change_id: z.ZodString;
|
|
98
|
+
harness_id: z.ZodString;
|
|
99
|
+
agent_id: z.ZodString;
|
|
100
|
+
on: z.ZodBoolean;
|
|
101
|
+
every: z.ZodInt;
|
|
102
|
+
asked_by: z.ZodString;
|
|
103
|
+
asked_at: z.ZodISODateTime;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export type HeartbeatChangeFrame = z.infer<typeof heartbeatChangeFrame>;
|
|
106
|
+
//# sourceMappingURL=agent-heartbeats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-heartbeats.d.ts","sourceRoot":"","sources":["../../src/agent-heartbeats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAA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