@assistant-ui/react 0.7.64 → 0.7.66
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/api/ThreadListItemRuntime.d.ts +2 -0
- package/dist/api/ThreadListItemRuntime.d.ts.map +1 -1
- package/dist/api/ThreadListItemRuntime.js +5 -0
- package/dist/api/ThreadListItemRuntime.js.map +1 -1
- package/dist/api/ThreadListItemRuntime.mjs +5 -0
- package/dist/api/ThreadListItemRuntime.mjs.map +1 -1
- package/dist/cloud/AssistantCloudThreads.d.ts +1 -1
- package/dist/cloud/AssistantCloudThreads.d.ts.map +1 -1
- package/dist/cloud/AssistantCloudThreads.js.map +1 -1
- package/dist/cloud/AssistantCloudThreads.mjs.map +1 -1
- package/dist/cloud/useCloudThreadListRuntime.d.ts +1 -1
- package/dist/cloud/useCloudThreadListRuntime.d.ts.map +1 -1
- package/dist/cloud/useCloudThreadListRuntime.js +8 -83
- package/dist/cloud/useCloudThreadListRuntime.js.map +1 -1
- package/dist/cloud/useCloudThreadListRuntime.mjs +8 -89
- package/dist/cloud/useCloudThreadListRuntime.mjs.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts +1 -2
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +4 -6
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.mjs +4 -6
- package/dist/primitives/thread/useThreadViewportAutoScroll.mjs.map +1 -1
- package/dist/runtimes/core/ThreadListRuntimeCore.d.ts +1 -0
- package/dist/runtimes/core/ThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/core/ThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/dangerous-in-browser/useDangerousInBrowserRuntime.d.ts +1 -1
- package/dist/runtimes/dangerous-in-browser/useDangerousInBrowserRuntime.d.ts.map +1 -1
- package/dist/runtimes/edge/EdgeChatAdapter.d.ts +22 -3
- package/dist/runtimes/edge/EdgeChatAdapter.d.ts.map +1 -1
- package/dist/runtimes/edge/EdgeChatAdapter.js +44 -13
- package/dist/runtimes/edge/EdgeChatAdapter.js.map +1 -1
- package/dist/runtimes/edge/EdgeChatAdapter.mjs +34 -13
- package/dist/runtimes/edge/EdgeChatAdapter.mjs.map +1 -1
- package/dist/runtimes/edge/useEdgeRuntime.d.ts +1 -1
- package/dist/runtimes/edge/useEdgeRuntime.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts +1 -0
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js +3 -0
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs +3 -0
- package/dist/runtimes/external-store/ExternalStoreThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.d.ts +1 -0
- package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.d.ts +4 -1
- package/dist/runtimes/local/LocalRuntimeOptions.d.ts.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.js +2 -0
- package/dist/runtimes/local/LocalRuntimeOptions.js.map +1 -1
- package/dist/runtimes/local/LocalRuntimeOptions.mjs +2 -0
- package/dist/runtimes/local/LocalRuntimeOptions.mjs.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts +21 -31
- package/dist/runtimes/local/LocalThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.js +43 -147
- package/dist/runtimes/local/LocalThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs +43 -147
- package/dist/runtimes/local/LocalThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.js +4 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs +4 -1
- package/dist/runtimes/local/LocalThreadRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/local/useLocalRuntime.d.ts +1 -1
- package/dist/runtimes/local/useLocalRuntime.d.ts.map +1 -1
- package/dist/runtimes/local/useLocalRuntime.js +10 -1
- package/dist/runtimes/local/useLocalRuntime.js.map +1 -1
- package/dist/runtimes/local/useLocalRuntime.mjs +10 -1
- package/dist/runtimes/local/useLocalRuntime.mjs.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListHookInstanceManager.js +4 -0
- package/dist/runtimes/remote-thread-list/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListHookInstanceManager.mjs +4 -0
- package/dist/runtimes/remote-thread-list/RemoteThreadListHookInstanceManager.mjs.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts +6 -6
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js +25 -23
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.mjs +25 -23
- package/dist/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/cloud.d.ts +13 -0
- package/dist/runtimes/remote-thread-list/adapter/cloud.d.ts.map +1 -0
- package/dist/runtimes/remote-thread-list/adapter/cloud.js +96 -0
- package/dist/runtimes/remote-thread-list/adapter/cloud.js.map +1 -0
- package/dist/runtimes/remote-thread-list/adapter/cloud.mjs +76 -0
- package/dist/runtimes/remote-thread-list/adapter/cloud.mjs.map +1 -0
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +12 -0
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -0
- package/dist/runtimes/remote-thread-list/adapter/in-memory.js +58 -0
- package/dist/runtimes/remote-thread-list/adapter/in-memory.js.map +1 -0
- package/dist/runtimes/remote-thread-list/adapter/in-memory.mjs +35 -0
- package/dist/runtimes/remote-thread-list/adapter/in-memory.mjs.map +1 -0
- package/dist/runtimes/remote-thread-list/index.d.ts +2 -1
- package/dist/runtimes/remote-thread-list/index.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/index.js +3 -0
- package/dist/runtimes/remote-thread-list/index.js.map +1 -1
- package/dist/runtimes/remote-thread-list/index.mjs +2 -0
- package/dist/runtimes/remote-thread-list/index.mjs.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +6 -6
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.js.map +1 -1
- package/dist/runtimes/remote-thread-list/useRemoteThreadListRuntime.d.ts +2 -2
- package/dist/runtimes/remote-thread-list/useRemoteThreadListRuntime.js +7 -7
- package/dist/runtimes/remote-thread-list/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/runtimes/remote-thread-list/useRemoteThreadListRuntime.mjs +7 -7
- package/dist/runtimes/remote-thread-list/useRemoteThreadListRuntime.mjs.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.d.ts.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.js +7 -17
- package/dist/utils/hooks/useOnResizeContent.js.map +1 -1
- package/dist/utils/hooks/useOnResizeContent.mjs +7 -17
- package/dist/utils/hooks/useOnResizeContent.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/ThreadListItemRuntime.ts +8 -0
- package/src/cloud/AssistantCloudThreads.tsx +1 -1
- package/src/cloud/useCloudThreadListRuntime.tsx +8 -110
- package/src/primitives/thread/useThreadViewportAutoScroll.tsx +3 -8
- package/src/runtimes/core/ThreadListRuntimeCore.tsx +1 -0
- package/src/runtimes/edge/EdgeChatAdapter.ts +90 -19
- package/src/runtimes/external-store/ExternalStoreThreadListRuntimeCore.tsx +4 -0
- package/src/runtimes/local/ChatModelAdapter.tsx +1 -0
- package/src/runtimes/local/LocalRuntimeOptions.tsx +4 -0
- package/src/runtimes/local/LocalThreadListRuntimeCore.tsx +47 -190
- package/src/runtimes/local/LocalThreadRuntimeCore.tsx +3 -0
- package/src/runtimes/local/useLocalRuntime.tsx +15 -2
- package/src/runtimes/remote-thread-list/RemoteThreadListHookInstanceManager.tsx +7 -0
- package/src/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx +27 -28
- package/src/runtimes/remote-thread-list/adapter/cloud.tsx +99 -0
- package/src/runtimes/remote-thread-list/adapter/in-memory.tsx +43 -0
- package/src/runtimes/remote-thread-list/index.ts +3 -4
- package/src/runtimes/remote-thread-list/types.tsx +10 -12
- package/src/runtimes/remote-thread-list/useRemoteThreadListRuntime.tsx +8 -8
- package/src/utils/hooks/useOnResizeContent.tsx +7 -21
|
@@ -22,6 +22,7 @@ export type ThreadListItemRuntime = {
|
|
|
22
22
|
remoteId: string;
|
|
23
23
|
externalId: string | undefined;
|
|
24
24
|
}>;
|
|
25
|
+
generateTitle(): Promise<void>;
|
|
25
26
|
switchTo(): Promise<void>;
|
|
26
27
|
rename(newTitle: string): Promise<void>;
|
|
27
28
|
archive(): Promise<void>;
|
|
@@ -47,6 +48,7 @@ export declare class ThreadListItemRuntimeImpl implements ThreadListItemRuntime
|
|
|
47
48
|
remoteId: string;
|
|
48
49
|
externalId: string | undefined;
|
|
49
50
|
}>;
|
|
51
|
+
generateTitle(): Promise<void>;
|
|
50
52
|
unstable_on(event: ThreadListItemEventType, callback: () => void): Unsubscribe;
|
|
51
53
|
subscribe(callback: () => void): Unsubscribe;
|
|
52
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadListItemRuntime.d.ts","sourceRoot":"","sources":["../../src/api/ThreadListItemRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG,eAAe,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,IAAI,mBAAmB,CAAC;IAEhC,UAAU,IAAI,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAC5E,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,CAAC,QAAQ,EAAE,MAAM,G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AI/B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAKzB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAMxB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAM1B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAMvB,UAAU,IAAI,OAAO,CAAC;QAC3B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;KAChC,CAAC;IAKK,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,WAAW,CAAC,KAAK,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,IAAI;IAahE,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,WAAW;CAGpD"}
|
|
@@ -38,6 +38,7 @@ var ThreadListItemRuntimeImpl = class {
|
|
|
38
38
|
this.unarchive = this.unarchive.bind(this);
|
|
39
39
|
this.delete = this.delete.bind(this);
|
|
40
40
|
this.initialize = this.initialize.bind(this);
|
|
41
|
+
this.generateTitle = this.generateTitle.bind(this);
|
|
41
42
|
this.subscribe = this.subscribe.bind(this);
|
|
42
43
|
this.unstable_on = this.unstable_on.bind(this);
|
|
43
44
|
this.getState = this.getState.bind(this);
|
|
@@ -69,6 +70,10 @@ var ThreadListItemRuntimeImpl = class {
|
|
|
69
70
|
const state = this._core.getState();
|
|
70
71
|
return this._threadListBinding.initialize(state.id);
|
|
71
72
|
}
|
|
73
|
+
generateTitle() {
|
|
74
|
+
const state = this._core.getState();
|
|
75
|
+
return this._threadListBinding.generateTitle(state.id);
|
|
76
|
+
}
|
|
72
77
|
unstable_on(event, callback) {
|
|
73
78
|
let prevIsMain = this._core.getState().isMain;
|
|
74
79
|
return this.subscribe(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/ThreadListItemRuntime.ts"],"sourcesContent":["import { Unsubscribe } from \"../types\";\nimport { ThreadListItemRuntimePath } from \"./RuntimePathTypes\";\nimport { SubscribableWithState } from \"./subscribable/Subscribable\";\nimport { ThreadListRuntimeCoreBinding } from \"./ThreadListRuntime\";\n\nexport type ThreadListItemEventType = \"switched-to\" | \"switched-away\";\n\nexport type ThreadListItemState = {\n readonly isMain: boolean;\n\n readonly id: string;\n readonly remoteId: string | undefined;\n readonly externalId: string | undefined;\n\n /**\n * @deprecated This field was renamed to `id`. This field will be removed in 0.8.0.\n */\n readonly threadId: string;\n\n readonly status: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n readonly title?: string | undefined;\n};\n\nexport type ThreadListItemRuntime = {\n readonly path: ThreadListItemRuntimePath;\n getState(): ThreadListItemState;\n\n initialize(): Promise<{ remoteId: string; externalId: string | undefined }>;\n switchTo(): Promise<void>;\n rename(newTitle: string): Promise<void>;\n archive(): Promise<void>;\n unarchive(): Promise<void>;\n delete(): Promise<void>;\n\n subscribe(callback: () => void): Unsubscribe;\n\n unstable_on(\n event: ThreadListItemEventType,\n callback: () => void,\n ): Unsubscribe;\n};\n\nexport type ThreadListItemStateBinding = SubscribableWithState<\n ThreadListItemState,\n ThreadListItemRuntimePath\n>;\n\nexport class ThreadListItemRuntimeImpl implements ThreadListItemRuntime {\n public get path() {\n return this._core.path;\n }\n\n constructor(\n private _core: ThreadListItemStateBinding,\n private _threadListBinding: ThreadListRuntimeCoreBinding,\n ) {}\n\n protected __internal_bindMethods() {\n this.switchTo = this.switchTo.bind(this);\n this.rename = this.rename.bind(this);\n this.archive = this.archive.bind(this);\n this.unarchive = this.unarchive.bind(this);\n this.delete = this.delete.bind(this);\n this.initialize = this.initialize.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.unstable_on = this.unstable_on.bind(this);\n this.getState = this.getState.bind(this);\n }\n\n public getState(): ThreadListItemState {\n return this._core.getState();\n }\n\n public switchTo(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.switchToThread(state.id);\n }\n\n public rename(newTitle: string): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.rename(state.id, newTitle);\n }\n\n public archive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.archive(state.id);\n }\n\n public unarchive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.unarchive(state.id);\n }\n\n public delete(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.delete(state.id);\n }\n\n public initialize(): Promise<{\n remoteId: string;\n externalId: string | undefined;\n }> {\n const state = this._core.getState();\n return this._threadListBinding.initialize(state.id);\n }\n\n public unstable_on(event: ThreadListItemEventType, callback: () => void) {\n let prevIsMain = this._core.getState().isMain;\n return this.subscribe(() => {\n const newIsMain = this._core.getState().isMain;\n if (prevIsMain === newIsMain) return;\n prevIsMain = newIsMain;\n\n if (event === \"switched-to\" && !newIsMain) return;\n if (event === \"switched-away\" && newIsMain) return;\n callback();\n });\n }\n\n public subscribe(callback: () => void): Unsubscribe {\n return this._core.subscribe(callback);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/api/ThreadListItemRuntime.ts"],"sourcesContent":["import { Unsubscribe } from \"../types\";\nimport { ThreadListItemRuntimePath } from \"./RuntimePathTypes\";\nimport { SubscribableWithState } from \"./subscribable/Subscribable\";\nimport { ThreadListRuntimeCoreBinding } from \"./ThreadListRuntime\";\n\nexport type ThreadListItemEventType = \"switched-to\" | \"switched-away\";\n\nexport type ThreadListItemState = {\n readonly isMain: boolean;\n\n readonly id: string;\n readonly remoteId: string | undefined;\n readonly externalId: string | undefined;\n\n /**\n * @deprecated This field was renamed to `id`. This field will be removed in 0.8.0.\n */\n readonly threadId: string;\n\n readonly status: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n readonly title?: string | undefined;\n};\n\nexport type ThreadListItemRuntime = {\n readonly path: ThreadListItemRuntimePath;\n getState(): ThreadListItemState;\n\n initialize(): Promise<{ remoteId: string; externalId: string | undefined }>;\n generateTitle(): Promise<void>;\n\n switchTo(): Promise<void>;\n rename(newTitle: string): Promise<void>;\n archive(): Promise<void>;\n unarchive(): Promise<void>;\n delete(): Promise<void>;\n\n subscribe(callback: () => void): Unsubscribe;\n\n unstable_on(\n event: ThreadListItemEventType,\n callback: () => void,\n ): Unsubscribe;\n};\n\nexport type ThreadListItemStateBinding = SubscribableWithState<\n ThreadListItemState,\n ThreadListItemRuntimePath\n>;\n\nexport class ThreadListItemRuntimeImpl implements ThreadListItemRuntime {\n public get path() {\n return this._core.path;\n }\n\n constructor(\n private _core: ThreadListItemStateBinding,\n private _threadListBinding: ThreadListRuntimeCoreBinding,\n ) {}\n\n protected __internal_bindMethods() {\n this.switchTo = this.switchTo.bind(this);\n this.rename = this.rename.bind(this);\n this.archive = this.archive.bind(this);\n this.unarchive = this.unarchive.bind(this);\n this.delete = this.delete.bind(this);\n this.initialize = this.initialize.bind(this);\n this.generateTitle = this.generateTitle.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.unstable_on = this.unstable_on.bind(this);\n this.getState = this.getState.bind(this);\n }\n\n public getState(): ThreadListItemState {\n return this._core.getState();\n }\n\n public switchTo(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.switchToThread(state.id);\n }\n\n public rename(newTitle: string): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.rename(state.id, newTitle);\n }\n\n public archive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.archive(state.id);\n }\n\n public unarchive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.unarchive(state.id);\n }\n\n public delete(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.delete(state.id);\n }\n\n public initialize(): Promise<{\n remoteId: string;\n externalId: string | undefined;\n }> {\n const state = this._core.getState();\n return this._threadListBinding.initialize(state.id);\n }\n\n public generateTitle(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.generateTitle(state.id);\n }\n\n public unstable_on(event: ThreadListItemEventType, callback: () => void) {\n let prevIsMain = this._core.getState().isMain;\n return this.subscribe(() => {\n const newIsMain = this._core.getState().isMain;\n if (prevIsMain === newIsMain) return;\n prevIsMain = newIsMain;\n\n if (event === \"switched-to\" && !newIsMain) return;\n if (event === \"switched-away\" && newIsMain) return;\n callback();\n });\n }\n\n public subscribe(callback: () => void): Unsubscribe {\n return this._core.subscribe(callback);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDO,IAAM,4BAAN,MAAiE;AAAA,EAKtE,YACU,OACA,oBACR;AAFQ;AACA;AAAA,EACP;AAAA,EAPH,IAAW,OAAO;AAChB,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA,EAOU,yBAAyB;AACjC,SAAK,WAAW,KAAK,SAAS,KAAK,IAAI;AACvC,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AACrC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AACzC,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,aAAa,KAAK,WAAW,KAAK,IAAI;AAC3C,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AACzC,SAAK,cAAc,KAAK,YAAY,KAAK,IAAI;AAC7C,SAAK,WAAW,KAAK,SAAS,KAAK,IAAI;AAAA,EACzC;AAAA,EAEO,WAAgC;AACrC,WAAO,KAAK,MAAM,SAAS;AAAA,EAC7B;AAAA,EAEO,WAA0B;AAC/B,UAAM,QAAQ,KAAK,MAAM,SAAS;AAClC,WAAO,KAAK,mBAAmB,eAAe,MAAM,EAAE;AAAA,EACxD;AAAA,EAEO,OAAO,UAAiC;AAC7C,UAAM,QAAQ,KAAK,MAAM,SAAS;AAElC,WAAO,KAAK,mBAAmB,OAAO,MAAM,IAAI,QAAQ;AAAA,EAC1D;AAAA,EAEO,UAAyB;AAC9B,UAAM,QAAQ,KAAK,MAAM,SAAS;AAElC,WAAO,KAAK,mBAAmB,QAAQ,MAAM,EAAE;AAAA,EACjD;AAAA,EAEO,YAA2B;AAChC,UAAM,QAAQ,KAAK,MAAM,SAAS;AAElC,WAAO,KAAK,mBAAmB,UAAU,MAAM,EAAE;AAAA,EACnD;AAAA,EAEO,SAAwB;AAC7B,UAAM,QAAQ,KAAK,MAAM,SAAS;AAElC,WAAO,KAAK,mBAAmB,OAAO,MAAM,EAAE;AAAA,EAChD;AAAA,EAEO,aAGJ;AACD,UAAM,QAAQ,KAAK,MAAM,SAAS;AAClC,WAAO,KAAK,mBAAmB,WAAW,MAAM,EAAE;AAAA,EACpD;AAAA,EAEO,gBAA+B;AACpC,UAAM,QAAQ,KAAK,MAAM,SAAS;AAClC,WAAO,KAAK,mBAAmB,cAAc,MAAM,EAAE;AAAA,EACvD;AAAA,EAEO,YAAY,OAAgC,UAAsB;AACvE,QAAI,aAAa,KAAK,MAAM,SAAS,EAAE;AACvC,WAAO,KAAK,UAAU,MAAM;AAC1B,YAAM,YAAY,KAAK,MAAM,SAAS,EAAE;AACxC,UAAI,eAAe,UAAW;AAC9B,mBAAa;AAEb,UAAI,UAAU,iBAAiB,CAAC,UAAW;AAC3C,UAAI,UAAU,mBAAmB,UAAW;AAC5C,eAAS;AAAA,IACX,CAAC;AAAA,EACH;AAAA,EAEO,UAAU,UAAmC;AAClD,WAAO,KAAK,MAAM,UAAU,QAAQ;AAAA,EACtC;AACF;","names":[]}
|
|
@@ -14,6 +14,7 @@ var ThreadListItemRuntimeImpl = class {
|
|
|
14
14
|
this.unarchive = this.unarchive.bind(this);
|
|
15
15
|
this.delete = this.delete.bind(this);
|
|
16
16
|
this.initialize = this.initialize.bind(this);
|
|
17
|
+
this.generateTitle = this.generateTitle.bind(this);
|
|
17
18
|
this.subscribe = this.subscribe.bind(this);
|
|
18
19
|
this.unstable_on = this.unstable_on.bind(this);
|
|
19
20
|
this.getState = this.getState.bind(this);
|
|
@@ -45,6 +46,10 @@ var ThreadListItemRuntimeImpl = class {
|
|
|
45
46
|
const state = this._core.getState();
|
|
46
47
|
return this._threadListBinding.initialize(state.id);
|
|
47
48
|
}
|
|
49
|
+
generateTitle() {
|
|
50
|
+
const state = this._core.getState();
|
|
51
|
+
return this._threadListBinding.generateTitle(state.id);
|
|
52
|
+
}
|
|
48
53
|
unstable_on(event, callback) {
|
|
49
54
|
let prevIsMain = this._core.getState().isMain;
|
|
50
55
|
return this.subscribe(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/ThreadListItemRuntime.ts"],"sourcesContent":["import { Unsubscribe } from \"../types\";\nimport { ThreadListItemRuntimePath } from \"./RuntimePathTypes\";\nimport { SubscribableWithState } from \"./subscribable/Subscribable\";\nimport { ThreadListRuntimeCoreBinding } from \"./ThreadListRuntime\";\n\nexport type ThreadListItemEventType = \"switched-to\" | \"switched-away\";\n\nexport type ThreadListItemState = {\n readonly isMain: boolean;\n\n readonly id: string;\n readonly remoteId: string | undefined;\n readonly externalId: string | undefined;\n\n /**\n * @deprecated This field was renamed to `id`. This field will be removed in 0.8.0.\n */\n readonly threadId: string;\n\n readonly status: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n readonly title?: string | undefined;\n};\n\nexport type ThreadListItemRuntime = {\n readonly path: ThreadListItemRuntimePath;\n getState(): ThreadListItemState;\n\n initialize(): Promise<{ remoteId: string; externalId: string | undefined }>;\n switchTo(): Promise<void>;\n rename(newTitle: string): Promise<void>;\n archive(): Promise<void>;\n unarchive(): Promise<void>;\n delete(): Promise<void>;\n\n subscribe(callback: () => void): Unsubscribe;\n\n unstable_on(\n event: ThreadListItemEventType,\n callback: () => void,\n ): Unsubscribe;\n};\n\nexport type ThreadListItemStateBinding = SubscribableWithState<\n ThreadListItemState,\n ThreadListItemRuntimePath\n>;\n\nexport class ThreadListItemRuntimeImpl implements ThreadListItemRuntime {\n public get path() {\n return this._core.path;\n }\n\n constructor(\n private _core: ThreadListItemStateBinding,\n private _threadListBinding: ThreadListRuntimeCoreBinding,\n ) {}\n\n protected __internal_bindMethods() {\n this.switchTo = this.switchTo.bind(this);\n this.rename = this.rename.bind(this);\n this.archive = this.archive.bind(this);\n this.unarchive = this.unarchive.bind(this);\n this.delete = this.delete.bind(this);\n this.initialize = this.initialize.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.unstable_on = this.unstable_on.bind(this);\n this.getState = this.getState.bind(this);\n }\n\n public getState(): ThreadListItemState {\n return this._core.getState();\n }\n\n public switchTo(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.switchToThread(state.id);\n }\n\n public rename(newTitle: string): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.rename(state.id, newTitle);\n }\n\n public archive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.archive(state.id);\n }\n\n public unarchive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.unarchive(state.id);\n }\n\n public delete(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.delete(state.id);\n }\n\n public initialize(): Promise<{\n remoteId: string;\n externalId: string | undefined;\n }> {\n const state = this._core.getState();\n return this._threadListBinding.initialize(state.id);\n }\n\n public unstable_on(event: ThreadListItemEventType, callback: () => void) {\n let prevIsMain = this._core.getState().isMain;\n return this.subscribe(() => {\n const newIsMain = this._core.getState().isMain;\n if (prevIsMain === newIsMain) return;\n prevIsMain = newIsMain;\n\n if (event === \"switched-to\" && !newIsMain) return;\n if (event === \"switched-away\" && newIsMain) return;\n callback();\n });\n }\n\n public subscribe(callback: () => void): Unsubscribe {\n return this._core.subscribe(callback);\n }\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/api/ThreadListItemRuntime.ts"],"sourcesContent":["import { Unsubscribe } from \"../types\";\nimport { ThreadListItemRuntimePath } from \"./RuntimePathTypes\";\nimport { SubscribableWithState } from \"./subscribable/Subscribable\";\nimport { ThreadListRuntimeCoreBinding } from \"./ThreadListRuntime\";\n\nexport type ThreadListItemEventType = \"switched-to\" | \"switched-away\";\n\nexport type ThreadListItemState = {\n readonly isMain: boolean;\n\n readonly id: string;\n readonly remoteId: string | undefined;\n readonly externalId: string | undefined;\n\n /**\n * @deprecated This field was renamed to `id`. This field will be removed in 0.8.0.\n */\n readonly threadId: string;\n\n readonly status: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n readonly title?: string | undefined;\n};\n\nexport type ThreadListItemRuntime = {\n readonly path: ThreadListItemRuntimePath;\n getState(): ThreadListItemState;\n\n initialize(): Promise<{ remoteId: string; externalId: string | undefined }>;\n generateTitle(): Promise<void>;\n\n switchTo(): Promise<void>;\n rename(newTitle: string): Promise<void>;\n archive(): Promise<void>;\n unarchive(): Promise<void>;\n delete(): Promise<void>;\n\n subscribe(callback: () => void): Unsubscribe;\n\n unstable_on(\n event: ThreadListItemEventType,\n callback: () => void,\n ): Unsubscribe;\n};\n\nexport type ThreadListItemStateBinding = SubscribableWithState<\n ThreadListItemState,\n ThreadListItemRuntimePath\n>;\n\nexport class ThreadListItemRuntimeImpl implements ThreadListItemRuntime {\n public get path() {\n return this._core.path;\n }\n\n constructor(\n private _core: ThreadListItemStateBinding,\n private _threadListBinding: ThreadListRuntimeCoreBinding,\n ) {}\n\n protected __internal_bindMethods() {\n this.switchTo = this.switchTo.bind(this);\n this.rename = this.rename.bind(this);\n this.archive = this.archive.bind(this);\n this.unarchive = this.unarchive.bind(this);\n this.delete = this.delete.bind(this);\n this.initialize = this.initialize.bind(this);\n this.generateTitle = this.generateTitle.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.unstable_on = this.unstable_on.bind(this);\n this.getState = this.getState.bind(this);\n }\n\n public getState(): ThreadListItemState {\n return this._core.getState();\n }\n\n public switchTo(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.switchToThread(state.id);\n }\n\n public rename(newTitle: string): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.rename(state.id, newTitle);\n }\n\n public archive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.archive(state.id);\n }\n\n public unarchive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.unarchive(state.id);\n }\n\n public delete(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.delete(state.id);\n }\n\n public initialize(): Promise<{\n remoteId: string;\n externalId: string | undefined;\n }> {\n const state = this._core.getState();\n return this._threadListBinding.initialize(state.id);\n }\n\n public generateTitle(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.generateTitle(state.id);\n }\n\n public unstable_on(event: ThreadListItemEventType, callback: () => void) {\n let prevIsMain = this._core.getState().isMain;\n return this.subscribe(() => {\n const newIsMain = this._core.getState().isMain;\n if (prevIsMain === newIsMain) return;\n prevIsMain = newIsMain;\n\n if (event === \"switched-to\" && !newIsMain) return;\n if (event === \"switched-away\" && newIsMain) return;\n callback();\n });\n }\n\n public subscribe(callback: () => void): Unsubscribe {\n return this._core.subscribe(callback);\n }\n}\n"],"mappings":";AAiDO,IAAM,4BAAN,MAAiE;AAAA,EAKtE,YACU,OACA,oBACR;AAFQ;AACA;AAAA,EACP;AAAA,EAPH,IAAW,OAAO;AAChB,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA,EAOU,yBAAyB;AACjC,SAAK,WAAW,KAAK,SAAS,KAAK,IAAI;AACvC,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AACrC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AACzC,SAAK,SAAS,KAAK,OAAO,KAAK,IAAI;AACnC,SAAK,aAAa,KAAK,WAAW,KAAK,IAAI;AAC3C,SAAK,gBAAgB,KAAK,cAAc,KAAK,IAAI;AACjD,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;AACzC,SAAK,cAAc,KAAK,YAAY,KAAK,IAAI;AAC7C,SAAK,WAAW,KAAK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AClD,WAAO,KAAK,MAAM,UAAU,QAAQ;AAAA,EACtC;AACF;","names":[]}
|
|
@@ -21,7 +21,7 @@ type AssistantCloudThreadsListResponse = {
|
|
|
21
21
|
threads: CloudThread[];
|
|
22
22
|
};
|
|
23
23
|
type AssistantCloudThreadsCreateBody = {
|
|
24
|
-
title
|
|
24
|
+
title?: string | undefined;
|
|
25
25
|
last_message_at: Date;
|
|
26
26
|
metadata?: unknown | undefined;
|
|
27
27
|
external_id?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantCloudThreads.d.ts","sourceRoot":"","sources":["../../src/cloud/AssistantCloudThreads.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,KAAK,8BAA8B,GAAG;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,iCAAiC,GAAG;IACvC,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,KAAK,+BAA+B,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantCloudThreads.d.ts","sourceRoot":"","sources":["../../src/cloud/Ass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qBAAa,qBAAqB;IAGpB,OAAO,CAAC,KAAK;IAFzB,SAAgB,QAAQ,EAAE,4BAA4B,CAAC;gBAEnC,KAAK,EAAE,iBAAiB;IAI/B,IAAI,CACf,KAAK,CAAC,EAAE,8BAA8B,GACrC,OAAO,CAAC,iCAAiC,CAAC;IAIhC,MAAM,CACjB,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,mCAAmC,CAAC;IAIlC,MAAM,CACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,IAAI,CAAC;IAOH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cloud/AssistantCloudThreads.tsx"],"sourcesContent":["import { AssistantCloudAPI } from \"./AssistantCloudAPI\";\nimport { AssistantCloudThreadMessages } from \"./AssistantCloudThreadMessages\";\n\ntype AssistantCloudThreadsListQuery = {\n is_archived?: boolean;\n limit?: number;\n after?: string;\n};\n\ntype CloudThread = {\n title: string;\n last_message_at: Date;\n metadata: unknown;\n external_id: string | null;\n id: string;\n project_id: string;\n created_at: Date;\n updated_at: Date;\n workspace_id: string;\n is_archived: boolean;\n};\n\ntype AssistantCloudThreadsListResponse = {\n threads: CloudThread[];\n};\n\ntype AssistantCloudThreadsCreateBody = {\n title
|
|
1
|
+
{"version":3,"sources":["../../src/cloud/AssistantCloudThreads.tsx"],"sourcesContent":["import { AssistantCloudAPI } from \"./AssistantCloudAPI\";\nimport { AssistantCloudThreadMessages } from \"./AssistantCloudThreadMessages\";\n\ntype AssistantCloudThreadsListQuery = {\n is_archived?: boolean;\n limit?: number;\n after?: string;\n};\n\ntype CloudThread = {\n title: string;\n last_message_at: Date;\n metadata: unknown;\n external_id: string | null;\n id: string;\n project_id: string;\n created_at: Date;\n updated_at: Date;\n workspace_id: string;\n is_archived: boolean;\n};\n\ntype AssistantCloudThreadsListResponse = {\n threads: CloudThread[];\n};\n\ntype AssistantCloudThreadsCreateBody = {\n title?: string | undefined;\n last_message_at: Date;\n metadata?: unknown | undefined;\n external_id?: string | undefined;\n};\n\ntype AssistantCloudThreadsCreateResponse = {\n thread_id: string;\n};\n\ntype AssistantCloudThreadsUpdateBody = {\n title?: string | undefined;\n last_message_at?: Date | undefined;\n metadata?: unknown | undefined;\n is_archived?: boolean | undefined;\n};\n\nexport class AssistantCloudThreads {\n public readonly messages: AssistantCloudThreadMessages;\n\n constructor(private cloud: AssistantCloudAPI) {\n this.messages = new AssistantCloudThreadMessages(cloud);\n }\n\n public async list(\n query?: AssistantCloudThreadsListQuery,\n ): Promise<AssistantCloudThreadsListResponse> {\n return this.cloud.makeRequest(\"/threads\", { query });\n }\n\n public async create(\n body: AssistantCloudThreadsCreateBody,\n ): Promise<AssistantCloudThreadsCreateResponse> {\n return this.cloud.makeRequest(\"/threads\", { method: \"POST\", body });\n }\n\n public async update(\n threadId: string,\n body: AssistantCloudThreadsUpdateBody,\n ): Promise<void> {\n return this.cloud.makeRequest(`/threads/${encodeURIComponent(threadId)}`, {\n method: \"PUT\",\n body,\n });\n }\n\n public async delete(threadId: string): Promise<void> {\n return this.cloud.makeRequest(`/threads/${encodeURIComponent(threadId)}`, {\n method: \"DELETE\",\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0CAA6C;AA2CtC,IAAM,wBAAN,MAA4B;AAAA,EAGjC,YAAoB,OAA0B;AAA1B;AAClB,SAAK,WAAW,IAAI,iEAA6B,KAAK;AAAA,EACxD;AAAA,EAJgB;AAAA,EAMhB,MAAa,KACX,OAC4C;AAC5C,WAAO,KAAK,MAAM,YAAY,YAAY,EAAE,MAAM,CAAC;AAAA,EACrD;AAAA,EAEA,MAAa,OACX,MAC8C;AAC9C,WAAO,KAAK,MAAM,YAAY,YAAY,EAAE,QAAQ,QAAQ,KAAK,CAAC;AAAA,EACpE;AAAA,EAEA,MAAa,OACX,UACA,MACe;AACf,WAAO,KAAK,MAAM,YAAY,YAAY,mBAAmB,QAAQ,CAAC,IAAI;AAAA,MACxE,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAa,OAAO,UAAiC;AACnD,WAAO,KAAK,MAAM,YAAY,YAAY,mBAAmB,QAAQ,CAAC,IAAI;AAAA,MACxE,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cloud/AssistantCloudThreads.tsx"],"sourcesContent":["import { AssistantCloudAPI } from \"./AssistantCloudAPI\";\nimport { AssistantCloudThreadMessages } from \"./AssistantCloudThreadMessages\";\n\ntype AssistantCloudThreadsListQuery = {\n is_archived?: boolean;\n limit?: number;\n after?: string;\n};\n\ntype CloudThread = {\n title: string;\n last_message_at: Date;\n metadata: unknown;\n external_id: string | null;\n id: string;\n project_id: string;\n created_at: Date;\n updated_at: Date;\n workspace_id: string;\n is_archived: boolean;\n};\n\ntype AssistantCloudThreadsListResponse = {\n threads: CloudThread[];\n};\n\ntype AssistantCloudThreadsCreateBody = {\n title
|
|
1
|
+
{"version":3,"sources":["../../src/cloud/AssistantCloudThreads.tsx"],"sourcesContent":["import { AssistantCloudAPI } from \"./AssistantCloudAPI\";\nimport { AssistantCloudThreadMessages } from \"./AssistantCloudThreadMessages\";\n\ntype AssistantCloudThreadsListQuery = {\n is_archived?: boolean;\n limit?: number;\n after?: string;\n};\n\ntype CloudThread = {\n title: string;\n last_message_at: Date;\n metadata: unknown;\n external_id: string | null;\n id: string;\n project_id: string;\n created_at: Date;\n updated_at: Date;\n workspace_id: string;\n is_archived: boolean;\n};\n\ntype AssistantCloudThreadsListResponse = {\n threads: CloudThread[];\n};\n\ntype AssistantCloudThreadsCreateBody = {\n title?: string | undefined;\n last_message_at: Date;\n metadata?: unknown | undefined;\n external_id?: string | undefined;\n};\n\ntype AssistantCloudThreadsCreateResponse = {\n thread_id: string;\n};\n\ntype AssistantCloudThreadsUpdateBody = {\n title?: string | undefined;\n last_message_at?: Date | undefined;\n metadata?: unknown | undefined;\n is_archived?: boolean | undefined;\n};\n\nexport class AssistantCloudThreads {\n public readonly messages: AssistantCloudThreadMessages;\n\n constructor(private cloud: AssistantCloudAPI) {\n this.messages = new AssistantCloudThreadMessages(cloud);\n }\n\n public async list(\n query?: AssistantCloudThreadsListQuery,\n ): Promise<AssistantCloudThreadsListResponse> {\n return this.cloud.makeRequest(\"/threads\", { query });\n }\n\n public async create(\n body: AssistantCloudThreadsCreateBody,\n ): Promise<AssistantCloudThreadsCreateResponse> {\n return this.cloud.makeRequest(\"/threads\", { method: \"POST\", body });\n }\n\n public async update(\n threadId: string,\n body: AssistantCloudThreadsUpdateBody,\n ): Promise<void> {\n return this.cloud.makeRequest(`/threads/${encodeURIComponent(threadId)}`, {\n method: \"PUT\",\n body,\n });\n }\n\n public async delete(threadId: string): Promise<void> {\n return this.cloud.makeRequest(`/threads/${encodeURIComponent(threadId)}`, {\n method: \"DELETE\",\n });\n }\n}\n"],"mappings":";AACA,SAAS,oCAAoC;AA2CtC,IAAM,wBAAN,MAA4B;AAAA,EAGjC,YAAoB,OAA0B;AAA1B;AAClB,SAAK,WAAW,IAAI,6BAA6B,KAAK;AAAA,EACxD;AAAA,EAJgB;AAAA,EAMhB,MAAa,KACX,OAC4C;AAC5C,WAAO,KAAK,MAAM,YAAY,YAAY,EAAE,MAAM,CAAC;AAAA,EACrD;AAAA,EAEA,MAAa,OACX,MAC8C;AAC9C,WAAO,KAAK,MAAM,YAAY,YAAY,EAAE,QAAQ,QAAQ,KAAK,CAAC;AAAA,EACpE;AAAA,EAEA,MAAa,OACX,UACA,MACe;AACf,WAAO,KAAK,MAAM,YAAY,YAAY,mBAAmB,QAAQ,CAAC,IAAI;AAAA,MACxE,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAa,OAAO,UAAiC;AACnD,WAAO,KAAK,MAAM,YAAY,YAAY,mBAAmB,QAAQ,CAAC,IAAI;AAAA,MACxE,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -9,6 +9,6 @@ type CloudThreadListAdapter = {
|
|
|
9
9
|
create?(): Promise<ThreadData>;
|
|
10
10
|
delete?(threadId: string): Promise<void>;
|
|
11
11
|
};
|
|
12
|
-
export declare const useCloudThreadListRuntime: (
|
|
12
|
+
export declare const useCloudThreadListRuntime: ({ runtimeHook, ...adapterOptions }: CloudThreadListAdapter) => AssistantRuntime;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=useCloudThreadListRuntime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCloudThreadListRuntime.d.ts","sourceRoot":"","sources":["../../src/cloud/useCloudThreadListRuntime.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCloudThreadListRuntime.d.ts","sourceRoot":"","sources":["../../src/cloud/useCloudThreadListRuntime.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAI1C,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,cAAc,CAAC;IAEtB,WAAW,EAAE,MAAM,gBAAgB,CAAC;IAEpC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,uCAGnC,sBAAsB,qBAQxB,CAAC"}
|
|
@@ -24,91 +24,16 @@ __export(useCloudThreadListRuntime_exports, {
|
|
|
24
24
|
useCloudThreadListRuntime: () => useCloudThreadListRuntime
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(useCloudThreadListRuntime_exports);
|
|
27
|
-
var import_react = require("react");
|
|
28
|
-
var import_edge = require("../runtimes/edge/index.js");
|
|
29
27
|
var import_useRemoteThreadListRuntime = require("../runtimes/remote-thread-list/useRemoteThreadListRuntime.js");
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (task === void 0) task = callback();
|
|
37
|
-
return task;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
var useCloudThreadListRuntime = (adapter) => {
|
|
41
|
-
const adapterRef = (0, import_react.useRef)(adapter);
|
|
42
|
-
(0, import_react.useEffect)(() => {
|
|
43
|
-
adapterRef.current = adapter;
|
|
44
|
-
}, [adapter]);
|
|
45
|
-
const [subscribers] = (0, import_react.useState)(() => /* @__PURE__ */ new Set());
|
|
28
|
+
var import_cloud = require("../runtimes/remote-thread-list/adapter/cloud.js");
|
|
29
|
+
var useCloudThreadListRuntime = ({
|
|
30
|
+
runtimeHook,
|
|
31
|
+
...adapterOptions
|
|
32
|
+
}) => {
|
|
33
|
+
const adapter = (0, import_cloud.useCloudThreadListAdapter)(adapterOptions);
|
|
46
34
|
const runtime = (0, import_useRemoteThreadListRuntime.useRemoteThreadListRuntime)({
|
|
47
|
-
runtimeHook
|
|
48
|
-
|
|
49
|
-
const { threads } = await adapter.cloud.threads.list();
|
|
50
|
-
return {
|
|
51
|
-
threads: threads.map((t) => ({
|
|
52
|
-
status: t.is_archived ? "archived" : "regular",
|
|
53
|
-
remoteId: t.id,
|
|
54
|
-
title: t.title,
|
|
55
|
-
externalId: t.external_id ?? void 0
|
|
56
|
-
}))
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
initialize: async (threadId) => {
|
|
60
|
-
const createTask = adapterRef.current.create?.() ?? Promise.resolve();
|
|
61
|
-
const t = await createTask;
|
|
62
|
-
const external_id = t ? t.externalId : void 0;
|
|
63
|
-
const { thread_id: remoteId } = await adapterRef.current.cloud.threads.create({
|
|
64
|
-
title: "New Thread",
|
|
65
|
-
last_message_at: /* @__PURE__ */ new Date(),
|
|
66
|
-
external_id
|
|
67
|
-
});
|
|
68
|
-
const dispose = runtime.threads.getById(threadId).unstable_on("run-end", () => {
|
|
69
|
-
dispose();
|
|
70
|
-
const messages = runtime.threads.getById(threadId).getState().messages;
|
|
71
|
-
const begin = beginnable(() => {
|
|
72
|
-
return adapterRef.current.cloud.runs.stream({
|
|
73
|
-
thread_id: remoteId,
|
|
74
|
-
assistant_id: "system/thread_title",
|
|
75
|
-
messages: (0, import_edge.toCoreMessages)(messages)
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
for (const subscriber of subscribers) {
|
|
79
|
-
subscriber.onGenerateTitle(remoteId, begin);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
return { externalId: external_id, remoteId };
|
|
83
|
-
},
|
|
84
|
-
rename: async (threadId, newTitle) => {
|
|
85
|
-
return adapter.cloud.threads.update(threadId, { title: newTitle });
|
|
86
|
-
},
|
|
87
|
-
archive: async (threadId) => {
|
|
88
|
-
return adapter.cloud.threads.update(threadId, { is_archived: true });
|
|
89
|
-
},
|
|
90
|
-
unarchive: async (threadId) => {
|
|
91
|
-
return adapter.cloud.threads.update(threadId, { is_archived: false });
|
|
92
|
-
},
|
|
93
|
-
delete: async (threadId) => {
|
|
94
|
-
await adapter.delete?.(threadId);
|
|
95
|
-
return adapter.cloud.threads.delete(threadId);
|
|
96
|
-
},
|
|
97
|
-
subscribe: (callback) => {
|
|
98
|
-
subscribers.add(callback);
|
|
99
|
-
return () => {
|
|
100
|
-
subscribers.delete(callback);
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
unstable_Provider: (0, import_react.useCallback)(({ children }) => {
|
|
104
|
-
const history = (0, import_AssistantCloudThreadHistoryAdapter.useAssistantCloudThreadHistoryAdapter)({
|
|
105
|
-
get current() {
|
|
106
|
-
return adapterRef.current.cloud;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
const adapters = (0, import_react.useMemo)(() => ({ history }), [history]);
|
|
110
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_RuntimeAdapterProvider.RuntimeAdapterProvider, { adapters, children });
|
|
111
|
-
}, [])
|
|
35
|
+
runtimeHook,
|
|
36
|
+
adapter
|
|
112
37
|
});
|
|
113
38
|
return runtime;
|
|
114
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cloud/useCloudThreadListRuntime.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/cloud/useCloudThreadListRuntime.tsx"],"sourcesContent":["\"use client\";\n\nimport { AssistantCloud } from \"./AssistantCloud\";\nimport { AssistantRuntime } from \"../api\";\nimport { useRemoteThreadListRuntime } from \"../runtimes/remote-thread-list/useRemoteThreadListRuntime\";\nimport { useCloudThreadListAdapter } from \"../runtimes/remote-thread-list/adapter/cloud\";\n\ntype ThreadData = {\n externalId: string;\n};\n\ntype CloudThreadListAdapter = {\n cloud: AssistantCloud;\n\n runtimeHook: () => AssistantRuntime;\n\n create?(): Promise<ThreadData>;\n delete?(threadId: string): Promise<void>;\n};\n\nexport const useCloudThreadListRuntime = ({\n runtimeHook,\n ...adapterOptions\n}: CloudThreadListAdapter) => {\n const adapter = useCloudThreadListAdapter(adapterOptions);\n const runtime = useRemoteThreadListRuntime({\n runtimeHook: runtimeHook,\n adapter,\n });\n\n return runtime;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wCAA2C;AAC3C,mBAA0C;AAenC,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA,GAAG;AACL,MAA8B;AAC5B,QAAM,cAAU,wCAA0B,cAAc;AACxD,QAAM,cAAU,8DAA2B;AAAA,IACzC;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]}
|
|
@@ -1,97 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/cloud/useCloudThreadListRuntime.tsx
|
|
4
|
-
import {
|
|
5
|
-
useCallback,
|
|
6
|
-
useEffect,
|
|
7
|
-
useMemo,
|
|
8
|
-
useRef,
|
|
9
|
-
useState
|
|
10
|
-
} from "react";
|
|
11
|
-
import { toCoreMessages } from "../runtimes/edge/index.mjs";
|
|
12
4
|
import { useRemoteThreadListRuntime } from "../runtimes/remote-thread-list/useRemoteThreadListRuntime.mjs";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (task === void 0) task = callback();
|
|
20
|
-
return task;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
var useCloudThreadListRuntime = (adapter) => {
|
|
24
|
-
const adapterRef = useRef(adapter);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
adapterRef.current = adapter;
|
|
27
|
-
}, [adapter]);
|
|
28
|
-
const [subscribers] = useState(() => /* @__PURE__ */ new Set());
|
|
5
|
+
import { useCloudThreadListAdapter } from "../runtimes/remote-thread-list/adapter/cloud.mjs";
|
|
6
|
+
var useCloudThreadListRuntime = ({
|
|
7
|
+
runtimeHook,
|
|
8
|
+
...adapterOptions
|
|
9
|
+
}) => {
|
|
10
|
+
const adapter = useCloudThreadListAdapter(adapterOptions);
|
|
29
11
|
const runtime = useRemoteThreadListRuntime({
|
|
30
|
-
runtimeHook
|
|
31
|
-
|
|
32
|
-
const { threads } = await adapter.cloud.threads.list();
|
|
33
|
-
return {
|
|
34
|
-
threads: threads.map((t) => ({
|
|
35
|
-
status: t.is_archived ? "archived" : "regular",
|
|
36
|
-
remoteId: t.id,
|
|
37
|
-
title: t.title,
|
|
38
|
-
externalId: t.external_id ?? void 0
|
|
39
|
-
}))
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
initialize: async (threadId) => {
|
|
43
|
-
const createTask = adapterRef.current.create?.() ?? Promise.resolve();
|
|
44
|
-
const t = await createTask;
|
|
45
|
-
const external_id = t ? t.externalId : void 0;
|
|
46
|
-
const { thread_id: remoteId } = await adapterRef.current.cloud.threads.create({
|
|
47
|
-
title: "New Thread",
|
|
48
|
-
last_message_at: /* @__PURE__ */ new Date(),
|
|
49
|
-
external_id
|
|
50
|
-
});
|
|
51
|
-
const dispose = runtime.threads.getById(threadId).unstable_on("run-end", () => {
|
|
52
|
-
dispose();
|
|
53
|
-
const messages = runtime.threads.getById(threadId).getState().messages;
|
|
54
|
-
const begin = beginnable(() => {
|
|
55
|
-
return adapterRef.current.cloud.runs.stream({
|
|
56
|
-
thread_id: remoteId,
|
|
57
|
-
assistant_id: "system/thread_title",
|
|
58
|
-
messages: toCoreMessages(messages)
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
for (const subscriber of subscribers) {
|
|
62
|
-
subscriber.onGenerateTitle(remoteId, begin);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return { externalId: external_id, remoteId };
|
|
66
|
-
},
|
|
67
|
-
rename: async (threadId, newTitle) => {
|
|
68
|
-
return adapter.cloud.threads.update(threadId, { title: newTitle });
|
|
69
|
-
},
|
|
70
|
-
archive: async (threadId) => {
|
|
71
|
-
return adapter.cloud.threads.update(threadId, { is_archived: true });
|
|
72
|
-
},
|
|
73
|
-
unarchive: async (threadId) => {
|
|
74
|
-
return adapter.cloud.threads.update(threadId, { is_archived: false });
|
|
75
|
-
},
|
|
76
|
-
delete: async (threadId) => {
|
|
77
|
-
await adapter.delete?.(threadId);
|
|
78
|
-
return adapter.cloud.threads.delete(threadId);
|
|
79
|
-
},
|
|
80
|
-
subscribe: (callback) => {
|
|
81
|
-
subscribers.add(callback);
|
|
82
|
-
return () => {
|
|
83
|
-
subscribers.delete(callback);
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
unstable_Provider: useCallback(({ children }) => {
|
|
87
|
-
const history = useAssistantCloudThreadHistoryAdapter({
|
|
88
|
-
get current() {
|
|
89
|
-
return adapterRef.current.cloud;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
const adapters = useMemo(() => ({ history }), [history]);
|
|
93
|
-
return /* @__PURE__ */ jsx(RuntimeAdapterProvider, { adapters, children });
|
|
94
|
-
}, [])
|
|
12
|
+
runtimeHook,
|
|
13
|
+
adapter
|
|
95
14
|
});
|
|
96
15
|
return runtime;
|
|
97
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cloud/useCloudThreadListRuntime.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/cloud/useCloudThreadListRuntime.tsx"],"sourcesContent":["\"use client\";\n\nimport { AssistantCloud } from \"./AssistantCloud\";\nimport { AssistantRuntime } from \"../api\";\nimport { useRemoteThreadListRuntime } from \"../runtimes/remote-thread-list/useRemoteThreadListRuntime\";\nimport { useCloudThreadListAdapter } from \"../runtimes/remote-thread-list/adapter/cloud\";\n\ntype ThreadData = {\n externalId: string;\n};\n\ntype CloudThreadListAdapter = {\n cloud: AssistantCloud;\n\n runtimeHook: () => AssistantRuntime;\n\n create?(): Promise<ThreadData>;\n delete?(threadId: string): Promise<void>;\n};\n\nexport const useCloudThreadListRuntime = ({\n runtimeHook,\n ...adapterOptions\n}: CloudThreadListAdapter) => {\n const adapter = useCloudThreadListAdapter(adapterOptions);\n const runtime = useRemoteThreadListRuntime({\n runtimeHook: runtimeHook,\n adapter,\n });\n\n return runtime;\n};\n"],"mappings":";;;AAIA,SAAS,kCAAkC;AAC3C,SAAS,iCAAiC;AAenC,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA,GAAG;AACL,MAA8B;AAC5B,QAAM,UAAU,0BAA0B,cAAc;AACxD,QAAM,UAAU,2BAA2B;AAAA,IACzC;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AACT;","names":[]}
|
|
@@ -2,8 +2,7 @@ import { RefCallback } from "react";
|
|
|
2
2
|
export declare namespace useThreadViewportAutoScroll {
|
|
3
3
|
type Options = {
|
|
4
4
|
autoScroll?: boolean | undefined;
|
|
5
|
-
unstable_scrollToBottomOnRunStart?: boolean | undefined;
|
|
6
5
|
};
|
|
7
6
|
}
|
|
8
|
-
export declare const useThreadViewportAutoScroll: <TElement extends HTMLElement>({ autoScroll,
|
|
7
|
+
export declare const useThreadViewportAutoScroll: <TElement extends HTMLElement>({ autoScroll, }: useThreadViewportAutoScroll.Options) => RefCallback<TElement>;
|
|
9
8
|
//# sourceMappingURL=useThreadViewportAutoScroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThreadViewportAutoScroll.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAqB,MAAM,OAAO,CAAC;AAUvD,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,OAAO,GAAG;QACpB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useThreadViewportAutoScroll.d.ts","sourceRoot":"","sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAqB,MAAM,OAAO,CAAC;AAUvD,yBAAiB,2BAA2B,CAAC;IAC3C,KAAY,OAAO,GAAG;QACpB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAClC,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,GAAI,QAAQ,SAAS,WAAW,mBAErE,2BAA2B,CAAC,OAAO,KAAG,WAAW,CAAC,QAAQ,CA0E5D,CAAC"}
|
|
@@ -32,8 +32,7 @@ var import_useOnScrollToBottom = require("../../utils/hooks/useOnScrollToBottom.
|
|
|
32
32
|
var import_useManagedRef = require("../../utils/hooks/useManagedRef.js");
|
|
33
33
|
var import_ReadonlyStore = require("../../context/ReadonlyStore.js");
|
|
34
34
|
var useThreadViewportAutoScroll = ({
|
|
35
|
-
autoScroll = true
|
|
36
|
-
unstable_scrollToBottomOnRunStart = true
|
|
35
|
+
autoScroll = true
|
|
37
36
|
}) => {
|
|
38
37
|
const divRef = (0, import_react.useRef)(null);
|
|
39
38
|
const threadViewportStore = (0, import_ThreadContext.useThreadViewportStore)();
|
|
@@ -75,15 +74,14 @@ var useThreadViewportAutoScroll = ({
|
|
|
75
74
|
el.removeEventListener("scroll", handleScroll);
|
|
76
75
|
};
|
|
77
76
|
});
|
|
78
|
-
const autoScrollRef = (0, import_react_compose_refs.useComposedRefs)(resizeRef, scrollRef, divRef);
|
|
79
77
|
(0, import_useOnScrollToBottom.useOnScrollToBottom)(() => {
|
|
80
78
|
scrollToBottom("auto");
|
|
81
79
|
});
|
|
82
80
|
const threadRuntime = (0, import_ThreadContext.useThreadRuntime)();
|
|
83
81
|
(0, import_react.useEffect)(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
return threadRuntime.unstable_on("run-start", () => scrollToBottom("auto"));
|
|
83
|
+
}, []);
|
|
84
|
+
const autoScrollRef = (0, import_react_compose_refs.useComposedRefs)(resizeRef, scrollRef, divRef);
|
|
87
85
|
return autoScrollRef;
|
|
88
86
|
};
|
|
89
87
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { RefCallback, useEffect, useRef } from \"react\";\nimport {\n useThreadRuntime,\n useThreadViewportStore,\n} from \"../../context/react/ThreadContext\";\nimport { useOnResizeContent } from \"../../utils/hooks/useOnResizeContent\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\n\nexport namespace useThreadViewportAutoScroll {\n export type Options = {\n autoScroll?: boolean | undefined;\n
|
|
1
|
+
{"version":3,"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { RefCallback, useEffect, useRef } from \"react\";\nimport {\n useThreadRuntime,\n useThreadViewportStore,\n} from \"../../context/react/ThreadContext\";\nimport { useOnResizeContent } from \"../../utils/hooks/useOnResizeContent\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\n\nexport namespace useThreadViewportAutoScroll {\n export type Options = {\n autoScroll?: boolean | undefined;\n };\n}\n\nexport const useThreadViewportAutoScroll = <TElement extends HTMLElement>({\n autoScroll = true,\n}: useThreadViewportAutoScroll.Options): RefCallback<TElement> => {\n const divRef = useRef<TElement>(null);\n\n const threadViewportStore = useThreadViewportStore();\n\n const lastScrollTop = useRef<number>(0);\n\n // bug: when ScrollToBottom's button changes its disabled state, the scroll stops\n // fix: delay the state change until the scroll is done\n const isScrollingToBottomRef = useRef(false);\n\n const scrollToBottom = (behavior: ScrollBehavior) => {\n const div = divRef.current;\n if (!div || !autoScroll) return;\n\n isScrollingToBottomRef.current = true;\n div.scrollTo({ top: div.scrollHeight, behavior });\n };\n\n const handleScroll = () => {\n const div = divRef.current;\n if (!div) return;\n\n const isAtBottom = threadViewportStore.getState().isAtBottom;\n const newIsAtBottom =\n div.scrollHeight - div.scrollTop <= div.clientHeight + 1; // TODO figure out why +1 is needed\n\n if (!newIsAtBottom && lastScrollTop.current < div.scrollTop) {\n // ignore scroll down\n } else {\n if (newIsAtBottom) {\n isScrollingToBottomRef.current = false;\n }\n\n if (newIsAtBottom !== isAtBottom) {\n writableStore(threadViewportStore).setState({\n isAtBottom: newIsAtBottom,\n });\n }\n }\n\n lastScrollTop.current = div.scrollTop;\n };\n\n const resizeRef = useOnResizeContent(() => {\n if (\n isScrollingToBottomRef.current ||\n threadViewportStore.getState().isAtBottom\n ) {\n scrollToBottom(\"instant\");\n }\n\n handleScroll();\n });\n\n const scrollRef = useManagedRef<HTMLElement>((el) => {\n el.addEventListener(\"scroll\", handleScroll);\n return () => {\n el.removeEventListener(\"scroll\", handleScroll);\n };\n });\n\n useOnScrollToBottom(() => {\n scrollToBottom(\"auto\");\n });\n\n // autoscroll on run start\n const threadRuntime = useThreadRuntime();\n useEffect(() => {\n return threadRuntime.unstable_on(\"run-start\", () => scrollToBottom(\"auto\"));\n }, []);\n\n const autoScrollRef = useComposedRefs<TElement>(resizeRef, scrollRef, divRef);\n return autoScrollRef;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAAgC;AAChC,mBAA+C;AAC/C,2BAGO;AACP,gCAAmC;AACnC,iCAAoC;AACpC,2BAA8B;AAC9B,2BAA8B;AAQvB,IAAM,8BAA8B,CAA+B;AAAA,EACxE,aAAa;AACf,MAAkE;AAChE,QAAM,aAAS,qBAAiB,IAAI;AAEpC,QAAM,0BAAsB,6CAAuB;AAEnD,QAAM,oBAAgB,qBAAe,CAAC;AAItC,QAAM,6BAAyB,qBAAO,KAAK;AAE3C,QAAM,iBAAiB,CAAC,aAA6B;AACnD,UAAM,MAAM,OAAO;AACnB,QAAI,CAAC,OAAO,CAAC,WAAY;AAEzB,2BAAuB,UAAU;AACjC,QAAI,SAAS,EAAE,KAAK,IAAI,cAAc,SAAS,CAAC;AAAA,EAClD;AAEA,QAAM,eAAe,MAAM;AACzB,UAAM,MAAM,OAAO;AACnB,QAAI,CAAC,IAAK;AAEV,UAAM,aAAa,oBAAoB,SAAS,EAAE;AAClD,UAAM,gBACJ,IAAI,eAAe,IAAI,aAAa,IAAI,eAAe;AAEzD,QAAI,CAAC,iBAAiB,cAAc,UAAU,IAAI,WAAW;AAAA,IAE7D,OAAO;AACL,UAAI,eAAe;AACjB,+BAAuB,UAAU;AAAA,MACnC;AAEA,UAAI,kBAAkB,YAAY;AAChC,gDAAc,mBAAmB,EAAE,SAAS;AAAA,UAC1C,YAAY;AAAA,QACd,CAAC;AAAA,MACH;AAAA,IACF;AAEA,kBAAc,UAAU,IAAI;AAAA,EAC9B;AAEA,QAAM,gBAAY,8CAAmB,MAAM;AACzC,QACE,uBAAuB,WACvB,oBAAoB,SAAS,EAAE,YAC/B;AACA,qBAAe,SAAS;AAAA,IAC1B;AAEA,iBAAa;AAAA,EACf,CAAC;AAED,QAAM,gBAAY,oCAA2B,CAAC,OAAO;AACnD,OAAG,iBAAiB,UAAU,YAAY;AAC1C,WAAO,MAAM;AACX,SAAG,oBAAoB,UAAU,YAAY;AAAA,IAC/C;AAAA,EACF,CAAC;AAED,sDAAoB,MAAM;AACxB,mBAAe,MAAM;AAAA,EACvB,CAAC;AAGD,QAAM,oBAAgB,uCAAiB;AACvC,8BAAU,MAAM;AACd,WAAO,cAAc,YAAY,aAAa,MAAM,eAAe,MAAM,CAAC;AAAA,EAC5E,GAAG,CAAC,CAAC;AAEL,QAAM,oBAAgB,2CAA0B,WAAW,WAAW,MAAM;AAC5E,SAAO;AACT;","names":[]}
|
|
@@ -12,8 +12,7 @@ import { useOnScrollToBottom } from "../../utils/hooks/useOnScrollToBottom.mjs";
|
|
|
12
12
|
import { useManagedRef } from "../../utils/hooks/useManagedRef.mjs";
|
|
13
13
|
import { writableStore } from "../../context/ReadonlyStore.mjs";
|
|
14
14
|
var useThreadViewportAutoScroll = ({
|
|
15
|
-
autoScroll = true
|
|
16
|
-
unstable_scrollToBottomOnRunStart = true
|
|
15
|
+
autoScroll = true
|
|
17
16
|
}) => {
|
|
18
17
|
const divRef = useRef(null);
|
|
19
18
|
const threadViewportStore = useThreadViewportStore();
|
|
@@ -55,15 +54,14 @@ var useThreadViewportAutoScroll = ({
|
|
|
55
54
|
el.removeEventListener("scroll", handleScroll);
|
|
56
55
|
};
|
|
57
56
|
});
|
|
58
|
-
const autoScrollRef = useComposedRefs(resizeRef, scrollRef, divRef);
|
|
59
57
|
useOnScrollToBottom(() => {
|
|
60
58
|
scrollToBottom("auto");
|
|
61
59
|
});
|
|
62
60
|
const threadRuntime = useThreadRuntime();
|
|
63
61
|
useEffect(() => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
return threadRuntime.unstable_on("run-start", () => scrollToBottom("auto"));
|
|
63
|
+
}, []);
|
|
64
|
+
const autoScrollRef = useComposedRefs(resizeRef, scrollRef, divRef);
|
|
67
65
|
return autoScrollRef;
|
|
68
66
|
};
|
|
69
67
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { RefCallback, useEffect, useRef } from \"react\";\nimport {\n useThreadRuntime,\n useThreadViewportStore,\n} from \"../../context/react/ThreadContext\";\nimport { useOnResizeContent } from \"../../utils/hooks/useOnResizeContent\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\n\nexport namespace useThreadViewportAutoScroll {\n export type Options = {\n autoScroll?: boolean | undefined;\n
|
|
1
|
+
{"version":3,"sources":["../../../src/primitives/thread/useThreadViewportAutoScroll.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { RefCallback, useEffect, useRef } from \"react\";\nimport {\n useThreadRuntime,\n useThreadViewportStore,\n} from \"../../context/react/ThreadContext\";\nimport { useOnResizeContent } from \"../../utils/hooks/useOnResizeContent\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\n\nexport namespace useThreadViewportAutoScroll {\n export type Options = {\n autoScroll?: boolean | undefined;\n };\n}\n\nexport const useThreadViewportAutoScroll = <TElement extends HTMLElement>({\n autoScroll = true,\n}: useThreadViewportAutoScroll.Options): RefCallback<TElement> => {\n const divRef = useRef<TElement>(null);\n\n const threadViewportStore = useThreadViewportStore();\n\n const lastScrollTop = useRef<number>(0);\n\n // bug: when ScrollToBottom's button changes its disabled state, the scroll stops\n // fix: delay the state change until the scroll is done\n const isScrollingToBottomRef = useRef(false);\n\n const scrollToBottom = (behavior: ScrollBehavior) => {\n const div = divRef.current;\n if (!div || !autoScroll) return;\n\n isScrollingToBottomRef.current = true;\n div.scrollTo({ top: div.scrollHeight, behavior });\n };\n\n const handleScroll = () => {\n const div = divRef.current;\n if (!div) return;\n\n const isAtBottom = threadViewportStore.getState().isAtBottom;\n const newIsAtBottom =\n div.scrollHeight - div.scrollTop <= div.clientHeight + 1; // TODO figure out why +1 is needed\n\n if (!newIsAtBottom && lastScrollTop.current < div.scrollTop) {\n // ignore scroll down\n } else {\n if (newIsAtBottom) {\n isScrollingToBottomRef.current = false;\n }\n\n if (newIsAtBottom !== isAtBottom) {\n writableStore(threadViewportStore).setState({\n isAtBottom: newIsAtBottom,\n });\n }\n }\n\n lastScrollTop.current = div.scrollTop;\n };\n\n const resizeRef = useOnResizeContent(() => {\n if (\n isScrollingToBottomRef.current ||\n threadViewportStore.getState().isAtBottom\n ) {\n scrollToBottom(\"instant\");\n }\n\n handleScroll();\n });\n\n const scrollRef = useManagedRef<HTMLElement>((el) => {\n el.addEventListener(\"scroll\", handleScroll);\n return () => {\n el.removeEventListener(\"scroll\", handleScroll);\n };\n });\n\n useOnScrollToBottom(() => {\n scrollToBottom(\"auto\");\n });\n\n // autoscroll on run start\n const threadRuntime = useThreadRuntime();\n useEffect(() => {\n return threadRuntime.unstable_on(\"run-start\", () => scrollToBottom(\"auto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aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;CAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/runtimes/core/ThreadListRuntimeCore.tsx"],"sourcesContent":["import { Unsubscribe } from \"../../types\";\nimport { ThreadRuntimeCore } from \"./ThreadRuntimeCore\";\n\ntype ThreadListItemCoreState = {\n readonly threadId: string;\n readonly remoteId?: string | undefined;\n readonly externalId?: string | undefined;\n\n readonly status: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n readonly title?: string | undefined;\n\n readonly runtime?: ThreadRuntimeCore | undefined;\n};\n\nexport type ThreadListRuntimeCore = {\n mainThreadId: string;\n newThreadId: string | undefined;\n\n threadIds: readonly string[];\n archivedThreadIds: readonly string[];\n\n getMainThreadRuntimeCore(): ThreadRuntimeCore;\n getThreadRuntimeCore(threadId: string): ThreadRuntimeCore;\n\n getItemById(threadId: string): ThreadListItemCoreState | undefined;\n\n switchToThread(threadId: string): Promise<void>;\n switchToNewThread(): Promise<void>;\n\n getLoadThreadsPromise(): Promise<void>;\n // getLoadArchivedThreadsPromise(): Promise<void>;\n\n rename(threadId: string, newTitle: string): Promise<void>;\n archive(threadId: string): Promise<void>;\n unarchive(threadId: string): Promise<void>;\n delete(threadId: string): Promise<void>;\n\n initialize(\n threadId: string,\n ): Promise<{ remoteId: string; externalId: string | undefined }>;\n\n subscribe(callback: () => void): Unsubscribe;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/runtimes/core/ThreadListRuntimeCore.tsx"],"sourcesContent":["import { Unsubscribe } from \"../../types\";\nimport { ThreadRuntimeCore } from \"./ThreadRuntimeCore\";\n\ntype ThreadListItemCoreState = {\n readonly threadId: string;\n readonly remoteId?: string | undefined;\n readonly externalId?: string | undefined;\n\n readonly status: \"archived\" | \"regular\" | \"new\" | \"deleted\";\n readonly title?: string | undefined;\n\n readonly runtime?: ThreadRuntimeCore | undefined;\n};\n\nexport type ThreadListRuntimeCore = {\n mainThreadId: string;\n newThreadId: string | undefined;\n\n threadIds: readonly string[];\n archivedThreadIds: readonly string[];\n\n getMainThreadRuntimeCore(): ThreadRuntimeCore;\n getThreadRuntimeCore(threadId: string): ThreadRuntimeCore;\n\n getItemById(threadId: string): ThreadListItemCoreState | undefined;\n\n switchToThread(threadId: string): Promise<void>;\n switchToNewThread(): Promise<void>;\n\n getLoadThreadsPromise(): Promise<void>;\n // getLoadArchivedThreadsPromise(): Promise<void>;\n\n rename(threadId: string, newTitle: string): Promise<void>;\n archive(threadId: string): Promise<void>;\n unarchive(threadId: string): Promise<void>;\n delete(threadId: string): Promise<void>;\n\n initialize(\n threadId: string,\n ): Promise<{ remoteId: string; externalId: string | undefined }>;\n generateTitle(threadId: string): Promise<void>;\n\n subscribe(callback: () => void): Unsubscribe;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|