@assistant-ui/react 0.7.0 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/dist/api/AssistantRuntime.d.ts +4 -34
  2. package/dist/api/AssistantRuntime.d.ts.map +1 -1
  3. package/dist/api/AssistantRuntime.js.map +1 -1
  4. package/dist/api/AssistantRuntime.mjs.map +1 -1
  5. package/dist/api/AttachmentRuntime.d.ts +4 -4
  6. package/dist/api/AttachmentRuntime.d.ts.map +1 -1
  7. package/dist/api/AttachmentRuntime.js.map +1 -1
  8. package/dist/api/AttachmentRuntime.mjs.map +1 -1
  9. package/dist/api/ComposerRuntime.d.ts +10 -10
  10. package/dist/api/ComposerRuntime.d.ts.map +1 -1
  11. package/dist/api/ComposerRuntime.js.map +1 -1
  12. package/dist/api/ComposerRuntime.mjs.map +1 -1
  13. package/dist/api/ContentPartRuntime.d.ts +2 -2
  14. package/dist/api/ContentPartRuntime.d.ts.map +1 -1
  15. package/dist/api/ContentPartRuntime.js.map +1 -1
  16. package/dist/api/ContentPartRuntime.mjs.map +1 -1
  17. package/dist/api/MessageRuntime.d.ts +7 -7
  18. package/dist/api/MessageRuntime.d.ts.map +1 -1
  19. package/dist/api/MessageRuntime.js +2 -2
  20. package/dist/api/MessageRuntime.js.map +1 -1
  21. package/dist/api/MessageRuntime.mjs +2 -2
  22. package/dist/api/MessageRuntime.mjs.map +1 -1
  23. package/dist/api/RuntimePathTypes.d.ts +33 -33
  24. package/dist/api/RuntimePathTypes.d.ts.map +1 -1
  25. package/dist/api/RuntimePathTypes.js.map +1 -1
  26. package/dist/api/ThreadListItemRuntime.d.ts +4 -4
  27. package/dist/api/ThreadListItemRuntime.d.ts.map +1 -1
  28. package/dist/api/ThreadListItemRuntime.js.map +1 -1
  29. package/dist/api/ThreadListItemRuntime.mjs.map +1 -1
  30. package/dist/api/ThreadListRuntime.d.ts +9 -9
  31. package/dist/api/ThreadListRuntime.d.ts.map +1 -1
  32. package/dist/api/ThreadListRuntime.js.map +1 -1
  33. package/dist/api/ThreadListRuntime.mjs.map +1 -1
  34. package/dist/api/ThreadRuntime.d.ts +45 -56
  35. package/dist/api/ThreadRuntime.d.ts.map +1 -1
  36. package/dist/api/ThreadRuntime.js.map +1 -1
  37. package/dist/api/ThreadRuntime.mjs.map +1 -1
  38. package/dist/api/index.d.ts +1 -0
  39. package/dist/api/index.d.ts.map +1 -1
  40. package/dist/api/index.js.map +1 -1
  41. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts +1 -1
  42. package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
  43. package/dist/context/react/AssistantContext.d.ts +10 -48
  44. package/dist/context/react/AssistantContext.d.ts.map +1 -1
  45. package/dist/context/react/AttachmentContext.d.ts +16 -16
  46. package/dist/context/react/MessageContext.d.ts +6 -36
  47. package/dist/context/react/MessageContext.d.ts.map +1 -1
  48. package/dist/context/react/ThreadContext.d.ts +10 -138
  49. package/dist/context/react/ThreadContext.d.ts.map +1 -1
  50. package/dist/context/stores/AssistantToolUIs.d.ts +9 -6
  51. package/dist/context/stores/AssistantToolUIs.d.ts.map +1 -1
  52. package/dist/context/stores/AssistantToolUIs.js.map +1 -1
  53. package/dist/context/stores/AssistantToolUIs.mjs.map +1 -1
  54. package/dist/context/stores/MessageUtils.d.ts +7 -12
  55. package/dist/context/stores/MessageUtils.d.ts.map +1 -1
  56. package/dist/context/stores/MessageUtils.js.map +1 -1
  57. package/dist/context/stores/MessageUtils.mjs.map +1 -1
  58. package/dist/context/stores/ThreadViewport.d.ts +6 -10
  59. package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
  60. package/dist/context/stores/ThreadViewport.js +0 -1
  61. package/dist/context/stores/ThreadViewport.js.map +1 -1
  62. package/dist/context/stores/ThreadViewport.mjs +0 -2
  63. package/dist/context/stores/ThreadViewport.mjs.map +1 -1
  64. package/dist/primitive-hooks/contentPart/useContentPartDisplay.d.ts +1 -1
  65. package/dist/primitive-hooks/contentPart/useContentPartImage.d.ts +1 -1
  66. package/dist/primitive-hooks/contentPart/useContentPartText.d.ts +1 -1
  67. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts +2 -4
  68. package/dist/runtimes/core/BaseThreadRuntimeCore.d.ts.map +1 -1
  69. package/dist/runtimes/core/ThreadRuntimeCore.d.ts +22 -22
  70. package/dist/runtimes/core/ThreadRuntimeCore.d.ts.map +1 -1
  71. package/dist/runtimes/core/ThreadRuntimeCore.js.map +1 -1
  72. package/dist/runtimes/edge/converters/fromCoreMessage.d.ts.map +1 -1
  73. package/dist/runtimes/edge/converters/fromCoreMessage.js +6 -3
  74. package/dist/runtimes/edge/converters/fromCoreMessage.js.map +1 -1
  75. package/dist/runtimes/edge/converters/fromCoreMessage.mjs +6 -3
  76. package/dist/runtimes/edge/converters/fromCoreMessage.mjs.map +1 -1
  77. package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts +3 -3
  78. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts +2 -11
  79. package/dist/runtimes/external-store/ExternalStoreThreadRuntimeCore.d.ts.map +1 -1
  80. package/dist/runtimes/external-store/ThreadMessageLike.d.ts +5 -1
  81. package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
  82. package/dist/runtimes/external-store/ThreadMessageLike.js +18 -6
  83. package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
  84. package/dist/runtimes/external-store/ThreadMessageLike.mjs +18 -6
  85. package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
  86. package/dist/runtimes/local/ChatModelAdapter.d.ts +4 -4
  87. package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
  88. package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
  89. package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
  90. package/dist/runtimes/local/LocalThreadRuntimeCore.js +1 -0
  91. package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
  92. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +1 -0
  93. package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
  94. package/dist/types/AssistantTypes.d.ts +13 -4
  95. package/dist/types/AssistantTypes.d.ts.map +1 -1
  96. package/dist/types/AssistantTypes.js.map +1 -1
  97. package/package.json +3 -3
  98. package/src/api/AssistantRuntime.ts +2 -2
  99. package/src/api/AttachmentRuntime.ts +4 -4
  100. package/src/api/ComposerRuntime.ts +10 -10
  101. package/src/api/ContentPartRuntime.ts +2 -2
  102. package/src/api/MessageRuntime.ts +9 -9
  103. package/src/api/RuntimePathTypes.ts +26 -26
  104. package/src/api/ThreadListItemRuntime.ts +4 -4
  105. package/src/api/ThreadListRuntime.ts +10 -10
  106. package/src/api/ThreadRuntime.ts +45 -14
  107. package/src/api/index.ts +4 -0
  108. package/src/context/stores/AssistantToolUIs.ts +9 -2
  109. package/src/context/stores/MessageUtils.ts +6 -6
  110. package/src/context/stores/ThreadViewport.tsx +5 -6
  111. package/src/runtimes/core/ThreadRuntimeCore.tsx +28 -29
  112. package/src/runtimes/edge/converters/fromCoreMessage.ts +4 -0
  113. package/src/runtimes/external-store/ThreadMessageLike.tsx +21 -4
  114. package/src/runtimes/local/ChatModelAdapter.tsx +4 -4
  115. package/src/runtimes/local/LocalThreadRuntimeCore.tsx +1 -0
  116. package/src/types/AssistantTypes.ts +13 -5
@@ -27,118 +27,14 @@ export declare function useThreadRuntime(options?: {
27
27
  optional?: boolean | undefined;
28
28
  }): ThreadRuntime | null;
29
29
  export declare const useThread: {
30
- (): Readonly<{
31
- threadId: string;
32
- metadata: Readonly<{
33
- threadId: string;
34
- state: "archived" | "regular" | "new" | "deleted";
35
- title?: string | undefined;
36
- }>;
37
- isDisabled: boolean;
38
- isRunning: boolean;
39
- capabilities: Readonly<{
40
- switchToBranch: boolean;
41
- edit: boolean;
42
- reload: boolean;
43
- cancel: boolean;
44
- unstable_copy: boolean;
45
- speech: boolean;
46
- attachments: boolean;
47
- feedback: boolean;
48
- }>;
49
- messages: readonly import("../..").ThreadMessage[];
50
- suggestions: readonly import("../..").ThreadSuggestion[];
51
- extras: unknown;
52
- speech: Readonly<{
53
- messageId: string;
54
- status: import("../..").SpeechSynthesisAdapter.Status;
55
- }> | undefined;
56
- }>;
57
- <TSelected>(selector: (state: Readonly<{
58
- threadId: string;
59
- metadata: Readonly<{
60
- threadId: string;
61
- state: "archived" | "regular" | "new" | "deleted";
62
- title?: string | undefined;
63
- }>;
64
- isDisabled: boolean;
65
- isRunning: boolean;
66
- capabilities: Readonly<{
67
- switchToBranch: boolean;
68
- edit: boolean;
69
- reload: boolean;
70
- cancel: boolean;
71
- unstable_copy: boolean;
72
- speech: boolean;
73
- attachments: boolean;
74
- feedback: boolean;
75
- }>;
76
- messages: readonly import("../..").ThreadMessage[];
77
- suggestions: readonly import("../..").ThreadSuggestion[];
78
- extras: unknown;
79
- speech: Readonly<{
80
- messageId: string;
81
- status: import("../..").SpeechSynthesisAdapter.Status;
82
- }> | undefined;
83
- }>) => TSelected): TSelected;
30
+ (): ThreadState;
31
+ <TSelected>(selector: (state: ThreadState) => TSelected): TSelected;
84
32
  (options: {
85
33
  optional: true;
86
- }): Readonly<{
87
- threadId: string;
88
- metadata: Readonly<{
89
- threadId: string;
90
- state: "archived" | "regular" | "new" | "deleted";
91
- title?: string | undefined;
92
- }>;
93
- isDisabled: boolean;
94
- isRunning: boolean;
95
- capabilities: Readonly<{
96
- switchToBranch: boolean;
97
- edit: boolean;
98
- reload: boolean;
99
- cancel: boolean;
100
- unstable_copy: boolean;
101
- speech: boolean;
102
- attachments: boolean;
103
- feedback: boolean;
104
- }>;
105
- messages: readonly import("../..").ThreadMessage[];
106
- suggestions: readonly import("../..").ThreadSuggestion[];
107
- extras: unknown;
108
- speech: Readonly<{
109
- messageId: string;
110
- status: import("../..").SpeechSynthesisAdapter.Status;
111
- }> | undefined;
112
- }> | null;
34
+ }): ThreadState | null;
113
35
  <TSelected>(options: {
114
36
  optional: true;
115
- selector?: (state: Readonly<{
116
- threadId: string;
117
- metadata: Readonly<{
118
- threadId: string;
119
- state: "archived" | "regular" | "new" | "deleted";
120
- title?: string | undefined;
121
- }>;
122
- isDisabled: boolean;
123
- isRunning: boolean;
124
- capabilities: Readonly<{
125
- switchToBranch: boolean;
126
- edit: boolean;
127
- reload: boolean;
128
- cancel: boolean;
129
- unstable_copy: boolean;
130
- speech: boolean;
131
- attachments: boolean;
132
- feedback: boolean;
133
- }>;
134
- messages: readonly import("../..").ThreadMessage[];
135
- suggestions: readonly import("../..").ThreadSuggestion[];
136
- extras: unknown;
137
- speech: Readonly<{
138
- messageId: string;
139
- status: import("../..").SpeechSynthesisAdapter.Status;
140
- }> | undefined;
141
- }>) => TSelected;
37
+ selector?: (state: ThreadState) => TSelected;
142
38
  }): TSelected | null;
143
39
  };
144
40
  export declare const useThreadComposer: {
@@ -153,44 +49,20 @@ export declare const useThreadComposer: {
153
49
  }): TSelected | null;
154
50
  };
155
51
  export declare const useThreadViewport: {
156
- (): Readonly<{
157
- isAtBottom: boolean;
158
- scrollToBottom: () => void;
159
- onScrollToBottom: (callback: () => void) => import("../..").Unsubscribe;
160
- }>;
161
- <TSelected>(selector: (state: Readonly<{
162
- isAtBottom: boolean;
163
- scrollToBottom: () => void;
164
- onScrollToBottom: (callback: () => void) => import("../..").Unsubscribe;
165
- }>) => TSelected): TSelected;
52
+ (): ThreadViewportState;
53
+ <TSelected>(selector: (state: ThreadViewportState) => TSelected): TSelected;
166
54
  (options: {
167
55
  optional: true;
168
- }): Readonly<{
169
- isAtBottom: boolean;
170
- scrollToBottom: () => void;
171
- onScrollToBottom: (callback: () => void) => import("../..").Unsubscribe;
172
- }> | null;
56
+ }): ThreadViewportState | null;
173
57
  <TSelected>(options: {
174
58
  optional: true;
175
- selector?: (state: Readonly<{
176
- isAtBottom: boolean;
177
- scrollToBottom: () => void;
178
- onScrollToBottom: (callback: () => void) => import("../..").Unsubscribe;
179
- }>) => TSelected;
59
+ selector?: (state: ThreadViewportState) => TSelected;
180
60
  }): TSelected | null;
181
61
  }, useThreadViewportStore: {
182
- (): ReadonlyStore<Readonly<{
183
- isAtBottom: boolean;
184
- scrollToBottom: () => void;
185
- onScrollToBottom: (callback: () => void) => import("../..").Unsubscribe;
186
- }>>;
62
+ (): ReadonlyStore<ThreadViewportState>;
187
63
  (options: {
188
64
  optional: true;
189
- }): ReadonlyStore<Readonly<{
190
- isAtBottom: boolean;
191
- scrollToBottom: () => void;
192
- onScrollToBottom: (callback: () => void) => import("../..").Unsubscribe;
193
- }>> | null;
65
+ }): ReadonlyStore<ThreadViewportState> | null;
194
66
  };
195
67
  export declare function useThreadModelConfig(options?: {
196
68
  optional?: false | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadContext.d.ts","sourceRoot":"","sources":["../../../src/context/react/ThreadContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;IACrD,gBAAgB,EAAE,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9D,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC/D,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAE5E,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"../../types/ContentPartComponentTypes";
2
2
  import { Unsubscribe } from "../../types";
3
- export type AssistantToolUIsState = Readonly<{
3
+ export type AssistantToolUIsState = {
4
+ /**
5
+ * Get the tool UI configured for a given tool name.
6
+ */
4
7
  getToolUI: (toolName: string) => ToolCallContentPartComponent | null;
8
+ /**
9
+ * Registers a tool UI for a given tool name. Returns an unsubscribe function to remove the tool UI.
10
+ */
5
11
  setToolUI: (toolName: string, render: ToolCallContentPartComponent) => Unsubscribe;
6
- }>;
7
- export declare const makeAssistantToolUIsStore: () => import("zustand").UseBoundStore<import("zustand").StoreApi<Readonly<{
8
- getToolUI: (toolName: string) => ToolCallContentPartComponent | null;
9
- setToolUI: (toolName: string, render: ToolCallContentPartComponent) => Unsubscribe;
10
- }>>>;
12
+ };
13
+ export declare const makeAssistantToolUIsStore: () => import("zustand").UseBoundStore<import("zustand").StoreApi<AssistantToolUIsState>>;
11
14
  //# sourceMappingURL=AssistantToolUIs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantToolUIs.d.ts","sourceRoot":"","sources":["../../../src/context/stores/AssistantToolUIs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,4BAA4B,GAAG,IAAI,CAAC;IACrE,SAAS,EAAE,CACT,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,4BAA4B,KACjC,WAAW,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,yBAAyB;eAPzB,CAAC,QAAQ,EAAE,MAAM,KAAK,4BAA4B,GAAG,IAAI;eACzD,CACT,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,4BAA4B,KACjC,WAAW;IAkCd,CAAC"}
1
+ {"version":3,"file":"AssistantToolUIs.d.ts","sourceRoot":"","sources":["../../../src/context/stores/AssistantToolUIs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,4BAA4B,GAAG,IAAI,CAAC;IAErE;;OAEG;IACH,SAAS,EAAE,CACT,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,4BAA4B,KACjC,WAAW,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,yBAAyB,0FA+BlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/stores/AssistantToolUIs.ts"],"sourcesContent":["\"use client\";\n\nimport { create } from \"zustand\";\nimport type { ToolCallContentPartComponent } from \"../../types/ContentPartComponentTypes\";\nimport { Unsubscribe } from \"../../types\";\n\nexport type AssistantToolUIsState = Readonly<{\n getToolUI: (toolName: string) => ToolCallContentPartComponent | null;\n setToolUI: (\n toolName: string,\n render: ToolCallContentPartComponent,\n ) => Unsubscribe;\n}>;\n\nexport const makeAssistantToolUIsStore = () =>\n create<AssistantToolUIsState>((set) => {\n const renderers = new Map<string, ToolCallContentPartComponent[]>();\n\n return Object.freeze({\n getToolUI: (name) => {\n const arr = renderers.get(name);\n const last = arr?.at(-1);\n if (last) return last;\n return null;\n },\n setToolUI: (name, render) => {\n let arr = renderers.get(name);\n if (!arr) {\n arr = [];\n renderers.set(name, arr);\n }\n arr.push(render);\n set({}); // notify the store listeners\n\n return () => {\n const index = arr.indexOf(render);\n if (index !== -1) {\n arr.splice(index, 1);\n }\n if (index === arr.length) {\n set({}); // notify the store listeners\n }\n };\n },\n }) satisfies AssistantToolUIsState;\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAuB;AAYhB,IAAM,4BAA4B,UACvC,uBAA8B,CAAC,QAAQ;AACrC,QAAM,YAAY,oBAAI,IAA4C;AAElE,SAAO,OAAO,OAAO;AAAA,IACnB,WAAW,CAAC,SAAS;AACnB,YAAM,MAAM,UAAU,IAAI,IAAI;AAC9B,YAAM,OAAO,KAAK,GAAG,EAAE;AACvB,UAAI,KAAM,QAAO;AACjB,aAAO;AAAA,IACT;AAAA,IACA,WAAW,CAAC,MAAM,WAAW;AAC3B,UAAI,MAAM,UAAU,IAAI,IAAI;AAC5B,UAAI,CAAC,KAAK;AACR,cAAM,CAAC;AACP,kBAAU,IAAI,MAAM,GAAG;AAAA,MACzB;AACA,UAAI,KAAK,MAAM;AACf,UAAI,CAAC,CAAC;AAEN,aAAO,MAAM;AACX,cAAM,QAAQ,IAAI,QAAQ,MAAM;AAChC,YAAI,UAAU,IAAI;AAChB,cAAI,OAAO,OAAO,CAAC;AAAA,QACrB;AACA,YAAI,UAAU,IAAI,QAAQ;AACxB,cAAI,CAAC,CAAC;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/stores/AssistantToolUIs.ts"],"sourcesContent":["\"use client\";\n\nimport { create } from \"zustand\";\nimport type { ToolCallContentPartComponent } from \"../../types/ContentPartComponentTypes\";\nimport { Unsubscribe } from \"../../types\";\n\nexport type AssistantToolUIsState = {\n /**\n * Get the tool UI configured for a given tool name.\n */\n getToolUI: (toolName: string) => ToolCallContentPartComponent | null;\n\n /**\n * Registers a tool UI for a given tool name. Returns an unsubscribe function to remove the tool UI.\n */\n setToolUI: (\n toolName: string,\n render: ToolCallContentPartComponent,\n ) => Unsubscribe;\n};\n\nexport const makeAssistantToolUIsStore = () =>\n create<AssistantToolUIsState>((set) => {\n const renderers = new Map<string, ToolCallContentPartComponent[]>();\n\n return Object.freeze({\n getToolUI: (name) => {\n const arr = renderers.get(name);\n const last = arr?.at(-1);\n if (last) return last;\n return null;\n },\n setToolUI: (name, render) => {\n let arr = renderers.get(name);\n if (!arr) {\n arr = [];\n renderers.set(name, arr);\n }\n arr.push(render);\n set({}); // notify the store listeners\n\n return () => {\n const index = arr.indexOf(render);\n if (index !== -1) {\n arr.splice(index, 1);\n }\n if (index === arr.length) {\n set({}); // notify the store listeners\n }\n };\n },\n }) satisfies AssistantToolUIsState;\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAuB;AAmBhB,IAAM,4BAA4B,UACvC,uBAA8B,CAAC,QAAQ;AACrC,QAAM,YAAY,oBAAI,IAA4C;AAElE,SAAO,OAAO,OAAO;AAAA,IACnB,WAAW,CAAC,SAAS;AACnB,YAAM,MAAM,UAAU,IAAI,IAAI;AAC9B,YAAM,OAAO,KAAK,GAAG,EAAE;AACvB,UAAI,KAAM,QAAO;AACjB,aAAO;AAAA,IACT;AAAA,IACA,WAAW,CAAC,MAAM,WAAW;AAC3B,UAAI,MAAM,UAAU,IAAI,IAAI;AAC5B,UAAI,CAAC,KAAK;AACR,cAAM,CAAC;AACP,kBAAU,IAAI,MAAM,GAAG;AAAA,MACzB;AACA,UAAI,KAAK,MAAM;AACf,UAAI,CAAC,CAAC;AAEN,aAAO,MAAM;AACX,cAAM,QAAQ,IAAI,QAAQ,MAAM;AAChC,YAAI,UAAU,IAAI;AAChB,cAAI,OAAO,OAAO,CAAC;AAAA,QACrB;AACA,YAAI,UAAU,IAAI,QAAQ;AACxB,cAAI,CAAC,CAAC;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH,CAAC;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/stores/AssistantToolUIs.ts"],"sourcesContent":["\"use client\";\n\nimport { create } from \"zustand\";\nimport type { ToolCallContentPartComponent } from \"../../types/ContentPartComponentTypes\";\nimport { Unsubscribe } from \"../../types\";\n\nexport type AssistantToolUIsState = Readonly<{\n getToolUI: (toolName: string) => ToolCallContentPartComponent | null;\n setToolUI: (\n toolName: string,\n render: ToolCallContentPartComponent,\n ) => Unsubscribe;\n}>;\n\nexport const makeAssistantToolUIsStore = () =>\n create<AssistantToolUIsState>((set) => {\n const renderers = new Map<string, ToolCallContentPartComponent[]>();\n\n return Object.freeze({\n getToolUI: (name) => {\n const arr = renderers.get(name);\n const last = arr?.at(-1);\n if (last) return last;\n return null;\n },\n setToolUI: (name, render) => {\n let arr = renderers.get(name);\n if (!arr) {\n arr = [];\n renderers.set(name, arr);\n }\n arr.push(render);\n set({}); // notify the store listeners\n\n return () => {\n const index = arr.indexOf(render);\n if (index !== -1) {\n arr.splice(index, 1);\n }\n if (index === arr.length) {\n set({}); // notify the store listeners\n }\n };\n },\n }) satisfies AssistantToolUIsState;\n });\n"],"mappings":";;;AAEA,SAAS,cAAc;AAYhB,IAAM,4BAA4B,MACvC,OAA8B,CAAC,QAAQ;AACrC,QAAM,YAAY,oBAAI,IAA4C;AAElE,SAAO,OAAO,OAAO;AAAA,IACnB,WAAW,CAAC,SAAS;AACnB,YAAM,MAAM,UAAU,IAAI,IAAI;AAC9B,YAAM,OAAO,KAAK,GAAG,EAAE;AACvB,UAAI,KAAM,QAAO;AACjB,aAAO;AAAA,IACT;AAAA,IACA,WAAW,CAAC,MAAM,WAAW;AAC3B,UAAI,MAAM,UAAU,IAAI,IAAI;AAC5B,UAAI,CAAC,KAAK;AACR,cAAM,CAAC;AACP,kBAAU,IAAI,MAAM,GAAG;AAAA,MACzB;AACA,UAAI,KAAK,MAAM;AACf,UAAI,CAAC,CAAC;AAEN,aAAO,MAAM;AACX,cAAM,QAAQ,IAAI,QAAQ,MAAM;AAChC,YAAI,UAAU,IAAI;AAChB,cAAI,OAAO,OAAO,CAAC;AAAA,QACrB;AACA,YAAI,UAAU,IAAI,QAAQ;AACxB,cAAI,CAAC,CAAC;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/stores/AssistantToolUIs.ts"],"sourcesContent":["\"use client\";\n\nimport { create } from \"zustand\";\nimport type { ToolCallContentPartComponent } from \"../../types/ContentPartComponentTypes\";\nimport { Unsubscribe } from \"../../types\";\n\nexport type AssistantToolUIsState = {\n /**\n * Get the tool UI configured for a given tool name.\n */\n getToolUI: (toolName: string) => ToolCallContentPartComponent | null;\n\n /**\n * Registers a tool UI for a given tool name. Returns an unsubscribe function to remove the tool UI.\n */\n setToolUI: (\n toolName: string,\n render: ToolCallContentPartComponent,\n ) => Unsubscribe;\n};\n\nexport const makeAssistantToolUIsStore = () =>\n create<AssistantToolUIsState>((set) => {\n const renderers = new Map<string, ToolCallContentPartComponent[]>();\n\n return Object.freeze({\n getToolUI: (name) => {\n const arr = renderers.get(name);\n const last = arr?.at(-1);\n if (last) return last;\n return null;\n },\n setToolUI: (name, render) => {\n let arr = renderers.get(name);\n if (!arr) {\n arr = [];\n renderers.set(name, arr);\n }\n arr.push(render);\n set({}); // notify the store listeners\n\n return () => {\n const index = arr.indexOf(render);\n if (index !== -1) {\n arr.splice(index, 1);\n }\n if (index === arr.length) {\n set({}); // notify the store listeners\n }\n };\n },\n }) satisfies AssistantToolUIsState;\n });\n"],"mappings":";;;AAEA,SAAS,cAAc;AAmBhB,IAAM,4BAA4B,MACvC,OAA8B,CAAC,QAAQ;AACrC,QAAM,YAAY,oBAAI,IAA4C;AAElE,SAAO,OAAO,OAAO;AAAA,IACnB,WAAW,CAAC,SAAS;AACnB,YAAM,MAAM,UAAU,IAAI,IAAI;AAC9B,YAAM,OAAO,KAAK,GAAG,EAAE;AACvB,UAAI,KAAM,QAAO;AACjB,aAAO;AAAA,IACT;AAAA,IACA,WAAW,CAAC,MAAM,WAAW;AAC3B,UAAI,MAAM,UAAU,IAAI,IAAI;AAC5B,UAAI,CAAC,KAAK;AACR,cAAM,CAAC;AACP,kBAAU,IAAI,MAAM,GAAG;AAAA,MACzB;AACA,UAAI,KAAK,MAAM;AACf,UAAI,CAAC,CAAC;AAEN,aAAO,MAAM;AACX,cAAM,QAAQ,IAAI,QAAQ,MAAM;AAChC,YAAI,UAAU,IAAI;AAChB,cAAI,OAAO,OAAO,CAAC;AAAA,QACrB;AACA,YAAI,UAAU,IAAI,QAAQ;AACxB,cAAI,CAAC,CAAC;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH,CAAC;","names":[]}
@@ -1,13 +1,8 @@
1
- export type MessageUtilsState = Readonly<{
2
- isCopied: boolean;
3
- setIsCopied: (value: boolean) => void;
4
- isHovering: boolean;
5
- setIsHovering: (value: boolean) => void;
6
- }>;
7
- export declare const makeMessageUtilsStore: () => import("zustand").UseBoundStore<import("zustand").StoreApi<Readonly<{
8
- isCopied: boolean;
9
- setIsCopied: (value: boolean) => void;
10
- isHovering: boolean;
11
- setIsHovering: (value: boolean) => void;
12
- }>>>;
1
+ export type MessageUtilsState = {
2
+ readonly isCopied: boolean;
3
+ readonly setIsCopied: (value: boolean) => void;
4
+ readonly isHovering: boolean;
5
+ readonly setIsHovering: (value: boolean) => void;
6
+ };
7
+ export declare const makeMessageUtilsStore: () => import("zustand").UseBoundStore<import("zustand").StoreApi<MessageUtilsState>>;
13
8
  //# sourceMappingURL=MessageUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageUtils.d.ts","sourceRoot":"","sources":["../../../src/context/stores/MessageUtils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEtC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,CAAC;AAEH,eAAO,MAAM,qBAAqB;cAPtB,OAAO;iBACJ,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;gBAEzB,OAAO;mBACJ,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAerC,CAAC"}
1
+ {"version":3,"file":"MessageUtils.d.ts","sourceRoot":"","sources":["../../../src/context/stores/MessageUtils.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,qBAAqB,sFAY9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/stores/MessageUtils.ts"],"sourcesContent":["import { create } from \"zustand\";\n\nexport type MessageUtilsState = Readonly<{\n isCopied: boolean;\n setIsCopied: (value: boolean) => void;\n\n isHovering: boolean;\n setIsHovering: (value: boolean) => void;\n}>;\n\nexport const makeMessageUtilsStore = () =>\n create<MessageUtilsState>((set) => {\n return {\n isCopied: false,\n setIsCopied: (value) => {\n set({ isCopied: value });\n },\n isHovering: false,\n setIsHovering: (value) => {\n set({ isHovering: value });\n },\n };\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AAUhB,IAAM,wBAAwB,UACnC,uBAA0B,CAAC,QAAQ;AACjC,SAAO;AAAA,IACL,UAAU;AAAA,IACV,aAAa,CAAC,UAAU;AACtB,UAAI,EAAE,UAAU,MAAM,CAAC;AAAA,IACzB;AAAA,IACA,YAAY;AAAA,IACZ,eAAe,CAAC,UAAU;AACxB,UAAI,EAAE,YAAY,MAAM,CAAC;AAAA,IAC3B;AAAA,EACF;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/stores/MessageUtils.ts"],"sourcesContent":["import { create } from \"zustand\";\n\nexport type MessageUtilsState = {\n readonly isCopied: boolean;\n readonly setIsCopied: (value: boolean) => void;\n\n readonly isHovering: boolean;\n readonly setIsHovering: (value: boolean) => void;\n};\n\nexport const makeMessageUtilsStore = () =>\n create<MessageUtilsState>((set) => {\n return {\n isCopied: false,\n setIsCopied: (value) => {\n set({ isCopied: value });\n },\n isHovering: false,\n setIsHovering: (value) => {\n set({ isHovering: value });\n },\n };\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AAUhB,IAAM,wBAAwB,UACnC,uBAA0B,CAAC,QAAQ;AACjC,SAAO;AAAA,IACL,UAAU;AAAA,IACV,aAAa,CAAC,UAAU;AACtB,UAAI,EAAE,UAAU,MAAM,CAAC;AAAA,IACzB;AAAA,IACA,YAAY;AAAA,IACZ,eAAe,CAAC,UAAU;AACxB,UAAI,EAAE,YAAY,MAAM,CAAC;AAAA,IAC3B;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/stores/MessageUtils.ts"],"sourcesContent":["import { create } from \"zustand\";\n\nexport type MessageUtilsState = Readonly<{\n isCopied: boolean;\n setIsCopied: (value: boolean) => void;\n\n isHovering: boolean;\n setIsHovering: (value: boolean) => void;\n}>;\n\nexport const makeMessageUtilsStore = () =>\n create<MessageUtilsState>((set) => {\n return {\n isCopied: false,\n setIsCopied: (value) => {\n set({ isCopied: value });\n },\n isHovering: false,\n setIsHovering: (value) => {\n set({ isHovering: value });\n },\n };\n });\n"],"mappings":";AAAA,SAAS,cAAc;AAUhB,IAAM,wBAAwB,MACnC,OAA0B,CAAC,QAAQ;AACjC,SAAO;AAAA,IACL,UAAU;AAAA,IACV,aAAa,CAAC,UAAU;AACtB,UAAI,EAAE,UAAU,MAAM,CAAC;AAAA,IACzB;AAAA,IACA,YAAY;AAAA,IACZ,eAAe,CAAC,UAAU;AACxB,UAAI,EAAE,YAAY,MAAM,CAAC;AAAA,IAC3B;AAAA,EACF;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/stores/MessageUtils.ts"],"sourcesContent":["import { create } from \"zustand\";\n\nexport type MessageUtilsState = {\n readonly isCopied: boolean;\n readonly setIsCopied: (value: boolean) => void;\n\n readonly isHovering: boolean;\n readonly setIsHovering: (value: boolean) => void;\n};\n\nexport const makeMessageUtilsStore = () =>\n create<MessageUtilsState>((set) => {\n return {\n isCopied: false,\n setIsCopied: (value) => {\n set({ isCopied: value });\n },\n isHovering: false,\n setIsHovering: (value) => {\n set({ isHovering: value });\n },\n };\n });\n"],"mappings":";AAAA,SAAS,cAAc;AAUhB,IAAM,wBAAwB,MACnC,OAA0B,CAAC,QAAQ;AACjC,SAAO;AAAA,IACL,UAAU;AAAA,IACV,aAAa,CAAC,UAAU;AACtB,UAAI,EAAE,UAAU,MAAM,CAAC;AAAA,IACzB;AAAA,IACA,YAAY;AAAA,IACZ,eAAe,CAAC,UAAU;AACxB,UAAI,EAAE,YAAY,MAAM,CAAC;AAAA,IAC3B;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -1,12 +1,8 @@
1
1
  import type { Unsubscribe } from "../../types/Unsubscribe";
2
- export type ThreadViewportState = Readonly<{
3
- isAtBottom: boolean;
4
- scrollToBottom: () => void;
5
- onScrollToBottom: (callback: () => void) => Unsubscribe;
6
- }>;
7
- export declare const makeThreadViewportStore: () => import("zustand").UseBoundStore<import("zustand").StoreApi<Readonly<{
8
- isAtBottom: boolean;
9
- scrollToBottom: () => void;
10
- onScrollToBottom: (callback: () => void) => Unsubscribe;
11
- }>>>;
2
+ export type ThreadViewportState = {
3
+ readonly isAtBottom: boolean;
4
+ readonly scrollToBottom: () => void;
5
+ readonly onScrollToBottom: (callback: () => void) => Unsubscribe;
6
+ };
7
+ export declare const makeThreadViewportStore: () => import("zustand").UseBoundStore<import("zustand").StoreApi<ThreadViewportState>>;
12
8
  //# sourceMappingURL=ThreadViewport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadViewport.d.ts","sourceRoot":"","sources":["../../../src/context/stores/ThreadViewport.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;CACzD,CAAC,CAAC;AAEH,eAAO,MAAM,uBAAuB;gBALtB,OAAO;oBACH,MAAM,IAAI;sBACR,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW;IAoBxD,CAAC"}
1
+ {"version":3,"file":"ThreadViewport.d.ts","sourceRoot":"","sources":["../../../src/context/stores/ThreadViewport.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,IAAI,CAAC;IACpC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;CAClE,CAAC;AAEF,eAAO,MAAM,uBAAuB,wFAiBnC,CAAC"}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- "use client";
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/stores/ThreadViewport.tsx"],"sourcesContent":["\"use client\";\nimport { create } from \"zustand\";\nimport type { Unsubscribe } from \"../../types/Unsubscribe\";\n\nexport type ThreadViewportState = Readonly<{\n isAtBottom: boolean;\n scrollToBottom: () => void;\n onScrollToBottom: (callback: () => void) => Unsubscribe;\n}>;\n\nexport const makeThreadViewportStore = () => {\n const scrollToBottomListeners = new Set<() => void>();\n\n return create<ThreadViewportState>(() => ({\n isAtBottom: true,\n scrollToBottom: () => {\n for (const listener of scrollToBottomListeners) {\n listener();\n }\n },\n onScrollToBottom: (callback) => {\n scrollToBottomListeners.add(callback);\n return () => {\n scrollToBottomListeners.delete(callback);\n };\n },\n }));\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAuB;AAShB,IAAM,0BAA0B,MAAM;AAC3C,QAAM,0BAA0B,oBAAI,IAAgB;AAEpD,aAAO,uBAA4B,OAAO;AAAA,IACxC,YAAY;AAAA,IACZ,gBAAgB,MAAM;AACpB,iBAAW,YAAY,yBAAyB;AAC9C,iBAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,kBAAkB,CAAC,aAAa;AAC9B,8BAAwB,IAAI,QAAQ;AACpC,aAAO,MAAM;AACX,gCAAwB,OAAO,QAAQ;AAAA,MACzC;AAAA,IACF;AAAA,EACF,EAAE;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/stores/ThreadViewport.tsx"],"sourcesContent":["import { create } from \"zustand\";\nimport type { Unsubscribe } from \"../../types/Unsubscribe\";\n\nexport type ThreadViewportState = {\n readonly isAtBottom: boolean;\n readonly scrollToBottom: () => void;\n readonly onScrollToBottom: (callback: () => void) => Unsubscribe;\n};\n\nexport const makeThreadViewportStore = () => {\n const scrollToBottomListeners = new Set<() => void>();\n\n return create<ThreadViewportState>(() => ({\n isAtBottom: true,\n scrollToBottom: () => {\n for (const listener of scrollToBottomListeners) {\n listener();\n }\n },\n onScrollToBottom: (callback) => {\n scrollToBottomListeners.add(callback);\n return () => {\n scrollToBottomListeners.delete(callback);\n };\n },\n }));\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AAShB,IAAM,0BAA0B,MAAM;AAC3C,QAAM,0BAA0B,oBAAI,IAAgB;AAEpD,aAAO,uBAA4B,OAAO;AAAA,IACxC,YAAY;AAAA,IACZ,gBAAgB,MAAM;AACpB,iBAAW,YAAY,yBAAyB;AAC9C,iBAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,kBAAkB,CAAC,aAAa;AAC9B,8BAAwB,IAAI,QAAQ;AACpC,aAAO,MAAM;AACX,gCAAwB,OAAO,QAAQ;AAAA,MACzC;AAAA,IACF;AAAA,EACF,EAAE;AACJ;","names":[]}
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  // src/context/stores/ThreadViewport.tsx
4
2
  import { create } from "zustand";
5
3
  var makeThreadViewportStore = () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/stores/ThreadViewport.tsx"],"sourcesContent":["\"use client\";\nimport { create } from \"zustand\";\nimport type { Unsubscribe } from \"../../types/Unsubscribe\";\n\nexport type ThreadViewportState = Readonly<{\n isAtBottom: boolean;\n scrollToBottom: () => void;\n onScrollToBottom: (callback: () => void) => Unsubscribe;\n}>;\n\nexport const makeThreadViewportStore = () => {\n const scrollToBottomListeners = new Set<() => void>();\n\n return create<ThreadViewportState>(() => ({\n isAtBottom: true,\n scrollToBottom: () => {\n for (const listener of scrollToBottomListeners) {\n listener();\n }\n },\n onScrollToBottom: (callback) => {\n scrollToBottomListeners.add(callback);\n return () => {\n scrollToBottomListeners.delete(callback);\n };\n },\n }));\n};\n"],"mappings":";;;AACA,SAAS,cAAc;AAShB,IAAM,0BAA0B,MAAM;AAC3C,QAAM,0BAA0B,oBAAI,IAAgB;AAEpD,SAAO,OAA4B,OAAO;AAAA,IACxC,YAAY;AAAA,IACZ,gBAAgB,MAAM;AACpB,iBAAW,YAAY,yBAAyB;AAC9C,iBAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,kBAAkB,CAAC,aAAa;AAC9B,8BAAwB,IAAI,QAAQ;AACpC,aAAO,MAAM;AACX,gCAAwB,OAAO,QAAQ;AAAA,MACzC;AAAA,IACF;AAAA,EACF,EAAE;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/context/stores/ThreadViewport.tsx"],"sourcesContent":["import { create } from \"zustand\";\nimport type { Unsubscribe } from \"../../types/Unsubscribe\";\n\nexport type ThreadViewportState = {\n readonly isAtBottom: boolean;\n readonly scrollToBottom: () => void;\n readonly onScrollToBottom: (callback: () => void) => Unsubscribe;\n};\n\nexport const makeThreadViewportStore = () => {\n const scrollToBottomListeners = new Set<() => void>();\n\n return create<ThreadViewportState>(() => ({\n isAtBottom: true,\n scrollToBottom: () => {\n for (const listener of scrollToBottomListeners) {\n listener();\n }\n },\n onScrollToBottom: (callback) => {\n scrollToBottomListeners.add(callback);\n return () => {\n scrollToBottomListeners.delete(callback);\n };\n },\n }));\n};\n"],"mappings":";AAAA,SAAS,cAAc;AAShB,IAAM,0BAA0B,MAAM;AAC3C,QAAM,0BAA0B,oBAAI,IAAgB;AAEpD,SAAO,OAA4B,OAAO;AAAA,IACxC,YAAY;AAAA,IACZ,gBAAgB,MAAM;AACpB,iBAAW,YAAY,yBAAyB;AAC9C,iBAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,kBAAkB,CAAC,aAAa;AAC9B,8BAAwB,IAAI,QAAQ;AACpC,aAAO,MAAM;AACX,gCAAwB,OAAO,QAAQ;AAAA,MACzC;AAAA,IACF;AAAA,EACF,EAAE;AACJ;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import { UIContentPart } from "../../types";
2
2
  export declare const useContentPartDisplay: () => UIContentPart & {
3
- status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
3
+ readonly status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
4
4
  };
5
5
  //# sourceMappingURL=useContentPartDisplay.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ImageContentPart } from "../../types";
2
2
  export declare const useContentPartImage: () => ImageContentPart & {
3
- status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
3
+ readonly status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
4
4
  };
5
5
  //# sourceMappingURL=useContentPartImage.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { TextContentPart } from "../../types";
2
2
  export declare const useContentPartText: () => TextContentPart & {
3
- status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
3
+ readonly status: import("../../types/AssistantTypes").ContentPartStatus | import("../../types/AssistantTypes").ToolCallContentPartStatus;
4
4
  };
5
5
  //# sourceMappingURL=useContentPartText.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { ModelConfigProvider, AppendMessage, Unsubscribe } from "../../types";
2
2
  import { ExportedMessageRepository, MessageRepository } from "../utils/MessageRepository";
3
3
  import { DefaultThreadComposerRuntimeCore } from "../composer/DefaultThreadComposerRuntimeCore";
4
- import { AddToolResultOptions, ThreadSuggestion, SubmitFeedbackOptions, ThreadRuntimeCore, SpeechState, RuntimeCapabilities, ThreadRuntimeEventType, ThreadMetadataRuntimeCore } from "../core/ThreadRuntimeCore";
4
+ import { AddToolResultOptions, ThreadSuggestion, SubmitFeedbackOptions, ThreadRuntimeCore, SpeechState, RuntimeCapabilities, SubmittedFeedback, ThreadRuntimeEventType, ThreadMetadataRuntimeCore } from "../core/ThreadRuntimeCore";
5
5
  import { DefaultEditComposerRuntimeCore } from "../composer/DefaultEditComposerRuntimeCore";
6
6
  import { SpeechSynthesisAdapter } from "../speech/SpeechAdapterTypes";
7
7
  import { FeedbackAdapter } from "../feedback/FeedbackAdapter";
@@ -43,9 +43,7 @@ export declare abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore
43
43
  _notifyEventSubscribers(event: ThreadRuntimeEventType): void;
44
44
  subscribe(callback: () => void): Unsubscribe;
45
45
  private _submittedFeedback;
46
- getSubmittedFeedback(messageId: string): Readonly<{
47
- type: "negative" | "positive";
48
- }> | undefined;
46
+ getSubmittedFeedback(messageId: string): SubmittedFeedback | undefined;
49
47
  submitFeedback({ messageId, type }: SubmitFeedbackOptions): void;
50
48
  private _stopSpeaking;
51
49
  speech: SpeechState | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseThreadRuntimeCore.d.ts","sourceRoot":"","sources":["../../../src/runtimes/core/BaseThreadRuntimeCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EAEnB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,KAAK,kBAAkB,GAAG;IACxB,MAAM,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,8BAAsB,qBAAsB,YAAW,iBAAiB;IA0BpE,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;IA1B5B,OAAO,CAAC,cAAc,CAAyB;IAE/C,S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AM,CAAC,IAAI,EAAE,yBAAyB;IAK7C,OAAO,CAAC,iBAAiB,CAAsC;IAExD,WAAW,CAAC,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,IAAI;CAiBvE"}
@@ -3,16 +3,16 @@ import type { Unsubscribe } from "../../types/Unsubscribe";
3
3
  import { SpeechSynthesisAdapter } from "../speech/SpeechAdapterTypes";
4
4
  import { ExportedMessageRepository } from "../utils/MessageRepository";
5
5
  import { ComposerRuntimeCore, ThreadComposerRuntimeCore } from "./ComposerRuntimeCore";
6
- export type RuntimeCapabilities = Readonly<{
7
- switchToBranch: boolean;
8
- edit: boolean;
9
- reload: boolean;
10
- cancel: boolean;
11
- unstable_copy: boolean;
12
- speech: boolean;
13
- attachments: boolean;
14
- feedback: boolean;
15
- }>;
6
+ export type RuntimeCapabilities = {
7
+ readonly switchToBranch: boolean;
8
+ readonly edit: boolean;
9
+ readonly reload: boolean;
10
+ readonly cancel: boolean;
11
+ readonly unstable_copy: boolean;
12
+ readonly speech: boolean;
13
+ readonly attachments: boolean;
14
+ readonly feedback: boolean;
15
+ };
16
16
  export type AddToolResultOptions = {
17
17
  messageId: string;
18
18
  toolName: string;
@@ -26,27 +26,27 @@ export type SubmitFeedbackOptions = {
26
26
  export type ThreadSuggestion = {
27
27
  prompt: string;
28
28
  };
29
- export type SpeechState = Readonly<{
30
- messageId: string;
31
- status: SpeechSynthesisAdapter.Status;
32
- }>;
33
- export type SubmittedFeedback = Readonly<{
34
- type: "negative" | "positive";
35
- }>;
29
+ export type SpeechState = {
30
+ readonly messageId: string;
31
+ readonly status: SpeechSynthesisAdapter.Status;
32
+ };
33
+ export type SubmittedFeedback = {
34
+ readonly type: "negative" | "positive";
35
+ };
36
36
  export type ThreadMetadata = Readonly<{
37
- threadId: string;
38
- state: "archived" | "regular" | "new" | "deleted";
39
- title?: string | undefined;
37
+ readonly threadId: string;
38
+ readonly state: "archived" | "regular" | "new" | "deleted";
39
+ readonly title?: string | undefined;
40
40
  }>;
41
41
  export type ThreadRuntimeEventType = "switched-to" | "switched-away" | "run-start" | "model-config-update";
42
- export type ThreadMetadataRuntimeCore = ThreadMetadata & Readonly<{
42
+ export type ThreadMetadataRuntimeCore = ThreadMetadata & {
43
43
  create(title?: string): Promise<void>;
44
44
  rename(newTitle: string): Promise<void>;
45
45
  archive(): Promise<void>;
46
46
  unarchive(): Promise<void>;
47
47
  delete(): Promise<void>;
48
48
  subscribe(callback: () => void): Unsubscribe;
49
- }>;
49
+ };
50
50
  export type ThreadRuntimeCore = Readonly<{
51
51
  metadata: ThreadMetadataRuntimeCore;
52
52
  getMessageById: (messageId: string) => {
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadRuntimeCore.d.ts","sourceRoot":"","sources":["../../../src/runtimes/core/ThreadRuntimeCore.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAA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,gBAAgB,EAAE,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC;IAEhB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;IAEjD,MAAM,CAAC,UAAU,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACpD,MAAM,IAAI,yBAAyB,CAAC;IAEpC,WAAW,CAAC,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;CAC/E,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtimes/core/ThreadRuntimeCore.tsx"],"sourcesContent":["import { AppendMessage, ModelConfig, ThreadMessage } from \"../../types\";\nimport type { Unsubscribe } from \"../../types/Unsubscribe\";\nimport { SpeechSynthesisAdapter } from \"../speech/SpeechAdapterTypes\";\nimport { ExportedMessageRepository } from \"../utils/MessageRepository\";\nimport {\n ComposerRuntimeCore,\n ThreadComposerRuntimeCore,\n} from \"./ComposerRuntimeCore\";\n\nexport type RuntimeCapabilities = Readonly<{\n switchToBranch: boolean;\n edit: boolean;\n reload: boolean;\n cancel: boolean;\n unstable_copy: boolean;\n speech: boolean;\n attachments: boolean;\n feedback: boolean;\n}>;\n\nexport type AddToolResultOptions = {\n messageId: string;\n toolName: string;\n toolCallId: string;\n result: any;\n};\n\nexport type SubmitFeedbackOptions = {\n messageId: string;\n type: \"negative\" | \"positive\";\n};\n\nexport type ThreadSuggestion = {\n prompt: string;\n};\n\nexport type SpeechState = Readonly<{\n messageId: string;\n status: SpeechSynthesisAdapter.Status;\n}>;\n\nexport type SubmittedFeedback = Readonly<{\n type: \"negative\" | \"positive\";\n}>;\n\nexport type ThreadMetadata = Readonly<{\n threadId: string;\n state: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n title?: string | undefined;\n}>;\n\nexport type ThreadRuntimeEventType =\n | \"switched-to\"\n | \"switched-away\"\n | \"run-start\"\n | \"model-config-update\";\n\nexport type ThreadMetadataRuntimeCore = ThreadMetadata &\n Readonly<{\n create(title?: string): Promise<void>;\n rename(newTitle: string): Promise<void>;\n archive(): Promise<void>;\n unarchive(): Promise<void>;\n delete(): Promise<void>;\n subscribe(callback: () => void): Unsubscribe;\n }>;\n\nexport type ThreadRuntimeCore = Readonly<{\n metadata: ThreadMetadataRuntimeCore;\n\n getMessageById: (messageId: string) =>\n | {\n parentId: string | null;\n message: ThreadMessage;\n }\n | undefined;\n\n getBranches: (messageId: string) => readonly string[];\n switchToBranch: (branchId: string) => void;\n\n append: (message: AppendMessage) => void;\n startRun: (parentId: string | null) => void;\n cancelRun: () => void;\n\n addToolResult: (options: AddToolResultOptions) => void;\n\n speak: (messageId: string) => void;\n stopSpeaking: () => void;\n\n getSubmittedFeedback: (messageId: string) => SubmittedFeedback | undefined;\n submitFeedback: (feedback: SubmitFeedbackOptions) => void;\n\n getModelConfig: () => ModelConfig;\n\n composer: ThreadComposerRuntimeCore;\n getEditComposer: (messageId: string) => ComposerRuntimeCore | undefined;\n beginEdit: (messageId: string) => void;\n\n speech: SpeechState | undefined;\n\n capabilities: Readonly<RuntimeCapabilities>;\n isDisabled: boolean;\n messages: readonly ThreadMessage[];\n suggestions: readonly ThreadSuggestion[];\n extras: unknown;\n\n subscribe: (callback: () => void) => Unsubscribe;\n\n import(repository: ExportedMessageRepository): void;\n export(): ExportedMessageRepository;\n\n unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../src/runtimes/core/ThreadRuntimeCore.tsx"],"sourcesContent":["import { AppendMessage, ModelConfig, ThreadMessage } from \"../../types\";\nimport type { Unsubscribe } from \"../../types/Unsubscribe\";\nimport { SpeechSynthesisAdapter } from \"../speech/SpeechAdapterTypes\";\nimport { ExportedMessageRepository } from \"../utils/MessageRepository\";\nimport {\n ComposerRuntimeCore,\n ThreadComposerRuntimeCore,\n} from \"./ComposerRuntimeCore\";\n\nexport type RuntimeCapabilities = {\n readonly switchToBranch: boolean;\n readonly edit: boolean;\n readonly reload: boolean;\n readonly cancel: boolean;\n readonly unstable_copy: boolean;\n readonly speech: boolean;\n readonly attachments: boolean;\n readonly feedback: boolean;\n};\n\nexport type AddToolResultOptions = {\n messageId: string;\n toolName: string;\n toolCallId: string;\n result: any;\n};\n\nexport type SubmitFeedbackOptions = {\n messageId: string;\n type: \"negative\" | \"positive\";\n};\n\nexport type ThreadSuggestion = {\n prompt: string;\n};\n\nexport type SpeechState = {\n readonly messageId: string;\n readonly status: SpeechSynthesisAdapter.Status;\n};\n\nexport type SubmittedFeedback = {\n readonly type: \"negative\" | \"positive\";\n};\n\nexport type ThreadMetadata = Readonly<{\n readonly threadId: string;\n readonly state: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n readonly title?: string | undefined;\n}>;\n\nexport type ThreadRuntimeEventType =\n | \"switched-to\"\n | \"switched-away\"\n | \"run-start\"\n | \"model-config-update\";\n\nexport type ThreadMetadataRuntimeCore = ThreadMetadata & {\n create(title?: string): Promise<void>;\n rename(newTitle: string): Promise<void>;\n archive(): Promise<void>;\n unarchive(): Promise<void>;\n delete(): Promise<void>;\n subscribe(callback: () => void): Unsubscribe;\n};\n\nexport type ThreadRuntimeCore = Readonly<{\n metadata: ThreadMetadataRuntimeCore;\n\n getMessageById: (messageId: string) =>\n | {\n parentId: string | null;\n message: ThreadMessage;\n }\n | undefined;\n\n getBranches: (messageId: string) => readonly string[];\n switchToBranch: (branchId: string) => void;\n\n append: (message: AppendMessage) => void;\n startRun: (parentId: string | null) => void;\n cancelRun: () => void;\n\n addToolResult: (options: AddToolResultOptions) => void;\n\n speak: (messageId: string) => void;\n stopSpeaking: () => void;\n\n getSubmittedFeedback: (messageId: string) => SubmittedFeedback | undefined;\n submitFeedback: (feedback: SubmitFeedbackOptions) => void;\n\n getModelConfig: () => ModelConfig;\n\n composer: ThreadComposerRuntimeCore;\n getEditComposer: (messageId: string) => ComposerRuntimeCore | undefined;\n beginEdit: (messageId: string) => void;\n\n speech: SpeechState | undefined;\n\n capabilities: Readonly<RuntimeCapabilities>;\n isDisabled: boolean;\n messages: readonly ThreadMessage[];\n suggestions: readonly ThreadSuggestion[];\n extras: unknown;\n\n subscribe: (callback: () => void) => Unsubscribe;\n\n import(repository: ExportedMessageRepository): void;\n export(): ExportedMessageRepository;\n\n unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"fromCoreMessage.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/edge/converters/fromCoreMessage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,WAAW,EAEX,aAAa,EACb,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,gBAAgB,YAClB,SAAS,WAAW,EAAE,KAC9B,aAAa,EAEf,CAAC;AAEF,eAAO,MAAM,eAAe,YACjB,WAAW;;;;MAMnB,aA4CF,CAAC"}
1
+ {"version":3,"file":"fromCoreMessage.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/edge/converters/fromCoreMessage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,WAAW,EAEX,aAAa,EACb,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,gBAAgB,YAClB,SAAS,WAAW,EAAE,KAC9B,aAAa,EAEf,CAAC;AAEF,eAAO,MAAM,eAAe,YACjB,WAAW;;;;MAMnB,aAgDF,CAAC"}
@@ -52,20 +52,23 @@ var fromCoreMessage = (message, {
52
52
  }
53
53
  return part;
54
54
  }),
55
- status
55
+ status,
56
+ metadata: { steps: [], custom: {} }
56
57
  };
57
58
  case "user":
58
59
  return {
59
60
  ...commonProps,
60
61
  role,
61
62
  content: message.content,
62
- attachments
63
+ attachments,
64
+ metadata: { custom: {} }
63
65
  };
64
66
  case "system":
65
67
  return {
66
68
  ...commonProps,
67
69
  role,
68
- content: message.content
70
+ content: message.content,
71
+ metadata: { custom: {} }
69
72
  };
70
73
  default: {
71
74
  const unsupportedRole = role;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/runtimes/edge/converters/fromCoreMessage.ts"],"sourcesContent":["import { generateId } from \"../../../internal\";\nimport {\n ThreadMessage,\n CoreMessage,\n ToolCallContentPart,\n MessageStatus,\n CompleteAttachment,\n} from \"../../../types\";\n\nexport const fromCoreMessages = (\n message: readonly CoreMessage[],\n): ThreadMessage[] => {\n return message.map((message) => fromCoreMessage(message));\n};\n\nexport const fromCoreMessage = (\n message: CoreMessage,\n {\n id = generateId(),\n status = { type: \"complete\", reason: \"unknown\" } as MessageStatus,\n attachments = [] as readonly CompleteAttachment[],\n } = {},\n): ThreadMessage => {\n const commonProps = {\n id,\n createdAt: new Date(),\n };\n\n const role = message.role;\n switch (role) {\n case \"assistant\":\n return {\n ...commonProps,\n role,\n content: message.content.map((part) => {\n if (part.type === \"tool-call\") {\n return {\n ...part,\n argsText: JSON.stringify(part.args),\n } satisfies ToolCallContentPart;\n }\n return part;\n }),\n status,\n } satisfies ThreadMessage;\n\n case \"user\":\n return {\n ...commonProps,\n role,\n content: message.content,\n attachments,\n } satisfies ThreadMessage;\n\n case \"system\":\n return {\n ...commonProps,\n role,\n content: message.content,\n } satisfies ThreadMessage;\n\n default: {\n const unsupportedRole: never = role;\n throw new Error(`Unknown message role: ${unsupportedRole}`);\n }\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2B;AASpB,IAAM,mBAAmB,CAC9B,YACoB;AACpB,SAAO,QAAQ,IAAI,CAACA,aAAY,gBAAgBA,QAAO,CAAC;AAC1D;AAEO,IAAM,kBAAkB,CAC7B,SACA;AAAA,EACE,SAAK,4BAAW;AAAA,EAChB,SAAS,EAAE,MAAM,YAAY,QAAQ,UAAU;AAAA,EAC/C,cAAc,CAAC;AACjB,IAAI,CAAC,MACa;AAClB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,WAAW,oBAAI,KAAK;AAAA,EACtB;AAEA,QAAM,OAAO,QAAQ;AACrB,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ,QAAQ,IAAI,CAAC,SAAS;AACrC,cAAI,KAAK,SAAS,aAAa;AAC7B,mBAAO;AAAA,cACL,GAAG;AAAA,cACH,UAAU,KAAK,UAAU,KAAK,IAAI;AAAA,YACpC;AAAA,UACF;AACA,iBAAO;AAAA,QACT,CAAC;AAAA,QACD;AAAA,MACF;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB;AAAA,MACF;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,MACnB;AAAA,IAEF,SAAS;AACP,YAAM,kBAAyB;AAC/B,YAAM,IAAI,MAAM,yBAAyB,eAAe,EAAE;AAAA,IAC5D;AAAA,EACF;AACF;","names":["message"]}
1
+ {"version":3,"sources":["../../../../src/runtimes/edge/converters/fromCoreMessage.ts"],"sourcesContent":["import { generateId } from \"../../../internal\";\nimport {\n ThreadMessage,\n CoreMessage,\n ToolCallContentPart,\n MessageStatus,\n CompleteAttachment,\n} from \"../../../types\";\n\nexport const fromCoreMessages = (\n message: readonly CoreMessage[],\n): ThreadMessage[] => {\n return message.map((message) => fromCoreMessage(message));\n};\n\nexport const fromCoreMessage = (\n message: CoreMessage,\n {\n id = generateId(),\n status = { type: \"complete\", reason: \"unknown\" } as MessageStatus,\n attachments = [] as readonly CompleteAttachment[],\n } = {},\n): ThreadMessage => {\n const commonProps = {\n id,\n createdAt: new Date(),\n };\n\n const role = message.role;\n switch (role) {\n case \"assistant\":\n return {\n ...commonProps,\n role,\n content: message.content.map((part) => {\n if (part.type === \"tool-call\") {\n return {\n ...part,\n argsText: JSON.stringify(part.args),\n } satisfies ToolCallContentPart;\n }\n return part;\n }),\n status,\n\n metadata: { steps: [], custom: {} },\n } satisfies ThreadMessage;\n\n case \"user\":\n return {\n ...commonProps,\n role,\n content: message.content,\n attachments,\n metadata: { custom: {} },\n } satisfies ThreadMessage;\n\n case \"system\":\n return {\n ...commonProps,\n role,\n content: message.content,\n metadata: { custom: {} },\n } satisfies ThreadMessage;\n\n default: {\n const unsupportedRole: never = role;\n throw new Error(`Unknown message role: ${unsupportedRole}`);\n }\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2B;AASpB,IAAM,mBAAmB,CAC9B,YACoB;AACpB,SAAO,QAAQ,IAAI,CAACA,aAAY,gBAAgBA,QAAO,CAAC;AAC1D;AAEO,IAAM,kBAAkB,CAC7B,SACA;AAAA,EACE,SAAK,4BAAW;AAAA,EAChB,SAAS,EAAE,MAAM,YAAY,QAAQ,UAAU;AAAA,EAC/C,cAAc,CAAC;AACjB,IAAI,CAAC,MACa;AAClB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,WAAW,oBAAI,KAAK;AAAA,EACtB;AAEA,QAAM,OAAO,QAAQ;AACrB,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ,QAAQ,IAAI,CAAC,SAAS;AACrC,cAAI,KAAK,SAAS,aAAa;AAC7B,mBAAO;AAAA,cACL,GAAG;AAAA,cACH,UAAU,KAAK,UAAU,KAAK,IAAI;AAAA,YACpC;AAAA,UACF;AACA,iBAAO;AAAA,QACT,CAAC;AAAA,QACD;AAAA,QAEA,UAAU,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE;AAAA,MACpC;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB;AAAA,QACA,UAAU,EAAE,QAAQ,CAAC,EAAE;AAAA,MACzB;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,UAAU,EAAE,QAAQ,CAAC,EAAE;AAAA,MACzB;AAAA,IAEF,SAAS;AACP,YAAM,kBAAyB;AAC/B,YAAM,IAAI,MAAM,yBAAyB,eAAe,EAAE;AAAA,IAC5D;AAAA,EACF;AACF;","names":["message"]}
@@ -27,20 +27,23 @@ var fromCoreMessage = (message, {
27
27
  }
28
28
  return part;
29
29
  }),
30
- status
30
+ status,
31
+ metadata: { steps: [], custom: {} }
31
32
  };
32
33
  case "user":
33
34
  return {
34
35
  ...commonProps,
35
36
  role,
36
37
  content: message.content,
37
- attachments
38
+ attachments,
39
+ metadata: { custom: {} }
38
40
  };
39
41
  case "system":
40
42
  return {
41
43
  ...commonProps,
42
44
  role,
43
- content: message.content
45
+ content: message.content,
46
+ metadata: { custom: {} }
44
47
  };
45
48
  default: {
46
49
  const unsupportedRole = role;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/runtimes/edge/converters/fromCoreMessage.ts"],"sourcesContent":["import { generateId } from \"../../../internal\";\nimport {\n ThreadMessage,\n CoreMessage,\n ToolCallContentPart,\n MessageStatus,\n CompleteAttachment,\n} from \"../../../types\";\n\nexport const fromCoreMessages = (\n message: readonly CoreMessage[],\n): ThreadMessage[] => {\n return message.map((message) => fromCoreMessage(message));\n};\n\nexport const fromCoreMessage = (\n message: CoreMessage,\n {\n id = generateId(),\n status = { type: \"complete\", reason: \"unknown\" } as MessageStatus,\n attachments = [] as readonly CompleteAttachment[],\n } = {},\n): ThreadMessage => {\n const commonProps = {\n id,\n createdAt: new Date(),\n };\n\n const role = message.role;\n switch (role) {\n case \"assistant\":\n return {\n ...commonProps,\n role,\n content: message.content.map((part) => {\n if (part.type === \"tool-call\") {\n return {\n ...part,\n argsText: JSON.stringify(part.args),\n } satisfies ToolCallContentPart;\n }\n return part;\n }),\n status,\n } satisfies ThreadMessage;\n\n case \"user\":\n return {\n ...commonProps,\n role,\n content: message.content,\n attachments,\n } satisfies ThreadMessage;\n\n case \"system\":\n return {\n ...commonProps,\n role,\n content: message.content,\n } satisfies ThreadMessage;\n\n default: {\n const unsupportedRole: never = role;\n throw new Error(`Unknown message role: ${unsupportedRole}`);\n }\n }\n};\n"],"mappings":";AAAA,SAAS,kBAAkB;AASpB,IAAM,mBAAmB,CAC9B,YACoB;AACpB,SAAO,QAAQ,IAAI,CAACA,aAAY,gBAAgBA,QAAO,CAAC;AAC1D;AAEO,IAAM,kBAAkB,CAC7B,SACA;AAAA,EACE,KAAK,WAAW;AAAA,EAChB,SAAS,EAAE,MAAM,YAAY,QAAQ,UAAU;AAAA,EAC/C,cAAc,CAAC;AACjB,IAAI,CAAC,MACa;AAClB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,WAAW,oBAAI,KAAK;AAAA,EACtB;AAEA,QAAM,OAAO,QAAQ;AACrB,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ,QAAQ,IAAI,CAAC,SAAS;AACrC,cAAI,KAAK,SAAS,aAAa;AAC7B,mBAAO;AAAA,cACL,GAAG;AAAA,cACH,UAAU,KAAK,UAAU,KAAK,IAAI;AAAA,YACpC;AAAA,UACF;AACA,iBAAO;AAAA,QACT,CAAC;AAAA,QACD;AAAA,MACF;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB;AAAA,MACF;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,MACnB;AAAA,IAEF,SAAS;AACP,YAAM,kBAAyB;AAC/B,YAAM,IAAI,MAAM,yBAAyB,eAAe,EAAE;AAAA,IAC5D;AAAA,EACF;AACF;","names":["message"]}
1
+ {"version":3,"sources":["../../../../src/runtimes/edge/converters/fromCoreMessage.ts"],"sourcesContent":["import { generateId } from \"../../../internal\";\nimport {\n ThreadMessage,\n CoreMessage,\n ToolCallContentPart,\n MessageStatus,\n CompleteAttachment,\n} from \"../../../types\";\n\nexport const fromCoreMessages = (\n message: readonly CoreMessage[],\n): ThreadMessage[] => {\n return message.map((message) => fromCoreMessage(message));\n};\n\nexport const fromCoreMessage = (\n message: CoreMessage,\n {\n id = generateId(),\n status = { type: \"complete\", reason: \"unknown\" } as MessageStatus,\n attachments = [] as readonly CompleteAttachment[],\n } = {},\n): ThreadMessage => {\n const commonProps = {\n id,\n createdAt: new Date(),\n };\n\n const role = message.role;\n switch (role) {\n case \"assistant\":\n return {\n ...commonProps,\n role,\n content: message.content.map((part) => {\n if (part.type === \"tool-call\") {\n return {\n ...part,\n argsText: JSON.stringify(part.args),\n } satisfies ToolCallContentPart;\n }\n return part;\n }),\n status,\n\n metadata: { steps: [], custom: {} },\n } satisfies ThreadMessage;\n\n case \"user\":\n return {\n ...commonProps,\n role,\n content: message.content,\n attachments,\n metadata: { custom: {} },\n } satisfies ThreadMessage;\n\n case \"system\":\n return {\n ...commonProps,\n role,\n content: message.content,\n metadata: { custom: {} },\n } satisfies ThreadMessage;\n\n default: {\n const unsupportedRole: never = role;\n throw new Error(`Unknown message role: ${unsupportedRole}`);\n }\n }\n};\n"],"mappings":";AAAA,SAAS,kBAAkB;AASpB,IAAM,mBAAmB,CAC9B,YACoB;AACpB,SAAO,QAAQ,IAAI,CAACA,aAAY,gBAAgBA,QAAO,CAAC;AAC1D;AAEO,IAAM,kBAAkB,CAC7B,SACA;AAAA,EACE,KAAK,WAAW;AAAA,EAChB,SAAS,EAAE,MAAM,YAAY,QAAQ,UAAU;AAAA,EAC/C,cAAc,CAAC;AACjB,IAAI,CAAC,MACa;AAClB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,WAAW,oBAAI,KAAK;AAAA,EACtB;AAEA,QAAM,OAAO,QAAQ;AACrB,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ,QAAQ,IAAI,CAAC,SAAS;AACrC,cAAI,KAAK,SAAS,aAAa;AAC7B,mBAAO;AAAA,cACL,GAAG;AAAA,cACH,UAAU,KAAK,UAAU,KAAK,IAAI;AAAA,YACpC;AAAA,UACF;AACA,iBAAO;AAAA,QACT,CAAC;AAAA,QACD;AAAA,QAEA,UAAU,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE;AAAA,MACpC;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB;AAAA,QACA,UAAU,EAAE,QAAQ,CAAC,EAAE;AAAA,MACzB;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,UAAU,EAAE,QAAQ,CAAC,EAAE;AAAA,MACzB;AAAA,IAEF,SAAS;AACP,YAAM,kBAAyB;AAC/B,YAAM,IAAI,MAAM,yBAAyB,eAAe,EAAE;AAAA,IAC5D;AAAA,EACF;AACF;","names":["message"]}