@corti/embedded-web 0.2.0 → 1.0.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.
@@ -1,10 +1,10 @@
1
- import type { ConfigureAppPayload } from "./config.js";
1
+ import type { ConfigureAppPayload, ConfigurePayload } from "./config.js";
2
2
  import type { AuthChangedEventPayload, DocumentEventPayload, ErrorEventPayload, InteractionCreatedEventPayload, NavigationChangedEventPayload, UsageEventPayload } from "./events.js";
3
- import type { AddFactsPayload, ConfigureSessionPayload, CreateInteractionPayload, Fact, KeycloakTokenResponse, NavigatePayload, SetCredentialsPayload } from "./payloads.js";
3
+ import type { AddFactsPayload, ConfigureSessionPayload, CreateInteractionPayload, DeviceLinkTokenResponse, Fact, KeycloakTokenResponse, NavigatePayload, SetInteractionOptionsPayload, SetCredentialsPayload } from "./payloads.js";
4
4
  import type { DefaultMode } from "./protocol.js";
5
- import type { AuthResponse, ConfigureAppResponse, CreateInteractionResponse, GetStatusResponse, GetTemplatesResponse } from "./responses.js";
6
- export type { ConfigureAppPayload } from "./config.js";
7
- export type { UserInfo } from "./responses.js";
5
+ import type { AuthResponse, ConfigureAppResponse, ConfigureResponse, CreateInteractionResponse, GetStatusResponse, GetTemplatesResponse, ShowDeviceLinkQRResponse } from "./responses.js";
6
+ export type { ConfigureAppPayload, ConfigurePayload } from "./config.js";
7
+ export type { ShowDeviceLinkQRResponse, UserInfo } from "./responses.js";
8
8
  /**
9
9
  * User information returned from authentication
10
10
  */
@@ -48,18 +48,26 @@ export interface CortiEmbeddedV1API {
48
48
  auth(payload: KeycloakTokenResponse): Promise<AuthResponse>;
49
49
  createInteraction(payload: CreateInteractionPayload): Promise<CreateInteractionResponse>;
50
50
  addFacts(payload: AddFactsPayload): Promise<void>;
51
+ configureApp(payload: ConfigureAppPayload): Promise<ConfigureAppResponse>;
51
52
  configureSession(payload: ConfigureSessionPayload): Promise<void>;
52
- configure(payload: ConfigureAppPayload): Promise<ConfigureAppResponse>;
53
+ setInteractionOptions(payload: SetInteractionOptionsPayload): Promise<void>;
54
+ configure(payload: ConfigurePayload): Promise<ConfigureResponse>;
53
55
  navigate(payload: NavigatePayload): Promise<void>;
54
56
  startRecording(): Promise<void>;
55
57
  stopRecording(): Promise<void>;
56
58
  setCredentials(payload: SetCredentialsPayload): Promise<void>;
57
59
  getStatus(): Promise<GetStatusResponse>;
58
60
  getTemplates(): Promise<GetTemplatesResponse>;
61
+ showDeviceLinkQR(payload: DeviceLinkTokenResponse): Promise<ShowDeviceLinkQRResponse>;
59
62
  }
60
63
  export interface CortiEmbeddedWindowAPI {
61
64
  v1: CortiEmbeddedV1API;
62
65
  }
66
+ declare global {
67
+ interface Window {
68
+ CortiEmbedded?: CortiEmbeddedWindowAPI;
69
+ }
70
+ }
63
71
  /**
64
72
  * Event listener function type
65
73
  */
@@ -118,18 +126,36 @@ export interface CortiEmbeddedAPI {
118
126
  * @returns Promise resolving to list of templates
119
127
  */
120
128
  getTemplates(): Promise<GetTemplatesResponse>;
129
+ /**
130
+ * Configure the embedded application
131
+ * @param config Application-level configuration
132
+ * @returns Promise that resolves when configuration is applied
133
+ */
134
+ configureApp(config: ConfigureAppPayload): Promise<ConfigureAppResponse>;
121
135
  /**
122
136
  * Configure the application
123
137
  * @param config Application configuration
124
138
  * @returns Promise that resolves when configuration is applied
125
139
  */
126
- configure(config: ConfigureAppPayload): Promise<ConfigureAppResponse>;
140
+ configure(config: ConfigurePayload): Promise<ConfigureResponse>;
141
+ /**
142
+ * Set one-shot interaction options for the embedded instance.
143
+ *
144
+ * Each call patches the provided interaction-options branches onto the current
145
+ * snapshot for the embedded instance. Omitted branches preserve their existing
146
+ * values from previous calls.
147
+ * @param config Interaction/session-level options
148
+ * @returns Promise that resolves when options are applied
149
+ */
150
+ setInteractionOptions(config: SetInteractionOptionsPayload): Promise<void>;
127
151
  /**
128
152
  * Set authentication credentials without triggering auth flow
129
153
  * @param credentials Authentication credentials to store
130
154
  * @returns Promise that resolves when credentials are set
131
155
  */
132
- setCredentials(credentials: SetCredentialsPayload): Promise<void>;
156
+ setCredentials(credentials: {
157
+ password: string;
158
+ }): Promise<void>;
133
159
  /**
134
160
  * Show the embedded UI
135
161
  */
@@ -138,4 +164,10 @@ export interface CortiEmbeddedAPI {
138
164
  * Hide the embedded UI
139
165
  */
140
166
  hide(): void;
167
+ /**
168
+ * Show the device-link QR code in the embedded UI
169
+ * @param payload Device-link token response to render as a QR code
170
+ * @returns Promise resolving to the rendered QR code state
171
+ */
172
+ showDeviceLinkQR(payload: DeviceLinkTokenResponse): Promise<ShowDeviceLinkQRResponse>;
141
173
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA,qCAAqC","sourcesContent":["// Public API types for SDK consumers\n\nimport type { ConfigureAppPayload } from \"./config.js\";\nimport type {\n AuthChangedEventPayload,\n DocumentEventPayload,\n ErrorEventPayload,\n InteractionCreatedEventPayload,\n NavigationChangedEventPayload,\n UsageEventPayload,\n} from \"./events.js\";\nimport type {\n AddFactsPayload,\n ConfigureSessionPayload,\n CreateInteractionPayload,\n Fact,\n KeycloakTokenResponse,\n NavigatePayload,\n SetCredentialsPayload,\n} from \"./payloads.js\";\nimport type { DefaultMode } from \"./protocol.js\";\nimport type {\n AuthResponse,\n ConfigureAppResponse,\n CreateInteractionResponse,\n GetStatusResponse,\n GetTemplatesResponse,\n} from \"./responses.js\";\n\nexport type { ConfigureAppPayload } from \"./config.js\";\n// Re-export common types for public API\nexport type { UserInfo } from \"./responses.js\";\n\n/**\n * User information returned from authentication\n */\nexport interface User {\n id: string;\n email: string;\n}\n\n/**\n * Details of a created interaction\n */\nexport interface InteractionDetails {\n id: string;\n createdAt: string;\n}\n\n/**\n * Session configuration options\n */\nexport interface SessionConfig {\n defaultLanguage?: string;\n defaultOutputLanguage?: string;\n defaultTemplateKey?: string;\n defaultMode?: DefaultMode;\n}\n\n/**\n * Event data types for component events\n */\nexport interface EmbeddedEventData {\n ready: undefined;\n \"auth-changed\": AuthChangedEventPayload;\n \"interaction-created\": InteractionCreatedEventPayload;\n \"recording-started\": undefined;\n \"recording-stopped\": undefined;\n \"document-generated\": DocumentEventPayload;\n \"document-updated\": DocumentEventPayload;\n \"document-synced\": DocumentEventPayload;\n \"navigation-changed\": NavigationChangedEventPayload;\n usage: UsageEventPayload;\n error: ErrorEventPayload;\n}\n\n// Window API Types\nexport interface CortiEmbeddedV1API {\n auth(payload: KeycloakTokenResponse): Promise<AuthResponse>;\n createInteraction(\n payload: CreateInteractionPayload,\n ): Promise<CreateInteractionResponse>;\n addFacts(payload: AddFactsPayload): Promise<void>;\n configureSession(payload: ConfigureSessionPayload): Promise<void>;\n configure(payload: ConfigureAppPayload): Promise<ConfigureAppResponse>;\n navigate(payload: NavigatePayload): Promise<void>;\n startRecording(): Promise<void>;\n stopRecording(): Promise<void>;\n setCredentials(payload: SetCredentialsPayload): Promise<void>;\n getStatus(): Promise<GetStatusResponse>;\n getTemplates(): Promise<GetTemplatesResponse>;\n}\nexport interface CortiEmbeddedWindowAPI {\n v1: CortiEmbeddedV1API;\n}\n\n/**\n * Event listener function type\n */\nexport type EventListener<T = unknown> = (data: T) => void;\n\n/**\n * Public API interface for the Corti Embedded component\n */\nexport interface CortiEmbeddedAPI {\n /**\n * Authenticate with the Corti system\n * @param credentials Authentication credentials\n * @returns Promise resolving to user information\n */\n auth(credentials: KeycloakTokenResponse): Promise<User>;\n\n /**\n * Create a new interaction\n * @param encounter Encounter request data\n * @returns Promise resolving to interaction details\n */\n createInteraction(\n encounter: CreateInteractionPayload,\n ): Promise<InteractionDetails>;\n\n /**\n * Configure the current session\n * @param config Session configuration\n * @returns Promise that resolves when configuration is complete\n */\n configureSession(config: SessionConfig): Promise<void>;\n\n /**\n * Add facts to the current session\n * @param facts Array of facts to add\n * @returns Promise that resolves when facts are added\n */\n addFacts(facts: Fact[]): Promise<void>;\n\n /**\n * Navigate to a specific path within the embedded UI\n * @param path Path to navigate to\n * @returns Promise that resolves when navigation is complete\n */\n navigate(path: string): Promise<void>;\n\n /**\n * Start recording\n * @returns Promise that resolves when recording starts\n */\n startRecording(): Promise<void>;\n\n /**\n * Stop recording\n * @returns Promise that resolves when recording stops\n */\n stopRecording(): Promise<void>;\n\n /**\n * Get current component status\n * @returns Promise resolving to current status\n */\n getStatus(): Promise<GetStatusResponse>;\n\n /**\n * Get all templates available to the current user\n * @returns Promise resolving to list of templates\n */\n getTemplates(): Promise<GetTemplatesResponse>;\n\n /**\n * Configure the application\n * @param config Application configuration\n * @returns Promise that resolves when configuration is applied\n */\n configure(config: ConfigureAppPayload): Promise<ConfigureAppResponse>;\n\n /**\n * Set authentication credentials without triggering auth flow\n * @param credentials Authentication credentials to store\n * @returns Promise that resolves when credentials are set\n */\n setCredentials(credentials: SetCredentialsPayload): Promise<void>;\n\n /**\n * Show the embedded UI\n */\n show(): void;\n\n /**\n * Hide the embedded UI\n */\n hide(): void;\n}\n"]}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA,qCAAqC","sourcesContent":["// Public API types for SDK consumers\n\nimport type { ConfigureAppPayload, ConfigurePayload } from \"./config.js\";\nimport type {\n AuthChangedEventPayload,\n DocumentEventPayload,\n ErrorEventPayload,\n InteractionCreatedEventPayload,\n NavigationChangedEventPayload,\n UsageEventPayload,\n} from \"./events.js\";\nimport type {\n AddFactsPayload,\n ConfigureSessionPayload,\n CreateInteractionPayload,\n DeviceLinkTokenResponse,\n Fact,\n KeycloakTokenResponse,\n NavigatePayload,\n SetInteractionOptionsPayload,\n SetCredentialsPayload,\n} from \"./payloads.js\";\nimport type { DefaultMode } from \"./protocol.js\";\nimport type {\n AuthResponse,\n ConfigureAppResponse,\n ConfigureResponse,\n CreateInteractionResponse,\n GetStatusResponse,\n GetTemplatesResponse,\n ShowDeviceLinkQRResponse,\n} from \"./responses.js\";\n\nexport type { ConfigureAppPayload, ConfigurePayload } from \"./config.js\";\n// Re-export common types for public API\nexport type { ShowDeviceLinkQRResponse, UserInfo } from \"./responses.js\";\n\n/**\n * User information returned from authentication\n */\nexport interface User {\n id: string;\n email: string;\n}\n\n/**\n * Details of a created interaction\n */\nexport interface InteractionDetails {\n id: string;\n createdAt: string;\n}\n\n/**\n * Session configuration options\n */\nexport interface SessionConfig {\n defaultLanguage?: string;\n defaultOutputLanguage?: string;\n defaultTemplateKey?: string;\n defaultMode?: DefaultMode;\n}\n\n/**\n * Event data types for component events\n */\nexport interface EmbeddedEventData {\n ready: undefined;\n \"auth-changed\": AuthChangedEventPayload;\n \"interaction-created\": InteractionCreatedEventPayload;\n \"recording-started\": undefined;\n \"recording-stopped\": undefined;\n \"document-generated\": DocumentEventPayload;\n \"document-updated\": DocumentEventPayload;\n \"document-synced\": DocumentEventPayload;\n \"navigation-changed\": NavigationChangedEventPayload;\n usage: UsageEventPayload;\n error: ErrorEventPayload;\n}\n\n// Window API Types\nexport interface CortiEmbeddedV1API {\n auth(payload: KeycloakTokenResponse): Promise<AuthResponse>;\n createInteraction(\n payload: CreateInteractionPayload,\n ): Promise<CreateInteractionResponse>;\n addFacts(payload: AddFactsPayload): Promise<void>;\n configureApp(payload: ConfigureAppPayload): Promise<ConfigureAppResponse>;\n configureSession(payload: ConfigureSessionPayload): Promise<void>;\n setInteractionOptions(payload: SetInteractionOptionsPayload): Promise<void>;\n configure(payload: ConfigurePayload): Promise<ConfigureResponse>;\n navigate(payload: NavigatePayload): Promise<void>;\n startRecording(): Promise<void>;\n stopRecording(): Promise<void>;\n setCredentials(payload: SetCredentialsPayload): Promise<void>;\n getStatus(): Promise<GetStatusResponse>;\n getTemplates(): Promise<GetTemplatesResponse>;\n showDeviceLinkQR(\n payload: DeviceLinkTokenResponse,\n ): Promise<ShowDeviceLinkQRResponse>;\n}\nexport interface CortiEmbeddedWindowAPI {\n v1: CortiEmbeddedV1API;\n}\n\n// Extend Window interface\ndeclare global {\n interface Window {\n CortiEmbedded?: CortiEmbeddedWindowAPI;\n }\n}\n\n/**\n * Event listener function type\n */\nexport type EventListener<T = unknown> = (data: T) => void;\n\n/**\n * Public API interface for the Corti Embedded component\n */\nexport interface CortiEmbeddedAPI {\n /**\n * Authenticate with the Corti system\n * @param credentials Authentication credentials\n * @returns Promise resolving to user information\n */\n auth(credentials: KeycloakTokenResponse): Promise<User>;\n\n /**\n * Create a new interaction\n * @param encounter Encounter request data\n * @returns Promise resolving to interaction details\n */\n createInteraction(\n encounter: CreateInteractionPayload,\n ): Promise<InteractionDetails>;\n\n /**\n * Configure the current session\n * @param config Session configuration\n * @returns Promise that resolves when configuration is complete\n */\n configureSession(config: SessionConfig): Promise<void>;\n\n /**\n * Add facts to the current session\n * @param facts Array of facts to add\n * @returns Promise that resolves when facts are added\n */\n addFacts(facts: Fact[]): Promise<void>;\n\n /**\n * Navigate to a specific path within the embedded UI\n * @param path Path to navigate to\n * @returns Promise that resolves when navigation is complete\n */\n navigate(path: string): Promise<void>;\n\n /**\n * Start recording\n * @returns Promise that resolves when recording starts\n */\n startRecording(): Promise<void>;\n\n /**\n * Stop recording\n * @returns Promise that resolves when recording stops\n */\n stopRecording(): Promise<void>;\n\n /**\n * Get current component status\n * @returns Promise resolving to current status\n */\n getStatus(): Promise<GetStatusResponse>;\n\n /**\n * Get all templates available to the current user\n * @returns Promise resolving to list of templates\n */\n getTemplates(): Promise<GetTemplatesResponse>;\n\n /**\n * Configure the embedded application\n * @param config Application-level configuration\n * @returns Promise that resolves when configuration is applied\n */\n configureApp(config: ConfigureAppPayload): Promise<ConfigureAppResponse>;\n\n /**\n * Configure the application\n * @param config Application configuration\n * @returns Promise that resolves when configuration is applied\n */\n configure(config: ConfigurePayload): Promise<ConfigureResponse>;\n\n /**\n * Set one-shot interaction options for the embedded instance.\n *\n * Each call patches the provided interaction-options branches onto the current\n * snapshot for the embedded instance. Omitted branches preserve their existing\n * values from previous calls.\n * @param config Interaction/session-level options\n * @returns Promise that resolves when options are applied\n */\n setInteractionOptions(config: SetInteractionOptionsPayload): Promise<void>;\n\n /**\n * Set authentication credentials without triggering auth flow\n * @param credentials Authentication credentials to store\n * @returns Promise that resolves when credentials are set\n */\n setCredentials(credentials: { password: string }): Promise<void>;\n\n /**\n * Show the embedded UI\n */\n show(): void;\n\n /**\n * Hide the embedded UI\n */\n hide(): void;\n\n /**\n * Show the device-link QR code in the embedded UI\n * @param payload Device-link token response to render as a QR code\n * @returns Promise resolving to the rendered QR code state\n */\n showDeviceLinkQR(\n payload: DeviceLinkTokenResponse,\n ): Promise<ShowDeviceLinkQRResponse>;\n}\n"]}
@@ -1,7 +1,16 @@
1
1
  export interface AppearanceConfig {
2
2
  primaryColor: string | null;
3
3
  }
4
- export interface FeaturesConfig {
4
+ export interface UIConfig {
5
+ interactionTitle: boolean;
6
+ aiChat: boolean;
7
+ documentFeedback: boolean;
8
+ navigation: boolean;
9
+ }
10
+ export interface CompanionAppConfig {
11
+ enabled: boolean;
12
+ }
13
+ export interface ConfigureFeaturesConfig {
5
14
  interactionTitle: boolean;
6
15
  aiChat: boolean;
7
16
  documentFeedback: boolean;
@@ -18,9 +27,18 @@ export interface LocaleConfig {
18
27
  export interface NetworkConfig {
19
28
  websocketBaseUrl?: string | null;
20
29
  }
30
+ export interface ConfigurePayload {
31
+ debug?: boolean;
32
+ appearance?: Partial<AppearanceConfig>;
33
+ features?: Partial<ConfigureFeaturesConfig>;
34
+ locale?: Partial<LocaleConfig>;
35
+ network?: Partial<NetworkConfig>;
36
+ }
21
37
  export interface ConfigureAppPayload {
38
+ debug?: boolean;
39
+ ui?: Partial<UIConfig>;
40
+ companionApp?: CompanionAppConfig;
22
41
  appearance?: Partial<AppearanceConfig>;
23
- features?: Partial<FeaturesConfig>;
24
42
  locale?: Partial<LocaleConfig>;
25
43
  network?: Partial<NetworkConfig>;
26
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,iDAAiD","sourcesContent":["// Configuration types for the embedded component\n\nexport interface AppearanceConfig {\n primaryColor: string | null;\n}\n\nexport interface FeaturesConfig {\n interactionTitle: boolean;\n aiChat: boolean;\n documentFeedback: boolean;\n navigation: boolean;\n virtualMode: boolean;\n syncDocumentAction: boolean;\n templateEditor: boolean;\n}\n\nexport interface LocaleConfig {\n interfaceLanguage: string;\n dictationLanguage?: string | null;\n overrides?: Record<string, string>;\n}\n\nexport interface NetworkConfig {\n websocketBaseUrl?: string | null;\n}\n\nexport interface ConfigureAppPayload {\n appearance?: Partial<AppearanceConfig>;\n features?: Partial<FeaturesConfig>;\n locale?: Partial<LocaleConfig>;\n network?: Partial<NetworkConfig>;\n}\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,iDAAiD","sourcesContent":["// Configuration types for the embedded component\n\nexport interface AppearanceConfig {\n primaryColor: string | null;\n}\n\nexport interface UIConfig {\n interactionTitle: boolean;\n aiChat: boolean;\n documentFeedback: boolean;\n navigation: boolean;\n}\n\nexport interface CompanionAppConfig {\n enabled: boolean;\n}\n\nexport interface ConfigureFeaturesConfig {\n interactionTitle: boolean;\n aiChat: boolean;\n documentFeedback: boolean;\n navigation: boolean;\n virtualMode: boolean;\n syncDocumentAction: boolean;\n templateEditor: boolean;\n}\n\nexport interface LocaleConfig {\n interfaceLanguage: string;\n dictationLanguage?: string | null;\n overrides?: Record<string, string>;\n}\n\nexport interface NetworkConfig {\n websocketBaseUrl?: string | null;\n}\n\nexport interface ConfigurePayload {\n debug?: boolean;\n appearance?: Partial<AppearanceConfig>;\n features?: Partial<ConfigureFeaturesConfig>;\n locale?: Partial<LocaleConfig>;\n network?: Partial<NetworkConfig>;\n}\n\nexport interface ConfigureAppPayload {\n debug?: boolean;\n ui?: Partial<UIConfig>;\n companionApp?: CompanionAppConfig;\n appearance?: Partial<AppearanceConfig>;\n locale?: Partial<LocaleConfig>;\n network?: Partial<NetworkConfig>;\n}\n"]}
@@ -79,6 +79,47 @@ export type EmbeddedInterviewDetails = {
79
79
  /** Not applicable for built-in templates */
80
80
  customTemplateId: null;
81
81
  state: "generated" | "pending" | "error" | "stale" | "missing_template";
82
+ } | {
83
+ /** Unique document identifier */
84
+ id: string;
85
+ /** Document name */
86
+ name: string;
87
+ /** Language code for document output */
88
+ outputLanguage: string;
89
+ /** Whether document is streamed */
90
+ isStream: boolean;
91
+ /** Document sections */
92
+ sections: {
93
+ /** Unique identifier for the section */
94
+ key: string;
95
+ /** Display name of the section */
96
+ name: string;
97
+ /** Section content text */
98
+ text: string;
99
+ /** Sort order for displaying sections */
100
+ sort: number;
101
+ /** ISO 8601 timestamp when section was created */
102
+ createdAt: string;
103
+ /** ISO 8601 timestamp when section was last updated */
104
+ updatedAt: string;
105
+ /** Markdown formatted content */
106
+ markdown?: (string | null) | undefined;
107
+ /** HTML formatted content */
108
+ htmlText?: string | undefined;
109
+ /** Plain text content */
110
+ plainText?: string | undefined;
111
+ }[];
112
+ /** Usage information */
113
+ usageInfo?: {
114
+ creditsConsumed: number;
115
+ } | undefined;
116
+ /** Reference to the template used */
117
+ templateRef: string;
118
+ /** Type of template used */
119
+ templateType: "schema-driven";
120
+ /** Not applicable for schema-driven templates */
121
+ customTemplateId: null;
122
+ state: "generated" | "pending" | "error" | "stale" | "missing_template";
82
123
  } | {
83
124
  /** Unique document identifier */
84
125
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interview-details.js","sourceRoot":"","sources":["../../../src/types/generated/interview-details.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uBAAuB","sourcesContent":["// This file is auto-generated by scripts/generate-embedded-interview-details.ts\n// Do not edit by hand.\n\nexport type EmbeddedInterviewDetails = {\n /** Unique interview identifier */\n id: string;\n /** Interview title */\n title: string | null;\n /** Current state of the interaction */\n state: \"planned\" | \"ongoing\" | \"paused\" | \"disconnected\" | \"ending\" | \"parsing\" | \"ended\";\n /** ISO 8601 timestamp when interview started */\n startedAt: string;\n /** ISO 8601 timestamp when interview ended */\n endedAt: string | null;\n /** ISO 8601 timestamp when interview is scheduled to end */\n endsAt: string | null;\n /** Maximum duration in minutes */\n maxDurationInMinutes?: (number | null) | undefined;\n transcripts: {\n utterances: {\n /** Unique utterance identifier */\n id: string;\n /** Start time in seconds */\n start: number;\n /** Duration in seconds */\n duration: number;\n /** Utterance text content */\n text: string;\n /** Whether the utterance is finalized */\n isFinal: boolean;\n /** ID of the participant who spoke */\n participantId?: string | undefined;\n }[];\n participants: {\n /** Unique participant identifier */\n id?: string | undefined;\n /** Audio channel number for the participant */\n channel: number;\n /** Role of the participant in the interaction */\n role: \"agent\" | \"patient\" | \"other\" | \"multiple\";\n }[];\n isMultiChannel: boolean;\n }[];\n documents: (\n | {\n /** Unique document identifier */\n id: string;\n /** Document name */\n name: string;\n /** Language code for document output */\n outputLanguage: string;\n /** Whether document is streamed */\n isStream: boolean;\n /** Document sections */\n sections: {\n /** Unique identifier for the section */\n key: string;\n /** Display name of the section */\n name: string;\n /** Section content text */\n text: string;\n /** Sort order for displaying sections */\n sort: number;\n /** ISO 8601 timestamp when section was created */\n createdAt: string;\n /** ISO 8601 timestamp when section was last updated */\n updatedAt: string;\n /** Markdown formatted content */\n markdown?: (string | null) | undefined;\n /** HTML formatted content */\n htmlText?: string | undefined;\n /** Plain text content */\n plainText?: string | undefined;\n }[];\n /** Usage information */\n usageInfo?:\n | {\n creditsConsumed: number;\n }\n | undefined;\n /** Reference to the template used */\n templateRef: string;\n /** Type of template used */\n templateType: \"built-in\";\n /** Not applicable for built-in templates */\n customTemplateId: null;\n state: \"generated\" | \"pending\" | \"error\" | \"stale\" | \"missing_template\";\n }\n | {\n /** Unique document identifier */\n id: string;\n /** Document name */\n name: string;\n /** Language code for document output */\n outputLanguage: string;\n /** Whether document is streamed */\n isStream: boolean;\n /** Document sections */\n sections: {\n /** Unique identifier for the section */\n key: string;\n /** Display name of the section */\n name: string;\n /** Section content text */\n text: string;\n /** Sort order for displaying sections */\n sort: number;\n /** ISO 8601 timestamp when section was created */\n createdAt: string;\n /** ISO 8601 timestamp when section was last updated */\n updatedAt: string;\n /** Markdown formatted content */\n markdown?: (string | null) | undefined;\n /** HTML formatted content */\n htmlText?: string | undefined;\n /** Plain text content */\n plainText?: string | undefined;\n }[];\n /** Usage information */\n usageInfo?:\n | {\n creditsConsumed: number;\n }\n | undefined;\n /** Type of template used */\n templateType: \"custom\";\n /** Not applicable for custom templates */\n templateRef: null;\n /** ID of the custom template */\n customTemplateId: string;\n state: \"generated\" | \"pending\" | \"error\" | \"stale\" | \"missing_template\";\n }\n )[];\n factGroups:\n | {\n /** DEPRECATED: Legacy identifier, use 'key' instead */\n id?: string | undefined;\n /** Unique fact group key */\n key: string;\n translations: {\n /** Translation identifier */\n id: number;\n /** Language identifier */\n languages_id: string;\n /** Translated group name */\n name: string;\n }[];\n }[]\n | null;\n facts:\n | {\n /** Unique fact identifier */\n id: string;\n /** The fact content */\n text: string;\n /** Category group key for organizing facts */\n group: string;\n /** DEPRECATED: Legacy group identifier, use 'group' instead */\n groupId?: (string | null) | undefined;\n /** Whether the fact has been discarded */\n isDiscarded: boolean;\n /** Origin of the fact: core (built-in), system (auto-generated), or user (manual) */\n source: \"core\" | \"system\" | \"user\";\n /** ISO 8601 timestamp when fact was created */\n createdAt?: string | undefined;\n /** ISO 8601 timestamp when fact was last updated */\n updatedAt: string;\n /** Whether this is a newly added fact */\n isNew?: boolean | undefined;\n }[]\n | null;\n websocketUrl: string;\n};\n"]}
1
+ {"version":3,"file":"interview-details.js","sourceRoot":"","sources":["../../../src/types/generated/interview-details.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uBAAuB","sourcesContent":["// This file is auto-generated by scripts/generate-embedded-interview-details.ts\n// Do not edit by hand.\n\nexport type EmbeddedInterviewDetails = {\n /** Unique interview identifier */\n id: string;\n /** Interview title */\n title: string | null;\n /** Current state of the interaction */\n state:\n | \"planned\"\n | \"ongoing\"\n | \"paused\"\n | \"disconnected\"\n | \"ending\"\n | \"parsing\"\n | \"ended\";\n /** ISO 8601 timestamp when interview started */\n startedAt: string;\n /** ISO 8601 timestamp when interview ended */\n endedAt: string | null;\n /** ISO 8601 timestamp when interview is scheduled to end */\n endsAt: string | null;\n /** Maximum duration in minutes */\n maxDurationInMinutes?: (number | null) | undefined;\n transcripts: {\n utterances: {\n /** Unique utterance identifier */\n id: string;\n /** Start time in seconds */\n start: number;\n /** Duration in seconds */\n duration: number;\n /** Utterance text content */\n text: string;\n /** Whether the utterance is finalized */\n isFinal: boolean;\n /** ID of the participant who spoke */\n participantId?: string | undefined;\n }[];\n participants: {\n /** Unique participant identifier */\n id?: string | undefined;\n /** Audio channel number for the participant */\n channel: number;\n /** Role of the participant in the interaction */\n role: \"agent\" | \"patient\" | \"other\" | \"multiple\";\n }[];\n isMultiChannel: boolean;\n }[];\n documents: (\n | {\n /** Unique document identifier */\n id: string;\n /** Document name */\n name: string;\n /** Language code for document output */\n outputLanguage: string;\n /** Whether document is streamed */\n isStream: boolean;\n /** Document sections */\n sections: {\n /** Unique identifier for the section */\n key: string;\n /** Display name of the section */\n name: string;\n /** Section content text */\n text: string;\n /** Sort order for displaying sections */\n sort: number;\n /** ISO 8601 timestamp when section was created */\n createdAt: string;\n /** ISO 8601 timestamp when section was last updated */\n updatedAt: string;\n /** Markdown formatted content */\n markdown?: (string | null) | undefined;\n /** HTML formatted content */\n htmlText?: string | undefined;\n /** Plain text content */\n plainText?: string | undefined;\n }[];\n /** Usage information */\n usageInfo?:\n | {\n creditsConsumed: number;\n }\n | undefined;\n /** Reference to the template used */\n templateRef: string;\n /** Type of template used */\n templateType: \"built-in\";\n /** Not applicable for built-in templates */\n customTemplateId: null;\n state: \"generated\" | \"pending\" | \"error\" | \"stale\" | \"missing_template\";\n }\n | {\n /** Unique document identifier */\n id: string;\n /** Document name */\n name: string;\n /** Language code for document output */\n outputLanguage: string;\n /** Whether document is streamed */\n isStream: boolean;\n /** Document sections */\n sections: {\n /** Unique identifier for the section */\n key: string;\n /** Display name of the section */\n name: string;\n /** Section content text */\n text: string;\n /** Sort order for displaying sections */\n sort: number;\n /** ISO 8601 timestamp when section was created */\n createdAt: string;\n /** ISO 8601 timestamp when section was last updated */\n updatedAt: string;\n /** Markdown formatted content */\n markdown?: (string | null) | undefined;\n /** HTML formatted content */\n htmlText?: string | undefined;\n /** Plain text content */\n plainText?: string | undefined;\n }[];\n /** Usage information */\n usageInfo?:\n | {\n creditsConsumed: number;\n }\n | undefined;\n /** Reference to the template used */\n templateRef: string;\n /** Type of template used */\n templateType: \"schema-driven\";\n /** Not applicable for schema-driven templates */\n customTemplateId: null;\n state: \"generated\" | \"pending\" | \"error\" | \"stale\" | \"missing_template\";\n }\n | {\n /** Unique document identifier */\n id: string;\n /** Document name */\n name: string;\n /** Language code for document output */\n outputLanguage: string;\n /** Whether document is streamed */\n isStream: boolean;\n /** Document sections */\n sections: {\n /** Unique identifier for the section */\n key: string;\n /** Display name of the section */\n name: string;\n /** Section content text */\n text: string;\n /** Sort order for displaying sections */\n sort: number;\n /** ISO 8601 timestamp when section was created */\n createdAt: string;\n /** ISO 8601 timestamp when section was last updated */\n updatedAt: string;\n /** Markdown formatted content */\n markdown?: (string | null) | undefined;\n /** HTML formatted content */\n htmlText?: string | undefined;\n /** Plain text content */\n plainText?: string | undefined;\n }[];\n /** Usage information */\n usageInfo?:\n | {\n creditsConsumed: number;\n }\n | undefined;\n /** Type of template used */\n templateType: \"custom\";\n /** Not applicable for custom templates */\n templateRef: null;\n /** ID of the custom template */\n customTemplateId: string;\n state: \"generated\" | \"pending\" | \"error\" | \"stale\" | \"missing_template\";\n }\n )[];\n factGroups:\n | {\n /** DEPRECATED: Legacy identifier, use 'key' instead */\n id?: string | undefined;\n /** Unique fact group key */\n key: string;\n translations: {\n /** Translation identifier */\n id: number;\n /** Language identifier */\n languages_id: string;\n /** Translated group name */\n name: string;\n }[];\n }[]\n | null;\n facts:\n | {\n /** Unique fact identifier */\n id: string;\n /** The fact content */\n text: string;\n /** Category group key for organizing facts */\n group: string;\n /** DEPRECATED: Legacy group identifier, use 'group' instead */\n groupId?: (string | null) | undefined;\n /** Whether the fact has been discarded */\n isDiscarded: boolean;\n /** Origin of the fact: core (built-in), system (auto-generated), or user (manual) */\n source: \"core\" | \"system\" | \"user\";\n /** ISO 8601 timestamp when fact was created */\n createdAt?: string | undefined;\n /** ISO 8601 timestamp when fact was last updated */\n updatedAt: string;\n /** Whether this is a newly added fact */\n isNew?: boolean | undefined;\n }[]\n | null;\n websocketUrl: string;\n};\n"]}
@@ -1,4 +1,4 @@
1
- // Main exports for @corti/embedded-types
1
+ // Main exports for @assistant/embedded-types
2
2
  // Public API types
3
3
  export * from "./api.js";
4
4
  // Config types
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,mBAAmB;AACnB,cAAc,UAAU,CAAC;AACzB,eAAe;AACf,cAAc,aAAa,CAAC;AAC5B,cAAc;AACd,cAAc,aAAa,CAAC;AAC5B,gBAAgB;AAChB,cAAc,eAAe,CAAC;AAC9B,iBAAiB;AACjB,cAAc,gBAAgB,CAAC;AAC/B,iBAAiB;AACjB,cAAc,eAAe,CAAC","sourcesContent":["// Main exports for @corti/embedded-types\n\n// Public API types\nexport * from \"./api.js\";\n// Config types\nexport * from \"./config.js\";\n// Event types\nexport * from \"./events.js\";\n// Payload types\nexport * from \"./payloads.js\";\n// Response types\nexport * from \"./responses.js\";\n// Protocol types\nexport * from \"./protocol.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,mBAAmB;AACnB,cAAc,UAAU,CAAC;AACzB,eAAe;AACf,cAAc,aAAa,CAAC;AAC5B,cAAc;AACd,cAAc,aAAa,CAAC;AAC5B,gBAAgB;AAChB,cAAc,eAAe,CAAC;AAC9B,iBAAiB;AACjB,cAAc,gBAAgB,CAAC;AAC/B,iBAAiB;AACjB,cAAc,eAAe,CAAC","sourcesContent":["// Main exports for @assistant/embedded-types\n\n// Public API types\nexport * from \"./api.js\";\n// Config types\nexport * from \"./config.js\";\n// Event types\nexport * from \"./events.js\";\n// Payload types\nexport * from \"./payloads.js\";\n// Response types\nexport * from \"./responses.js\";\n// Protocol types\nexport * from \"./protocol.js\";\n"]}
@@ -17,6 +17,9 @@ export interface KeycloakTokenResponse {
17
17
  sub: string;
18
18
  };
19
19
  }
20
+ export type DeviceLinkTokenResponse = KeycloakTokenResponse & {
21
+ refresh_token: string;
22
+ };
20
23
  export interface Fact {
21
24
  text: Corti.FactsCreateInput["text"];
22
25
  group: string;
@@ -50,6 +53,104 @@ export interface ConfigureSessionPayload {
50
53
  defaultTemplateKey?: string;
51
54
  defaultMode?: DefaultMode;
52
55
  }
56
+ export interface InteractionModeOptions {
57
+ fallback?: DefaultMode;
58
+ options: DefaultMode[];
59
+ }
60
+ export interface SpokenLanguageOptions {
61
+ fallback?: string;
62
+ options?: string[];
63
+ }
64
+ export interface InlineTemplateLabel {
65
+ key: string;
66
+ value: string;
67
+ }
68
+ export interface InlineTemplateSectionInstructions {
69
+ contentPrompt: string;
70
+ writingStylePrompt?: string;
71
+ miscPrompt?: string;
72
+ }
73
+ export interface InlineTemplateSection {
74
+ heading: string;
75
+ labels?: InlineTemplateLabel[];
76
+ instructions: InlineTemplateSectionInstructions;
77
+ outputSchema?: Record<string, unknown>;
78
+ }
79
+ export interface InlineTemplate {
80
+ id?: string;
81
+ name: string;
82
+ labels?: InlineTemplateLabel[];
83
+ generation: {
84
+ instructions: {
85
+ prompt: string;
86
+ };
87
+ sections: InlineTemplateSection[];
88
+ };
89
+ }
90
+ export interface InteractionTemplateReference {
91
+ source: "standard" | "project";
92
+ id: string;
93
+ }
94
+ export interface DefaultInteractionTemplateOptions {
95
+ behaviour?: "fallback";
96
+ template?: InteractionTemplateReference;
97
+ allowUserSelection?: boolean;
98
+ }
99
+ export interface PersonalTemplateSectionFieldConfig {
100
+ visible?: boolean;
101
+ editable?: boolean;
102
+ }
103
+ export interface PersonalTemplateSectionFields {
104
+ heading?: {
105
+ editable?: boolean;
106
+ };
107
+ description?: {
108
+ editable?: boolean;
109
+ };
110
+ contentPrompt?: PersonalTemplateSectionFieldConfig;
111
+ writingStylePrompt?: PersonalTemplateSectionFieldConfig;
112
+ miscPrompt?: PersonalTemplateSectionFieldConfig;
113
+ outputSchema?: PersonalTemplateSectionFieldConfig;
114
+ }
115
+ export interface InteractionTemplateSources {
116
+ personal?: {
117
+ enabled?: boolean;
118
+ sectionFields?: PersonalTemplateSectionFields;
119
+ };
120
+ standard?: {
121
+ enabled?: boolean;
122
+ include?: {
123
+ regions?: string[];
124
+ families?: string[];
125
+ };
126
+ };
127
+ project?: {
128
+ enabled?: boolean;
129
+ include?: {
130
+ ids?: string[];
131
+ };
132
+ exclude?: {
133
+ ids?: string[];
134
+ };
135
+ };
136
+ }
137
+ export interface InteractionTemplateOptions {
138
+ sources?: InteractionTemplateSources;
139
+ defaultTemplate?: DefaultInteractionTemplateOptions;
140
+ }
141
+ export interface InteractionDocumentOptions {
142
+ actions?: {
143
+ sync?: boolean;
144
+ };
145
+ allowedLanguages?: string[];
146
+ maxGenerated?: number | "unlimited";
147
+ }
148
+ export interface SetInteractionOptionsPayload {
149
+ mode?: InteractionModeOptions;
150
+ spokenLanguage?: SpokenLanguageOptions;
151
+ templates?: InteractionTemplateOptions;
152
+ documents?: InteractionDocumentOptions;
153
+ }
53
154
  export interface NavigatePayload {
54
155
  path: string;
55
156
  }
@@ -1 +1 @@
1
- {"version":3,"file":"payloads.js","sourceRoot":"","sources":["../../src/types/payloads.ts"],"names":[],"mappings":"","sourcesContent":["// Payload types for embedded API requests and responses\nimport type { Corti } from \"@corti/sdk\";\n\nimport type { DefaultMode } from \"./protocol.js\";\n\n// Keycloak token structure\nexport interface KeycloakTokenResponse {\n access_token: string;\n token_type: string;\n expires_at?: number | null;\n expires_in?: number | null;\n refresh_expires_in?: number | null;\n refresh_token?: string;\n id_token?: string;\n \"not-before-policy\"?: number | null;\n session_state?: string;\n scope?: string;\n profile?: {\n name: string;\n email: string;\n sub: string;\n };\n}\n\n// Fact structure\nexport interface Fact {\n text: Corti.FactsCreateInput[\"text\"];\n group: string;\n source?: Corti.FactsCreateInput[\"source\"];\n}\n\n// Create interaction payload\nexport interface CreateInteractionPayload {\n assignedUserId?: Corti.InteractionsCreateRequest[\"assignedUserId\"] | null;\n encounter: {\n identifier: Corti.InteractionsCreateRequest[\"encounter\"][\"identifier\"];\n status: Corti.InteractionsCreateRequest[\"encounter\"][\"status\"];\n type: Corti.InteractionsCreateRequest[\"encounter\"][\"type\"];\n period: {\n startedAt: string;\n endedAt?: string;\n };\n title?: string;\n };\n patient?: {\n identifier?: Corti.InteractionsPatient[\"identifier\"];\n name?: string;\n birthDate?: string | null;\n gender?: Corti.InteractionsPatient[\"gender\"];\n };\n}\n\n// Add facts payload\nexport interface AddFactsPayload {\n facts: Fact[];\n}\n\n// Configure session payload\nexport interface ConfigureSessionPayload {\n defaultLanguage?: string;\n defaultOutputLanguage?: string;\n defaultTemplateKey?: string;\n defaultMode?: DefaultMode;\n}\n\n// Navigate payload\nexport interface NavigatePayload {\n path: string;\n}\n\n// Set credentials payload\nexport interface SetCredentialsPayload {\n password: string;\n}\n"]}
1
+ {"version":3,"file":"payloads.js","sourceRoot":"","sources":["../../src/types/payloads.ts"],"names":[],"mappings":"","sourcesContent":["// Payload types for embedded API requests and responses\nimport type { Corti } from \"@corti/sdk\";\n\nimport type { DefaultMode } from \"./protocol.js\";\n\n// Keycloak token structure\nexport interface KeycloakTokenResponse {\n access_token: string;\n token_type: string;\n expires_at?: number | null;\n expires_in?: number | null;\n refresh_expires_in?: number | null;\n refresh_token?: string;\n id_token?: string;\n \"not-before-policy\"?: number | null;\n session_state?: string;\n scope?: string;\n profile?: {\n name: string;\n email: string;\n sub: string;\n };\n}\n\nexport type DeviceLinkTokenResponse = KeycloakTokenResponse & {\n refresh_token: string;\n};\n\n// Fact structure\nexport interface Fact {\n text: Corti.FactsCreateInput[\"text\"];\n group: string;\n source?: Corti.FactsCreateInput[\"source\"];\n}\n\n// Create interaction payload\nexport interface CreateInteractionPayload {\n assignedUserId?: Corti.InteractionsCreateRequest[\"assignedUserId\"] | null;\n encounter: {\n identifier: Corti.InteractionsCreateRequest[\"encounter\"][\"identifier\"];\n status: Corti.InteractionsCreateRequest[\"encounter\"][\"status\"];\n type: Corti.InteractionsCreateRequest[\"encounter\"][\"type\"];\n period: {\n startedAt: string;\n endedAt?: string;\n };\n title?: string;\n };\n patient?: {\n identifier?: Corti.InteractionsPatient[\"identifier\"];\n name?: string;\n birthDate?: string | null;\n gender?: Corti.InteractionsPatient[\"gender\"];\n };\n}\n\n// Add facts payload\nexport interface AddFactsPayload {\n facts: Fact[];\n}\n\n// Configure session payload\nexport interface ConfigureSessionPayload {\n defaultLanguage?: string;\n defaultOutputLanguage?: string;\n defaultTemplateKey?: string;\n defaultMode?: DefaultMode;\n}\n\nexport interface InteractionModeOptions {\n fallback?: DefaultMode;\n options: DefaultMode[];\n}\n\nexport interface SpokenLanguageOptions {\n fallback?: string;\n options?: string[];\n}\n\nexport interface InlineTemplateLabel {\n key: string;\n value: string;\n}\n\nexport interface InlineTemplateSectionInstructions {\n contentPrompt: string;\n writingStylePrompt?: string;\n miscPrompt?: string;\n}\n\nexport interface InlineTemplateSection {\n heading: string;\n labels?: InlineTemplateLabel[];\n instructions: InlineTemplateSectionInstructions;\n outputSchema?: Record<string, unknown>;\n}\n\nexport interface InlineTemplate {\n id?: string;\n name: string;\n labels?: InlineTemplateLabel[];\n generation: {\n instructions: {\n prompt: string;\n };\n sections: InlineTemplateSection[];\n };\n}\n\nexport interface InteractionTemplateReference {\n source: \"standard\" | \"project\";\n id: string;\n}\n\nexport interface DefaultInteractionTemplateOptions {\n behaviour?: \"fallback\";\n template?: InteractionTemplateReference;\n allowUserSelection?: boolean;\n}\n\nexport interface PersonalTemplateSectionFieldConfig {\n visible?: boolean;\n editable?: boolean;\n}\n\nexport interface PersonalTemplateSectionFields {\n heading?: { editable?: boolean };\n description?: { editable?: boolean };\n contentPrompt?: PersonalTemplateSectionFieldConfig;\n writingStylePrompt?: PersonalTemplateSectionFieldConfig;\n miscPrompt?: PersonalTemplateSectionFieldConfig;\n outputSchema?: PersonalTemplateSectionFieldConfig;\n}\n\nexport interface InteractionTemplateSources {\n personal?: {\n enabled?: boolean;\n sectionFields?: PersonalTemplateSectionFields;\n };\n standard?: {\n enabled?: boolean;\n include?: {\n regions?: string[];\n families?: string[];\n };\n };\n project?: {\n enabled?: boolean;\n include?: {\n ids?: string[];\n };\n exclude?: {\n ids?: string[];\n };\n };\n}\n\nexport interface InteractionTemplateOptions {\n sources?: InteractionTemplateSources;\n defaultTemplate?: DefaultInteractionTemplateOptions;\n}\n\nexport interface InteractionDocumentOptions {\n actions?: {\n sync?: boolean;\n };\n allowedLanguages?: string[];\n maxGenerated?: number | \"unlimited\";\n}\n\nexport interface SetInteractionOptionsPayload {\n mode?: InteractionModeOptions;\n spokenLanguage?: SpokenLanguageOptions;\n templates?: InteractionTemplateOptions;\n documents?: InteractionDocumentOptions;\n}\n\n// Navigate payload\nexport interface NavigatePayload {\n path: string;\n}\n\n// Set credentials payload\nexport interface SetCredentialsPayload {\n password: string;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  export type APIVersion = "v1";
2
2
  export type MessageType = "CORTI_EMBEDDED" | "CORTI_EMBEDDED_RESPONSE" | "CORTI_EMBEDDED_EVENT";
3
3
  export type DefaultMode = "virtual" | "in-person";
4
- export type EmbeddedAction = "auth" | "createInteraction" | "addFacts" | "configureSession" | "navigate" | "startRecording" | "stopRecording" | "getStatus" | "getTemplates" | "configure" | "setCredentials";
4
+ export type EmbeddedAction = "auth" | "createInteraction" | "addFacts" | "configureApp" | "configureSession" | "setInteractionOptions" | "navigate" | "startRecording" | "stopRecording" | "getStatus" | "getTemplates" | "configure" | "setCredentials" | "showDeviceLinkQR";
5
5
  export type DeprecatedEmbeddedEvent = "ready" | "loaded" | "recordingStarted" | "recordingStopped" | "documentGenerated" | "documentUpdated" | "documentSynced" | "authChanged" | "interactionCreated" | "navigationChanged" | "usage";
6
6
  export interface BaseMessage {
7
7
  type: MessageType;
@@ -48,6 +48,12 @@ export interface AddFactsRequest extends EmbeddedRequest {
48
48
  export interface ConfigureSessionRequest extends EmbeddedRequest {
49
49
  action: "configureSession";
50
50
  }
51
+ export interface ConfigureAppRequest extends EmbeddedRequest {
52
+ action: "configureApp";
53
+ }
54
+ export interface SetInteractionOptionsRequest extends EmbeddedRequest {
55
+ action: "setInteractionOptions";
56
+ }
51
57
  export interface NavigateRequest extends EmbeddedRequest {
52
58
  action: "navigate";
53
59
  }
@@ -69,6 +75,9 @@ export interface ConfigureRequest extends EmbeddedRequest {
69
75
  export interface SetCredentialsRequest extends EmbeddedRequest {
70
76
  action: "setCredentials";
71
77
  }
78
+ export interface ShowDeviceLinkQRRequest extends EmbeddedRequest {
79
+ action: "showDeviceLinkQR";
80
+ }
72
81
  export interface ReadyEvent extends DeprecatedEmbeddedEventMessage {
73
82
  event: "ready";
74
83
  }
@@ -102,9 +111,9 @@ export interface NavigationChangedEvent extends DeprecatedEmbeddedEventMessage {
102
111
  export interface UsageEvent extends DeprecatedEmbeddedEventMessage {
103
112
  event: "usage";
104
113
  }
105
- export type AnyEmbeddedRequest = AuthRequest | CreateInteractionRequest | AddFactsRequest | ConfigureSessionRequest | GetTemplatesRequest | NavigateRequest | StartRecordingRequest | StopRecordingRequest | GetStatusRequest | ConfigureRequest | SetCredentialsRequest;
114
+ export type AnyEmbeddedRequest = AuthRequest | CreateInteractionRequest | AddFactsRequest | ConfigureAppRequest | ConfigureSessionRequest | GetTemplatesRequest | NavigateRequest | SetInteractionOptionsRequest | StartRecordingRequest | StopRecordingRequest | GetStatusRequest | ConfigureRequest | SetCredentialsRequest | ShowDeviceLinkQRRequest;
106
115
  export type AnyEmbeddedResponse = EmbeddedResponse;
107
116
  export type AnyDeprecatedEmbeddedEvent = ReadyEvent | LoadedEvent | RecordingStartedEvent | RecordingStoppedEvent | DocumentGeneratedEvent | DocumentUpdatedEvent | DocumentSyncedEvent | AuthChangedEvent | InteractionCreatedEvent | NavigationChangedEvent | UsageEvent;
108
117
  export type AnyEvent = EmbeddedEventMessage | AnyDeprecatedEmbeddedEvent;
109
- export type AnyEmbeddedMessage = AnyEmbeddedRequest | AnyEmbeddedResponse | AnyDeprecatedEmbeddedEvent;
118
+ export type AnyEmbeddedMessage = AnyEmbeddedRequest | AnyEmbeddedResponse | AnyEvent;
110
119
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/types/protocol.ts"],"names":[],"mappings":"AAAA,4FAA4F","sourcesContent":["// Protocol types for communication between parent applications and embedded Corti Assistant\n\nexport type APIVersion = \"v1\";\n\nexport type MessageType =\n | \"CORTI_EMBEDDED\"\n | \"CORTI_EMBEDDED_RESPONSE\"\n | \"CORTI_EMBEDDED_EVENT\";\n\nexport type DefaultMode = \"virtual\" | \"in-person\";\n\nexport type EmbeddedAction =\n | \"auth\"\n | \"createInteraction\"\n | \"addFacts\"\n | \"configureSession\"\n | \"navigate\"\n | \"startRecording\"\n | \"stopRecording\"\n | \"getStatus\"\n | \"getTemplates\"\n | \"configure\"\n | \"setCredentials\";\n\nexport type DeprecatedEmbeddedEvent =\n | \"ready\"\n | \"loaded\"\n | \"recordingStarted\"\n | \"recordingStopped\"\n | \"documentGenerated\"\n | \"documentUpdated\"\n | \"documentSynced\"\n | \"authChanged\"\n | \"interactionCreated\"\n | \"navigationChanged\"\n | \"usage\";\n\n// Base Message Types\nexport interface BaseMessage {\n type: MessageType;\n version: APIVersion;\n}\n\nexport interface EmbeddedRequest extends BaseMessage {\n type: \"CORTI_EMBEDDED\";\n action: EmbeddedAction;\n requestId: string;\n payload?: unknown;\n}\n\nexport interface EmbeddedResponse extends BaseMessage {\n type: \"CORTI_EMBEDDED_RESPONSE\";\n action: EmbeddedAction;\n requestId: string;\n success: boolean;\n payload?: unknown;\n error?: string;\n errorCode?: string;\n errorDetails?: unknown;\n}\n\ninterface BaseEventMessage extends BaseMessage {\n type: \"CORTI_EMBEDDED_EVENT\";\n event: string | DeprecatedEmbeddedEvent;\n payload?: unknown;\n}\n\nexport interface DeprecatedEmbeddedEventMessage extends BaseEventMessage {\n event: DeprecatedEmbeddedEvent;\n deprecated: true;\n}\n\nexport interface EmbeddedEventMessage extends BaseEventMessage {\n payload: null | Record<string, unknown>;\n confidential: boolean;\n}\n\n// Specific Request Types\nexport interface AuthRequest extends EmbeddedRequest {\n action: \"auth\";\n}\n\nexport interface CreateInteractionRequest extends EmbeddedRequest {\n action: \"createInteraction\";\n}\n\nexport interface AddFactsRequest extends EmbeddedRequest {\n action: \"addFacts\";\n}\n\nexport interface ConfigureSessionRequest extends EmbeddedRequest {\n action: \"configureSession\";\n}\n\nexport interface NavigateRequest extends EmbeddedRequest {\n action: \"navigate\";\n}\n\nexport interface StartRecordingRequest extends EmbeddedRequest {\n action: \"startRecording\";\n}\n\nexport interface StopRecordingRequest extends EmbeddedRequest {\n action: \"stopRecording\";\n}\n\nexport interface GetStatusRequest extends EmbeddedRequest {\n action: \"getStatus\";\n}\n\nexport interface GetTemplatesRequest extends EmbeddedRequest {\n action: \"getTemplates\";\n}\n\nexport interface ConfigureRequest extends EmbeddedRequest {\n action: \"configure\";\n}\n\nexport interface SetCredentialsRequest extends EmbeddedRequest {\n action: \"setCredentials\";\n}\n\n// Event Types\nexport interface ReadyEvent extends DeprecatedEmbeddedEventMessage {\n event: \"ready\";\n}\n\nexport interface LoadedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"loaded\";\n}\n\nexport interface RecordingStartedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"recordingStarted\";\n}\n\nexport interface RecordingStoppedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"recordingStopped\";\n}\n\nexport interface DocumentGeneratedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"documentGenerated\";\n}\n\nexport interface DocumentUpdatedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"documentUpdated\";\n}\n\nexport interface DocumentSyncedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"documentSynced\";\n}\n\nexport interface AuthChangedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"authChanged\";\n}\n\nexport interface InteractionCreatedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"interactionCreated\";\n}\n\nexport interface NavigationChangedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"navigationChanged\";\n}\n\nexport interface UsageEvent extends DeprecatedEmbeddedEventMessage {\n event: \"usage\";\n}\n\n// Request/Response/Event type unions\nexport type AnyEmbeddedRequest =\n | AuthRequest\n | CreateInteractionRequest\n | AddFactsRequest\n | ConfigureSessionRequest\n | GetTemplatesRequest\n | NavigateRequest\n | StartRecordingRequest\n | StopRecordingRequest\n | GetStatusRequest\n | ConfigureRequest\n | SetCredentialsRequest;\n\nexport type AnyEmbeddedResponse = EmbeddedResponse;\n\nexport type AnyDeprecatedEmbeddedEvent =\n | ReadyEvent\n | LoadedEvent\n | RecordingStartedEvent\n | RecordingStoppedEvent\n | DocumentGeneratedEvent\n | DocumentUpdatedEvent\n | DocumentSyncedEvent\n | AuthChangedEvent\n | InteractionCreatedEvent\n | NavigationChangedEvent\n | UsageEvent;\n\nexport type AnyEvent = EmbeddedEventMessage | AnyDeprecatedEmbeddedEvent;\n\nexport type AnyEmbeddedMessage =\n | AnyEmbeddedRequest\n | AnyEmbeddedResponse\n | AnyDeprecatedEmbeddedEvent;\n"]}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/types/protocol.ts"],"names":[],"mappings":"AAAA,4FAA4F","sourcesContent":["// Protocol types for communication between parent applications and embedded Corti Assistant\n\nexport type APIVersion = \"v1\";\n\nexport type MessageType =\n | \"CORTI_EMBEDDED\"\n | \"CORTI_EMBEDDED_RESPONSE\"\n | \"CORTI_EMBEDDED_EVENT\";\n\nexport type DefaultMode = \"virtual\" | \"in-person\";\n\nexport type EmbeddedAction =\n | \"auth\"\n | \"createInteraction\"\n | \"addFacts\"\n | \"configureApp\"\n | \"configureSession\"\n | \"setInteractionOptions\"\n | \"navigate\"\n | \"startRecording\"\n | \"stopRecording\"\n | \"getStatus\"\n | \"getTemplates\"\n | \"configure\"\n | \"setCredentials\"\n | \"showDeviceLinkQR\";\n\nexport type DeprecatedEmbeddedEvent =\n | \"ready\"\n | \"loaded\"\n | \"recordingStarted\"\n | \"recordingStopped\"\n | \"documentGenerated\"\n | \"documentUpdated\"\n | \"documentSynced\"\n | \"authChanged\"\n | \"interactionCreated\"\n | \"navigationChanged\"\n | \"usage\";\n\n// Base Message Types\nexport interface BaseMessage {\n type: MessageType;\n version: APIVersion;\n}\n\nexport interface EmbeddedRequest extends BaseMessage {\n type: \"CORTI_EMBEDDED\";\n action: EmbeddedAction;\n requestId: string;\n payload?: unknown;\n}\n\nexport interface EmbeddedResponse extends BaseMessage {\n type: \"CORTI_EMBEDDED_RESPONSE\";\n action: EmbeddedAction;\n requestId: string;\n success: boolean;\n payload?: unknown;\n error?: string;\n errorCode?: string;\n errorDetails?: unknown;\n}\n\ninterface BaseEventMessage extends BaseMessage {\n type: \"CORTI_EMBEDDED_EVENT\";\n event: string | DeprecatedEmbeddedEvent;\n payload?: unknown;\n}\n\nexport interface DeprecatedEmbeddedEventMessage extends BaseEventMessage {\n event: DeprecatedEmbeddedEvent;\n deprecated: true;\n}\n\nexport interface EmbeddedEventMessage extends BaseEventMessage {\n payload: null | Record<string, unknown>;\n confidential: boolean;\n}\n\n// Specific Request Types\nexport interface AuthRequest extends EmbeddedRequest {\n action: \"auth\";\n}\n\nexport interface CreateInteractionRequest extends EmbeddedRequest {\n action: \"createInteraction\";\n}\n\nexport interface AddFactsRequest extends EmbeddedRequest {\n action: \"addFacts\";\n}\n\nexport interface ConfigureSessionRequest extends EmbeddedRequest {\n action: \"configureSession\";\n}\n\nexport interface ConfigureAppRequest extends EmbeddedRequest {\n action: \"configureApp\";\n}\n\nexport interface SetInteractionOptionsRequest extends EmbeddedRequest {\n action: \"setInteractionOptions\";\n}\n\nexport interface NavigateRequest extends EmbeddedRequest {\n action: \"navigate\";\n}\n\nexport interface StartRecordingRequest extends EmbeddedRequest {\n action: \"startRecording\";\n}\n\nexport interface StopRecordingRequest extends EmbeddedRequest {\n action: \"stopRecording\";\n}\n\nexport interface GetStatusRequest extends EmbeddedRequest {\n action: \"getStatus\";\n}\n\nexport interface GetTemplatesRequest extends EmbeddedRequest {\n action: \"getTemplates\";\n}\n\nexport interface ConfigureRequest extends EmbeddedRequest {\n action: \"configure\";\n}\n\nexport interface SetCredentialsRequest extends EmbeddedRequest {\n action: \"setCredentials\";\n}\n\nexport interface ShowDeviceLinkQRRequest extends EmbeddedRequest {\n action: \"showDeviceLinkQR\";\n}\n\n// Event Types\nexport interface ReadyEvent extends DeprecatedEmbeddedEventMessage {\n event: \"ready\";\n}\n\nexport interface LoadedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"loaded\";\n}\n\nexport interface RecordingStartedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"recordingStarted\";\n}\n\nexport interface RecordingStoppedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"recordingStopped\";\n}\n\nexport interface DocumentGeneratedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"documentGenerated\";\n}\n\nexport interface DocumentUpdatedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"documentUpdated\";\n}\n\nexport interface DocumentSyncedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"documentSynced\";\n}\n\nexport interface AuthChangedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"authChanged\";\n}\n\nexport interface InteractionCreatedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"interactionCreated\";\n}\n\nexport interface NavigationChangedEvent extends DeprecatedEmbeddedEventMessage {\n event: \"navigationChanged\";\n}\n\nexport interface UsageEvent extends DeprecatedEmbeddedEventMessage {\n event: \"usage\";\n}\n\n// Request/Response/Event type unions\nexport type AnyEmbeddedRequest =\n | AuthRequest\n | CreateInteractionRequest\n | AddFactsRequest\n | ConfigureAppRequest\n | ConfigureSessionRequest\n | GetTemplatesRequest\n | NavigateRequest\n | SetInteractionOptionsRequest\n | StartRecordingRequest\n | StopRecordingRequest\n | GetStatusRequest\n | ConfigureRequest\n | SetCredentialsRequest\n | ShowDeviceLinkQRRequest;\n\nexport type AnyEmbeddedResponse = EmbeddedResponse;\n\nexport type AnyDeprecatedEmbeddedEvent =\n | ReadyEvent\n | LoadedEvent\n | RecordingStartedEvent\n | RecordingStoppedEvent\n | DocumentGeneratedEvent\n | DocumentUpdatedEvent\n | DocumentSyncedEvent\n | AuthChangedEvent\n | InteractionCreatedEvent\n | NavigationChangedEvent\n | UsageEvent;\n\nexport type AnyEvent = EmbeddedEventMessage | AnyDeprecatedEmbeddedEvent;\n\nexport type AnyEmbeddedMessage =\n | AnyEmbeddedRequest\n | AnyEmbeddedResponse\n | AnyEvent;\n"]}
@@ -1,4 +1,4 @@
1
- import type { AppearanceConfig, FeaturesConfig, LocaleConfig, NetworkConfig } from "./config.js";
1
+ import type { AppearanceConfig, CompanionAppConfig, ConfigureFeaturesConfig, LocaleConfig, NetworkConfig, UIConfig } from "./config.js";
2
2
  import type { EmbeddedInterviewDetails } from "./generated/interview-details.js";
3
3
  export interface UserInfo {
4
4
  id: string;
@@ -18,12 +18,20 @@ export interface EmbeddedTemplate {
18
18
  id: string;
19
19
  name: string;
20
20
  description?: string;
21
+ templateType?: "built-in" | "custom" | "schema-driven";
21
22
  language: {
22
23
  code: string;
23
24
  name: string;
24
25
  locale?: string;
26
+ localName?: string;
25
27
  };
26
- sections: Array<{
28
+ outputLanguages?: Array<{
29
+ code: string;
30
+ name: string;
31
+ locale?: string;
32
+ hasPreview: boolean;
33
+ }>;
34
+ sections?: Array<{
27
35
  id: string;
28
36
  title: string;
29
37
  }>;
@@ -40,9 +48,21 @@ export interface GetStatusResponse {
40
48
  export interface GetTemplatesResponse {
41
49
  templates: EmbeddedTemplate[];
42
50
  }
51
+ export interface ConfigureResponse {
52
+ debug?: boolean;
53
+ appearance: AppearanceConfig;
54
+ features: ConfigureFeaturesConfig;
55
+ locale: LocaleConfig;
56
+ network: NetworkConfig;
57
+ }
43
58
  export interface ConfigureAppResponse {
59
+ debug?: boolean;
44
60
  appearance: AppearanceConfig;
45
- features: FeaturesConfig;
61
+ ui: UIConfig;
62
+ companionApp: CompanionAppConfig;
46
63
  locale: LocaleConfig;
47
64
  network: NetworkConfig;
48
65
  }
66
+ export interface ShowDeviceLinkQRResponse {
67
+ status: "approved" | "denied" | "expired" | "dismissed";
68
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/types/responses.ts"],"names":[],"mappings":"AAAA,kCAAkC","sourcesContent":["// Response types for embedded API\n\nimport type { AppearanceConfig, FeaturesConfig, LocaleConfig, NetworkConfig } from \"./config.js\";\nimport type { EmbeddedInterviewDetails } from \"./generated/interview-details.js\";\n\nexport interface UserInfo {\n id: string;\n email: string;\n name?: string;\n [key: string]: unknown;\n}\n\nexport interface AuthResponse {\n user: UserInfo;\n}\n\nexport interface CreateInteractionResponse {\n id: string;\n createdAt: string;\n status?: string;\n}\n\nexport interface EmbeddedTemplate {\n id: string;\n name: string;\n description?: string;\n language: {\n code: string;\n name: string;\n locale?: string;\n };\n sections: Array<{\n id: string;\n title: string;\n }>;\n isCustom: boolean;\n}\n\nexport interface GetStatusResponse {\n auth: {\n isAuthenticated: boolean;\n user?: UserInfo;\n };\n currentUrl: string;\n interaction: EmbeddedInterviewDetails | null;\n}\n\nexport interface GetTemplatesResponse {\n templates: EmbeddedTemplate[];\n}\n\nexport interface ConfigureAppResponse {\n appearance: AppearanceConfig;\n features: FeaturesConfig;\n locale: LocaleConfig;\n network: NetworkConfig;\n}\n"]}
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/types/responses.ts"],"names":[],"mappings":"AAAA,kCAAkC","sourcesContent":["// Response types for embedded API\n\nimport type {\n AppearanceConfig,\n CompanionAppConfig,\n ConfigureFeaturesConfig,\n LocaleConfig,\n NetworkConfig,\n UIConfig,\n} from \"./config.js\";\nimport type { EmbeddedInterviewDetails } from \"./generated/interview-details.js\";\n\nexport interface UserInfo {\n id: string;\n email: string;\n name?: string;\n [key: string]: unknown;\n}\n\nexport interface AuthResponse {\n user: UserInfo;\n}\n\nexport interface CreateInteractionResponse {\n id: string;\n createdAt: string;\n status?: string;\n}\n\nexport interface EmbeddedTemplate {\n id: string;\n name: string;\n description?: string;\n templateType?: \"built-in\" | \"custom\" | \"schema-driven\";\n language: {\n code: string;\n name: string;\n locale?: string;\n localName?: string;\n };\n outputLanguages?: Array<{\n code: string;\n name: string;\n locale?: string;\n hasPreview: boolean;\n }>;\n sections?: Array<{\n id: string;\n title: string;\n }>;\n isCustom: boolean;\n}\n\nexport interface GetStatusResponse {\n auth: {\n isAuthenticated: boolean;\n user?: UserInfo;\n };\n currentUrl: string;\n interaction: EmbeddedInterviewDetails | null;\n}\n\nexport interface GetTemplatesResponse {\n templates: EmbeddedTemplate[];\n}\n\nexport interface ConfigureResponse {\n debug?: boolean;\n appearance: AppearanceConfig;\n features: ConfigureFeaturesConfig;\n locale: LocaleConfig;\n network: NetworkConfig;\n}\n\nexport interface ConfigureAppResponse {\n debug?: boolean;\n appearance: AppearanceConfig;\n ui: UIConfig;\n companionApp: CompanionAppConfig;\n locale: LocaleConfig;\n network: NetworkConfig;\n}\n\nexport interface ShowDeviceLinkQRResponse {\n status: \"approved\" | \"denied\" | \"expired\" | \"dismissed\";\n}\n"]}