@alexkroman1/aai-ui 1.8.2 → 1.9.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.
- package/dist/_colors-DJUordGv.js +19 -0
- package/dist/_utils-5cs73OrA.js +16 -0
- package/dist/_utils.d.ts +4 -0
- package/dist/aai-logo-B8lDmsut.js +84 -0
- package/dist/audio.d.ts +9 -2
- package/dist/audio.js +41 -24
- package/dist/chat-view-C1XbqDk0.js +186 -0
- package/dist/components/_colors.d.ts +26 -0
- package/dist/components/aai-logo.d.ts +7 -6
- package/dist/components/button.d.ts +11 -13
- package/dist/components/button.js +7 -16
- package/dist/components/chat-view.d.ts +8 -19
- package/dist/components/chat-view.js +2 -98
- package/dist/components/controls.d.ts +1 -1
- package/dist/components/controls.js +2 -39
- package/dist/components/eyebrow.d.ts +12 -0
- package/dist/components/message-list.d.ts +1 -1
- package/dist/components/message-list.js +126 -56
- package/dist/components/sidebar-layout.d.ts +1 -1
- package/dist/components/start-screen.d.ts +4 -3
- package/dist/components/start-screen.js +20 -14
- package/dist/components/text-controls.d.ts +14 -0
- package/dist/components/tool-call-block.d.ts +5 -3
- package/dist/components/tool-call-block.js +1 -1
- package/dist/components/url-chips.d.ts +28 -0
- package/dist/context.d.ts +30 -4
- package/dist/context.js +86 -10
- package/dist/controls-BngrPbOC.js +135 -0
- package/dist/default-client/assets/audio-Cs-6t_Wd.js +1 -0
- package/dist/default-client/assets/capture-processor-C19oBn4L.js +105 -0
- package/dist/default-client/assets/index-Bf4ZTNcx.js +73 -0
- package/dist/default-client/assets/index-Bzlh9i7w.css +2 -0
- package/dist/default-client/assets/playback-processor-BtlzAH78.js +149 -0
- package/dist/default-client/index.html +3 -3
- package/dist/define-client.d.ts +2 -2
- package/dist/define-client.js +18 -24
- package/dist/eyebrow-C6ZFuiz6.js +27 -0
- package/dist/hooks.js +71 -42
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -5
- package/dist/session-core-D3NDaySY.js +652 -0
- package/dist/session-core-messages.d.ts +50 -0
- package/dist/session-core-types.d.ts +147 -0
- package/dist/session-core-upload.d.ts +16 -0
- package/dist/session-core.d.ts +2 -68
- package/dist/session-core.js +1 -455
- package/dist/{tool-call-block-wby_jyoY.js → tool-call-block-7f1GTG-P.js} +33 -31
- package/dist/types.d.ts +29 -4
- package/dist/types.js +10 -1
- package/dist/worklets/capture-processor.d.ts +2 -0
- package/dist/worklets/capture-processor.js +80 -25
- package/dist/worklets/playback-processor.d.ts +2 -0
- package/dist/worklets/playback-processor.js +80 -29
- package/package.json +18 -18
- package/styles.css +30 -0
- package/dist/_react-test-utils.d.ts +0 -86
- package/dist/aai-logo-BqFv6JU6.js +0 -21
- package/dist/default-client/assets/audio-UowwhmYo.js +0 -1
- package/dist/default-client/assets/capture-processor-C26lSiVr.js +0 -53
- package/dist/default-client/assets/index-BZqVGR2o.css +0 -2
- package/dist/default-client/assets/index-YW9WUhbL.js +0 -49
- package/dist/default-client/assets/playback-processor-dSA8Im99.js +0 -101
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
var e=new Blob([`
|
|
2
|
-
class PlaybackProcessor extends AudioWorkletProcessor {
|
|
3
|
-
constructor(options) {
|
|
4
|
-
super();
|
|
5
|
-
this.interrupted = false;
|
|
6
|
-
this.isDone = false;
|
|
7
|
-
this.playing = false;
|
|
8
|
-
const rate = options.processorOptions?.sampleRate ?? 24000;
|
|
9
|
-
// Wait for ~400ms of audio before starting.
|
|
10
|
-
// If 'done' arrives first (short utterance), start immediately.
|
|
11
|
-
this.jitterSamples = Math.floor(rate * 0.4);
|
|
12
|
-
// Carry-over byte for split samples across chunks
|
|
13
|
-
this.carry = null;
|
|
14
|
-
// Float32 sample buffer — 60s at the context sample rate
|
|
15
|
-
this.samples = new Float32Array(rate * 60);
|
|
16
|
-
this.writePos = 0;
|
|
17
|
-
this.readPos = 0;
|
|
18
|
-
// Report playback position every ~50ms for word-level text sync
|
|
19
|
-
this.progressInterval = Math.floor(rate * 0.05);
|
|
20
|
-
this.samplesSinceProgress = 0;
|
|
21
|
-
|
|
22
|
-
this.port.onmessage = (e) => {
|
|
23
|
-
const d = e.data;
|
|
24
|
-
if (d.event === 'write') {
|
|
25
|
-
this.ingestBytes(d.buffer);
|
|
26
|
-
} else if (d.event === 'interrupt') {
|
|
27
|
-
this.interrupted = true;
|
|
28
|
-
} else if (d.event === 'done') {
|
|
29
|
-
this.isDone = true;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
ingestBytes(uint8) {
|
|
35
|
-
let bytes = uint8;
|
|
36
|
-
|
|
37
|
-
if (this.carry !== null) {
|
|
38
|
-
const merged = new Uint8Array(1 + bytes.length);
|
|
39
|
-
merged[0] = this.carry;
|
|
40
|
-
merged.set(bytes, 1);
|
|
41
|
-
bytes = merged;
|
|
42
|
-
this.carry = null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (bytes.length % 2 !== 0) {
|
|
46
|
-
this.carry = bytes[bytes.length - 1];
|
|
47
|
-
bytes = bytes.subarray(0, bytes.length - 1);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (bytes.length === 0) return;
|
|
51
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.length);
|
|
52
|
-
const numSamples = bytes.length / 2;
|
|
53
|
-
for (let i = 0; i < numSamples; i++) {
|
|
54
|
-
this.samples[this.writePos++] = view.getInt16(i * 2, true) / 0x8000;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
process(inputs, outputs) {
|
|
59
|
-
const out = outputs[0][0];
|
|
60
|
-
if (this.interrupted) {
|
|
61
|
-
this.port.postMessage({ event: 'stop' });
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const avail = this.writePos - this.readPos;
|
|
66
|
-
|
|
67
|
-
// Wait for jitter buffer to fill, unless done (short utterance)
|
|
68
|
-
if (!this.playing) {
|
|
69
|
-
if (avail >= this.jitterSamples || this.isDone) {
|
|
70
|
-
this.playing = true;
|
|
71
|
-
} else {
|
|
72
|
-
out.fill(0);
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (avail > 0) {
|
|
78
|
-
const n = Math.min(avail, out.length);
|
|
79
|
-
out.set(this.samples.subarray(this.readPos, this.readPos + n));
|
|
80
|
-
this.readPos += n;
|
|
81
|
-
this.samplesSinceProgress += n;
|
|
82
|
-
if (this.samplesSinceProgress >= this.progressInterval) {
|
|
83
|
-
this.port.postMessage({ event: 'progress', readPos: this.readPos });
|
|
84
|
-
this.samplesSinceProgress = 0;
|
|
85
|
-
}
|
|
86
|
-
out.fill(0, n);
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// No data: output silence, stop only when done
|
|
91
|
-
out.fill(0);
|
|
92
|
-
if (this.isDone) {
|
|
93
|
-
this.port.postMessage({ event: 'stop' });
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
registerProcessor('playback-processor', PlaybackProcessor);
|
|
101
|
-
`],{type:`application/javascript`}),t=URL.createObjectURL(e);export{t as default};
|