@ai-matrx/chat 0.2.4 → 0.2.7

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/agents/addressing/agentAddress.js +1 -1
  3. package/dist/agents/components/context-items/bodies/ProcessedDocumentTitle.js +3 -2
  4. package/dist/agents/components/context-items/bodies/WebpageBody.js +6 -1
  5. package/dist/agents/components/debug/SandboxFileViewer.js +6 -1
  6. package/dist/agents/components/debug/StreamDebugPanel.js +6 -1
  7. package/dist/agents/components/inputs/input-components/MediaVariableInput.js +1 -1
  8. package/dist/agents/components/inputs/input-components/PicklistVariableInput.js +2 -2
  9. package/dist/agents/components/inputs/resources/attached-documents.js +3 -2
  10. package/dist/agents/components/inputs/resources/usePasteImageResource.js +2 -2
  11. package/dist/agents/components/messages-display/TranscriptIntegrityCopyButton.js +6 -2
  12. package/dist/agents/components/observational-memory/components/MemoryStateInspector.d.ts +0 -12
  13. package/dist/agents/components/observational-memory/components/MemoryStateInspector.js +10 -2
  14. package/dist/agents/components/run-controls/AgentExecutionTestModal.js +6 -1
  15. package/dist/agents/components/shared/AgentDuplicateOutcomeDialog.d.ts +26 -2
  16. package/dist/agents/components/shared/AgentDuplicateOutcomeDialog.js +50 -4
  17. package/dist/agents/components/shared/AgentOptionsMenu.js +11 -61
  18. package/dist/agents/components/shared/StreamProfilerOverlay.js +6 -1
  19. package/dist/agents/components/working-document/workingDocumentSurface.d.ts +1 -1
  20. package/dist/agents/hooks/useAgentDuplicateFlow.d.ts +13 -3
  21. package/dist/agents/hooks/useAgentDuplicateFlow.js +81 -24
  22. package/dist/agents/hooks/useWidgetHandle.js +1 -1
  23. package/dist/agents/prompt-preview/PromptPreviewContent.js +6 -1
  24. package/dist/agents/redux/agent-definition/cache-bust-middleware.js +1 -1
  25. package/dist/agents/redux/agent-definition/parse-messages-variables.js +6 -0
  26. package/dist/agents/redux/agent-shortcuts/thunks.js +1 -1
  27. package/dist/agents/redux/execution-system/instance-resources/resource-source.js +1 -2
  28. package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +1 -1
  29. package/dist/agents/redux/execution-system/thunks/launch-conversation.thunk.js +1 -1
  30. package/dist/agents/redux/execution-system/thunks/run-headless-agent-json.d.ts +8 -3
  31. package/dist/agents/redux/execution-system/thunks/run-headless-agent-json.js +36 -3
  32. package/dist/agents/redux/execution-system/utils/assert-conversation-id.js +1 -1
  33. package/dist/agents/redux/execution-system/utils/content-prefilter.js +2 -2
  34. package/dist/agents/runtime/realtime/launchRealtimeSession.thunk.js +1 -1
  35. package/dist/agents/surface-catalog-profile.d.ts +2 -2
  36. package/dist/agents/types/agent-definition.types.d.ts +8 -6
  37. package/dist/agents/utils/variable-customcomponent.d.ts +2 -2
  38. package/dist/agents/utils/variable-customcomponent.js +4 -4
  39. package/dist/cx-chat/components/messages/AssistantMessage.js +1 -1
  40. package/dist/cx-chat/components/user-input/ConversationInput.js +1 -1
  41. package/dist/cx-conversation/AssistantMessage.js +1 -1
  42. package/dist/cx-conversation/ConversationInput.js +1 -1
  43. package/dist/host/builder-door.d.ts +13 -2
  44. package/dist/host/db-types.d.ts +150 -2
  45. package/dist/host/defaults/diagnostics.js +1 -1
  46. package/dist/host/ui-slots.d.ts +2 -22
  47. package/dist/host/ui-slots.js +3 -29
  48. package/dist/host/window-openers.d.ts +3 -3
  49. package/dist/host/window-openers.js +4 -4
  50. package/dist/store/create-chat-store.d.ts +2 -0
  51. package/dist/store/create-chat-store.js +15 -3
  52. package/dist/surfaces/runtime/loaded-value-check.js +1 -1
  53. package/dist/surfaces/runtime/surface-writeback.js +1 -1
  54. package/dist/surfaces/utils/route-to-surface.js +1 -1
  55. package/dist/surfaces/utils/surface-display.js +1 -1
  56. package/dist/tool-call-visualization/effects/toolStateEffects.d.ts +1 -1
  57. package/dist/tool-call-visualization/registry/registry.js +3 -7
  58. package/dist/tool-call-visualization/result-fields/shape.js +1 -1
  59. package/dist/ui/file-source.d.ts +3 -17
  60. package/dist/voice-agent/components/VoiceDebugPanel.js +6 -1
  61. package/dist/voice-agent/hooks/useRealtimeAgentConfig.js +1 -1
  62. package/dist/voice-agent/hooks/useXaiVoiceSession.js +2 -2
  63. package/dist/voice-agent/transport/xaiClient.js +1 -1
  64. package/dist/window-panels/windows/agents/AgentMemoryWindow.js +7 -5
  65. package/package.json +3 -3
@@ -17,12 +17,23 @@ type Cfg = {
17
17
  state: ChatRootState;
18
18
  };
19
19
  type Door<Arg, Ret> = (arg: Arg) => AsyncThunkAction<Ret, Arg, Cfg>;
20
- export interface DuplicateAgentOptions {
21
- agentId: string;
20
+ interface DuplicateAgentCommon {
22
21
  asSystem?: boolean;
23
22
  organizationId?: string;
24
23
  followsSource?: boolean;
25
24
  }
25
+ /**
26
+ * What to copy into a new agent: the agent as it is now (`agentId`), or one
27
+ * exact saved version (`versionId`, an agent.definition_version id — its
28
+ * snapshot is copied, never the possibly-newer master).
29
+ */
30
+ export type DuplicateAgentOptions = DuplicateAgentCommon & ({
31
+ agentId: string;
32
+ versionId?: string;
33
+ } | {
34
+ agentId?: string;
35
+ versionId: string;
36
+ });
26
37
  export type CreateAgentInput = Partial<Omit<AgentDefinition, "id" | "createdBy" | "createdAt" | "updatedAt" | "isVersion" | "parentAgentId" | "version" | "changedAt" | "changeNote">>;
27
38
  export interface BuilderDoor {
28
39
  saveAgent: Door<string, void>;
@@ -26155,6 +26155,88 @@ export type ChatDatabase = {
26155
26155
  };
26156
26156
  Returns: boolean;
26157
26157
  };
26158
+ _entity_cursor_decode: {
26159
+ Args: {
26160
+ p: string;
26161
+ };
26162
+ Returns: Json;
26163
+ };
26164
+ _entity_cursor_encode: {
26165
+ Args: {
26166
+ p: Json;
26167
+ };
26168
+ Returns: string;
26169
+ };
26170
+ _entity_identifier: {
26171
+ Args: {
26172
+ p_cols: Json;
26173
+ p_name: string;
26174
+ };
26175
+ Returns: string;
26176
+ };
26177
+ _entity_org_notice: {
26178
+ Args: {
26179
+ p_ids: Json;
26180
+ p_op: string;
26181
+ p_organization_id: string;
26182
+ p_token: string;
26183
+ };
26184
+ Returns: undefined;
26185
+ };
26186
+ _entity_refuse: {
26187
+ Args: {
26188
+ p_code: string;
26189
+ p_detail?: Json;
26190
+ p_message: string;
26191
+ };
26192
+ Returns: undefined;
26193
+ };
26194
+ _entity_reraise: {
26195
+ Args: {
26196
+ p_detail: string;
26197
+ p_hint: string;
26198
+ p_message: string;
26199
+ p_state: string;
26200
+ };
26201
+ Returns: undefined;
26202
+ };
26203
+ _entity_trash_or_restore: {
26204
+ Args: {
26205
+ p_entity_type: string;
26206
+ p_ids: string[];
26207
+ p_trash: boolean;
26208
+ };
26209
+ Returns: Json;
26210
+ };
26211
+ _entity_wire_rows: {
26212
+ Args: {
26213
+ p_columns: Json;
26214
+ p_rows: Json;
26215
+ p_token: string;
26216
+ };
26217
+ Returns: Json;
26218
+ };
26219
+ _entity_write_refusal: {
26220
+ Args: {
26221
+ p_column?: string;
26222
+ p_constraint?: string;
26223
+ p_detail: string;
26224
+ p_extra?: Json;
26225
+ p_hint: string;
26226
+ p_message: string;
26227
+ p_state: string;
26228
+ };
26229
+ Returns: undefined;
26230
+ };
26231
+ _entity_write_values: {
26232
+ Args: {
26233
+ p_insert: boolean;
26234
+ p_org: string;
26235
+ p_token: string;
26236
+ p_values: Json;
26237
+ };
26238
+ Returns: Json;
26239
+ };
26158
26240
  _final_switch_is_on: {
26159
26241
  Args: never;
26160
26242
  Returns: boolean;
@@ -28042,6 +28124,13 @@ export type ChatDatabase = {
28042
28124
  };
28043
28125
  Returns: string;
28044
28126
  };
28127
+ entity_archive: {
28128
+ Args: {
28129
+ p_entity_type: string;
28130
+ p_ids: string[];
28131
+ };
28132
+ Returns: Json;
28133
+ };
28045
28134
  entity_columns: {
28046
28135
  Args: {
28047
28136
  p_organization_id: string;
@@ -28061,6 +28150,22 @@ export type ChatDatabase = {
28061
28150
  };
28062
28151
  Returns: Database["platform"]["Enums"]["visibility"];
28063
28152
  };
28153
+ entity_get: {
28154
+ Args: {
28155
+ p_entity_type: string;
28156
+ p_ids: string[];
28157
+ p_include?: Json;
28158
+ };
28159
+ Returns: Json;
28160
+ };
28161
+ entity_insert: {
28162
+ Args: {
28163
+ p_entity_type: string;
28164
+ p_organization_id: string;
28165
+ p_rows: Json;
28166
+ };
28167
+ Returns: Json;
28168
+ };
28064
28169
  entity_is_org_scoped: {
28065
28170
  Args: {
28066
28171
  p_token: string;
@@ -28073,6 +28178,33 @@ export type ChatDatabase = {
28073
28178
  };
28074
28179
  Returns: boolean;
28075
28180
  };
28181
+ entity_list_scoped: {
28182
+ Args: {
28183
+ p_after?: string;
28184
+ p_archived?: string;
28185
+ p_deep?: boolean;
28186
+ p_entity_type: string;
28187
+ p_favorites_first?: boolean;
28188
+ p_filter?: Json;
28189
+ p_include?: Json;
28190
+ p_page?: number;
28191
+ p_page_size?: number;
28192
+ p_scope?: Json;
28193
+ p_search?: string;
28194
+ p_search_columns?: string[];
28195
+ p_search_match?: string;
28196
+ p_sort?: Json;
28197
+ p_trash?: boolean;
28198
+ p_with_total?: boolean;
28199
+ };
28200
+ Returns: Json;
28201
+ };
28202
+ entity_org_topic_admits: {
28203
+ Args: {
28204
+ p_topic: string;
28205
+ };
28206
+ Returns: boolean;
28207
+ };
28076
28208
  entity_organization_id: {
28077
28209
  Args: {
28078
28210
  p_id: string;
@@ -28110,6 +28242,22 @@ export type ChatDatabase = {
28110
28242
  };
28111
28243
  Returns: boolean;
28112
28244
  };
28245
+ entity_unarchive: {
28246
+ Args: {
28247
+ p_entity_type: string;
28248
+ p_ids: string[];
28249
+ };
28250
+ Returns: Json;
28251
+ };
28252
+ entity_update: {
28253
+ Args: {
28254
+ p_base_version?: number;
28255
+ p_entity_type: string;
28256
+ p_id: string;
28257
+ p_patch?: Json;
28258
+ };
28259
+ Returns: Json;
28260
+ };
28113
28261
  extensibility_knob: {
28114
28262
  Args: {
28115
28263
  p_definition_id?: string;
@@ -38384,7 +38532,7 @@ export type ChatDatabase = {
38384
38532
  };
38385
38533
  Returns: Json;
38386
38534
  };
38387
- get_structured_list_for_selection: {
38535
+ get_pick_list_for_selection: {
38388
38536
  Args: {
38389
38537
  p_list_id: string;
38390
38538
  };
@@ -38547,7 +38695,7 @@ export type ChatDatabase = {
38547
38695
  };
38548
38696
  Returns: Json;
38549
38697
  };
38550
- get_user_lists_summary: {
38698
+ get_pick_lists_summary: {
38551
38699
  Args: {
38552
38700
  p_user_id: string;
38553
38701
  };
@@ -32,7 +32,7 @@ function currentRoute() {
32
32
  }
33
33
  }
34
34
  function createLogClientErrorDiagnostics(db, options) {
35
- const persist = options.persist ?? false;
35
+ const persist = options.persist ?? process.env.NODE_ENV === "production";
36
36
  const flushDelayMs = options.flushDelayMs ?? DIAGNOSTICS_FLUSH_DELAY_MS;
37
37
  const sourceApp = isChatSourceApp(options.sourceApp) ? options.sourceApp : null;
38
38
  const persisted = /* @__PURE__ */ new Set();
@@ -231,19 +231,11 @@ export interface ChatUiSlots {
231
231
  ChangeDiff: AnyComponent;
232
232
  SearchGroup: AnyComponent;
233
233
  SearchGroupTrigger: AnyComponent;
234
- /** The host's upload hook: `{ upload, uploadMany, uploading, progress, result, error, reset }`. */
235
- useFileUpload: AnyFn;
236
- /** One file from the host's file store by source: `{ file }`. */
237
- useFile: AnyFn;
238
234
  useFileDocument: AnyFn;
239
235
  useFileResourceFamily: AnyFn;
240
236
  useFileActions: AnyFn;
241
237
  /** The host's record-then-transcribe hook (`isRecording`, `startRecording`, ...). */
242
238
  useRecordAndTranscribe: AnyFn;
243
- /** Resolves a file source to its stored file (the host's file handler). */
244
- resolveFile: AnyFn;
245
- /** The host's rename-file thunk creator (`dispatch(renameFile({ fileId, newName })).unwrap()`). */
246
- renameFile: AnyFn;
247
239
  requestScribeAudioSeek: AnyFn;
248
240
  resolvePdfSurfaceIds: AnyFn;
249
241
  /** The host's list RPC reader (`{ data, error }`). */
@@ -285,7 +277,7 @@ export interface ChatUiSlots {
285
277
  };
286
278
  useAutoLabel: AnyFn;
287
279
  generateLabelFromContent: AnyFn;
288
- useStructuredListForSelection: (listId: string | null | undefined, groupName?: string) => {
280
+ usePickListForSelection: (listId: string | null | undefined, groupName?: string) => {
289
281
  items: PicklistItem[];
290
282
  groups: unknown[];
291
283
  loading: boolean;
@@ -326,13 +318,11 @@ export interface ChatUiSlots {
326
318
  dispatchWarRoomMasterTool: AnyFn;
327
319
  resolveGmailSendConnection: AnyFn;
328
320
  voiceDisplayName: AnyFn;
329
- recognizeOurFileUrl: AnyFn;
330
321
  canvasGetVersionHistory: (canvasId: string) => Promise<CanvasItemRow[]>;
331
322
  canvasGetById: (canvasId: string) => Promise<CanvasItemRow | null>;
332
323
  createSandboxFilesystemAdapter: AnyFn;
333
324
  notesGetById: AnyFn;
334
325
  isLiveConversationVoice: AnyFn;
335
- ourFileUrlMarkers: AnyFn;
336
326
  createHtmlPage: AnyFn;
337
327
  convertMarkdownToHtml: AnyFn;
338
328
  sklActions: Record<string, AnyFn>;
@@ -391,8 +381,6 @@ export interface ChatUiSlots {
391
381
  pushAppHref: AnyFn;
392
382
  replaceAppHref: AnyFn;
393
383
  announceComingSoon: AnyFn;
394
- normalize: AnyFn;
395
- toMediaRef: AnyFn;
396
384
  peekSystemOrgId: AnyFn;
397
385
  toGlobalOwnershipRecord: AnyFn;
398
386
  fromGlobalOwnershipRecord: AnyFn;
@@ -601,14 +589,10 @@ export declare const ChangeDiff: AnyComponent;
601
589
  /** A host with no search toolbar lays the group's buttons out in a plain row. */
602
590
  export declare const SearchGroup: AnyComponent;
603
591
  export declare const SearchGroupTrigger: AnyComponent;
604
- export declare const useFileUpload: AnyFn;
605
- export declare const useFile: AnyFn;
606
592
  export declare const useFileDocument: AnyFn;
607
593
  export declare const useFileResourceFamily: AnyFn;
608
594
  export declare const useFileActions: AnyFn;
609
595
  export declare const useRecordAndTranscribe: AnyFn;
610
- export declare const resolveFile: AnyFn;
611
- export declare const renameFile: AnyFn;
612
596
  /** A host with no transcript studio has no audio to seek; the request is a reported no-op. */
613
597
  export declare const requestScribeAudioSeek: AnyFn;
614
598
  export declare const resolvePdfSurfaceIds: AnyFn;
@@ -688,7 +672,7 @@ export declare const useSkills: () => {
688
672
  };
689
673
  export declare const useAutoLabel: AnyFn;
690
674
  export declare const generateLabelFromContent: AnyFn;
691
- export declare const useStructuredListForSelection: (listId: string | null | undefined, groupName?: string) => {
675
+ export declare const usePickListForSelection: (listId: string | null | undefined, groupName?: string) => {
692
676
  items: PicklistItem[];
693
677
  groups: unknown[];
694
678
  loading: boolean;
@@ -729,13 +713,11 @@ export declare const dispatchWarRoomTool: AnyFn;
729
713
  export declare const dispatchWarRoomMasterTool: AnyFn;
730
714
  export declare const resolveGmailSendConnection: AnyFn;
731
715
  export declare const voiceDisplayName: AnyFn;
732
- export declare const recognizeOurFileUrl: AnyFn;
733
716
  export declare const canvasGetVersionHistory: (canvasId: string) => Promise<CanvasItemRow[]>;
734
717
  export declare const canvasGetById: (canvasId: string) => Promise<CanvasItemRow | null>;
735
718
  export declare const createSandboxFilesystemAdapter: AnyFn;
736
719
  export declare const notesGetById: AnyFn;
737
720
  export declare const isLiveConversationVoice: AnyFn;
738
- export declare const ourFileUrlMarkers: AnyFn;
739
721
  export declare const createHtmlPage: AnyFn;
740
722
  export declare const convertMarkdownToHtml: AnyFn;
741
723
  /** The host's skill-library action creators (`sklActions.x(...)`); resolved at call time, a bare host throws naming the slot. */
@@ -754,8 +736,6 @@ export declare const readOf: AnyFn;
754
736
  export declare const pushAppHref: AnyFn;
755
737
  export declare const replaceAppHref: AnyFn;
756
738
  export declare const announceComingSoon: AnyFn;
757
- export declare const normalize: AnyFn;
758
- export declare const toMediaRef: AnyFn;
759
739
  export declare const peekSystemOrgId: AnyFn;
760
740
  export declare const toGlobalOwnershipRecord: AnyFn;
761
741
  export declare const fromGlobalOwnershipRecord: AnyFn;
@@ -93,7 +93,6 @@ const STAND_INS = {
93
93
  fetchArtifactsForMessageThunk: noopThunk,
94
94
  updateArtifactThunk: failingThunk("updateArtifactThunk"),
95
95
  registerArtifactThunk: failingThunk("registerArtifactThunk"),
96
- renameFile: failingThunk("renameFile"),
97
96
  refreshNoteContent: failingThunk("refreshNoteContent"),
98
97
  saveNoteField: failingThunk("saveNoteField"),
99
98
  fetchNotesList: noopThunk,
@@ -167,7 +166,7 @@ const STAND_INS = {
167
166
  beginPlaybackSession: () => ({ id: "", update: () => void 0, end: () => void 0 }),
168
167
  useCanvasOpenGuard: () => ({ ensureCanvasReachable: async () => true }),
169
168
  useSkills: () => ({ skills: NONE, grouped: {}, count: 0, loading: false, error: null, reload: async () => void 0 }),
170
- useStructuredListForSelection: () => ({ items: NONE, groups: NONE, loading: false, unavailable: true, error: null, retry: () => void 0 }),
169
+ usePickListForSelection: () => ({ items: NONE, groups: NONE, loading: false, unavailable: true, error: null, retry: () => void 0 }),
171
170
  useOutputFeedback: () => ({ verdict: null, isLoaded: true })
172
171
  };
173
172
  function slotFn(name, declared) {
@@ -314,23 +313,10 @@ const SearchGroup = slotComponent(
314
313
  ({ children, className }) => createElement("div", { className: `flex items-center ${className ?? ""}`, "data-chat-slot-fallback": "SearchGroup" }, children ?? null)
315
314
  );
316
315
  const SearchGroupTrigger = slotComponent("SearchGroupTrigger");
317
- const noUploadHere = () => Promise.reject(new Error("This host has no file upload (registerChatUi useFileUpload)"));
318
- const useFileUpload = slotFn("useFileUpload", () => ({
319
- upload: noUploadHere,
320
- uploadMany: noUploadHere,
321
- uploading: false,
322
- progress: null,
323
- result: null,
324
- error: null,
325
- reset: () => void 0
326
- }));
327
- const useFile = slotFn("useFile", () => ({ file: null }));
328
316
  const useFileDocument = slotFn("useFileDocument");
329
317
  const useFileResourceFamily = slotFn("useFileResourceFamily");
330
318
  const useFileActions = slotFn("useFileActions");
331
319
  const useRecordAndTranscribe = slotFn("useRecordAndTranscribe");
332
- const resolveFile = slotFn("resolveFile");
333
- const renameFile = slotFn("renameFile");
334
320
  const requestScribeAudioSeek = slotFn("requestScribeAudioSeek", () => void 0);
335
321
  const resolvePdfSurfaceIds = slotFn("resolvePdfSurfaceIds");
336
322
  const readListRpc = slotFn("readListRpc");
@@ -408,7 +394,7 @@ const useRegisterChatAttachTarget = slotFn("useRegisterChatAttachTarget", () =>
408
394
  const useSkills = slotFn("useSkills");
409
395
  const useAutoLabel = slotFn("useAutoLabel", () => void 0);
410
396
  const generateLabelFromContent = slotFn("generateLabelFromContent");
411
- const useStructuredListForSelection = slotFn("useStructuredListForSelection");
397
+ const usePickListForSelection = slotFn("usePickListForSelection");
412
398
  const useGitHubConnection = slotFn("useGitHubConnection");
413
399
  const useOutputFeedback = slotFn("useOutputFeedback");
414
400
  const saveOutputFeedback = slotFn("saveOutputFeedback");
@@ -432,13 +418,11 @@ const dispatchWarRoomTool = slotFn("dispatchWarRoomTool");
432
418
  const dispatchWarRoomMasterTool = slotFn("dispatchWarRoomMasterTool");
433
419
  const resolveGmailSendConnection = slotFn("resolveGmailSendConnection");
434
420
  const voiceDisplayName = slotFn("voiceDisplayName", (_set, id) => id);
435
- const recognizeOurFileUrl = slotFn("recognizeOurFileUrl", () => null);
436
421
  const canvasGetVersionHistory = slotFn("canvasGetVersionHistory");
437
422
  const canvasGetById = slotFn("canvasGetById");
438
423
  const createSandboxFilesystemAdapter = slotFn("createSandboxFilesystemAdapter");
439
424
  const notesGetById = slotFn("notesGetById");
440
425
  const isLiveConversationVoice = slotFn("isLiveConversationVoice", () => false);
441
- const ourFileUrlMarkers = slotFn("ourFileUrlMarkers", () => []);
442
426
  const createHtmlPage = slotFn("createHtmlPage");
443
427
  const convertMarkdownToHtml = slotFn("convertMarkdownToHtml");
444
428
  const sklActions = new Proxy({}, { get: (_t, prop) => (...args) => {
@@ -460,8 +444,6 @@ const readOf = slotFn("readOf");
460
444
  const pushAppHref = slotFn("pushAppHref");
461
445
  const replaceAppHref = slotFn("replaceAppHref");
462
446
  const announceComingSoon = slotFn("announceComingSoon");
463
- const normalize = slotFn("normalize");
464
- const toMediaRef = slotFn("toMediaRef");
465
447
  const peekSystemOrgId = slotFn("peekSystemOrgId");
466
448
  const toGlobalOwnershipRecord = slotFn("toGlobalOwnershipRecord");
467
449
  const fromGlobalOwnershipRecord = slotFn("fromGlobalOwnershipRecord");
@@ -702,12 +684,10 @@ export {
702
684
  makeSelectUsageGroups,
703
685
  markDriftAlertViewed,
704
686
  materializeMessageArtifacts,
705
- normalize,
706
687
  noteBrowserActivity,
707
688
  notesCreate,
708
689
  notesGetById,
709
690
  notifyPrintOutcome,
710
- ourFileUrlMarkers,
711
691
  peekMandateCatalogueEntry,
712
692
  peekSystemOrgId,
713
693
  precedingQuestion,
@@ -717,19 +697,16 @@ export {
717
697
  readOf,
718
698
  readProjectScopeOrganizationId,
719
699
  receivedFsChange,
720
- recognizeOurFileUrl,
721
700
  reconcileMessagesArtifacts,
722
701
  refreshNoteContent,
723
702
  registerArtifactThunk,
724
703
  registerChatUi,
725
- renameFile,
726
704
  replaceAppHref,
727
705
  reportCanvasOpenDrop,
728
706
  requestScribeAudioSeek,
729
707
  requireAuthenticatedSupabaseSession,
730
708
  resetChatUiForTests,
731
709
  resolveEntityToken,
732
- resolveFile,
733
710
  resolveGmailSendConnection,
734
711
  resolvePdfSurfaceIds,
735
712
  resolvePreferredChatModel,
@@ -753,7 +730,6 @@ export {
753
730
  studioDocumentContentChanged,
754
731
  summarizeContextCell,
755
732
  toGlobalOwnershipRecord,
756
- toMediaRef,
757
733
  toastDoor,
758
734
  traceWarRoomRenderPath,
759
735
  updateArtifactThunk,
@@ -770,11 +746,9 @@ export {
770
746
  useConversationAttachments,
771
747
  useCostDisplay,
772
748
  useEntityTitles,
773
- useFile,
774
749
  useFileActions,
775
750
  useFileDocument,
776
751
  useFileResourceFamily,
777
- useFileUpload,
778
752
  useGitHubConnection,
779
753
  useHeldWriteTableName,
780
754
  useHtmlPreviewState,
@@ -789,12 +763,12 @@ export {
789
763
  useOverlaySurfaceRenderAck,
790
764
  usePageCapture,
791
765
  usePageCaptureContribution,
766
+ usePickListForSelection,
792
767
  usePopoutContainer,
793
768
  useRecordAndTranscribe,
794
769
  useRegisterChatAttachTarget,
795
770
  useRunControlCounts,
796
771
  useSkills,
797
- useStructuredListForSelection,
798
772
  useTablesEverywhere,
799
773
  useTextareaFormatting,
800
774
  useUrlSync,
@@ -145,7 +145,7 @@ export interface OpenScraperWindowOptions {
145
145
  url?: string;
146
146
  mode?: ScraperWindowMode;
147
147
  }
148
- export interface OpenStructuredListManagerV2WindowOptions {
148
+ export interface OpenPickListManagerWindowOptions {
149
149
  title?: string;
150
150
  forcedListId?: string | null;
151
151
  }
@@ -297,7 +297,7 @@ export interface ChatWindowOpeners {
297
297
  openSaveTemplateDialog: (opts?: OpenSaveTemplateDialogOptions) => void;
298
298
  openScraperWindow: (opts?: OpenScraperWindowOptions) => ChatWindowHandle;
299
299
  openScratchpadPanel: (opts?: OpenScratchpadPanelOptions) => ChatWindowHandle;
300
- openStructuredListManagerV2Window: (opts?: OpenStructuredListManagerV2WindowOptions) => ChatWindowHandle;
300
+ openPickListManagerWindow: (opts?: OpenPickListManagerWindowOptions) => ChatWindowHandle;
301
301
  openSurfaceContextInspector: (opts: OpenSurfaceContextInspectorOptions) => ChatWindowHandle;
302
302
  openSurfaceContextWindow: (opts: OpenSurfaceContextWindowOptions) => void;
303
303
  openSystemInstructionWindow: (opts: OpenSystemInstructionWindowOptions) => ChatWindowHandle;
@@ -352,7 +352,7 @@ export declare function useOpenQuickChatSheet(): (opts?: OpenQuickChatSheetOptio
352
352
  export declare function useOpenRunControlsWindow(): (opts: OpenRunControlsWindowOptions) => ChatWindowHandle;
353
353
  export declare function useOpenSaveTemplateDialog(): (opts?: OpenSaveTemplateDialogOptions) => void;
354
354
  export declare function useOpenScraperWindow(): (opts?: OpenScraperWindowOptions) => ChatWindowHandle;
355
- export declare function useOpenStructuredListManagerV2Window(): (opts?: OpenStructuredListManagerV2WindowOptions) => ChatWindowHandle;
355
+ export declare function useOpenPickListManagerWindow(): (opts?: OpenPickListManagerWindowOptions) => ChatWindowHandle;
356
356
  export declare function useOpenSurfaceContextInspector(): (opts: OpenSurfaceContextInspectorOptions) => ChatWindowHandle;
357
357
  export declare function useOpenSurfaceContextWindow(): (opts: OpenSurfaceContextWindowOptions) => void;
358
358
  export declare function useOpenSystemInstructionWindow(): (opts: OpenSystemInstructionWindowOptions) => ChatWindowHandle;
@@ -52,7 +52,7 @@ const UNHOSTED_WINDOW_OPENERS = {
52
52
  openSaveTemplateDialog: unhosted("openSaveTemplateDialog"),
53
53
  openScraperWindow: unhosted("openScraperWindow"),
54
54
  openScratchpadPanel: unhosted("openScratchpadPanel"),
55
- openStructuredListManagerV2Window: unhosted("openStructuredListManagerV2Window"),
55
+ openPickListManagerWindow: unhosted("openPickListManagerWindow"),
56
56
  openSurfaceContextInspector: unhosted("openSurfaceContextInspector"),
57
57
  openSurfaceContextWindow: unhosted("openSurfaceContextWindow"),
58
58
  openSystemInstructionWindow: unhosted("openSystemInstructionWindow"),
@@ -206,8 +206,8 @@ function useOpenSaveTemplateDialog() {
206
206
  function useOpenScraperWindow() {
207
207
  return useOpener("openScraperWindow");
208
208
  }
209
- function useOpenStructuredListManagerV2Window() {
210
- return useOpener("openStructuredListManagerV2Window");
209
+ function useOpenPickListManagerWindow() {
210
+ return useOpener("openPickListManagerWindow");
211
211
  }
212
212
  function useOpenSurfaceContextInspector() {
213
213
  return useOpener("openSurfaceContextInspector");
@@ -261,6 +261,7 @@ export {
261
261
  useOpenLiveRunWindow,
262
262
  useOpenMandateWindow,
263
263
  useOpenNotesWindow,
264
+ useOpenPickListManagerWindow,
264
265
  useOpenPromptPreviewWindow,
265
266
  useOpenQuickChatSheet,
266
267
  useOpenRunControlsWindow,
@@ -268,7 +269,6 @@ export {
268
269
  useOpenScraperWindow,
269
270
  useOpenScratchpadPanel,
270
271
  useOpenShortcutEditorWindow,
271
- useOpenStructuredListManagerV2Window,
272
272
  useOpenSurfaceContextInspector,
273
273
  useOpenSurfaceContextWindow,
274
274
  useOpenSystemInstructionWindow,
@@ -43,6 +43,7 @@ export declare function createChatStore(preloadedState?: Partial<ChatState>): im
43
43
  conversationAttachments: import("../agents/connectors/attachments.slice.js").AttachmentsSliceState;
44
44
  modelRegistry: import("../agents/model-registry/modelRegistrySlice.js").ModelRegistryState;
45
45
  chatHost: import("./chat-host.slice.js").ChatHostState;
46
+ cloudFiles: import("@ai-matrx/media/files/engine").CloudFilesState;
46
47
  }, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
47
48
  dispatch: import("redux-thunk").ThunkDispatch<{
48
49
  voiceAgent: import("../voice-agent/types.js").VoiceAgentState;
@@ -88,6 +89,7 @@ export declare function createChatStore(preloadedState?: Partial<ChatState>): im
88
89
  conversationAttachments: import("../agents/connectors/attachments.slice.js").AttachmentsSliceState;
89
90
  modelRegistry: import("../agents/model-registry/modelRegistrySlice.js").ModelRegistryState;
90
91
  chatHost: import("./chat-host.slice.js").ChatHostState;
92
+ cloudFiles: import("@ai-matrx/media/files/engine").CloudFilesState;
91
93
  }, undefined, import("redux").UnknownAction>;
92
94
  }>, import("redux").StoreEnhancer]>>;
93
95
  export type ChatStore = ReturnType<typeof createChatStore>;
@@ -1,13 +1,20 @@
1
1
  import { combineReducers, configureStore } from "@reduxjs/toolkit";
2
2
  import createSagaMiddleware from "redux-saga";
3
3
  import { fork } from "redux-saga/effects";
4
+ import {
5
+ cloudFilesMutationToastMiddleware,
6
+ cloudFilesRealtimeMiddleware,
7
+ cloudFilesReducer
8
+ } from "@ai-matrx/media/files/engine";
4
9
  import { chatReducers } from "./slices.js";
5
10
  import { chatMiddlewares } from "./middlewares.js";
6
11
  import { chatSagas } from "./sagas.js";
7
12
  function createChatStore(preloadedState) {
8
13
  const sagaMiddleware = createSagaMiddleware();
9
14
  const store = configureStore({
10
- reducer: combineReducers(chatReducers),
15
+ // Files are part of chat (P16f): the files engine's slice and its two middlewares come
16
+ // straight from @ai-matrx/media. A host that brings its own store mounts them itself.
17
+ reducer: combineReducers({ ...chatReducers, cloudFiles: cloudFilesReducer }),
11
18
  preloadedState,
12
19
  // The chat middlewares are still typed against the host RootState (§2.3 — host keys
13
20
  // they read); widened here until those reads move onto `chatHost` (P7–P9).
@@ -15,8 +22,13 @@ function createChatStore(preloadedState) {
15
22
  serializableCheck: false,
16
23
  immutableCheck: false,
17
24
  actionCreatorCheck: false
18
- }).concat(sagaMiddleware, ...chatMiddlewares()),
19
- devTools: true
25
+ }).concat(
26
+ sagaMiddleware,
27
+ ...chatMiddlewares(),
28
+ cloudFilesRealtimeMiddleware,
29
+ cloudFilesMutationToastMiddleware
30
+ ),
31
+ devTools: process.env.NODE_ENV !== "production"
20
32
  });
21
33
  sagaMiddleware.run(function* chatRootSaga() {
22
34
  for (const saga of chatSagas()) yield fork(saga);
@@ -15,7 +15,7 @@ function findUndeclaredLoadedValues(surfaceName, scope) {
15
15
  }
16
16
  const announced = /* @__PURE__ */ new Set();
17
17
  function announceUndeclaredLoadedValues(surfaceName, scope) {
18
- const mode = "development";
18
+ const mode = process.env.NODE_ENV;
19
19
  if (mode === "production") return;
20
20
  const issues = findUndeclaredLoadedValues(surfaceName, scope);
21
21
  if (issues.length === 0) return;
@@ -1197,7 +1197,7 @@ function reportUnwiredTarget(surfaceName, target) {
1197
1197
  if (reportedUnwiredTargets.has(key)) return;
1198
1198
  reportedUnwiredTargets.add(key);
1199
1199
  const message = `[surface-writeback] Surface "${surfaceName}" declares agent-writable target "${target.name}", but the mounted page registered no handler for it \u2014 agents are not offered it here. Register it with useSurfaceWriteHandlers (or getWriteHandlers) on the component that owns that state, or drop the declaration from the manifest.`;
1200
- if (true) {
1200
+ if (process.env.NODE_ENV !== "production") {
1201
1201
  console.warn(message);
1202
1202
  }
1203
1203
  }
@@ -95,7 +95,7 @@ const SURFACE_ROUTE_MAPPINGS = [
95
95
  { prefix: "/work", surface: "matrx-user/ai-work" },
96
96
  { prefix: "/files", surface: "matrx-user/files" },
97
97
  { prefix: "/projects", surface: "matrx-user/projects" },
98
- { prefix: "/lists", surface: "matrx-user/lists" },
98
+ { prefix: "/pick-lists", surface: "matrx-user/pick-lists" },
99
99
  { prefix: "/tools/pdf-extractor", surface: "matrx-user/pdf-extractor" },
100
100
  { prefix: "/tools/scanner", surface: "matrx-user/scanner" },
101
101
  { prefix: "/documents", surface: "matrx-user/documents" },
@@ -31,7 +31,7 @@ function getSurfaceValueLabel(surfaceName, valueName) {
31
31
  (v) => v.name === valueName
32
32
  );
33
33
  if (!value) {
34
- if (true) {
34
+ if (process.env.NODE_ENV !== "production") {
35
35
  console.error(
36
36
  `[surfaces] getSurfaceValueLabel: "${valueName}" is not declared on "${surfaceName}" \u2014 declare it in the manifest (completeness law).`
37
37
  );
@@ -26,7 +26,7 @@
26
26
  * ADDING AN ENTITY: one entry in `TOOL_STATE_EFFECTS` — tool names + a `run`
27
27
  * that dispatches the feature's refetch thunk(s). Known not-yet-covered
28
28
  * writers (no canonical Redux refetch today, or their state is hook-local):
29
- * picklist (session-cached `usePicklistDetail`), dictionary, workbook,
29
+ * picklist (session-cached `usePickListDetail`), dictionary, workbook,
30
30
  * dataset/usertable, document. The working document is already reconciled by
31
31
  * its own `context_changed` re-read; the scratchpad is agent-readonly.
32
32
  */