@assistant-ui/react 0.10.29 → 0.10.31

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 (57) hide show
  1. package/dist/api/AttachmentRuntime.d.ts +1 -1
  2. package/dist/api/AttachmentRuntime.d.ts.map +1 -1
  3. package/dist/api/AttachmentRuntime.js.map +1 -1
  4. package/dist/api/ComposerRuntime.d.ts +3 -10
  5. package/dist/api/ComposerRuntime.d.ts.map +1 -1
  6. package/dist/api/ComposerRuntime.js.map +1 -1
  7. package/dist/api/MessagePartRuntime.d.ts +1 -1
  8. package/dist/api/MessagePartRuntime.d.ts.map +1 -1
  9. package/dist/api/MessagePartRuntime.js.map +1 -1
  10. package/dist/api/MessageRuntime.d.ts +10 -4
  11. package/dist/api/MessageRuntime.d.ts.map +1 -1
  12. package/dist/api/MessageRuntime.js.map +1 -1
  13. package/dist/api/RuntimeBindings.d.ts +38 -0
  14. package/dist/api/RuntimeBindings.d.ts.map +1 -0
  15. package/dist/api/RuntimeBindings.js +1 -0
  16. package/dist/api/RuntimeBindings.js.map +1 -0
  17. package/dist/api/ThreadListItemRuntime.d.ts +2 -12
  18. package/dist/api/ThreadListItemRuntime.d.ts.map +1 -1
  19. package/dist/api/ThreadListItemRuntime.js.map +1 -1
  20. package/dist/api/ThreadRuntime.d.ts +1 -1
  21. package/dist/api/ThreadRuntime.d.ts.map +1 -1
  22. package/dist/api/ThreadRuntime.js.map +1 -1
  23. package/dist/context/react/AttachmentContext.d.ts +48 -48
  24. package/dist/primitives/message/MessagePartsGroupedByParentId.d.ts.map +1 -1
  25. package/dist/primitives/message/MessagePartsGroupedByParentId.js +9 -17
  26. package/dist/primitives/message/MessagePartsGroupedByParentId.js.map +1 -1
  27. package/dist/runtimes/core/ThreadListRuntimeCore.d.ts +2 -1
  28. package/dist/runtimes/core/ThreadListRuntimeCore.d.ts.map +1 -1
  29. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.d.ts +1 -1
  30. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.d.ts.map +1 -1
  31. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js +1 -1
  32. package/dist/runtimes/external-store/ExternalStoreRuntimeCore.js.map +1 -1
  33. package/dist/types/AssistantTypes.d.ts +4 -50
  34. package/dist/types/AssistantTypes.d.ts.map +1 -1
  35. package/dist/types/AttachmentTypes.d.ts +1 -1
  36. package/dist/types/AttachmentTypes.d.ts.map +1 -1
  37. package/dist/types/MessagePartTypes.d.ts +49 -0
  38. package/dist/types/MessagePartTypes.d.ts.map +1 -0
  39. package/dist/types/MessagePartTypes.js +1 -0
  40. package/dist/types/MessagePartTypes.js.map +1 -0
  41. package/dist/types/index.d.ts +1 -0
  42. package/dist/types/index.d.ts.map +1 -1
  43. package/package.json +2 -2
  44. package/src/api/AttachmentRuntime.ts +1 -1
  45. package/src/api/ComposerRuntime.ts +12 -16
  46. package/src/api/MessagePartRuntime.ts +1 -1
  47. package/src/api/MessageRuntime.ts +2 -5
  48. package/src/api/RuntimeBindings.ts +70 -0
  49. package/src/api/ThreadListItemRuntime.ts +5 -14
  50. package/src/api/ThreadRuntime.ts +1 -1
  51. package/src/primitives/message/MessagePartsGroupedByParentId.tsx +22 -29
  52. package/src/runtimes/core/ThreadListRuntimeCore.tsx +2 -1
  53. package/src/runtimes/external-store/ExternalStoreRuntimeCore.tsx +1 -1
  54. package/src/types/AssistantTypes.ts +27 -70
  55. package/src/types/AttachmentTypes.ts +1 -1
  56. package/src/types/MessagePartTypes.ts +69 -0
  57. package/src/types/index.ts +3 -0
@@ -1,53 +1,8 @@
1
- import { CompleteAttachment } from "./AttachmentTypes";
2
- import { ReadonlyJSONObject, ReadonlyJSONValue } from "assistant-stream/utils";
1
+ import type { CompleteAttachment } from "./AttachmentTypes";
2
+ import type { ReadonlyJSONValue } from "assistant-stream/utils";
3
+ import type { TextMessagePart, ReasoningMessagePart, SourceMessagePart, ImageMessagePart, FileMessagePart, Unstable_AudioMessagePart, ToolCallMessagePart, ThreadUserMessagePart, ThreadAssistantMessagePart } from "./MessagePartTypes";
4
+ export type { TextMessagePart, ReasoningMessagePart, SourceMessagePart, ImageMessagePart, FileMessagePart, Unstable_AudioMessagePart, ToolCallMessagePart, ThreadUserMessagePart, ThreadAssistantMessagePart, };
3
5
  export type MessageRole = ThreadMessage["role"];
4
- export type TextMessagePart = {
5
- readonly type: "text";
6
- readonly text: string;
7
- readonly parentId?: string;
8
- };
9
- export type ReasoningMessagePart = {
10
- readonly type: "reasoning";
11
- readonly text: string;
12
- readonly parentId?: string;
13
- };
14
- export type SourceMessagePart = {
15
- readonly type: "source";
16
- readonly sourceType: "url";
17
- readonly id: string;
18
- readonly url: string;
19
- readonly title?: string;
20
- readonly parentId?: string;
21
- };
22
- export type ImageMessagePart = {
23
- readonly type: "image";
24
- readonly image: string;
25
- };
26
- export type FileMessagePart = {
27
- readonly type: "file";
28
- readonly data: string;
29
- readonly mimeType: string;
30
- };
31
- export type Unstable_AudioMessagePart = {
32
- readonly type: "audio";
33
- readonly audio: {
34
- readonly data: string;
35
- readonly format: "mp3" | "wav";
36
- };
37
- };
38
- export type ToolCallMessagePart<TArgs = ReadonlyJSONObject, TResult = unknown> = {
39
- readonly type: "tool-call";
40
- readonly toolCallId: string;
41
- readonly toolName: string;
42
- readonly args: TArgs;
43
- readonly result?: TResult | undefined;
44
- readonly isError?: boolean | undefined;
45
- readonly argsText: string;
46
- readonly artifact?: unknown;
47
- readonly parentId?: string;
48
- };
49
- export type ThreadUserMessagePart = TextMessagePart | ImageMessagePart | FileMessagePart | Unstable_AudioMessagePart;
50
- export type ThreadAssistantMessagePart = TextMessagePart | ReasoningMessagePart | ToolCallMessagePart | SourceMessagePart | FileMessagePart;
51
6
  type MessageCommonProps = {
52
7
  readonly id: string;
53
8
  readonly createdAt: Date;
@@ -134,5 +89,4 @@ type BaseThreadMessage = {
134
89
  readonly attachments?: ThreadUserMessage["attachments"];
135
90
  };
136
91
  export type ThreadMessage = BaseThreadMessage & (ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage);
137
- export {};
138
92
  //# sourceMappingURL=AssistantTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantTypes.d.ts","sourceRoot":"","sources":["../../src/types/AssistantTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAA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QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CAAC,mBAAmB,GAAG,iBAAiB,GAAG,sBAAsB,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ThreadUserMessagePart } from "./AssistantTypes";
1
+ import type { ThreadUserMessagePart } from "./MessagePartTypes";
2
2
  export type PendingAttachmentStatus = {
3
3
  type: "running";
4
4
  reason: "uploading";
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentTypes.d.ts","sourceRoot":"","sources":["../../src/types/AttachmentTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAC/B;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;CACzB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,eAAe,CAAC;CACnC,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,uBAAuB,GACvB,wBAAwB,CAAC;AAE7B,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG;IAC/C,MAAM,EAAE,uB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,GAAG;IAChD,MAAM,EAAE,wBAAwB,CAAC;IACjC,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { ReadonlyJSONObject } from "assistant-stream/utils";
2
+ export type TextMessagePart = {
3
+ readonly type: "text";
4
+ readonly text: string;
5
+ readonly parentId?: string;
6
+ };
7
+ export type ReasoningMessagePart = {
8
+ readonly type: "reasoning";
9
+ readonly text: string;
10
+ readonly parentId?: string;
11
+ };
12
+ export type SourceMessagePart = {
13
+ readonly type: "source";
14
+ readonly sourceType: "url";
15
+ readonly id: string;
16
+ readonly url: string;
17
+ readonly title?: string;
18
+ readonly parentId?: string;
19
+ };
20
+ export type ImageMessagePart = {
21
+ readonly type: "image";
22
+ readonly image: string;
23
+ };
24
+ export type FileMessagePart = {
25
+ readonly type: "file";
26
+ readonly data: string;
27
+ readonly mimeType: string;
28
+ };
29
+ export type Unstable_AudioMessagePart = {
30
+ readonly type: "audio";
31
+ readonly audio: {
32
+ readonly data: string;
33
+ readonly format: "mp3" | "wav";
34
+ };
35
+ };
36
+ export type ToolCallMessagePart<TArgs = ReadonlyJSONObject, TResult = unknown> = {
37
+ readonly type: "tool-call";
38
+ readonly toolCallId: string;
39
+ readonly toolName: string;
40
+ readonly args: TArgs;
41
+ readonly result?: TResult | undefined;
42
+ readonly isError?: boolean | undefined;
43
+ readonly argsText: string;
44
+ readonly artifact?: unknown;
45
+ readonly parentId?: string;
46
+ };
47
+ export type ThreadUserMessagePart = TextMessagePart | ImageMessagePart | FileMessagePart | Unstable_AudioMessagePart;
48
+ export type ThreadAssistantMessagePart = TextMessagePart | ReasoningMessagePart | ToolCallMessagePart | SourceMessagePart | FileMessagePart;
49
+ //# sourceMappingURL=MessagePartTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessagePartTypes.d.ts","sourceRoot":"","sources":["../../src/types/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B,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;KAChC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAC7B,KAAK,GAAG,kBAAkB,EAC1B,OAAO,GAAG,OAAO,IACf;IACF,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,yBAAyB,CAAC;AAE9B,MAAM,MAAM,0BAA0B,GAClC,eAAe,GACf,oBAAoB,GACpB,mBAAmB,GACnB,iBAAiB,GACjB,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=MessagePartTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -3,5 +3,6 @@ export type { AppendMessage, TextMessagePart, ReasoningMessagePart, SourceMessag
3
3
  export type { TextMessagePart as TextContentPart, ReasoningMessagePart as ReasoningContentPart, SourceMessagePart as SourceContentPart, ImageMessagePart as ImageContentPart, FileMessagePart as FileContentPart, Unstable_AudioMessagePart as AudioContentPart, ToolCallMessagePart as ToolCallContentPart, MessagePartStatus as ContentPartStatus, ToolCallMessagePartStatus as ToolCallContentPartStatus, ThreadUserMessagePart as ThreadUserContentPart, ThreadAssistantMessagePart as ThreadAssistantContentPart, ThreadSystemMessage as ThreadSystemContentPart, ThreadAssistantMessage as ThreadAssistantContent, ThreadUserMessage as ThreadUserContent, ThreadMessage as ThreadContent, } from "./AssistantTypes";
4
4
  export type { EmptyMessagePartComponent, EmptyMessagePartProps, TextMessagePartComponent, TextMessagePartProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, SourceMessagePartComponent, SourceMessagePartProps, ImageMessagePartComponent, ImageMessagePartProps, FileMessagePartComponent, FileMessagePartProps, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps, ToolCallMessagePartComponent, ToolCallMessagePartProps, } from "./MessagePartComponentTypes";
5
5
  export type { EmptyMessagePartComponent as EmptyContentPartComponent, EmptyMessagePartProps as EmptyContentPartProps, TextMessagePartComponent as TextContentPartComponent, TextMessagePartProps as TextContentPartProps, ReasoningMessagePartComponent as ReasoningContentPartComponent, ReasoningMessagePartProps as ReasoningContentPartProps, SourceMessagePartComponent as SourceContentPartComponent, SourceMessagePartProps as SourceContentPartProps, ImageMessagePartComponent as ImageContentPartComponent, ImageMessagePartProps as ImageContentPartProps, FileMessagePartComponent as FileContentPartComponent, FileMessagePartProps as FileContentPartProps, Unstable_AudioMessagePartComponent as AudioContentPartComponent, Unstable_AudioMessagePartProps as AudioContentPartProps, ToolCallMessagePartComponent as ToolCallContentPartComponent, ToolCallMessagePartProps as ToolCallContentPartProps, } from "./MessagePartComponentTypes";
6
+ export type { ThreadListItemStatus } from "../api/ThreadListItemRuntime";
6
7
  export type { Unsubscribe } from "./Unsubscribe";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,iBAAi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BAAoB,EACpB,6BAA6B,EAC7B,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,kCAAkC,EAClC,8BAA8B,EAC9B,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AAGrC,YAAY,EACV,yBAAyB,IAAI,yBAAyB,EACtD,qBAAqB,IAAI,qBAAqB,EAC9C,wBAAwB,IAAI,wBAAwB,EACpD,oBAAoB,IAAI,oBAAoB,EAC5C,6BAA6B,IAAI,6BAA6B,EAC9D,yBAAyB,IAAI,yBAAyB,EACtD,0BAA0B,IAAI,0BAA0B,EACxD,sBAAsB,IAAI,sBAAsB,EAChD,yBAAyB,IAAI,yBAAyB,EACtD,qBAAqB,IAAI,qBAAqB,EAC9C,wBAAwB,IAAI,wBAAwB,EACpD,oBAAoB,IAAI,oBAAoB,EAC5C,kCAAkC,IAAI,yBAAyB,EAC/D,8BAA8B,IAAI,qBAAqB,EACvD,4BAA4B,IAAI,4BAA4B,EAC5D,wBAAwB,IAAI,wBAAwB,GACrD,MAAM,6BAA6B,CAAC;AAGrC,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
package/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  "conversational-ui",
29
29
  "conversational-ai"
30
30
  ],
31
- "version": "0.10.29",
31
+ "version": "0.10.31",
32
32
  "license": "MIT",
33
33
  "type": "module",
34
34
  "exports": {
@@ -57,7 +57,7 @@
57
57
  "@radix-ui/react-use-callback-ref": "^1.1.1",
58
58
  "@radix-ui/react-use-escape-keydown": "^1.1.1",
59
59
  "@standard-schema/spec": "^1.0.0",
60
- "assistant-stream": "^0.2.20",
60
+ "assistant-stream": "^0.2.21",
61
61
  "json-schema": "^0.4.0",
62
62
  "nanoid": "5.1.5",
63
63
  "react-textarea-autosize": "^8.5.9",
@@ -1,6 +1,6 @@
1
1
  import { SubscribableWithState } from "./subscribable/Subscribable";
2
2
 
3
- import { ComposerRuntimeCoreBinding } from "./ComposerRuntime";
3
+ import type { ComposerRuntimeCoreBinding } from "./RuntimeBindings";
4
4
  import {
5
5
  Attachment,
6
6
  CompleteAttachment,
@@ -5,7 +5,7 @@ import {
5
5
  ThreadComposerRuntimeCore,
6
6
  } from "../runtimes/core/ComposerRuntimeCore";
7
7
  import { Unsubscribe } from "../types";
8
- import { SubscribableWithState } from "./subscribable/Subscribable";
8
+
9
9
  import { LazyMemoizeSubject } from "./subscribable/LazyMemoizeSubject";
10
10
  import {
11
11
  AttachmentRuntime,
@@ -18,21 +18,17 @@ import { SKIP_UPDATE } from "./subscribable/SKIP_UPDATE";
18
18
  import { ComposerRuntimePath } from "./RuntimePathTypes";
19
19
  import { MessageRole, RunConfig } from "../types/AssistantTypes";
20
20
  import { EventSubscriptionSubject } from "./subscribable/EventSubscriptionSubject";
21
-
22
- export type ThreadComposerRuntimeCoreBinding = SubscribableWithState<
23
- ThreadComposerRuntimeCore | undefined,
24
- ComposerRuntimePath & { composerSource: "thread" }
25
- >;
26
-
27
- export type EditComposerRuntimeCoreBinding = SubscribableWithState<
28
- ComposerRuntimeCore | undefined,
29
- ComposerRuntimePath & { composerSource: "edit" }
30
- >;
31
-
32
- export type ComposerRuntimeCoreBinding = SubscribableWithState<
33
- ComposerRuntimeCore | undefined,
34
- ComposerRuntimePath
35
- >;
21
+ import type {
22
+ ThreadComposerRuntimeCoreBinding,
23
+ EditComposerRuntimeCoreBinding,
24
+ ComposerRuntimeCoreBinding,
25
+ } from "./RuntimeBindings";
26
+
27
+ export type {
28
+ ThreadComposerRuntimeCoreBinding,
29
+ EditComposerRuntimeCoreBinding,
30
+ ComposerRuntimeCoreBinding,
31
+ };
36
32
 
37
33
  type BaseComposerState = {
38
34
  readonly canCancel: boolean;
@@ -5,7 +5,7 @@ import {
5
5
  ToolCallMessagePartStatus,
6
6
  } from "../types/AssistantTypes";
7
7
  import { ThreadRuntimeCoreBinding } from "./ThreadRuntime";
8
- import { MessageStateBinding } from "./MessageRuntime";
8
+ import type { MessageStateBinding } from "./RuntimeBindings";
9
9
  import { SubscribableWithState } from "./subscribable/Subscribable";
10
10
  import { Unsubscribe } from "../types";
11
11
  import { MessagePartRuntimePath } from "./RuntimePathTypes";
@@ -34,7 +34,7 @@ import { ThreadRuntimeCoreBinding } from "./ThreadRuntime";
34
34
  import { NestedSubscriptionSubject } from "./subscribable/NestedSubscriptionSubject";
35
35
  import { SKIP_UPDATE } from "./subscribable/SKIP_UPDATE";
36
36
  import { ShallowMemoizeSubject } from "./subscribable/ShallowMemoizeSubject";
37
- import { SubscribableWithState } from "./subscribable/Subscribable";
37
+ import type { MessageStateBinding } from "./RuntimeBindings";
38
38
 
39
39
  const COMPLETE_STATUS: MessagePartStatus = Object.freeze({
40
40
  type: "complete",
@@ -92,10 +92,7 @@ export type MessageState = ThreadMessage & {
92
92
  readonly submittedFeedback: SubmittedFeedback | undefined;
93
93
  };
94
94
 
95
- export type MessageStateBinding = SubscribableWithState<
96
- MessageState,
97
- MessageRuntimePath
98
- >;
95
+ export type { MessageStateBinding } from "./RuntimeBindings";
99
96
 
100
97
  type ReloadConfig = {
101
98
  runConfig?: RunConfig;
@@ -0,0 +1,70 @@
1
+ import type {
2
+ ComposerRuntimeCore,
3
+ ThreadComposerRuntimeCore,
4
+ } from "../runtimes/core/ComposerRuntimeCore";
5
+ import type { ThreadRuntimeCore } from "../runtimes/core/ThreadRuntimeCore";
6
+ import type { ThreadListRuntimeCore } from "../runtimes/core/ThreadListRuntimeCore";
7
+ import type { SubscribableWithState } from "./subscribable/Subscribable";
8
+ import type { ThreadMessage } from "../types";
9
+ import type {
10
+ SpeechState,
11
+ SubmittedFeedback,
12
+ } from "../runtimes/core/ThreadRuntimeCore";
13
+ import type {
14
+ ComposerRuntimePath,
15
+ ThreadRuntimePath,
16
+ ThreadListItemRuntimePath,
17
+ MessageRuntimePath,
18
+ } from "./RuntimePathTypes";
19
+
20
+ export type ComposerRuntimeCoreBinding = SubscribableWithState<
21
+ ComposerRuntimeCore | undefined,
22
+ ComposerRuntimePath
23
+ >;
24
+
25
+ export type ThreadComposerRuntimeCoreBinding = SubscribableWithState<
26
+ ThreadComposerRuntimeCore | undefined,
27
+ ComposerRuntimePath & { composerSource: "thread" }
28
+ >;
29
+
30
+ export type EditComposerRuntimeCoreBinding = SubscribableWithState<
31
+ ComposerRuntimeCore | undefined,
32
+ ComposerRuntimePath & { composerSource: "edit" }
33
+ >;
34
+
35
+ export type ThreadRuntimeCoreBinding = SubscribableWithState<
36
+ ThreadRuntimeCore,
37
+ ThreadRuntimePath
38
+ >;
39
+
40
+ export type ThreadListRuntimeCoreBinding = SubscribableWithState<
41
+ ThreadListRuntimeCore,
42
+ ThreadListItemRuntimePath
43
+ >;
44
+
45
+ export type MessageStateBinding = SubscribableWithState<
46
+ ThreadMessage & {
47
+ readonly parentId: string | null;
48
+ readonly isLast: boolean;
49
+ readonly branchNumber: number;
50
+ readonly branchCount: number;
51
+ readonly speech: SpeechState | undefined;
52
+ readonly submittedFeedback: SubmittedFeedback | undefined;
53
+ },
54
+ MessageRuntimePath
55
+ >;
56
+
57
+ export type ThreadListItemStatus = "archived" | "regular" | "new" | "deleted";
58
+
59
+ export type ThreadListItemState = {
60
+ readonly isMain: boolean;
61
+ readonly id: string;
62
+ readonly remoteId: string | undefined;
63
+ readonly externalId: string | undefined;
64
+ /**
65
+ * @deprecated Use `id` instead. This field will be removed in version 0.8.0.
66
+ */
67
+ readonly threadId: string;
68
+ readonly status: ThreadListItemStatus;
69
+ readonly title?: string | undefined;
70
+ };
@@ -5,21 +5,12 @@ import { ThreadListRuntimeCoreBinding } from "./ThreadListRuntime";
5
5
 
6
6
  export type ThreadListItemEventType = "switched-to" | "switched-away";
7
7
 
8
- export type ThreadListItemState = {
9
- readonly isMain: boolean;
10
-
11
- readonly id: string;
12
- readonly remoteId: string | undefined;
13
- readonly externalId: string | undefined;
14
-
15
- /**
16
- * @deprecated This field was renamed to `id`. This field will be removed in 0.8.0.
17
- */
18
- readonly threadId: string;
8
+ import type {
9
+ ThreadListItemState,
10
+ ThreadListItemStatus,
11
+ } from "./RuntimeBindings";
19
12
 
20
- readonly status: "archived" | "regular" | "new" | "deleted";
21
- readonly title?: string | undefined;
22
- };
13
+ export type { ThreadListItemState, ThreadListItemStatus };
23
14
 
24
15
  export type ThreadListItemRuntime = {
25
16
  readonly path: ThreadListItemRuntimePath;
@@ -28,7 +28,7 @@ import {
28
28
  ThreadListItemRuntimePath,
29
29
  ThreadRuntimePath,
30
30
  } from "./RuntimePathTypes";
31
- import { ThreadListItemState } from "./ThreadListItemRuntime";
31
+ import type { ThreadListItemState } from "./RuntimeBindings";
32
32
  import { RunConfig } from "../types/AssistantTypes";
33
33
  import { EventSubscriptionSubject } from "./subscribable/EventSubscriptionSubject";
34
34
  import { symbolInnerMessage } from "../runtimes/external-store/getExternalStoreMessage";
@@ -41,44 +41,37 @@ type MessagePartGroup = {
41
41
 
42
42
  /**
43
43
  * Groups message parts by their parent ID.
44
- * Parts without a parent ID appear after grouped parts and remain ungrouped.
45
- * The position of groups is based on the first occurrence of each parent ID.
44
+ * Parts without a parent ID appear in their chronological position as individual groups.
45
+ * Parts with the same parent ID are grouped together at the position of their first occurrence.
46
46
  */
47
47
  const groupMessagePartsByParentId = (
48
48
  parts: readonly any[],
49
49
  ): MessagePartGroup[] => {
50
- const groups: MessagePartGroup[] = [];
51
- const parentIdToGroupIndex = new Map<string | undefined, number>();
52
- const processedIndices = new Set<number>();
53
-
54
- // First pass: process all parts with parent IDs
50
+ // Map maintains insertion order, so groups appear in order of first occurrence
51
+ const groupMap = new Map<string, number[]>();
52
+
53
+ // Process each part in order
55
54
  for (let i = 0; i < parts.length; i++) {
56
55
  const part = parts[i];
57
56
  const parentId = part?.parentId as string | undefined;
58
-
59
- if (parentId !== undefined) {
60
- let groupIndex = parentIdToGroupIndex.get(parentId);
61
-
62
- if (groupIndex === undefined) {
63
- // Create new group for this parent ID
64
- groupIndex = groups.length;
65
- groups.push({ parentId, indices: [] });
66
- parentIdToGroupIndex.set(parentId, groupIndex);
67
- }
68
-
69
- groups[groupIndex]!.indices.push(i);
70
- processedIndices.add(i);
71
- }
57
+
58
+ // For parts without parentId, assign a unique group ID to maintain their position
59
+ const groupId = parentId ?? `__ungrouped_${i}`;
60
+
61
+ // Get or create the indices array for this group
62
+ const indices = groupMap.get(groupId) ?? [];
63
+ indices.push(i);
64
+ groupMap.set(groupId, indices);
72
65
  }
73
-
74
- // Second pass: add ungrouped parts (those without parent ID)
75
- for (let i = 0; i < parts.length; i++) {
76
- if (!processedIndices.has(i)) {
77
- // Add individual group for parts without parent ID
78
- groups.push({ parentId: undefined, indices: [i] });
79
- }
66
+
67
+ // Convert map to array of groups
68
+ const groups: MessagePartGroup[] = [];
69
+ for (const [groupId, indices] of groupMap) {
70
+ // Extract parentId (undefined for ungrouped parts)
71
+ const parentId = groupId.startsWith('__ungrouped_') ? undefined : groupId;
72
+ groups.push({ parentId, indices });
80
73
  }
81
-
74
+
82
75
  return groups;
83
76
  };
84
77
 
@@ -1,12 +1,13 @@
1
1
  import { Unsubscribe } from "../../types";
2
2
  import { ThreadRuntimeCore } from "./ThreadRuntimeCore";
3
+ import type { ThreadListItemStatus } from "../../api/RuntimeBindings";
3
4
 
4
5
  type ThreadListItemCoreState = {
5
6
  readonly threadId: string;
6
7
  readonly remoteId?: string | undefined;
7
8
  readonly externalId?: string | undefined;
8
9
 
9
- readonly status: "archived" | "regular" | "new" | "deleted";
10
+ readonly status: ThreadListItemStatus;
10
11
  readonly title?: string | undefined;
11
12
 
12
13
  readonly runtime?: ThreadRuntimeCore | undefined;
@@ -1,4 +1,4 @@
1
- import { BaseAssistantRuntimeCore } from "../../internal";
1
+ import { BaseAssistantRuntimeCore } from "../core/BaseAssistantRuntimeCore";
2
2
  import { ExternalStoreThreadListRuntimeCore } from "./ExternalStoreThreadListRuntimeCore";
3
3
  import { ExternalStoreAdapter } from "./ExternalStoreAdapter";
4
4
  import { ExternalStoreThreadRuntimeCore } from "./ExternalStoreThreadRuntimeCore";
@@ -1,75 +1,32 @@
1
- import { CompleteAttachment } from "./AttachmentTypes";
2
- import { ReadonlyJSONObject, ReadonlyJSONValue } from "assistant-stream/utils";
3
-
4
- export type MessageRole = ThreadMessage["role"];
5
-
6
- export type TextMessagePart = {
7
- readonly type: "text";
8
- readonly text: string;
9
- readonly parentId?: string;
10
- };
11
-
12
- export type ReasoningMessagePart = {
13
- readonly type: "reasoning";
14
- readonly text: string;
15
- readonly parentId?: string;
16
- };
17
-
18
- export type SourceMessagePart = {
19
- readonly type: "source";
20
- readonly sourceType: "url";
21
- readonly id: string;
22
- readonly url: string;
23
- readonly title?: string;
24
- readonly parentId?: string;
25
- };
26
-
27
- export type ImageMessagePart = {
28
- readonly type: "image";
29
- readonly image: string;
1
+ import type { CompleteAttachment } from "./AttachmentTypes";
2
+ import type { ReadonlyJSONValue } from "assistant-stream/utils";
3
+ import type {
4
+ TextMessagePart,
5
+ ReasoningMessagePart,
6
+ SourceMessagePart,
7
+ ImageMessagePart,
8
+ FileMessagePart,
9
+ Unstable_AudioMessagePart,
10
+ ToolCallMessagePart,
11
+ ThreadUserMessagePart,
12
+ ThreadAssistantMessagePart,
13
+ } from "./MessagePartTypes";
14
+
15
+ // Re-export message part types for convenience
16
+ export type {
17
+ TextMessagePart,
18
+ ReasoningMessagePart,
19
+ SourceMessagePart,
20
+ ImageMessagePart,
21
+ FileMessagePart,
22
+ Unstable_AudioMessagePart,
23
+ ToolCallMessagePart,
24
+ ThreadUserMessagePart,
25
+ ThreadAssistantMessagePart,
30
26
  };
31
27
 
32
- export type FileMessagePart = {
33
- readonly type: "file";
34
- readonly data: string;
35
- readonly mimeType: string;
36
- };
37
-
38
- export type Unstable_AudioMessagePart = {
39
- readonly type: "audio";
40
- readonly audio: {
41
- readonly data: string;
42
- readonly format: "mp3" | "wav";
43
- };
44
- };
45
-
46
- export type ToolCallMessagePart<
47
- TArgs = ReadonlyJSONObject,
48
- TResult = unknown,
49
- > = {
50
- readonly type: "tool-call";
51
- readonly toolCallId: string;
52
- readonly toolName: string;
53
- readonly args: TArgs;
54
- readonly result?: TResult | undefined;
55
- readonly isError?: boolean | undefined;
56
- readonly argsText: string;
57
- readonly artifact?: unknown;
58
- readonly parentId?: string;
59
- };
60
-
61
- export type ThreadUserMessagePart =
62
- | TextMessagePart
63
- | ImageMessagePart
64
- | FileMessagePart
65
- | Unstable_AudioMessagePart;
66
-
67
- export type ThreadAssistantMessagePart =
68
- | TextMessagePart
69
- | ReasoningMessagePart
70
- | ToolCallMessagePart
71
- | SourceMessagePart
72
- | FileMessagePart;
28
+ // Alias for the role of a thread message
29
+ export type MessageRole = ThreadMessage["role"];
73
30
 
74
31
  type MessageCommonProps = {
75
32
  readonly id: string;
@@ -1,4 +1,4 @@
1
- import { ThreadUserMessagePart } from "./AssistantTypes";
1
+ import type { ThreadUserMessagePart } from "./MessagePartTypes";
2
2
 
3
3
  export type PendingAttachmentStatus =
4
4
  | {