@chipschat/conformance 0.0.0-stage → 1.0.0

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 (59) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +34 -2
  3. package/dist/checks.d.ts +29 -0
  4. package/dist/checks.d.ts.map +1 -0
  5. package/dist/checks.js +133 -0
  6. package/dist/checks.js.map +1 -0
  7. package/dist/exchange.d.ts +30 -0
  8. package/dist/exchange.d.ts.map +1 -0
  9. package/dist/exchange.js +102 -0
  10. package/dist/exchange.js.map +1 -0
  11. package/dist/fake-chips.d.ts +130 -0
  12. package/dist/fake-chips.d.ts.map +1 -0
  13. package/dist/fake-chips.js +1642 -0
  14. package/dist/fake-chips.js.map +1 -0
  15. package/dist/fake-join.d.ts +56 -0
  16. package/dist/fake-join.d.ts.map +1 -0
  17. package/dist/fake-join.js +181 -0
  18. package/dist/fake-join.js.map +1 -0
  19. package/dist/index.d.ts +20 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +14 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/project.d.ts +39 -0
  24. package/dist/project.d.ts.map +1 -0
  25. package/dist/project.js +254 -0
  26. package/dist/project.js.map +1 -0
  27. package/dist/report.d.ts +65 -0
  28. package/dist/report.d.ts.map +1 -0
  29. package/dist/report.js +142 -0
  30. package/dist/report.js.map +1 -0
  31. package/dist/room-files.d.ts +54 -0
  32. package/dist/room-files.d.ts.map +1 -0
  33. package/dist/room-files.js +144 -0
  34. package/dist/room-files.js.map +1 -0
  35. package/dist/scenario.d.ts +41 -0
  36. package/dist/scenario.d.ts.map +1 -0
  37. package/dist/scenario.js +414 -0
  38. package/dist/scenario.js.map +1 -0
  39. package/dist/settings.d.ts +60 -0
  40. package/dist/settings.d.ts.map +1 -0
  41. package/dist/settings.js +142 -0
  42. package/dist/settings.js.map +1 -0
  43. package/dist/spend.d.ts +20 -0
  44. package/dist/spend.d.ts.map +1 -0
  45. package/dist/spend.js +50 -0
  46. package/dist/spend.js.map +1 -0
  47. package/dist/subject.d.ts +55 -0
  48. package/dist/subject.d.ts.map +1 -0
  49. package/dist/subject.js +22 -0
  50. package/dist/subject.js.map +1 -0
  51. package/dist/waiting.d.ts +12 -0
  52. package/dist/waiting.d.ts.map +1 -0
  53. package/dist/waiting.js +30 -0
  54. package/dist/waiting.js.map +1 -0
  55. package/dist/workspace.d.ts +893 -0
  56. package/dist/workspace.d.ts.map +1 -0
  57. package/dist/workspace.js +3160 -0
  58. package/dist/workspace.js.map +1 -0
  59. package/package.json +38 -3
@@ -0,0 +1,60 @@
1
+ /**
2
+ * What a person changes about an agent from its page (ADRs 0134, 0140, 0143, 0146), and about a
3
+ * harness's own jobs from its page (ADR 0252), as the fake plays it. A harness's copies are taken whole and checked against the protocol's own schemas, as
4
+ * the real door checks them; the answer a copy carries is kept; and a person's change is a frame
5
+ * built from the copy as it stands. The kit asks for what the copy already says (the same model,
6
+ * the same heartbeat, the same limit, the same text), so a harness that answers changes nothing
7
+ * it would not have, and one that refuses has said why.
8
+ */
9
+ import { type IdGenerator } from "@chipschat/protocol";
10
+ /** One of the four copies, the harness's own shared files beside an agent's, and its own jobs. */
11
+ export type SettingKind = "context" | "harness-context" | "model" | "heartbeat" | "context-window" | "jobs";
12
+ /** What a socket says in its `hello` to be sent a kind's frames. */
13
+ export declare const ACCEPTS: Readonly<Record<SettingKind, string>>;
14
+ /** A copy's answer to a person's change: made, or refused with the harness's words. */
15
+ export interface SettingAnswer {
16
+ readonly kind: SettingKind;
17
+ readonly id: string;
18
+ readonly changeId: string;
19
+ readonly made: boolean;
20
+ readonly message?: string | undefined;
21
+ }
22
+ export type PutOutcome = {
23
+ readonly ok: true;
24
+ } | {
25
+ readonly ok: false;
26
+ readonly message: string;
27
+ readonly issues: readonly {
28
+ path: string;
29
+ message: string;
30
+ }[];
31
+ };
32
+ type Copy = Readonly<Record<string, unknown>>;
33
+ /** The people and clocks a frame names. */
34
+ export interface Asker {
35
+ readonly ids: IdGenerator;
36
+ readonly harnessId: string;
37
+ readonly ownerId: string;
38
+ readonly now: string;
39
+ }
40
+ export declare class FakeSettings {
41
+ /** The copy last taken for each `kind:id`, without its answer. */
42
+ private readonly copies;
43
+ /** Every answer a copy carried, oldest first. */
44
+ readonly answers: SettingAnswer[];
45
+ /** A copy sent: checked, kept, and its answer, if it carries one, noted. */
46
+ put(kind: SettingKind, id: string, body: unknown): PutOutcome;
47
+ copy(kind: SettingKind, id: string): Copy | undefined;
48
+ /** Every copy of a kind, by whose it is. */
49
+ copiesOf(kind: SettingKind): (readonly [id: string, copy: Copy])[];
50
+ answerTo(changeId: string): SettingAnswer | undefined;
51
+ /**
52
+ * The change a person would ask of a copy as it stands, as the frame the harness is sent, or
53
+ * nothing when the copy offers nothing to change: no file with its text.
54
+ */
55
+ askOf(kind: SettingKind, id: string, asker: Asker): Record<string, unknown> | undefined;
56
+ /** A file saved as it is: an agent's, or one of the harness's own set. */
57
+ private editOf;
58
+ }
59
+ export {};
60
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAE7B,kGAAkG;AAClG,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,iBAAiB,GACjB,OAAO,GACP,WAAW,GACX,gBAAgB,GAChB,MAAM,CAAC;AAEX,oEAAoE;AACpE,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAOzD,CAAC;AAWF,uFAAuF;AACvF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,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a,GAAG,SAAS;IAIrD;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAmDvF,0EAA0E;IAC1E,OAAO,CAAC,MAAM;CAsBf"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * What a person changes about an agent from its page (ADRs 0134, 0140, 0143, 0146), and about a
3
+ * harness's own jobs from its page (ADR 0252), as the fake plays it. A harness's copies are taken whole and checked against the protocol's own schemas, as
4
+ * the real door checks them; the answer a copy carries is kept; and a person's change is a frame
5
+ * built from the copy as it stands. The kit asks for what the copy already says (the same model,
6
+ * the same heartbeat, the same limit, the same text), so a harness that answers changes nothing
7
+ * it would not have, and one that refuses has said why.
8
+ */
9
+ import { agentContextPut, agentContextWindowPut, agentHeartbeatPut, agentModelPut, harnessContextPut, harnessJobsPut, } from "@chipschat/protocol";
10
+ /** What a socket says in its `hello` to be sent a kind's frames. */
11
+ export const ACCEPTS = {
12
+ context: "context",
13
+ "harness-context": "context",
14
+ model: "models",
15
+ heartbeat: "heartbeats",
16
+ "context-window": "context_windows",
17
+ jobs: "jobs",
18
+ };
19
+ const SCHEMAS = {
20
+ context: agentContextPut,
21
+ "harness-context": harnessContextPut,
22
+ model: agentModelPut,
23
+ heartbeat: agentHeartbeatPut,
24
+ "context-window": agentContextWindowPut,
25
+ jobs: harnessJobsPut,
26
+ };
27
+ export class FakeSettings {
28
+ /** The copy last taken for each `kind:id`, without its answer. */
29
+ copies = new Map();
30
+ /** Every answer a copy carried, oldest first. */
31
+ answers = [];
32
+ /** A copy sent: checked, kept, and its answer, if it carries one, noted. */
33
+ put(kind, id, body) {
34
+ const parsed = SCHEMAS[kind].safeParse(body);
35
+ if (!parsed.success) {
36
+ return {
37
+ ok: false,
38
+ message: `That is not a copy of ${kind === "harness-context" ? "a harness's files" : kind === "jobs" ? "a harness's jobs" : `an agent's ${kind}`}.`,
39
+ issues: parsed.error.issues.map((issue) => ({
40
+ path: issue.path.join(".") || "(root)",
41
+ message: issue.message,
42
+ })),
43
+ };
44
+ }
45
+ const { answers, refuses, ...copy } = parsed.data;
46
+ this.copies.set(`${kind}:${id}`, copy);
47
+ if (answers !== undefined)
48
+ this.answers.push({ kind, id, changeId: answers, made: true });
49
+ if (refuses !== undefined) {
50
+ const changeId = String(refuses["change_id"] ?? refuses["edit_id"]);
51
+ const message = typeof refuses["message"] === "string" ? refuses["message"] : undefined;
52
+ this.answers.push({ kind, id, changeId, made: false, message });
53
+ }
54
+ return { ok: true };
55
+ }
56
+ copy(kind, id) {
57
+ return this.copies.get(`${kind}:${id}`);
58
+ }
59
+ /** Every copy of a kind, by whose it is. */
60
+ copiesOf(kind) {
61
+ const prefix = `${kind}:`;
62
+ return [...this.copies]
63
+ .filter(([key]) => key.startsWith(prefix))
64
+ .map(([key, copy]) => [key.slice(prefix.length), copy]);
65
+ }
66
+ answerTo(changeId) {
67
+ return this.answers.find((answer) => answer.changeId === changeId);
68
+ }
69
+ /**
70
+ * The change a person would ask of a copy as it stands, as the frame the harness is sent, or
71
+ * nothing when the copy offers nothing to change: no file with its text.
72
+ */
73
+ askOf(kind, id, asker) {
74
+ const copy = this.copy(kind, id);
75
+ if (copy === undefined)
76
+ return undefined;
77
+ const asked = { harness_id: asker.harnessId, asked_by: asker.ownerId, asked_at: asker.now };
78
+ const change = () => asker.ids.next("change");
79
+ switch (kind) {
80
+ case "model":
81
+ return {
82
+ frame: "model.change",
83
+ change_id: change(),
84
+ agent_id: id,
85
+ model: copy["model"],
86
+ effort: copy["effort"] ?? null,
87
+ ...asked,
88
+ };
89
+ case "heartbeat":
90
+ return {
91
+ frame: "heartbeat.change",
92
+ change_id: change(),
93
+ agent_id: id,
94
+ on: copy["on"],
95
+ every: copy["every"],
96
+ ...asked,
97
+ };
98
+ case "jobs": {
99
+ const job = (copy["jobs"] ?? []).find((each) => each["editable"]);
100
+ if (job === undefined)
101
+ return undefined;
102
+ return {
103
+ frame: "job.change",
104
+ change_id: change(),
105
+ job_id: job["job_id"],
106
+ on: job["on"],
107
+ ...(job["choices"] === undefined ? {} : { every: job["every"] }),
108
+ ...asked,
109
+ };
110
+ }
111
+ case "context-window": {
112
+ const limit = copy["limit"];
113
+ return {
114
+ frame: "context_window.change",
115
+ change_id: change(),
116
+ agent_id: id,
117
+ at: limit?.at ?? null,
118
+ ...asked,
119
+ };
120
+ }
121
+ default:
122
+ return this.editOf(kind, id, copy, asked, asker);
123
+ }
124
+ }
125
+ /** A file saved as it is: an agent's, or one of the harness's own set. */
126
+ editOf(kind, id, copy, asked, asker) {
127
+ const files = (copy[kind === "context" ? "files" : "shared"] ?? []);
128
+ const file = files.find((each) => typeof each["text"] === "string" && each["editable"] === true);
129
+ if (file === undefined)
130
+ return undefined;
131
+ return {
132
+ frame: "context.edit",
133
+ edit_id: asker.ids.next("edit"),
134
+ ...(kind === "context" ? { agent_id: id } : {}),
135
+ name: file["name"],
136
+ text: file["text"],
137
+ base_hash: typeof file["hash"] === "string" ? file["hash"] : "unknown",
138
+ ...asked,
139
+ };
140
+ }
141
+ }
142
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,GAEf,MAAM,qBAAqB,CAAC;AAW7B,oEAAoE;AACpE,MAAM,CAAC,MAAM,OAAO,GAA0C;IAC5D,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,SAAS;IAC5B,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,YAAY;IACvB,gBAAgB,EAAE,iBAAiB;IACnC,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,eAAe;IACxB,iBAA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YACL,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;YAC/B,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,SAAS,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;YACtE,GAAG,KAAK;SACT,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * What a room's job has spent (ADR 0117), worked out from the fake's log as the server does: from
3
+ * the last person's act or brief handed into the room, what the room's `usage` reports said since,
4
+ * a run's own report being its total so far, against what the room allows a job.
5
+ */
6
+ import { type JobSpend } from "@chipschat/protocol";
7
+ /** An event of the fake's log, as much of it as the job reads. */
8
+ interface StoredEvent {
9
+ readonly seq: number;
10
+ readonly type: string;
11
+ readonly space_id: string | null;
12
+ readonly run_id: string | null;
13
+ readonly actor: {
14
+ readonly kind: string;
15
+ };
16
+ readonly payload: Readonly<Record<string, unknown>>;
17
+ }
18
+ export declare function spendInLog(log: readonly StoredEvent[], spaceId: string, upto: number): JobSpend;
19
+ export {};
20
+ //# sourceMappingURL=spend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend.d.ts","sourceRoot":"","sources":["../src/spend.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA6B,KAAK,QAAQ,EAAkB,MAAM,qBAAqB,CAAC;AAE/F,kEAAkE;AAClE,UAAU,WAAW;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrD;AA0CD,wBAAgB,UAAU,CAAC,GAAG,EAAE,SAAS,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAiB/F"}
package/dist/spend.js ADDED
@@ -0,0 +1,50 @@
1
+ /**
2
+ * What a room's job has spent (ADR 0117), worked out from the fake's log as the server does: from
3
+ * the last person's act or brief handed into the room, what the room's `usage` reports said since,
4
+ * a run's own report being its total so far, against what the room allows a job.
5
+ */
6
+ import { DEFAULT_SPEND_CEILING_USD, resetsTheCount } from "@chipschat/protocol";
7
+ /** Where the room's job began: the last person's act, or the last brief handed in. */
8
+ function jobStart(room) {
9
+ return (room.findLast((event) => (event.actor.kind === "person" && resetsTheCount(event.type, event.payload)) ||
10
+ (event.type === "run.requested" && typeof event.payload["lane_id"] === "string"))?.seq ?? 0);
11
+ }
12
+ /** What a `usage` report said a run cost, when it said. */
13
+ function costOf(event) {
14
+ return event.payload["cost"]?.usd;
15
+ }
16
+ /** Count one `usage` into its run's total, and into the job's spend when it is the job's. */
17
+ function tally(into, event, job) {
18
+ const run = event.run_id ?? "";
19
+ const usd = costOf(event);
20
+ if (usd === undefined) {
21
+ if (job)
22
+ into.silent.add(run);
23
+ return;
24
+ }
25
+ const was = into.totals.get(run) ?? 0;
26
+ const now = event.payload["scope"] === "run" ? usd : was + usd;
27
+ into.totals.set(run, now);
28
+ if (!job)
29
+ return;
30
+ into.costed.add(run);
31
+ into.spent += now - was;
32
+ }
33
+ export function spendInLog(log, spaceId, upto) {
34
+ const room = log.filter((event) => event.space_id === spaceId && event.seq <= upto);
35
+ const since = jobStart(room);
36
+ const so = { spent: 0, totals: new Map(), costed: new Set(), silent: new Set() };
37
+ for (const event of log) {
38
+ if (event.type !== "usage" || event.seq > upto)
39
+ continue;
40
+ tally(so, event, event.seq > since && event.space_id === spaceId);
41
+ }
42
+ const ceiling = room.findLast((event) => event.type === "space.spend_ceiling_set")?.payload["usd"];
43
+ return {
44
+ ceiling_usd: typeof ceiling === "number" ? ceiling : DEFAULT_SPEND_CEILING_USD,
45
+ spent_usd: Math.max(0, Math.round(so.spent * 1e6) / 1e6),
46
+ since_seq: since,
47
+ uncounted_runs: [...so.silent].filter((run) => !so.costed.has(run)).length,
48
+ };
49
+ }
50
+ //# sourceMappingURL=spend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend.js","sourceRoot":"","sources":["../src/spend.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,EAAiB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAY/F,sFAAsF;AACtF,SAAS,QAAQ,CAAC,IAA4B;IAC5C,OAAO,CACL,IAAI,CAAC,QAAQ,CACX,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5E,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CACnF,EAAE,GAAG,IAAI,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,SAAS,MAAM,CAAC,KAAkB;IAChC,OAAQ,KAAK,CAAC,OAAO,CAAC,MAAM,CAAkC,EAAE,GAAG,CAAC;AACtE,CAAC;AAUD,6FAA6F;AAC7F,SAAS,KAAK,CAAC,IAAW,EAAE,KAAkB,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ACxB,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,GAAG,IAAI;YAAE,SAAS;QACzD,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,yBAAyB,CAAC,EAAE,OAAO,CACzF,KAAK,CACN,CAAC;IACF,OAAO;QACL,WAAW,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;QAC9E,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QACxD,SAAS,EAAE,KAAK;QAChB,cAAc,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM;KAC3E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * What the kit drives: an adapter, brought up against a Chips it was given, and — for a harness
3
+ * that cannot act on its own here — asked for a turn.
4
+ *
5
+ * The kit plays the person. It says something in a space, answers the card that comes back,
6
+ * answers a question if one is asked, and reads what the harness sent. Which side of the wire
7
+ * the adapter is on is the adapter's business: a harness that runs itself — Scout, Jacobian's
8
+ * channel — hears the message on its own socket and runs a turn by itself. An adapter with no
9
+ * model behind it in a test is asked to
10
+ * play the harness's side instead — the events a real turn would send, with the message as the
11
+ * prompt. A custom harness that a person started by hand is the first kind: the kit prints where
12
+ * Chips is and waits for it to connect.
13
+ */
14
+ /** Where the fake Chips is, and who the harness is there. Everything an adapter needs to connect. */
15
+ export interface ChipsAddress {
16
+ /** `http://127.0.0.1:<port>`. The socket is at `/v1/ws` under it. */
17
+ readonly url: string;
18
+ readonly workspaceId: string;
19
+ readonly harnessId: string;
20
+ /** The harness's bearer token, `chips_at_…`. */
21
+ readonly token: string;
22
+ /** The person the harness belongs to, and the one whose message starts the scenario. */
23
+ readonly ownerId: string;
24
+ /** The direct space between the owner and the harness, where the scenario is played. */
25
+ readonly spaceId: string;
26
+ }
27
+ /** The person's message, as the kit said it. */
28
+ export interface Turn {
29
+ readonly spaceId: string;
30
+ readonly messageId: string;
31
+ readonly text: string;
32
+ }
33
+ export interface Subject {
34
+ /** The adapter's id — `scout`, `custom` — named in the report. */
35
+ readonly name: string;
36
+ /**
37
+ * What the harness declares, as its registration would (ADR 0046). A harness that declares
38
+ * `new_spaces` is asked for a room as well, after the golden scenario, and must claim it: it
39
+ * is a harness that runs itself, since nobody calls `turn` for that room.
40
+ */
41
+ readonly capabilities?: readonly string[] | undefined;
42
+ /** Bring the adapter up against this Chips. Resolves when it is ready to hear a message. */
43
+ readonly start: (chips: ChipsAddress) => Promise<void>;
44
+ /**
45
+ * The harness's side of one turn, for an adapter whose harness cannot act here on its own.
46
+ * Called right after the person's message is posted, and awaited only after the run has
47
+ * ended — an approval it asks for is answered while it runs. Absent for a harness that
48
+ * answers a message by itself.
49
+ */
50
+ readonly turn?: ((message: Turn) => Promise<void>) | undefined;
51
+ readonly stop: () => Promise<void>;
52
+ }
53
+ /** A harness somebody starts by hand against the address the kit prints. */
54
+ export declare function customSubject(): Subject;
55
+ //# sourceMappingURL=subject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,qGAAqG;AACrG,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wFAAwF;IACxF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,gDAAgD;AAChD,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACtD,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,IAAI,OAAO,CAMvC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * What the kit drives: an adapter, brought up against a Chips it was given, and — for a harness
3
+ * that cannot act on its own here — asked for a turn.
4
+ *
5
+ * The kit plays the person. It says something in a space, answers the card that comes back,
6
+ * answers a question if one is asked, and reads what the harness sent. Which side of the wire
7
+ * the adapter is on is the adapter's business: a harness that runs itself — Scout, Jacobian's
8
+ * channel — hears the message on its own socket and runs a turn by itself. An adapter with no
9
+ * model behind it in a test is asked to
10
+ * play the harness's side instead — the events a real turn would send, with the message as the
11
+ * prompt. A custom harness that a person started by hand is the first kind: the kit prints where
12
+ * Chips is and waits for it to connect.
13
+ */
14
+ /** A harness somebody starts by hand against the address the kit prints. */
15
+ export function customSubject() {
16
+ return {
17
+ name: "custom",
18
+ start: async () => undefined,
19
+ stop: async () => undefined,
20
+ };
21
+ }
22
+ //# sourceMappingURL=subject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subject.js","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA4CH,4EAA4E;AAC5E,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;QAC5B,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** Waiting on the fake's log, and on what is not in it, for the scenario and the checks. */
2
+ import type { FakeChips } from "./fake-chips.js";
3
+ import type { StoredEvent } from "./workspace.js";
4
+ export declare const POLL_MS = 200;
5
+ export declare function sleep(ms: number): Promise<void>;
6
+ /** What the harness said: as itself, or as one of its agents, beside which it is named (ADR 0087). */
7
+ export declare function byHarness(event: StoredEvent, harnessId: string): boolean;
8
+ /** The first event that matches within the time, or nothing. */
9
+ export declare function within(chips: FakeChips, match: (event: StoredEvent) => boolean, ms: number): Promise<StoredEvent | undefined>;
10
+ /** The first thing `read` finds within the time, asked every `POLL_MS`: for what no event says. */
11
+ export declare function until<T>(read: () => T | undefined, ms: number): Promise<T | undefined>;
12
+ //# sourceMappingURL=waiting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waiting.d.ts","sourceRoot":"","sources":["../src/waiting.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,OAAO,MAAM,CAAC;AAE3B,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,sGAAsG;AACtG,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAKxE;AAED,gEAAgE;AAChE,wBAAsB,MAAM,CAC1B,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,EACtC,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAMlC;AAED,mGAAmG;AACnG,wBAAsB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAO5F"}
@@ -0,0 +1,30 @@
1
+ /** Waiting on the fake's log, and on what is not in it, for the scenario and the checks. */
2
+ export const POLL_MS = 200;
3
+ export function sleep(ms) {
4
+ return new Promise((resolve) => setTimeout(resolve, ms));
5
+ }
6
+ /** What the harness said: as itself, or as one of its agents, beside which it is named (ADR 0087). */
7
+ export function byHarness(event, harnessId) {
8
+ return (event.actor.id === harnessId ||
9
+ event.actor.harness_id === harnessId);
10
+ }
11
+ /** The first event that matches within the time, or nothing. */
12
+ export async function within(chips, match, ms) {
13
+ try {
14
+ return await chips.waitFor((event) => (match(event) ? event : undefined), ms);
15
+ }
16
+ catch {
17
+ return undefined;
18
+ }
19
+ }
20
+ /** The first thing `read` finds within the time, asked every `POLL_MS`: for what no event says. */
21
+ export async function until(read, ms) {
22
+ const deadline = Date.now() + ms;
23
+ for (;;) {
24
+ const found = read();
25
+ if (found !== undefined || Date.now() >= deadline)
26
+ return found;
27
+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