@chipschat/protocol 1.0.0 → 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.
Files changed (53) hide show
  1. package/package.json +2 -1
  2. package/dist/envelope.d.ts +0 -54
  3. package/dist/envelope.d.ts.map +0 -1
  4. package/dist/envelope.js +0 -48
  5. package/dist/envelope.js.map +0 -1
  6. package/dist/events/agent-to-chips.d.ts +0 -27
  7. package/dist/events/agent-to-chips.d.ts.map +0 -1
  8. package/dist/events/agent-to-chips.js +0 -392
  9. package/dist/events/agent-to-chips.js.map +0 -1
  10. package/dist/events/catalogue.d.ts +0 -48
  11. package/dist/events/catalogue.d.ts.map +0 -1
  12. package/dist/events/catalogue.js +0 -67
  13. package/dist/events/catalogue.js.map +0 -1
  14. package/dist/events/chips-to-agent.d.ts +0 -24
  15. package/dist/events/chips-to-agent.d.ts.map +0 -1
  16. package/dist/events/chips-to-agent.js +0 -324
  17. package/dist/events/chips-to-agent.js.map +0 -1
  18. package/dist/events/chips-to-harness.d.ts +0 -24
  19. package/dist/events/chips-to-harness.d.ts.map +0 -1
  20. package/dist/events/chips-to-harness.js +0 -324
  21. package/dist/events/chips-to-harness.js.map +0 -1
  22. package/dist/events/harness-to-chips.d.ts +0 -27
  23. package/dist/events/harness-to-chips.d.ts.map +0 -1
  24. package/dist/events/harness-to-chips.js +0 -390
  25. package/dist/events/harness-to-chips.js.map +0 -1
  26. package/dist/events/index.d.ts +0 -6
  27. package/dist/events/index.d.ts.map +0 -1
  28. package/dist/events/index.js +0 -5
  29. package/dist/events/index.js.map +0 -1
  30. package/dist/events/workspace.d.ts +0 -19
  31. package/dist/events/workspace.d.ts.map +0 -1
  32. package/dist/events/workspace.js +0 -79
  33. package/dist/events/workspace.js.map +0 -1
  34. package/dist/frames.d.ts +0 -175
  35. package/dist/frames.d.ts.map +0 -1
  36. package/dist/frames.js +0 -161
  37. package/dist/frames.js.map +0 -1
  38. package/dist/ids/index.d.ts +0 -3
  39. package/dist/ids/index.d.ts.map +0 -1
  40. package/dist/ids/index.js +0 -2
  41. package/dist/ids/index.js.map +0 -1
  42. package/dist/ids/ulid.d.ts +0 -83
  43. package/dist/ids/ulid.d.ts.map +0 -1
  44. package/dist/ids/ulid.js +0 -199
  45. package/dist/ids/ulid.js.map +0 -1
  46. package/dist/index.d.ts +0 -18
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/index.js +0 -13
  49. package/dist/index.js.map +0 -1
  50. package/dist/primitives.d.ts +0 -194
  51. package/dist/primitives.d.ts.map +0 -1
  52. package/dist/primitives.js +0 -193
  53. package/dist/primitives.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipschat/protocol",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Agent Connect: the canonical Zod schemas, the identifier vocabulary, and everything generated from them.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://chipschat.ai/reference/",
@@ -9,6 +9,7 @@
9
9
  "url": "git+https://github.com/arjungupta99/chips.git",
10
10
  "directory": "packages/protocol"
11
11
  },
12
+ "bugs": "https://github.com/arjungupta99/chips/issues",
12
13
  "type": "module",
13
14
  "exports": {
14
15
  ".": {
@@ -1,54 +0,0 @@
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
- conversation_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
- agent: "agent";
25
- system: "system";
26
- }>;
27
- id: z.ZodString;
28
- }, z.core.$strip>;
29
- }, z.core.$strip>;
30
- export type Envelope = z.infer<typeof envelope>;
31
- /**
32
- * Which way an event travels. `workspace` events never leave Chips: they record a human action
33
- * on the workspace itself, so the read models that depend on them can be replayed (ADR 0018).
34
- */
35
- export type Direction = "agent_to_chips" | "chips_to_agent" | "workspace";
36
- /** The description of one event type: everything the schema, the docs and the tests need. */
37
- export interface EventDefinition<TType extends string = string> {
38
- /** The wire value of `type`. */
39
- readonly type: TType;
40
- readonly direction: Direction;
41
- /** One sentence, in the product voice. Becomes the reference page's opening line. */
42
- readonly summary: string;
43
- /** The fields this event adds to the envelope. */
44
- readonly payload: z.ZodObject;
45
- /** Whether an agent may send this without a `run_id`. */
46
- readonly requiresRun: boolean;
47
- }
48
- /** Build the full schema for an event: the envelope, its `type` narrowed, and its payload. */
49
- export declare function eventSchema<TType extends string>(definition: EventDefinition<TType>): z.ZodObject<{
50
- [x: string]: any;
51
- }, z.core.$strip>;
52
- /** Helper for declaring a definition without losing the literal type of `type`. */
53
- export declare function defineEvent<TType extends string>(definition: EventDefinition<TType>): EventDefinition<TType>;
54
- //# sourceMappingURL=envelope.d.ts.map
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;;iBA4BuC,CAAC;AAE7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAE1E,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,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;IAC9B,yDAAyD;IACzD,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"}
package/dist/envelope.js DELETED
@@ -1,48 +0,0 @@
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
- conversation_id: id("conversation")
20
- .optional()
21
- .describe("The conversation, when the event belongs to one."),
22
- run_id: id("run").optional().describe("The run, when the event belongs to one."),
23
- seq: z
24
- .int()
25
- .positive()
26
- .optional()
27
- .describe("Assigned by the server on append, monotonic per workspace. Absent on the way in."),
28
- idempotency_key: z
29
- .string()
30
- .min(1)
31
- .max(200)
32
- .optional()
33
- .describe("Required on every client-originated write. Sending the same key twice is a no-op."),
34
- actor,
35
- })
36
- .describe("The fields every Agent Connect event carries.");
37
- /** Build the full schema for an event: the envelope, its `type` narrowed, and its payload. */
38
- export function eventSchema(definition) {
39
- return envelope
40
- .extend({ type: z.literal(definition.type) })
41
- .extend(definition.payload.shape)
42
- .describe(definition.summary);
43
- }
44
- /** Helper for declaring a definition without losing the literal type of `type`. */
45
- export function defineEvent(definition) {
46
- return definition;
47
- }
48
- //# sourceMappingURL=envelope.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1D,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAU,CAAC;AAE3C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAClE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IACnF,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,8DAA8D,CAAC;IACxF,EAAE,EAAE,YAAY,CAAC,QAAQ,CACvB,kGAAkG,CACnG;IACD,YAAY,EAAE,EAAE,CAAC,WAAW,CAAC;IAC7B,eAAe,EAAE,EAAE,CAAC,cAAc,CAAC;SAChC,QAAQ,EAAE;SACV,QAAQ,CAAC,kDAAkD,CAAC;IAC/D,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAChF,GAAG,EAAE,CAAC;SACH,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,kFAAkF,CAAC;IAC/F,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,mFAAmF,CACpF;IACH,KAAK;CACN,CAAC;KACD,QAAQ,CAAC,+CAA+C,CAAC,CAAC;AAuB7D,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"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Events an agent sends to Chips.
3
- *
4
- * The interface is progressive (blueprint, Connect): the minimum is three events — a run
5
- * started, a message, a run completed. Every extra event upgrades what the person sees. Send
6
- * step logs and you get receipts; send approval requests and you get approval cards; send
7
- * context usage and you get the context ring.
8
- */
9
- export declare const runStarted: import("../envelope.js").EventDefinition<"run.started">;
10
- export declare const runStatus: import("../envelope.js").EventDefinition<"run.status">;
11
- export declare const runPlan: import("../envelope.js").EventDefinition<"run.plan">;
12
- export declare const stepLog: import("../envelope.js").EventDefinition<"step.log">;
13
- export declare const messagePost: import("../envelope.js").EventDefinition<"message.post">;
14
- export declare const approvalRequest: import("../envelope.js").EventDefinition<"approval.request">;
15
- export declare const questionAsk: import("../envelope.js").EventDefinition<"question.ask">;
16
- export declare const artifactCreate: import("../envelope.js").EventDefinition<"artifact.create">;
17
- export declare const checkpoint: import("../envelope.js").EventDefinition<"checkpoint">;
18
- export declare const handoff: import("../envelope.js").EventDefinition<"handoff">;
19
- export declare const task: import("../envelope.js").EventDefinition<"task">;
20
- export declare const usage: import("../envelope.js").EventDefinition<"usage">;
21
- export declare const contextUsage: import("../envelope.js").EventDefinition<"context.usage">;
22
- export declare const approvalExecuted: import("../envelope.js").EventDefinition<"approval.executed">;
23
- export declare const runCompleted: import("../envelope.js").EventDefinition<"run.completed">;
24
- export declare const runFailed: import("../envelope.js").EventDefinition<"run.failed">;
25
- /** Every event an agent may send, in the order the reference lists them. */
26
- export declare const AGENT_TO_CHIPS: readonly [import("../envelope.js").EventDefinition<"run.started">, import("../envelope.js").EventDefinition<"run.status">, import("../envelope.js").EventDefinition<"run.plan">, import("../envelope.js").EventDefinition<"step.log">, import("../envelope.js").EventDefinition<"message.post">, import("../envelope.js").EventDefinition<"approval.request">, import("../envelope.js").EventDefinition<"question.ask">, import("../envelope.js").EventDefinition<"artifact.create">, import("../envelope.js").EventDefinition<"checkpoint">, import("../envelope.js").EventDefinition<"handoff">, import("../envelope.js").EventDefinition<"task">, import("../envelope.js").EventDefinition<"usage">, import("../envelope.js").EventDefinition<"context.usage">, import("../envelope.js").EventDefinition<"approval.executed">, import("../envelope.js").EventDefinition<"run.completed">, import("../envelope.js").EventDefinition<"run.failed">];
27
- //# sourceMappingURL=agent-to-chips.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-to-chips.d.ts","sourceRoot":"","sources":["../../src/events/agent-to-chips.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4BH,eAAO,MAAM,UAAU,yDAsBrB,CAAC;AAEH,eAAO,MAAM,SAAS,wDAwBpB,CAAC;AAEH,eAAO,MAAM,OAAO,sDAoBlB,CAAC;AAEH,eAAO,MAAM,OAAO,sDAuBlB,CAAC;AAEH,eAAO,MAAM,WAAW,0DAqBtB,CAAC;AAEH,eAAO,MAAM,eAAe,8DAkD1B,CAAC;AAkCH,eAAO,MAAM,WAAW,0DAmBtB,CAAC;AAEH,eAAO,MAAM,cAAc,6DAczB,CAAC;AAEH,eAAO,MAAM,UAAU,wDAarB,CAAC;AAEH,eAAO,MAAM,OAAO,qDAYlB,CAAC;AAEH,eAAO,MAAM,IAAI,kDA0Cf,CAAC;AAEH,eAAO,MAAM,KAAK,mDAahB,CAAC;AAEH,eAAO,MAAM,YAAY,2DAYvB,CAAC;AAEH,eAAO,MAAM,gBAAgB,+DAY3B,CAAC;AAEH,eAAO,MAAM,YAAY,2DAevB,CAAC;AAEH,eAAO,MAAM,SAAS,wDAYpB,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,cAAc,s5BAiBjB,CAAC"}
@@ -1,392 +0,0 @@
1
- /**
2
- * Events an agent sends to Chips.
3
- *
4
- * The interface is progressive (blueprint, Connect): the minimum is three events — a run
5
- * started, a message, a run completed. Every extra event upgrades what the person sees. Send
6
- * step logs and you get receipts; send approval requests and you get approval cards; send
7
- * context usage and you get the context ring.
8
- */
9
- import { z } from "zod";
10
- import { defineEvent } from "../envelope.js";
11
- import { action, approverRef, attachment, autonomyLevel, cost, id, isoTimestamp, preview, riskClass, source, } from "../primitives.js";
12
- const plannedStep = z
13
- .object({
14
- step_id: z
15
- .string()
16
- .min(1)
17
- .max(120)
18
- .describe("Stable for the life of the run, so updates land on the right row."),
19
- title: z.string().min(1).max(300).describe("What this step will do."),
20
- })
21
- .describe("One step of a plan, shown as a hollow dot until it completes.");
22
- export const runStarted = defineEvent({
23
- type: "run.started",
24
- direction: "agent_to_chips",
25
- summary: "An agent has begun a unit of work, optionally with the plan it intends to follow.",
26
- requiresRun: true,
27
- payload: z.object({
28
- goal: z
29
- .string()
30
- .min(1)
31
- .max(4000)
32
- .describe("What the run is for, in the person's words where possible."),
33
- plan: z
34
- .array(plannedStep)
35
- .max(64)
36
- .optional()
37
- .describe("The steps the agent expects to take. The run panel draws one hollow dot each."),
38
- session_ref: z
39
- .string()
40
- .max(500)
41
- .optional()
42
- .describe("A pointer back to the harness's own transcript, so a person can jump to it."),
43
- }),
44
- });
45
- export const runStatus = defineEvent({
46
- type: "run.status",
47
- direction: "agent_to_chips",
48
- summary: "What the agent is doing right now. This is the agent's typing indicator.",
49
- requiresRun: true,
50
- payload: z.object({
51
- phase: z.string().min(1).max(120).describe("A short machine-ish label, for example `reading`."),
52
- verb_phrase: z
53
- .string()
54
- .min(1)
55
- .max(200)
56
- .describe('What to show under the agent\'s name, for example "Reading PO #4471…".'),
57
- progress: z
58
- .number()
59
- .min(0)
60
- .max(1)
61
- .optional()
62
- .describe("Fraction complete, when the agent knows."),
63
- estimate_seconds: z
64
- .int()
65
- .nonnegative()
66
- .optional()
67
- .describe("Seconds remaining, when the agent knows."),
68
- }),
69
- });
70
- export const runPlan = defineEvent({
71
- type: "run.plan",
72
- direction: "agent_to_chips",
73
- summary: "The plan changed. Replaces the steps not yet done; the ones already done or failed keep their place.",
74
- requiresRun: true,
75
- payload: z.object({
76
- plan: z
77
- .array(plannedStep)
78
- .min(1)
79
- .max(64)
80
- .describe("The steps still to come, in order. Steps already done or failed stay ahead of these; a step still to do that is not here is dropped."),
81
- reason: z
82
- .string()
83
- .max(1000)
84
- .optional()
85
- .describe("Why the plan changed, in a sentence: a steer, a surprise, a shortcut."),
86
- }),
87
- });
88
- export const stepLog = defineEvent({
89
- type: "step.log",
90
- direction: "agent_to_chips",
91
- summary: "One tool call or reasoning step, for the receipt and the run timeline.",
92
- requiresRun: true,
93
- payload: z.object({
94
- step_id: z
95
- .string()
96
- .min(1)
97
- .max(120)
98
- .describe("Stable across the started and done events for one step."),
99
- status: z.enum(["started", "done", "failed"]).describe("Where this step got to."),
100
- title: z
101
- .string()
102
- .max(300)
103
- .optional()
104
- .describe("What the step is, when it was not in the plan."),
105
- tool: z.string().max(120).optional().describe("The tool called, for example `drive.read`."),
106
- summary: z.string().max(2000).optional().describe("One line for the receipt."),
107
- sources: z.array(source).max(32).optional().describe("Where the information came from."),
108
- duration_ms: z.int().nonnegative().optional().describe("How long the step took."),
109
- error: z.string().max(2000).optional().describe("Why it failed, when it did."),
110
- }),
111
- });
112
- export const messagePost = defineEvent({
113
- type: "message.post",
114
- direction: "agent_to_chips",
115
- summary: "An agent says something in a conversation, with any attachments.",
116
- requiresRun: false,
117
- payload: z.object({
118
- text: z.string().max(64_000).describe("Markdown, with mentions."),
119
- attachments: z
120
- .array(attachment)
121
- .max(20)
122
- .optional()
123
- .describe("Photos, video, voice notes, files, as the upload described them."),
124
- upload_ids: z
125
- .array(id("attachment"))
126
- .max(20)
127
- .optional()
128
- .describe("Uploads to attach, by the id `POST /v1/uploads` gave. Chips fills in `attachments` from what it stored."),
129
- reply_to: id("message").optional().describe("The message being answered, when it is a reply."),
130
- }),
131
- });
132
- export const approvalRequest = defineEvent({
133
- type: "approval.request",
134
- direction: "agent_to_chips",
135
- summary: "The thing a group chat cannot do: an action, a preview, a risk class, who may answer, and an audit record.",
136
- requiresRun: true,
137
- payload: z.object({
138
- approval_id: id("approval").describe("Minted by the agent, so a retry after a reconnect is the same ask."),
139
- step_id: z.string().min(1).max(120).optional().describe("The plan step this ask belongs to."),
140
- action,
141
- preview: preview
142
- .optional()
143
- .describe("What the approver sees. Omit only when the action speaks for itself."),
144
- risk: z
145
- .array(riskClass)
146
- .max(8)
147
- .describe("Risk classes. The policy engine matches rules against these."),
148
- sources: z
149
- .array(source)
150
- .max(32)
151
- .optional()
152
- .describe("Where the agent got what it is about to act on."),
153
- expires_in: z
154
- .int()
155
- .positive()
156
- .max(604_800)
157
- .describe("Seconds until the approval expires. Every approval has an expiry and a fallback."),
158
- fallback: z
159
- .enum(["deny", "allow"])
160
- .default("deny")
161
- .describe("What happens on expiry. Denying is the default, and the safe one."),
162
- approvers: z
163
- .array(approverRef)
164
- .max(16)
165
- .optional()
166
- .describe("Who may answer. Chips resolves roles."),
167
- editable: z
168
- .boolean()
169
- .default(false)
170
- .describe("Whether the approver may change the input before allowing."),
171
- resume_token: z
172
- .string()
173
- .max(500)
174
- .optional()
175
- .describe("Lets a paused command-line run continue hours later. Approvals outlive processes."),
176
- }),
177
- });
178
- const questionOption = z
179
- .object({
180
- value: z.string().min(1).max(120).describe("What comes back in `question.answered`."),
181
- label: z.string().min(1).max(200).describe("What the person taps."),
182
- description: z.string().max(500).optional().describe("What choosing it means."),
183
- })
184
- .describe("One tappable option.");
185
- const question = z
186
- .object({
187
- question_id: z
188
- .string()
189
- .min(1)
190
- .max(120)
191
- .describe("Stable, so answers land on the right question."),
192
- prompt: z.string().min(1).max(2000).describe("What is being asked."),
193
- options: z.array(questionOption).min(2).max(4).describe("Two to four options."),
194
- multi_select: z
195
- .boolean()
196
- .default(false)
197
- .describe("Whether more than one option may be chosen."),
198
- allow_free_text: z.boolean().default(false).describe("Whether the person may type instead."),
199
- default_value: z
200
- .string()
201
- .max(120)
202
- .optional()
203
- .describe("What the agent will take if nobody answers. Its presence lowers the notification tier."),
204
- })
205
- .describe("One question, with its options.");
206
- export const questionAsk = defineEvent({
207
- type: "question.ask",
208
- direction: "agent_to_chips",
209
- summary: "One to four questions with tappable options, a default, and a timeout.",
210
- requiresRun: true,
211
- payload: z.object({
212
- ask_id: id("question").describe("Minted by the agent, so a retry is the same ask."),
213
- questions: z.array(question).min(1).max(4).describe("One to four questions."),
214
- timeout_seconds: z
215
- .int()
216
- .positive()
217
- .max(604_800)
218
- .optional()
219
- .describe("How long to wait for an answer."),
220
- on_no_answer: z
221
- .enum(["use_default", "cancel", "continue"])
222
- .default("use_default")
223
- .describe("What the agent will do if the timeout passes."),
224
- }),
225
- });
226
- export const artifactCreate = defineEvent({
227
- type: "artifact.create",
228
- direction: "agent_to_chips",
229
- summary: "A file, document, code, image or table the agent produced, with a version.",
230
- requiresRun: false,
231
- payload: z.object({
232
- artifact_id: id("attachment").describe("Content-addressed, like every attachment."),
233
- kind: z.enum(["file", "document", "code", "image", "table"]).describe("How to render it."),
234
- title: z.string().min(1).max(300).describe("What to call it."),
235
- version: z.int().positive().default(1).describe("Bumped when the agent revises it."),
236
- attachment: attachment.optional().describe("The bytes, when the artifact is a file."),
237
- body: z.string().max(1_000_000).optional().describe("The content, when the artifact is text."),
238
- language: z.string().max(60).optional().describe("For code, the language to highlight."),
239
- }),
240
- });
241
- export const checkpoint = defineEvent({
242
- type: "checkpoint",
243
- direction: "agent_to_chips",
244
- summary: "A milestone reached and what is next. Compaction is a checkpoint. FYI tier.",
245
- requiresRun: true,
246
- payload: z.object({
247
- label: z.string().min(1).max(300).describe("The milestone reached."),
248
- next: z.string().max(300).optional().describe("What the agent will do next."),
249
- compacted: z
250
- .boolean()
251
- .default(false)
252
- .describe("True when the agent just compacted its context."),
253
- }),
254
- });
255
- export const handoff = defineEvent({
256
- type: "handoff",
257
- direction: "agent_to_chips",
258
- summary: "Passing work to a person or another agent, with a context summary and what is still open.",
259
- requiresRun: false,
260
- payload: z.object({
261
- to: z.string().min(1).max(120).describe("The participant id receiving the work."),
262
- context_summary: z.string().min(1).max(20_000).describe("What the recipient needs to know."),
263
- open_items: z.array(z.string().max(500)).max(50).optional().describe("What is still undone."),
264
- reason: z.string().max(1000).optional().describe("Why the work is moving."),
265
- }),
266
- });
267
- export const task = defineEvent({
268
- type: "task",
269
- direction: "agent_to_chips",
270
- summary: "Route work to another agent. From a lead this becomes a lane: one object, two views, never a copy.",
271
- requiresRun: false,
272
- payload: z.object({
273
- task_id: id("lane").describe("The lane this task opens."),
274
- to: z
275
- .string()
276
- .min(1)
277
- .max(120)
278
- .describe("The specialist's participant id, or a label for an ephemeral child."),
279
- child: z
280
- .object({
281
- label: z
282
- .string()
283
- .min(1)
284
- .max(120)
285
- .describe("A name for a transient participant Chips will mint."),
286
- })
287
- .optional()
288
- .describe("Names an ephemeral child, which inherits owner, autonomy and budget from the lead."),
289
- on_behalf_of: z.string().min(1).max(120).describe("The person the work is ultimately for."),
290
- origin: id("message").optional().describe("The message that caused this routing."),
291
- goal: z.string().min(1).max(4000).describe("What the specialist is being asked to do."),
292
- constraints: z
293
- .array(z.string().max(500))
294
- .max(20)
295
- .optional()
296
- .describe("Bounds on how to do it."),
297
- deadline: isoTimestamp.optional().describe("When it is needed by."),
298
- autonomy: autonomyLevel
299
- .optional()
300
- .describe("The level for this lane. Never above the lead's own."),
301
- attachments: z.array(attachment).max(20).optional().describe("Anything the specialist needs."),
302
- link_to: id("conversation")
303
- .optional()
304
- .describe("The lead's conversation, where the route card appears."),
305
- }),
306
- });
307
- export const usage = defineEvent({
308
- type: "usage",
309
- direction: "agent_to_chips",
310
- summary: "Tokens and cost for a step, a run or a lane. Cost rolls up the trail and is always an estimate.",
311
- requiresRun: true,
312
- payload: z.object({
313
- scope: z.enum(["step", "run", "lane"]).describe("What the numbers cover."),
314
- model: z.string().min(1).max(120).describe("The model that did the work."),
315
- input_tokens: z.int().nonnegative().describe("Tokens in."),
316
- output_tokens: z.int().nonnegative().describe("Tokens out."),
317
- cost: cost.optional().describe("The estimated cost, when the agent can compute one."),
318
- }),
319
- });
320
- export const contextUsage = defineEvent({
321
- type: "context.usage",
322
- direction: "agent_to_chips",
323
- summary: "How full the agent's context is. Drives the context ring; context stays per agent, never rolled up.",
324
- requiresRun: true,
325
- payload: z.object({
326
- used_tokens: z.int().nonnegative().describe("Tokens currently held."),
327
- limit_tokens: z.int().positive().describe("The window size."),
328
- model: z.string().min(1).max(120).describe("The model whose window this is."),
329
- compacted: z.boolean().default(false).describe("True when the agent just compacted."),
330
- }),
331
- });
332
- export const approvalExecuted = defineEvent({
333
- type: "approval.executed",
334
- direction: "agent_to_chips",
335
- summary: "What happened after a yes. The card changes from `approved` to `sent`, or to `failed`.",
336
- requiresRun: true,
337
- payload: z.object({
338
- approval_id: id("approval"),
339
- outcome: z
340
- .enum(["executed", "failed", "skipped"])
341
- .describe("Whether the action actually happened."),
342
- detail: z.string().max(4000).optional().describe("What was sent, or why it failed."),
343
- }),
344
- });
345
- export const runCompleted = defineEvent({
346
- type: "run.completed",
347
- direction: "agent_to_chips",
348
- summary: "The run is done. Posts a summary card and moves the status pill to Done.",
349
- requiresRun: true,
350
- payload: z.object({
351
- summary: z.string().min(1).max(20_000).describe("The outcome, in the product voice."),
352
- changed: z.array(z.string().max(500)).max(50).optional().describe("What changed in the world."),
353
- follow_ups: z
354
- .array(z.string().max(500))
355
- .max(50)
356
- .optional()
357
- .describe("What is worth doing next."),
358
- cost: cost.optional().describe("The run's estimated cost."),
359
- }),
360
- });
361
- export const runFailed = defineEvent({
362
- type: "run.failed",
363
- direction: "agent_to_chips",
364
- summary: "The run stopped without finishing. Says what was left undone, so a person can pick it up.",
365
- requiresRun: true,
366
- payload: z.object({
367
- error: z.string().min(1).max(4000).describe("What went wrong."),
368
- left_undone: z.array(z.string().max(500)).max(50).optional().describe("What did not get done."),
369
- retryable: z.boolean().default(false).describe("Whether running it again might work."),
370
- cost: cost.optional().describe("What was spent before it failed."),
371
- }),
372
- });
373
- /** Every event an agent may send, in the order the reference lists them. */
374
- export const AGENT_TO_CHIPS = [
375
- runStarted,
376
- runStatus,
377
- runPlan,
378
- stepLog,
379
- messagePost,
380
- approvalRequest,
381
- questionAsk,
382
- artifactCreate,
383
- checkpoint,
384
- handoff,
385
- task,
386
- usage,
387
- contextUsage,
388
- approvalExecuted,
389
- runCompleted,
390
- runFailed,
391
- ];
392
- //# sourceMappingURL=agent-to-chips.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-to-chips.js","sourceRoot":"","sources":["../../src/events/agent-to-chips.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,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AAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAC/D,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC/F,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QACtF,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KACnE,CAAC;CACH,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU;IACV,SAAS;IACT,OAAO;IACP,OAAO;IACP,WAAW;IACX,eAAe;IACf,WAAW;IACX,cAAc;IACd,UAAU;IACV,OAAO;IACP,IAAI;IACJ,KAAK;IACL,YAAY;IACZ,gBAAgB;IAChB,YAAY;IACZ,SAAS;CACD,CAAC"}
@@ -1,48 +0,0 @@
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 { AGENT_TO_CHIPS } from "./agent-to-chips.js";
9
- import { CHIPS_TO_AGENT } from "./chips-to-agent.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 AgentToChipsType = (typeof AGENT_TO_CHIPS)[number]["type"];
16
- export type ChipsToAgentType = (typeof CHIPS_TO_AGENT)[number]["type"];
17
- export type WorkspaceEventType = (typeof WORKSPACE_EVENTS)[number]["type"];
18
- export type EventType = AgentToChipsType | ChipsToAgentType | 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).
40
- */
41
- export declare function parseEvent(input: unknown): {
42
- ok: true;
43
- value: Record<string, unknown>;
44
- } | {
45
- ok: false;
46
- error: ParseFailure;
47
- };
48
- //# sourceMappingURL=catalogue.d.ts.map
@@ -1 +0,0 @@
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,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,4FAA4F;AAC5F,eAAO,MAAM,MAAM,EAAE,SAAS,eAAe,EAI5C,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,WAAW,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