@framers/agentos 0.13.8 → 0.13.9

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.
@@ -0,0 +1,48 @@
1
+ /** Options of {@link AudioWorkletCapture}. */
2
+ export interface AudioWorkletCaptureOptions {
3
+ /** The page's audio context. */
4
+ context: AudioContext;
5
+ /** The stream to hear: a microphone's, or a mix the page made. */
6
+ stream: MediaStream;
7
+ /** Where the host serves `capture-worklet.js`, the module beside this entry in the package's `dist`. */
8
+ moduleUrl: string;
9
+ /**
10
+ * Samples per block: a positive whole number, or the constructor throws a `RangeError`.
11
+ * @defaultValue 2048
12
+ */
13
+ blockSize?: number;
14
+ }
15
+ /** A page's audio as mono Float32 blocks through an `AudioWorkletNode`. */
16
+ export declare class AudioWorkletCapture {
17
+ private readonly options;
18
+ private node;
19
+ private source;
20
+ private silent;
21
+ private stream;
22
+ /** Advanced by each `start()` and `stop()`, so a start whose module loads after a later call builds nothing. */
23
+ private generation;
24
+ private readonly listeners;
25
+ /** @throws {RangeError} When `blockSize` is not a positive whole number. */
26
+ constructor(options: AudioWorkletCaptureOptions);
27
+ /** Adds a listener for each block; answers the function that removes it. */
28
+ onBlock(listener: (samples: Float32Array, sampleRate: number) => void): () => void;
29
+ /**
30
+ * Loads the module (once per context), builds the path, and starts handing blocks on. A started capture is left as
31
+ * it is, so a second call builds no second path; when calls overlap while the module loads, the last one builds.
32
+ * A start that fails leaves nothing connected, and the next call tries again.
33
+ */
34
+ start(): Promise<void>;
35
+ /**
36
+ * Hears another stream with the same node: a new microphone, or the tab's sound added. The samples the worklet holds
37
+ * toward its next block are kept and open the first block after the change, so no sample it took in before the
38
+ * change is dropped. A stream with no audio track throws, and the capture keeps hearing the stream it had.
39
+ */
40
+ setStream(stream: MediaStream): void;
41
+ /**
42
+ * Stops: every node disconnected, the worklet's processor told to end, every listener removed, and no block handed
43
+ * on after it; a start still loading the module builds nothing. A capture started again hands its blocks to the
44
+ * listeners added after the stop.
45
+ */
46
+ stop(): void;
47
+ }
48
+ //# sourceMappingURL=AudioWorkletCapture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioWorkletCapture.d.ts","sourceRoot":"","sources":["../../../src/io/hearing/AudioWorkletCapture.ts"],"names":[],"mappings":"AAkBA,8CAA8C;AAC9C,MAAM,WAAW,0BAA0B;IACzC,gCAAgC;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,kEAAkE;IAClE,MAAM,EAAE,WAAW,CAAC;IACpB,wGAAwG;IACxG,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,2EAA2E;AAC3E,qBAAa,mBAAmB;IAUlB,OAAO,CAAC,QAAQ,CAAC,OAAO;IATpC,OAAO,CAAC,IAAI,CAA+B;IAC3C,OAAO,CAAC,MAAM,CAAyC;IACvD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAAc;IAC5B,gHAAgH;IAChH,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkE;IAE5F,4EAA4E;gBAC/C,OAAO,EAAE,0BAA0B;IAShE,4EAA4E;IAC5E,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI;IAKlF;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkC5B;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAWpC;;;;OAIG;IACH,IAAI,IAAI,IAAI;CAcb"}
@@ -0,0 +1,119 @@
1
+ /// <reference lib="dom" />
2
+ /**
3
+ * @module hearing/AudioWorkletCapture
4
+ * A page's audio as mono Float32 blocks, read off the main thread by an `AudioWorkletNode` (beside `AudioProcessor`,
5
+ * whose `ScriptProcessorNode` capture the worklet succeeds): a `MediaStream` through `createMediaStreamSource` into the
6
+ * worklet, whose one output goes to the destination through a gain of zero so every engine pulls it, and each block
7
+ * handed to the listeners with the context's sample rate. The worklet module is `capture-worklet.js`, beside this
8
+ * entry's built file in the package's `dist`, which the host serves from its own origin.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const capture = new AudioWorkletCapture({ context, stream, moduleUrl: '/live/capture-worklet.js' });
13
+ * capture.onBlock((samples, sampleRate) => session.pushAudio({ samples, sampleRate, timestamp: Date.now() }));
14
+ * await capture.start();
15
+ * ```
16
+ */
17
+ import { CAPTURE_PROCESSOR_NAME, CAPTURE_STOP_MESSAGE } from './capture-worklet.js';
18
+ /**
19
+ * The module each context loaded, so a second capture on one context loads nothing. A load that fails is dropped, so
20
+ * the next start on that context loads the module again.
21
+ */
22
+ const loaded = new WeakMap();
23
+ /** A page's audio as mono Float32 blocks through an `AudioWorkletNode`. */
24
+ export class AudioWorkletCapture {
25
+ /** @throws {RangeError} When `blockSize` is not a positive whole number. */
26
+ constructor(options) {
27
+ this.options = options;
28
+ /** Advanced by each `start()` and `stop()`, so a start whose module loads after a later call builds nothing. */
29
+ this.generation = 0;
30
+ this.listeners = new Set();
31
+ // Checked here, on the page: a size the worklet's processor refuses would only fail inside the worklet, in silence.
32
+ const { blockSize } = options;
33
+ if (blockSize !== undefined && (!Number.isInteger(blockSize) || blockSize < 1)) {
34
+ throw new RangeError('AudioWorkletCapture: blockSize must be a positive whole number');
35
+ }
36
+ this.stream = options.stream;
37
+ }
38
+ /** Adds a listener for each block; answers the function that removes it. */
39
+ onBlock(listener) {
40
+ this.listeners.add(listener);
41
+ return () => this.listeners.delete(listener);
42
+ }
43
+ /**
44
+ * Loads the module (once per context), builds the path, and starts handing blocks on. A started capture is left as
45
+ * it is, so a second call builds no second path; when calls overlap while the module loads, the last one builds.
46
+ * A start that fails leaves nothing connected, and the next call tries again.
47
+ */
48
+ async start() {
49
+ if (this.node)
50
+ return;
51
+ const generation = ++this.generation;
52
+ const { context } = this.options;
53
+ let ready = loaded.get(context);
54
+ if (!ready) {
55
+ ready = context.audioWorklet.addModule(this.options.moduleUrl).catch((error) => {
56
+ loaded.delete(context);
57
+ throw error;
58
+ });
59
+ loaded.set(context, ready);
60
+ }
61
+ await ready;
62
+ if (generation !== this.generation)
63
+ return;
64
+ // The path is built whole before it is kept: a stream with no audio track throws here, with nothing connected.
65
+ const source = context.createMediaStreamSource(this.stream);
66
+ const node = new AudioWorkletNode(context, CAPTURE_PROCESSOR_NAME, {
67
+ numberOfInputs: 1,
68
+ numberOfOutputs: 1,
69
+ processorOptions: { blockSize: this.options.blockSize ?? 2048 },
70
+ });
71
+ node.port.onmessage = (event) => {
72
+ for (const listener of this.listeners)
73
+ listener(event.data, context.sampleRate);
74
+ };
75
+ const silent = context.createGain();
76
+ silent.gain.value = 0;
77
+ node.connect(silent);
78
+ silent.connect(context.destination);
79
+ source.connect(node);
80
+ this.source = source;
81
+ this.node = node;
82
+ this.silent = silent;
83
+ }
84
+ /**
85
+ * Hears another stream with the same node: a new microphone, or the tab's sound added. The samples the worklet holds
86
+ * toward its next block are kept and open the first block after the change, so no sample it took in before the
87
+ * change is dropped. A stream with no audio track throws, and the capture keeps hearing the stream it had.
88
+ */
89
+ setStream(stream) {
90
+ if (this.node) {
91
+ // The new source is built before the old one is let go: a stream with no audio track throws here.
92
+ const source = this.options.context.createMediaStreamSource(stream);
93
+ this.source?.disconnect();
94
+ source.connect(this.node);
95
+ this.source = source;
96
+ }
97
+ this.stream = stream;
98
+ }
99
+ /**
100
+ * Stops: every node disconnected, the worklet's processor told to end, every listener removed, and no block handed
101
+ * on after it; a start still loading the module builds nothing. A capture started again hands its blocks to the
102
+ * listeners added after the stop.
103
+ */
104
+ stop() {
105
+ this.generation += 1;
106
+ this.listeners.clear();
107
+ if (this.node) {
108
+ this.node.port.onmessage = null;
109
+ this.node.port.postMessage(CAPTURE_STOP_MESSAGE);
110
+ }
111
+ this.source?.disconnect();
112
+ this.node?.disconnect();
113
+ this.silent?.disconnect();
114
+ this.source = undefined;
115
+ this.node = undefined;
116
+ this.silent = undefined;
117
+ }
118
+ }
119
+ //# sourceMappingURL=AudioWorkletCapture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioWorkletCapture.js","sourceRoot":"","sources":["../../../src/io/hearing/AudioWorkletCapture.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAiBpF;;;GAGG;AACH,MAAM,MAAM,GAAG,IAAI,OAAO,EAAmC,CAAC;AAE9D,2EAA2E;AAC3E,MAAM,OAAO,mBAAmB;IAS9B,4EAA4E;IAC5E,YAA6B,OAAmC;QAAnC,YAAO,GAAP,OAAO,CAA4B;QALhE,gHAAgH;QACxG,eAAU,GAAG,CAAC,CAAC;QACN,cAAS,GAAG,IAAI,GAAG,EAAuD,CAAC;QAI1F,oHAAoH;QACpH,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;QAC9B,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC/E,MAAM,IAAI,UAAU,CAAC,gEAAgE,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED,4EAA4E;IAC5E,OAAO,CAAC,QAA6D;QACnE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO;QACtB,MAAM,UAAU,GAAG,EAAE,IAAI,CAAC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S,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @module hearing/capture-worklet
3
+ * The worklet module of `AudioWorkletCapture`: in an `AudioWorkletGlobalScope` it registers a processor that mixes its
4
+ * first input to mono and posts blocks of `blockSize` samples to the page, and ends once the page posts it
5
+ * `CAPTURE_STOP_MESSAGE`. It imports nothing, so its built file (`dist/io/hearing/capture-worklet.js`) is served on
6
+ * its own from the host's origin; outside a worklet (a test, a bundle) it registers nothing and exports its pure parts.
7
+ */
8
+ /** The name the processor registers under. */
9
+ export declare const CAPTURE_PROCESSOR_NAME = "agentos-capture";
10
+ /** The message the page posts the processor to end it: from then on its `process()` answers `false`. */
11
+ export declare const CAPTURE_STOP_MESSAGE = "stop";
12
+ /** The channels of one input mixed to mono (their mean); `null` when the input has no channel or no sample. */
13
+ export declare function mixToMono(channels: readonly Float32Array[]): Float32Array | null;
14
+ /** Gathers samples into blocks of one size, keeping the rest for the next push. */
15
+ export declare class BlockAccumulator {
16
+ private readonly size;
17
+ private buffer;
18
+ private filled;
19
+ /** @throws {RangeError} When `size` is not a positive whole number. */
20
+ constructor(size: number);
21
+ /** Takes samples; answers every block they completed, in order. */
22
+ push(samples: Float32Array): Float32Array[];
23
+ }
24
+ //# sourceMappingURL=capture-worklet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-worklet.d.ts","sourceRoot":"","sources":["../../../src/io/hearing/capture-worklet.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD,wGAAwG;AACxG,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAE3C,+GAA+G;AAC/G,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,GAAG,IAAI,CAShF;AAED,mFAAmF;AACnF,qBAAa,gBAAgB;IAKf,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAK;IAEnB,uEAAuE;gBAC1C,IAAI,EAAE,MAAM;IAKzC,mEAAmE;IACnE,IAAI,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE;CAgB5C"}
@@ -0,0 +1,80 @@
1
+ /// <reference lib="dom" />
2
+ /**
3
+ * @module hearing/capture-worklet
4
+ * The worklet module of `AudioWorkletCapture`: in an `AudioWorkletGlobalScope` it registers a processor that mixes its
5
+ * first input to mono and posts blocks of `blockSize` samples to the page, and ends once the page posts it
6
+ * `CAPTURE_STOP_MESSAGE`. It imports nothing, so its built file (`dist/io/hearing/capture-worklet.js`) is served on
7
+ * its own from the host's origin; outside a worklet (a test, a bundle) it registers nothing and exports its pure parts.
8
+ */
9
+ /** The name the processor registers under. */
10
+ export const CAPTURE_PROCESSOR_NAME = 'agentos-capture';
11
+ /** The message the page posts the processor to end it: from then on its `process()` answers `false`. */
12
+ export const CAPTURE_STOP_MESSAGE = 'stop';
13
+ /** The channels of one input mixed to mono (their mean); `null` when the input has no channel or no sample. */
14
+ export function mixToMono(channels) {
15
+ const first = channels[0];
16
+ if (!first || first.length === 0)
17
+ return null;
18
+ if (channels.length === 1)
19
+ return new Float32Array(first);
20
+ const mixed = new Float32Array(first.length);
21
+ for (const channel of channels) {
22
+ for (let i = 0; i < mixed.length; i += 1)
23
+ mixed[i] = (mixed[i] ?? 0) + (channel[i] ?? 0) / channels.length;
24
+ }
25
+ return mixed;
26
+ }
27
+ /** Gathers samples into blocks of one size, keeping the rest for the next push. */
28
+ export class BlockAccumulator {
29
+ /** @throws {RangeError} When `size` is not a positive whole number. */
30
+ constructor(size) {
31
+ this.size = size;
32
+ this.filled = 0;
33
+ if (!Number.isInteger(size) || size < 1)
34
+ throw new RangeError('BlockAccumulator: size must be a positive whole number');
35
+ this.buffer = new Float32Array(size);
36
+ }
37
+ /** Takes samples; answers every block they completed, in order. */
38
+ push(samples) {
39
+ const out = [];
40
+ let offset = 0;
41
+ while (offset < samples.length) {
42
+ const take = Math.min(this.size - this.filled, samples.length - offset);
43
+ this.buffer.set(samples.subarray(offset, offset + take), this.filled);
44
+ this.filled += take;
45
+ offset += take;
46
+ if (this.filled === this.size) {
47
+ out.push(this.buffer);
48
+ this.buffer = new Float32Array(this.size);
49
+ this.filled = 0;
50
+ }
51
+ }
52
+ return out;
53
+ }
54
+ }
55
+ const scope = globalThis;
56
+ if (typeof scope.registerProcessor === 'function' && scope.AudioWorkletProcessor) {
57
+ const Base = scope.AudioWorkletProcessor;
58
+ scope.registerProcessor(CAPTURE_PROCESSOR_NAME, class extends Base {
59
+ constructor(options) {
60
+ super(options);
61
+ /** Set by the page's stop message; `process()` then answers `false`, so the browser can end the node. */
62
+ this.stopped = false;
63
+ this.blocks = new BlockAccumulator(options?.processorOptions?.blockSize ?? 2048);
64
+ this.port.onmessage = (event) => {
65
+ if (event.data === CAPTURE_STOP_MESSAGE)
66
+ this.stopped = true;
67
+ };
68
+ }
69
+ process(inputs) {
70
+ if (this.stopped)
71
+ return false;
72
+ const mono = mixToMono(inputs[0] ?? []);
73
+ if (mono)
74
+ for (const block of this.blocks.push(mono))
75
+ this.port.postMessage(block, [block.buffer]);
76
+ return true;
77
+ }
78
+ });
79
+ }
80
+ //# sourceMappingURL=capture-worklet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-worklet.js","sourceRoot":"","sources":["../../../src/io/hearing/capture-worklet.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B;;;;;;GAMG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAExD,wGAAwG;AACxG,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE3C,+GAA+G;AAC/G,MAAM,UAAU,SAAS,CAAC,QAAiC;IACzD,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,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K,CAAC;YAC/B,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACxC,IAAI,IAAI;gBAAE,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;oBAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,MAAqB,CAAC,CAAC,CAAC;YAClH,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos",
3
- "version": "0.13.8",
3
+ "version": "0.13.9",
4
4
  "description": "AgentOS: open-source TypeScript framework for autonomous AI agents. Unified graph orchestration, cognitive memory, runtime tool forging, multi-tier guardrails, voice pipeline, and 11 LLM providers.",
5
5
  "homepage": "https://agentos.sh",
6
6
  "repository": {
@@ -280,6 +280,11 @@
280
280
  "default": "./dist/io/hearing/index.js",
281
281
  "types": "./dist/io/hearing/index.d.ts"
282
282
  },
283
+ "./io/hearing/capture": {
284
+ "import": "./dist/io/hearing/AudioWorkletCapture.js",
285
+ "default": "./dist/io/hearing/AudioWorkletCapture.js",
286
+ "types": "./dist/io/hearing/AudioWorkletCapture.d.ts"
287
+ },
283
288
  "./io/hearing/livekit": {
284
289
  "import": "./dist/io/hearing/livekit.js",
285
290
  "default": "./dist/io/hearing/livekit.js",