@alexkroman1/aai 0.8.7 → 0.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/{sdk/_internal_types.d.ts → _internal-types.d.ts} +0 -3
- package/dist/_internal-types.js +19 -0
- package/dist/{sdk/_mock_ws.d.ts → _mock-ws.d.ts} +16 -5
- package/dist/_mock-ws.js +158 -0
- package/dist/{sdk/_utils.d.ts → _utils.d.ts} +1 -2
- package/dist/_utils.js +8 -0
- package/dist/{sdk/builtin_tools.d.ts → builtin-tools.d.ts} +5 -8
- package/dist/builtin-tools.js +270 -0
- package/dist/{sdk/direct_executor.d.ts → direct-executor.d.ts} +3 -7
- package/dist/direct-executor.js +125 -0
- package/dist/{sdk/mod.d.ts → index.d.ts} +0 -4
- package/dist/index.js +2 -0
- package/dist/{sdk/kv.d.ts → kv.d.ts} +23 -20
- package/dist/kv.js +99 -0
- package/dist/{sdk/protocol.d.ts → protocol.d.ts} +67 -31
- package/dist/protocol.js +142 -0
- package/dist/runtime.d.ts +18 -0
- package/dist/runtime.js +16 -0
- package/dist/s2s.d.ts +110 -0
- package/dist/s2s.js +242 -0
- package/dist/{sdk/server.d.ts → server.d.ts} +3 -23
- package/dist/server.js +105 -0
- package/dist/{sdk/session.d.ts → session.d.ts} +4 -11
- package/dist/session.js +312 -0
- package/dist/tsdown.config.d.ts +2 -0
- package/dist/{sdk/types.d.ts → types.d.ts} +41 -25
- package/dist/types.js +139 -0
- package/dist/{sdk/vector.d.ts → vector.d.ts} +14 -15
- package/dist/vector.js +56 -0
- package/dist/{sdk/worker_entry.d.ts → worker-entry.d.ts} +2 -5
- package/dist/worker-entry.js +59 -0
- package/dist/{sdk/ws_handler.d.ts → ws-handler.d.ts} +10 -8
- package/dist/ws-handler.js +155 -0
- package/package.json +66 -149
- package/README.md +0 -34
- package/dist/aai.js +0 -3
- package/dist/cli/tsconfig.tsbuildinfo +0 -1
- package/dist/cli.js +0 -2811
- package/dist/sdk/_internal_types.d.ts.map +0 -1
- package/dist/sdk/_internal_types.js +0 -25
- package/dist/sdk/_internal_types.js.map +0 -1
- package/dist/sdk/_mock_ws.d.ts.map +0 -1
- package/dist/sdk/_mock_ws.js +0 -154
- package/dist/sdk/_mock_ws.js.map +0 -1
- package/dist/sdk/_render_check.d.ts +0 -10
- package/dist/sdk/_render_check.d.ts.map +0 -1
- package/dist/sdk/_render_check.js +0 -72
- package/dist/sdk/_render_check.js.map +0 -1
- package/dist/sdk/_utils.d.ts.map +0 -1
- package/dist/sdk/_utils.js +0 -7
- package/dist/sdk/_utils.js.map +0 -1
- package/dist/sdk/builtin_tools.d.ts.map +0 -1
- package/dist/sdk/builtin_tools.js +0 -309
- package/dist/sdk/builtin_tools.js.map +0 -1
- package/dist/sdk/capnweb.d.ts +0 -102
- package/dist/sdk/capnweb.d.ts.map +0 -1
- package/dist/sdk/capnweb.js +0 -219
- package/dist/sdk/capnweb.js.map +0 -1
- package/dist/sdk/define_agent.d.ts +0 -36
- package/dist/sdk/define_agent.d.ts.map +0 -1
- package/dist/sdk/define_agent.js +0 -71
- package/dist/sdk/define_agent.js.map +0 -1
- package/dist/sdk/direct_executor.d.ts.map +0 -1
- package/dist/sdk/direct_executor.js +0 -145
- package/dist/sdk/direct_executor.js.map +0 -1
- package/dist/sdk/host.d.ts +0 -59
- package/dist/sdk/host.d.ts.map +0 -1
- package/dist/sdk/host.js +0 -131
- package/dist/sdk/host.js.map +0 -1
- package/dist/sdk/kv.d.ts.map +0 -1
- package/dist/sdk/kv.js +0 -94
- package/dist/sdk/kv.js.map +0 -1
- package/dist/sdk/memory_tools.d.ts +0 -38
- package/dist/sdk/memory_tools.d.ts.map +0 -1
- package/dist/sdk/memory_tools.js +0 -77
- package/dist/sdk/memory_tools.js.map +0 -1
- package/dist/sdk/mod.d.ts.map +0 -1
- package/dist/sdk/mod.js +0 -27
- package/dist/sdk/mod.js.map +0 -1
- package/dist/sdk/protocol.d.ts.map +0 -1
- package/dist/sdk/protocol.js +0 -133
- package/dist/sdk/protocol.js.map +0 -1
- package/dist/sdk/runtime.d.ts +0 -36
- package/dist/sdk/runtime.d.ts.map +0 -1
- package/dist/sdk/runtime.js +0 -27
- package/dist/sdk/runtime.js.map +0 -1
- package/dist/sdk/s2s.d.ts +0 -74
- package/dist/sdk/s2s.d.ts.map +0 -1
- package/dist/sdk/s2s.js +0 -218
- package/dist/sdk/s2s.js.map +0 -1
- package/dist/sdk/server.d.ts.map +0 -1
- package/dist/sdk/server.js +0 -144
- package/dist/sdk/server.js.map +0 -1
- package/dist/sdk/session.d.ts.map +0 -1
- package/dist/sdk/session.js +0 -303
- package/dist/sdk/session.js.map +0 -1
- package/dist/sdk/system_prompt.d.ts +0 -6
- package/dist/sdk/system_prompt.d.ts.map +0 -1
- package/dist/sdk/system_prompt.js +0 -35
- package/dist/sdk/system_prompt.js.map +0 -1
- package/dist/sdk/tsconfig.tsbuildinfo +0 -1
- package/dist/sdk/types.d.ts.map +0 -1
- package/dist/sdk/types.js +0 -96
- package/dist/sdk/types.js.map +0 -1
- package/dist/sdk/vector.d.ts.map +0 -1
- package/dist/sdk/vector.js +0 -63
- package/dist/sdk/vector.js.map +0 -1
- package/dist/sdk/winterc_server.d.ts +0 -56
- package/dist/sdk/winterc_server.d.ts.map +0 -1
- package/dist/sdk/winterc_server.js +0 -77
- package/dist/sdk/winterc_server.js.map +0 -1
- package/dist/sdk/worker_entry.d.ts.map +0 -1
- package/dist/sdk/worker_entry.js +0 -68
- package/dist/sdk/worker_entry.js.map +0 -1
- package/dist/sdk/worker_shim.d.ts +0 -19
- package/dist/sdk/worker_shim.d.ts.map +0 -1
- package/dist/sdk/worker_shim.js +0 -141
- package/dist/sdk/worker_shim.js.map +0 -1
- package/dist/sdk/ws_handler.d.ts.map +0 -1
- package/dist/sdk/ws_handler.js +0 -158
- package/dist/sdk/ws_handler.js.map +0 -1
- package/dist/ui/_cn.d.ts +0 -5
- package/dist/ui/_cn.d.ts.map +0 -1
- package/dist/ui/_cn.js +0 -22
- package/dist/ui/_cn.js.map +0 -1
- package/dist/ui/_components/app.d.ts +0 -5
- package/dist/ui/_components/app.d.ts.map +0 -1
- package/dist/ui/_components/app.js +0 -12
- package/dist/ui/_components/app.js.map +0 -1
- package/dist/ui/_components/button.d.ts +0 -11
- package/dist/ui/_components/button.d.ts.map +0 -1
- package/dist/ui/_components/button.js +0 -17
- package/dist/ui/_components/button.js.map +0 -1
- package/dist/ui/_components/chat_view.d.ts +0 -5
- package/dist/ui/_components/chat_view.d.ts.map +0 -1
- package/dist/ui/_components/chat_view.js +0 -15
- package/dist/ui/_components/chat_view.js.map +0 -1
- package/dist/ui/_components/controls.d.ts +0 -4
- package/dist/ui/_components/controls.d.ts.map +0 -1
- package/dist/ui/_components/controls.js +0 -10
- package/dist/ui/_components/controls.js.map +0 -1
- package/dist/ui/_components/error_banner.d.ts +0 -8
- package/dist/ui/_components/error_banner.d.ts.map +0 -1
- package/dist/ui/_components/error_banner.js +0 -8
- package/dist/ui/_components/error_banner.js.map +0 -1
- package/dist/ui/_components/message_bubble.d.ts +0 -7
- package/dist/ui/_components/message_bubble.d.ts.map +0 -1
- package/dist/ui/_components/message_bubble.js +0 -11
- package/dist/ui/_components/message_bubble.js.map +0 -1
- package/dist/ui/_components/message_list.d.ts +0 -4
- package/dist/ui/_components/message_list.d.ts.map +0 -1
- package/dist/ui/_components/message_list.js +0 -45
- package/dist/ui/_components/message_list.js.map +0 -1
- package/dist/ui/_components/sidebar_layout.d.ts +0 -20
- package/dist/ui/_components/sidebar_layout.d.ts.map +0 -1
- package/dist/ui/_components/sidebar_layout.js +0 -19
- package/dist/ui/_components/sidebar_layout.js.map +0 -1
- package/dist/ui/_components/start_screen.d.ts +0 -25
- package/dist/ui/_components/start_screen.d.ts.map +0 -1
- package/dist/ui/_components/start_screen.js +0 -28
- package/dist/ui/_components/start_screen.js.map +0 -1
- package/dist/ui/_components/state_indicator.d.ts +0 -8
- package/dist/ui/_components/state_indicator.d.ts.map +0 -1
- package/dist/ui/_components/state_indicator.js +0 -6
- package/dist/ui/_components/state_indicator.js.map +0 -1
- package/dist/ui/_components/thinking_indicator.d.ts +0 -5
- package/dist/ui/_components/thinking_indicator.d.ts.map +0 -1
- package/dist/ui/_components/thinking_indicator.js +0 -10
- package/dist/ui/_components/thinking_indicator.js.map +0 -1
- package/dist/ui/_components/tool_call_block.d.ts +0 -7
- package/dist/ui/_components/tool_call_block.d.ts.map +0 -1
- package/dist/ui/_components/tool_call_block.js +0 -46
- package/dist/ui/_components/tool_call_block.js.map +0 -1
- package/dist/ui/_components/tool_icons.d.ts +0 -18
- package/dist/ui/_components/tool_icons.d.ts.map +0 -1
- package/dist/ui/_components/tool_icons.js +0 -26
- package/dist/ui/_components/tool_icons.js.map +0 -1
- package/dist/ui/_components/transcript.d.ts +0 -7
- package/dist/ui/_components/transcript.d.ts.map +0 -1
- package/dist/ui/_components/transcript.js +0 -9
- package/dist/ui/_components/transcript.js.map +0 -1
- package/dist/ui/_dom_shim.d.ts +0 -7
- package/dist/ui/_dom_shim.d.ts.map +0 -1
- package/dist/ui/_dom_shim.js +0 -21
- package/dist/ui/_dom_shim.js.map +0 -1
- package/dist/ui/_hooks.d.ts +0 -21
- package/dist/ui/_hooks.d.ts.map +0 -1
- package/dist/ui/_hooks.js +0 -35
- package/dist/ui/_hooks.js.map +0 -1
- package/dist/ui/_jsdom_setup.d.ts +0 -1
- package/dist/ui/_jsdom_setup.d.ts.map +0 -1
- package/dist/ui/_jsdom_setup.js +0 -6
- package/dist/ui/_jsdom_setup.js.map +0 -1
- package/dist/ui/_test_utils.js +0 -272
- package/dist/ui/_test_utils.js.map +0 -1
- package/dist/ui/audio.d.ts +0 -46
- package/dist/ui/audio.d.ts.map +0 -1
- package/dist/ui/audio.js +0 -130
- package/dist/ui/audio.js.map +0 -1
- package/dist/ui/components.d.ts +0 -14
- package/dist/ui/components.d.ts.map +0 -1
- package/dist/ui/components.js +0 -15
- package/dist/ui/components.js.map +0 -1
- package/dist/ui/components_mod.d.ts +0 -34
- package/dist/ui/components_mod.d.ts.map +0 -1
- package/dist/ui/components_mod.js +0 -32
- package/dist/ui/components_mod.js.map +0 -1
- package/dist/ui/mod.d.ts +0 -23
- package/dist/ui/mod.d.ts.map +0 -1
- package/dist/ui/mod.js +0 -22
- package/dist/ui/mod.js.map +0 -1
- package/dist/ui/mount.d.ts +0 -44
- package/dist/ui/mount.d.ts.map +0 -1
- package/dist/ui/mount.js +0 -61
- package/dist/ui/mount.js.map +0 -1
- package/dist/ui/mount_context.d.ts +0 -22
- package/dist/ui/mount_context.d.ts.map +0 -1
- package/dist/ui/mount_context.js +0 -10
- package/dist/ui/mount_context.js.map +0 -1
- package/dist/ui/session.d.ts +0 -96
- package/dist/ui/session.d.ts.map +0 -1
- package/dist/ui/session.js +0 -379
- package/dist/ui/session.js.map +0 -1
- package/dist/ui/session_mod.d.ts +0 -19
- package/dist/ui/session_mod.d.ts.map +0 -1
- package/dist/ui/session_mod.js +0 -18
- package/dist/ui/session_mod.js.map +0 -1
- package/dist/ui/signals.d.ts +0 -80
- package/dist/ui/signals.d.ts.map +0 -1
- package/dist/ui/signals.js +0 -137
- package/dist/ui/signals.js.map +0 -1
- package/dist/ui/tsconfig.tsbuildinfo +0 -1
- package/dist/ui/types.d.ts +0 -36
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/ui/types.js +0 -4
- package/dist/ui/types.js.map +0 -1
- package/dist/ui/worklets/capture-processor.d.ts +0 -3
- package/dist/ui/worklets/capture-processor.d.ts.map +0 -1
- package/dist/ui/worklets/capture-processor.js +0 -61
- package/dist/ui/worklets/capture-processor.js.map +0 -1
- package/dist/ui/worklets/playback-processor.d.ts +0 -3
- package/dist/ui/worklets/playback-processor.d.ts.map +0 -1
- package/dist/ui/worklets/playback-processor.js +0 -109
- package/dist/ui/worklets/playback-processor.js.map +0 -1
- package/templates/.env +0 -1
- package/templates/_shared/.env.example +0 -5
- package/templates/_shared/CLAUDE.md +0 -1073
- package/templates/_shared/biome.json +0 -32
- package/templates/_shared/global.d.ts +0 -1
- package/templates/_shared/index.html +0 -16
- package/templates/_shared/package.json +0 -22
- package/templates/_shared/tsconfig.json +0 -16
- package/templates/code-interpreter/agent.ts +0 -27
- package/templates/code-interpreter/client.tsx +0 -3
- package/templates/dispatch-center/agent.ts +0 -1223
- package/templates/dispatch-center/client.tsx +0 -505
- package/templates/embedded-assets/agent.ts +0 -48
- package/templates/embedded-assets/client.tsx +0 -3
- package/templates/embedded-assets/knowledge.json +0 -20
- package/templates/health-assistant/agent.ts +0 -160
- package/templates/health-assistant/client.tsx +0 -3
- package/templates/infocom-adventure/agent.ts +0 -164
- package/templates/infocom-adventure/client.tsx +0 -300
- package/templates/math-buddy/agent.ts +0 -21
- package/templates/math-buddy/client.tsx +0 -3
- package/templates/memory-agent/agent.ts +0 -20
- package/templates/memory-agent/client.tsx +0 -3
- package/templates/night-owl/agent.ts +0 -98
- package/templates/night-owl/client.tsx +0 -12
- package/templates/personal-finance/agent.ts +0 -26
- package/templates/personal-finance/client.tsx +0 -3
- package/templates/pizza-ordering/agent.ts +0 -214
- package/templates/pizza-ordering/client.tsx +0 -264
- package/templates/simple/agent.ts +0 -6
- package/templates/simple/client.tsx +0 -3
- package/templates/smart-research/agent.ts +0 -164
- package/templates/smart-research/client.tsx +0 -3
- package/templates/solo-rpg/agent.ts +0 -1240
- package/templates/solo-rpg/client.tsx +0 -698
- package/templates/support/README.md +0 -62
- package/templates/support/agent.ts +0 -19
- package/templates/support/client.tsx +0 -3
- package/templates/travel-concierge/agent.ts +0 -29
- package/templates/travel-concierge/client.tsx +0 -3
- package/templates/tsconfig.json +0 -1
- package/templates/web-researcher/agent.ts +0 -17
- package/templates/web-researcher/client.tsx +0 -3
- package/ui/styles.css +0 -74
package/dist/ui/mod.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser client library for AAI voice agents.
|
|
3
|
-
*
|
|
4
|
-
* Provides WebSocket session management, audio capture/playback,
|
|
5
|
-
* and Preact UI components. For narrower imports, use the sub-path exports:
|
|
6
|
-
*
|
|
7
|
-
* - `@aai/ui/session` — WebSocket session only (no Preact dependency)
|
|
8
|
-
* - `@aai/ui/components` — Preact components, mount helpers, and signals
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* import { App, mount } from "@aai/ui";
|
|
13
|
-
*
|
|
14
|
-
* mount(App, { target: "#app" });
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @module
|
|
18
|
-
*/
|
|
19
|
-
export * from "./components_mod.ts";
|
|
20
|
-
export type { VoiceSession } from "./session.ts";
|
|
21
|
-
export { createVoiceSession } from "./session.ts";
|
|
22
|
-
export type { AgentState, Message, SessionError, SessionErrorCode, SessionOptions, ToolCallInfo, } from "./types.ts";
|
|
23
|
-
//# sourceMappingURL=mod.d.ts.map
|
package/dist/ui/mod.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../ui/mod.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;GAiBG;AAEH,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EACV,UAAU,EACV,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/ui/mod.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 the AAI authors. MIT license.
|
|
2
|
-
/**
|
|
3
|
-
* Browser client library for AAI voice agents.
|
|
4
|
-
*
|
|
5
|
-
* Provides WebSocket session management, audio capture/playback,
|
|
6
|
-
* and Preact UI components. For narrower imports, use the sub-path exports:
|
|
7
|
-
*
|
|
8
|
-
* - `@aai/ui/session` — WebSocket session only (no Preact dependency)
|
|
9
|
-
* - `@aai/ui/components` — Preact components, mount helpers, and signals
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* import { App, mount } from "@aai/ui";
|
|
14
|
-
*
|
|
15
|
-
* mount(App, { target: "#app" });
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @module
|
|
19
|
-
*/
|
|
20
|
-
export * from "./components_mod.js";
|
|
21
|
-
export { createVoiceSession } from "./session.js";
|
|
22
|
-
//# sourceMappingURL=mod.js.map
|
package/dist/ui/mod.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../ui/mod.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C;;;;;;;;;;;;;;;;;GAiBG;AAEH,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/ui/mount.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from "preact";
|
|
2
|
-
import { type MountTheme } from "./mount_context.ts";
|
|
3
|
-
import { type VoiceSession } from "./session.ts";
|
|
4
|
-
import { type SessionSignals } from "./signals.ts";
|
|
5
|
-
/** Options for {@linkcode mount}. */
|
|
6
|
-
export type MountOptions = {
|
|
7
|
-
/** CSS selector or DOM element to render into. Defaults to `"#app"`. */
|
|
8
|
-
target?: string | HTMLElement;
|
|
9
|
-
/** Base URL of the AAI platform server. Derived from `location.href` by default. */
|
|
10
|
-
platformUrl?: string;
|
|
11
|
-
/** Agent title shown in the header and start screen. */
|
|
12
|
-
title?: string;
|
|
13
|
-
/** Theme color overrides. */
|
|
14
|
-
theme?: MountTheme;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Handle returned by {@linkcode mount} for cleanup.
|
|
18
|
-
*
|
|
19
|
-
* Implements {@linkcode Disposable} so it can be used with `using`.
|
|
20
|
-
*/
|
|
21
|
-
export type MountHandle = {
|
|
22
|
-
/** The underlying voice session. */
|
|
23
|
-
session: VoiceSession;
|
|
24
|
-
/** Reactive session controls for the mounted UI. */
|
|
25
|
-
signals: SessionSignals;
|
|
26
|
-
/** Unmount the UI, remove injected styles, and disconnect the session. */
|
|
27
|
-
dispose(): void;
|
|
28
|
-
/** Alias for {@linkcode dispose} for use with `using`. */
|
|
29
|
-
[Symbol.dispose](): void;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Mount a Preact component with voice session wiring.
|
|
33
|
-
*
|
|
34
|
-
* Creates a {@linkcode VoiceSession}, wraps it in
|
|
35
|
-
* {@linkcode SessionSignals}, and renders the component
|
|
36
|
-
* inside a {@linkcode SessionProvider}.
|
|
37
|
-
*
|
|
38
|
-
* @param Component - The Preact component to render.
|
|
39
|
-
* @param options - Mount options (target element, platform URL).
|
|
40
|
-
* @returns A {@linkcode MountHandle} for cleanup.
|
|
41
|
-
* @throws {Error} If the target element is not found in the DOM.
|
|
42
|
-
*/
|
|
43
|
-
export declare function mount(Component: ComponentType<any>, options?: MountOptions): MountHandle;
|
|
44
|
-
//# sourceMappingURL=mount.d.ts.map
|
package/dist/ui/mount.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../ui/mount.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE3F,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG;IACzB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,oCAAoC;IACpC,OAAO,EAAE,YAAY,CAAC;IACtB,oDAAoD;IACpD,OAAO,EAAE,cAAc,CAAC;IACxB,0EAA0E;IAC1E,OAAO,IAAI,IAAI,CAAC;IAChB,0DAA0D;IAC1D,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;CAC1B,CAAC;AAQF;;;;;;;;;;;GAWG;AAEH,wBAAgB,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,WAAW,CA2CxF"}
|
package/dist/ui/mount.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
|
-
import { render } from "preact";
|
|
3
|
-
import { MountConfigProvider } from "./mount_context.js";
|
|
4
|
-
import { createVoiceSession } from "./session.js";
|
|
5
|
-
import { createSessionControls, SessionProvider } from "./signals.js";
|
|
6
|
-
function resolveContainer(target = "#app") {
|
|
7
|
-
const el = typeof target === "string" ? document.querySelector(target) : target;
|
|
8
|
-
if (!el)
|
|
9
|
-
throw new Error(`Element not found: ${target}`);
|
|
10
|
-
return el;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Mount a Preact component with voice session wiring.
|
|
14
|
-
*
|
|
15
|
-
* Creates a {@linkcode VoiceSession}, wraps it in
|
|
16
|
-
* {@linkcode SessionSignals}, and renders the component
|
|
17
|
-
* inside a {@linkcode SessionProvider}.
|
|
18
|
-
*
|
|
19
|
-
* @param Component - The Preact component to render.
|
|
20
|
-
* @param options - Mount options (target element, platform URL).
|
|
21
|
-
* @returns A {@linkcode MountHandle} for cleanup.
|
|
22
|
-
* @throws {Error} If the target element is not found in the DOM.
|
|
23
|
-
*/
|
|
24
|
-
// biome-ignore lint/suspicious/noExplicitAny: mount accepts any component
|
|
25
|
-
export function mount(Component, options) {
|
|
26
|
-
const container = resolveContainer(options?.target);
|
|
27
|
-
const platformUrl = options?.platformUrl ?? globalThis.location.origin + globalThis.location.pathname;
|
|
28
|
-
const session = createVoiceSession({ platformUrl });
|
|
29
|
-
const signals = createSessionControls(session);
|
|
30
|
-
const mountConfig = { title: options?.title, theme: options?.theme };
|
|
31
|
-
// Apply theme overrides as CSS custom properties on the container.
|
|
32
|
-
if (options?.theme) {
|
|
33
|
-
const t = options.theme;
|
|
34
|
-
const el = container;
|
|
35
|
-
if (t.bg)
|
|
36
|
-
el.style.setProperty("--color-aai-bg", t.bg);
|
|
37
|
-
if (t.primary)
|
|
38
|
-
el.style.setProperty("--color-aai-primary", t.primary);
|
|
39
|
-
if (t.text)
|
|
40
|
-
el.style.setProperty("--color-aai-text", t.text);
|
|
41
|
-
if (t.surface)
|
|
42
|
-
el.style.setProperty("--color-aai-surface", t.surface);
|
|
43
|
-
if (t.border)
|
|
44
|
-
el.style.setProperty("--color-aai-border", t.border);
|
|
45
|
-
}
|
|
46
|
-
render(_jsx(MountConfigProvider, { value: mountConfig, children: _jsx(SessionProvider, { value: signals, children: _jsx(Component, {}) }) }), container);
|
|
47
|
-
const handle = {
|
|
48
|
-
session,
|
|
49
|
-
signals,
|
|
50
|
-
dispose() {
|
|
51
|
-
render(null, container);
|
|
52
|
-
signals.dispose();
|
|
53
|
-
session.disconnect();
|
|
54
|
-
},
|
|
55
|
-
[Symbol.dispose]() {
|
|
56
|
-
handle.dispose();
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
return handle;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=mount.js.map
|
package/dist/ui/mount.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../../ui/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;YAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,CAAC,OAAO;YAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,CAAC,IAAI;YAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,CAAC,CAAC,OAAO;YAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,CAAC,MAAM;YAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,CACJ,KAAC,mBAAmB,IAAC,KAAK,EAAE,WAAW,YACrC,KAAC,eAAe,IAAC,KAAK,EAAE,OAAO,YAC7B,KAAC,SAAS,KAAG,GACG,GACE,EACtB,SAAS,CACV,CAAC;IAEF,MAAM,MAAM,GAAgB;QAC1B,OAAO;QACP,OAAO;QACP,OAAO;YACL,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACxB,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,CAAC;QACD,CAAC,MAAM,CAAC,OAAO,CAAC;YACd,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;KACF,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** Theme overrides for the default UI. Applied as CSS custom properties. */
|
|
2
|
-
export type MountTheme = {
|
|
3
|
-
/** Background color. Default: `#101010`. */
|
|
4
|
-
bg?: string;
|
|
5
|
-
/** Primary accent color. Default: `#fab283`. */
|
|
6
|
-
primary?: string;
|
|
7
|
-
/** Main text color. */
|
|
8
|
-
text?: string;
|
|
9
|
-
/** Surface/card color. */
|
|
10
|
-
surface?: string;
|
|
11
|
-
/** Border color. */
|
|
12
|
-
border?: string;
|
|
13
|
-
};
|
|
14
|
-
/** Resolved mount-level configuration available to default UI components. */
|
|
15
|
-
export type MountConfig = {
|
|
16
|
-
title?: string | undefined;
|
|
17
|
-
theme?: MountTheme | undefined;
|
|
18
|
-
};
|
|
19
|
-
export declare const MountConfigProvider: import("preact").Provider<MountConfig>;
|
|
20
|
-
/** Read mount config (title, theme) from the nearest provider. */
|
|
21
|
-
export declare function useMountConfig(): MountConfig;
|
|
22
|
-
//# sourceMappingURL=mount_context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount_context.d.ts","sourceRoot":"","sources":["../../ui/mount_context.ts"],"names":[],"mappings":"AAIA,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAAG;IACvB,4CAA4C;IAC5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF,eAAO,MAAM,mBAAmB,wCAAe,CAAC;AAEhD,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
|
package/dist/ui/mount_context.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 the AAI authors. MIT license.
|
|
2
|
-
import { createContext } from "preact";
|
|
3
|
-
import { useContext } from "preact/hooks";
|
|
4
|
-
const Ctx = createContext({});
|
|
5
|
-
export const MountConfigProvider = Ctx.Provider;
|
|
6
|
-
/** Read mount config (title, theme) from the nearest provider. */
|
|
7
|
-
export function useMountConfig() {
|
|
8
|
-
return useContext(Ctx);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=mount_context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount_context.js","sourceRoot":"","sources":["../../ui/mount_context.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsB1C,MAAM,GAAG,GAAG,aAAa,CAAc,EAAE,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC,QAAQ,CAAC;AAEhD,kEAAkE;AAClE,MAAM,UAAU,cAAc;IAC5B,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
package/dist/ui/session.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { type Signal } from "@preact/signals";
|
|
2
|
-
import type { ClientEvent, ReadyConfig } from "../sdk/protocol.ts";
|
|
3
|
-
import type { VoiceIO } from "./audio.ts";
|
|
4
|
-
import type { AgentState, Message, SessionError, SessionOptions, ToolCallInfo } from "./types.ts";
|
|
5
|
-
/**
|
|
6
|
-
* A reactive voice session that manages WebSocket communication,
|
|
7
|
-
* audio capture/playback, and agent state transitions.
|
|
8
|
-
*
|
|
9
|
-
* Uses plain JSON text frames and binary audio frames for communication
|
|
10
|
-
* and native WebSocket for the connection.
|
|
11
|
-
*
|
|
12
|
-
* Implements {@linkcode Disposable} for resource cleanup via `using`.
|
|
13
|
-
*/
|
|
14
|
-
export type VoiceSession = {
|
|
15
|
-
/** Current agent state (connecting, listening, thinking, etc.). */
|
|
16
|
-
readonly state: Signal<AgentState>;
|
|
17
|
-
/** Chat message history for the session. */
|
|
18
|
-
readonly messages: Signal<Message[]>;
|
|
19
|
-
/** Active tool calls for the current turn. */
|
|
20
|
-
readonly toolCalls: Signal<ToolCallInfo[]>;
|
|
21
|
-
/**
|
|
22
|
-
* Live user utterance from STT/VAD.
|
|
23
|
-
* `null` = not speaking, `""` = speech detected but no text yet,
|
|
24
|
-
* non-empty string = partial/final transcript text.
|
|
25
|
-
*/
|
|
26
|
-
readonly userUtterance: Signal<string | null>;
|
|
27
|
-
/**
|
|
28
|
-
* Streaming agent response text.
|
|
29
|
-
* `null` = not speaking, non-empty string = accumulated delta text.
|
|
30
|
-
* Cleared when the final `chat` message arrives.
|
|
31
|
-
*/
|
|
32
|
-
readonly agentUtterance: Signal<string | null>;
|
|
33
|
-
/** Current session error, or `null` if no error. */
|
|
34
|
-
readonly error: Signal<SessionError | null>;
|
|
35
|
-
/** Disconnection info, or `null` if connected. */
|
|
36
|
-
readonly disconnected: Signal<{
|
|
37
|
-
intentional: boolean;
|
|
38
|
-
} | null>;
|
|
39
|
-
/**
|
|
40
|
-
* Open a WebSocket connection to the server and begin audio capture.
|
|
41
|
-
*
|
|
42
|
-
* @param options - Optional connection options.
|
|
43
|
-
* @param options.signal - An AbortSignal that, when aborted, disconnects the session.
|
|
44
|
-
*/
|
|
45
|
-
connect(options?: {
|
|
46
|
-
signal?: AbortSignal;
|
|
47
|
-
}): void;
|
|
48
|
-
/** Cancel the current agent turn and discard in-flight TTS audio. */
|
|
49
|
-
cancel(): void;
|
|
50
|
-
/** Clear messages, transcript, and error state without disconnecting. */
|
|
51
|
-
resetState(): void;
|
|
52
|
-
/** Reset the session: clear state and reconnect. */
|
|
53
|
-
reset(): void;
|
|
54
|
-
/** Close the WebSocket and release all audio resources. */
|
|
55
|
-
disconnect(): void;
|
|
56
|
-
/** Alias for {@linkcode disconnect} for use with `using`. */
|
|
57
|
-
[Symbol.dispose](): void;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Handles server→client messages and updates reactive Preact signals
|
|
61
|
-
* accordingly (state transitions, transcripts, messages, audio playback).
|
|
62
|
-
*/
|
|
63
|
-
/** @internal Exported for testing only. */
|
|
64
|
-
export declare class ClientHandler {
|
|
65
|
-
#private;
|
|
66
|
-
constructor(opts: {
|
|
67
|
-
state: Signal<AgentState>;
|
|
68
|
-
messages: Signal<Message[]>;
|
|
69
|
-
toolCalls: Signal<ToolCallInfo[]>;
|
|
70
|
-
userUtterance: Signal<string | null>;
|
|
71
|
-
agentUtterance: Signal<string | null>;
|
|
72
|
-
error: Signal<SessionError | null>;
|
|
73
|
-
voiceIO: () => VoiceIO | null;
|
|
74
|
-
});
|
|
75
|
-
/** Single entry point for all server→client session events. */
|
|
76
|
-
event(e: ClientEvent): void;
|
|
77
|
-
playAudioChunk(chunk: Uint8Array): void;
|
|
78
|
-
playAudioDone(): void;
|
|
79
|
-
/**
|
|
80
|
-
* Dispatch an incoming WebSocket message (text or binary).
|
|
81
|
-
*
|
|
82
|
-
* Returns the parsed config if the message is a `config` message,
|
|
83
|
-
* otherwise `null`.
|
|
84
|
-
*/
|
|
85
|
-
handleMessage(data: string | ArrayBuffer): ReadyConfig | null;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Create a voice session that connects to an AAI server via WebSocket.
|
|
89
|
-
*
|
|
90
|
-
* Uses plain JSON text frames and binary audio frames for communication.
|
|
91
|
-
*
|
|
92
|
-
* @param options - Session configuration including the platform server URL.
|
|
93
|
-
* @returns A {@linkcode VoiceSession} handle for controlling the session.
|
|
94
|
-
*/
|
|
95
|
-
export declare function createVoiceSession(options: SessionOptions): VoiceSession;
|
|
96
|
-
//# sourceMappingURL=session.d.ts.map
|
package/dist/ui/session.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../ui/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,MAA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