@assistant-ui/react 0.11.1 → 0.11.3
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.
- package/dist/client/types/Composer.d.ts +2 -0
- package/dist/client/types/Composer.d.ts.map +1 -1
- package/dist/client/types/Message.d.ts +2 -0
- package/dist/client/types/Message.d.ts.map +1 -1
- package/dist/{legacy-runtime → client}/util-hooks/tapLookupResources.d.ts +2 -2
- package/dist/client/util-hooks/tapLookupResources.d.ts.map +1 -0
- package/dist/{legacy-runtime → client}/util-hooks/tapLookupResources.js +1 -1
- package/dist/client/util-hooks/tapLookupResources.js.map +1 -0
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.d.ts +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js +1 -1
- package/dist/legacy-runtime/client/AttachmentRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js +9 -3
- package/dist/legacy-runtime/client/ComposerRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.d.ts.map +1 -1
- package/dist/legacy-runtime/client/MessageRuntimeClient.js +8 -2
- package/dist/legacy-runtime/client/MessageRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js +1 -1
- package/dist/legacy-runtime/client/ThreadListRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js +1 -1
- package/dist/legacy-runtime/client/ThreadRuntimeClient.js.map +1 -1
- package/dist/legacy-runtime/runtime/index.d.ts +0 -1
- package/dist/legacy-runtime/runtime/index.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/core/BaseThreadRuntimeCore.d.ts +1 -1
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts +2 -2
- package/dist/legacy-runtime/runtime-cores/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +2 -2
- package/dist/model-context/index.d.ts +1 -13
- package/dist/model-context/index.d.ts.map +1 -1
- package/dist/model-context/index.js +1 -3
- package/dist/model-context/index.js.map +1 -1
- package/dist/primitives/index.d.ts +0 -6
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +0 -12
- package/dist/primitives/index.js.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/CompositeContextProvider.d.ts +1 -1
- package/dist/utils/tap-store/index.d.ts +1 -1
- package/dist/utils/tap-store/index.d.ts.map +1 -1
- package/dist/utils/tap-store/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/types/Composer.ts +1 -1
- package/src/client/types/Message.ts +1 -1
- package/src/{legacy-runtime → client}/util-hooks/tapLookupResources.ts +2 -2
- package/src/legacy-runtime/client/AttachmentRuntimeClient.ts +1 -1
- package/src/legacy-runtime/client/ComposerRuntimeClient.ts +10 -3
- package/src/legacy-runtime/client/MessageRuntimeClient.ts +8 -2
- package/src/legacy-runtime/client/ThreadListRuntimeClient.ts +1 -1
- package/src/legacy-runtime/client/ThreadRuntimeClient.ts +1 -1
- package/src/legacy-runtime/runtime/index.ts +0 -6
- package/src/model-context/index.ts +1 -16
- package/src/primitives/index.ts +0 -8
- package/src/types/index.ts +0 -41
- package/src/utils/tap-store/index.ts +1 -1
- package/dist/legacy-runtime/util-hooks/tapLookupResources.d.ts.map +0 -1
- package/dist/legacy-runtime/util-hooks/tapLookupResources.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Composer.d.ts","sourceRoot":"","sources":["../../../src/client/types/Composer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,MAAM,mBAA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ils/tap-store";
|
3
|
+
export declare const tapLookupResources: <TState, TApi extends ApiObject>(elements: ResourceElement<{
|
4
4
|
key: string | undefined;
|
5
5
|
state: TState;
|
6
6
|
api: TApi;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tapLookupResources.d.ts","sourceRoot":"","sources":["../../../src/client/util-hooks/tapLookupResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,eAAO,MAAM,kBAAkB,GAAI,MAAM,EAAE,IAAI,SAAS,SAAS,EAC/D,UAAU,eAAe,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,IAAI,CAAC;CACX,CAAC,EAAE;;kBAMY;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE;CAepD,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/client/util-hooks/tapLookupResources.ts"],"sourcesContent":["import { ResourceElement, tapResources } from \"@assistant-ui/tap\";\nimport { ApiObject } from \"../../utils/tap-store\";\n\nexport const tapLookupResources = <TState, TApi extends ApiObject>(\n elements: ResourceElement<{\n key: string | undefined;\n state: TState;\n api: TApi;\n }>[],\n) => {\n const resources = tapResources(elements);\n\n return {\n state: resources.map((r) => r.state),\n api: (lookup: { index: number } | { key: string }) => {\n const value =\n \"index\" in lookup\n ? resources[lookup.index]?.api\n : resources.find((r) => r.key === lookup.key)?.api;\n\n if (!value) {\n throw new Error(\n `tapLookupResources: Resource not found for lookup: ${JSON.stringify(lookup)}`,\n );\n }\n\n return value;\n },\n };\n};\n"],"mappings":";AAAA,SAA0B,oBAAoB;AAGvC,IAAM,qBAAqB,CAChC,aAKG;AACH,QAAM,YAAY,aAAa,QAAQ;AAEvC,SAAO;AAAA,IACL,OAAO,UAAU,IAAI,CAAC,MAAM,EAAE,KAAK;AAAA,IACnC,KAAK,CAAC,WAAgD;AACpD,YAAM,QACJ,WAAW,SACP,UAAU,OAAO,KAAK,GAAG,MACzB,UAAU,KAAK,CAAC,MAAM,EAAE,QAAQ,OAAO,GAAG,GAAG;AAEnD,UAAI,CAAC,OAAO;AACV,cAAM,IAAI;AAAA,UACR,sDAAsD,KAAK,UAAU,MAAM,CAAC;AAAA,QAC9E;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/legacy-runtime/client/AttachmentRuntimeClient.ts"],"sourcesContent":["import { resource } from \"../../../../tap/dist/core/resource\";\nimport { AttachmentClientApi } from \"../../client/types/Attachment\";\nimport { tapApi } from \"../../utils/tap-store\";\nimport { AttachmentRuntime } from \"../runtime\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\n\nexport const AttachmentRuntimeClient = resource(\n ({ runtime }: { runtime: AttachmentRuntime }) => {\n const state = tapSubscribable(runtime);\n const api = tapApi<AttachmentClientApi>({\n getState: () => state,\n remove: runtime.remove,\n __internal_getRuntime: () => runtime,\n });\n\n return {\n state: state,\n api,\n key:
|
1
|
+
{"version":3,"sources":["../../../src/legacy-runtime/client/AttachmentRuntimeClient.ts"],"sourcesContent":["import { resource } from \"../../../../tap/dist/core/resource\";\nimport { AttachmentClientApi } from \"../../client/types/Attachment\";\nimport { tapApi } from \"../../utils/tap-store\";\nimport { AttachmentRuntime } from \"../runtime\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\n\nexport const AttachmentRuntimeClient = resource(\n ({ runtime }: { runtime: AttachmentRuntime }) => {\n const state = tapSubscribable(runtime);\n const api = tapApi<AttachmentClientApi>({\n getState: () => state,\n remove: runtime.remove,\n __internal_getRuntime: () => runtime,\n });\n\n return {\n state: state,\n api,\n key: state.id,\n };\n },\n);\n"],"mappings":";AAAA,SAAS,gBAAgB;AAEzB,SAAS,cAAc;AAEvB,SAAS,uBAAuB;AAEzB,IAAM,0BAA0B;AAAA,EACrC,CAAC,EAAE,QAAQ,MAAsC;AAC/C,UAAM,QAAQ,gBAAgB,OAAO;AACrC,UAAM,MAAM,OAA4B;AAAA,MACtC,UAAU,MAAM;AAAA,MAChB,QAAQ,QAAQ;AAAA,MAChB,uBAAuB,MAAM;AAAA,IAC/B,CAAC;AAED,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,KAAK,MAAM;AAAA,IACb;AAAA,EACF;AACF;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComposerRuntimeClient.d.ts","sourceRoot":"","sources":["../../../src/legacy-runtime/client/ComposerRuntimeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAEV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;
|
1
|
+
{"version":3,"file":"ComposerRuntimeClient.d.ts","sourceRoot":"","sources":["../../../src/legacy-runtime/client/ComposerRuntimeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAEV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAoBrC,eAAO,MAAM,cAAc;;;;iBAMV,SAAS,CAAC,MAAM,CAAC;mBACf,SAAS,CAAC,MAAM,CAAC;aACvB,eAAe;EAuF3B,CAAC"}
|
@@ -5,11 +5,11 @@ import {
|
|
5
5
|
tapEffect,
|
6
6
|
tapInlineResource
|
7
7
|
} from "@assistant-ui/tap";
|
8
|
-
import { tapSubscribable } from "../util-hooks/tapSubscribable.js";
|
9
8
|
import { tapApi } from "../../utils/tap-store/index.js";
|
10
9
|
import { tapEvents } from "../../client/EventContext.js";
|
11
|
-
import { tapLookupResources } from "
|
10
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources.js";
|
12
11
|
import { AttachmentRuntimeClient } from "./AttachmentRuntimeClient.js";
|
12
|
+
import { tapSubscribable } from "../util-hooks/tapSubscribable.js";
|
13
13
|
var ComposerAttachmentClientByIndex = resource(
|
14
14
|
({ runtime, index }) => {
|
15
15
|
const attachmentRuntime = tapMemo(
|
@@ -84,7 +84,13 @@ var ComposerClient = resource(
|
|
84
84
|
beginEdit: runtime.beginEdit ?? (() => {
|
85
85
|
throw new Error("beginEdit is not supported in this runtime");
|
86
86
|
}),
|
87
|
-
attachment:
|
87
|
+
attachment: (selector) => {
|
88
|
+
if ("id" in selector) {
|
89
|
+
return attachments.api({ key: selector.id });
|
90
|
+
} else {
|
91
|
+
return attachments.api(selector);
|
92
|
+
}
|
93
|
+
},
|
88
94
|
__internal_getRuntime: () => runtime
|
89
95
|
});
|
90
96
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/legacy-runtime/client/ComposerRuntimeClient.ts"],"sourcesContent":["import {\n resource,\n tapMemo,\n tapEffect,\n RefObject,\n tapInlineResource,\n} from \"@assistant-ui/tap\";\nimport {\n ComposerRuntime,\n EditComposerRuntime,\n} from \"../runtime/ComposerRuntime\";\nimport { Unsubscribe } from \"../../types\";\
|
1
|
+
{"version":3,"sources":["../../../src/legacy-runtime/client/ComposerRuntimeClient.ts"],"sourcesContent":["import {\n resource,\n tapMemo,\n tapEffect,\n RefObject,\n tapInlineResource,\n} from \"@assistant-ui/tap\";\nimport {\n ComposerRuntime,\n EditComposerRuntime,\n} from \"../runtime/ComposerRuntime\";\nimport { Unsubscribe } from \"../../types\";\n\nimport { tapApi } from \"../../utils/tap-store\";\nimport { ComposerRuntimeEventType } from \"../runtime-cores/core/ComposerRuntimeCore\";\nimport { tapEvents } from \"../../client/EventContext\";\nimport {\n ComposerClientState,\n ComposerClientApi,\n} from \"../../client/types/Composer\";\nimport { tapLookupResources } from \"../../client/util-hooks/tapLookupResources\";\nimport { AttachmentRuntimeClient } from \"./AttachmentRuntimeClient\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\n\nconst ComposerAttachmentClientByIndex = resource(\n ({ runtime, index }: { runtime: ComposerRuntime; index: number }) => {\n const attachmentRuntime = tapMemo(\n () => runtime.getAttachmentByIndex(index),\n [runtime, index],\n );\n\n return tapInlineResource(\n AttachmentRuntimeClient({\n runtime: attachmentRuntime,\n }),\n );\n },\n);\n\nexport const ComposerClient = resource(\n ({\n threadIdRef,\n messageIdRef,\n runtime,\n }: {\n threadIdRef: RefObject<string>;\n messageIdRef?: RefObject<string>;\n runtime: ComposerRuntime;\n }) => {\n const runtimeState = tapSubscribable(runtime);\n const events = tapEvents();\n\n // Bind composer events to event manager\n tapEffect(() => {\n const unsubscribers: Unsubscribe[] = [];\n\n // Subscribe to composer events\n const composerEvents: ComposerRuntimeEventType[] = [\n \"send\",\n \"attachment-add\",\n ];\n\n for (const event of composerEvents) {\n const unsubscribe = runtime.unstable_on(event, () => {\n events.emit(`composer.${event}`, {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n });\n });\n unsubscribers.push(unsubscribe);\n }\n\n return () => {\n for (const unsub of unsubscribers) unsub();\n };\n }, [runtime, events, threadIdRef, messageIdRef]);\n\n const attachments = tapLookupResources(\n runtimeState.attachments.map((_, idx) =>\n ComposerAttachmentClientByIndex(\n { runtime: runtime, index: idx },\n { key: idx },\n ),\n ),\n );\n\n const state = tapMemo<ComposerClientState>(() => {\n return {\n text: runtimeState.text,\n role: runtimeState.role,\n attachments: attachments.state,\n runConfig: runtimeState.runConfig,\n isEditing: runtimeState.isEditing,\n canCancel: runtimeState.canCancel,\n attachmentAccept: runtimeState.attachmentAccept,\n isEmpty: runtimeState.isEmpty,\n type: runtimeState.type ?? \"thread\",\n };\n }, [runtimeState, attachments.state]);\n\n const api = tapApi<ComposerClientApi>({\n getState: () => state,\n\n setText: runtime.setText,\n setRole: runtime.setRole,\n setRunConfig: runtime.setRunConfig,\n addAttachment: runtime.addAttachment,\n reset: runtime.reset,\n\n clearAttachments: runtime.clearAttachments,\n send: runtime.send,\n cancel: runtime.cancel,\n beginEdit:\n (runtime as EditComposerRuntime).beginEdit ??\n (() => {\n throw new Error(\"beginEdit is not supported in this runtime\");\n }),\n\n attachment: (selector) => {\n if (\"id\" in selector) {\n return attachments.api({ key: selector.id });\n } else {\n return attachments.api(selector);\n }\n },\n\n __internal_getRuntime: () => runtime,\n });\n\n return {\n state,\n api,\n };\n },\n);\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAOP,SAAS,cAAc;AAEvB,SAAS,iBAAiB;AAK1B,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAEhC,IAAM,kCAAkC;AAAA,EACtC,CAAC,EAAE,SAAS,MAAM,MAAmD;AACnE,UAAM,oBAAoB;AAAA,MACxB,MAAM,QAAQ,qBAAqB,KAAK;AAAA,MACxC,CAAC,SAAS,KAAK;AAAA,IACjB;AAEA,WAAO;AAAA,MACL,wBAAwB;AAAA,QACtB,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEO,IAAM,iBAAiB;AAAA,EAC5B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAIM;AACJ,UAAM,eAAe,gBAAgB,OAAO;AAC5C,UAAM,SAAS,UAAU;AAGzB,cAAU,MAAM;AACd,YAAM,gBAA+B,CAAC;AAGtC,YAAM,iBAA6C;AAAA,QACjD;AAAA,QACA;AAAA,MACF;AAEA,iBAAW,SAAS,gBAAgB;AAClC,cAAM,cAAc,QAAQ,YAAY,OAAO,MAAM;AACnD,iBAAO,KAAK,YAAY,KAAK,IAAI;AAAA,YAC/B,UAAU,YA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Y,IAAI,QAAQ;AAAA,QACjC;AAAA,MACF;AAAA,MAEA,uBAAuB,MAAM;AAAA,IAC/B,CAAC;AAED,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageRuntimeClient.d.ts","sourceRoot":"","sources":["../../../src/legacy-runtime/client/MessageRuntimeClient.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAK3D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AAyBpC,eAAO,MAAM,aAAa;;;;;aAKb,cAAc;iBACV,SAAS,CAAC,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"MessageRuntimeClient.d.ts","sourceRoot":"","sources":["../../../src/legacy-runtime/client/MessageRuntimeClient.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAK3D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AAyBpC,eAAO,MAAM,aAAa;;;;;aAKb,cAAc;iBACV,SAAS,CAAC,MAAM,CAAC;EA8FjC,CAAC"}
|
@@ -9,7 +9,7 @@ import { tapApi } from "../../utils/tap-store/index.js";
|
|
9
9
|
import { tapSubscribable } from "../util-hooks/tapSubscribable.js";
|
10
10
|
import { ComposerClient } from "./ComposerRuntimeClient.js";
|
11
11
|
import { MessagePartClient } from "./MessagePartRuntimeClient.js";
|
12
|
-
import { tapLookupResources } from "
|
12
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources.js";
|
13
13
|
import { AttachmentRuntimeClient } from "./AttachmentRuntimeClient.js";
|
14
14
|
var MessageAttachmentClientByIndex = resource(
|
15
15
|
({ runtime, index }) => {
|
@@ -95,7 +95,13 @@ var MessageClient = resource(
|
|
95
95
|
return parts.api({ key: "toolCallId-" + selector.toolCallId });
|
96
96
|
}
|
97
97
|
},
|
98
|
-
attachment:
|
98
|
+
attachment: (selector) => {
|
99
|
+
if ("id" in selector) {
|
100
|
+
return attachments.api({ key: selector.id });
|
101
|
+
} else {
|
102
|
+
return attachments.api(selector);
|
103
|
+
}
|
104
|
+
},
|
99
105
|
setIsCopied,
|
100
106
|
setIsHovering,
|
101
107
|
__internal_getRuntime: () => runtime
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/legacy-runtime/client/MessageRuntimeClient.ts"],"sourcesContent":["import {\n resource,\n tapInlineResource,\n tapMemo,\n tapState,\n} from \"@assistant-ui/tap\";\nimport { tapApi } from \"../../utils/tap-store\";\nimport { MessageRuntime } from \"../runtime/MessageRuntime\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\nimport { ComposerClient } from \"./ComposerRuntimeClient\";\nimport { MessagePartClient } from \"./MessagePartRuntimeClient\";\nimport { tapLookupResources } from \"
|
1
|
+
{"version":3,"sources":["../../../src/legacy-runtime/client/MessageRuntimeClient.ts"],"sourcesContent":["import {\n resource,\n tapInlineResource,\n tapMemo,\n tapState,\n} from \"@assistant-ui/tap\";\nimport { tapApi } from \"../../utils/tap-store\";\nimport { MessageRuntime } from \"../runtime/MessageRuntime\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\nimport { ComposerClient } from \"./ComposerRuntimeClient\";\nimport { MessagePartClient } from \"./MessagePartRuntimeClient\";\nimport { tapLookupResources } from \"../../client/util-hooks/tapLookupResources\";\nimport { RefObject } from \"react\";\nimport {\n MessageClientState,\n MessageClientApi,\n} from \"../../client/types/Message\";\nimport { AttachmentRuntimeClient } from \"./AttachmentRuntimeClient\";\n\nconst MessageAttachmentClientByIndex = resource(\n ({ runtime, index }: { runtime: MessageRuntime; index: number }) => {\n const attachmentRuntime = tapMemo(\n () => runtime.getAttachmentByIndex(index),\n [runtime, index],\n );\n return tapInlineResource(\n AttachmentRuntimeClient({ runtime: attachmentRuntime }),\n );\n },\n);\n\nconst MessagePartByIndex = resource(\n ({ runtime, index }: { runtime: MessageRuntime; index: number }) => {\n const partRuntime = tapMemo(\n () => runtime.getMessagePartByIndex(index),\n [runtime, index],\n );\n return tapInlineResource(MessagePartClient({ runtime: partRuntime }));\n },\n);\n\nexport const MessageClient = resource(\n ({\n runtime,\n threadIdRef,\n }: {\n runtime: MessageRuntime;\n threadIdRef: RefObject<string>;\n }) => {\n const runtimeState = tapSubscribable(runtime);\n\n const [isCopiedState, setIsCopied] = tapState(false);\n const [isHoveringState, setIsHovering] = tapState(false);\n\n const messageIdRef = tapMemo(\n () => ({\n get current() {\n return runtime.getState().id;\n },\n }),\n [runtime],\n );\n\n const composer = tapInlineResource(\n ComposerClient({\n runtime: runtime.composer,\n threadIdRef,\n messageIdRef,\n }),\n );\n\n const parts = tapLookupResources(\n runtimeState.content.map((_, idx) =>\n MessagePartByIndex({ runtime, index: idx }, { key: idx }),\n ),\n );\n\n const attachments = tapLookupResources(\n runtimeState.attachments?.map((_, idx) =>\n MessageAttachmentClientByIndex({ runtime, index: idx }, { key: idx }),\n ) ?? [],\n );\n\n const state = tapMemo<MessageClientState>(() => {\n return {\n ...(runtimeState as MessageClientState),\n\n parts: parts.state,\n composer: composer.state,\n\n isCopied: isCopiedState,\n isHovering: isHoveringState,\n };\n }, [\n runtimeState,\n parts.state,\n composer.state,\n isCopiedState,\n isHoveringState,\n ]);\n\n const api = tapApi<MessageClientApi>({\n getState: () => state,\n\n composer: composer.api,\n\n reload: (config) => runtime.reload(config),\n speak: () => runtime.speak(),\n stopSpeaking: () => runtime.stopSpeaking(),\n submitFeedback: (feedback) => runtime.submitFeedback(feedback),\n switchToBranch: (options) => runtime.switchToBranch(options),\n getCopyText: () => runtime.unstable_getCopyText(),\n\n part: (selector) => {\n if (\"index\" in selector) {\n return parts.api({ index: selector.index });\n } else {\n return parts.api({ key: \"toolCallId-\" + selector.toolCallId });\n }\n },\n\n attachment: (selector) => {\n if (\"id\" in selector) {\n return attachments.api({ key: selector.id });\n } else {\n return attachments.api(selector);\n }\n },\n\n setIsCopied,\n setIsHovering,\n\n __internal_getRuntime: () => runtime,\n });\n\n return {\n key: runtimeState.id,\n state,\n api,\n };\n },\n);\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAEvB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AAMnC,SAAS,+BAA+B;AAExC,IAAM,iCAAiC;AAAA,EACrC,CAAC,EAAE,SAAS,MAAM,MAAkD;AAClE,UAAM,oBAAoB;AAAA,MACxB,MAAM,QAAQ,qBAAqB,KAAK;AAAA,MACxC,CAAC,SAAS,KAAK;AAAA,IACjB;AACA,WAAO;AAAA,MACL,wBAAwB,EAAE,SAAS,kBAAkB,CAAC;AAAA,IACxD;AAAA,EACF;AACF;AAEA,IAAM,qBAAqB;AAAA,EACzB,CAAC,EAAE,SAAS,MAAM,MAAkD;AAClE,UAAM,cAAc;AAAA,MAClB,MAAM,QAAQ,sBAAsB,KAAK;AAAA,MACzC,CAAC,SAAS,KAAK;AAAA,IACjB;AACA,WAAO,kBAAkB,kBAAkB,EAAE,SAAS,YAAY,CAAC,CAAC;AAAA,EACtE;AACF;AAEO,IAAM,gBAAgB;AAAA,EAC3B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,EACF,MAGM;AACJ,UAAM,eAAe,gBAAgB,OAAO;AAE5C,UAAM,CAAC,eAAe,WAAW,IAAI,SAAS,KAAK;AACnD,UAAM,CAAC,iBAAiB,aAAa,IAAI,SAAS,KAAK;AAEvD,UAAM,eAAe;AAAA,MACnB,OAAO;AAAA,QACL,IAAI,UAAU;AACZ,iBAAO,QAAQ,SAAS,EAAE;AAAA,QAC5B;AAAA,M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IAAI,EAAE,KAAK,gBAAgB,SAAS,WAAW,CAAC;AAAA,QAC/D;AAAA,MACF;AAAA,MAEA,YAAY,CAAC,aAAa;AACxB,YAAI,QAAQ,UAAU;AACpB,iBAAO,YAAY,IAAI,EAAE,KAAK,SAAS,GAAG,CAAC;AAAA,QAC7C,OAAO;AACL,iBAAO,YAAY,IAAI,QAAQ;AAAA,QACjC;AAAA,MACF;AAAA,MAEA;AAAA,MACA;AAAA,MAEA,uBAAuB,MAAM;AAAA,IAC/B,CAAC;AAED,WAAO;AAAA,MACL,KAAK,aAAa;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
@@ -4,7 +4,7 @@ import { resource, tapInlineResource, tapMemo } from "@assistant-ui/tap";
|
|
4
4
|
import { tapSubscribable } from "../util-hooks/tapSubscribable.js";
|
5
5
|
import { ThreadListItemClient } from "./ThreadListItemRuntimeClient.js";
|
6
6
|
import { ThreadClient } from "./ThreadRuntimeClient.js";
|
7
|
-
import { tapLookupResources } from "
|
7
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources.js";
|
8
8
|
var ThreadListItemClientById = resource(
|
9
9
|
({ runtime, id }) => {
|
10
10
|
const threadListItemRuntime = tapMemo(
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/legacy-runtime/client/ThreadListRuntimeClient.ts"],"sourcesContent":["import { tapApi } from \"../../utils/tap-store\";\nimport { resource, tapInlineResource, tapMemo } from \"@assistant-ui/tap\";\nimport { ThreadListRuntime } from \"../runtime/ThreadListRuntime\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\nimport { ThreadListItemClient } from \"./ThreadListItemRuntimeClient\";\nimport { ThreadClient } from \"./ThreadRuntimeClient\";\nimport { tapLookupResources } from \"
|
1
|
+
{"version":3,"sources":["../../../src/legacy-runtime/client/ThreadListRuntimeClient.ts"],"sourcesContent":["import { tapApi } from \"../../utils/tap-store\";\nimport { resource, tapInlineResource, tapMemo } from \"@assistant-ui/tap\";\nimport { ThreadListRuntime } from \"../runtime/ThreadListRuntime\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\nimport { ThreadListItemClient } from \"./ThreadListItemRuntimeClient\";\nimport { ThreadClient } from \"./ThreadRuntimeClient\";\nimport { tapLookupResources } from \"../../client/util-hooks/tapLookupResources\";\nimport {\n ThreadListClientState,\n ThreadListClientApi,\n} from \"../../client/types/ThreadList\";\n\nconst ThreadListItemClientById = resource(\n ({ runtime, id }: { runtime: ThreadListRuntime; id: string }) => {\n const threadListItemRuntime = tapMemo(\n () => runtime.getItemById(id),\n [runtime, id],\n );\n return tapInlineResource(\n ThreadListItemClient({\n runtime: threadListItemRuntime,\n }),\n );\n },\n);\n\nexport const ThreadListClient = resource(\n ({ runtime }: { runtime: ThreadListRuntime }) => {\n const runtimeState = tapSubscribable(runtime);\n\n const main = tapInlineResource(\n ThreadClient({\n runtime: runtime.main,\n }),\n );\n\n const threadItems = tapLookupResources(\n Object.keys(runtimeState.threadItems).map((id) =>\n ThreadListItemClientById({ runtime, id }, { key: id }),\n ),\n );\n\n const state = tapMemo<ThreadListClientState>(() => {\n return {\n mainThreadId: runtimeState.mainThreadId,\n newThreadId: runtimeState.newThread,\n isLoading: runtimeState.isLoading,\n threadIds: runtimeState.threads,\n archivedThreadIds: runtimeState.archivedThreads,\n threadItems: threadItems.state,\n\n main: main.state,\n };\n }, [runtimeState, threadItems.state, main.state]);\n\n const api = tapApi<ThreadListClientApi>({\n getState: () => state,\n\n thread: () => main.api,\n\n item: (threadIdOrOptions) => {\n if (threadIdOrOptions === \"main\") {\n return threadItems.api({ key: state.mainThreadId });\n }\n\n if (\"id\" in threadIdOrOptions) {\n return threadItems.api({ key: threadIdOrOptions.id });\n }\n\n const { index, archived = false } = threadIdOrOptions;\n const id = archived\n ? state.archivedThreadIds[index]!\n : state.threadIds[index]!;\n return threadItems.api({ key: id });\n },\n\n switchToThread: (threadId) => {\n runtime.switchToThread(threadId);\n },\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AI,sBAAsB,QAAQ;AAChC,iBAAO,YAAY,IAAI,EAAE,KAAK,MAAM,aAAa,CAAC;AAAA,QACpD;AAEA,YAAI,QAAQ,mBAAmB;AAC7B,iBAAO,YAAY,IAAI,EAAE,KAAK,kBAAkB,GAAG,CAAC;AAAA,QACtD;AAEA,cAAM,EAAE,OAAO,WAAW,MAAM,IAAI;AACpC,cAAM,KAAK,WACP,MAAM,kBAAkB,KAAK,IAC7B,MAAM,UAAU,KAAK;AACzB,eAAO,YAAY,IAAI,EAAE,KAAK,GAAG,CAAC;AAAA,MACpC;AAAA,MAEA,gBAAgB,CAAC,aAAa;AAC5B,gBAAQ,eAAe,QAAQ;AAAA,MACjC;AAAA,MACA,mBAAmB,MAAM;AACvB,gBAAQ,kBAAkB;AAAA,MAC5B;AAAA,IACF,CAAC;AAED,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
@@ -9,7 +9,7 @@ import { ComposerClient } from "./ComposerRuntimeClient.js";
|
|
9
9
|
import { MessageClient } from "./MessageRuntimeClient.js";
|
10
10
|
import { tapSubscribable } from "../util-hooks/tapSubscribable.js";
|
11
11
|
import { tapApi } from "../../utils/tap-store/index.js";
|
12
|
-
import { tapLookupResources } from "
|
12
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources.js";
|
13
13
|
import { tapEvents } from "../../client/EventContext.js";
|
14
14
|
var MessageClientById = resource(
|
15
15
|
({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/legacy-runtime/client/ThreadRuntimeClient.ts"],"sourcesContent":["import { ThreadRuntimeEventType } from \"../runtime-cores/core/ThreadRuntimeCore\";\nimport { ThreadRuntime } from \"../runtime/ThreadRuntime\";\nimport {\n resource,\n tapInlineResource,\n tapMemo,\n tapEffect,\n RefObject,\n} from \"@assistant-ui/tap\";\nimport { ComposerClient } from \"./ComposerRuntimeClient\";\nimport { MessageClient } from \"./MessageRuntimeClient\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\nimport { tapApi } from \"../../utils/tap-store\";\nimport { tapLookupResources } from \"
|
1
|
+
{"version":3,"sources":["../../../src/legacy-runtime/client/ThreadRuntimeClient.ts"],"sourcesContent":["import { ThreadRuntimeEventType } from \"../runtime-cores/core/ThreadRuntimeCore\";\nimport { ThreadRuntime } from \"../runtime/ThreadRuntime\";\nimport {\n resource,\n tapInlineResource,\n tapMemo,\n tapEffect,\n RefObject,\n} from \"@assistant-ui/tap\";\nimport { ComposerClient } from \"./ComposerRuntimeClient\";\nimport { MessageClient } from \"./MessageRuntimeClient\";\nimport { tapSubscribable } from \"../util-hooks/tapSubscribable\";\nimport { tapApi } from \"../../utils/tap-store\";\nimport { tapLookupResources } from \"../../client/util-hooks/tapLookupResources\";\nimport { Unsubscribe } from \"../../types\";\nimport { tapEvents } from \"../../client/EventContext\";\nimport { ThreadClientState, ThreadClientApi } from \"../../client/types/Thread\";\n\nconst MessageClientById = resource(\n ({\n runtime,\n id,\n threadIdRef,\n }: {\n runtime: ThreadRuntime;\n id: string;\n threadIdRef: RefObject<string>;\n }) => {\n const messageRuntime = tapMemo(\n () => runtime.getMessageById(id),\n [runtime, id],\n );\n\n return tapInlineResource(\n MessageClient({ runtime: messageRuntime, threadIdRef }),\n );\n },\n);\n\nexport const ThreadClient = resource(\n ({ runtime }: { runtime: ThreadRuntime }) => {\n const runtimeState = tapSubscribable(runtime);\n\n const events = tapEvents();\n\n // Bind thread events to event manager\n tapEffect(() => {\n const unsubscribers: Unsubscribe[] = [];\n\n // Subscribe to thread events\n const threadEvents: ThreadRuntimeEventType[] = [\n \"run-start\",\n \"run-end\",\n \"initialize\",\n \"model-context-update\",\n ];\n\n for (const event of threadEvents) {\n const unsubscribe = runtime.unstable_on(event, () => {\n const threadId = runtime.getState()?.threadId || \"unknown\";\n events.emit(`thread.${event}`, {\n threadId,\n });\n });\n unsubscribers.push(unsubscribe);\n }\n\n return () => {\n for (const unsub of unsubscribers) unsub();\n };\n }, [runtime]);\n\n const threadIdRef = tapMemo(\n () => ({\n get current() {\n return runtime.getState()!.threadId;\n },\n }),\n [runtime],\n );\n\n const composer = tapInlineResource(\n ComposerClient({\n runtime: runtime.composer,\n threadIdRef,\n }),\n );\n\n const messages = tapLookupResources(\n runtimeState.messages.map((m) =>\n MessageClientById(\n { runtime: runtime, id: m.id, threadIdRef },\n { key: m.id },\n ),\n ),\n );\n\n const state = tapMemo<ThreadClientState>(() => {\n return {\n isDisabled: runtimeState.isDisabled,\n isLoading: runtimeState.isLoading,\n isRunning: runtimeState.isRunning,\n capabilities: runtimeState.capabilities,\n state: runtimeState.state,\n suggestions: runtimeState.suggestions,\n extras: runtimeState.extras,\n speech: runtimeState.speech,\n\n composer: composer.state,\n messages: messages.state,\n };\n }, [runtimeState, messages, composer.state]);\n\n const api = tapApi<ThreadClientApi>({\n getState: () => state,\n\n composer: composer.api,\n\n append: runtime.append,\n startRun: runtime.startRun,\n unstable_resumeRun: runtime.unstable_resumeRun,\n cancelRun: runtime.cancelRun,\n getModelContext: runtime.getModelContext,\n export: runtime.export,\n import: runtime.import,\n reset: runtime.reset,\n stopSpeaking: runtime.stopSpeaking,\n\n message: (selector) => {\n if (\"id\" in selector) {\n return messages.api({ key: selector.id });\n } else {\n return messages.api(selector);\n }\n },\n\n __internal_getRuntime: () => runtime,\n });\n\n return {\n state,\n api,\n };\n },\n);\n"],"mappings":";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,cAAc;AACvB,SAAS,0BAA0B;AAEnC,SAAS,iBAAiB;AAG1B,IAAM,oBAAoB;AAAA,EACxB,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAIM;AACJ,UAAM,iBAAiB;AAAA,MACrB,MAAM,QAAQ,eAAe,EAAE;AAAA,MAC/B,CAAC,SAAS,EAAE;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c,aAAa;AAAA,QAC3B,OAAO,aAAa;AAAA,QACpB,aAAa,aAAa;AAAA,QAC1B,QAAQ,aAAa;AAAA,QACrB,QAAQ,aAAa;AAAA,QAErB,UAAU,SAAS;AAAA,QACnB,UAAU,SAAS;AAAA,MACrB;AAAA,IACF,GAAG,CAAC,cAAc,UAAU,SAAS,KAAK,CAAC;AAE3C,UAAM,MAAM,OAAwB;AAAA,MAClC,UAAU,MAAM;AAAA,MAEhB,UAAU,SAAS;AAAA,MAEnB,QAAQ,QAAQ;AAAA,MAChB,UAAU,QAAQ;AAAA,MAClB,oBAAoB,QAAQ;AAAA,MAC5B,WAAW,QAAQ;AAAA,MACnB,iBAAiB,QAAQ;AAAA,MACzB,QAAQ,QAAQ;AAAA,MAChB,QAAQ,QAAQ;AAAA,MAChB,OAAO,QAAQ;AAAA,MACf,cAAc,QAAQ;AAAA,MAEtB,SAAS,CAAC,aAAa;AACrB,YAAI,QAAQ,UAAU;AACpB,iBAAO,SAAS,IAAI,EAAE,KAAK,SAAS,GAAG,CAAC;AAAA,QAC1C,OAAO;AACL,iBAAO,SAAS,IAAI,QAAQ;AAAA,QAC9B;AAAA,MACF;AAAA,MAEA,uBAAuB,MAAM;AAAA,IAC/B,CAAC;AAED,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
@@ -2,7 +2,6 @@ export type { AssistantRuntime } from "./AssistantRuntime";
|
|
2
2
|
export type { ThreadRuntime, ThreadState, CreateAppendMessage, CreateStartRunConfig, } from "./ThreadRuntime";
|
3
3
|
export type { MessageRuntime, MessageState } from "./MessageRuntime";
|
4
4
|
export type { MessagePartRuntime, MessagePartState, } from "./MessagePartRuntime";
|
5
|
-
export type { MessagePartRuntime as MessageContentRuntime, MessagePartState as MessageContentState, } from "./MessagePartRuntime";
|
6
5
|
export type { ComposerRuntime, ThreadComposerRuntime, EditComposerRuntime, EditComposerState, ThreadComposerState, ComposerState, } from "./ComposerRuntime";
|
7
6
|
export type { AttachmentRuntime, AttachmentState } from "./AttachmentRuntime";
|
8
7
|
export type { ThreadListRuntime, ThreadListState } from "./ThreadListRuntime";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy-runtime/runtime/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EACV,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErE,YAAY,EACV,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy-runtime/runtime/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EACV,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErE,YAAY,EACV,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC"}
|
@@ -33,7 +33,7 @@ export declare abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore
|
|
33
33
|
get state(): string | number | boolean | import("assistant-stream/utils").ReadonlyJSONObject | import("assistant-stream/utils").ReadonlyJSONArray | null;
|
34
34
|
readonly composer: DefaultThreadComposerRuntimeCore;
|
35
35
|
constructor(_contextProvider: ModelContextProvider);
|
36
|
-
getModelContext(): import("../../..").
|
36
|
+
getModelContext(): import("../../..").ModelContext;
|
37
37
|
private _editComposers;
|
38
38
|
getEditComposer(messageId: string): DefaultEditComposerRuntimeCore | undefined;
|
39
39
|
beginEdit(messageId: string): void;
|
@@ -23,7 +23,7 @@ export declare class RemoteThreadListHookInstanceManager extends BaseSubscribabl
|
|
23
23
|
stopSpeaking: () => void;
|
24
24
|
getSubmittedFeedback: (messageId: string) => import("../core/ThreadRuntimeCore").SubmittedFeedback | undefined;
|
25
25
|
submitFeedback: (feedback: import("..").SubmitFeedbackOptions) => void;
|
26
|
-
getModelContext: () => import("../../..").
|
26
|
+
getModelContext: () => import("../../..").ModelContext;
|
27
27
|
composer: import("../core/ComposerRuntimeCore").ThreadComposerRuntimeCore;
|
28
28
|
getEditComposer: (messageId: string) => import("../core/ComposerRuntimeCore").ComposerRuntimeCore | undefined;
|
29
29
|
beginEdit: (messageId: string) => void;
|
@@ -57,7 +57,7 @@ export declare class RemoteThreadListHookInstanceManager extends BaseSubscribabl
|
|
57
57
|
stopSpeaking: () => void;
|
58
58
|
getSubmittedFeedback: (messageId: string) => import("../core/ThreadRuntimeCore").SubmittedFeedback | undefined;
|
59
59
|
submitFeedback: (feedback: import("..").SubmitFeedbackOptions) => void;
|
60
|
-
getModelContext: () => import("../../..").
|
60
|
+
getModelContext: () => import("../../..").ModelContext;
|
61
61
|
composer: import("../core/ComposerRuntimeCore").ThreadComposerRuntimeCore;
|
62
62
|
getEditComposer: (messageId: string) => import("../core/ComposerRuntimeCore").ComposerRuntimeCore | undefined;
|
63
63
|
beginEdit: (messageId: string) => void;
|
@@ -61,7 +61,7 @@ export declare class RemoteThreadListThreadListRuntimeCore extends BaseSubscriba
|
|
61
61
|
stopSpeaking: () => void;
|
62
62
|
getSubmittedFeedback: (messageId: string) => import("../core/ThreadRuntimeCore").SubmittedFeedback | undefined;
|
63
63
|
submitFeedback: (feedback: import("..").SubmitFeedbackOptions) => void;
|
64
|
-
getModelContext: () => import("../../..").
|
64
|
+
getModelContext: () => import("../../..").ModelContext;
|
65
65
|
composer: import("../core/ComposerRuntimeCore").ThreadComposerRuntimeCore;
|
66
66
|
getEditComposer: (messageId: string) => import("../core/ComposerRuntimeCore").ComposerRuntimeCore | undefined;
|
67
67
|
beginEdit: (messageId: string) => void;
|
@@ -95,7 +95,7 @@ export declare class RemoteThreadListThreadListRuntimeCore extends BaseSubscriba
|
|
95
95
|
stopSpeaking: () => void;
|
96
96
|
getSubmittedFeedback: (messageId: string) => import("../core/ThreadRuntimeCore").SubmittedFeedback | undefined;
|
97
97
|
submitFeedback: (feedback: import("..").SubmitFeedbackOptions) => void;
|
98
|
-
getModelContext: () => import("../../..").
|
98
|
+
getModelContext: () => import("../../..").ModelContext;
|
99
99
|
composer: import("../core/ComposerRuntimeCore").ThreadComposerRuntimeCore;
|
100
100
|
getEditComposer: (messageId: string) => import("../core/ComposerRuntimeCore").ComposerRuntimeCore | undefined;
|
101
101
|
beginEdit: (messageId: string) => void;
|
@@ -4,21 +4,9 @@ export { useAssistantInstructions } from "./useAssistantInstructions";
|
|
4
4
|
export { useAssistantTool, type AssistantToolProps } from "./useAssistantTool";
|
5
5
|
export { useAssistantToolUI, type AssistantToolUIProps, } from "./useAssistantToolUI";
|
6
6
|
export { useInlineRender } from "./useInlineRender";
|
7
|
-
export type {
|
8
|
-
/**
|
9
|
-
* @deprecated This type was renamed to `ModelContext`.
|
10
|
-
*/
|
11
|
-
ModelContext as AssistantConfig,
|
12
|
-
/**
|
13
|
-
* @deprecated This type was renamed to `ModelContextProvider`.
|
14
|
-
*/
|
15
|
-
ModelContextProvider as AssistantConfigProvider, ModelContext, ModelContextProvider, } from "./ModelContextTypes";
|
7
|
+
export type { ModelContext, ModelContextProvider } from "./ModelContextTypes";
|
16
8
|
export type { Tool } from "assistant-stream";
|
17
9
|
export { tool } from "./tool";
|
18
|
-
/**
|
19
|
-
* @deprecated This function was renamed to `makeAssistantVisible`.
|
20
|
-
*/
|
21
|
-
export { makeAssistantVisible as makeAssistantReadable } from "./makeAssistantVisible";
|
22
10
|
export { makeAssistantVisible } from "./makeAssistantVisible";
|
23
11
|
export * from "./registry";
|
24
12
|
export * from "./frame";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACL,KAAK,eAAe,EACpB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,YAAY
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACL,KAAK,eAAe,EACpB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
@@ -11,14 +11,12 @@ import {
|
|
11
11
|
import { useInlineRender } from "./useInlineRender.js";
|
12
12
|
import { tool } from "./tool.js";
|
13
13
|
import { makeAssistantVisible } from "./makeAssistantVisible.js";
|
14
|
-
import { makeAssistantVisible as makeAssistantVisible2 } from "./makeAssistantVisible.js";
|
15
14
|
export * from "./registry/index.js";
|
16
15
|
export * from "./frame/index.js";
|
17
16
|
export {
|
18
|
-
makeAssistantVisible as makeAssistantReadable,
|
19
17
|
makeAssistantTool,
|
20
18
|
makeAssistantToolUI,
|
21
|
-
|
19
|
+
makeAssistantVisible,
|
22
20
|
tool,
|
23
21
|
useAssistantInstructions,
|
24
22
|
useAssistantTool,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/model-context/index.ts"],"sourcesContent":["export { makeAssistantTool, type AssistantTool } from \"./makeAssistantTool\";\nexport {\n type AssistantToolUI,\n makeAssistantToolUI,\n} from \"./makeAssistantToolUI\";\nexport { useAssistantInstructions } from \"./useAssistantInstructions\";\nexport { useAssistantTool, type AssistantToolProps } from \"./useAssistantTool\";\nexport {\n useAssistantToolUI,\n type AssistantToolUIProps,\n} from \"./useAssistantToolUI\";\nexport { useInlineRender } from \"./useInlineRender\";\n\nexport type {
|
1
|
+
{"version":3,"sources":["../../src/model-context/index.ts"],"sourcesContent":["export { makeAssistantTool, type AssistantTool } from \"./makeAssistantTool\";\nexport {\n type AssistantToolUI,\n makeAssistantToolUI,\n} from \"./makeAssistantToolUI\";\nexport { useAssistantInstructions } from \"./useAssistantInstructions\";\nexport { useAssistantTool, type AssistantToolProps } from \"./useAssistantTool\";\nexport {\n useAssistantToolUI,\n type AssistantToolUIProps,\n} from \"./useAssistantToolUI\";\nexport { useInlineRender } from \"./useInlineRender\";\n\nexport type { ModelContext, ModelContextProvider } from \"./ModelContextTypes\";\n\nexport type { Tool } from \"assistant-stream\";\n\nexport { tool } from \"./tool\";\n\nexport { makeAssistantVisible } from \"./makeAssistantVisible\";\n\nexport * from \"./registry\";\nexport * from \"./frame\";\n"],"mappings":";AAAA,SAAS,yBAA6C;AACtD;AAAA,EAEE;AAAA,OACK;AACP,SAAS,gCAAgC;AACzC,SAAS,wBAAiD;AAC1D;AAAA,EACE;AAAA,OAEK;AACP,SAAS,uBAAuB;AAMhC,SAAS,YAAY;AAErB,SAAS,4BAA4B;AAErC,cAAc;AACd,cAAc;","names":[]}
|
@@ -15,10 +15,4 @@ export { useMessagePartSource } from "./messagePart/useMessagePartSource";
|
|
15
15
|
export { useMessagePartFile } from "./messagePart/useMessagePartFile";
|
16
16
|
export { useMessagePartImage } from "./messagePart/useMessagePartImage";
|
17
17
|
export { useThreadViewportAutoScroll } from "./thread/useThreadViewportAutoScroll";
|
18
|
-
export * as ContentPartPrimitive from "./messagePart";
|
19
|
-
export { useMessagePartText as useContentPartText } from "./messagePart/useMessagePartText";
|
20
|
-
export { useMessagePartReasoning as useContentPartReasoning } from "./messagePart/useMessagePartReasoning";
|
21
|
-
export { useMessagePartSource as useContentPartSource } from "./messagePart/useMessagePartSource";
|
22
|
-
export { useMessagePartFile as useContentPartFile } from "./messagePart/useMessagePartFile";
|
23
|
-
export { useMessagePartImage as useContentPartImage } from "./messagePart/useMessagePartImage";
|
24
18
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK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AC;AAC5C,OAAO,KAAK,mBAAmB,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,uBAAuB,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/primitives/index.js
CHANGED
@@ -16,30 +16,18 @@ import { useMessagePartSource } from "./messagePart/useMessagePartSource.js";
|
|
16
16
|
import { useMessagePartFile } from "./messagePart/useMessagePartFile.js";
|
17
17
|
import { useMessagePartImage } from "./messagePart/useMessagePartImage.js";
|
18
18
|
import { useThreadViewportAutoScroll } from "./thread/useThreadViewportAutoScroll.js";
|
19
|
-
import * as ContentPartPrimitive from "./messagePart/index.js";
|
20
|
-
import { useMessagePartText as useMessagePartText2 } from "./messagePart/useMessagePartText.js";
|
21
|
-
import { useMessagePartReasoning as useMessagePartReasoning2 } from "./messagePart/useMessagePartReasoning.js";
|
22
|
-
import { useMessagePartSource as useMessagePartSource2 } from "./messagePart/useMessagePartSource.js";
|
23
|
-
import { useMessagePartFile as useMessagePartFile2 } from "./messagePart/useMessagePartFile.js";
|
24
|
-
import { useMessagePartImage as useMessagePartImage2 } from "./messagePart/useMessagePartImage.js";
|
25
19
|
export {
|
26
20
|
ActionBarPrimitive,
|
27
21
|
AssistantModalPrimitive,
|
28
22
|
AttachmentPrimitive,
|
29
23
|
BranchPickerPrimitive,
|
30
24
|
ComposerPrimitive,
|
31
|
-
ContentPartPrimitive,
|
32
25
|
ErrorPrimitive,
|
33
26
|
MessagePartPrimitive,
|
34
27
|
MessagePrimitive,
|
35
28
|
ThreadListItemPrimitive,
|
36
29
|
ThreadListPrimitive,
|
37
30
|
ThreadPrimitive,
|
38
|
-
useMessagePartFile2 as useContentPartFile,
|
39
|
-
useMessagePartImage2 as useContentPartImage,
|
40
|
-
useMessagePartReasoning2 as useContentPartReasoning,
|
41
|
-
useMessagePartSource2 as useContentPartSource,
|
42
|
-
useMessagePartText2 as useContentPartText,
|
43
31
|
useMessagePartFile,
|
44
32
|
useMessagePartImage,
|
45
33
|
useMessagePartReasoning,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as MessagePartPrimitive from \"./messagePart\";\nexport * as ErrorPrimitive from \"./error\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport { useMessagePartText } from \"./messagePart/useMessagePartText\";\nexport { useMessagePartReasoning } from \"./messagePart/useMessagePartReasoning\";\nexport { useMessagePartSource } from \"./messagePart/useMessagePartSource\";\nexport { useMessagePartFile } from \"./messagePart/useMessagePartFile\";\nexport { useMessagePartImage } from \"./messagePart/useMessagePartImage\";\nexport { useThreadViewportAutoScroll } from \"./thread/useThreadViewportAutoScroll\";\n
|
1
|
+
{"version":3,"sources":["../../src/primitives/index.ts"],"sourcesContent":["export * as ActionBarPrimitive from \"./actionBar\";\nexport * as AssistantModalPrimitive from \"./assistantModal\";\nexport * as AttachmentPrimitive from \"./attachment\";\nexport * as BranchPickerPrimitive from \"./branchPicker\";\nexport * as ComposerPrimitive from \"./composer\";\nexport * as MessagePartPrimitive from \"./messagePart\";\nexport * as ErrorPrimitive from \"./error\";\nexport * as MessagePrimitive from \"./message\";\nexport * as ThreadPrimitive from \"./thread\";\nexport * as ThreadListPrimitive from \"./threadList\";\nexport * as ThreadListItemPrimitive from \"./threadListItem\";\n\nexport { useMessagePartText } from \"./messagePart/useMessagePartText\";\nexport { useMessagePartReasoning } from \"./messagePart/useMessagePartReasoning\";\nexport { useMessagePartSource } from \"./messagePart/useMessagePartSource\";\nexport { useMessagePartFile } from \"./messagePart/useMessagePartFile\";\nexport { useMessagePartImage } from \"./messagePart/useMessagePartImage\";\nexport { useThreadViewportAutoScroll } from \"./thread/useThreadViewportAutoScroll\";\n"],"mappings":";AAAA,YAAY,wBAAwB;AACpC,YAAY,6BAA6B;AACzC,YAAY,yBAAyB;AACrC,YAAY,2BAA2B;AACvC,YAAY,uBAAuB;AACnC,YAAY,0BAA0B;AACtC,YAAY,oBAAoB;AAChC,YAAY,sBAAsB;AAClC,YAAY,qBAAqB;AACjC,YAAY,yBAAyB;AACrC,YAAY,6BAA6B;AAEzC,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,mCAAmC;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
export type { Attachment, PendingAttachment, CompleteAttachment, AttachmentStatus, } from "./AttachmentTypes";
|
2
2
|
export type { AppendMessage, TextMessagePart, ReasoningMessagePart, SourceMessagePart, ImageMessagePart, FileMessagePart, Unstable_AudioMessagePart, ToolCallMessagePart, MessageStatus, MessagePartStatus, ToolCallMessagePartStatus, ThreadUserMessagePart, ThreadAssistantMessagePart, ThreadSystemMessage, ThreadAssistantMessage, ThreadUserMessage, ThreadMessage, } from "./AssistantTypes";
|
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
3
|
export type { EmptyMessagePartComponent, EmptyMessagePartProps, TextMessagePartComponent, TextMessagePartProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, SourceMessagePartComponent, SourceMessagePartProps, ImageMessagePartComponent, ImageMessagePartProps, FileMessagePartComponent, FileMessagePartProps, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps, ToolCallMessagePartComponent, ToolCallMessagePartProps, } from "./MessagePartComponentTypes";
|
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
4
|
export type { ThreadListItemStatus } from "../legacy-runtime/runtime/ThreadListItemRuntime";
|
7
5
|
export type { Unsubscribe } from "./Unsubscribe";
|
8
6
|
export type { AssistantEventScope, AssistantEventSelector, AssistantEvents, } from "./EventTypes";
|
@@ -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,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EAGzB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,GACd,MAAM,kBAAkB,CAAC;
|
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,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EAGzB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,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,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAE5F,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,GAChB,MAAM,cAAc,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { type ModelContextProvider } from "../model-context/ModelContextTypes";
|
2
2
|
export declare class CompositeContextProvider implements ModelContextProvider {
|
3
3
|
private _providers;
|
4
|
-
getModelContext(): import("..").
|
4
|
+
getModelContext(): import("..").ModelContext;
|
5
5
|
registerModelContextProvider(provider: ModelContextProvider): () => void;
|
6
6
|
private _subscribers;
|
7
7
|
notifySubscribers(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/tap-store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/tap-store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/tap-store/index.ts"],"sourcesContent":["export { type Store, asStore } from \"./store\";\nexport { tapApi, type ApiObject
|
1
|
+
{"version":3,"sources":["../../../src/utils/tap-store/index.ts"],"sourcesContent":["export { type Store, asStore } from \"./store\";\nexport { tapApi, type ApiObject } from \"./tap-api\";\n"],"mappings":";AAAA,SAAqB,eAAe;AACpC,SAAS,cAA8B;","names":[]}
|
package/package.json
CHANGED
@@ -23,7 +23,7 @@ export type ComposerClientApi = {
|
|
23
23
|
setRunConfig(runConfig: RunConfig): void;
|
24
24
|
addAttachment(file: File): Promise<void>;
|
25
25
|
clearAttachments(): Promise<void>;
|
26
|
-
attachment(selector: { index: number }): AttachmentClientApi;
|
26
|
+
attachment(selector: { index: number } | { id: string }): AttachmentClientApi;
|
27
27
|
reset(): Promise<void>;
|
28
28
|
send(): void;
|
29
29
|
cancel(): void;
|
@@ -56,7 +56,7 @@ export type MessageClientApi = {
|
|
56
56
|
part: (
|
57
57
|
selector: { index: number } | { toolCallId: string },
|
58
58
|
) => MessagePartClientApi;
|
59
|
-
attachment(selector: { index: number }): AttachmentClientApi;
|
59
|
+
attachment(selector: { index: number } | { id: string }): AttachmentClientApi;
|
60
60
|
|
61
61
|
setIsCopied(value: boolean): void;
|
62
62
|
setIsHovering(value: boolean): void;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ResourceElement, tapResources } from "@assistant-ui/tap";
|
2
|
-
import {
|
2
|
+
import { ApiObject } from "../../utils/tap-store";
|
3
3
|
|
4
|
-
export const tapLookupResources = <TState, TApi extends
|
4
|
+
export const tapLookupResources = <TState, TApi extends ApiObject>(
|
5
5
|
elements: ResourceElement<{
|
6
6
|
key: string | undefined;
|
7
7
|
state: TState;
|
@@ -10,7 +10,7 @@ import {
|
|
10
10
|
EditComposerRuntime,
|
11
11
|
} from "../runtime/ComposerRuntime";
|
12
12
|
import { Unsubscribe } from "../../types";
|
13
|
-
|
13
|
+
|
14
14
|
import { tapApi } from "../../utils/tap-store";
|
15
15
|
import { ComposerRuntimeEventType } from "../runtime-cores/core/ComposerRuntimeCore";
|
16
16
|
import { tapEvents } from "../../client/EventContext";
|
@@ -18,8 +18,9 @@ import {
|
|
18
18
|
ComposerClientState,
|
19
19
|
ComposerClientApi,
|
20
20
|
} from "../../client/types/Composer";
|
21
|
-
import { tapLookupResources } from "
|
21
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources";
|
22
22
|
import { AttachmentRuntimeClient } from "./AttachmentRuntimeClient";
|
23
|
+
import { tapSubscribable } from "../util-hooks/tapSubscribable";
|
23
24
|
|
24
25
|
const ComposerAttachmentClientByIndex = resource(
|
25
26
|
({ runtime, index }: { runtime: ComposerRuntime; index: number }) => {
|
@@ -115,7 +116,13 @@ export const ComposerClient = resource(
|
|
115
116
|
throw new Error("beginEdit is not supported in this runtime");
|
116
117
|
}),
|
117
118
|
|
118
|
-
attachment:
|
119
|
+
attachment: (selector) => {
|
120
|
+
if ("id" in selector) {
|
121
|
+
return attachments.api({ key: selector.id });
|
122
|
+
} else {
|
123
|
+
return attachments.api(selector);
|
124
|
+
}
|
125
|
+
},
|
119
126
|
|
120
127
|
__internal_getRuntime: () => runtime,
|
121
128
|
});
|
@@ -9,7 +9,7 @@ import { MessageRuntime } from "../runtime/MessageRuntime";
|
|
9
9
|
import { tapSubscribable } from "../util-hooks/tapSubscribable";
|
10
10
|
import { ComposerClient } from "./ComposerRuntimeClient";
|
11
11
|
import { MessagePartClient } from "./MessagePartRuntimeClient";
|
12
|
-
import { tapLookupResources } from "
|
12
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources";
|
13
13
|
import { RefObject } from "react";
|
14
14
|
import {
|
15
15
|
MessageClientState,
|
@@ -119,7 +119,13 @@ export const MessageClient = resource(
|
|
119
119
|
}
|
120
120
|
},
|
121
121
|
|
122
|
-
attachment:
|
122
|
+
attachment: (selector) => {
|
123
|
+
if ("id" in selector) {
|
124
|
+
return attachments.api({ key: selector.id });
|
125
|
+
} else {
|
126
|
+
return attachments.api(selector);
|
127
|
+
}
|
128
|
+
},
|
123
129
|
|
124
130
|
setIsCopied,
|
125
131
|
setIsHovering,
|
@@ -4,7 +4,7 @@ import { ThreadListRuntime } from "../runtime/ThreadListRuntime";
|
|
4
4
|
import { tapSubscribable } from "../util-hooks/tapSubscribable";
|
5
5
|
import { ThreadListItemClient } from "./ThreadListItemRuntimeClient";
|
6
6
|
import { ThreadClient } from "./ThreadRuntimeClient";
|
7
|
-
import { tapLookupResources } from "
|
7
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources";
|
8
8
|
import {
|
9
9
|
ThreadListClientState,
|
10
10
|
ThreadListClientApi,
|
@@ -11,7 +11,7 @@ import { ComposerClient } from "./ComposerRuntimeClient";
|
|
11
11
|
import { MessageClient } from "./MessageRuntimeClient";
|
12
12
|
import { tapSubscribable } from "../util-hooks/tapSubscribable";
|
13
13
|
import { tapApi } from "../../utils/tap-store";
|
14
|
-
import { tapLookupResources } from "
|
14
|
+
import { tapLookupResources } from "../../client/util-hooks/tapLookupResources";
|
15
15
|
import { Unsubscribe } from "../../types";
|
16
16
|
import { tapEvents } from "../../client/EventContext";
|
17
17
|
import { ThreadClientState, ThreadClientApi } from "../../client/types/Thread";
|
@@ -12,12 +12,6 @@ export type {
|
|
12
12
|
MessagePartState,
|
13
13
|
} from "./MessagePartRuntime";
|
14
14
|
|
15
|
-
// TODO remove in v0.11
|
16
|
-
export type {
|
17
|
-
MessagePartRuntime as MessageContentRuntime,
|
18
|
-
MessagePartState as MessageContentState,
|
19
|
-
} from "./MessagePartRuntime";
|
20
|
-
|
21
15
|
export type {
|
22
16
|
ComposerRuntime,
|
23
17
|
ThreadComposerRuntime,
|
@@ -11,27 +11,12 @@ export {
|
|
11
11
|
} from "./useAssistantToolUI";
|
12
12
|
export { useInlineRender } from "./useInlineRender";
|
13
13
|
|
14
|
-
export type {
|
15
|
-
/**
|
16
|
-
* @deprecated This type was renamed to `ModelContext`.
|
17
|
-
*/
|
18
|
-
ModelContext as AssistantConfig,
|
19
|
-
/**
|
20
|
-
* @deprecated This type was renamed to `ModelContextProvider`.
|
21
|
-
*/
|
22
|
-
ModelContextProvider as AssistantConfigProvider,
|
23
|
-
ModelContext,
|
24
|
-
ModelContextProvider,
|
25
|
-
} from "./ModelContextTypes";
|
14
|
+
export type { ModelContext, ModelContextProvider } from "./ModelContextTypes";
|
26
15
|
|
27
16
|
export type { Tool } from "assistant-stream";
|
28
17
|
|
29
18
|
export { tool } from "./tool";
|
30
19
|
|
31
|
-
/**
|
32
|
-
* @deprecated This function was renamed to `makeAssistantVisible`.
|
33
|
-
*/
|
34
|
-
export { makeAssistantVisible as makeAssistantReadable } from "./makeAssistantVisible";
|
35
20
|
export { makeAssistantVisible } from "./makeAssistantVisible";
|
36
21
|
|
37
22
|
export * from "./registry";
|
package/src/primitives/index.ts
CHANGED
@@ -16,11 +16,3 @@ export { useMessagePartSource } from "./messagePart/useMessagePartSource";
|
|
16
16
|
export { useMessagePartFile } from "./messagePart/useMessagePartFile";
|
17
17
|
export { useMessagePartImage } from "./messagePart/useMessagePartImage";
|
18
18
|
export { useThreadViewportAutoScroll } from "./thread/useThreadViewportAutoScroll";
|
19
|
-
|
20
|
-
// TODO remove in v0.11
|
21
|
-
export * as ContentPartPrimitive from "./messagePart";
|
22
|
-
export { useMessagePartText as useContentPartText } from "./messagePart/useMessagePartText";
|
23
|
-
export { useMessagePartReasoning as useContentPartReasoning } from "./messagePart/useMessagePartReasoning";
|
24
|
-
export { useMessagePartSource as useContentPartSource } from "./messagePart/useMessagePartSource";
|
25
|
-
export { useMessagePartFile as useContentPartFile } from "./messagePart/useMessagePartFile";
|
26
|
-
export { useMessagePartImage as useContentPartImage } from "./messagePart/useMessagePartImage";
|
package/src/types/index.ts
CHANGED
@@ -27,27 +27,6 @@ export type {
|
|
27
27
|
ThreadMessage,
|
28
28
|
} from "./AssistantTypes";
|
29
29
|
|
30
|
-
// TODO remove in v0.11
|
31
|
-
export type {
|
32
|
-
TextMessagePart as TextContentPart,
|
33
|
-
ReasoningMessagePart as ReasoningContentPart,
|
34
|
-
SourceMessagePart as SourceContentPart,
|
35
|
-
ImageMessagePart as ImageContentPart,
|
36
|
-
FileMessagePart as FileContentPart,
|
37
|
-
Unstable_AudioMessagePart as AudioContentPart,
|
38
|
-
ToolCallMessagePart as ToolCallContentPart,
|
39
|
-
MessagePartStatus as ContentPartStatus,
|
40
|
-
ToolCallMessagePartStatus as ToolCallContentPartStatus,
|
41
|
-
|
42
|
-
// thread message types
|
43
|
-
ThreadUserMessagePart as ThreadUserContentPart,
|
44
|
-
ThreadAssistantMessagePart as ThreadAssistantContentPart,
|
45
|
-
ThreadSystemMessage as ThreadSystemContentPart,
|
46
|
-
ThreadAssistantMessage as ThreadAssistantContent,
|
47
|
-
ThreadUserMessage as ThreadUserContent,
|
48
|
-
ThreadMessage as ThreadContent,
|
49
|
-
} from "./AssistantTypes";
|
50
|
-
|
51
30
|
export type {
|
52
31
|
EmptyMessagePartComponent,
|
53
32
|
EmptyMessagePartProps,
|
@@ -67,26 +46,6 @@ export type {
|
|
67
46
|
ToolCallMessagePartProps,
|
68
47
|
} from "./MessagePartComponentTypes";
|
69
48
|
|
70
|
-
// TODO remove in v0.11
|
71
|
-
export type {
|
72
|
-
EmptyMessagePartComponent as EmptyContentPartComponent,
|
73
|
-
EmptyMessagePartProps as EmptyContentPartProps,
|
74
|
-
TextMessagePartComponent as TextContentPartComponent,
|
75
|
-
TextMessagePartProps as TextContentPartProps,
|
76
|
-
ReasoningMessagePartComponent as ReasoningContentPartComponent,
|
77
|
-
ReasoningMessagePartProps as ReasoningContentPartProps,
|
78
|
-
SourceMessagePartComponent as SourceContentPartComponent,
|
79
|
-
SourceMessagePartProps as SourceContentPartProps,
|
80
|
-
ImageMessagePartComponent as ImageContentPartComponent,
|
81
|
-
ImageMessagePartProps as ImageContentPartProps,
|
82
|
-
FileMessagePartComponent as FileContentPartComponent,
|
83
|
-
FileMessagePartProps as FileContentPartProps,
|
84
|
-
Unstable_AudioMessagePartComponent as AudioContentPartComponent,
|
85
|
-
Unstable_AudioMessagePartProps as AudioContentPartProps,
|
86
|
-
ToolCallMessagePartComponent as ToolCallContentPartComponent,
|
87
|
-
ToolCallMessagePartProps as ToolCallContentPartProps,
|
88
|
-
} from "./MessagePartComponentTypes";
|
89
|
-
|
90
49
|
// Thread list item types
|
91
50
|
export type { ThreadListItemStatus } from "../legacy-runtime/runtime/ThreadListItemRuntime";
|
92
51
|
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { type Store, asStore } from "./store";
|
2
|
-
export { tapApi, type ApiObject
|
2
|
+
export { tapApi, type ApiObject } from "./tap-api";
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"tapLookupResources.d.ts","sourceRoot":"","sources":["../../../src/legacy-runtime/util-hooks/tapLookupResources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,GAAI,MAAM,EAAE,IAAI,SAAS,aAAa,EACnE,UAAU,eAAe,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,IAAI,CAAC;CACX,CAAC,EAAE;;kBAMY;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE;CAepD,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/legacy-runtime/util-hooks/tapLookupResources.ts"],"sourcesContent":["import { ResourceElement, tapResources } from \"@assistant-ui/tap\";\nimport { ActionsObject } from \"../../utils/tap-store\";\n\nexport const tapLookupResources = <TState, TApi extends ActionsObject>(\n elements: ResourceElement<{\n key: string | undefined;\n state: TState;\n api: TApi;\n }>[],\n) => {\n const resources = tapResources(elements);\n\n return {\n state: resources.map((r) => r.state),\n api: (lookup: { index: number } | { key: string }) => {\n const value =\n \"index\" in lookup\n ? resources[lookup.index]?.api\n : resources.find((r) => r.key === lookup.key)?.api;\n\n if (!value) {\n throw new Error(\n `tapLookupResources: Resource not found for lookup: ${JSON.stringify(lookup)}`,\n );\n }\n\n return value;\n },\n };\n};\n"],"mappings":";AAAA,SAA0B,oBAAoB;AAGvC,IAAM,qBAAqB,CAChC,aAKG;AACH,QAAM,YAAY,aAAa,QAAQ;AAEvC,SAAO;AAAA,IACL,OAAO,UAAU,IAAI,CAAC,MAAM,EAAE,KAAK;AAAA,IACnC,KAAK,CAAC,WAAgD;AACpD,YAAM,QACJ,WAAW,SACP,UAAU,OAAO,KAAK,GAAG,MACzB,UAAU,KAAK,CAAC,MAAM,EAAE,QAAQ,OAAO,GAAG,GAAG;AAEnD,UAAI,CAAC,OAAO;AACV,cAAM,IAAI;AAAA,UACR,sDAAsD,KAAK,UAAU,MAAM,CAAC;AAAA,QAC9E;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|