rystem.playframework.client 0.1.1 → 0.1.3
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 +1617 -47
- package/lib/engine/ClientInteractionRegistry.d.ts +48 -1
- package/lib/engine/ClientInteractionRegistry.d.ts.map +1 -1
- package/lib/engine/ClientInteractionRegistry.js +84 -13
- package/lib/engine/PlayFrameworkClient.d.ts +58 -0
- package/lib/engine/PlayFrameworkClient.d.ts.map +1 -1
- package/lib/engine/PlayFrameworkClient.js +271 -24
- package/lib/index.d.ts +17 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +15 -1
- package/lib/models/AiSceneResponse.d.ts +2 -2
- package/lib/models/AiSceneResponse.d.ts.map +1 -1
- package/lib/models/ClientInteractionRequest.d.ts +15 -0
- package/lib/models/ClientInteractionRequest.d.ts.map +1 -1
- package/lib/models/CommandResult.d.ts +31 -0
- package/lib/models/CommandResult.d.ts.map +1 -0
- package/lib/models/CommandResult.js +18 -0
- package/lib/models/ExecutionState.d.ts +35 -0
- package/lib/models/ExecutionState.d.ts.map +1 -0
- package/lib/models/ExecutionState.js +2 -0
- package/lib/models/PlayFrameworkRequest.d.ts +10 -0
- package/lib/models/PlayFrameworkRequest.d.ts.map +1 -1
- package/lib/models/StoredConversation.d.ts +88 -0
- package/lib/models/StoredConversation.d.ts.map +1 -0
- package/lib/models/StoredConversation.js +17 -0
- package/lib/models/StoredMessage.d.ts +30 -0
- package/lib/models/StoredMessage.d.ts.map +1 -0
- package/lib/models/StoredMessage.js +2 -0
- package/lib/models/VoiceResponse.d.ts +39 -0
- package/lib/models/VoiceResponse.d.ts.map +1 -0
- package/lib/models/VoiceResponse.js +2 -0
- package/lib/utils/BrowserSpeechRecognizer.d.ts +128 -0
- package/lib/utils/BrowserSpeechRecognizer.d.ts.map +1 -0
- package/lib/utils/BrowserSpeechRecognizer.js +150 -0
- package/lib/utils/BrowserSpeechSynthesizer.d.ts +148 -0
- package/lib/utils/BrowserSpeechSynthesizer.d.ts.map +1 -0
- package/lib/utils/BrowserSpeechSynthesizer.js +400 -0
- package/lib/utils/BrowserVoiceClient.d.ts +142 -0
- package/lib/utils/BrowserVoiceClient.d.ts.map +1 -0
- package/lib/utils/BrowserVoiceClient.js +200 -0
- package/lib/utils/ContentUrlConverter.d.ts +62 -0
- package/lib/utils/ContentUrlConverter.d.ts.map +1 -0
- package/lib/utils/ContentUrlConverter.js +151 -0
- package/lib/utils/VoiceRecorder.d.ts +90 -0
- package/lib/utils/VoiceRecorder.d.ts.map +1 -0
- package/lib/utils/VoiceRecorder.js +195 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePlayFramework = exports.PlayFrameworkServices = exports.PlayFrameworkSettings = exports.AIContentConverter = exports.ClientInteractionRegistry = exports.PlayFrameworkClient = void 0;
|
|
3
|
+
exports.usePlayFramework = exports.PlayFrameworkServices = exports.PlayFrameworkSettings = exports.BrowserVoiceClient = exports.BrowserSpeechSynthesizer = exports.BrowserSpeechRecognizer = exports.VoiceRecorder = exports.ContentUrlConverter = exports.AIContentConverter = exports.ClientInteractionRegistry = exports.PlayFrameworkClient = exports.CommandResultHelper = exports.ConversationSortOrder = void 0;
|
|
4
|
+
var StoredConversation_1 = require("./models/StoredConversation");
|
|
5
|
+
Object.defineProperty(exports, "ConversationSortOrder", { enumerable: true, get: function () { return StoredConversation_1.ConversationSortOrder; } });
|
|
6
|
+
var CommandResult_1 = require("./models/CommandResult");
|
|
7
|
+
Object.defineProperty(exports, "CommandResultHelper", { enumerable: true, get: function () { return CommandResult_1.CommandResult; } });
|
|
4
8
|
// Engine
|
|
5
9
|
var PlayFrameworkClient_1 = require("./engine/PlayFrameworkClient");
|
|
6
10
|
Object.defineProperty(exports, "PlayFrameworkClient", { enumerable: true, get: function () { return PlayFrameworkClient_1.PlayFrameworkClient; } });
|
|
@@ -9,6 +13,16 @@ Object.defineProperty(exports, "ClientInteractionRegistry", { enumerable: true,
|
|
|
9
13
|
// Utilities
|
|
10
14
|
var AIContentConverter_1 = require("./utils/AIContentConverter");
|
|
11
15
|
Object.defineProperty(exports, "AIContentConverter", { enumerable: true, get: function () { return AIContentConverter_1.AIContentConverter; } });
|
|
16
|
+
var ContentUrlConverter_1 = require("./utils/ContentUrlConverter");
|
|
17
|
+
Object.defineProperty(exports, "ContentUrlConverter", { enumerable: true, get: function () { return ContentUrlConverter_1.ContentUrlConverter; } });
|
|
18
|
+
var VoiceRecorder_1 = require("./utils/VoiceRecorder");
|
|
19
|
+
Object.defineProperty(exports, "VoiceRecorder", { enumerable: true, get: function () { return VoiceRecorder_1.VoiceRecorder; } });
|
|
20
|
+
var BrowserSpeechRecognizer_1 = require("./utils/BrowserSpeechRecognizer");
|
|
21
|
+
Object.defineProperty(exports, "BrowserSpeechRecognizer", { enumerable: true, get: function () { return BrowserSpeechRecognizer_1.BrowserSpeechRecognizer; } });
|
|
22
|
+
var BrowserSpeechSynthesizer_1 = require("./utils/BrowserSpeechSynthesizer");
|
|
23
|
+
Object.defineProperty(exports, "BrowserSpeechSynthesizer", { enumerable: true, get: function () { return BrowserSpeechSynthesizer_1.BrowserSpeechSynthesizer; } });
|
|
24
|
+
var BrowserVoiceClient_1 = require("./utils/BrowserVoiceClient");
|
|
25
|
+
Object.defineProperty(exports, "BrowserVoiceClient", { enumerable: true, get: function () { return BrowserVoiceClient_1.BrowserVoiceClient; } });
|
|
12
26
|
// Service Collection
|
|
13
27
|
var PlayFrameworkSettings_1 = require("./servicecollection/PlayFrameworkSettings");
|
|
14
28
|
Object.defineProperty(exports, "PlayFrameworkSettings", { enumerable: true, get: function () { return PlayFrameworkSettings_1.PlayFrameworkSettings; } });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ClientInteractionRequest } from "./ClientInteractionRequest";
|
|
2
2
|
/**
|
|
3
3
|
* Response status from PlayFramework execution.
|
|
4
|
-
*
|
|
4
|
+
* Serialized as camelCase from C# JsonStringEnumConverter.
|
|
5
5
|
*/
|
|
6
|
-
export type AiResponseStatus = "initializing" | "loadingCache" | "executingMainActors" | "planning" | "executingScene" | "functionRequest" | "functionCompleted" | "toolSkipped" | "streaming" | "running" | "summarizing" | "directorDecision" | "generatingFinalResponse" | "savingCache" | "savingMemory" | "awaitingClient" | "completed" | "budgetExceeded" | "error";
|
|
6
|
+
export type AiResponseStatus = "initializing" | "loadingCache" | "executingMainActors" | "planning" | "executingScene" | "functionRequest" | "functionCompleted" | "toolSkipped" | "streaming" | "running" | "summarizing" | "directorDecision" | "generatingFinalResponse" | "savingCache" | "savingMemory" | "awaitingClient" | "commandClient" | "completed" | "budgetExceeded" | "error" | "unauthorized";
|
|
7
7
|
/**
|
|
8
8
|
* Single step response from PlayFramework (used in step-by-step streaming).
|
|
9
9
|
* Matches C# AiSceneResponse contract.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiSceneResponse.d.ts","sourceRoot":"","sources":["../../src/models/AiSceneResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACtB,cAAc,GACd,cAAc,GACd,qBAAqB,GACrB,UAAU,GACV,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,GACnB,aAAa,GACb,WAAW,GACX,SAAS,GACT,aAAa,GACb,kBAAkB,GAClB,yBAAyB,GACzB,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,gBAAgB,GAChB,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AiSceneResponse.d.ts","sourceRoot":"","sources":["../../src/models/AiSceneResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAC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E,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACN;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,WAAW,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,eAAe,GAAG,gBAAgB,GAAG,WAAW,CAAC"}
|
|
@@ -27,7 +27,22 @@ export interface ClientInteractionRequest {
|
|
|
27
27
|
argumentsSchema?: string;
|
|
28
28
|
/**
|
|
29
29
|
* Maximum execution time in seconds.
|
|
30
|
+
* For standard tools: timeout for client response.
|
|
31
|
+
* For commands: timeout for client-side execution (protects against crashes/hangs).
|
|
30
32
|
*/
|
|
31
33
|
timeoutSeconds: number;
|
|
34
|
+
/**
|
|
35
|
+
* Indicates if this is a command (fire-and-forget tool).
|
|
36
|
+
* Commands don't require immediate response - auto-completed with 'true' on next user message.
|
|
37
|
+
* Client can optionally send CommandResult (success + message) based on feedbackMode.
|
|
38
|
+
*/
|
|
39
|
+
isCommand?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Feedback mode for Commands (only used when isCommand=true).
|
|
42
|
+
* - 'never': No feedback sent, auto-complete immediately with 'true'
|
|
43
|
+
* - 'onError': Send feedback only if command fails
|
|
44
|
+
* - 'always': Always send feedback (success + message)
|
|
45
|
+
*/
|
|
46
|
+
feedbackMode?: 'never' | 'onError' | 'always';
|
|
32
47
|
}
|
|
33
48
|
//# sourceMappingURL=ClientInteractionRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientInteractionRequest.d.ts","sourceRoot":"","sources":["../../src/models/ClientInteractionRequest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB
|
|
1
|
+
{"version":3,"file":"ClientInteractionRequest.d.ts","sourceRoot":"","sources":["../../src/models/ClientInteractionRequest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;CACjD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of a client command execution.
|
|
3
|
+
* Commands are fire-and-forget client tools that don't require immediate response.
|
|
4
|
+
*/
|
|
5
|
+
export interface CommandResult {
|
|
6
|
+
/**
|
|
7
|
+
* Indicates if the command executed successfully.
|
|
8
|
+
*/
|
|
9
|
+
success: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Optional message to send to the LLM (e.g., error details, confirmation message).
|
|
12
|
+
* If undefined, only the success status is sent.
|
|
13
|
+
*/
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Helper methods for creating CommandResult instances.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CommandResult: {
|
|
20
|
+
/**
|
|
21
|
+
* Creates a successful result.
|
|
22
|
+
* @param message - Optional success message
|
|
23
|
+
*/
|
|
24
|
+
ok: (message?: string) => CommandResult;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a failed result.
|
|
27
|
+
* @param message - Error message describing what went wrong
|
|
28
|
+
*/
|
|
29
|
+
fail: (message: string) => CommandResult;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=CommandResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandResult.d.ts","sourceRoot":"","sources":["../../src/models/CommandResult.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;IACtB;;;OAGG;mBACY,MAAM,KAAG,aAAa;IAErC;;;OAGG;oBACa,MAAM,KAAG,aAAa;CACzC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandResult = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Helper methods for creating CommandResult instances.
|
|
6
|
+
*/
|
|
7
|
+
exports.CommandResult = {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a successful result.
|
|
10
|
+
* @param message - Optional success message
|
|
11
|
+
*/
|
|
12
|
+
ok: (message) => ({ success: true, message }),
|
|
13
|
+
/**
|
|
14
|
+
* Creates a failed result.
|
|
15
|
+
* @param message - Error message describing what went wrong
|
|
16
|
+
*/
|
|
17
|
+
fail: (message) => ({ success: false, message }),
|
|
18
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution phase enum (matches C# ExecutionPhase).
|
|
3
|
+
* Serialized as camelCase from JsonStringEnumConverter.
|
|
4
|
+
*/
|
|
5
|
+
export type ExecutionPhase = "notStarted" | "initialized" | "sceneSelected" | "executingScene" | "awaitingClient" | "sceneCompleted" | "chaining" | "generatingFinalResponse" | "completed" | "completedNoResponse" | "budgetExceeded" | "sceneNotFound" | "tooManyToolRequests" | "break" | "unauthorized";
|
|
6
|
+
/**
|
|
7
|
+
* Execution state for resuming conversations.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExecutionState {
|
|
10
|
+
/**
|
|
11
|
+
* Current execution phase.
|
|
12
|
+
*/
|
|
13
|
+
phase: ExecutionPhase;
|
|
14
|
+
/**
|
|
15
|
+
* Executed scenes in order.
|
|
16
|
+
*/
|
|
17
|
+
executedSceneOrder: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Tools executed per scene.
|
|
20
|
+
*/
|
|
21
|
+
executedScenes: Record<string, any[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Executed tools.
|
|
24
|
+
*/
|
|
25
|
+
executedTools: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Accumulated cost.
|
|
28
|
+
*/
|
|
29
|
+
accumulatedCost: number;
|
|
30
|
+
/**
|
|
31
|
+
* Current scene name (if resuming mid-execution).
|
|
32
|
+
*/
|
|
33
|
+
currentSceneName?: string | null;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ExecutionState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionState.d.ts","sourceRoot":"","sources":["../../src/models/ExecutionState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,cAAc,GACpB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,UAAU,GACV,yBAAyB,GACzB,WAAW,GACX,qBAAqB,GACrB,gBAAgB,GAChB,eAAe,GACf,qBAAqB,GACrB,OAAO,GACP,cAAc,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAE7B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAEtC;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC"}
|
|
@@ -40,6 +40,16 @@ export interface SceneRequestSettings {
|
|
|
40
40
|
sceneName?: string;
|
|
41
41
|
/** Results from client-side tool executions. */
|
|
42
42
|
clientInteractionResults?: ClientInteractionResult[];
|
|
43
|
+
/**
|
|
44
|
+
* Additional system-level instructions appended to the system prompt.
|
|
45
|
+
* Used by voice pipeline to inject conversational style and language instructions.
|
|
46
|
+
*/
|
|
47
|
+
additionalSystemInstructions?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* When true, the server injects a voice-style system instruction
|
|
50
|
+
* that tells the LLM to respond conversationally (no tables, no markdown).
|
|
51
|
+
*/
|
|
52
|
+
isVoiceMode?: boolean;
|
|
43
53
|
}
|
|
44
54
|
/**
|
|
45
55
|
* Request model for PlayFramework HTTP API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayFrameworkRequest.d.ts","sourceRoot":"","sources":["../../src/models/PlayFrameworkRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,uBAAuB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AC,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACxD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { StoredMessage } from './StoredMessage';
|
|
2
|
+
import type { ExecutionState } from './ExecutionState';
|
|
3
|
+
/**
|
|
4
|
+
* Stored conversation with messages and metadata.
|
|
5
|
+
*/
|
|
6
|
+
export interface StoredConversation {
|
|
7
|
+
/**
|
|
8
|
+
* Unique conversation identifier.
|
|
9
|
+
*/
|
|
10
|
+
conversationKey: string;
|
|
11
|
+
/**
|
|
12
|
+
* User who owns this conversation (null = public).
|
|
13
|
+
*/
|
|
14
|
+
userId?: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Whether this conversation is public (accessible to everyone).
|
|
17
|
+
*/
|
|
18
|
+
isPublic: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Last update timestamp.
|
|
21
|
+
*/
|
|
22
|
+
timestamp: string;
|
|
23
|
+
/**
|
|
24
|
+
* Serializable messages.
|
|
25
|
+
*/
|
|
26
|
+
messages: StoredMessage[];
|
|
27
|
+
/**
|
|
28
|
+
* Execution state (scenes executed, tools used, etc.).
|
|
29
|
+
*/
|
|
30
|
+
executionState?: ExecutionState | null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Query parameters for listing conversations.
|
|
34
|
+
*/
|
|
35
|
+
export interface ConversationQueryParameters {
|
|
36
|
+
/**
|
|
37
|
+
* Search text in conversation messages (optional).
|
|
38
|
+
*/
|
|
39
|
+
searchText?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Sort order by timestamp.
|
|
42
|
+
*/
|
|
43
|
+
orderBy?: ConversationSortOrder;
|
|
44
|
+
/**
|
|
45
|
+
* Include public conversations (default: true).
|
|
46
|
+
*/
|
|
47
|
+
includePublic?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Include private conversations owned by current user (default: true).
|
|
50
|
+
*/
|
|
51
|
+
includePrivate?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Number of items to skip for pagination (default: 0).
|
|
54
|
+
*/
|
|
55
|
+
skip?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Number of items to take for pagination (default: 50).
|
|
58
|
+
*/
|
|
59
|
+
take?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Include message contents (images, audio, PDFs, etc.) in responses (default: false).
|
|
62
|
+
* When false, contents are excluded to reduce payload size in list operations.
|
|
63
|
+
*/
|
|
64
|
+
includeContents?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Sort order for conversation list.
|
|
68
|
+
*/
|
|
69
|
+
export declare enum ConversationSortOrder {
|
|
70
|
+
/**
|
|
71
|
+
* Newest first (default).
|
|
72
|
+
*/
|
|
73
|
+
TimestampDescending = 0,
|
|
74
|
+
/**
|
|
75
|
+
* Oldest first.
|
|
76
|
+
*/
|
|
77
|
+
TimestampAscending = 1
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Request body for updating conversation visibility.
|
|
81
|
+
*/
|
|
82
|
+
export interface UpdateConversationVisibilityRequest {
|
|
83
|
+
/**
|
|
84
|
+
* Whether the conversation should be public.
|
|
85
|
+
*/
|
|
86
|
+
isPublic: boolean;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=StoredConversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoredConversation.d.ts","sourceRoot":"","sources":["../../src/models/StoredConversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE1B;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,oBAAY,qBAAqB;IAC7B;;OAEG;IACH,mBAAmB,IAAI;IAEvB;;OAEG;IACH,kBAAkB,IAAI;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAChD;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConversationSortOrder = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sort order for conversation list.
|
|
6
|
+
*/
|
|
7
|
+
var ConversationSortOrder;
|
|
8
|
+
(function (ConversationSortOrder) {
|
|
9
|
+
/**
|
|
10
|
+
* Newest first (default).
|
|
11
|
+
*/
|
|
12
|
+
ConversationSortOrder[ConversationSortOrder["TimestampDescending"] = 0] = "TimestampDescending";
|
|
13
|
+
/**
|
|
14
|
+
* Oldest first.
|
|
15
|
+
*/
|
|
16
|
+
ConversationSortOrder[ConversationSortOrder["TimestampAscending"] = 1] = "TimestampAscending";
|
|
17
|
+
})(ConversationSortOrder || (exports.ConversationSortOrder = ConversationSortOrder = {}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializable representation of a message.
|
|
3
|
+
*/
|
|
4
|
+
export interface StoredMessage {
|
|
5
|
+
/**
|
|
6
|
+
* Business type flags.
|
|
7
|
+
*/
|
|
8
|
+
businessType: number;
|
|
9
|
+
/**
|
|
10
|
+
* Label for debugging.
|
|
11
|
+
*/
|
|
12
|
+
label?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* The role of the message (User, Assistant, System, Tool).
|
|
15
|
+
*/
|
|
16
|
+
role: string;
|
|
17
|
+
/**
|
|
18
|
+
* Text content of the message (if any).
|
|
19
|
+
*/
|
|
20
|
+
text?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Serialized contents for complex messages.
|
|
23
|
+
*/
|
|
24
|
+
contents?: any[] | null;
|
|
25
|
+
/**
|
|
26
|
+
* Additional properties from the original message.
|
|
27
|
+
*/
|
|
28
|
+
additionalProperties?: Record<string, any> | null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=StoredMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoredMessage.d.ts","sourceRoot":"","sources":["../../src/models/StoredMessage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CACrD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AiSceneResponse } from "./AiSceneResponse";
|
|
2
|
+
/**
|
|
3
|
+
* Type of voice pipeline response event.
|
|
4
|
+
*/
|
|
5
|
+
export type VoiceResponseType = "transcription" | "audio" | "scene" | "completed" | "error";
|
|
6
|
+
/**
|
|
7
|
+
* Single event from the voice pipeline SSE stream.
|
|
8
|
+
* The server sends these as `data: {...}\n\n` lines.
|
|
9
|
+
*/
|
|
10
|
+
export interface VoiceEvent {
|
|
11
|
+
/** Event type discriminator. */
|
|
12
|
+
type: VoiceResponseType;
|
|
13
|
+
/** Text content (transcript for "transcription", synthesized sentence for "audio"). */
|
|
14
|
+
text?: string;
|
|
15
|
+
/** Base64-encoded audio chunk (only for type === "audio"). */
|
|
16
|
+
audio?: string;
|
|
17
|
+
/** PlayFramework scene status (only for type === "scene"). */
|
|
18
|
+
status?: string;
|
|
19
|
+
/** Full scene response (only for type === "scene"). */
|
|
20
|
+
sceneResponse?: AiSceneResponse;
|
|
21
|
+
/** Scene message (only for type === "scene"). */
|
|
22
|
+
message?: string;
|
|
23
|
+
/** Error message (only for type === "error"). */
|
|
24
|
+
errorMessage?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Options for the voice pipeline request.
|
|
28
|
+
*/
|
|
29
|
+
export interface VoiceRequestOptions {
|
|
30
|
+
/** Raw audio data as Blob or File. */
|
|
31
|
+
audio: Blob | File;
|
|
32
|
+
/** Optional conversation key for multi-turn voice conversations. */
|
|
33
|
+
conversationKey?: string;
|
|
34
|
+
/** Optional metadata (userId, tenantId, etc.). */
|
|
35
|
+
metadata?: Record<string, any>;
|
|
36
|
+
/** Optional abort signal. */
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=VoiceResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceResponse.d.ts","sourceRoot":"","sources":["../../src/models/VoiceResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,UAAU;IACvB,gCAAgC;IAChC,IAAI,EAAE,iBAAiB,CAAC;IAExB,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uDAAuD;IACvD,aAAa,CAAC,EAAE,eAAe,CAAC;IAEhC,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,sCAAsC;IACtC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE/B,6BAA6B;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for BrowserSpeechRecognizer.
|
|
3
|
+
*/
|
|
4
|
+
export interface BrowserSpeechRecognizerOptions {
|
|
5
|
+
/** BCP-47 language code (e.g. 'it-IT', 'en-US'). If omitted, the browser's default is used. */
|
|
6
|
+
lang?: string;
|
|
7
|
+
/** Whether to return interim (partial) results. Default: `true`. */
|
|
8
|
+
interimResults?: boolean;
|
|
9
|
+
/** Whether recognition restarts automatically on end. Default: `false`. */
|
|
10
|
+
continuous?: boolean;
|
|
11
|
+
/** Maximum alternatives per result. Default: `1`. */
|
|
12
|
+
maxAlternatives?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Result from a speech recognition session.
|
|
16
|
+
*/
|
|
17
|
+
export interface SpeechRecognitionResult {
|
|
18
|
+
/** The final transcribed text. */
|
|
19
|
+
transcript: string;
|
|
20
|
+
/** Confidence score (0-1). */
|
|
21
|
+
confidence: number;
|
|
22
|
+
/** Whether this is a final (not interim) result. */
|
|
23
|
+
isFinal: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Callbacks emitted by BrowserSpeechRecognizer.
|
|
27
|
+
*/
|
|
28
|
+
export interface BrowserSpeechRecognizerCallbacks {
|
|
29
|
+
/** Called with each interim or final result. */
|
|
30
|
+
onResult?: (result: SpeechRecognitionResult) => void;
|
|
31
|
+
/** Called when recognition ends (user stopped or no more speech). */
|
|
32
|
+
onEnd?: () => void;
|
|
33
|
+
/** Called on recognition error. */
|
|
34
|
+
onError?: (error: Error) => void;
|
|
35
|
+
/** Called when recognition starts. */
|
|
36
|
+
onStart?: () => void;
|
|
37
|
+
}
|
|
38
|
+
interface SpeechRecognitionEvent extends Event {
|
|
39
|
+
results: SpeechRecognitionResultList;
|
|
40
|
+
resultIndex: number;
|
|
41
|
+
}
|
|
42
|
+
interface SpeechRecognitionErrorEvent extends Event {
|
|
43
|
+
error: string;
|
|
44
|
+
message: string;
|
|
45
|
+
}
|
|
46
|
+
interface SpeechRecognitionResultList {
|
|
47
|
+
length: number;
|
|
48
|
+
item(index: number): SpeechRecognitionResultItem;
|
|
49
|
+
[index: number]: SpeechRecognitionResultItem;
|
|
50
|
+
}
|
|
51
|
+
interface SpeechRecognitionResultItem {
|
|
52
|
+
isFinal: boolean;
|
|
53
|
+
length: number;
|
|
54
|
+
item(index: number): SpeechRecognitionAlternative;
|
|
55
|
+
[index: number]: SpeechRecognitionAlternative;
|
|
56
|
+
}
|
|
57
|
+
interface SpeechRecognitionAlternative {
|
|
58
|
+
transcript: string;
|
|
59
|
+
confidence: number;
|
|
60
|
+
}
|
|
61
|
+
interface SpeechRecognitionAPI extends EventTarget {
|
|
62
|
+
lang: string;
|
|
63
|
+
continuous: boolean;
|
|
64
|
+
interimResults: boolean;
|
|
65
|
+
maxAlternatives: number;
|
|
66
|
+
start(): void;
|
|
67
|
+
stop(): void;
|
|
68
|
+
abort(): void;
|
|
69
|
+
onresult: ((event: SpeechRecognitionEvent) => void) | null;
|
|
70
|
+
onend: (() => void) | null;
|
|
71
|
+
onerror: ((event: SpeechRecognitionErrorEvent) => void) | null;
|
|
72
|
+
onstart: (() => void) | null;
|
|
73
|
+
}
|
|
74
|
+
declare global {
|
|
75
|
+
interface Window {
|
|
76
|
+
SpeechRecognition?: new () => SpeechRecognitionAPI;
|
|
77
|
+
webkitSpeechRecognition?: new () => SpeechRecognitionAPI;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Wraps the browser Web Speech API `SpeechRecognition` for speech-to-text.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const recognizer = new BrowserSpeechRecognizer({ lang: 'it-IT' });
|
|
86
|
+
*
|
|
87
|
+
* // One-shot usage — returns final transcript as a Promise
|
|
88
|
+
* const text = await recognizer.listen();
|
|
89
|
+
*
|
|
90
|
+
* // Event-based usage
|
|
91
|
+
* recognizer.start({
|
|
92
|
+
* onResult: (r) => console.log(r.transcript, r.isFinal),
|
|
93
|
+
* onEnd: () => console.log('done'),
|
|
94
|
+
* });
|
|
95
|
+
* // later...
|
|
96
|
+
* recognizer.stop();
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare class BrowserSpeechRecognizer {
|
|
100
|
+
private options;
|
|
101
|
+
private recognition;
|
|
102
|
+
private _isListening;
|
|
103
|
+
constructor(options?: BrowserSpeechRecognizerOptions);
|
|
104
|
+
/** Whether recognition is currently active. */
|
|
105
|
+
get isListening(): boolean;
|
|
106
|
+
/** Returns `true` if the browser supports the Web Speech Recognition API. */
|
|
107
|
+
static isSupported(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Start recognition with event callbacks.
|
|
110
|
+
* If already listening, this is a no-op.
|
|
111
|
+
*/
|
|
112
|
+
start(callbacks?: BrowserSpeechRecognizerCallbacks): void;
|
|
113
|
+
/** Stop recognition gracefully (delivers final result). */
|
|
114
|
+
stop(): void;
|
|
115
|
+
/** Abort recognition immediately (no final result). */
|
|
116
|
+
abort(): void;
|
|
117
|
+
/**
|
|
118
|
+
* One-shot recognition: starts listening and returns a Promise that resolves
|
|
119
|
+
* with the final transcript when speech ends.
|
|
120
|
+
*
|
|
121
|
+
* @param timeoutMs - Maximum wait time (default: 15000ms). Resolves with '' on timeout.
|
|
122
|
+
*/
|
|
123
|
+
listen(timeoutMs?: number): Promise<string>;
|
|
124
|
+
/** Update language at runtime (takes effect on next `start()`). */
|
|
125
|
+
setLang(lang: string): void;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=BrowserSpeechRecognizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserSpeechRecognizer.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserSpeechRecognizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,kCAAkC;IAClC,UAAU,EAAE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