@onlive.ai/common-121 0.2.70 → 0.2.179
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/README.md +0 -1
- package/chunk-CHMR2I4G.js +2 -0
- package/components/asset/asset-modal-portal.cjs +550 -0
- package/components/asset/asset-modal-portal.d.cts +22 -0
- package/components/asset/asset-modal-portal.d.ts +22 -0
- package/components/asset/asset-modal-portal.js +550 -0
- package/components/asset/asset.cjs +3536 -0
- package/components/asset/asset.d.cts +37 -0
- package/components/asset/asset.d.ts +37 -0
- package/components/asset/asset.js +3536 -0
- package/components/asset/asset.loaders.cjs +2 -0
- package/components/asset/asset.loaders.d.cts +17 -0
- package/components/asset/asset.loaders.d.ts +17 -0
- package/components/asset/asset.loaders.js +2 -0
- package/components/asset/asset.renderer.cjs +2292 -0
- package/components/asset/asset.renderer.d.cts +29 -0
- package/components/asset/asset.renderer.d.ts +29 -0
- package/components/asset/asset.renderer.js +2292 -0
- package/components/asset/asset.styles.cjs +683 -0
- package/components/asset/asset.styles.d.cts +6 -0
- package/components/asset/asset.styles.d.ts +6 -0
- package/components/asset/asset.styles.js +683 -0
- package/components/asset/asset.types.cjs +2 -0
- package/components/asset/asset.types.d.cts +103 -0
- package/components/asset/asset.types.d.ts +103 -0
- package/components/asset/asset.types.js +1 -0
- package/components/asset/index.cjs +3536 -0
- package/components/asset/index.d.cts +8 -0
- package/components/asset/index.d.ts +8 -0
- package/components/asset/index.js +3536 -0
- package/components/player/player.cjs +2044 -0
- package/components/player/player.d.cts +25 -0
- package/components/player/player.d.ts +25 -0
- package/components/player/player.js +2044 -0
- package/components/player/player.styles.cjs +16 -0
- package/components/player/player.styles.d.cts +6 -0
- package/components/player/player.styles.d.ts +6 -0
- package/components/player/player.styles.js +16 -0
- package/components/side-bar/index.cjs +3185 -0
- package/components/side-bar/index.d.cts +11 -0
- package/components/side-bar/index.d.ts +11 -0
- package/components/side-bar/index.js +3185 -0
- package/components/side-bar/side-bar.cjs +3185 -0
- package/components/side-bar/side-bar.d.cts +83 -0
- package/components/side-bar/side-bar.d.ts +83 -0
- package/components/side-bar/side-bar.js +3185 -0
- package/components/side-bar/side-bar.styles.cjs +801 -0
- package/components/side-bar/side-bar.styles.d.cts +6 -0
- package/components/side-bar/side-bar.styles.d.ts +6 -0
- package/components/side-bar/side-bar.styles.js +801 -0
- package/components/side-bar/side-bar.types.cjs +2 -0
- package/components/side-bar/side-bar.types.d.cts +105 -0
- package/components/side-bar/side-bar.types.d.ts +105 -0
- package/components/side-bar/side-bar.types.js +2 -0
- package/components/upload/index.cjs +83 -0
- package/components/upload/index.d.cts +4 -0
- package/components/upload/index.d.ts +4 -0
- package/components/upload/index.js +83 -0
- package/components/upload/upload.cjs +83 -0
- package/components/upload/upload.d.cts +28 -0
- package/components/upload/upload.d.ts +28 -0
- package/components/upload/upload.js +83 -0
- package/components/upload/upload.styles.cjs +65 -0
- package/components/upload/upload.styles.d.cts +6 -0
- package/components/upload/upload.styles.d.ts +6 -0
- package/components/upload/upload.styles.js +65 -0
- package/components/upload/upload.types.cjs +2 -0
- package/components/upload/upload.types.d.cts +16 -0
- package/components/upload/upload.types.d.ts +16 -0
- package/components/upload/upload.types.js +1 -0
- package/index.cjs +4677 -0
- package/index.d.cts +4397 -0
- package/index.d.ts +4397 -0
- package/index.js +4677 -0
- package/media-TFGJGBU2.js +2 -0
- package/package.json +35 -11
- package/react/components/asset/Asset.cjs +2 -0
- package/react/components/asset/Asset.jsx +2 -0
- package/react/components/side-bar/SideBar.cjs +2 -0
- package/react/components/side-bar/SideBar.jsx +2 -0
- package/react/components/upload/Upload.cjs +2 -0
- package/react/components/upload/Upload.jsx +2 -0
- package/services/audio.service.cjs +2 -2
- package/services/audio.service.d.cts +1 -0
- package/services/audio.service.d.ts +1 -0
- package/services/audio.service.js +2 -2
- package/services/conversation/conversation.service.cjs +2 -0
- package/services/conversation/conversation.service.d.cts +543 -0
- package/services/conversation/conversation.service.d.ts +543 -0
- package/services/conversation/conversation.service.js +2 -0
- package/services/conversation/conversation.types.cjs +2 -0
- package/services/conversation/conversation.types.d.cts +525 -0
- package/services/conversation/conversation.types.d.ts +525 -0
- package/services/conversation/conversation.types.js +2 -0
- package/services/conversation/index.cjs +2 -0
- package/services/conversation/index.d.cts +24 -0
- package/services/conversation/index.d.ts +24 -0
- package/services/conversation/index.js +2 -0
- package/services/conversation/mock/actor/agent.cjs +2 -0
- package/services/conversation/mock/actor/agent.d.cts +202 -0
- package/services/conversation/mock/actor/agent.d.ts +202 -0
- package/services/conversation/mock/actor/agent.js +2 -0
- package/services/conversation/mock/actor/index.cjs +2 -0
- package/services/conversation/mock/actor/index.d.cts +4 -0
- package/services/conversation/mock/actor/index.d.ts +4 -0
- package/services/conversation/mock/actor/index.js +2 -0
- package/services/conversation/mock/actor/strategies.cjs +2 -0
- package/services/conversation/mock/actor/strategies.d.cts +31 -0
- package/services/conversation/mock/actor/strategies.d.ts +31 -0
- package/services/conversation/mock/actor/strategies.js +2 -0
- package/services/conversation/mock/errors.cjs +2 -0
- package/services/conversation/mock/errors.d.cts +125 -0
- package/services/conversation/mock/errors.d.ts +125 -0
- package/services/conversation/mock/errors.js +2 -0
- package/services/conversation/mock/events.cjs +2 -0
- package/services/conversation/mock/events.d.cts +253 -0
- package/services/conversation/mock/events.d.ts +253 -0
- package/services/conversation/mock/events.js +2 -0
- package/services/conversation/mock/factory.cjs +2 -0
- package/services/conversation/mock/factory.d.cts +134 -0
- package/services/conversation/mock/factory.d.ts +134 -0
- package/services/conversation/mock/factory.js +2 -0
- package/services/conversation/mock/fixtures.cjs +2 -0
- package/services/conversation/mock/fixtures.d.cts +191 -0
- package/services/conversation/mock/fixtures.d.ts +191 -0
- package/services/conversation/mock/fixtures.js +2 -0
- package/services/conversation/mock/generators.cjs +2 -0
- package/services/conversation/mock/generators.d.cts +123 -0
- package/services/conversation/mock/generators.d.ts +123 -0
- package/services/conversation/mock/generators.js +2 -0
- package/services/conversation/mock/index.cjs +2 -0
- package/services/conversation/mock/index.d.cts +24 -0
- package/services/conversation/mock/index.d.ts +24 -0
- package/services/conversation/mock/index.js +2 -0
- package/services/conversation/mock/livekit/index.cjs +2 -0
- package/services/conversation/mock/livekit/index.d.cts +7 -0
- package/services/conversation/mock/livekit/index.d.ts +7 -0
- package/services/conversation/mock/livekit/index.js +2 -0
- package/services/conversation/mock/livekit/local-participant.cjs +2 -0
- package/services/conversation/mock/livekit/local-participant.d.cts +204 -0
- package/services/conversation/mock/livekit/local-participant.d.ts +204 -0
- package/services/conversation/mock/livekit/local-participant.js +2 -0
- package/services/conversation/mock/livekit/participant.cjs +2 -0
- package/services/conversation/mock/livekit/participant.d.cts +171 -0
- package/services/conversation/mock/livekit/participant.d.ts +171 -0
- package/services/conversation/mock/livekit/participant.js +2 -0
- package/services/conversation/mock/livekit/room.cjs +2 -0
- package/services/conversation/mock/livekit/room.d.cts +292 -0
- package/services/conversation/mock/livekit/room.d.ts +292 -0
- package/services/conversation/mock/livekit/room.js +2 -0
- package/services/conversation/mock/livekit/streams.cjs +2 -0
- package/services/conversation/mock/livekit/streams.d.cts +190 -0
- package/services/conversation/mock/livekit/streams.d.ts +190 -0
- package/services/conversation/mock/livekit/streams.js +2 -0
- package/services/conversation/mock/livekit/tracks.cjs +2 -0
- package/services/conversation/mock/livekit/tracks.d.cts +149 -0
- package/services/conversation/mock/livekit/tracks.d.ts +149 -0
- package/services/conversation/mock/livekit/tracks.js +2 -0
- package/services/conversation/mock/media.cjs +2 -0
- package/services/conversation/mock/media.d.cts +174 -0
- package/services/conversation/mock/media.d.ts +174 -0
- package/services/conversation/mock/media.js +2 -0
- package/services/conversation/mock/service.cjs +2 -0
- package/services/conversation/mock/service.d.cts +300 -0
- package/services/conversation/mock/service.d.ts +300 -0
- package/services/conversation/mock/service.js +2 -0
- package/services/conversation/mock/service.test.cjs +2 -0
- package/services/conversation/mock/service.test.d.cts +1 -0
- package/services/conversation/mock/service.test.d.ts +1 -0
- package/services/conversation/mock/service.test.js +2 -0
- package/services/conversation/mock/state.cjs +2 -0
- package/services/conversation/mock/state.d.cts +296 -0
- package/services/conversation/mock/state.d.ts +296 -0
- package/services/conversation/mock/state.js +2 -0
- package/services/conversation/mock/storybook.cjs +2 -0
- package/services/conversation/mock/storybook.d.cts +197 -0
- package/services/conversation/mock/storybook.d.ts +197 -0
- package/services/conversation/mock/storybook.js +2 -0
- package/services/conversation/mock/types.cjs +2 -0
- package/services/conversation/mock/types.d.cts +442 -0
- package/services/conversation/mock/types.d.ts +442 -0
- package/services/conversation/mock/types.js +1 -0
- package/services/faqs/faqs.service.cjs +2 -0
- package/services/faqs/faqs.service.d.cts +16 -0
- package/services/faqs/faqs.service.d.ts +16 -0
- package/services/faqs/faqs.service.js +2 -0
- package/services/faqs/faqs.types.cjs +2 -0
- package/services/faqs/faqs.types.d.cts +60 -0
- package/services/faqs/faqs.types.d.ts +60 -0
- package/services/faqs/faqs.types.js +1 -0
- package/services/faqs/index.cjs +2 -0
- package/services/faqs/index.d.cts +3 -0
- package/services/faqs/index.d.ts +3 -0
- package/services/faqs/index.js +2 -0
- package/services/file/file.service.cjs +2 -0
- package/services/file/file.service.d.cts +66 -0
- package/services/file/file.service.d.ts +66 -0
- package/services/file/file.service.js +2 -0
- package/services/file/file.types.cjs +2 -0
- package/services/file/file.types.d.cts +72 -0
- package/services/file/file.types.d.ts +72 -0
- package/services/file/file.types.js +1 -0
- package/services/file/index.cjs +2 -0
- package/services/file/index.d.cts +3 -0
- package/services/file/index.d.ts +3 -0
- package/services/file/index.js +2 -0
- package/services/firebase/firebase-api.cjs +2 -2
- package/services/firebase/firebase-api.d.cts +25 -9
- package/services/firebase/firebase-api.d.ts +25 -9
- package/services/firebase/firebase-api.js +2 -2
- package/services/multimedia/config.example.cjs +2 -0
- package/services/multimedia/config.example.d.cts +13 -0
- package/services/multimedia/config.example.d.ts +13 -0
- package/services/multimedia/config.example.js +2 -0
- package/services/multimedia/index.cjs +2 -0
- package/services/multimedia/index.d.cts +3 -0
- package/services/multimedia/index.d.ts +3 -0
- package/services/multimedia/index.js +2 -0
- package/services/multimedia/multimedia.service.cjs +2 -0
- package/services/multimedia/multimedia.service.d.cts +28 -0
- package/services/multimedia/multimedia.service.d.ts +28 -0
- package/services/multimedia/multimedia.service.js +2 -0
- package/services/multimedia/multimedia.types.cjs +2 -0
- package/services/multimedia/multimedia.types.d.cts +65 -0
- package/services/multimedia/multimedia.types.d.ts +65 -0
- package/services/multimedia/multimedia.types.js +1 -0
- package/services/product/index.cjs +2 -0
- package/services/product/index.d.cts +3 -0
- package/services/product/index.d.ts +3 -0
- package/services/product/index.js +2 -0
- package/services/product/product.service.cjs +2 -0
- package/services/product/product.service.d.cts +19 -0
- package/services/product/product.service.d.ts +19 -0
- package/services/product/product.service.js +2 -0
- package/services/product/product.types.cjs +2 -0
- package/services/product/product.types.d.cts +78 -0
- package/services/product/product.types.d.ts +78 -0
- package/services/product/product.types.js +1 -0
- package/services/request.provider.cjs +1 -1
- package/services/request.provider.d.cts +1 -0
- package/services/request.provider.d.ts +1 -0
- package/services/request.provider.js +1 -1
- package/services/session.service.cjs +2 -0
- package/services/session.service.d.cts +70 -0
- package/services/session.service.d.ts +70 -0
- package/services/session.service.js +2 -0
- package/services/upload/index.cjs +2 -0
- package/services/upload/index.d.cts +2 -0
- package/services/upload/index.d.ts +2 -0
- package/services/upload/index.js +2 -0
- package/services/upload/upload.service.cjs +2 -0
- package/services/upload/upload.service.d.cts +81 -0
- package/services/upload/upload.service.d.ts +81 -0
- package/services/upload/upload.service.js +2 -0
- package/themes/dark.cjs +16 -2
- package/themes/dark.d.cts +1 -0
- package/themes/dark.d.ts +1 -0
- package/themes/dark.js +15 -1
- package/themes/light.cjs +13 -2
- package/themes/light.d.cts +1 -0
- package/themes/light.d.ts +1 -0
- package/themes/light.js +12 -1
- package/types/globals.cjs +2 -0
- package/types/globals.d.cts +39 -0
- package/types/globals.d.ts +39 -0
- package/types/globals.js +1 -0
- package/types/tracking-options.cjs +2 -2
- package/types/tracking-options.d.cts +8 -6
- package/types/tracking-options.d.ts +8 -6
- package/types/tracking-options.js +1 -1
- package/utils/adopt-styles.cjs +2 -2
- package/utils/adopt-styles.d.cts +1 -0
- package/utils/adopt-styles.d.ts +1 -0
- package/utils/adopt-styles.js +2 -2
- package/utils/browser-preferences.cjs +2 -2
- package/utils/browser-preferences.d.cts +1 -0
- package/utils/browser-preferences.d.ts +1 -0
- package/utils/browser-preferences.js +2 -2
- package/utils/classify-media.cjs +1 -1
- package/utils/classify-media.d.cts +1 -0
- package/utils/classify-media.d.ts +1 -0
- package/utils/classify-media.js +1 -1
- package/utils/decorators.cjs +1 -1
- package/utils/decorators.d.cts +1 -0
- package/utils/decorators.d.ts +1 -0
- package/utils/decorators.js +1 -1
- package/utils/detected-lang.cjs +2 -2
- package/utils/detected-lang.d.cts +1 -0
- package/utils/detected-lang.d.ts +1 -0
- package/utils/detected-lang.js +2 -2
- package/utils/fullscreen.cjs +2 -2
- package/utils/fullscreen.d.cts +6 -5
- package/utils/fullscreen.d.ts +6 -5
- package/utils/fullscreen.js +2 -2
- package/utils/insert-script.cjs +1 -1
- package/utils/insert-script.d.cts +1 -0
- package/utils/insert-script.d.ts +1 -0
- package/utils/insert-script.js +1 -1
- package/utils/is-map-compatible.cjs +1 -1
- package/utils/is-map-compatible.d.cts +1 -0
- package/utils/is-map-compatible.d.ts +1 -0
- package/utils/is-map-compatible.js +1 -1
- package/utils/markdown.cjs +2 -2
- package/utils/markdown.d.cts +1 -0
- package/utils/markdown.d.ts +1 -0
- package/utils/markdown.js +2 -2
- package/utils/merge.cjs +2 -2
- package/utils/merge.d.cts +2 -1
- package/utils/merge.d.ts +2 -1
- package/utils/merge.js +2 -2
- package/utils/multiband-track-volume.cjs +2 -2
- package/utils/multiband-track-volume.d.cts +1 -0
- package/utils/multiband-track-volume.d.ts +1 -0
- package/utils/multiband-track-volume.js +2 -2
- package/utils/onlive-url-params.cjs +1 -1
- package/utils/onlive-url-params.d.cts +1 -0
- package/utils/onlive-url-params.d.ts +1 -0
- package/utils/onlive-url-params.js +1 -1
- package/utils/pretty-distance.cjs +2 -2
- package/utils/pretty-distance.d.cts +2 -1
- package/utils/pretty-distance.d.ts +2 -1
- package/utils/pretty-distance.js +2 -2
- package/utils/pretty-time.cjs +2 -0
- package/utils/pretty-time.d.cts +16 -0
- package/utils/pretty-time.d.ts +16 -0
- package/utils/pretty-time.js +2 -0
- package/utils/random-string.cjs +1 -1
- package/utils/random-string.d.cts +1 -0
- package/utils/random-string.d.ts +1 -0
- package/utils/random-string.js +1 -1
- package/utils/resource-type.cjs +1 -1
- package/utils/resource-type.d.cts +1 -0
- package/utils/resource-type.d.ts +1 -0
- package/utils/resource-type.js +1 -1
- package/utils/round-number.cjs +2 -0
- package/utils/round-number.d.cts +30 -0
- package/utils/round-number.d.ts +30 -0
- package/utils/round-number.js +2 -0
- package/utils/safe-html.cjs +2 -2
- package/utils/safe-html.d.cts +12 -4
- package/utils/safe-html.d.ts +12 -4
- package/utils/safe-html.js +2 -2
- package/utils/sanitize.cjs +2 -2
- package/utils/sanitize.d.cts +1 -0
- package/utils/sanitize.d.ts +1 -0
- package/utils/sanitize.js +2 -2
- package/utils/spread.cjs +2 -2
- package/utils/spread.d.cts +1 -0
- package/utils/spread.d.ts +1 -0
- package/utils/spread.js +2 -2
- package/utils/watch.cjs +1 -1
- package/utils/watch.d.cts +1 -0
- package/utils/watch.d.ts +1 -0
- package/utils/watch.js +1 -1
- package/services/firebase/firebase.service.cjs +0 -2
- package/services/firebase/firebase.service.d.cts +0 -40
- package/services/firebase/firebase.service.d.ts +0 -40
- package/services/firebase/firebase.service.js +0 -2
- package/services/livekit.service.cjs +0 -2
- package/services/livekit.service.d.cts +0 -219
- package/services/livekit.service.d.ts +0 -219
- package/services/livekit.service.js +0 -2
- package/types/window-context.cjs +0 -2
- package/types/window-context.d.cts +0 -8
- package/types/window-context.d.ts +0 -8
- package/types/window-context.js +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
import { MockAgentConfig, MockAgentStatus, MockAgentMessage, MockAgentResponseStrategy } from '../types.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file Mock AI Agent implementation.
|
|
6
|
+
*
|
|
7
|
+
* @description Provides a mock AI agent that can simulate responses in conversations.
|
|
8
|
+
* Supports multiple response strategies and conversation history tracking.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Custom response handler type.
|
|
13
|
+
*/
|
|
14
|
+
type MockAgentResponseHandler = (agentId: string, userMessage: string, history: MockAgentMessage[]) => string | Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Agent event types.
|
|
17
|
+
*/
|
|
18
|
+
type MockAgentEvent = {
|
|
19
|
+
type: "started";
|
|
20
|
+
agentId: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: "stopped";
|
|
23
|
+
agentId: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: "message_received";
|
|
26
|
+
agentId: string;
|
|
27
|
+
message: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: "response_sent";
|
|
30
|
+
agentId: string;
|
|
31
|
+
response: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: "error";
|
|
34
|
+
agentId: string;
|
|
35
|
+
error: Error;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Agent event listener.
|
|
39
|
+
*/
|
|
40
|
+
type MockAgentEventListener = (event: MockAgentEvent) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Mock AI Agent for simulating conversational responses.
|
|
43
|
+
*
|
|
44
|
+
* @description Simulates an AI agent that responds to user messages using configurable
|
|
45
|
+
* strategies. Maintains conversation history and supports custom response handlers.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const agent = new MockAgent("agent_1", "AI Assistant", {
|
|
50
|
+
* responseStrategy: "sequential",
|
|
51
|
+
* cannedResponses: ["Hello!", "How can I help?", "Goodbye!"],
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* await agent.start("room_123");
|
|
55
|
+
* const response = await agent.processMessage("Hi there");
|
|
56
|
+
* console.log(response); // "Hello!"
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare class MockAgent {
|
|
60
|
+
/** Agent ID */
|
|
61
|
+
readonly id: string;
|
|
62
|
+
/** Agent name */
|
|
63
|
+
readonly name: string;
|
|
64
|
+
/** Room ID this agent is assigned to */
|
|
65
|
+
roomId?: string;
|
|
66
|
+
/** Agent configuration */
|
|
67
|
+
private config;
|
|
68
|
+
/** Current state */
|
|
69
|
+
private _state;
|
|
70
|
+
/** Conversation history */
|
|
71
|
+
private conversationHistory;
|
|
72
|
+
/** Response index for sequential strategy */
|
|
73
|
+
private responseIndex;
|
|
74
|
+
/** Custom response handler */
|
|
75
|
+
private customHandler?;
|
|
76
|
+
/** Event listeners */
|
|
77
|
+
private eventListeners;
|
|
78
|
+
/** Random function for deterministic testing */
|
|
79
|
+
private randomFn;
|
|
80
|
+
/** Message count for maxMessages limit */
|
|
81
|
+
private messageCount;
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new MockAgent.
|
|
84
|
+
*
|
|
85
|
+
* @param id - Agent ID.
|
|
86
|
+
* @param name - Agent display name.
|
|
87
|
+
* @param config - Agent configuration.
|
|
88
|
+
*/
|
|
89
|
+
constructor(id: string, name: string, config?: Partial<MockAgentConfig>);
|
|
90
|
+
/**
|
|
91
|
+
* Gets the current agent state.
|
|
92
|
+
*/
|
|
93
|
+
get state(): MockAgentStatus;
|
|
94
|
+
/**
|
|
95
|
+
* Gets whether the agent is running.
|
|
96
|
+
*/
|
|
97
|
+
get isRunning(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Gets the conversation history.
|
|
100
|
+
*/
|
|
101
|
+
get history(): ReadonlyArray<MockAgentMessage>;
|
|
102
|
+
/**
|
|
103
|
+
* Gets the agent configuration.
|
|
104
|
+
*/
|
|
105
|
+
getConfig(): MockAgentConfig;
|
|
106
|
+
/**
|
|
107
|
+
* Updates the agent configuration.
|
|
108
|
+
*
|
|
109
|
+
* @param config - Partial configuration to merge.
|
|
110
|
+
*/
|
|
111
|
+
updateConfig(config: Partial<MockAgentConfig>): void;
|
|
112
|
+
/**
|
|
113
|
+
* Sets the response strategy.
|
|
114
|
+
*
|
|
115
|
+
* @param strategy - Response strategy.
|
|
116
|
+
*/
|
|
117
|
+
setStrategy(strategy: MockAgentResponseStrategy): void;
|
|
118
|
+
/**
|
|
119
|
+
* Sets canned responses.
|
|
120
|
+
*
|
|
121
|
+
* @param responses - Array of canned responses.
|
|
122
|
+
*/
|
|
123
|
+
setCannedResponses(responses: string[]): void;
|
|
124
|
+
/**
|
|
125
|
+
* Sets a custom response handler.
|
|
126
|
+
*
|
|
127
|
+
* @param handler - Custom handler function.
|
|
128
|
+
*/
|
|
129
|
+
setCustomHandler(handler: MockAgentResponseHandler): void;
|
|
130
|
+
/**
|
|
131
|
+
* Sets the random function for deterministic testing.
|
|
132
|
+
*
|
|
133
|
+
* @param fn - Random function.
|
|
134
|
+
*/
|
|
135
|
+
setRandomFunction(fn: () => number): void;
|
|
136
|
+
/**
|
|
137
|
+
* Starts the agent in a room.
|
|
138
|
+
*
|
|
139
|
+
* @param roomId - Room ID to join.
|
|
140
|
+
*/
|
|
141
|
+
start(roomId: string): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Stops the agent.
|
|
144
|
+
*/
|
|
145
|
+
stop(): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Processes a user message and generates a response.
|
|
148
|
+
*
|
|
149
|
+
* @param message - User message.
|
|
150
|
+
* @returns Agent response (empty string if silent).
|
|
151
|
+
*/
|
|
152
|
+
processMessage(message: string): Promise<string>;
|
|
153
|
+
/**
|
|
154
|
+
* Adds an event listener.
|
|
155
|
+
*
|
|
156
|
+
* @param listener - Event listener function.
|
|
157
|
+
* @returns Unsubscribe function.
|
|
158
|
+
*/
|
|
159
|
+
addEventListener(listener: MockAgentEventListener): () => void;
|
|
160
|
+
/**
|
|
161
|
+
* Clears the conversation history.
|
|
162
|
+
*/
|
|
163
|
+
clearHistory(): void;
|
|
164
|
+
/**
|
|
165
|
+
* Resets the agent to initial state.
|
|
166
|
+
*/
|
|
167
|
+
reset(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Serializes agent state for debugging.
|
|
170
|
+
*/
|
|
171
|
+
toJSON(): object;
|
|
172
|
+
private addMessage;
|
|
173
|
+
private emitEvent;
|
|
174
|
+
private delay;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Creates a mock agent with common presets.
|
|
178
|
+
*/
|
|
179
|
+
declare const MockAgentPresets: {
|
|
180
|
+
/**
|
|
181
|
+
* Creates an echo agent.
|
|
182
|
+
*/
|
|
183
|
+
echo(name?: string): MockAgent;
|
|
184
|
+
/**
|
|
185
|
+
* Creates a silent agent.
|
|
186
|
+
*/
|
|
187
|
+
silent(name?: string): MockAgent;
|
|
188
|
+
/**
|
|
189
|
+
* Creates an agent with sequential responses.
|
|
190
|
+
*/
|
|
191
|
+
sequential(name: string, responses: string[]): MockAgent;
|
|
192
|
+
/**
|
|
193
|
+
* Creates an AI assistant agent.
|
|
194
|
+
*/
|
|
195
|
+
aiAssistant(name?: string): MockAgent;
|
|
196
|
+
/**
|
|
197
|
+
* Creates a customer support agent.
|
|
198
|
+
*/
|
|
199
|
+
customerSupport(name?: string): MockAgent;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export { MockAgent, type MockAgentEvent, type MockAgentEventListener, MockAgentPresets, type MockAgentResponseHandler };
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
import { MockAgentConfig, MockAgentStatus, MockAgentMessage, MockAgentResponseStrategy } from '../types.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file Mock AI Agent implementation.
|
|
6
|
+
*
|
|
7
|
+
* @description Provides a mock AI agent that can simulate responses in conversations.
|
|
8
|
+
* Supports multiple response strategies and conversation history tracking.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Custom response handler type.
|
|
13
|
+
*/
|
|
14
|
+
type MockAgentResponseHandler = (agentId: string, userMessage: string, history: MockAgentMessage[]) => string | Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Agent event types.
|
|
17
|
+
*/
|
|
18
|
+
type MockAgentEvent = {
|
|
19
|
+
type: "started";
|
|
20
|
+
agentId: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: "stopped";
|
|
23
|
+
agentId: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: "message_received";
|
|
26
|
+
agentId: string;
|
|
27
|
+
message: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: "response_sent";
|
|
30
|
+
agentId: string;
|
|
31
|
+
response: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: "error";
|
|
34
|
+
agentId: string;
|
|
35
|
+
error: Error;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Agent event listener.
|
|
39
|
+
*/
|
|
40
|
+
type MockAgentEventListener = (event: MockAgentEvent) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Mock AI Agent for simulating conversational responses.
|
|
43
|
+
*
|
|
44
|
+
* @description Simulates an AI agent that responds to user messages using configurable
|
|
45
|
+
* strategies. Maintains conversation history and supports custom response handlers.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const agent = new MockAgent("agent_1", "AI Assistant", {
|
|
50
|
+
* responseStrategy: "sequential",
|
|
51
|
+
* cannedResponses: ["Hello!", "How can I help?", "Goodbye!"],
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* await agent.start("room_123");
|
|
55
|
+
* const response = await agent.processMessage("Hi there");
|
|
56
|
+
* console.log(response); // "Hello!"
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare class MockAgent {
|
|
60
|
+
/** Agent ID */
|
|
61
|
+
readonly id: string;
|
|
62
|
+
/** Agent name */
|
|
63
|
+
readonly name: string;
|
|
64
|
+
/** Room ID this agent is assigned to */
|
|
65
|
+
roomId?: string;
|
|
66
|
+
/** Agent configuration */
|
|
67
|
+
private config;
|
|
68
|
+
/** Current state */
|
|
69
|
+
private _state;
|
|
70
|
+
/** Conversation history */
|
|
71
|
+
private conversationHistory;
|
|
72
|
+
/** Response index for sequential strategy */
|
|
73
|
+
private responseIndex;
|
|
74
|
+
/** Custom response handler */
|
|
75
|
+
private customHandler?;
|
|
76
|
+
/** Event listeners */
|
|
77
|
+
private eventListeners;
|
|
78
|
+
/** Random function for deterministic testing */
|
|
79
|
+
private randomFn;
|
|
80
|
+
/** Message count for maxMessages limit */
|
|
81
|
+
private messageCount;
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new MockAgent.
|
|
84
|
+
*
|
|
85
|
+
* @param id - Agent ID.
|
|
86
|
+
* @param name - Agent display name.
|
|
87
|
+
* @param config - Agent configuration.
|
|
88
|
+
*/
|
|
89
|
+
constructor(id: string, name: string, config?: Partial<MockAgentConfig>);
|
|
90
|
+
/**
|
|
91
|
+
* Gets the current agent state.
|
|
92
|
+
*/
|
|
93
|
+
get state(): MockAgentStatus;
|
|
94
|
+
/**
|
|
95
|
+
* Gets whether the agent is running.
|
|
96
|
+
*/
|
|
97
|
+
get isRunning(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Gets the conversation history.
|
|
100
|
+
*/
|
|
101
|
+
get history(): ReadonlyArray<MockAgentMessage>;
|
|
102
|
+
/**
|
|
103
|
+
* Gets the agent configuration.
|
|
104
|
+
*/
|
|
105
|
+
getConfig(): MockAgentConfig;
|
|
106
|
+
/**
|
|
107
|
+
* Updates the agent configuration.
|
|
108
|
+
*
|
|
109
|
+
* @param config - Partial configuration to merge.
|
|
110
|
+
*/
|
|
111
|
+
updateConfig(config: Partial<MockAgentConfig>): void;
|
|
112
|
+
/**
|
|
113
|
+
* Sets the response strategy.
|
|
114
|
+
*
|
|
115
|
+
* @param strategy - Response strategy.
|
|
116
|
+
*/
|
|
117
|
+
setStrategy(strategy: MockAgentResponseStrategy): void;
|
|
118
|
+
/**
|
|
119
|
+
* Sets canned responses.
|
|
120
|
+
*
|
|
121
|
+
* @param responses - Array of canned responses.
|
|
122
|
+
*/
|
|
123
|
+
setCannedResponses(responses: string[]): void;
|
|
124
|
+
/**
|
|
125
|
+
* Sets a custom response handler.
|
|
126
|
+
*
|
|
127
|
+
* @param handler - Custom handler function.
|
|
128
|
+
*/
|
|
129
|
+
setCustomHandler(handler: MockAgentResponseHandler): void;
|
|
130
|
+
/**
|
|
131
|
+
* Sets the random function for deterministic testing.
|
|
132
|
+
*
|
|
133
|
+
* @param fn - Random function.
|
|
134
|
+
*/
|
|
135
|
+
setRandomFunction(fn: () => number): void;
|
|
136
|
+
/**
|
|
137
|
+
* Starts the agent in a room.
|
|
138
|
+
*
|
|
139
|
+
* @param roomId - Room ID to join.
|
|
140
|
+
*/
|
|
141
|
+
start(roomId: string): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Stops the agent.
|
|
144
|
+
*/
|
|
145
|
+
stop(): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Processes a user message and generates a response.
|
|
148
|
+
*
|
|
149
|
+
* @param message - User message.
|
|
150
|
+
* @returns Agent response (empty string if silent).
|
|
151
|
+
*/
|
|
152
|
+
processMessage(message: string): Promise<string>;
|
|
153
|
+
/**
|
|
154
|
+
* Adds an event listener.
|
|
155
|
+
*
|
|
156
|
+
* @param listener - Event listener function.
|
|
157
|
+
* @returns Unsubscribe function.
|
|
158
|
+
*/
|
|
159
|
+
addEventListener(listener: MockAgentEventListener): () => void;
|
|
160
|
+
/**
|
|
161
|
+
* Clears the conversation history.
|
|
162
|
+
*/
|
|
163
|
+
clearHistory(): void;
|
|
164
|
+
/**
|
|
165
|
+
* Resets the agent to initial state.
|
|
166
|
+
*/
|
|
167
|
+
reset(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Serializes agent state for debugging.
|
|
170
|
+
*/
|
|
171
|
+
toJSON(): object;
|
|
172
|
+
private addMessage;
|
|
173
|
+
private emitEvent;
|
|
174
|
+
private delay;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Creates a mock agent with common presets.
|
|
178
|
+
*/
|
|
179
|
+
declare const MockAgentPresets: {
|
|
180
|
+
/**
|
|
181
|
+
* Creates an echo agent.
|
|
182
|
+
*/
|
|
183
|
+
echo(name?: string): MockAgent;
|
|
184
|
+
/**
|
|
185
|
+
* Creates a silent agent.
|
|
186
|
+
*/
|
|
187
|
+
silent(name?: string): MockAgent;
|
|
188
|
+
/**
|
|
189
|
+
* Creates an agent with sequential responses.
|
|
190
|
+
*/
|
|
191
|
+
sequential(name: string, responses: string[]): MockAgent;
|
|
192
|
+
/**
|
|
193
|
+
* Creates an AI assistant agent.
|
|
194
|
+
*/
|
|
195
|
+
aiAssistant(name?: string): MockAgent;
|
|
196
|
+
/**
|
|
197
|
+
* Creates a customer support agent.
|
|
198
|
+
*/
|
|
199
|
+
customerSupport(name?: string): MockAgent;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export { MockAgent, type MockAgentEvent, type MockAgentEventListener, MockAgentPresets, type MockAgentResponseHandler };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
var a=0;function r(s){return a++,`mock_${s}_${a}_${Date.now().toString(36)}`}var g={responseStrategy:"echo",responseDelayMs:100,cannedResponses:[],type:"text",nature:"ai",simulateTyping:!1,typingDelayPerChar:20};function c(s,e,n=[],t=0,p=Math.random){switch(s){case"echo":return{response:`Echo: ${e}`,nextIndex:t};case"canned":return{response:n[0]||"Default response",nextIndex:t};case"sequential":return{response:n[t]||"No more responses",nextIndex:(t+1)%Math.max(1,n.length)};case"random":{if(n.length===0)return{response:"Random response",nextIndex:t};let i=Math.floor(p()*n.length);return{response:n[i],nextIndex:t}}case"silent":return{response:"",nextIndex:t};case"error":throw new Error("Agent error");case"custom":return{response:"",nextIndex:t};default:return{response:"Default agent response",nextIndex:t}}}var o=class{constructor(e,n,t={}){this._state="idle";this.conversationHistory=[];this.responseIndex=0;this.eventListeners=new Set;this.randomFn=Math.random;this.messageCount=0;this.id=e,this.name=n,this.config={...g,...t}}get state(){return this._state}get isRunning(){return this._state==="running"}get history(){return[...this.conversationHistory]}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e}}setStrategy(e){this.config.responseStrategy=e}setCannedResponses(e){this.config.cannedResponses=e,this.responseIndex=0}setCustomHandler(e){this.customHandler=e,this.config.responseStrategy="custom"}setRandomFunction(e){this.randomFn=e}async start(e){this._state!=="running"&&(this._state="starting",this.roomId=e,this.conversationHistory=[],this.responseIndex=0,this.messageCount=0,await this.delay(50),this._state="running",this.emitEvent({type:"started",agentId:this.id}))}async stop(){this._state==="running"&&(this._state="stopping",await this.delay(50),this._state="stopped",this.roomId=void 0,this.emitEvent({type:"stopped",agentId:this.id}))}async processMessage(e){if(this._state!=="running")throw new Error("Agent is not running");if(this.config.maxMessages&&this.messageCount>=this.config.maxMessages)return await this.stop(),"";this.addMessage(e,"user"),this.emitEvent({type:"message_received",agentId:this.id,message:e});let n;try{if(this.config.responseStrategy==="custom"&&this.customHandler)n=await this.customHandler(this.id,e,this.conversationHistory);else{if(this.config.responseStrategy==="silent")return"";if(this.config.responseStrategy==="error"){let t=new Error("Agent error");throw this.emitEvent({type:"error",agentId:this.id,error:t}),t}else{let t=c(this.config.responseStrategy,e,this.config.cannedResponses,this.responseIndex,this.randomFn);n=t.response,this.responseIndex=t.nextIndex}}}catch(t){throw this._state="error",t}return this.config.simulateTyping&&this.config.typingDelayPerChar&&await this.delay(n.length*this.config.typingDelayPerChar),this.config.responseDelayMs&&await this.delay(this.config.responseDelayMs),this.addMessage(n,"agent"),this.messageCount++,this.emitEvent({type:"response_sent",agentId:this.id,response:n}),n}addEventListener(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}clearHistory(){this.conversationHistory=[],this.responseIndex=0}reset(){this._state="idle",this.roomId=void 0,this.conversationHistory=[],this.responseIndex=0,this.messageCount=0}toJSON(){return{id:this.id,name:this.name,state:this._state,roomId:this.roomId,config:this.config,historyLength:this.conversationHistory.length,messageCount:this.messageCount}}addMessage(e,n){let t={id:r("msg"),content:e,role:n,timestamp:Date.now()};return this.conversationHistory.push(t),t}emitEvent(e){for(let n of this.eventListeners)try{n(e)}catch(t){console.error("Error in agent event listener:",t)}}delay(e){return new Promise(n=>setTimeout(n,e))}},m={echo(s="Echo Agent"){return new o(r("agent"),s,{responseStrategy:"echo"})},silent(s="Silent Agent"){return new o(r("agent"),s,{responseStrategy:"silent"})},sequential(s,e){return new o(r("agent"),s,{responseStrategy:"sequential",cannedResponses:e})},aiAssistant(s="AI Assistant"){return new o(r("agent"),s,{responseStrategy:"sequential",responseDelayMs:150,simulateTyping:!0,typingDelayPerChar:10,cannedResponses:["Hello! How can I help you today?","I understand. Let me help you with that.","Is there anything else I can assist you with?","Thank you for your question. Here's what I found...","I'm happy to help! What would you like to know?"]})},customerSupport(s="Support Agent"){return new o(r("agent"),s,{responseStrategy:"sequential",responseDelayMs:200,cannedResponses:["Thank you for contacting support. How may I assist you?","I apologize for any inconvenience. Let me look into that for you.","I've found a solution. Here's what you need to do...","Is there anything else I can help you with today?","Thank you for contacting us. Have a great day!"]})}};export{o as MockAgent,m as MockAgentPresets};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
"use strict";var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var l=(s,e)=>{for(var n in e)c(s,n,{get:e[n],enumerable:!0})},f=(s,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of y(e))!m.call(s,o)&&o!==n&&c(s,o,{get:()=>e[o],enumerable:!(t=u(e,o))||t.enumerable});return s};var M=s=>f(c({},"__esModule",{value:!0}),s);var k={};l(k,{DEFAULT_AGENT_CONFIG:()=>a,MockAgent:()=>r,MockAgentPresets:()=>h,generateStrategyResponse:()=>g});module.exports=M(k);var d=0;function i(s){return d++,`mock_${s}_${d}_${Date.now().toString(36)}`}var a={responseStrategy:"echo",responseDelayMs:100,cannedResponses:[],type:"text",nature:"ai",simulateTyping:!1,typingDelayPerChar:20};function g(s,e,n=[],t=0,o=Math.random){switch(s){case"echo":return{response:`Echo: ${e}`,nextIndex:t};case"canned":return{response:n[0]||"Default response",nextIndex:t};case"sequential":return{response:n[t]||"No more responses",nextIndex:(t+1)%Math.max(1,n.length)};case"random":{if(n.length===0)return{response:"Random response",nextIndex:t};let p=Math.floor(o()*n.length);return{response:n[p],nextIndex:t}}case"silent":return{response:"",nextIndex:t};case"error":throw new Error("Agent error");case"custom":return{response:"",nextIndex:t};default:return{response:"Default agent response",nextIndex:t}}}var r=class{constructor(e,n,t={}){this._state="idle";this.conversationHistory=[];this.responseIndex=0;this.eventListeners=new Set;this.randomFn=Math.random;this.messageCount=0;this.id=e,this.name=n,this.config={...a,...t}}get state(){return this._state}get isRunning(){return this._state==="running"}get history(){return[...this.conversationHistory]}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e}}setStrategy(e){this.config.responseStrategy=e}setCannedResponses(e){this.config.cannedResponses=e,this.responseIndex=0}setCustomHandler(e){this.customHandler=e,this.config.responseStrategy="custom"}setRandomFunction(e){this.randomFn=e}async start(e){this._state!=="running"&&(this._state="starting",this.roomId=e,this.conversationHistory=[],this.responseIndex=0,this.messageCount=0,await this.delay(50),this._state="running",this.emitEvent({type:"started",agentId:this.id}))}async stop(){this._state==="running"&&(this._state="stopping",await this.delay(50),this._state="stopped",this.roomId=void 0,this.emitEvent({type:"stopped",agentId:this.id}))}async processMessage(e){if(this._state!=="running")throw new Error("Agent is not running");if(this.config.maxMessages&&this.messageCount>=this.config.maxMessages)return await this.stop(),"";this.addMessage(e,"user"),this.emitEvent({type:"message_received",agentId:this.id,message:e});let n;try{if(this.config.responseStrategy==="custom"&&this.customHandler)n=await this.customHandler(this.id,e,this.conversationHistory);else{if(this.config.responseStrategy==="silent")return"";if(this.config.responseStrategy==="error"){let t=new Error("Agent error");throw this.emitEvent({type:"error",agentId:this.id,error:t}),t}else{let t=g(this.config.responseStrategy,e,this.config.cannedResponses,this.responseIndex,this.randomFn);n=t.response,this.responseIndex=t.nextIndex}}}catch(t){throw this._state="error",t}return this.config.simulateTyping&&this.config.typingDelayPerChar&&await this.delay(n.length*this.config.typingDelayPerChar),this.config.responseDelayMs&&await this.delay(this.config.responseDelayMs),this.addMessage(n,"agent"),this.messageCount++,this.emitEvent({type:"response_sent",agentId:this.id,response:n}),n}addEventListener(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}clearHistory(){this.conversationHistory=[],this.responseIndex=0}reset(){this._state="idle",this.roomId=void 0,this.conversationHistory=[],this.responseIndex=0,this.messageCount=0}toJSON(){return{id:this.id,name:this.name,state:this._state,roomId:this.roomId,config:this.config,historyLength:this.conversationHistory.length,messageCount:this.messageCount}}addMessage(e,n){let t={id:i("msg"),content:e,role:n,timestamp:Date.now()};return this.conversationHistory.push(t),t}emitEvent(e){for(let n of this.eventListeners)try{n(e)}catch(t){console.error("Error in agent event listener:",t)}}delay(e){return new Promise(n=>setTimeout(n,e))}},h={echo(s="Echo Agent"){return new r(i("agent"),s,{responseStrategy:"echo"})},silent(s="Silent Agent"){return new r(i("agent"),s,{responseStrategy:"silent"})},sequential(s,e){return new r(i("agent"),s,{responseStrategy:"sequential",cannedResponses:e})},aiAssistant(s="AI Assistant"){return new r(i("agent"),s,{responseStrategy:"sequential",responseDelayMs:150,simulateTyping:!0,typingDelayPerChar:10,cannedResponses:["Hello! How can I help you today?","I understand. Let me help you with that.","Is there anything else I can assist you with?","Thank you for your question. Here's what I found...","I'm happy to help! What would you like to know?"]})},customerSupport(s="Support Agent"){return new r(i("agent"),s,{responseStrategy:"sequential",responseDelayMs:200,cannedResponses:["Thank you for contacting support. How may I assist you?","I apologize for any inconvenience. Let me look into that for you.","I've found a solution. Here's what you need to do...","Is there anything else I can help you with today?","Thank you for contacting us. Have a great day!"]})}};0&&(module.exports={DEFAULT_AGENT_CONFIG,MockAgent,MockAgentPresets,generateStrategyResponse});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
export { MockAgent, MockAgentEvent, MockAgentEventListener, MockAgentPresets, MockAgentResponseHandler } from './agent.cjs';
|
|
3
|
+
export { DEFAULT_AGENT_CONFIG, generateStrategyResponse } from './strategies.cjs';
|
|
4
|
+
export { MockAgentConfig, MockAgentMessage, MockAgentResponseStrategy } from '../types.cjs';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
export { MockAgent, MockAgentEvent, MockAgentEventListener, MockAgentPresets, MockAgentResponseHandler } from './agent.js';
|
|
3
|
+
export { DEFAULT_AGENT_CONFIG, generateStrategyResponse } from './strategies.js';
|
|
4
|
+
export { MockAgentConfig, MockAgentMessage, MockAgentResponseStrategy } from '../types.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
var c=0;function o(s){return c++,`mock_${s}_${c}_${Date.now().toString(36)}`}var i={responseStrategy:"echo",responseDelayMs:100,cannedResponses:[],type:"text",nature:"ai",simulateTyping:!1,typingDelayPerChar:20};function a(s,e,n=[],t=0,p=Math.random){switch(s){case"echo":return{response:`Echo: ${e}`,nextIndex:t};case"canned":return{response:n[0]||"Default response",nextIndex:t};case"sequential":return{response:n[t]||"No more responses",nextIndex:(t+1)%Math.max(1,n.length)};case"random":{if(n.length===0)return{response:"Random response",nextIndex:t};let g=Math.floor(p()*n.length);return{response:n[g],nextIndex:t}}case"silent":return{response:"",nextIndex:t};case"error":throw new Error("Agent error");case"custom":return{response:"",nextIndex:t};default:return{response:"Default agent response",nextIndex:t}}}var r=class{constructor(e,n,t={}){this._state="idle";this.conversationHistory=[];this.responseIndex=0;this.eventListeners=new Set;this.randomFn=Math.random;this.messageCount=0;this.id=e,this.name=n,this.config={...i,...t}}get state(){return this._state}get isRunning(){return this._state==="running"}get history(){return[...this.conversationHistory]}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e}}setStrategy(e){this.config.responseStrategy=e}setCannedResponses(e){this.config.cannedResponses=e,this.responseIndex=0}setCustomHandler(e){this.customHandler=e,this.config.responseStrategy="custom"}setRandomFunction(e){this.randomFn=e}async start(e){this._state!=="running"&&(this._state="starting",this.roomId=e,this.conversationHistory=[],this.responseIndex=0,this.messageCount=0,await this.delay(50),this._state="running",this.emitEvent({type:"started",agentId:this.id}))}async stop(){this._state==="running"&&(this._state="stopping",await this.delay(50),this._state="stopped",this.roomId=void 0,this.emitEvent({type:"stopped",agentId:this.id}))}async processMessage(e){if(this._state!=="running")throw new Error("Agent is not running");if(this.config.maxMessages&&this.messageCount>=this.config.maxMessages)return await this.stop(),"";this.addMessage(e,"user"),this.emitEvent({type:"message_received",agentId:this.id,message:e});let n;try{if(this.config.responseStrategy==="custom"&&this.customHandler)n=await this.customHandler(this.id,e,this.conversationHistory);else{if(this.config.responseStrategy==="silent")return"";if(this.config.responseStrategy==="error"){let t=new Error("Agent error");throw this.emitEvent({type:"error",agentId:this.id,error:t}),t}else{let t=a(this.config.responseStrategy,e,this.config.cannedResponses,this.responseIndex,this.randomFn);n=t.response,this.responseIndex=t.nextIndex}}}catch(t){throw this._state="error",t}return this.config.simulateTyping&&this.config.typingDelayPerChar&&await this.delay(n.length*this.config.typingDelayPerChar),this.config.responseDelayMs&&await this.delay(this.config.responseDelayMs),this.addMessage(n,"agent"),this.messageCount++,this.emitEvent({type:"response_sent",agentId:this.id,response:n}),n}addEventListener(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}clearHistory(){this.conversationHistory=[],this.responseIndex=0}reset(){this._state="idle",this.roomId=void 0,this.conversationHistory=[],this.responseIndex=0,this.messageCount=0}toJSON(){return{id:this.id,name:this.name,state:this._state,roomId:this.roomId,config:this.config,historyLength:this.conversationHistory.length,messageCount:this.messageCount}}addMessage(e,n){let t={id:o("msg"),content:e,role:n,timestamp:Date.now()};return this.conversationHistory.push(t),t}emitEvent(e){for(let n of this.eventListeners)try{n(e)}catch(t){console.error("Error in agent event listener:",t)}}delay(e){return new Promise(n=>setTimeout(n,e))}},d={echo(s="Echo Agent"){return new r(o("agent"),s,{responseStrategy:"echo"})},silent(s="Silent Agent"){return new r(o("agent"),s,{responseStrategy:"silent"})},sequential(s,e){return new r(o("agent"),s,{responseStrategy:"sequential",cannedResponses:e})},aiAssistant(s="AI Assistant"){return new r(o("agent"),s,{responseStrategy:"sequential",responseDelayMs:150,simulateTyping:!0,typingDelayPerChar:10,cannedResponses:["Hello! How can I help you today?","I understand. Let me help you with that.","Is there anything else I can assist you with?","Thank you for your question. Here's what I found...","I'm happy to help! What would you like to know?"]})},customerSupport(s="Support Agent"){return new r(o("agent"),s,{responseStrategy:"sequential",responseDelayMs:200,cannedResponses:["Thank you for contacting support. How may I assist you?","I apologize for any inconvenience. Let me look into that for you.","I've found a solution. Here's what you need to do...","Is there anything else I can help you with today?","Thank you for contacting us. Have a great day!"]})}};export{i as DEFAULT_AGENT_CONFIG,r as MockAgent,d as MockAgentPresets,a as generateStrategyResponse};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
"use strict";var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(n,t)=>{for(var r in t)s(n,r,{get:t[r],enumerable:!0})},i=(n,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of c(t))!p.call(n,o)&&o!==r&&s(n,o,{get:()=>t[o],enumerable:!(e=g(t,o))||e.enumerable});return n};var x=n=>i(s({},"__esModule",{value:!0}),n);var m={};u(m,{DEFAULT_AGENT_CONFIG:()=>y,generateStrategyResponse:()=>l});module.exports=x(m);var y={responseStrategy:"echo",responseDelayMs:100,cannedResponses:[],type:"text",nature:"ai",simulateTyping:!1,typingDelayPerChar:20};function l(n,t,r=[],e=0,o=Math.random){switch(n){case"echo":return{response:`Echo: ${t}`,nextIndex:e};case"canned":return{response:r[0]||"Default response",nextIndex:e};case"sequential":return{response:r[e]||"No more responses",nextIndex:(e+1)%Math.max(1,r.length)};case"random":{if(r.length===0)return{response:"Random response",nextIndex:e};let a=Math.floor(o()*r.length);return{response:r[a],nextIndex:e}}case"silent":return{response:"",nextIndex:e};case"error":throw new Error("Agent error");case"custom":return{response:"",nextIndex:e};default:return{response:"Default agent response",nextIndex:e}}}0&&(module.exports={DEFAULT_AGENT_CONFIG,generateStrategyResponse});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
import { MockAgentConfig, MockAgentResponseStrategy } from '../types.cjs';
|
|
3
|
+
export { MockAgentMessage } from '../types.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file Mock Agent response strategies.
|
|
7
|
+
*
|
|
8
|
+
* @description Defines response strategies for mock AI agents.
|
|
9
|
+
* These strategies determine how agents respond to user messages.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Default agent configuration.
|
|
14
|
+
*/
|
|
15
|
+
declare const DEFAULT_AGENT_CONFIG: MockAgentConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Generates a response based on strategy.
|
|
18
|
+
*
|
|
19
|
+
* @param strategy - Response strategy.
|
|
20
|
+
* @param userMessage - User's message.
|
|
21
|
+
* @param cannedResponses - Available canned responses.
|
|
22
|
+
* @param responseIndex - Current index for sequential strategy.
|
|
23
|
+
* @param randomFn - Random function for deterministic testing.
|
|
24
|
+
* @returns Generated response and next index.
|
|
25
|
+
*/
|
|
26
|
+
declare function generateStrategyResponse(strategy: MockAgentResponseStrategy, userMessage: string, cannedResponses?: string[], responseIndex?: number, randomFn?: () => number): {
|
|
27
|
+
response: string;
|
|
28
|
+
nextIndex: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { DEFAULT_AGENT_CONFIG, MockAgentConfig, MockAgentResponseStrategy, generateStrategyResponse };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
import { MockAgentConfig, MockAgentResponseStrategy } from '../types.js';
|
|
3
|
+
export { MockAgentMessage } from '../types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file Mock Agent response strategies.
|
|
7
|
+
*
|
|
8
|
+
* @description Defines response strategies for mock AI agents.
|
|
9
|
+
* These strategies determine how agents respond to user messages.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Default agent configuration.
|
|
14
|
+
*/
|
|
15
|
+
declare const DEFAULT_AGENT_CONFIG: MockAgentConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Generates a response based on strategy.
|
|
18
|
+
*
|
|
19
|
+
* @param strategy - Response strategy.
|
|
20
|
+
* @param userMessage - User's message.
|
|
21
|
+
* @param cannedResponses - Available canned responses.
|
|
22
|
+
* @param responseIndex - Current index for sequential strategy.
|
|
23
|
+
* @param randomFn - Random function for deterministic testing.
|
|
24
|
+
* @returns Generated response and next index.
|
|
25
|
+
*/
|
|
26
|
+
declare function generateStrategyResponse(strategy: MockAgentResponseStrategy, userMessage: string, cannedResponses?: string[], responseIndex?: number, randomFn?: () => number): {
|
|
27
|
+
response: string;
|
|
28
|
+
nextIndex: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { DEFAULT_AGENT_CONFIG, MockAgentConfig, MockAgentResponseStrategy, generateStrategyResponse };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
var a={responseStrategy:"echo",responseDelayMs:100,cannedResponses:[],type:"text",nature:"ai",simulateTyping:!1,typingDelayPerChar:20};function g(n,o,t=[],e=0,s=Math.random){switch(n){case"echo":return{response:`Echo: ${o}`,nextIndex:e};case"canned":return{response:t[0]||"Default response",nextIndex:e};case"sequential":return{response:t[e]||"No more responses",nextIndex:(e+1)%Math.max(1,t.length)};case"random":{if(t.length===0)return{response:"Random response",nextIndex:e};let r=Math.floor(s()*t.length);return{response:t[r],nextIndex:e}}case"silent":return{response:"",nextIndex:e};case"error":throw new Error("Agent error");case"custom":return{response:"",nextIndex:e};default:return{response:"Default agent response",nextIndex:e}}}export{a as DEFAULT_AGENT_CONFIG,g as generateStrategyResponse};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
"use strict";var T=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var R=(s,t)=>{for(var e in t)T(s,e,{get:t[e],enumerable:!0})},w=(s,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m(t))!l.call(s,r)&&r!==e&&T(s,r,{get:()=>t[r],enumerable:!(o=g(t,r))||o.enumerable});return s};var M=s=>w(T({},"__esModule",{value:!0}),s);var h={};R(h,{AgentNotFoundError:()=>E,InvalidOperationError:()=>k,MockLiveKitError:()=>n,NetworkError:()=>p,ParticipantAlreadyJoinedError:()=>i,ParticipantNotFoundError:()=>u,RoomEndedError:()=>a,RoomNotFoundError:()=>c,TimeoutError:()=>N,TrackNotFoundError:()=>d,UnauthorizedError:()=>O,createErrorFromMockError:()=>x,isMockError:()=>_,isMockLiveKitError:()=>A});module.exports=M(h);var n=class s extends Error{constructor(t,e,o){super(e),this.name="MockLiveKitError",this.code=t,this.details=o,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,s)}toMockError(){return{code:this.code,message:this.message,details:this.details}}static fromMockError(t){return new s(t.code,t.message,t.details)}},c=class extends n{constructor(t){super("ROOM_NOT_FOUND",`Room not found: ${t}`,{roomId:t}),this.name="RoomNotFoundError"}},a=class extends n{constructor(t){super("ROOM_ENDED",`Room has ended: ${t}`,{roomId:t}),this.name="RoomEndedError"}},i=class extends n{constructor(t,e){super("PARTICIPANT_ALREADY_JOINED",`Participant ${t} is already in room ${e}`,{identity:t,roomId:e}),this.name="ParticipantAlreadyJoinedError"}},u=class extends n{constructor(t){super("PARTICIPANT_NOT_FOUND",`Participant not found: ${t}`,{identity:t}),this.name="ParticipantNotFoundError"}},d=class extends n{constructor(t){super("TRACK_NOT_FOUND",`Track not found: ${t}`,{trackId:t}),this.name="TrackNotFoundError"}},E=class extends n{constructor(t){super("AGENT_NOT_FOUND",`Agent not found: ${t}`,{agentId:t}),this.name="AgentNotFoundError"}},O=class extends n{constructor(t="Unauthorized"){super("UNAUTHORIZED",t),this.name="UnauthorizedError"}},p=class extends n{constructor(t="Network error occurred"){super("NETWORK_ERROR",t),this.name="NetworkError"}},k=class extends n{constructor(t,e){super("INVALID_OPERATION",t,e),this.name="InvalidOperationError"}},N=class extends n{constructor(t,e){super("TIMEOUT",`Operation timed out: ${t}`,{operation:t,timeoutMs:e}),this.name="TimeoutError"}};function x(s){switch(s.code){case"ROOM_NOT_FOUND":return new c(s.details?.roomId??"unknown");case"ROOM_ENDED":return new a(s.details?.roomId??"unknown");case"PARTICIPANT_ALREADY_JOINED":return new i(s.details?.identity??"unknown",s.details?.roomId??"unknown");case"PARTICIPANT_NOT_FOUND":return new u(s.details?.identity??"unknown");case"TRACK_NOT_FOUND":return new d(s.details?.trackId??"unknown");case"AGENT_NOT_FOUND":return new E(s.details?.agentId??"unknown");case"UNAUTHORIZED":return new O(s.message);case"NETWORK_ERROR":return new p(s.message);case"INVALID_OPERATION":return new k(s.message,s.details);case"TIMEOUT":return new N(s.details?.operation??"unknown",s.details?.timeoutMs??0);default:return n.fromMockError(s)}}function _(s){return typeof s=="object"&&s!==null&&"code"in s&&"message"in s&&typeof s.code=="string"&&typeof s.message=="string"}function A(s){return s instanceof n}0&&(module.exports={AgentNotFoundError,InvalidOperationError,MockLiveKitError,NetworkError,ParticipantAlreadyJoinedError,ParticipantNotFoundError,RoomEndedError,RoomNotFoundError,TimeoutError,TrackNotFoundError,UnauthorizedError,createErrorFromMockError,isMockError,isMockLiveKitError});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.179 | © 2026 Onlive.ai */
|
|
2
|
+
import { MockErrorCode, MockError } from './types.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @summary Custom error classes for the mock LiveKit service.
|
|
6
|
+
*
|
|
7
|
+
* @description Provides typed error classes that match LiveKit error patterns
|
|
8
|
+
* for consistent error handling in tests.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @summary Base error class for mock LiveKit errors.
|
|
13
|
+
*
|
|
14
|
+
* @description Extends the standard Error class with mock-specific properties.
|
|
15
|
+
*/
|
|
16
|
+
declare class MockLiveKitError extends Error {
|
|
17
|
+
/** Error code for programmatic handling */
|
|
18
|
+
readonly code: MockErrorCode;
|
|
19
|
+
/** Additional error details */
|
|
20
|
+
readonly details?: Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new MockLiveKitError.
|
|
23
|
+
*
|
|
24
|
+
* @param {MockErrorCode} code - Error code.
|
|
25
|
+
* @param {string} message - Error message.
|
|
26
|
+
* @param {Record<string, unknown>} [details] - Additional details.
|
|
27
|
+
*/
|
|
28
|
+
constructor(code: MockErrorCode, message: string, details?: Record<string, unknown>);
|
|
29
|
+
/**
|
|
30
|
+
* Converts the error to a MockError object.
|
|
31
|
+
*
|
|
32
|
+
* @returns {MockError} Plain error object.
|
|
33
|
+
*/
|
|
34
|
+
toMockError(): MockError;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a MockLiveKitError from a MockError object.
|
|
37
|
+
*
|
|
38
|
+
* @param {MockError} error - Error object.
|
|
39
|
+
* @returns {MockLiveKitError} Error instance.
|
|
40
|
+
*/
|
|
41
|
+
static fromMockError(error: MockError): MockLiveKitError;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Room not found error.
|
|
45
|
+
*/
|
|
46
|
+
declare class RoomNotFoundError extends MockLiveKitError {
|
|
47
|
+
constructor(roomId: string);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Room ended error.
|
|
51
|
+
*/
|
|
52
|
+
declare class RoomEndedError extends MockLiveKitError {
|
|
53
|
+
constructor(roomId: string);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Participant already joined error.
|
|
57
|
+
*/
|
|
58
|
+
declare class ParticipantAlreadyJoinedError extends MockLiveKitError {
|
|
59
|
+
constructor(identity: string, roomId: string);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Participant not found error.
|
|
63
|
+
*/
|
|
64
|
+
declare class ParticipantNotFoundError extends MockLiveKitError {
|
|
65
|
+
constructor(identity: string);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Track not found error.
|
|
69
|
+
*/
|
|
70
|
+
declare class TrackNotFoundError extends MockLiveKitError {
|
|
71
|
+
constructor(trackId: string);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Agent not found error.
|
|
75
|
+
*/
|
|
76
|
+
declare class AgentNotFoundError extends MockLiveKitError {
|
|
77
|
+
constructor(agentId: string);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Unauthorized error.
|
|
81
|
+
*/
|
|
82
|
+
declare class UnauthorizedError extends MockLiveKitError {
|
|
83
|
+
constructor(message?: string);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Network error.
|
|
87
|
+
*/
|
|
88
|
+
declare class NetworkError extends MockLiveKitError {
|
|
89
|
+
constructor(message?: string);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Invalid operation error.
|
|
93
|
+
*/
|
|
94
|
+
declare class InvalidOperationError extends MockLiveKitError {
|
|
95
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Timeout error.
|
|
99
|
+
*/
|
|
100
|
+
declare class TimeoutError extends MockLiveKitError {
|
|
101
|
+
constructor(operation: string, timeoutMs: number);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Creates an appropriate error instance from a MockError object.
|
|
105
|
+
*
|
|
106
|
+
* @param {MockError} error - Error object.
|
|
107
|
+
* @returns {MockLiveKitError} Typed error instance.
|
|
108
|
+
*/
|
|
109
|
+
declare function createErrorFromMockError(error: MockError): MockLiveKitError;
|
|
110
|
+
/**
|
|
111
|
+
* Type guard to check if a value is a MockError.
|
|
112
|
+
*
|
|
113
|
+
* @param {unknown} value - Value to check.
|
|
114
|
+
* @returns {boolean} True if value is a MockError.
|
|
115
|
+
*/
|
|
116
|
+
declare function isMockError(value: unknown): value is MockError;
|
|
117
|
+
/**
|
|
118
|
+
* Type guard to check if a value is a MockLiveKitError.
|
|
119
|
+
*
|
|
120
|
+
* @param {unknown} value - Value to check.
|
|
121
|
+
* @returns {boolean} True if value is a MockLiveKitError.
|
|
122
|
+
*/
|
|
123
|
+
declare function isMockLiveKitError(value: unknown): value is MockLiveKitError;
|
|
124
|
+
|
|
125
|
+
export { AgentNotFoundError, InvalidOperationError, MockLiveKitError, NetworkError, ParticipantAlreadyJoinedError, ParticipantNotFoundError, RoomEndedError, RoomNotFoundError, TimeoutError, TrackNotFoundError, UnauthorizedError, createErrorFromMockError, isMockError, isMockLiveKitError };
|