@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,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every Agent Connect event is an envelope plus a payload. The envelope is the part Chips
|
|
3
|
+
* itself reads: who acted, in which workspace, on which run, and — for anything a client
|
|
4
|
+
* sends — the key that makes replaying it safe.
|
|
5
|
+
*
|
|
6
|
+
* The shape is fixed by Appendix C of the technical plan.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
/** The protocol version this build speaks. Breaking changes only at a major, after 1.0. */
|
|
10
|
+
export declare const PROTOCOL_VERSION: 1;
|
|
11
|
+
export declare const envelope: z.ZodObject<{
|
|
12
|
+
v: z.ZodLiteral<1>;
|
|
13
|
+
type: z.ZodString;
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
ts: z.ZodISODateTime;
|
|
16
|
+
workspace_id: z.ZodString;
|
|
17
|
+
space_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
run_id: z.ZodOptional<z.ZodString>;
|
|
19
|
+
seq: z.ZodOptional<z.ZodInt>;
|
|
20
|
+
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
21
|
+
actor: z.ZodObject<{
|
|
22
|
+
kind: z.ZodEnum<{
|
|
23
|
+
person: "person";
|
|
24
|
+
harness: "harness";
|
|
25
|
+
agent: "agent";
|
|
26
|
+
system: "system";
|
|
27
|
+
}>;
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
harness_id: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type Envelope = z.infer<typeof envelope>;
|
|
33
|
+
/**
|
|
34
|
+
* Which way an event travels. `workspace` events never leave Chips: they record a human action
|
|
35
|
+
* on the workspace itself, so the read models that depend on them can be replayed (ADR 0018).
|
|
36
|
+
*/
|
|
37
|
+
export type Direction = "harness_to_chips" | "chips_to_harness" | "workspace";
|
|
38
|
+
/**
|
|
39
|
+
* Who writes an event (agents review, finding 1): a harness with its token, a person with a device
|
|
40
|
+
* key, either, or Chips alone. `chips` is refused from every client: Chips writes it itself, as it
|
|
41
|
+
* delivers or from what it already knows. Said for every event, so a new one cannot default to
|
|
42
|
+
* "anybody may".
|
|
43
|
+
*/
|
|
44
|
+
export type EventSender = "harness" | "person" | "either" | "chips";
|
|
45
|
+
/** The description of one event type: everything the schema, the docs and the tests need. */
|
|
46
|
+
export interface EventDefinition<TType extends string = string> {
|
|
47
|
+
/** The wire value of `type`. */
|
|
48
|
+
readonly type: TType;
|
|
49
|
+
readonly direction: Direction;
|
|
50
|
+
/** Who may send it through the door. The direction says who hears it; this says who writes it. */
|
|
51
|
+
readonly sender: EventSender;
|
|
52
|
+
/**
|
|
53
|
+
* The fields of its payload that are Chips's to write and not derived again at the door: a value
|
|
54
|
+
* a sender wrote is dropped before the schema sees the event (agents review, finding 2).
|
|
55
|
+
*/
|
|
56
|
+
readonly chipsWrites?: readonly string[];
|
|
57
|
+
/** One sentence, in the product voice. Becomes the reference page's opening line. */
|
|
58
|
+
readonly summary: string;
|
|
59
|
+
/** The fields this event adds to the envelope. */
|
|
60
|
+
readonly payload: z.ZodObject;
|
|
61
|
+
/** Whether a harness may send this without a `run_id`. */
|
|
62
|
+
readonly requiresRun: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Build the full schema for an event: the envelope, its `type` narrowed, and its payload. */
|
|
65
|
+
export declare function eventSchema<TType extends string>(definition: EventDefinition<TType>): z.ZodObject<{
|
|
66
|
+
[x: string]: any;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
/** Helper for declaring a definition without losing the literal type of `type`. */
|
|
69
|
+
export declare function defineEvent<TType extends string>(definition: EventDefinition<TType>): EventDefinition<TType>;
|
|
70
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAE3C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;iBA0BuC,CAAC;AAE7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpE,6FAA6F;AAC7F,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM;IAC5D,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,KAAK,SAAS,MAAM,EAAE,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC;;kBAKnF;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK,SAAS,MAAM,EAC9C,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC,GACjC,eAAe,CAAC,KAAK,CAAC,CAExB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every Agent Connect event is an envelope plus a payload. The envelope is the part Chips
|
|
3
|
+
* itself reads: who acted, in which workspace, on which run, and — for anything a client
|
|
4
|
+
* sends — the key that makes replaying it safe.
|
|
5
|
+
*
|
|
6
|
+
* The shape is fixed by Appendix C of the technical plan.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { actor, id, isoTimestamp } from "./primitives.js";
|
|
10
|
+
/** The protocol version this build speaks. Breaking changes only at a major, after 1.0. */
|
|
11
|
+
export const PROTOCOL_VERSION = 1;
|
|
12
|
+
export const envelope = z
|
|
13
|
+
.object({
|
|
14
|
+
v: z.literal(PROTOCOL_VERSION).describe("Protocol major version."),
|
|
15
|
+
type: z.string().min(1).describe("The event type, for example `approval.request`."),
|
|
16
|
+
id: id("event").describe("The event's own id. Stable across a retry of the same event."),
|
|
17
|
+
ts: isoTimestamp.describe("When it happened, by Chips' clock. Stamped on the way in; a value the sender writes is replaced."),
|
|
18
|
+
workspace_id: id("workspace"),
|
|
19
|
+
space_id: id("space").optional().describe("The space, when the event belongs to one."),
|
|
20
|
+
run_id: id("run").optional().describe("The run, when the event belongs to one."),
|
|
21
|
+
seq: z
|
|
22
|
+
.int()
|
|
23
|
+
.positive()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Assigned by the server on append, monotonic per workspace. Absent on the way in."),
|
|
26
|
+
idempotency_key: z
|
|
27
|
+
.string()
|
|
28
|
+
.min(1)
|
|
29
|
+
.max(200)
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Required on every client-originated write. Sending the same key twice is a no-op."),
|
|
32
|
+
actor,
|
|
33
|
+
})
|
|
34
|
+
.describe("The fields every Agent Connect event carries.");
|
|
35
|
+
/** Build the full schema for an event: the envelope, its `type` narrowed, and its payload. */
|
|
36
|
+
export function eventSchema(definition) {
|
|
37
|
+
return envelope
|
|
38
|
+
.extend({ type: z.literal(definition.type) })
|
|
39
|
+
.extend(definition.payload.shape)
|
|
40
|
+
.describe(definition.summary);
|
|
41
|
+
}
|
|
42
|
+
/** Helper for declaring a definition without losing the literal type of `type`. */
|
|
43
|
+
export function defineEvent(definition) {
|
|
44
|
+
return definition;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=envelope.js.map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CAA+C,CAAC,CAAC;AAsC7D,8FAA8F;AAC9F,MAAM,UAAU,WAAW,CAAuB,UAAkC;IAClF,OAAO,QAAQ;SACZ,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;SAC5C,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;SAChC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,WAAW,CACzB,UAAkC;IAElC,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The catalogue is the single list of every Agent Connect event. The schemas, the generated
|
|
3
|
+
* JSON Schema, the generated types, the reference pages and the fixture tests are all reads
|
|
4
|
+
* of this one array, so an event cannot exist in one of them and not the others.
|
|
5
|
+
*/
|
|
6
|
+
import type { z } from "zod";
|
|
7
|
+
import { type EventDefinition } from "../envelope.js";
|
|
8
|
+
import { CHIPS_TO_HARNESS } from "./chips-to-harness.js";
|
|
9
|
+
import { HARNESS_TO_CHIPS } from "./harness-to-chips.js";
|
|
10
|
+
import { WORKSPACE_EVENTS } from "./workspace.js";
|
|
11
|
+
/** Every event in the log: Agent Connect in both directions, then Chips' own (ADR 0018). */
|
|
12
|
+
export declare const EVENTS: readonly EventDefinition[];
|
|
13
|
+
/** Every event type, as a plain list of strings. */
|
|
14
|
+
export declare const EVENT_TYPES: readonly string[];
|
|
15
|
+
export type HarnessToChipsType = (typeof HARNESS_TO_CHIPS)[number]["type"];
|
|
16
|
+
export type ChipsToHarnessType = (typeof CHIPS_TO_HARNESS)[number]["type"];
|
|
17
|
+
export type WorkspaceEventType = (typeof WORKSPACE_EVENTS)[number]["type"];
|
|
18
|
+
export type EventType = HarnessToChipsType | ChipsToHarnessType | WorkspaceEventType;
|
|
19
|
+
/** The definition for one event type, or undefined when nothing declares it. */
|
|
20
|
+
export declare function eventDefinition(type: string): EventDefinition | undefined;
|
|
21
|
+
export declare function schemaFor(type: string): z.ZodObject | undefined;
|
|
22
|
+
/** Every schema, keyed by event type. Used by the generators. */
|
|
23
|
+
export declare const EVENT_SCHEMAS: ReadonlyMap<string, z.ZodObject>;
|
|
24
|
+
export declare class UnknownEventTypeError extends Error {
|
|
25
|
+
readonly type: string;
|
|
26
|
+
readonly name = "UnknownEventTypeError";
|
|
27
|
+
constructor(type: string);
|
|
28
|
+
}
|
|
29
|
+
export interface ParseFailure {
|
|
30
|
+
readonly type: "unknown_type" | "invalid";
|
|
31
|
+
readonly message: string;
|
|
32
|
+
readonly issues?: readonly {
|
|
33
|
+
path: string;
|
|
34
|
+
message: string;
|
|
35
|
+
}[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Validate one event from the wire. This is the edge: everything inside trusts the result and
|
|
39
|
+
* does not re-validate (technical-plan 6.1). A field the schema does not declare is dropped, and
|
|
40
|
+
* `dropped` names those at the top level, so whoever sent them can be told (ADR 0162).
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseEvent(input: unknown): {
|
|
43
|
+
ok: true;
|
|
44
|
+
value: Record<string, unknown>;
|
|
45
|
+
dropped: readonly string[];
|
|
46
|
+
} | {
|
|
47
|
+
ok: false;
|
|
48
|
+
error: ParseFailure;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=catalogue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../../../src/events/catalogue.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CA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AC;CAChE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,GAEZ;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACxE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CA4BrC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The catalogue is the single list of every Agent Connect event. The schemas, the generated
|
|
3
|
+
* JSON Schema, the generated types, the reference pages and the fixture tests are all reads
|
|
4
|
+
* of this one array, so an event cannot exist in one of them and not the others.
|
|
5
|
+
*/
|
|
6
|
+
import { eventSchema } from "../envelope.js";
|
|
7
|
+
import { CHIPS_TO_HARNESS } from "./chips-to-harness.js";
|
|
8
|
+
import { HARNESS_TO_CHIPS } from "./harness-to-chips.js";
|
|
9
|
+
import { WORKSPACE_EVENTS } from "./workspace.js";
|
|
10
|
+
/** Every event in the log: Agent Connect in both directions, then Chips' own (ADR 0018). */
|
|
11
|
+
export const EVENTS = [
|
|
12
|
+
...HARNESS_TO_CHIPS,
|
|
13
|
+
...CHIPS_TO_HARNESS,
|
|
14
|
+
...WORKSPACE_EVENTS,
|
|
15
|
+
];
|
|
16
|
+
/** Every event type, as a plain list of strings. */
|
|
17
|
+
export const EVENT_TYPES = EVENTS.map((event) => event.type);
|
|
18
|
+
const byType = new Map(EVENTS.map((event) => [event.type, event]));
|
|
19
|
+
/** The definition for one event type, or undefined when nothing declares it. */
|
|
20
|
+
export function eventDefinition(type) {
|
|
21
|
+
return byType.get(type);
|
|
22
|
+
}
|
|
23
|
+
/** The full schema — envelope plus payload — for one event type. */
|
|
24
|
+
const schemas = new Map(EVENTS.map((event) => [event.type, eventSchema(event)]));
|
|
25
|
+
export function schemaFor(type) {
|
|
26
|
+
return schemas.get(type);
|
|
27
|
+
}
|
|
28
|
+
/** Every schema, keyed by event type. Used by the generators. */
|
|
29
|
+
export const EVENT_SCHEMAS = schemas;
|
|
30
|
+
export class UnknownEventTypeError extends Error {
|
|
31
|
+
type;
|
|
32
|
+
name = "UnknownEventTypeError";
|
|
33
|
+
constructor(type) {
|
|
34
|
+
super(`no schema is declared for event type ${JSON.stringify(type)}`);
|
|
35
|
+
this.type = type;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Validate one event from the wire. This is the edge: everything inside trusts the result and
|
|
40
|
+
* does not re-validate (technical-plan 6.1). A field the schema does not declare is dropped, and
|
|
41
|
+
* `dropped` names those at the top level, so whoever sent them can be told (ADR 0162).
|
|
42
|
+
*/
|
|
43
|
+
export function parseEvent(input) {
|
|
44
|
+
const type = input?.type;
|
|
45
|
+
if (typeof type !== "string") {
|
|
46
|
+
return { ok: false, error: { type: "unknown_type", message: "event has no `type`" } };
|
|
47
|
+
}
|
|
48
|
+
const schema = schemas.get(type);
|
|
49
|
+
if (schema === undefined) {
|
|
50
|
+
return { ok: false, error: { type: "unknown_type", message: `unknown event type ${type}` } };
|
|
51
|
+
}
|
|
52
|
+
const parsed = schema.safeParse(input);
|
|
53
|
+
if (!parsed.success) {
|
|
54
|
+
return {
|
|
55
|
+
ok: false,
|
|
56
|
+
error: {
|
|
57
|
+
type: "invalid",
|
|
58
|
+
message: `${type} is not valid`,
|
|
59
|
+
issues: parsed.error.issues.map((issue) => ({
|
|
60
|
+
path: issue.path.join(".") || "(root)",
|
|
61
|
+
message: issue.message,
|
|
62
|
+
})),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const value = parsed.data;
|
|
67
|
+
const dropped = Object.keys(input).filter((key) => !Object.hasOwn(value, key));
|
|
68
|
+
return { ok: true, value, dropped };
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=catalogue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AM,KAAK,GAAG,MAAM,CAAC,IAA+B,CAAC;IACrD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IACzF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Events Chips sends to a harness.
|
|
3
|
+
*
|
|
4
|
+
* The harness keeps its own loop, memory and tools. What it gains is structured asks and a
|
|
5
|
+
* stable multi-user story: it sees a sender id and a role, and treats Chips as one trusted
|
|
6
|
+
* account (blueprint, Connect).
|
|
7
|
+
*/
|
|
8
|
+
export declare const hello: import("../envelope.js").EventDefinition<"hello">;
|
|
9
|
+
export declare const messageNew: import("../envelope.js").EventDefinition<"message.new">;
|
|
10
|
+
export declare const messageOverheard: import("../envelope.js").EventDefinition<"message.overheard">;
|
|
11
|
+
export declare const runRequested: import("../envelope.js").EventDefinition<"run.requested">;
|
|
12
|
+
export declare const approvalResolved: import("../envelope.js").EventDefinition<"approval.resolved">;
|
|
13
|
+
export declare const questionAnswered: import("../envelope.js").EventDefinition<"question.answered">;
|
|
14
|
+
export declare const runSteer: import("../envelope.js").EventDefinition<"run.steer">;
|
|
15
|
+
export declare const runPause: import("../envelope.js").EventDefinition<"run.pause">;
|
|
16
|
+
export declare const runResume: import("../envelope.js").EventDefinition<"run.resume">;
|
|
17
|
+
export declare const runCancel: import("../envelope.js").EventDefinition<"run.cancel">;
|
|
18
|
+
export declare const policyUpdated: import("../envelope.js").EventDefinition<"policy.updated">;
|
|
19
|
+
/**
|
|
20
|
+
* Eighty percent of a ceiling spent, or all of it. For a harness's budget, or since ADR 0118 for a
|
|
21
|
+
* room's job (`scope: "job"`): the room's harnesses are told once per job at each, in the room
|
|
22
|
+
* (`space_id`), and at a hundred Chips has paused the agents there (`exchange.set` with `why:
|
|
23
|
+
* "spend"`) until a person acts. A harness that chains turns itself starts no new one in that
|
|
24
|
+
* room until then; one that runs a turn per message needs do nothing, since the room holds what
|
|
25
|
+
* its agents say to each other.
|
|
26
|
+
*/
|
|
27
|
+
export declare const budgetWarning: import("../envelope.js").EventDefinition<"budget.warning">;
|
|
28
|
+
export declare const laneUpdated: import("../envelope.js").EventDefinition<"lane.updated">;
|
|
29
|
+
/**
|
|
30
|
+
* Sent by a person, like a steer: the direction says who hears it. Chips fills in `from` and
|
|
31
|
+
* delivers it to the harness whose message it is, and to everyone in the space.
|
|
32
|
+
*/
|
|
33
|
+
export declare const feedback: import("../envelope.js").EventDefinition<"feedback">;
|
|
34
|
+
export declare const receipt: import("../envelope.js").EventDefinition<"receipt">;
|
|
35
|
+
/** Every event Chips may send, in the order the reference lists them. */
|
|
36
|
+
export declare const CHIPS_TO_HARNESS: readonly [import("../envelope.js").EventDefinition<"hello">, import("../envelope.js").EventDefinition<"message.new">, import("../envelope.js").EventDefinition<"message.overheard">, import("../envelope.js").EventDefinition<"run.requested">, import("../envelope.js").EventDefinition<"approval.resolved">, import("../envelope.js").EventDefinition<"question.answered">, import("../envelope.js").EventDefinition<"run.steer">, import("../envelope.js").EventDefinition<"run.pause">, import("../envelope.js").EventDefinition<"run.resume">, import("../envelope.js").EventDefinition<"run.cancel">, import("../envelope.js").EventDefinition<"policy.updated">, import("../envelope.js").EventDefinition<"budget.warning">, import("../envelope.js").EventDefinition<"lane.updated">, import("../envelope.js").EventDefinition<"feedback">, import("../envelope.js").EventDefinition<"receipt">];
|
|
37
|
+
//# sourceMappingURL=chips-to-harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chips-to-harness.d.ts","sourceRoot":"","sources":["../../../src/events/chips-to-harness.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiEH,eAAO,MAAM,KAAK,mDAwDhB,CAAC;AA+DH,eAAO,MAAM,UAAU,yDAmCrB,CAAC;AAEH,eAAO,MAAM,gBAAgB,+DAe3B,CAAC;AAEH,eAAO,MAAM,YAAY,2DA0DvB,CAAC;AAEH,eAAO,MAAM,gBAAgB,+DA+C3B,CAAC;AAEH,eAAO,MAAM,gBAAgB,+DAgC3B,CAAC;AAEH,eAAO,MAAM,QAAQ,uDAanB,CAAC;AAEH,eAAO,MAAM,QAAQ,uDAenB,CAAC;AAEH,eAAO,MAAM,SAAS,wDAkBpB,CAAC;AAEH,eAAO,MAAM,SAAS,wDAgBpB,CAAC;AAEH,eAAO,MAAM,aAAa,4DA2BxB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,4DA6BxB,CAAC;AAEH,eAAO,MAAM,WAAW,0DAqCtB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,sDA2BnB,CAAC;AAEH,eAAO,MAAM,OAAO,qDAYlB,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,02BAgBnB,CAAC"}
|