hci-atrium 0.2.0 → 0.3.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 (67) hide show
  1. package/README.md +252 -13
  2. package/dist/atrium.d.ts +220 -7
  3. package/dist/atrium.d.ts.map +1 -1
  4. package/dist/atrium.js +410 -39
  5. package/dist/atrium.js.map +1 -1
  6. package/dist/dash.d.ts +206 -0
  7. package/dist/dash.d.ts.map +1 -0
  8. package/dist/dash.js +302 -0
  9. package/dist/dash.js.map +1 -0
  10. package/dist/direct.d.ts +86 -0
  11. package/dist/direct.d.ts.map +1 -0
  12. package/dist/direct.js +121 -0
  13. package/dist/direct.js.map +1 -0
  14. package/dist/index.d.ts +6 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +5 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/models.d.ts +70 -0
  19. package/dist/models.d.ts.map +1 -1
  20. package/dist/models.js +56 -0
  21. package/dist/models.js.map +1 -1
  22. package/dist/player/runtime.d.ts.map +1 -1
  23. package/dist/player/runtime.js +8 -1
  24. package/dist/player/runtime.js.map +1 -1
  25. package/dist/rooms/recorder.d.ts +4 -0
  26. package/dist/rooms/recorder.d.ts.map +1 -1
  27. package/dist/rooms/recorder.js +7 -0
  28. package/dist/rooms/recorder.js.map +1 -1
  29. package/dist/rooms/room.d.ts +84 -1
  30. package/dist/rooms/room.d.ts.map +1 -1
  31. package/dist/rooms/room.js +213 -4
  32. package/dist/rooms/room.js.map +1 -1
  33. package/dist/rooms/standing-source.d.ts +3 -0
  34. package/dist/rooms/standing-source.d.ts.map +1 -1
  35. package/dist/rooms/standing-source.js +6 -0
  36. package/dist/rooms/standing-source.js.map +1 -1
  37. package/dist/rooms/transcriber.d.ts +4 -0
  38. package/dist/rooms/transcriber.d.ts.map +1 -1
  39. package/dist/rooms/transcriber.js +1 -0
  40. package/dist/rooms/transcriber.js.map +1 -1
  41. package/dist/shaping/index.d.ts +1 -0
  42. package/dist/shaping/index.d.ts.map +1 -1
  43. package/dist/shaping/index.js +1 -0
  44. package/dist/shaping/index.js.map +1 -1
  45. package/dist/shaping/request.d.ts +1 -1
  46. package/dist/shaping/request.d.ts.map +1 -1
  47. package/dist/shaping/rooms.d.ts +2 -0
  48. package/dist/shaping/rooms.d.ts.map +1 -1
  49. package/dist/shaping/rooms.js +45 -6
  50. package/dist/shaping/rooms.js.map +1 -1
  51. package/dist/shaping/surveys.d.ts +69 -0
  52. package/dist/shaping/surveys.d.ts.map +1 -0
  53. package/dist/shaping/surveys.js +129 -0
  54. package/dist/shaping/surveys.js.map +1 -0
  55. package/dist/tools.d.ts +84 -0
  56. package/dist/tools.d.ts.map +1 -0
  57. package/dist/tools.js +105 -0
  58. package/dist/tools.js.map +1 -0
  59. package/dist/trace.d.ts +96 -0
  60. package/dist/trace.d.ts.map +1 -0
  61. package/dist/trace.js +251 -0
  62. package/dist/trace.js.map +1 -0
  63. package/dist/transcribe.d.ts +5 -0
  64. package/dist/transcribe.d.ts.map +1 -1
  65. package/dist/transcribe.js +1 -1
  66. package/dist/transcribe.js.map +1 -1
  67. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,2DAA2D;AAC3D,UAAU,aAAa;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,KAAK,cAAc,CAAC,MAAM,IACtB;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,CAAA;AAEjF;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,MAAM,G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AM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,yFAAyF;AACzF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAE,CAW1E"}
package/dist/tools.js ADDED
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Tool descriptors for {@link ../atrium.Atrium.agent} — the TypeScript answer to Python's
3
+ * ``@client.tool`` decorator.
4
+ *
5
+ * Python derives a tool's OpenAI schema from the function's signature + docstring (``_tools.py``).
6
+ * TypeScript has neither at runtime — types are erased and there are no docstrings — so a tool is
7
+ * an **explicit descriptor**: ``{ name, description, parameters, execute }``. That keeps the SDK's
8
+ * zero-runtime-dependency promise (no schema library is pulled in to make ``agent`` work) and keeps
9
+ * the emitted wire honest: what you write is what the model sees.
10
+ *
11
+ * ``parameters`` accepts either shape:
12
+ *
13
+ * - **plain JSON Schema** — ``{ type: "object", properties: {…}, required: […] }``, sent verbatim.
14
+ * - **``{ jsonSchema, validate? }``** — the same JSON Schema, plus an optional validator. Any object
15
+ * implementing the [Standard Schema](https://standardschema.dev) interface (the ``~standard``
16
+ * property — Zod ≥3.24, Valibot, ArkType, …) works as the validator: the model's arguments are
17
+ * run through it before ``execute`` sees them.
18
+ *
19
+ * A bare Standard-Schema object (a Zod schema on its own) is **rejected**: the SDK can validate with
20
+ * it but cannot emit JSON Schema from it without taking on the library as a dependency. Pass
21
+ * ``parameters: { jsonSchema, validate: schema }`` instead — one line, and the wire stays explicit.
22
+ */
23
+ import { InvalidArgumentError } from "./errors.js";
24
+ const EMPTY_SCHEMA = { type: "object", properties: {}, required: [] };
25
+ /** True when ``value`` implements the Standard Schema interface. */
26
+ export function isStandardSchema(value) {
27
+ return (typeof value === "object" &&
28
+ value !== null &&
29
+ "~standard" in value &&
30
+ typeof value["~standard"]?.validate === "function");
31
+ }
32
+ function isToolJsonSchema(value) {
33
+ return "jsonSchema" in value && typeof value.jsonSchema === "object";
34
+ }
35
+ /** The JSON Schema a descriptor puts on the wire, and its validator (when one was given). */
36
+ function splitParameters(tool) {
37
+ const params = tool.parameters;
38
+ if (params === undefined) {
39
+ return { jsonSchema: { ...EMPTY_SCHEMA } };
40
+ }
41
+ if (isToolJsonSchema(params)) {
42
+ return { jsonSchema: params.jsonSchema, validate: params.validate };
43
+ }
44
+ if (isStandardSchema(params)) {
45
+ throw new InvalidArgumentError(`tool ${JSON.stringify(tool.name)}: a ${params["~standard"].vendor} schema can validate arguments but the SDK can't derive JSON Schema from it (that would ` +
46
+ "mean depending on the library). Pass parameters: { jsonSchema: { type: 'object', … }, " +
47
+ "validate: yourSchema } — the JSON Schema goes on the wire, the schema validates the " +
48
+ "model's arguments.");
49
+ }
50
+ return { jsonSchema: params };
51
+ }
52
+ /** The OpenAI ``tools`` entry for one descriptor (the twin of Python's ``build_tool_schema``). */
53
+ export function toolSchema(tool) {
54
+ const { jsonSchema } = splitParameters(tool);
55
+ return {
56
+ type: "function",
57
+ function: {
58
+ name: tool.name,
59
+ description: tool.description ?? "",
60
+ parameters: jsonSchema,
61
+ },
62
+ };
63
+ }
64
+ /**
65
+ * Parse (and optionally validate) the arguments of one tool call. ``raw`` is the model's
66
+ * ``function.arguments`` JSON string — malformed JSON or a validation failure raises
67
+ * {@link InvalidArgumentError}, mirroring how a bad call surfaces out of Python's ``fn(**args)``.
68
+ */
69
+ export async function parseToolArguments(tool, raw) {
70
+ let args;
71
+ try {
72
+ args = JSON.parse(raw || "{}");
73
+ }
74
+ catch (err) {
75
+ throw new InvalidArgumentError(`tool ${JSON.stringify(tool.name)}: the model's arguments were not valid JSON ` +
76
+ `(${err.message}): ${String(raw).slice(0, 200)}`);
77
+ }
78
+ const { validate } = splitParameters(tool);
79
+ if (!validate) {
80
+ return args && typeof args === "object" ? args : {};
81
+ }
82
+ const result = await validate["~standard"].validate(args);
83
+ if (result.issues) {
84
+ const detail = result.issues.map((issue) => issue.message).join("; ");
85
+ throw new InvalidArgumentError(`tool ${JSON.stringify(tool.name)}: the model's arguments failed validation: ${detail}`);
86
+ }
87
+ return result.value && typeof result.value === "object"
88
+ ? result.value
89
+ : {};
90
+ }
91
+ /** The tool calls in an assistant message (``message.tool_calls``), or an empty list. */
92
+ export function readToolCalls(message) {
93
+ const calls = message.tool_calls;
94
+ if (!Array.isArray(calls))
95
+ return [];
96
+ return calls.map((call) => {
97
+ const c = (call ?? {});
98
+ return {
99
+ id: String(c.id ?? ""),
100
+ name: String(c.function?.name ?? ""),
101
+ arguments: typeof c.function?.arguments === "string" ? c.function.arguments : "",
102
+ };
103
+ });
104
+ }
105
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AA8ClD,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAW,CAAA;AAE9E,oEAAoE;AACpE,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,WAAW,IAAI,KAAK;QACpB,OAAQ,KAA0B,CAAC,WAAW,CAAC,EAAE,QAAQ,KAAK,UAAU,CACzE,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAqB;IAC7C,OAAO,YAAY,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAA;AACtE,CAAC;AAED,6FAA6F;AAC7F,SAAS,eAAe,CAAC,IAAoB;IAI3C,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;IAC9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,EAAE,UAAU,EAAE,EAA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tB,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC;YACpC,SAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;SACjF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Room tracing — the machinery behind ``room.trace()``. The TypeScript port of Python's ``_trace.py``
3
+ * (envelope + summaries + the instrumentation seam) and its room-side sink (``_AsyncRoomTrace``).
4
+ *
5
+ * Tracing mirrors into a room, as ``trace.*`` signals, what the SDK is doing on the same client:
6
+ * library/model calls (``trace.<label>`` — ``trace.chat`` / ``trace.library.search`` / ``trace.play``)
7
+ * and SDK-internal state changes (``trace.state.<label>`` — ``trace.state.recorder`` / …). Folding the
8
+ * operation into the type lets a dashboard's type column and filters tell a search from a play without
9
+ * opening the payload; ``label`` stays in the payload for renderers and older consumers. Ephemerality
10
+ * is per-signal (see {@link isTraceEphemeral}). It is OFF by default — one ``room.trace()`` call arms
11
+ * it — and a trace failure never breaks the traced call (every emit path suppresses + logs).
12
+ *
13
+ * {@link traced} wraps a funnelled client method with a zero-cost fast path (no armed sink → straight
14
+ * through). The per-method *summaries* live here so every call site shares one honest one-line glance.
15
+ *
16
+ * Divergence from Python (deliberate): Python needs a ``contextvars`` re-entrancy guard because its
17
+ * structured-output ``chat`` recurses through the *traced* ``chat``. The TS client's structured path
18
+ * recurses through the **untraced** inner ``chatOnce`` instead, so one logical call emits exactly one
19
+ * trace with no task-local state — same contract, no guard.
20
+ */
21
+ /** The state-signal namespace. A state trace folds its component label into the type as
22
+ * ``trace.state.<label>`` (``trace.state.recorder`` / ``trace.state.transcriber`` / …). */
23
+ export declare const TRACE_STATE = "trace.state";
24
+ /** The signal type for a call trace — the operation folded into the type (``trace.<label>``:
25
+ * ``trace.chat``, ``trace.library.search``, ``trace.play``). ``label`` still rides the payload. */
26
+ export declare function traceCallType(label: string): string;
27
+ /** The signal type for a state trace (``trace.state.<label>``: ``trace.state.recorder``, …). */
28
+ export declare function traceStateType(label: string): string;
29
+ /**
30
+ * Whether a trace signal rides the room ephemerally (recorders skip it) or durably (a recorder
31
+ * captures it into the session).
32
+ *
33
+ * The rule: a trace mirror is DURABLE unless the action it mirrors already rides the room durably.
34
+ *
35
+ * * ``trace.chat`` / ``trace.library.*`` — durable: they happen OUTSIDE the room, so the trace is
36
+ * their only record; for a study it IS the record.
37
+ * * ``trace.play`` — ephemeral: the raw ``play`` control send already rides the room durably, so a
38
+ * durable mirror would double-record every play in the session.
39
+ * * ``trace.state.*`` — ephemeral: liveness chatter (recorder / transcriber / offer transitions).
40
+ */
41
+ export declare function isTraceEphemeral(type: string): boolean;
42
+ /** Build the ``trace.*`` payload: a label, one glanceable summary line, an optional detail object,
43
+ * and a client timestamp (epoch-ms). */
44
+ export declare function traceEnvelope(label: string, summary: string, detail?: Record<string, unknown>): Record<string, unknown>;
45
+ /** Where a trace goes: an armed {@link RoomTrace}. Kept as an interface so the client's sink list
46
+ * doesn't depend on the rooms module. */
47
+ export interface TraceSink {
48
+ emit(type: string, payload: Record<string, unknown>): Promise<void>;
49
+ }
50
+ /** A per-method summary: the traced call's arguments, its result, and the elapsed ms →
51
+ * ``[summary, detail]``. Must not throw (the caller suppresses regardless, but a total summary is
52
+ * the whole point). */
53
+ export type Summarizer = (args: Record<string, unknown>, result: unknown, dtMs: number) => [string, Record<string, unknown>];
54
+ /** Glance for ``library.search`` — subject (query / ``like`` operand), hit count + top match. */
55
+ export declare const summarizeSearch: Summarizer;
56
+ /** Glance for ``library.searchByExamples`` — example count, method, hit count + top match. */
57
+ export declare const summarizeSearchByExamples: Summarizer;
58
+ /** Glance for ``library.enrich`` — query + modality, plus any scalar counts the call returns. */
59
+ export declare const summarizeEnrich: Summarizer;
60
+ /** Glance for ``room.play`` — a ``▶`` line naming the track(s), with mode + layer detail. */
61
+ export declare const summarizePlay: Summarizer;
62
+ /** Glance for ``chat`` — the answering model + duration, plus a short reply preview. */
63
+ export declare const summarizeChat: Summarizer;
64
+ /**
65
+ * Run ``fn``, mirroring it into every armed ``sinks`` as a ``trace.<label>``. Zero-cost when nothing
66
+ * is tracing (one length check — the summarizer never runs), and a trace failure is swallowed: the
67
+ * traced call's result always comes back. A call that *raises* emits nothing (mirror of Python's
68
+ * decorator, whose emit sits after the awaited call).
69
+ */
70
+ export declare function traced<T>(sinks: TraceSink[] | undefined, label: string, args: Record<string, unknown>, summarize: Summarizer, fn: () => Promise<T>): Promise<T>;
71
+ /** How a {@link RoomTrace} publishes — the room's REST ``/signal`` POST (the WS inbound path forces
72
+ * ``ephemeral: false``, and trace ephemerality is per-signal). Wired by ``room.trace()``. */
73
+ export interface RoomTraceDeps {
74
+ publish(type: string, payload: Record<string, unknown>, opts: {
75
+ ephemeral: boolean;
76
+ }): Promise<void>;
77
+ /** Unregister from the client's call sinks + the room's own list (called once, by {@link RoomTrace.stop}). */
78
+ onStop(): void;
79
+ }
80
+ /**
81
+ * A live tracing session on one room — the handle ``room.trace()`` returns (port of Python's
82
+ * ``_AsyncRoomTrace``). Stop it with ``stop()`` (idempotent), the room's ``close()``, or
83
+ * ``using t = room.trace()``.
84
+ */
85
+ export declare class RoomTrace implements TraceSink {
86
+ private readonly deps;
87
+ private live;
88
+ constructor(deps: RoomTraceDeps);
89
+ /** True until {@link stop} (or the room's teardown) ends this tracing session. */
90
+ get alive(): boolean;
91
+ emit(type: string, payload: Record<string, unknown>): Promise<void>;
92
+ /** Stop tracing (idempotent) — unregisters from the client's call sinks and the room. */
93
+ stop(): void;
94
+ [Symbol.dispose]: () => void;
95
+ }
96
+ //# sourceMappingURL=trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG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SAAS,EAAE,GAAG,SAAS,EAC9B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,EAAE,UAAU,EACrB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAcZ;AAED;6FAC6F;AAC7F,MAAM,WAAW,aAAa;IAC5B,OAAO,CACL,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,IAAI,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAAA;IAChB,8GAA8G;IAC9G,MAAM,IAAI,IAAI,CAAA;CACf;AAED;;;;GAIG;AACH,qBAAa,SAAU,YAAW,SAAS;IAG7B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,IAAI,CAAO;gBAEU,IAAI,EAAE,aAAa;IAEhD,kFAAkF;IAClF,IAAI,KAAK,IAAI,OAAO,CAEnB;IAEK,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUzE,yFAAyF;IACzF,IAAI,IAAI,IAAI;IAOJ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrC"}
package/dist/trace.js ADDED
@@ -0,0 +1,251 @@
1
+ /**
2
+ * Room tracing — the machinery behind ``room.trace()``. The TypeScript port of Python's ``_trace.py``
3
+ * (envelope + summaries + the instrumentation seam) and its room-side sink (``_AsyncRoomTrace``).
4
+ *
5
+ * Tracing mirrors into a room, as ``trace.*`` signals, what the SDK is doing on the same client:
6
+ * library/model calls (``trace.<label>`` — ``trace.chat`` / ``trace.library.search`` / ``trace.play``)
7
+ * and SDK-internal state changes (``trace.state.<label>`` — ``trace.state.recorder`` / …). Folding the
8
+ * operation into the type lets a dashboard's type column and filters tell a search from a play without
9
+ * opening the payload; ``label`` stays in the payload for renderers and older consumers. Ephemerality
10
+ * is per-signal (see {@link isTraceEphemeral}). It is OFF by default — one ``room.trace()`` call arms
11
+ * it — and a trace failure never breaks the traced call (every emit path suppresses + logs).
12
+ *
13
+ * {@link traced} wraps a funnelled client method with a zero-cost fast path (no armed sink → straight
14
+ * through). The per-method *summaries* live here so every call site shares one honest one-line glance.
15
+ *
16
+ * Divergence from Python (deliberate): Python needs a ``contextvars`` re-entrancy guard because its
17
+ * structured-output ``chat`` recurses through the *traced* ``chat``. The TS client's structured path
18
+ * recurses through the **untraced** inner ``chatOnce`` instead, so one logical call emits exactly one
19
+ * trace with no task-local state — same contract, no guard.
20
+ */
21
+ /** The state-signal namespace. A state trace folds its component label into the type as
22
+ * ``trace.state.<label>`` (``trace.state.recorder`` / ``trace.state.transcriber`` / …). */
23
+ export const TRACE_STATE = "trace.state";
24
+ /** Cap on how many results ride a call's ``detail`` — a glanceable top-N, never the full payload. */
25
+ const DETAIL_TOP_N = 5;
26
+ /** Cap on a chat reply preview stashed in ``detail`` (never the whole completion). */
27
+ const REPLY_PREVIEW = 200;
28
+ /** The signal type for a call trace — the operation folded into the type (``trace.<label>``:
29
+ * ``trace.chat``, ``trace.library.search``, ``trace.play``). ``label`` still rides the payload. */
30
+ export function traceCallType(label) {
31
+ return `trace.${label}`;
32
+ }
33
+ /** The signal type for a state trace (``trace.state.<label>``: ``trace.state.recorder``, …). */
34
+ export function traceStateType(label) {
35
+ return `${TRACE_STATE}.${label}`;
36
+ }
37
+ /**
38
+ * Whether a trace signal rides the room ephemerally (recorders skip it) or durably (a recorder
39
+ * captures it into the session).
40
+ *
41
+ * The rule: a trace mirror is DURABLE unless the action it mirrors already rides the room durably.
42
+ *
43
+ * * ``trace.chat`` / ``trace.library.*`` — durable: they happen OUTSIDE the room, so the trace is
44
+ * their only record; for a study it IS the record.
45
+ * * ``trace.play`` — ephemeral: the raw ``play`` control send already rides the room durably, so a
46
+ * durable mirror would double-record every play in the session.
47
+ * * ``trace.state.*`` — ephemeral: liveness chatter (recorder / transcriber / offer transitions).
48
+ */
49
+ export function isTraceEphemeral(type) {
50
+ return (type === traceCallType("play") || type === TRACE_STATE || type.startsWith(`${TRACE_STATE}.`));
51
+ }
52
+ /** Build the ``trace.*`` payload: a label, one glanceable summary line, an optional detail object,
53
+ * and a client timestamp (epoch-ms). */
54
+ export function traceEnvelope(label, summary, detail) {
55
+ const payload = { label, summary, t: Date.now() };
56
+ if (detail !== undefined)
57
+ payload.detail = detail;
58
+ return payload;
59
+ }
60
+ function assetTitle(asset) {
61
+ const title = asset?.title;
62
+ if (title)
63
+ return String(title);
64
+ const id = asset?.id;
65
+ return id ? String(id).slice(0, 8) : "?";
66
+ }
67
+ function hitScore(hit) {
68
+ const score = Number(hit?.score);
69
+ return Number.isFinite(score) ? score : 0;
70
+ }
71
+ function hitLine(hit) {
72
+ return {
73
+ id: hit?.asset?.id ?? null,
74
+ title: assetTitle(hit?.asset),
75
+ score: Math.round(hitScore(hit) * 1000) / 1000,
76
+ };
77
+ }
78
+ /** `` (top: <title> <score>)`` for the best hit, or empty when there are none. */
79
+ function topClause(hits) {
80
+ const top = hits[0];
81
+ if (!top)
82
+ return "";
83
+ return ` (top: ${assetTitle(top.asset)} ${hitScore(top).toFixed(2)})`;
84
+ }
85
+ /** A short glance at a ``like=`` / example operand — an id or a string, never a vector. */
86
+ function operandRef(value) {
87
+ if (value === null || value === undefined)
88
+ return "?";
89
+ if (typeof value === "string")
90
+ return value.slice(0, 40);
91
+ const obj = value;
92
+ if (obj.asset !== undefined)
93
+ return String(obj.asset?.id ?? "?").slice(0, 12);
94
+ return obj.id ? String(obj.id).slice(0, 12) : typeof value;
95
+ }
96
+ function asHits(result) {
97
+ return Array.isArray(result) ? result : [];
98
+ }
99
+ /** Glance for ``library.search`` — subject (query / ``like`` operand), hit count + top match. */
100
+ export const summarizeSearch = (args, result) => {
101
+ const query = args.query || "";
102
+ const like = args.like;
103
+ const hits = asHits(result);
104
+ const capped = hits.slice(0, DETAIL_TOP_N);
105
+ const subject = query
106
+ ? `"${query}"`
107
+ : like !== undefined && like !== null
108
+ ? `like ${operandRef(like)}`
109
+ : "search";
110
+ const summary = `${subject} → ${hits.length} hits${topClause(capped)}`;
111
+ const detail = { hits: capped.map(hitLine) };
112
+ if (query)
113
+ detail.query = query;
114
+ if (like !== undefined && like !== null)
115
+ detail.like = operandRef(like);
116
+ return [summary, detail];
117
+ };
118
+ /** Glance for ``library.searchByExamples`` — example count, method, hit count + top match. */
119
+ export const summarizeSearchByExamples = (args, result) => {
120
+ const positives = Array.isArray(args.positives) ? args.positives : [];
121
+ const hits = asHits(result);
122
+ const capped = hits.slice(0, DETAIL_TOP_N);
123
+ const summary = `${positives.length} example(s) → ${hits.length} hits${topClause(capped)}`;
124
+ return [
125
+ summary,
126
+ { examples: positives.length, method: args.method ?? null, hits: capped.map(hitLine) },
127
+ ];
128
+ };
129
+ /** Glance for ``library.enrich`` — query + modality, plus any scalar counts the call returns. */
130
+ export const summarizeEnrich = (args, result) => {
131
+ const query = args.query || "";
132
+ const modality = args.modality ?? null;
133
+ let summary = `enrich "${query}" (${modality})`;
134
+ const detail = { query, modality };
135
+ // ``enrich`` returns a free-form payload — surface only its scalar fields (counts, status), never
136
+ // nested candidate lists.
137
+ if (result && typeof result === "object" && !Array.isArray(result)) {
138
+ const counts = [];
139
+ for (const [k, v] of Object.entries(result)) {
140
+ if (typeof v !== "number" && typeof v !== "string" && typeof v !== "boolean")
141
+ continue;
142
+ detail[k] = v;
143
+ if (typeof v === "number" && Number.isInteger(v))
144
+ counts.push(`${k} ${v}`);
145
+ }
146
+ if (counts.length > 0)
147
+ summary += ` → ${counts.slice(0, 3).join(", ")}`;
148
+ }
149
+ return [summary, detail];
150
+ };
151
+ /** Glance for ``room.play`` — a ``▶`` line naming the track(s), with mode + layer detail. */
152
+ export const summarizePlay = (args) => {
153
+ const source = args.source;
154
+ const layer = args.layer;
155
+ const mode = args.mode ?? null;
156
+ let desc;
157
+ let tracks = 1;
158
+ if (Array.isArray(source)) {
159
+ tracks = source.length;
160
+ desc = `${tracks} tracks`;
161
+ }
162
+ else if (typeof source === "string") {
163
+ desc = source.slice(0, 40);
164
+ }
165
+ else if (source && typeof source === "object") {
166
+ const s = source;
167
+ desc = String(s.title ?? s.asset_id ?? s.id ?? "track");
168
+ }
169
+ else {
170
+ desc = operandRef(source);
171
+ }
172
+ const detail = { tracks, mode };
173
+ if (layer)
174
+ detail.layer = layer;
175
+ return [`▶ ${desc}`, detail];
176
+ };
177
+ /** Glance for ``chat`` — the answering model + duration, plus a short reply preview. */
178
+ export const summarizeChat = (args, result, dtMs) => {
179
+ const replied = result?.model;
180
+ const model = String(replied || args.model || "default");
181
+ const detail = { model, duration_ms: Math.round(dtMs) };
182
+ const content = result?.content;
183
+ if (typeof content === "string")
184
+ detail.reply = content.slice(0, REPLY_PREVIEW);
185
+ return [`chat ${model}: ${(dtMs / 1000).toFixed(1)}s`, detail];
186
+ };
187
+ // --- the instrumentation seam --------------------------------------------------------------------
188
+ /**
189
+ * Run ``fn``, mirroring it into every armed ``sinks`` as a ``trace.<label>``. Zero-cost when nothing
190
+ * is tracing (one length check — the summarizer never runs), and a trace failure is swallowed: the
191
+ * traced call's result always comes back. A call that *raises* emits nothing (mirror of Python's
192
+ * decorator, whose emit sits after the awaited call).
193
+ */
194
+ export async function traced(sinks, label, args, summarize, fn) {
195
+ if (!sinks || sinks.length === 0)
196
+ return fn();
197
+ const t0 = Date.now();
198
+ const result = await fn();
199
+ const dtMs = Date.now() - t0;
200
+ try {
201
+ const [summary, detail] = summarize(args, result, dtMs);
202
+ const payload = traceEnvelope(label, summary, detail);
203
+ for (const sink of [...sinks])
204
+ await sink.emit(traceCallType(label), payload);
205
+ }
206
+ catch (err) {
207
+ // A trace must never break the traced call.
208
+ console.debug(`Atrium trace: emit failed for ${label}:`, err);
209
+ }
210
+ return result;
211
+ }
212
+ /**
213
+ * A live tracing session on one room — the handle ``room.trace()`` returns (port of Python's
214
+ * ``_AsyncRoomTrace``). Stop it with ``stop()`` (idempotent), the room's ``close()``, or
215
+ * ``using t = room.trace()``.
216
+ */
217
+ export class RoomTrace {
218
+ deps;
219
+ live = true;
220
+ constructor(deps) {
221
+ this.deps = deps;
222
+ }
223
+ /** True until {@link stop} (or the room's teardown) ends this tracing session. */
224
+ get alive() {
225
+ return this.live;
226
+ }
227
+ async emit(type, payload) {
228
+ if (!this.live)
229
+ return;
230
+ try {
231
+ await this.deps.publish(type, payload, { ephemeral: isTraceEphemeral(type) });
232
+ }
233
+ catch (err) {
234
+ // A trace emit must never break the traced call or state change.
235
+ console.debug("Atrium trace: publish failed:", err);
236
+ }
237
+ }
238
+ /** Stop tracing (idempotent) — unregisters from the client's call sinks and the room. */
239
+ stop() {
240
+ if (!this.live)
241
+ return;
242
+ this.live = false;
243
+ this.deps.onStop();
244
+ }
245
+ }
246
+ if (typeof Symbol.dispose === "symbol") {
247
+ RoomTrace.prototype[Symbol.dispose] = function () {
248
+ this.stop();
249
+ };
250
+ }
251
+ //# sourceMappingURL=trace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;2FAC2F;AAC3F,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AAExC,qGAAqG;AACrG,MAAM,YAAY,GAAG,CAAC,CAAA;AACtB,sFAAsF;AACtF,MAAM,aAAa,GAAG,GAAG,CAAA;AAEzB;mGACmG;AACnG,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,SAAS,KAAK,EAAE,CAAA;AACzB,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,GAAG,WAAW,IAAI,KAAK,EAAE,CAAA;AAClC,CAAC;AAED;;;;;;;;;;;GAWG;AACH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IACpB,CAAC;CAIF;AAED,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;IACvC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG;QACpC,IAAI,CAAC,IAAI,EAAE,CAAA;IACb,CAAC,CAAA;AACH,CAAC"}
@@ -50,6 +50,11 @@ export interface TranscribeStreamOptions {
50
50
  /** Injected ``WebSocket`` constructor for the stream handshake (defaults to the runtime global) —
51
51
  * the test seam / Node <22 escape hatch. */
52
52
  webSocketCtor?: WebSocketCtor;
53
+ /** Replace the default per-clip batch fallback (used only when the streaming route can't be
54
+ * reached). The seam {@link ../rooms/room.Room.audioTranscripts} uses so each degraded transcript
55
+ * can carry its source snippet — mirror of Python's ``_transcribe_engine(fallback=…)``. It owns the
56
+ * clip source, so ``clips`` is left untouched when it runs. */
57
+ fallback?: () => AsyncIterable<Transcript>;
53
58
  }
54
59
  /** Run the shared engine over ``clips``, yielding a {@link Transcript} per finalized sentence (and,
55
60
  * with ``partials``, per live partial). Streaming when the backend offers it, per-clip batch otherwise. */
@@ -1 +1 @@
1
- {"version":3,"file":"transcribe.d.ts","sourceRoot":"","sources":["../src/transcribe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,eAAe,GAAG,IAAI,CAAA;AAE7D;oEACoE;AACpE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IACxB,yFAAyF;IACzF,UAAU,CACR,KAAK,EAAE,UAAU,EACjB,IAAI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K,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IACxB,yFAAyF;IACzF,UAAU,CACR,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3D,OAAO,CAAC,UAAU,CAAC,CAAA;IACtB,sGAAsG;IACtG,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+FAA+F;IAC/F,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAA;IACjB,8DAA8D;IAC9D,SAAS,EAAE,OAAO,CAAA;IAClB,uGAAuG;IACvG,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;gDAC4C;IAC5C,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;;mEAG+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,aAAa,CAAC,UAAU,CAAC,CAAA;CAC3C;AAKD;2GAC2G;AAC3G,wBAAuB,gBAAgB,CACrC,IAAI,EAAE,oBAAoB,EAC1B,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,EAChC,IAAI,EAAE,uBAAuB,GAC5B,cAAc,CAAC,UAAU,CAAC,CAmB5B"}
@@ -34,7 +34,7 @@ export async function* transcribeEngine(deps, clips, opts) {
34
34
  }
35
35
  catch (err) {
36
36
  if (err instanceof StreamUnavailable) {
37
- yield* transcribeFallbackClips(deps, clips, opts);
37
+ yield* opts.fallback ? opts.fallback() : transcribeFallbackClips(deps, clips, opts);
38
38
  return;
39
39
  }
40
40
  throw err; // AuthError propagates
@@ -1 +1 @@
1
- {"version":3,"file":"transcribe.js","source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MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IACzE,CAAC;IACD,OAAO,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA,CAAC,OAAO;AAC1D,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,KAAiB;IAC5C,IAAI,KAAK,YAAY,WAAW;QAAE,OAAO,KAAK,CAAA;IAC9C,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAgB,CAAA;IACjG,CAAC;IACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA,CAAC,OAAO;AACpC,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,KAAiB;IACrC,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,KAAK,CAAA;IACvC,OAAO,IAAI,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC/C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hci-atrium",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "TypeScript SDK for the Atrium framework — multimodal asset library, semantic + cross-modal search, and capability routing.",
5
5
  "type": "module",
6
6
  "license": "MIT",