@marketrix.ai/widget 4.0.107 → 4.0.109

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.
@@ -67,11 +67,11 @@ export interface LayoutProps {
67
67
  minWidth?: '0';
68
68
  minHeight?: '0';
69
69
  border?: boolean | keyof typeof BORDER_SIDE;
70
- rounded?: boolean | RadiusToken;
71
- animate?: 'spin' | 'ping' | 'pulse' | 'fadeIn' | 'none';
72
- hidden?: boolean;
70
+ rounded?: boolean | RadiusToken | undefined;
71
+ animate?: 'spin' | 'ping' | 'pulse' | 'fadeIn' | 'none' | undefined;
72
+ hidden?: boolean | undefined;
73
73
  as?: ElementType;
74
- style?: CSSProperties;
74
+ style?: CSSProperties | undefined;
75
75
  }
76
76
  export declare function resolveLayoutStyle(props: LayoutProps): CSSProperties;
77
77
  export declare function stripLayoutProps<T extends LayoutProps>(props: T): Omit<T, keyof LayoutProps>;
@@ -6,10 +6,10 @@ export interface NotificationProviderProps {
6
6
  }
7
7
  export declare const NotificationProvider: React.FC<NotificationProviderProps>;
8
8
  export interface WidgetNotificationsProps {
9
- error?: string;
9
+ error?: string | undefined;
10
10
  onClearError: () => void;
11
- onRetry?: () => void;
12
- greeting?: string;
11
+ onRetry?: (() => void) | undefined;
12
+ greeting?: string | undefined;
13
13
  greetingBody?: string;
14
14
  onGreetingDismiss: () => void;
15
15
  }
@@ -9,7 +9,7 @@ export interface UIState {
9
9
  isOpen: boolean;
10
10
  activeView: WidgetView;
11
11
  currentMode: InstructionType;
12
- error?: string;
12
+ error?: string | undefined;
13
13
  }
14
14
  interface UIStateActions {
15
15
  setActiveView: (view: WidgetView) => void;
@@ -21,5 +21,5 @@
21
21
  */
22
22
  export declare function useFocusTrap(containerRef: React.RefObject<HTMLElement | null>, isActive: boolean, options?: {
23
23
  onEscape?: () => void;
24
- focusTargetRef?: React.RefObject<HTMLElement | null>;
24
+ focusTargetRef?: React.RefObject<HTMLElement | null> | undefined;
25
25
  }): void;
@@ -22,7 +22,7 @@ declare global {
22
22
  interface Window {
23
23
  __mtx?: {
24
24
  state?: 'initializing' | 'active';
25
- };
25
+ } | undefined;
26
26
  }
27
27
  }
28
28
  import React from 'react';
@@ -169,7 +169,7 @@ export declare const widgetContract: {
169
169
  error: string;
170
170
  } | {
171
171
  type: "task/status";
172
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
172
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
173
173
  message?: string | undefined;
174
174
  } | {
175
175
  type: "tool/call";
@@ -197,7 +197,7 @@ export declare const widgetContract: {
197
197
  error: string;
198
198
  } | {
199
199
  type: "task/status";
200
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
200
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
201
201
  message?: string | undefined;
202
202
  } | {
203
203
  type: "tool/call";
@@ -0,0 +1,217 @@
1
+ /**
2
+ * `ActivityMetadataByType` — the strict, per-`ActivityLogType` shape of `activity_log.metadata`, the
3
+ * one write-time gate `models/columnSchemas.ts` registers against the column. Moved out of that file
4
+ * so `contracts/entities.ts` can import it to type `ActivityLogEntitySchema.metadata` precisely
5
+ * (a union of every branch) instead of the open `.passthrough()` it carried before — deriving from a
6
+ * registry that lived inside `models/columnSchemas.ts`, which itself imports from `entities.ts`,
7
+ * would have cycled.
8
+ *
9
+ * `slack_command`'s `status` imports `SlackCommandLogStatusSchema` from `./activityLogVocabulary` —
10
+ * the one home `tests/unit/contractEnumHomes.test.ts` requires for that value set — a dependency-free
11
+ * leaf, so this registry (and everything importing it through `entities.ts`) never pulls in
12
+ * `contracts/slack.ts`'s `@orpc/contract` import.
13
+ */
14
+ import { z } from 'zod';
15
+ export declare const ActivityMetadataByType: {
16
+ update_workspace: z.ZodObject<{
17
+ details: z.ZodString;
18
+ }, z.core.$strict>;
19
+ update_user: z.ZodUnion<readonly [z.ZodObject<{
20
+ target_user_id: z.ZodNumber;
21
+ target_user_email: z.ZodString;
22
+ reason: z.ZodString;
23
+ details: z.ZodString;
24
+ }, z.core.$strict>, z.ZodObject<{
25
+ target_user_id: z.ZodNumber;
26
+ details: z.ZodString;
27
+ }, z.core.$strict>]>;
28
+ create_application: z.ZodObject<{
29
+ id: z.ZodNumber;
30
+ name: z.ZodString;
31
+ type: z.ZodEnum<{
32
+ app: "app";
33
+ website: "website";
34
+ }>;
35
+ }, z.core.$strict>;
36
+ update_application: z.ZodObject<{
37
+ id: z.ZodNumber;
38
+ name: z.ZodString;
39
+ type: z.ZodEnum<{
40
+ app: "app";
41
+ website: "website";
42
+ }>;
43
+ }, z.core.$strict>;
44
+ delete_application: z.ZodObject<{
45
+ id: z.ZodNumber;
46
+ name: z.ZodString;
47
+ type: z.ZodEnum<{
48
+ app: "app";
49
+ website: "website";
50
+ }>;
51
+ }, z.core.$strict>;
52
+ create_widget: z.ZodObject<{
53
+ application_id: z.ZodNumber;
54
+ widget_type: z.ZodEnum<{
55
+ widget: "widget";
56
+ }>;
57
+ details: z.ZodString;
58
+ }, z.core.$strict>;
59
+ update_widget: z.ZodObject<{
60
+ application_id: z.ZodNumber;
61
+ widget_type: z.ZodEnum<{
62
+ widget: "widget";
63
+ }>;
64
+ details: z.ZodString;
65
+ }, z.core.$strict>;
66
+ delete_widget: z.ZodObject<{
67
+ application_id: z.ZodNumber;
68
+ widget_type: z.ZodEnum<{
69
+ widget: "widget";
70
+ }>;
71
+ details: z.ZodString;
72
+ }, z.core.$strict>;
73
+ create_knowledge: z.ZodObject<{
74
+ application_id: z.ZodNumber;
75
+ file_name: z.ZodString;
76
+ file_size: z.ZodNumber;
77
+ file_type: z.ZodString;
78
+ file_url: z.ZodString;
79
+ source_url: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strict>;
81
+ update_knowledge: z.ZodObject<{
82
+ id: z.ZodNumber;
83
+ file_name: z.ZodString;
84
+ source_url: z.ZodString;
85
+ action: z.ZodLiteral<"refreshed">;
86
+ }, z.core.$strict>;
87
+ delete_knowledge: z.ZodObject<{
88
+ id: z.ZodNumber;
89
+ file_name: z.ZodString;
90
+ file_type: z.ZodString;
91
+ }, z.core.$strict>;
92
+ request_membership: z.ZodObject<{
93
+ target_user_email: z.ZodString;
94
+ reminder: z.ZodOptional<z.ZodLiteral<true>>;
95
+ details: z.ZodString;
96
+ }, z.core.$strict>;
97
+ invite_user: z.ZodObject<{
98
+ target_user_email: z.ZodString;
99
+ details: z.ZodString;
100
+ }, z.core.$strict>;
101
+ create_workspace: z.ZodObject<{
102
+ slug: z.ZodString;
103
+ details: z.ZodString;
104
+ }, z.core.$strict>;
105
+ trial_started: z.ZodObject<{
106
+ subscription_id: z.ZodString;
107
+ plan: z.ZodOptional<z.ZodString>;
108
+ details: z.ZodString;
109
+ }, z.core.$strict>;
110
+ trial_ending_soon: z.ZodObject<{
111
+ subscription_id: z.ZodString;
112
+ plan: z.ZodOptional<z.ZodString>;
113
+ details: z.ZodString;
114
+ }, z.core.$strict>;
115
+ trial_ended: z.ZodObject<{
116
+ subscription_id: z.ZodString;
117
+ plan: z.ZodOptional<z.ZodString>;
118
+ details: z.ZodString;
119
+ }, z.core.$strict>;
120
+ subscription_created: z.ZodObject<{
121
+ subscription_id: z.ZodString;
122
+ plan: z.ZodOptional<z.ZodString>;
123
+ details: z.ZodString;
124
+ }, z.core.$strict>;
125
+ subscription_canceled: z.ZodObject<{
126
+ subscription_id: z.ZodString;
127
+ plan: z.ZodOptional<z.ZodString>;
128
+ details: z.ZodString;
129
+ }, z.core.$strict>;
130
+ plan_changed: z.ZodObject<{
131
+ session_id: z.ZodString;
132
+ plan: z.ZodOptional<z.ZodString>;
133
+ details: z.ZodString;
134
+ }, z.core.$strict>;
135
+ payment_succeeded: z.ZodObject<{
136
+ invoice_id: z.ZodString;
137
+ plan: z.ZodOptional<z.ZodString>;
138
+ details: z.ZodString;
139
+ }, z.core.$strict>;
140
+ payment_failed: z.ZodObject<{
141
+ invoice_id: z.ZodString;
142
+ plan: z.ZodOptional<z.ZodString>;
143
+ details: z.ZodString;
144
+ }, z.core.$strict>;
145
+ widget_question: z.ZodObject<{
146
+ application_id: z.ZodNumber;
147
+ chat_id: z.ZodString;
148
+ mode: z.ZodString;
149
+ question: z.ZodString;
150
+ timestamp: z.ZodString;
151
+ user_id: z.ZodOptional<z.ZodNumber>;
152
+ }, z.core.$strict>;
153
+ start_simulation: z.ZodObject<{
154
+ application_id: z.ZodNumber;
155
+ simulation_id: z.ZodNumber;
156
+ }, z.core.$strict>;
157
+ create_workflow: z.ZodObject<{
158
+ id: z.ZodNumber;
159
+ name: z.ZodString;
160
+ details: z.ZodString;
161
+ }, z.core.$strict>;
162
+ update_workflow: z.ZodObject<{
163
+ id: z.ZodNumber;
164
+ name: z.ZodString;
165
+ details: z.ZodString;
166
+ }, z.core.$strict>;
167
+ delete_workflow: z.ZodObject<{
168
+ id: z.ZodNumber;
169
+ name: z.ZodString;
170
+ details: z.ZodString;
171
+ }, z.core.$strict>;
172
+ toggle_workflow: z.ZodObject<{
173
+ enabled: z.ZodBoolean;
174
+ id: z.ZodNumber;
175
+ name: z.ZodString;
176
+ details: z.ZodString;
177
+ }, z.core.$strict>;
178
+ slack_command: z.ZodObject<{
179
+ slack_user_id: z.ZodString;
180
+ slack_channel_id: z.ZodNullable<z.ZodString>;
181
+ raw_text: z.ZodString;
182
+ detected_intent: z.ZodString;
183
+ extracted_params: z.ZodObject<{
184
+ qaFlowId: z.ZodOptional<z.ZodNumber>;
185
+ appId: z.ZodOptional<z.ZodNumber>;
186
+ instructions: z.ZodOptional<z.ZodString>;
187
+ query: z.ZodOptional<z.ZodString>;
188
+ channel: z.ZodOptional<z.ZodString>;
189
+ text: z.ZodOptional<z.ZodString>;
190
+ name: z.ZodOptional<z.ZodString>;
191
+ workflowName: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strict>;
193
+ status: z.ZodEnum<{
194
+ received: "received";
195
+ classifying: "classifying";
196
+ dispatched: "dispatched";
197
+ completed: "completed";
198
+ failed: "failed";
199
+ }>;
200
+ response_text: z.ZodNullable<z.ZodString>;
201
+ error_message: z.ZodNullable<z.ZodString>;
202
+ duration_ms: z.ZodNullable<z.ZodNumber>;
203
+ }, z.core.$strict>;
204
+ publish_survey: z.ZodObject<{
205
+ survey_id: z.ZodNumber;
206
+ details: z.ZodString;
207
+ }, z.core.$strict>;
208
+ unpublish_survey: z.ZodObject<{
209
+ survey_id: z.ZodNumber;
210
+ details: z.ZodString;
211
+ }, z.core.$strict>;
212
+ delete_survey_response: z.ZodObject<{
213
+ survey_id: z.ZodNumber;
214
+ details: z.ZodString;
215
+ }, z.core.$strict>;
216
+ };
217
+ export type SlackCommandMetadata = z.infer<typeof ActivityMetadataByType.slack_command>;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The four closed vocabularies an activity-log row's shape is keyed on — `type` (what happened),
3
+ * the two enums that ride INSIDE some per-type metadata shapes (`ApplicationTypeSchema`,
4
+ * `WidgetTypeSchema`), and `SlackCommandLogStatusSchema` (the `slack_command` metadata's `status`,
5
+ * and `contracts/slack.ts`'s command-log entity status — one home per `tests/unit/contractEnumHomes.test.ts`).
6
+ * Split out of `contracts/entities.ts` into this dependency-free leaf — no `@orpc/contract` import —
7
+ * so `contracts/activityLogMetadata.ts`'s per-type registry can import them without cycling back
8
+ * through `entities.ts`, which needs the registry to type `ActivityLogEntitySchema.metadata`
9
+ * precisely instead of `.passthrough()`, and so an audience that never touches oRPC contract routes
10
+ * (the internal/monitor mirror) doesn't pull `@orpc/contract` in through the metadata registry.
11
+ * `entities.ts` re-exports the first three (unchanged); `SlackCommandLogStatusSchema` is new here and
12
+ * has no `entities.ts` re-export since nothing imported it from there before.
13
+ */
14
+ import { z } from 'zod';
15
+ export declare const ApplicationTypeSchema: z.ZodEnum<{
16
+ app: "app";
17
+ website: "website";
18
+ }>;
19
+ export type ApplicationType = z.infer<typeof ApplicationTypeSchema>;
20
+ export declare const WidgetTypeSchema: z.ZodEnum<{
21
+ widget: "widget";
22
+ }>;
23
+ export type WidgetType = z.infer<typeof WidgetTypeSchema>;
24
+ export declare const ActivityLogTypeSchema: z.ZodEnum<{
25
+ update_workspace: "update_workspace";
26
+ update_user: "update_user";
27
+ create_application: "create_application";
28
+ update_application: "update_application";
29
+ delete_application: "delete_application";
30
+ create_widget: "create_widget";
31
+ update_widget: "update_widget";
32
+ delete_widget: "delete_widget";
33
+ create_knowledge: "create_knowledge";
34
+ update_knowledge: "update_knowledge";
35
+ delete_knowledge: "delete_knowledge";
36
+ request_membership: "request_membership";
37
+ invite_user: "invite_user";
38
+ create_workspace: "create_workspace";
39
+ trial_started: "trial_started";
40
+ trial_ending_soon: "trial_ending_soon";
41
+ trial_ended: "trial_ended";
42
+ subscription_created: "subscription_created";
43
+ subscription_canceled: "subscription_canceled";
44
+ plan_changed: "plan_changed";
45
+ payment_succeeded: "payment_succeeded";
46
+ payment_failed: "payment_failed";
47
+ widget_question: "widget_question";
48
+ start_simulation: "start_simulation";
49
+ create_workflow: "create_workflow";
50
+ update_workflow: "update_workflow";
51
+ delete_workflow: "delete_workflow";
52
+ toggle_workflow: "toggle_workflow";
53
+ slack_command: "slack_command";
54
+ publish_survey: "publish_survey";
55
+ unpublish_survey: "unpublish_survey";
56
+ delete_survey_response: "delete_survey_response";
57
+ }>;
58
+ export type ActivityLogType = z.infer<typeof ActivityLogTypeSchema>;
59
+ export declare const SlackCommandLogStatusSchema: z.ZodEnum<{
60
+ received: "received";
61
+ classifying: "classifying";
62
+ dispatched: "dispatched";
63
+ completed: "completed";
64
+ failed: "failed";
65
+ }>;
66
+ export type SlackCommandLogStatus = z.infer<typeof SlackCommandLogStatusSchema>;
@@ -1,4 +1,7 @@
1
1
  import { z } from 'zod';
2
+ import { type ActivityLogType, ActivityLogTypeSchema, type ApplicationType, ApplicationTypeSchema, type WidgetType, WidgetTypeSchema } from './activityLogVocabulary';
3
+ export { ActivityLogTypeSchema, ApplicationTypeSchema, WidgetTypeSchema };
4
+ export type { ActivityLogType, ApplicationType, WidgetType };
2
5
  export declare const WorkspacePackageSchema: z.ZodEnum<{
3
6
  free: "free";
4
7
  startup: "startup";
@@ -27,15 +30,6 @@ export declare const RevenueStatusSchema: z.ZodEnum<{
27
30
  zero: "zero";
28
31
  }>;
29
32
  export type RevenueStatus = z.infer<typeof RevenueStatusSchema>;
30
- export declare const ApplicationTypeSchema: z.ZodEnum<{
31
- app: "app";
32
- website: "website";
33
- }>;
34
- export type ApplicationType = z.infer<typeof ApplicationTypeSchema>;
35
- export declare const WidgetTypeSchema: z.ZodEnum<{
36
- widget: "widget";
37
- }>;
38
- export type WidgetType = z.infer<typeof WidgetTypeSchema>;
39
33
  export declare const InstructionTypeSchema: z.ZodEnum<{
40
34
  tell: "tell";
41
35
  show: "show";
@@ -63,7 +57,7 @@ export declare const UserEntitySchema: z.ZodObject<{
63
57
  suspended: "suspended";
64
58
  }>;
65
59
  email: z.ZodEmail;
66
- external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ external_id: z.ZodString;
67
61
  first_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
62
  last_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
63
  image_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -79,12 +73,12 @@ export declare const UserEntitySchema: z.ZodObject<{
79
73
  }, z.core.$strip>;
80
74
  export declare const UserSummarySchema: z.ZodObject<{
81
75
  id: z.ZodNumber;
82
- is_super: z.ZodBoolean;
83
76
  status: z.ZodEnum<{
84
77
  created: "created";
85
78
  active: "active";
86
79
  suspended: "suspended";
87
80
  }>;
81
+ is_super: z.ZodBoolean;
88
82
  email: z.ZodEmail;
89
83
  first_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
84
  last_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -368,51 +362,10 @@ export declare const WidgetPublicSchema: z.ZodObject<{
368
362
  }, z.core.$strip>;
369
363
  }, z.core.$strip>;
370
364
  export type WidgetPublicData = z.infer<typeof WidgetPublicSchema>;
371
- export declare const ActivityLogTypeSchema: z.ZodEnum<{
372
- update_workspace: "update_workspace";
373
- update_user: "update_user";
374
- create_application: "create_application";
375
- update_application: "update_application";
376
- delete_application: "delete_application";
377
- create_widget: "create_widget";
378
- update_widget: "update_widget";
379
- delete_widget: "delete_widget";
380
- create_knowledge: "create_knowledge";
381
- update_knowledge: "update_knowledge";
382
- delete_knowledge: "delete_knowledge";
383
- request_membership: "request_membership";
384
- invite_user: "invite_user";
385
- create_workspace: "create_workspace";
386
- trial_started: "trial_started";
387
- trial_ending_soon: "trial_ending_soon";
388
- trial_ended: "trial_ended";
389
- subscription_created: "subscription_created";
390
- subscription_canceled: "subscription_canceled";
391
- plan_changed: "plan_changed";
392
- payment_succeeded: "payment_succeeded";
393
- payment_failed: "payment_failed";
394
- widget_question: "widget_question";
395
- start_simulation: "start_simulation";
396
- create_workflow: "create_workflow";
397
- update_workflow: "update_workflow";
398
- delete_workflow: "delete_workflow";
399
- toggle_workflow: "toggle_workflow";
400
- slack_command: "slack_command";
401
- publish_survey: "publish_survey";
402
- unpublish_survey: "unpublish_survey";
403
- delete_survey_response: "delete_survey_response";
404
- }>;
405
- export type ActivityLogType = z.infer<typeof ActivityLogTypeSchema>;
406
- export declare const ActivityLogMetadataSchema: z.ZodObject<{
407
- details: z.ZodOptional<z.ZodString>;
408
- id: z.ZodOptional<z.ZodNumber>;
409
- type: z.ZodOptional<z.ZodString>;
410
- name: z.ZodOptional<z.ZodString>;
411
- }, z.core.$loose>;
365
+ export declare const ActivityLogMetadataSchema: z.ZodUnion<[z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, ...z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[]]>;
412
366
  export declare const ActivityLogEntitySchema: z.ZodObject<{
413
367
  id: z.ZodNumber;
414
368
  created_at: z.ZodCoercedDate<unknown>;
415
- updated_at: z.ZodCoercedDate<unknown>;
416
369
  workspace_id: z.ZodNumber;
417
370
  user_id: z.ZodNullable<z.ZodNumber>;
418
371
  type: z.ZodEnum<{
@@ -449,12 +402,7 @@ export declare const ActivityLogEntitySchema: z.ZodObject<{
449
402
  unpublish_survey: "unpublish_survey";
450
403
  delete_survey_response: "delete_survey_response";
451
404
  }>;
452
- metadata: z.ZodOptional<z.ZodObject<{
453
- details: z.ZodOptional<z.ZodString>;
454
- id: z.ZodOptional<z.ZodNumber>;
455
- type: z.ZodOptional<z.ZodString>;
456
- name: z.ZodOptional<z.ZodString>;
457
- }, z.core.$loose>>;
405
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, ...z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[]]>>>;
458
406
  }, z.core.$strip>;
459
407
  export type ActivityLogData = z.infer<typeof ActivityLogEntitySchema>;
460
408
  export declare const WidgetQuestionLogSchema: z.ZodObject<{
@@ -122,9 +122,9 @@ export declare const WidgetEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
122
  }, z.core.$strip>, z.ZodObject<{
123
123
  type: z.ZodLiteral<"task/status">;
124
124
  status: z.ZodEnum<{
125
- running: "running";
126
125
  completed: "completed";
127
126
  failed: "failed";
127
+ running: "running";
128
128
  stopped: "stopped";
129
129
  has_question: "has_question";
130
130
  }>;
@@ -593,7 +593,7 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
593
593
  error: string;
594
594
  } | {
595
595
  type: "task/status";
596
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
596
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
597
597
  message?: string | undefined;
598
598
  } | {
599
599
  type: "tool/call";
@@ -621,7 +621,7 @@ export declare const widgetStream: import("@orpc/contract").ContractProcedureBui
621
621
  error: string;
622
622
  } | {
623
623
  type: "task/status";
624
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
624
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
625
625
  message?: string | undefined;
626
626
  } | {
627
627
  type: "tool/call";
@@ -1088,7 +1088,7 @@ export declare const widgetRoutes: {
1088
1088
  error: string;
1089
1089
  } | {
1090
1090
  type: "task/status";
1091
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
1091
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
1092
1092
  message?: string | undefined;
1093
1093
  } | {
1094
1094
  type: "tool/call";
@@ -1116,7 +1116,7 @@ export declare const widgetRoutes: {
1116
1116
  error: string;
1117
1117
  } | {
1118
1118
  type: "task/status";
1119
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
1119
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
1120
1120
  message?: string | undefined;
1121
1121
  } | {
1122
1122
  type: "tool/call";
@@ -170,7 +170,7 @@ export declare const sdk: {
170
170
  error: string;
171
171
  } | {
172
172
  type: "task/status";
173
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
173
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
174
174
  message?: string | undefined;
175
175
  } | {
176
176
  type: "tool/call";
@@ -198,7 +198,7 @@ export declare const sdk: {
198
198
  error: string;
199
199
  } | {
200
200
  type: "task/status";
201
- status: "running" | "completed" | "failed" | "stopped" | "has_question";
201
+ status: "completed" | "failed" | "running" | "stopped" | "has_question";
202
202
  message?: string | undefined;
203
203
  } | {
204
204
  type: "tool/call";
@@ -20,6 +20,12 @@
20
20
  *
21
21
  * `scopedKey(name, config)` is the one place `<name>_<tenantScope>` is assembled — the position and resize-size
22
22
  * keys share it with the chat context key, so all three browser-local entries partition by tenant identically.
23
+ *
24
+ * `sanitizeStoredContext` is the boundary guard for the parsed JSON: hand-rolled (not zod) per the
25
+ * package-level rule that a schema imported as a VALUE anywhere reachable from `src/index.tsx` pulls
26
+ * zod's whole runtime into the bundle. Each field is checked against its own type and falls back to
27
+ * `DEFAULT_CONTEXT`'s value individually, so a partially-corrupt payload (e.g. a bad `currentMode` from
28
+ * an older widget version) keeps the fields that DID parse rather than discarding the whole context.
23
29
  */
24
30
  import type { ChatMessage, InstructionType, MarketrixConfig, ValidWidgetConfig } from '../types';
25
31
  type StoredMessage = Omit<ChatMessage, 'videoStream' | 'timestamp'> & {
@@ -1,3 +1,4 @@
1
+ import type { CredentialedConfig } from '../services/StorageService';
1
2
  import type { ChatMessage, ValidWidgetConfig, WidgetSettingsData } from '../types';
2
3
  export declare const flushMicrotasks: () => Promise<void>;
3
4
  export declare const mountTarget: () => HTMLDivElement;
@@ -5,4 +6,5 @@ export declare function agentMessage(overrides?: Partial<ChatMessage>): ChatMess
5
6
  type MockWidgetConfig = ValidWidgetConfig & Pick<WidgetSettingsData, 'widget_border_radius' | 'widget_font_size' | 'widget_animation_duration' | 'widget_fade_duration'>;
6
7
  export declare function getMockWidgetConfig(overrides?: Partial<MockWidgetConfig>): MockWidgetConfig;
7
8
  export declare function validSettings(overrides?: Partial<MockWidgetConfig>): WidgetSettingsData;
9
+ export declare function credentialedConfig(overrides?: Partial<CredentialedConfig>): CredentialedConfig;
8
10
  export {};
@@ -40,14 +40,14 @@ export interface ChatMessage {
40
40
  content: string;
41
41
  sender: 'user' | 'agent';
42
42
  timestamp: Date;
43
- mode?: InstructionType;
43
+ mode?: InstructionType | undefined;
44
44
  videoStream?: MediaStream;
45
45
  isScreenAccessRequest?: boolean;
46
46
  screenShareStatus?: 'allowed' | 'denied';
47
- pendingContent?: string;
47
+ pendingContent?: string | undefined;
48
48
  isSystemMessage?: boolean;
49
- isPlaceholder?: boolean;
50
- placeholderState?: 'thinking' | 'waiting-for-user';
49
+ isPlaceholder?: boolean | undefined;
50
+ placeholderState?: 'thinking' | 'waiting-for-user' | undefined;
51
51
  parts: MessagePart[];
52
52
  taskStatus?: 'done' | 'failed' | 'stopped';
53
53
  }
@@ -65,7 +65,7 @@ export interface WidgetState {
65
65
  isAwaitingReply: boolean;
66
66
  messages: ChatMessage[];
67
67
  currentMode: InstructionType;
68
- error?: string;
68
+ error?: string | undefined;
69
69
  isTaskRunning: boolean;
70
70
  activeView: WidgetView;
71
71
  }