@sapia-ai/chatbot-v3 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EmbeddedVideoPlayer-CNcds-dW.js → EmbeddedVideoPlayer-COUZHpPa.js} +14 -14
- package/dist/{Preview-Dmns6UWL.js → Preview-wPnYtccF.js} +3 -3
- package/dist/api/client.d.ts +6 -2
- package/dist/api/types/messages.d.ts +16 -5
- package/dist/api/types/responses.d.ts +48 -7
- package/dist/api.js +2 -2
- package/dist/core/bubbles/types.d.ts +2 -5
- package/dist/core/i18n/languages.d.ts +6 -1
- package/dist/core/interview.d.ts +15 -8
- package/dist/core/media/mimeTypes.d.ts +6 -1
- package/dist/core/media/recorder.d.ts +11 -2
- package/dist/core/store.d.ts +21 -1
- package/dist/core/theme/contrast.d.ts +6 -0
- package/dist/core/theme/cssVariables.d.ts +5 -0
- package/dist/core/theme/types.d.ts +3 -0
- package/dist/{dist-BSi28_cP.js → dist-BOe6WyvN.js} +92 -92
- package/dist/{dist-B9SbMqZU.js → dist-Bwlks_W8.js} +98 -98
- package/dist/{fix-webm-duration-BWL-ZRDX.js → fix-webm-duration-QAy9T6AR.js} +2 -2
- package/dist/index.js +7443 -5031
- package/dist/{jsx-runtime-8QqjHL5t.js → jsx-runtime-24G8w2Bf.js} +2 -2
- package/dist/{messages-Czlp86gl.js → messages-DCvBcspv.js} +260 -245
- package/dist/react/AnswerInput.d.ts +4 -5
- package/dist/react/bubbleViewModel.d.ts +25 -9
- package/dist/react/strings.d.ts +26 -3
- package/dist/{react-DJysvNxz.js → react-BjO903pN.js} +33 -33
- package/dist/{react-QrtEtv1G.js → react-Bw5AugJc.js} +31 -31
- package/dist/{react-dE7BdGuR.js → react-D8hV9uow.js} +10 -10
- package/dist/{react-NauLB_WU.js → react-DDjfkpOE.js} +38 -38
- package/dist/{react-Dbs-sPBo.js → react-DEF8h8hc.js} +37 -37
- package/dist/{react-B0K-sClg.js → react-DOgLiyZi.js} +2 -2
- package/dist/{react-be7q6yw_.js → react-DPFikgTM.js} +55 -55
- package/dist/{react-ChCcxVnw.js → react-qa12DkXH.js} +34 -34
- package/dist/{react-czRIxT0g.js → react-y4vaW3OH.js} +46 -46
- package/dist/ui/chat/ChatBubble/ChatBubble.d.ts +14 -5
- package/dist/ui/chat/ChatLog/ChatLog.d.ts +6 -4
- package/dist/ui/chat/EditBanner/EditBanner.d.ts +16 -0
- package/dist/ui/chat/SummaryCard/SummaryCard.d.ts +46 -0
- package/dist/ui/chat/types.d.ts +21 -8
- package/dist/ui/constants.d.ts +1 -0
- package/dist/ui/inputs/OptionList/OptionList.d.ts +3 -1
- package/dist/ui/inputs/TextAnswerInput/TextAnswerInput.d.ts +11 -4
- package/dist/ui/inputs/VideoRecorder/VideoRecorder.d.ts +6 -2
- package/dist/ui/markdown.d.ts +4 -0
- package/dist/ui/motion.d.ts +2 -0
- package/dist/ui/primitives/Button/Button.d.ts +5 -1
- package/dist/ui/primitives/Dialog/Dialog.d.ts +2 -1
- package/dist/ui/shell/WidgetRoot/WidgetRoot.d.ts +7 -1
- package/dist-umd/sapia-chatbot.umd.js +394 -270
- package/package.json +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./react-
|
|
3
|
-
import { t as n } from "./jsx-runtime-
|
|
1
|
+
import { w as e } from "./messages-DCvBcspv.js";
|
|
2
|
+
import { t } from "./react-DOgLiyZi.js";
|
|
3
|
+
import { t as n } from "./jsx-runtime-24G8w2Bf.js";
|
|
4
4
|
import { t as r } from "./defineProperty-DiFpLzd2.js";
|
|
5
5
|
//#region ../../node_modules/.pnpm/react-player@3.4.0_@svta+cml-cta@1.0.6_@svta+cml-structured-field-values@1.1.3_@svta+cm_a4f64f295cc2a316f39ce360b0a6e480/node_modules/react-player/dist/patterns.js
|
|
6
6
|
var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, o = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, s = /\.(m3u8)($|\?)/i, c = /\.(mpd)($|\?)/i, l = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, u = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, d = /vimeo\.com\/(?!progressive_redirect).+/, f = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, p = /open\.spotify\.com\/(\w+)\/(\w+)/i, m = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/, h = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/, g = (e, t) => {
|
|
@@ -34,7 +34,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
34
34
|
canEnablePIP: () => !0,
|
|
35
35
|
player: (0, i.lazy)(() => import(
|
|
36
36
|
/* webpackChunkName: 'reactPlayerHls' */
|
|
37
|
-
"./react-
|
|
37
|
+
"./react-Bw5AugJc.js"
|
|
38
38
|
))
|
|
39
39
|
},
|
|
40
40
|
{
|
|
@@ -44,7 +44,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
44
44
|
canEnablePIP: () => !0,
|
|
45
45
|
player: (0, i.lazy)(() => import(
|
|
46
46
|
/* webpackChunkName: 'reactPlayerDash' */
|
|
47
|
-
"./react-
|
|
47
|
+
"./react-D8hV9uow.js"
|
|
48
48
|
))
|
|
49
49
|
},
|
|
50
50
|
{
|
|
@@ -54,7 +54,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
54
54
|
canEnablePIP: () => !0,
|
|
55
55
|
player: (0, i.lazy)(() => import(
|
|
56
56
|
/* webpackChunkName: 'reactPlayerMux' */
|
|
57
|
-
"./dist-
|
|
57
|
+
"./dist-Bwlks_W8.js"
|
|
58
58
|
))
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -63,7 +63,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
63
63
|
canPlay: _.youtube,
|
|
64
64
|
player: (0, i.lazy)(() => import(
|
|
65
65
|
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
66
|
-
"./react-
|
|
66
|
+
"./react-DEF8h8hc.js"
|
|
67
67
|
))
|
|
68
68
|
},
|
|
69
69
|
{
|
|
@@ -72,7 +72,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
72
72
|
canPlay: _.vimeo,
|
|
73
73
|
player: (0, i.lazy)(() => import(
|
|
74
74
|
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
75
|
-
"./react-
|
|
75
|
+
"./react-DPFikgTM.js"
|
|
76
76
|
))
|
|
77
77
|
},
|
|
78
78
|
{
|
|
@@ -82,7 +82,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
82
82
|
canEnablePIP: () => !0,
|
|
83
83
|
player: (0, i.lazy)(() => import(
|
|
84
84
|
/* webpackChunkName: 'reactPlayerWistia' */
|
|
85
|
-
"./react-
|
|
85
|
+
"./react-DDjfkpOE.js"
|
|
86
86
|
))
|
|
87
87
|
},
|
|
88
88
|
{
|
|
@@ -92,7 +92,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
92
92
|
canEnablePIP: () => !1,
|
|
93
93
|
player: (0, i.lazy)(() => import(
|
|
94
94
|
/* webpackChunkName: 'reactPlayerSpotify' */
|
|
95
|
-
"./react-
|
|
95
|
+
"./react-BjO903pN.js"
|
|
96
96
|
))
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -102,7 +102,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
102
102
|
canEnablePIP: () => !1,
|
|
103
103
|
player: (0, i.lazy)(() => import(
|
|
104
104
|
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
105
|
-
"./react-
|
|
105
|
+
"./react-y4vaW3OH.js"
|
|
106
106
|
))
|
|
107
107
|
},
|
|
108
108
|
{
|
|
@@ -112,7 +112,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
112
112
|
canEnablePIP: () => !1,
|
|
113
113
|
player: (0, i.lazy)(() => import(
|
|
114
114
|
/* webpackChunkName: 'reactPlayerTiktok' */
|
|
115
|
-
"./react-
|
|
115
|
+
"./react-qa12DkXH.js"
|
|
116
116
|
))
|
|
117
117
|
},
|
|
118
118
|
{
|
|
@@ -181,7 +181,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
181
181
|
b.displayName = "Player";
|
|
182
182
|
var te = b, ne = (0, i.lazy)(() => import(
|
|
183
183
|
/* webpackChunkName: 'reactPlayerPreview' */
|
|
184
|
-
"./Preview-
|
|
184
|
+
"./Preview-wPnYtccF.js"
|
|
185
185
|
)), x = [], S = (e, t) => {
|
|
186
186
|
let n = (n) => {
|
|
187
187
|
for (let t of [...x, ...e]) if (n && t.canPlay(n)) return t;
|
|
@@ -1275,4 +1275,4 @@ var Q = n(), Se = (e) => {
|
|
|
1275
1275
|
//#endregion
|
|
1276
1276
|
export { Ee as EmbeddedVideoPlayer };
|
|
1277
1277
|
|
|
1278
|
-
//# sourceMappingURL=EmbeddedVideoPlayer-
|
|
1278
|
+
//# sourceMappingURL=EmbeddedVideoPlayer-COUZHpPa.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./react-
|
|
1
|
+
import { w as e } from "./messages-DCvBcspv.js";
|
|
2
|
+
import { t } from "./react-DOgLiyZi.js";
|
|
3
3
|
//#region ../../node_modules/.pnpm/react-player@3.4.0_@svta+cml-cta@1.0.6_@svta+cml-structured-field-values@1.1.3_@svta+cm_a4f64f295cc2a316f39ce360b0a6e480/node_modules/react-player/dist/Preview.js
|
|
4
4
|
var n = /* @__PURE__ */ e(t(), 1), r = "64px", i = {}, a = ({ src: e, light: t, oEmbedUrl: a, onClickPreview: o, playIcon: s, previewTabIndex: c, previewAriaLabel: l }) => {
|
|
5
5
|
let [u, d] = (0, n.useState)(null);
|
|
@@ -81,4 +81,4 @@ var n = /* @__PURE__ */ e(t(), 1), r = "64px", i = {}, a = ({ src: e, light: t,
|
|
|
81
81
|
//#endregion
|
|
82
82
|
export { a as default };
|
|
83
83
|
|
|
84
|
-
//# sourceMappingURL=Preview-
|
|
84
|
+
//# sourceMappingURL=Preview-wPnYtccF.js.map
|
package/dist/api/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as axios, AxiosInstance } from 'axios';
|
|
2
2
|
import { ChatbotClientConfig } from './config';
|
|
3
3
|
import { CandidateResponseInput, EditCandidateResponseInput, Question } from './types/messages';
|
|
4
|
-
import { AccessManagementResponse, DetectAgcResponse, EditAnswerResponse, ExtractHumanNameResponse, ExtractHumanNameType, FiToken, NextResponse, StartAtsResponse, TranslationResponse, VerifyAccessResponse, VideoSignedUrlResponse } from './types/responses';
|
|
4
|
+
import { AccessManagementResponse, AssessmentSummary, DetectAgcResponse, EditAnswerResponse, ExtractHumanNameResponse, ExtractHumanNameType, FiToken, NextResponse, StartAtsResponse, TranslationResponse, VerifyAccessResponse, VideoSignedUrlResponse } from './types/responses';
|
|
5
5
|
export type ChatbotApiClientOptions = ChatbotClientConfig & {
|
|
6
6
|
/** Injectable for tests / instrumented hosts. */
|
|
7
7
|
httpClient?: AxiosInstance;
|
|
@@ -20,6 +20,8 @@ export type NextStreamHandlers = {
|
|
|
20
20
|
onDelta: (text: string, messageId: string) => void;
|
|
21
21
|
/** Optional leading frame carrying the question structure (types/rules/options) before the text. */
|
|
22
22
|
onMeta?: (question: Question) => void;
|
|
23
|
+
/** The pre-interview "what to expect" summary, emitted once before any dialogue content. */
|
|
24
|
+
onSummary?: (summary: AssessmentSummary) => void;
|
|
23
25
|
/** Aborts the in-flight stream (new request / unmount). */
|
|
24
26
|
signal?: AbortSignal;
|
|
25
27
|
};
|
|
@@ -43,7 +45,9 @@ export declare class ChatbotApiClient {
|
|
|
43
45
|
* `type`. Fires onMeta from STATE_SNAPSHOT and onDelta per TEXT_MESSAGE_CONTENT,
|
|
44
46
|
* then resolves with the authoritative NextResponse carried by RUN_FINISHED.
|
|
45
47
|
*/
|
|
46
|
-
nextStream(assessmentId: string, candidateResponse: CandidateResponseInput | undefined, handlers: NextStreamHandlers
|
|
48
|
+
nextStream(assessmentId: string, candidateResponse: CandidateResponseInput | undefined, handlers: NextStreamHandlers, options?: {
|
|
49
|
+
summaryContinued?: boolean;
|
|
50
|
+
}): Promise<NextResponse | undefined>;
|
|
47
51
|
editAnswer(assessmentId: string, editCandidateResponse: EditCandidateResponseInput): Promise<EditAnswerResponse>;
|
|
48
52
|
extractHumanName(assessmentId: string, input: {
|
|
49
53
|
userText: string;
|
|
@@ -82,10 +82,9 @@ export type ButtonGroupContent = Content & {
|
|
|
82
82
|
style: Style;
|
|
83
83
|
};
|
|
84
84
|
export type AnswerContent = {
|
|
85
|
+
/** Free-text answers written in the rich composer carry markdown here — see `ui/markdown.ts`. */
|
|
85
86
|
text: string;
|
|
86
87
|
value: string;
|
|
87
|
-
/** Sanitized rich-text HTML for re-display; `text` stays the plain-text source for scoring. */
|
|
88
|
-
html?: string;
|
|
89
88
|
triggers?: Trigger[];
|
|
90
89
|
style?: Style;
|
|
91
90
|
};
|
|
@@ -98,11 +97,23 @@ export type QuestionRule = {
|
|
|
98
97
|
type: string;
|
|
99
98
|
value: number | string;
|
|
100
99
|
};
|
|
100
|
+
/** BE A2UI-style render component for a content bubble (STATE_SNAPSHOT / loaded chatLogs). */
|
|
101
|
+
export declare enum ContentComponent {
|
|
102
|
+
TEXT = "Text",
|
|
103
|
+
VOICE_PLAYER = "VoicePlayer",
|
|
104
|
+
VIDEO_PLAYER = "VideoPlayer",
|
|
105
|
+
SLIDER = "Slider"
|
|
106
|
+
}
|
|
107
|
+
/** BE message kind: an unanswerable agent aside vs a real question. */
|
|
108
|
+
export declare enum MessageKind {
|
|
109
|
+
HINT = "Hint",
|
|
110
|
+
QUESTION = "Question"
|
|
111
|
+
}
|
|
101
112
|
export type BubbleContent = {
|
|
102
113
|
value: string;
|
|
103
114
|
types: ContentType[];
|
|
104
115
|
/** BE A2UI-style render component (streaming STATE_SNAPSHOT / loaded chatLogs only). */
|
|
105
|
-
component?:
|
|
116
|
+
component?: ContentComponent;
|
|
106
117
|
};
|
|
107
118
|
export type MCQQuestionOption = {
|
|
108
119
|
id: string;
|
|
@@ -123,8 +134,8 @@ export type Question = {
|
|
|
123
134
|
usageWhitelist?: PHService[];
|
|
124
135
|
_id: string;
|
|
125
136
|
tags?: Tag[];
|
|
126
|
-
/** BE message kind (streaming STATE_SNAPSHOT / loaded chatLogs only)
|
|
127
|
-
kind?:
|
|
137
|
+
/** BE message kind (streaming STATE_SNAPSHOT / loaded chatLogs only). */
|
|
138
|
+
kind?: MessageKind;
|
|
128
139
|
};
|
|
129
140
|
export type Answer = {
|
|
130
141
|
_id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Branding } from './branding';
|
|
2
|
-
import { AgentResponse, AssessmentStatus, BGQButton, CandidateResponse, ContentType, MCQQuestionOption, PHService, QuestionRule, QuestionType, Tag } from './messages';
|
|
2
|
+
import { AgentResponse, AssessmentStatus, BGQButton, CandidateResponse, ContentComponent, ContentType, MCQQuestionOption, MessageKind, PHService, QuestionRule, QuestionType, Tag } from './messages';
|
|
3
3
|
/** Session token returned by /start/ats; sent as a dynamic header on subsequent calls. */
|
|
4
4
|
export type FiToken = {
|
|
5
5
|
name: string;
|
|
@@ -26,6 +26,12 @@ export type StartAtsResponse = {
|
|
|
26
26
|
candidateName?: string;
|
|
27
27
|
/** Role/position title for the welcome + header (optional; falls back to branding.title). */
|
|
28
28
|
roleTitle?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Pre-interview "what to expect" summary. Returned here too (not just on the
|
|
31
|
+
* stream) so it survives reload — re-hydration goes through /start, which never
|
|
32
|
+
* replays the stream. The store captures whichever source arrives first.
|
|
33
|
+
*/
|
|
34
|
+
summary?: AssessmentSummary;
|
|
29
35
|
};
|
|
30
36
|
export type NextResponse = {
|
|
31
37
|
nextResponse: AgentResponse;
|
|
@@ -71,15 +77,48 @@ export type DetectAgcResponse = {
|
|
|
71
77
|
isAgc: boolean;
|
|
72
78
|
allowNextAgcDetection: boolean;
|
|
73
79
|
};
|
|
74
|
-
export
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
export declare enum AgUiEventType {
|
|
81
|
+
RUN_STARTED = "RUN_STARTED",
|
|
82
|
+
STATE_SNAPSHOT = "STATE_SNAPSHOT",
|
|
83
|
+
ASSESSMENT_SUMMARY = "ASSESSMENT_SUMMARY",
|
|
84
|
+
TEXT_MESSAGE_START = "TEXT_MESSAGE_START",
|
|
85
|
+
TEXT_MESSAGE_CONTENT = "TEXT_MESSAGE_CONTENT",
|
|
86
|
+
TEXT_MESSAGE_END = "TEXT_MESSAGE_END",
|
|
87
|
+
CUSTOM = "CUSTOM",
|
|
88
|
+
RUN_FINISHED = "RUN_FINISHED",
|
|
89
|
+
RUN_ERROR = "RUN_ERROR"
|
|
90
|
+
}
|
|
91
|
+
/** Lifecycle of the BE-authored Continue action on the pre-interview summary. */
|
|
92
|
+
export declare enum SummaryActionStatus {
|
|
93
|
+
/** The BE stopped at the gate and is waiting for the click. */
|
|
94
|
+
PENDING = "PENDING",
|
|
95
|
+
/** The gate is already past (reload after continuing). */
|
|
96
|
+
CLICKED = "CLICKED"
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Pre-interview "what to expect" summary (AG-UI ASSESSMENT_SUMMARY, emitted once before dialogue).
|
|
100
|
+
* The backend sends structured counts only; the frontend owns the category labels/descriptions.
|
|
101
|
+
*/
|
|
102
|
+
export type AssessmentSummary = {
|
|
103
|
+
title: string;
|
|
104
|
+
totalQuestions: number;
|
|
105
|
+
estimatedMinutes: number;
|
|
106
|
+
breakdown: {
|
|
107
|
+
type: QuestionType;
|
|
108
|
+
count: number;
|
|
109
|
+
}[];
|
|
110
|
+
/** BE-authored Continue action; status PENDING gates the dialogue, CLICKED is past the gate. */
|
|
111
|
+
continueAction: {
|
|
112
|
+
label: string;
|
|
113
|
+
status: SummaryActionStatus;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
77
116
|
/** STATE_SNAPSHOT.snapshot.question — same data as our Question, but `types` is `questionTypes`. */
|
|
78
117
|
export type SnapshotQuestion = {
|
|
79
118
|
_id: string;
|
|
80
119
|
masterId?: string;
|
|
81
|
-
/** Bubble template:
|
|
82
|
-
kind?:
|
|
120
|
+
/** Bubble template: Hint (agent context, unanswerable) vs Question. */
|
|
121
|
+
kind?: MessageKind;
|
|
83
122
|
/** Answer-input component (ignored — response stays questionType-driven). */
|
|
84
123
|
component?: string | null;
|
|
85
124
|
questionTypes: QuestionType[];
|
|
@@ -88,7 +127,7 @@ export type SnapshotQuestion = {
|
|
|
88
127
|
tags?: Tag[];
|
|
89
128
|
usageWhitelist?: PHService[];
|
|
90
129
|
contents?: {
|
|
91
|
-
component:
|
|
130
|
+
component: ContentComponent;
|
|
92
131
|
types: ContentType[];
|
|
93
132
|
}[];
|
|
94
133
|
};
|
|
@@ -98,6 +137,8 @@ export type AgUiFrame = {
|
|
|
98
137
|
snapshot?: {
|
|
99
138
|
question?: SnapshotQuestion;
|
|
100
139
|
};
|
|
140
|
+
/** ASSESSMENT_SUMMARY payload (present only on that frame). */
|
|
141
|
+
summary?: AssessmentSummary;
|
|
101
142
|
/** TEXT_MESSAGE_* message id, shape "<baseId>:<contentIndex>"; segments bundled messages. */
|
|
102
143
|
messageId?: string;
|
|
103
144
|
delta?: string;
|
package/dist/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t,
|
|
2
|
-
export {
|
|
1
|
+
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, x as y, y as b } from "./messages-DCvBcspv.js";
|
|
2
|
+
export { s as API_ORIGIN_BY_ENV, p as AgUiEventType, g as AssessmentStatus, d as ButtonType, o as CHATBOT_API_PATH, a as ChatbotApiClient, m as ContentComponent, c as ContentType, e as DEFAULT_LOCAL_API_ORIGIN, v as ENVIRONMENTS, t as MessageKind, f as MessageSender, h as PHService, r as PiiQuestionType, l as QuestionType, b as REGIONS, _ as RuleName, u as SummaryActionStatus, i as VideoQuestionType, n as buildChatbotBaseUrl, y as resolveApiOrigin };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnswerContent, ContentType, MessageIdentifier, MessageSender, PHService, PiiQuestionType, QuestionRule, QuestionType, Style, Tag, Trigger, VideoQuestionType } from '../../api/types/messages';
|
|
1
|
+
import { AnswerContent, ContentComponent, ContentType, MessageKind, MessageIdentifier, MessageSender, PHService, PiiQuestionType, QuestionRule, QuestionType, Style, Tag, Trigger, VideoQuestionType } from '../../api/types/messages';
|
|
2
2
|
export declare enum BubbleStatus {
|
|
3
3
|
ANSWERED = "ANSWERED",
|
|
4
4
|
ANSWERING = "ANSWERING",
|
|
@@ -15,10 +15,7 @@ export type OptionContent = {
|
|
|
15
15
|
triggers?: Trigger[];
|
|
16
16
|
style?: Style;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
export type ContentComponent = 'Text' | 'VoicePlayer' | 'VideoPlayer' | 'Slider';
|
|
20
|
-
/** BE message kind (STATE_SNAPSHOT / loaded chatLogs question.kind). */
|
|
21
|
-
export type MessageKind = 'Hint' | 'Question';
|
|
18
|
+
export { ContentComponent, MessageKind } from '../../api/types/messages';
|
|
22
19
|
export type MessageItem = {
|
|
23
20
|
id: string;
|
|
24
21
|
types: ContentType[];
|
|
@@ -8,4 +8,9 @@ export declare const normalizeLanguage: (browserLanguage?: string) => SupportedL
|
|
|
8
8
|
/** Resolve the interview language: explicit override, else the browser default. */
|
|
9
9
|
export declare const resolveLanguage: (override?: string, browserLanguage?: string) => SupportedLanguage;
|
|
10
10
|
export declare const isRtlLanguage: (language: string) => boolean;
|
|
11
|
-
|
|
11
|
+
/** Values mirror the DOM `dir` attribute. */
|
|
12
|
+
export declare enum TextDirection {
|
|
13
|
+
LTR = "ltr",
|
|
14
|
+
RTL = "rtl"
|
|
15
|
+
}
|
|
16
|
+
export declare const directionForLanguage: (language: string) => TextDirection;
|
package/dist/core/interview.d.ts
CHANGED
|
@@ -12,14 +12,19 @@ export declare const ERROR_TYPE_VERIFY_ACCESS_FAILED = "FI_VERIFY_ACCESS_FAILED"
|
|
|
12
12
|
export declare const ERROR_TYPE_DETECT_AGC_FAILED = "FI_DETECT_AGC_FAILED";
|
|
13
13
|
export declare const LOG_TYPE_INVALID_PHONE_NUMBER = "INVALID_PHONE_NUMBER";
|
|
14
14
|
export declare const LOG_TYPE_INVALID_PASTE_ANSWER_ACTION = "INVALID_PASTE_ANSWER_ACTION";
|
|
15
|
-
/**
|
|
15
|
+
/** Outcome of a validated PII submission (drives the UI error/confirm modals). */
|
|
16
|
+
export declare enum PiiSubmitStatus {
|
|
17
|
+
SUBMITTED = "submitted",
|
|
18
|
+
INVALID = "invalid",
|
|
19
|
+
CONFIRM_NAME = "confirm-name"
|
|
20
|
+
}
|
|
16
21
|
export type PiiSubmitOutcome = {
|
|
17
|
-
status:
|
|
22
|
+
status: PiiSubmitStatus.SUBMITTED;
|
|
18
23
|
} | {
|
|
19
|
-
status:
|
|
24
|
+
status: PiiSubmitStatus.INVALID;
|
|
20
25
|
errorKey: PiiErrorKey;
|
|
21
26
|
} | {
|
|
22
|
-
status:
|
|
27
|
+
status: PiiSubmitStatus.CONFIRM_NAME;
|
|
23
28
|
suggested: string;
|
|
24
29
|
original: string;
|
|
25
30
|
};
|
|
@@ -76,6 +81,8 @@ export declare class InterviewEngine {
|
|
|
76
81
|
* the agent's opening message(s). No-op unless we're holding at the gate.
|
|
77
82
|
*/
|
|
78
83
|
confirmWelcome(): Promise<void>;
|
|
84
|
+
/** Candidate clicked Continue on the summary gate — re-call next/stream to stream the dialogue. */
|
|
85
|
+
continueFromSummary(): Promise<void>;
|
|
79
86
|
/**
|
|
80
87
|
* Ported from legacy firstLoadMessageBasedOnChatLogs: empty history → fetch the
|
|
81
88
|
* first message; history ending in a HINT (either the agent's question or the
|
|
@@ -84,11 +91,11 @@ export declare class InterviewEngine {
|
|
|
84
91
|
*/
|
|
85
92
|
private firstLoad;
|
|
86
93
|
/**
|
|
87
|
-
* Submit a free-text answer to the current (last agent) question.
|
|
88
|
-
*
|
|
89
|
-
*
|
|
94
|
+
* Submit a free-text answer to the current (last agent) question. Rich-text answers arrive as
|
|
95
|
+
* markdown (see `ui/markdown.ts`) — it is stored verbatim as the answer text, which is the only
|
|
96
|
+
* field the backend persists and echoes back.
|
|
90
97
|
*/
|
|
91
|
-
submitTextAnswer(text: string
|
|
98
|
+
submitTextAnswer(text: string): Promise<void>;
|
|
92
99
|
/** Validate then submit an email PII answer (legacy FTQResponse email branch). */
|
|
93
100
|
submitEmailAnswer(text: string): Promise<PiiSubmitOutcome>;
|
|
94
101
|
/**
|
|
@@ -4,7 +4,12 @@ export declare const AUDIO_MIME_CANDIDATES: readonly ["audio/webm;codecs=opus",
|
|
|
4
4
|
export type MimeSupportCheck = (mimeType: string) => boolean;
|
|
5
5
|
/** First supported candidate, or undefined to let the browser pick its default. */
|
|
6
6
|
export declare const negotiateMimeType: (candidates: readonly string[], isSupported: MimeSupportCheck) => string | undefined;
|
|
7
|
+
/** Recorded-file extensions; also the value sent to the BE for the playback URL. */
|
|
8
|
+
export declare enum RecordingExtension {
|
|
9
|
+
MP4 = "mp4",
|
|
10
|
+
WEBM = "webm"
|
|
11
|
+
}
|
|
7
12
|
/** File extension for a recorded blob's mimeType (mp4 vs webm). */
|
|
8
|
-
export declare const extensionForMimeType: (mimeType: string | undefined) =>
|
|
13
|
+
export declare const extensionForMimeType: (mimeType: string | undefined) => RecordingExtension;
|
|
9
14
|
/** webm duration metadata needs the fix-webm-duration patch; mp4 does not. */
|
|
10
15
|
export declare const needsWebmDurationFix: (mimeType: string | undefined) => boolean;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { MimeSupportCheck } from './mimeTypes';
|
|
2
|
-
export
|
|
2
|
+
export declare enum RecorderPhase {
|
|
3
|
+
IDLE = "idle",
|
|
4
|
+
PREVIEW = "preview",
|
|
5
|
+
RECORDING = "recording",
|
|
6
|
+
REVIEW = "review",
|
|
7
|
+
ERROR = "error"
|
|
8
|
+
}
|
|
3
9
|
export type RecorderState = {
|
|
4
10
|
phase: RecorderPhase;
|
|
5
11
|
/** Seconds elapsed in the current recording. */
|
|
@@ -12,7 +18,10 @@ export type RecorderState = {
|
|
|
12
18
|
};
|
|
13
19
|
error?: string;
|
|
14
20
|
};
|
|
15
|
-
export
|
|
21
|
+
export declare enum RecorderMedia {
|
|
22
|
+
VIDEO = "video",
|
|
23
|
+
AUDIO = "audio"
|
|
24
|
+
}
|
|
16
25
|
export type RecorderDeps = {
|
|
17
26
|
/** Max recording length in seconds; auto-stops when reached. */
|
|
18
27
|
maxSeconds: number;
|
package/dist/core/store.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { StoreApi } from 'zustand/vanilla';
|
|
2
2
|
import { AssessmentStatus } from '../api/types/messages';
|
|
3
3
|
import { Branding } from '../api/types/branding';
|
|
4
|
+
import { AssessmentSummary } from '../api/types/responses';
|
|
4
5
|
import { MessageBubble } from './bubbles/types';
|
|
5
|
-
export
|
|
6
|
+
export declare enum InterviewPhase {
|
|
7
|
+
IDLE = "idle",
|
|
8
|
+
VERIFYING = "verifying",
|
|
9
|
+
ACCESS_REQUIRED = "access-required",
|
|
10
|
+
STARTING = "starting",
|
|
11
|
+
/** Data loaded for a fresh assessment; awaiting the candidate's "Next" on the welcome screen. */
|
|
12
|
+
WELCOME = "welcome",
|
|
13
|
+
ACTIVE = "active",
|
|
14
|
+
ENDED = "ended",
|
|
15
|
+
FAILED = "failed"
|
|
16
|
+
}
|
|
6
17
|
export type InterviewState = {
|
|
7
18
|
phase: InterviewPhase;
|
|
8
19
|
assessmentStatus?: AssessmentStatus;
|
|
@@ -15,6 +26,15 @@ export type InterviewState = {
|
|
|
15
26
|
sendingAnswer: boolean;
|
|
16
27
|
numOfNormalQuestion: number;
|
|
17
28
|
numOfNormalAnswer: number;
|
|
29
|
+
/** Pre-interview "what to expect" summary from the stream; rendered up front once it arrives. */
|
|
30
|
+
assessmentSummary?: AssessmentSummary;
|
|
31
|
+
/** True while the fresh-start summary gate is loading (before it resolves) — renders the
|
|
32
|
+
* summary card's dots as the sole loader and suppresses the generic typing bubble. */
|
|
33
|
+
loadingSummaryGate?: boolean;
|
|
34
|
+
/** True while the BE has stopped at the pre-interview summary gate, awaiting a Continue click. */
|
|
35
|
+
awaitingSummaryContinue?: boolean;
|
|
36
|
+
/** True once the summary is settled (past the gate / reload) — renders as a static pinned header. */
|
|
37
|
+
summaryPinned?: boolean;
|
|
18
38
|
branding?: Branding;
|
|
19
39
|
/** Candidate display name for the welcome/done screens (optional; from /start/ats). */
|
|
20
40
|
candidateName?: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG 2.1 contrast ratio between two `#rrggbb` colours: 1 when identical, 21 for black on
|
|
3
|
+
* white. Order-independent. Compare against 4.5 for body text, 3 for large text and for the
|
|
4
|
+
* boundary of a user interface component.
|
|
5
|
+
*/
|
|
6
|
+
export declare const contrastRatio: (foreground: string, background: string) => number;
|
|
@@ -7,6 +7,11 @@ export declare const CSS_VAR_RESPONSE_BG = "--sc-response-bg";
|
|
|
7
7
|
export declare const CSS_VAR_RESPONSE_FG = "--sc-response-fg";
|
|
8
8
|
export declare const CSS_VAR_BUTTON_BG = "--sc-button-bg";
|
|
9
9
|
export declare const CSS_VAR_BUTTON_FG = "--sc-button-fg";
|
|
10
|
+
export declare const CSS_VAR_SELECTEDITEM_BG = "--sc-selecteditem-bg";
|
|
11
|
+
export declare const CSS_VAR_SELECTEDITEM_FG = "--sc-selecteditem-fg";
|
|
12
|
+
export declare const CSS_VAR_PROGRESS_BG = "--sc-progress-bg";
|
|
13
|
+
export declare const CSS_VAR_HINT_BG = "--sc-hint-bg";
|
|
14
|
+
export declare const CSS_VAR_HINT_FG = "--sc-hint-fg";
|
|
10
15
|
export declare const CSS_VAR_FONT_FAMILY = "--sc-font-family";
|
|
11
16
|
export type CssVariableMap = Record<string, string>;
|
|
12
17
|
/**
|