@assistant-ui/core 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -4
- package/dist/index.js.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/react/AssistantProvider.d.ts +3 -2
- package/dist/react/AssistantProvider.d.ts.map +1 -1
- package/dist/react/AssistantProvider.js +19 -26
- package/dist/react/AssistantProvider.js.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +7 -2
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/AssistantRuntimeProvider.js +9 -7
- package/dist/react/AssistantRuntimeProvider.js.map +1 -1
- package/dist/react/RuntimeAdapter.js +1 -1
- package/dist/react/RuntimeAdapter.js.map +1 -1
- package/dist/react/client/Interactables.js +1 -1
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/Tools.d.ts +1 -1
- package/dist/react/client/Tools.js +1 -1
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/index.d.ts +9 -9
- package/dist/react/index.js +4 -4
- package/dist/react/model-context/interactableTool.d.ts +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.js +33 -39
- package/dist/react/providers/AttachmentByIndexProvider.js.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.js +15 -20
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.js.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.js +17 -20
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.js.map +1 -1
- package/dist/react/providers/MessageByIdProvider.js +28 -38
- package/dist/react/providers/MessageByIdProvider.js.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.js +28 -38
- package/dist/react/providers/MessageByIndexProvider.js.map +1 -1
- package/dist/react/providers/PartByIndexProvider.js +17 -20
- package/dist/react/providers/PartByIndexProvider.js.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.js +21 -21
- package/dist/react/providers/QueueItemByIndexProvider.js.map +1 -1
- package/dist/react/providers/ReadonlyThreadProvider.js +24 -32
- package/dist/react/providers/ReadonlyThreadProvider.js.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.js +17 -20
- package/dist/react/providers/SuggestionByIndexProvider.js.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.js +16 -19
- package/dist/react/providers/TextMessagePartProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.js +17 -20
- package/dist/react/providers/ThreadListItemByIndexProvider.js.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.js +15 -18
- package/dist/react/providers/ThreadListItemRuntimeProvider.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +7 -3
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +5 -2
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +3 -2
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/createMessageConverter.d.ts +1 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts +4 -1
- package/dist/react/runtimes/createRuntimeExtras.d.ts.map +1 -1
- package/dist/react/runtimes/createRuntimeExtras.js +6 -17
- package/dist/react/runtimes/createRuntimeExtras.js.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts +3 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.js +4 -2
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +1 -1
- package/dist/react/types/scopes/interactables.d.ts +1 -1
- package/dist/react/types/scopes/tools.d.ts +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +5 -1
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +8 -1
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.js +1 -1
- package/dist/runtime/api/message-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +4 -2
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +2 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +3 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +14 -3
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +2 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +3 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts +19 -6
- package/dist/runtime/queue/external-thread-queue-adapter.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +10 -1
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +138 -36
- package/dist/runtime/queue/message-queue.js.map +1 -1
- package/dist/runtime/utils/runtime-extras-brand.d.ts +21 -0
- package/dist/runtime/utils/runtime-extras-brand.d.ts.map +1 -0
- package/dist/runtime/utils/runtime-extras-brand.js +37 -0
- package/dist/runtime/utils/runtime-extras-brand.js.map +1 -0
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +2 -1
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +3 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js +7 -6
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/local/local-runtime-options.d.ts +13 -0
- package/dist/runtimes/local/local-runtime-options.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +5 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +30 -14
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.d.ts +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js +1 -1
- package/dist/runtimes/readonly/ReadonlyThreadRuntimeCore.js.map +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.js +1 -1
- package/dist/runtimes/remote-thread-list/empty-thread-core.js.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +6 -3
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/store/clients/runtime-adapter.d.ts.map +1 -1
- package/dist/store/clients/runtime-adapter.js +1 -1
- package/dist/store/clients/runtime-adapter.js.map +1 -1
- package/dist/store/clients/suggestions.js +1 -1
- package/dist/store/clients/suggestions.js.map +1 -1
- package/dist/store/clients/thread-message-client.js +1 -1
- package/dist/store/clients/thread-message-client.js.map +1 -1
- package/dist/store/index.d.ts +10 -1
- package/dist/store/index.js +7 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.js +12 -5
- package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.js +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.js +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/scopes/composer.d.ts +7 -3
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.d.ts +10 -0
- package/dist/store/scopes/queue-item.d.ts.map +1 -1
- package/dist/store/scopes/queue-item.js.map +1 -1
- package/package.json +15 -15
- package/src/index.ts +5 -1
- package/src/react/AssistantProvider.tsx +20 -18
- package/src/react/AssistantRuntimeProvider.test.tsx +55 -1
- package/src/react/AssistantRuntimeProvider.tsx +12 -2
- package/src/react/RuntimeAdapter.test.ts +85 -0
- package/src/react/RuntimeAdapter.ts +1 -1
- package/src/react/client/Interactables.test.ts +3 -2
- package/src/react/client/Interactables.ts +4 -4
- package/src/react/client/Tools.ts +4 -4
- package/src/react/index.ts +1 -0
- package/src/react/providers/AttachmentByIndexProvider.tsx +15 -7
- package/src/react/providers/ChainOfThoughtByIndicesProvider.tsx +12 -4
- package/src/react/providers/ChainOfThoughtPartByIndexProvider.tsx +8 -4
- package/src/react/providers/MessageByIdProvider.tsx +8 -4
- package/src/react/providers/MessageByIndexProvider.tsx +8 -4
- package/src/react/providers/PartByIndexProvider.tsx +8 -4
- package/src/react/providers/QueueItemByIndexProvider.tsx +9 -5
- package/src/react/providers/ReadonlyThreadProvider.tsx +9 -4
- package/src/react/providers/SuggestionByIndexProvider.tsx +8 -4
- package/src/react/providers/TextMessagePartProvider.tsx +13 -4
- package/src/react/providers/ThreadListItemByIndexProvider.tsx +8 -4
- package/src/react/providers/ThreadListItemRuntimeProvider.tsx +8 -4
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +19 -4
- package/src/react/runtimes/createRuntimeExtras.test.ts +14 -1
- package/src/react/runtimes/createRuntimeExtras.ts +15 -26
- package/src/react/runtimes/useLocalRuntime.ts +4 -0
- package/src/runtime/api/composer-runtime.ts +11 -2
- package/src/runtime/api/message-runtime.test.ts +25 -0
- package/src/runtime/api/message-runtime.ts +1 -1
- package/src/runtime/base/base-composer-runtime-core.ts +5 -1
- package/src/runtime/base/default-thread-composer-runtime-core.ts +27 -3
- package/src/runtime/interfaces/composer-runtime-core.ts +2 -1
- package/src/runtime/interfaces/thread-runtime-core.ts +3 -1
- package/src/runtime/queue/external-thread-queue-adapter.ts +19 -3
- package/src/runtime/queue/message-queue.ts +200 -38
- package/src/runtime/utils/runtime-extras-brand.ts +47 -0
- package/src/runtime/utils/thread-message-like.ts +2 -4
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +10 -8
- package/src/runtimes/local/local-runtime-options.ts +15 -0
- package/src/runtimes/local/local-thread-runtime-core.test.ts +43 -0
- package/src/runtimes/local/local-thread-runtime-core.ts +48 -13
- package/src/runtimes/readonly/ReadonlyThreadRuntimeCore.ts +1 -1
- package/src/runtimes/remote-thread-list/empty-thread-core.ts +1 -1
- package/src/runtimes/remote-thread-list/types.ts +9 -2
- package/src/store/clients/runtime-adapter.ts +2 -5
- package/src/store/clients/suggestions.ts +1 -1
- package/src/store/clients/thread-message-client.ts +1 -1
- package/src/store/index.ts +31 -0
- package/src/store/runtime-clients/composer-runtime-client.ts +15 -10
- package/src/store/runtime-clients/message-runtime-client.ts +2 -5
- package/src/store/runtime-clients/thread-list-item-runtime-client.ts +2 -1
- package/src/store/runtime-clients/thread-list-runtime-client.ts +2 -5
- package/src/store/runtime-clients/thread-runtime-client.ts +2 -2
- package/src/store/scopes/composer.ts +6 -4
- package/src/store/scopes/queue-item.ts +8 -1
- package/src/tests/external-store-thread-runtime-core.test.ts +56 -13
- package/src/tests/framework-neutral-boundary.test.ts +257 -0
- package/src/tests/message-queue.test.ts +494 -34
- package/src/tests/thread-message-like.test.ts +66 -0
- package/LICENSE +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tools.js","names":["useState","useEffect","useCallback","useMemo","useResources","resource","withKey","ResourceElement","
|
|
1
|
+
{"version":3,"file":"Tools.js","names":["useState","useEffect","useCallback","useMemo","useResources","resource","withKey","ResourceElement","ClientOutput","attachTransformScopes","useAssistantClientRef","McpAppResourceOutput","ToolsState","Tool","isStandaloneToolDisplay","makeToolCallTextComponent","Toolkit","ToolCallMessagePartComponent","ModelContext","useTools","t0","$","_c","toolkit","mcpApp","t1","mcpAppOutputs","mcpAppOutput","toolUIs","setToolUIs","_temp","t2","state","clientRef","t3","Symbol","for","toolName","render","options","registration","standalone","prev","prev_0","next","filter","r","length","rest","setToolUI","t4","t5","unsubscribes","toolName_0","tool","Object","entries","toolRender","undefined","toolRenderText","renderText","render_0","push","toolsWithoutRender","reduce","_temp2","Record","modelContextProvider","getModelContext","tools","current","modelContext","register","forEach","_temp3","t6","getState","Tools","scopes","parent","source","acc","name","tool_0","type","display","_display","_render","_renderText","rest_0","fn"],"sources":["../../../src/react/client/Tools.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useMemo } from \"react\";\nimport {\n useResources,\n resource,\n withKey,\n type ResourceElement,\n} from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport {\n attachTransformScopes,\n useAssistantClientRef,\n} from \"@assistant-ui/store/client\";\nimport type { McpAppResourceOutput, ToolsState } from \"../types/scopes/tools\";\nimport type { Tool } from \"assistant-stream\";\nimport {\n isStandaloneToolDisplay,\n makeToolCallTextComponent,\n type Toolkit,\n} from \"../model-context/toolbox\";\nimport type { ToolCallMessagePartComponent } from \"../types/MessagePartComponentTypes\";\nimport { ModelContext } from \"../../store/clients/model-context-client\";\n\nexport type { McpAppResourceOutput };\n\n/**\n * Registers tools with model context and installs tool-call renderers.\n *\n * Mount this resource near an assistant subtree when you want to expose a\n * group of tools declaratively. Tool definitions are registered with model\n * context, while each tool renderer is registered with the tools scope for\n * message rendering.\n */\nconst useTools = ({\n toolkit,\n mcpApp,\n}: {\n /** Tools to expose to the model and optional renderers to install. */\n toolkit?: Toolkit;\n /** Optional MCP app resource whose tools should be merged into context. */\n mcpApp?: ResourceElement<McpAppResourceOutput> | undefined;\n}): ClientOutput<\"tools\"> => {\n const mcpAppOutputs = useResources(mcpApp ? [withKey(\"mcpApp\", mcpApp)] : []);\n const mcpAppOutput = mcpAppOutputs[0];\n\n const [toolUIs, setToolUIs] = useState<ToolsState[\"toolUIs\"]>(() => ({}));\n\n const state = useMemo(\n (): ToolsState => ({\n toolUIs,\n mcpApp: mcpAppOutput,\n }),\n [toolUIs, mcpAppOutput],\n );\n\n const clientRef = useAssistantClientRef();\n\n const setToolUI = useCallback(\n (\n toolName: string,\n render: ToolCallMessagePartComponent,\n options?: { standalone?: boolean },\n ) => {\n // One registration object per call; identity is the removal key, so\n // the per-name list stays correctly ref-counted across re-registers.\n const registration = {\n render,\n standalone: options?.standalone ?? false,\n };\n\n setToolUIs((prev) => ({\n ...prev,\n [toolName]: [...(prev[toolName] ?? []), registration],\n }));\n\n return () => {\n setToolUIs((prev) => {\n const next = prev[toolName]?.filter((r) => r !== registration) ?? [];\n if (next.length > 0) return { ...prev, [toolName]: next };\n // Drop the key entirely so repeatedly mounted/unmounted tools\n // don't leave empty arrays accumulating across a long session.\n const rest = { ...prev };\n delete rest[toolName];\n return rest;\n });\n };\n },\n [],\n );\n\n useEffect(() => {\n if (!toolkit) return;\n const unsubscribes: (() => void)[] = [];\n\n // Register tool UIs (exclude symbols)\n for (const [toolName, tool] of Object.entries(toolkit)) {\n const toolRender = \"render\" in tool ? tool.render : undefined;\n const toolRenderText = \"renderText\" in tool ? tool.renderText : undefined;\n const render =\n toolRender ??\n (toolRenderText\n ? makeToolCallTextComponent(toolRenderText)\n : undefined);\n if (render) {\n unsubscribes.push(\n setToolUI(toolName, render, {\n standalone: isStandaloneToolDisplay(tool),\n }),\n );\n }\n }\n\n // Register tools with model context (exclude symbols). `render`,\n // `renderText`, and `display` are client-only presentation concerns and\n // never reach the model.\n const toolsWithoutRender = Object.entries(toolkit).reduce(\n (acc, [name, tool]) => {\n if (tool.type === \"mcp\") return acc;\n const {\n display: _display,\n render: _render,\n renderText: _renderText,\n ...rest\n } = tool as typeof tool & { renderText?: unknown };\n acc[name] = rest as Tool<any, any>;\n return acc;\n },\n {} as Record<string, Tool<any, any>>,\n );\n\n const modelContextProvider = {\n getModelContext: () => ({\n tools: toolsWithoutRender,\n }),\n };\n\n unsubscribes.push(\n clientRef.current!.modelContext().register(modelContextProvider),\n );\n\n return () => {\n unsubscribes.forEach((fn) => fn());\n };\n }, [toolkit, setToolUI, clientRef]);\n\n return {\n getState: () => state,\n setToolUI,\n };\n};\n\nexport const Tools = resource(useTools);\n\nattachTransformScopes(useTools, (scopes, parent) => {\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n});\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,MAAMmB,YAAWC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAC,SAAAC,WAAAJ;CAQjB,IAAAK;CAAA,IAAAJ,EAAA,OAAAG,QAAA;EACoCC,KAAAD,SAAA,CAAUlB,QAAQ,UAAUkB,MAAM,CAAC,IAAnC,CAAA;EAAyCH,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAC5E,MAAAM,eADsBvB,aAAaqB,EACdC,CAAa,CAAA;CAElC,MAAA,CAAAE,SAAAC,cAA8B7B,SAAgC8B,KAAU;CAAE,IAAAC;CAAA,IAAAV,EAAA,OAAAM,gBAAAN,EAAA,OAAAO,SAAA;EAGrDG,KAAA;GAAAH;GAAAJ,QAETG;EACV;EAACN,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAJH,MAAAW,QACqBD;CAOrB,MAAAE,YAAkBvB,sBAAsB;CAAE,IAAAwB;CAAA,IAAAb,EAAA,OAAAc,OAAAC,IAAA,2BAAA,GAAA;EAGxCF,MAAAG,UAAAC,QAAAC,YAAA;GAOE,MAAAC,eAAqB;IAAAF;IAAAG,YAEPF,SAAOE,cAAP;GACd;GAEAZ,YAAWa,UAAW;IAAA,GACjBA;KACFL,WAAW,CAAA,GAAKK,KAAKL,aAAL,CAAA,GAAuBG,YAAY;GACtD,EAAE;GAAC,aAEI;IACLX,YAAWc,WAAA;KACT,MAAAC,OAAaF,OAAKL,SAAiB,EAAAQ,QAACC,MAAOA,MAAMN,YAAkB,KAAtD,CAAA;KACb,IAAII,KAAIG,SAAU,GAAC,OAAS;MAAA,GAAKL;OAAOL,WAAWO;KAAK;KAGxD,MAAAI,OAAa,EAAA,GAAKN,OAAK;KACvB,OAAOM,KAAKX;KAAS,OACdW;IAAI,CACZ;GAAC;EACH;EACF3B,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CA7BH,MAAA4B,YAAkBf;CA+BhB,IAAAgB;CAAA,IAAAC;CAAA,IAAA9B,EAAA,OAAAY,aAAAZ,EAAA,OAAAE,SAAA;EAEQ2B,WAAA;GACR,IAAI,CAAC3B,SAAO;GACZ,MAAA6B,eAAqC,CAAA;GAGrC,KAAK,MAAA,CAAAC,YAAAC,SAA0BC,OAAMC,QAASjC,OAAO,GAAC;IACpD,MAAAkC,aAAmB,YAAYH,OAAOA,KAAIhB,SAAvBoB,KAAAA;IACnB,MAAAC,iBAAuB,gBAAgBL,OAAOA,KAAIM,aAA3BF,KAAAA;IACvB,MAAAG,WACEJ,eACCE,iBACG5C,0BAA0B4C,cAClB,IAFXD,KAAAA;IAGH,IAAIpB,UACFc,aAAYU,KACVb,UAAUZ,YAAUC,UAAQ,EAAAG,YACd3B,wBAAwBwC,IAAI,EAC1C,CAAC,CACH;GACD;GAMH,MAAAS,qBAA2BR,OAAMC,QAASjC,OAAO,CAAC,CAAAyC,OAChDC,QAWA,CAAC,CACH;GAQAb,aAAYU,KACV7B,UAASqC,QAAQC,aAAe,CAAC,CAAAC,SAAUL,EAPhBC,wBACH,EAAAC,OACfN,mBACT,GAI2CI,CAAoB,CACjE;GAAC,aAEM;IACLf,aAAYqB,QAASC,MAAY;GAAC;EACnC;EACAvB,KAAA;GAAC5B;GAAS0B;GAAWhB;EAAS;EAACZ,EAAA,KAAAY;EAAAZ,EAAA,KAAAE;EAAAF,EAAA,KAAA6B;EAAA7B,EAAA,KAAA8B;CAAA,OAAA;EAAAD,KAAA7B,EAAA;EAAA8B,KAAA9B,EAAA;CAAA;CArDlCpB,UAAUiD,IAqDPC,EAA+B;CAAC,IAAAwB;CAAA,IAAAtD,EAAA,QAAAW,OAAA;EAE5B2C,KAAA;GAAAC,gBACW5C;GAAKiB;EAEvB;EAAC5B,EAAA,MAAAW;EAAAX,EAAA,MAAAsD;CAAA,OAAAA,KAAAtD,EAAA;CAAA,OAHMsD;AAGN;AAGH,MAAaE,QAAQxE,SAASc,QAAQ;AAEtCV,sBAAsBU,WAAW2D,QAAQC,WAAW;CAClD,IAAI,CAACD,OAAOP,gBAAgBQ,OAAOR,aAAaS,WAAW,MACzDF,OAAOP,eAAerD,aAAa;AAEvC,CAAC;AA5HgB,SAAAY,QAAA;CAAA,OAYsD,CAAC;AAAC;AAZxD,SAAAmC,OAAAgB,KAAA7D,IAAA;CAmFL,MAAA,CAAA8D,MAAAC,UAAA/D;CACJ,IAAIkC,OAAI8B,SAAU,OAAK,OAASH;CAChC,MAAA,EAAAI,SAAAC,UAAAhD,QAAAiD,SAAA3B,YAAA4B,aAAA,GAAAC,WAKInC;CACJ2B,IAAIC,QAAQlC;CAAH,OACFiC;AAAG;AA5FD,SAAAP,OAAAgB,IAAA;CAAA,OA4GkBA,GAAG;AAAC"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
/// <reference path="./types/store-augmentation.d.ts" />
|
|
3
3
|
import { AssistantContextConfig } from "../model-context/types.js";
|
|
4
4
|
import { PartState } from "../store/scopes/part.js";
|
|
5
|
+
import { RuntimeAdapter } from "./RuntimeAdapter.js";
|
|
6
|
+
import { JoinStrategy, convertExternalMessages, useExternalMessageConverter } from "./runtimes/external-message-converter.js";
|
|
5
7
|
import { StreamingTimingAccessors, StreamingTimingOptions, StreamingTimingState } from "../runtime/utils/streaming-timing.js";
|
|
8
|
+
import { useStreamingTiming } from "./runtimes/useStreamingTiming.js";
|
|
9
|
+
import { DataMessagePartComponent, DataMessagePartProps, EmptyMessagePartComponent, EmptyMessagePartProps, FileMessagePartComponent, FileMessagePartProps, GenerativeUIComponentRegistry, GenerativeUIMessagePartComponent, GenerativeUIMessagePartProps, GenerativeUIRenderProps, ImageMessagePartComponent, ImageMessagePartProps, QuoteMessagePartComponent, QuoteMessagePartProps, ReasoningGroupComponent, ReasoningGroupProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, SourceMessagePartComponent, SourceMessagePartProps, TextMessagePartComponent, TextMessagePartProps, ToolCallMessagePartComponent, ToolCallMessagePartProps, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps } from "./types/MessagePartComponentTypes.js";
|
|
10
|
+
import { ToolCallText, ToolDefinition, Toolkit, ToolkitDefinition, ToolkitDefinitionEntry } from "./model-context/toolbox.js";
|
|
11
|
+
import { defineToolkit } from "./model-context/define-toolkit.js";
|
|
12
|
+
import { McpToolkitDefinition, McpToolkitEntry, McpToolkitToolConfig, defineMcpToolkit } from "./model-context/define-mcp-toolkit.js";
|
|
6
13
|
import { AssistantProviderBase, AssistantProviderBaseProps, getRenderComponent } from "./AssistantProvider.js";
|
|
7
14
|
import { AssistantRuntimeProvider } from "./AssistantRuntimeProvider.js";
|
|
8
|
-
import { RuntimeAdapter } from "./RuntimeAdapter.js";
|
|
9
15
|
import { TitleGenerationAdapter, createSimpleTitleAdapter } from "./adapters/TitleGenerationAdapter.js";
|
|
10
16
|
import { AsyncStorageLike, createLocalStorageAdapter } from "./adapters/LocalStorageThreadListAdapter.js";
|
|
11
17
|
import { DataRenderers } from "./client/DataRenderers.js";
|
|
12
|
-
import { DataMessagePartComponent, DataMessagePartProps, EmptyMessagePartComponent, EmptyMessagePartProps, FileMessagePartComponent, FileMessagePartProps, GenerativeUIComponentRegistry, GenerativeUIMessagePartComponent, GenerativeUIMessagePartProps, GenerativeUIRenderProps, ImageMessagePartComponent, ImageMessagePartProps, QuoteMessagePartComponent, QuoteMessagePartProps, ReasoningGroupComponent, ReasoningGroupProps, ReasoningMessagePartComponent, ReasoningMessagePartProps, SourceMessagePartComponent, SourceMessagePartProps, TextMessagePartComponent, TextMessagePartProps, ToolCallMessagePartComponent, ToolCallMessagePartProps, Unstable_AudioMessagePartComponent, Unstable_AudioMessagePartProps } from "./types/MessagePartComponentTypes.js";
|
|
13
18
|
import { Unstable_InteractableDefinition, Unstable_InteractablePersistedState, Unstable_InteractablePersistenceAdapter, Unstable_InteractablePersistenceStatus, Unstable_InteractableRegistration, Unstable_InteractableStateSchema, Unstable_InteractablesClientSchema, Unstable_InteractablesConfig, Unstable_InteractablesMethods, Unstable_InteractablesState } from "./types/scopes/interactables.js";
|
|
14
19
|
import { unstable_Interactables } from "./client/Interactables.js";
|
|
15
20
|
import { McpAppResourceOutput, ToolsClientSchema, ToolsMethods, ToolsState } from "./types/scopes/tools.js";
|
|
16
|
-
import { ToolCallText, ToolDefinition, Toolkit, ToolkitDefinition, ToolkitDefinitionEntry } from "./model-context/toolbox.js";
|
|
17
21
|
import { Tools } from "./client/Tools.js";
|
|
18
22
|
import { AssistantToolProps, useAssistantTool } from "./model-context/useAssistantTool.js";
|
|
19
23
|
import { AssistantTool, makeAssistantTool } from "./model-context/makeAssistantTool.js";
|
|
@@ -24,13 +28,11 @@ import { AssistantDataUI, makeAssistantDataUI } from "./model-context/makeAssist
|
|
|
24
28
|
import { useAssistantInstructions } from "./model-context/useAssistantInstructions.js";
|
|
25
29
|
import { useAssistantContext } from "./model-context/useAssistantContext.js";
|
|
26
30
|
import { useInlineRender } from "./model-context/useInlineRender.js";
|
|
27
|
-
import { defineToolkit } from "./model-context/define-toolkit.js";
|
|
28
31
|
import { stubTool } from "./model-context/stub-tool.js";
|
|
29
32
|
import { externalTool } from "./model-context/external-tool.js";
|
|
30
33
|
import { useAuiToolOverrides } from "./model-context/useAuiToolOverrides.js";
|
|
31
34
|
import { hitl, hitlTool, humanTool } from "./model-context/human-tool.js";
|
|
32
35
|
import { ProviderToolConfig, providerTool } from "./model-context/provider-tool.js";
|
|
33
|
-
import { McpToolkitDefinition, McpToolkitEntry, McpToolkitToolConfig, defineMcpToolkit } from "./model-context/define-mcp-toolkit.js";
|
|
34
36
|
import { InteractableDefinition, InteractablePersistedState, InteractablePersistenceAdapter, InteractablePersistenceStatus, InteractableRegistration, InteractableStateSchema, InteractablesClientSchema, InteractablesMethods, InteractablesState } from "./interactables-legacy/scopes.js";
|
|
35
37
|
import { AssistantInteractableProps, useAssistantInteractable } from "./interactables-legacy/useAssistantInteractable.js";
|
|
36
38
|
import { useInteractableState } from "./interactables-legacy/useInteractableState.js";
|
|
@@ -55,10 +57,8 @@ import { ReadonlyThreadProvider } from "./providers/ReadonlyThreadProvider.js";
|
|
|
55
57
|
import { RuntimeAdapterProvider, RuntimeAdapters, useRuntimeAdapters } from "./runtimes/RuntimeAdapterProvider.js";
|
|
56
58
|
import { useExternalStoreRuntime } from "./runtimes/useExternalStoreRuntime.js";
|
|
57
59
|
import { useExternalStoreSharedOptions } from "./runtimes/useExternalStoreSharedOptions.js";
|
|
58
|
-
import { JoinStrategy, convertExternalMessages, useExternalMessageConverter } from "./runtimes/external-message-converter.js";
|
|
59
60
|
import { createMessageConverter } from "./runtimes/createMessageConverter.js";
|
|
60
|
-
import {
|
|
61
|
-
import { RuntimeExtras, createRuntimeExtras } from "./runtimes/createRuntimeExtras.js";
|
|
61
|
+
import { RuntimeExtras, createRuntimeExtras, unstable_createRuntimeExtrasFromBrand } from "./runtimes/createRuntimeExtras.js";
|
|
62
62
|
import { RemoteThreadListHookInstanceManager } from "./runtimes/RemoteThreadListHookInstanceManager.js";
|
|
63
63
|
import { RemoteThreadListThreadListRuntimeCore } from "./runtimes/RemoteThreadListThreadListRuntimeCore.js";
|
|
64
64
|
import { useRemoteThreadListRuntime } from "./runtimes/useRemoteThreadListRuntime.js";
|
|
@@ -112,4 +112,4 @@ import { useEditComposerCancel } from "./primitive-hooks/useEditComposerCancel.j
|
|
|
112
112
|
import { useEditComposerSend } from "./primitive-hooks/useEditComposerSend.js";
|
|
113
113
|
import { useMessageError } from "./primitive-hooks/useMessageError.js";
|
|
114
114
|
import { LocalRuntimeOptions, splitLocalRuntimeOptions, useLocalRuntime } from "./runtimes/useLocalRuntime.js";
|
|
115
|
-
export { type AssistantContextConfig, type AssistantDataUI, type AssistantDataUIProps, type AssistantInteractableProps, AssistantProviderBase, type AssistantProviderBaseProps, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AsyncStorageLike, ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ChainOfThoughtPrimitiveParts, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments, ComposerPrimitiveIf, ComposerPrimitiveQueue, type DataMessagePartComponent, type DataMessagePartProps, DataRenderers, type DataRenderersClientSchema, type DataRenderersMethods, type DataRenderersState, type EmptyMessagePartComponent, type EmptyMessagePartProps, type EnrichedPartState, type FileMessagePartComponent, type FileMessagePartProps, type GenerativeUIComponentRegistry, type GenerativeUIMessagePartComponent, type GenerativeUIMessagePartProps, GenerativeUIRender, GenerativeUIRenderError, type GenerativeUIRenderProps, type GroupByContext, type ImageMessagePartComponent, type ImageMessagePartProps, type InteractableDefinition, type InteractablePersistedState, type InteractablePersistenceAdapter, type InteractablePersistenceStatus, type InteractableRegistration, type InteractableStateSchema, Interactables, type InteractablesClientSchema, type InteractablesMethods, type InteractablesState, type JoinStrategy, type LocalRuntimeOptions, type McpAppResourceOutput, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessagePartComponent, MessagePartPrimitiveInProgress, MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments, MessagePrimitiveGenerativeUI, MessagePrimitiveGroupedParts, MessagePrimitivePartByIndex, MessagePrimitiveParts, MessagePrimitiveQuote, PartByIndexProvider, PartPrimitiveMessages, PartPrimitiveMessagesImpl, type PartState, type ProviderToolConfig, QueueItemByIndexProvider, type QueueItemByIndexProviderProps, type QuoteMessagePartComponent, type QuoteMessagePartProps, ReadonlyThreadProvider, type ReasoningGroupComponent, type ReasoningGroupProps, type ReasoningMessagePartComponent, type ReasoningMessagePartProps, RemoteThreadListHookInstanceManager, RemoteThreadListThreadListRuntimeCore, RuntimeAdapter, RuntimeAdapterProvider, type RuntimeAdapters, type RuntimeExtras, type SourceMessagePartComponent, type SourceMessagePartProps, type StreamingTimingAccessors, type StreamingTimingOptions, type StreamingTimingState, SuggestionByIndexProvider, type SuggestionByIndexProviderProps, type TextMessagePartComponent, type TextMessagePartProps, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemPrimitiveTitle, ThreadListItemRuntimeProvider, ThreadListPrimitiveItemByIndex, ThreadListPrimitiveItems, ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveSuggestionByIndex, ThreadPrimitiveSuggestions, ThreadPrimitiveSuggestionsImpl, ThreadPrimitiveUnstable_MessageById, type TitleGenerationAdapter, type ToolArgsStatus, type ToolCallMessagePartComponent, type ToolCallMessagePartProps, type ToolCallText, type ToolDefinition, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, Tools, type ToolsClientSchema, type ToolsMethods, type ToolsState, type Unstable_AudioMessagePartComponent, type Unstable_AudioMessagePartProps, type Unstable_InferInteractableState, type Unstable_InteractableConfig, type Unstable_InteractableDefinition, type Unstable_InteractablePersistedState, type Unstable_InteractablePersistenceAdapter, type Unstable_InteractablePersistenceStatus, type Unstable_InteractableRegistration, type Unstable_InteractableStateSchema, type Unstable_InteractableToolConfig, type Unstable_InteractableToolRenderProps, type Unstable_InteractableVersionInfo, type Unstable_InteractablesClientSchema, type Unstable_InteractablesConfig, type Unstable_InteractablesMethods, type Unstable_InteractablesState, type UseActionBarCopyOptions, type UseComposerIfProps, type UseSuggestionTriggerOptions, convertExternalMessages, createLocalStorageAdapter, createMessageConverter, createRuntimeExtras, createSimpleTitleAdapter, defineMcpToolkit, defineToolkit, externalTool, getMessageQuote, getRenderComponent, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, defaultComponents as messagePartsDefaultComponents, providerTool, splitLocalRuntimeOptions, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useActionBarCopy, useActionBarEdit, useActionBarFeedbackNegative, useActionBarFeedbackPositive, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAssistantCloudThreadHistoryAdapter, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useBranchPickerNext, useBranchPickerPrevious, useCloudThreadListAdapter, useComposerAddAttachment, useComposerCancel, useComposerDictate, useComposerSend, useEditComposerCancel, useEditComposerSend, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessageBranching, useMessageError, useMessageReload, useRemoteThreadListRuntime, useRuntimeAdapters, useStreamingTiming, useSuggestionTrigger, useThreadIsEmpty, useThreadIsRunning, useThreadListItemArchive, useThreadListItemDelete, useThreadListItemTrigger, useThreadListItemUnarchive, useThreadListLoadMore, useThreadListNew, useThreadMessages, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
|
|
115
|
+
export { type AssistantContextConfig, type AssistantDataUI, type AssistantDataUIProps, type AssistantInteractableProps, AssistantProviderBase, type AssistantProviderBaseProps, AssistantRuntimeProvider, type AssistantTool, type AssistantToolProps, type AssistantToolUI, type AssistantToolUIProps, type AsyncStorageLike, ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ChainOfThoughtPrimitiveParts, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments, ComposerPrimitiveIf, ComposerPrimitiveQueue, type DataMessagePartComponent, type DataMessagePartProps, DataRenderers, type DataRenderersClientSchema, type DataRenderersMethods, type DataRenderersState, type EmptyMessagePartComponent, type EmptyMessagePartProps, type EnrichedPartState, type FileMessagePartComponent, type FileMessagePartProps, type GenerativeUIComponentRegistry, type GenerativeUIMessagePartComponent, type GenerativeUIMessagePartProps, GenerativeUIRender, GenerativeUIRenderError, type GenerativeUIRenderProps, type GroupByContext, type ImageMessagePartComponent, type ImageMessagePartProps, type InteractableDefinition, type InteractablePersistedState, type InteractablePersistenceAdapter, type InteractablePersistenceStatus, type InteractableRegistration, type InteractableStateSchema, Interactables, type InteractablesClientSchema, type InteractablesMethods, type InteractablesState, type JoinStrategy, type LocalRuntimeOptions, type McpAppResourceOutput, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessagePartComponent, MessagePartPrimitiveInProgress, MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments, MessagePrimitiveGenerativeUI, MessagePrimitiveGroupedParts, MessagePrimitivePartByIndex, MessagePrimitiveParts, MessagePrimitiveQuote, PartByIndexProvider, PartPrimitiveMessages, PartPrimitiveMessagesImpl, type PartState, type ProviderToolConfig, QueueItemByIndexProvider, type QueueItemByIndexProviderProps, type QuoteMessagePartComponent, type QuoteMessagePartProps, ReadonlyThreadProvider, type ReasoningGroupComponent, type ReasoningGroupProps, type ReasoningMessagePartComponent, type ReasoningMessagePartProps, RemoteThreadListHookInstanceManager, RemoteThreadListThreadListRuntimeCore, RuntimeAdapter, RuntimeAdapterProvider, type RuntimeAdapters, type RuntimeExtras, type SourceMessagePartComponent, type SourceMessagePartProps, type StreamingTimingAccessors, type StreamingTimingOptions, type StreamingTimingState, SuggestionByIndexProvider, type SuggestionByIndexProviderProps, type TextMessagePartComponent, type TextMessagePartProps, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemPrimitiveTitle, ThreadListItemRuntimeProvider, ThreadListPrimitiveItemByIndex, ThreadListPrimitiveItems, ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveSuggestionByIndex, ThreadPrimitiveSuggestions, ThreadPrimitiveSuggestionsImpl, ThreadPrimitiveUnstable_MessageById, type TitleGenerationAdapter, type ToolArgsStatus, type ToolCallMessagePartComponent, type ToolCallMessagePartProps, type ToolCallText, type ToolDefinition, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, Tools, type ToolsClientSchema, type ToolsMethods, type ToolsState, type Unstable_AudioMessagePartComponent, type Unstable_AudioMessagePartProps, type Unstable_InferInteractableState, type Unstable_InteractableConfig, type Unstable_InteractableDefinition, type Unstable_InteractablePersistedState, type Unstable_InteractablePersistenceAdapter, type Unstable_InteractablePersistenceStatus, type Unstable_InteractableRegistration, type Unstable_InteractableStateSchema, type Unstable_InteractableToolConfig, type Unstable_InteractableToolRenderProps, type Unstable_InteractableVersionInfo, type Unstable_InteractablesClientSchema, type Unstable_InteractablesConfig, type Unstable_InteractablesMethods, type Unstable_InteractablesState, type UseActionBarCopyOptions, type UseComposerIfProps, type UseSuggestionTriggerOptions, convertExternalMessages, createLocalStorageAdapter, createMessageConverter, createRuntimeExtras, createSimpleTitleAdapter, defineMcpToolkit, defineToolkit, externalTool, getMessageQuote, getRenderComponent, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, defaultComponents as messagePartsDefaultComponents, providerTool, splitLocalRuntimeOptions, stubTool, unstable_Interactables, unstable_createRuntimeExtrasFromBrand, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useActionBarCopy, useActionBarEdit, useActionBarFeedbackNegative, useActionBarFeedbackPositive, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAssistantCloudThreadHistoryAdapter, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useBranchPickerNext, useBranchPickerPrevious, useCloudThreadListAdapter, useComposerAddAttachment, useComposerCancel, useComposerDictate, useComposerSend, useEditComposerCancel, useEditComposerSend, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessageBranching, useMessageError, useMessageReload, useRemoteThreadListRuntime, useRuntimeAdapters, useStreamingTiming, useSuggestionTrigger, useThreadIsEmpty, useThreadIsRunning, useThreadListItemArchive, useThreadListItemDelete, useThreadListItemTrigger, useThreadListItemUnarchive, useThreadListLoadMore, useThreadListNew, useThreadMessages, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
|
package/dist/react/index.js
CHANGED
|
@@ -26,6 +26,8 @@ import { unstable_useInteractable } from "./model-context/useInteractable.js";
|
|
|
26
26
|
import { unstable_useInteractableVersions } from "./model-context/useInteractableVersions.js";
|
|
27
27
|
import { unstable_interactableTool } from "./model-context/interactableTool.js";
|
|
28
28
|
import { useToolArgsStatus } from "./model-context/useToolArgsStatus.js";
|
|
29
|
+
import { convertExternalMessages, useExternalMessageConverter } from "./runtimes/external-message-converter.js";
|
|
30
|
+
import { useStreamingTiming } from "./runtimes/useStreamingTiming.js";
|
|
29
31
|
import { Interactables } from "./interactables-legacy/Interactables.js";
|
|
30
32
|
import { unstable_Interactables } from "./client/Interactables.js";
|
|
31
33
|
import { ComposerAttachmentByIndexProvider, MessageAttachmentByIndexProvider } from "./providers/AttachmentByIndexProvider.js";
|
|
@@ -42,10 +44,8 @@ import { ReadonlyThreadProvider } from "./providers/ReadonlyThreadProvider.js";
|
|
|
42
44
|
import { RuntimeAdapterProvider, useRuntimeAdapters } from "./runtimes/RuntimeAdapterProvider.js";
|
|
43
45
|
import { useExternalStoreRuntime } from "./runtimes/useExternalStoreRuntime.js";
|
|
44
46
|
import { useExternalStoreSharedOptions } from "./runtimes/useExternalStoreSharedOptions.js";
|
|
45
|
-
import { convertExternalMessages, useExternalMessageConverter } from "./runtimes/external-message-converter.js";
|
|
46
47
|
import { createMessageConverter } from "./runtimes/createMessageConverter.js";
|
|
47
|
-
import {
|
|
48
|
-
import { createRuntimeExtras } from "./runtimes/createRuntimeExtras.js";
|
|
48
|
+
import { createRuntimeExtras, unstable_createRuntimeExtrasFromBrand } from "./runtimes/createRuntimeExtras.js";
|
|
49
49
|
import { RemoteThreadListHookInstanceManager } from "./runtimes/RemoteThreadListHookInstanceManager.js";
|
|
50
50
|
import { RemoteThreadListThreadListRuntimeCore } from "./runtimes/RemoteThreadListThreadListRuntimeCore.js";
|
|
51
51
|
import { useRemoteThreadListRuntime } from "./runtimes/useRemoteThreadListRuntime.js";
|
|
@@ -101,4 +101,4 @@ import { useEditComposerCancel } from "./primitive-hooks/useEditComposerCancel.j
|
|
|
101
101
|
import { useEditComposerSend } from "./primitive-hooks/useEditComposerSend.js";
|
|
102
102
|
import { useMessageError } from "./primitive-hooks/useMessageError.js";
|
|
103
103
|
import { splitLocalRuntimeOptions, useLocalRuntime } from "./runtimes/useLocalRuntime.js";
|
|
104
|
-
export { AssistantProviderBase, AssistantRuntimeProvider, ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ChainOfThoughtPrimitiveParts, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments, ComposerPrimitiveIf, ComposerPrimitiveQueue, DataRenderers, GenerativeUIRender, GenerativeUIRenderError, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessagePartComponent, MessagePartPrimitiveInProgress, MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments, MessagePrimitiveGenerativeUI, MessagePrimitiveGroupedParts, MessagePrimitivePartByIndex, MessagePrimitiveParts, MessagePrimitiveQuote, PartByIndexProvider, PartPrimitiveMessages, PartPrimitiveMessagesImpl, QueueItemByIndexProvider, ReadonlyThreadProvider, RemoteThreadListHookInstanceManager, RemoteThreadListThreadListRuntimeCore, RuntimeAdapter, RuntimeAdapterProvider, SuggestionByIndexProvider, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemPrimitiveTitle, ThreadListItemRuntimeProvider, ThreadListPrimitiveItemByIndex, ThreadListPrimitiveItems, ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveSuggestionByIndex, ThreadPrimitiveSuggestions, ThreadPrimitiveSuggestionsImpl, ThreadPrimitiveUnstable_MessageById, Tools, convertExternalMessages, createLocalStorageAdapter, createMessageConverter, createRuntimeExtras, createSimpleTitleAdapter, defineMcpToolkit, defineToolkit, externalTool, getMessageQuote, getRenderComponent, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, defaultComponents as messagePartsDefaultComponents, providerTool, splitLocalRuntimeOptions, stubTool, unstable_Interactables, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useActionBarCopy, useActionBarEdit, useActionBarFeedbackNegative, useActionBarFeedbackPositive, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAssistantCloudThreadHistoryAdapter, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useBranchPickerNext, useBranchPickerPrevious, useCloudThreadListAdapter, useComposerAddAttachment, useComposerCancel, useComposerDictate, useComposerSend, useEditComposerCancel, useEditComposerSend, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessageBranching, useMessageError, useMessageReload, useRemoteThreadListRuntime, useRuntimeAdapters, useStreamingTiming, useSuggestionTrigger, useThreadIsEmpty, useThreadIsRunning, useThreadListItemArchive, useThreadListItemDelete, useThreadListItemTrigger, useThreadListItemUnarchive, useThreadListLoadMore, useThreadListNew, useThreadMessages, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
|
|
104
|
+
export { AssistantProviderBase, AssistantRuntimeProvider, ChainOfThoughtByIndicesProvider, ChainOfThoughtPartByIndexProvider, ChainOfThoughtPrimitiveParts, CloudFileAttachmentAdapter, ComposerAttachmentByIndexProvider, ComposerPrimitiveAttachmentByIndex, ComposerPrimitiveAttachments, ComposerPrimitiveIf, ComposerPrimitiveQueue, DataRenderers, GenerativeUIRender, GenerativeUIRenderError, Interactables, MessageAttachmentByIndexProvider, MessageByIndexProvider, MessagePartComponent, MessagePartPrimitiveInProgress, MessagePrimitiveAttachmentByIndex, MessagePrimitiveAttachments, MessagePrimitiveGenerativeUI, MessagePrimitiveGroupedParts, MessagePrimitivePartByIndex, MessagePrimitiveParts, MessagePrimitiveQuote, PartByIndexProvider, PartPrimitiveMessages, PartPrimitiveMessagesImpl, QueueItemByIndexProvider, ReadonlyThreadProvider, RemoteThreadListHookInstanceManager, RemoteThreadListThreadListRuntimeCore, RuntimeAdapter, RuntimeAdapterProvider, SuggestionByIndexProvider, TextMessagePartProvider, ThreadListItemByIndexProvider, ThreadListItemPrimitiveTitle, ThreadListItemRuntimeProvider, ThreadListPrimitiveItemByIndex, ThreadListPrimitiveItems, ThreadPrimitiveMessageByIndex, ThreadPrimitiveMessages, ThreadPrimitiveMessagesImpl, ThreadPrimitiveSuggestionByIndex, ThreadPrimitiveSuggestions, ThreadPrimitiveSuggestionsImpl, ThreadPrimitiveUnstable_MessageById, Tools, convertExternalMessages, createLocalStorageAdapter, createMessageConverter, createRuntimeExtras, createSimpleTitleAdapter, defineMcpToolkit, defineToolkit, externalTool, getMessageQuote, getRenderComponent, groupPartByType, hitl, hitlTool, humanTool, makeAssistantDataUI, makeAssistantTool, makeAssistantToolUI, defaultComponents as messagePartsDefaultComponents, providerTool, splitLocalRuntimeOptions, stubTool, unstable_Interactables, unstable_createRuntimeExtrasFromBrand, unstable_interactableTool, unstable_useInteractable, unstable_useInteractableState, unstable_useInteractableVersions, unstable_useThreadMessageIds, useActionBarCopy, useActionBarEdit, useActionBarFeedbackNegative, useActionBarFeedbackPositive, useActionBarReload, useActionBarSpeak, useActionBarStopSpeaking, useAssistantCloudThreadHistoryAdapter, useAssistantContext, useAssistantDataUI, useAssistantInstructions, useAssistantInteractable, useAssistantTool, useAssistantToolUI, useAuiToolOverrides, useBranchPickerNext, useBranchPickerPrevious, useCloudThreadListAdapter, useComposerAddAttachment, useComposerCancel, useComposerDictate, useComposerSend, useEditComposerCancel, useEditComposerSend, useExternalMessageConverter, useExternalStoreRuntime, useExternalStoreSharedOptions, useInlineRender, useInteractableState, useLocalRuntime, useMessageBranching, useMessageError, useMessageReload, useRemoteThreadListRuntime, useRuntimeAdapters, useStreamingTiming, useSuggestionTrigger, useThreadIsEmpty, useThreadIsRunning, useThreadListItemArchive, useThreadListItemDelete, useThreadListItemTrigger, useThreadListItemUnarchive, useThreadListLoadMore, useThreadListNew, useThreadMessages, useToolArgsStatus, useVoiceControls, useVoiceState, useVoiceVolume };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Unstable_InteractableStateSchema } from "../types/scopes/interactables.js";
|
|
2
1
|
import { ToolDefinition } from "./toolbox.js";
|
|
2
|
+
import { Unstable_InteractableStateSchema } from "../types/scopes/interactables.js";
|
|
3
3
|
import { Unstable_InferInteractableState, Unstable_InteractableVersionInfo } from "./useInteractable.js";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
//#region src/react/model-context/interactableTool.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AssistantToolProps as AssistantToolProps$1 } from "../../model-context/types.js";
|
|
2
|
-
import "../../index.js";
|
|
3
2
|
import { ToolCallMessagePartComponent } from "../types/MessagePartComponentTypes.js";
|
|
4
3
|
import { ToolCallText } from "./toolbox.js";
|
|
4
|
+
import "../../index.js";
|
|
5
5
|
//#region src/react/model-context/useAssistantTool.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Props used to register a tool from React.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentByIndexProvider.d.ts","names":[],"sources":["../../../src/react/providers/AttachmentByIndexProvider.tsx"],"mappings":";;cAGa,kCAAkC,GAC7C;EACE;;
|
|
1
|
+
{"version":3,"file":"AttachmentByIndexProvider.d.ts","names":[],"sources":["../../../src/react/providers/AttachmentByIndexProvider.tsx"],"mappings":";;cAGa,kCAAkC,GAC7C;EACE;;cAkBS,mCAAmC,GAC9C;EACE"}
|
|
@@ -1,76 +1,70 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { AuiProvider, Derived, useAui } from "@assistant-ui/store";
|
|
2
|
+
import { AuiConfig, AuiProvider, Derived, useAui } from "@assistant-ui/store";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/react/providers/AttachmentByIndexProvider.tsx
|
|
5
5
|
const MessageAttachmentByIndexProvider = (t0) => {
|
|
6
|
-
const $ = c(
|
|
6
|
+
const $ = c(6);
|
|
7
7
|
const { index, children } = t0;
|
|
8
|
+
const aui = useAui();
|
|
8
9
|
let t1;
|
|
9
10
|
if ($[0] !== index) {
|
|
10
|
-
t1 = Derived({
|
|
11
|
+
t1 = AuiConfig({ attachment: Derived({
|
|
11
12
|
source: "message",
|
|
12
13
|
query: {
|
|
13
14
|
type: "index",
|
|
14
15
|
index
|
|
15
16
|
},
|
|
16
|
-
get: (
|
|
17
|
-
});
|
|
17
|
+
get: (aui_0) => aui_0.message.attachment({ index })
|
|
18
|
+
}) });
|
|
18
19
|
$[0] = index;
|
|
19
20
|
$[1] = t1;
|
|
20
21
|
} else t1 = $[1];
|
|
22
|
+
const config = t1;
|
|
21
23
|
let t2;
|
|
22
|
-
if ($[2] !==
|
|
23
|
-
t2 =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} else t2 = $[3];
|
|
27
|
-
const aui_0 = useAui(t2);
|
|
28
|
-
let t3;
|
|
29
|
-
if ($[4] !== aui_0 || $[5] !== children) {
|
|
30
|
-
t3 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
31
|
-
value: aui_0,
|
|
24
|
+
if ($[2] !== aui || $[3] !== children || $[4] !== config) {
|
|
25
|
+
t2 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
26
|
+
extends: aui,
|
|
27
|
+
config,
|
|
32
28
|
children
|
|
33
29
|
});
|
|
34
|
-
$[
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
$[2] = aui;
|
|
31
|
+
$[3] = children;
|
|
32
|
+
$[4] = config;
|
|
33
|
+
$[5] = t2;
|
|
34
|
+
} else t2 = $[5];
|
|
35
|
+
return t2;
|
|
39
36
|
};
|
|
40
37
|
const ComposerAttachmentByIndexProvider = (t0) => {
|
|
41
|
-
const $ = c(
|
|
38
|
+
const $ = c(6);
|
|
42
39
|
const { index, children } = t0;
|
|
40
|
+
const aui = useAui();
|
|
43
41
|
let t1;
|
|
44
42
|
if ($[0] !== index) {
|
|
45
|
-
t1 = Derived({
|
|
43
|
+
t1 = AuiConfig({ attachment: Derived({
|
|
46
44
|
source: "composer",
|
|
47
45
|
query: {
|
|
48
46
|
type: "index",
|
|
49
47
|
index
|
|
50
48
|
},
|
|
51
|
-
get: (
|
|
52
|
-
});
|
|
49
|
+
get: (aui_0) => aui_0.composer.attachment({ index })
|
|
50
|
+
}) });
|
|
53
51
|
$[0] = index;
|
|
54
52
|
$[1] = t1;
|
|
55
53
|
} else t1 = $[1];
|
|
54
|
+
const config = t1;
|
|
56
55
|
let t2;
|
|
57
|
-
if ($[2] !==
|
|
58
|
-
t2 =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} else t2 = $[3];
|
|
62
|
-
const aui_0 = useAui(t2);
|
|
63
|
-
let t3;
|
|
64
|
-
if ($[4] !== aui_0 || $[5] !== children) {
|
|
65
|
-
t3 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
66
|
-
value: aui_0,
|
|
56
|
+
if ($[2] !== aui || $[3] !== children || $[4] !== config) {
|
|
57
|
+
t2 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
58
|
+
extends: aui,
|
|
59
|
+
config,
|
|
67
60
|
children
|
|
68
61
|
});
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
$[2] = aui;
|
|
63
|
+
$[3] = children;
|
|
64
|
+
$[4] = config;
|
|
65
|
+
$[5] = t2;
|
|
66
|
+
} else t2 = $[5];
|
|
67
|
+
return t2;
|
|
74
68
|
};
|
|
75
69
|
//#endregion
|
|
76
70
|
export { ComposerAttachmentByIndexProvider, MessageAttachmentByIndexProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiProvider","Derived","MessageAttachmentByIndexProvider","index","t0","$","_c","children","t1","source","query","type","get","
|
|
1
|
+
{"version":3,"file":"AttachmentByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","MessageAttachmentByIndexProvider","index","t0","$","_c","children","aui","t1","attachment","source","query","type","get","aui_0","message","config","t2","ComposerAttachmentByIndexProvider","composer"],"sources":["../../../src/react/providers/AttachmentByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const MessageAttachmentByIndexProvider: FC<\n PropsWithChildren<{\n index: number;\n }>\n> = ({ index, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n attachment: Derived({\n source: \"message\",\n query: { type: \"index\", index },\n get: (aui) => aui.message.attachment({ index }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n\nexport const ComposerAttachmentByIndexProvider: FC<\n PropsWithChildren<{\n index: number;\n }>\n> = ({ index, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n attachment: Derived({\n source: \"composer\",\n query: { type: \"index\", index },\n get: (aui) => aui.composer.attachment({ index }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,oCAITE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EACNM,KAAAV,UAAU,EAAAW,YACXT,QAAQ;GAAAU,QACV;GAASC,OACV;IAAAC,MAAQ;IAAOV;GAAQ;GAACW,MAC1BC,UAASP,MAAGQ,QAAQN,WAAY,EAAAP,MAAQ,CAAC;EAChD,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAY,SAAeR;CAMZ,IAAAS;CAAA,IAAAb,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAY,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBV,SAAAA;GAAaS;GAChCV;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAFda;AAEc;AAIlB,MAAaC,qCAITf,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EACNM,KAAAV,UAAU,EAAAW,YACXT,QAAQ;GAAAU,QACV;GAAUC,OACX;IAAAC,MAAQ;IAAOV;GAAQ;GAACW,MAC1BC,UAASP,MAAGY,SAASV,WAAY,EAAAP,MAAQ,CAAC;EACjD,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAY,SAAeR;CAMZ,IAAAS;CAAA,IAAAb,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAY,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBV,SAAAA;GAAaS;GAChCV;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAFda;AAEc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainOfThoughtByIndicesProvider.d.ts","names":[],"sources":["../../../src/react/providers/ChainOfThoughtByIndicesProvider.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ChainOfThoughtByIndicesProvider.d.ts","names":[],"sources":["../../../src/react/providers/ChainOfThoughtByIndicesProvider.tsx"],"mappings":";;cAUa,iCAAiC,GAC5C;EACE;EACA"}
|
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
import { ChainOfThoughtClient } from "../../store/clients/chain-of-thought-client.js";
|
|
2
2
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
3
|
-
import { AuiProvider, useAui, useAuiState } from "@assistant-ui/store";
|
|
3
|
+
import { AuiConfig, AuiProvider, useAui, useAuiState } from "@assistant-ui/store";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/react/providers/ChainOfThoughtByIndicesProvider.tsx
|
|
6
6
|
const ChainOfThoughtByIndicesProvider = (t0) => {
|
|
7
|
-
const $ = c(
|
|
7
|
+
const $ = c(4);
|
|
8
8
|
const { startIndex, endIndex, children } = t0;
|
|
9
9
|
const parts = useAuiState(_temp).slice(startIndex, endIndex + 1);
|
|
10
10
|
const parentAui = useAui();
|
|
11
|
-
const
|
|
11
|
+
const config = AuiConfig({ chainOfThought: ChainOfThoughtClient({
|
|
12
12
|
parts,
|
|
13
13
|
getMessagePart: (t1) => {
|
|
14
14
|
const { index } = t1;
|
|
15
15
|
if (index < 0 || index >= parts.length) throw new Error(`ChainOfThought part index ${index} is out of bounds (0..${parts.length - 1})`);
|
|
16
16
|
return parentAui.message.part({ index: startIndex + index });
|
|
17
17
|
}
|
|
18
|
-
});
|
|
19
|
-
let
|
|
20
|
-
if ($[0] !==
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} else t3 = $[1];
|
|
25
|
-
const aui = useAui(t3);
|
|
26
|
-
let t4;
|
|
27
|
-
if ($[2] !== aui || $[3] !== children) {
|
|
28
|
-
t4 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
29
|
-
value: aui,
|
|
18
|
+
}) });
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[0] !== children || $[1] !== config || $[2] !== parentAui) {
|
|
21
|
+
t2 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
22
|
+
extends: parentAui,
|
|
23
|
+
config,
|
|
30
24
|
children
|
|
31
25
|
});
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
$[0] = children;
|
|
27
|
+
$[1] = config;
|
|
28
|
+
$[2] = parentAui;
|
|
29
|
+
$[3] = t2;
|
|
30
|
+
} else t2 = $[3];
|
|
31
|
+
return t2;
|
|
37
32
|
};
|
|
38
33
|
function _temp(s) {
|
|
39
34
|
return s.message.parts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainOfThoughtByIndicesProvider.js","names":["FC","PropsWithChildren","useAui","useAuiState","AuiProvider","ChainOfThoughtClient","ChainOfThoughtPart","ChainOfThoughtByIndicesProvider","startIndex","endIndex","t0","$","_c","children","parts","_temp","slice","parentAui","
|
|
1
|
+
{"version":3,"file":"ChainOfThoughtByIndicesProvider.js","names":["FC","PropsWithChildren","useAui","useAuiState","AuiConfig","AuiProvider","ChainOfThoughtClient","ChainOfThoughtPart","ChainOfThoughtByIndicesProvider","startIndex","endIndex","t0","$","_c","children","parts","_temp","slice","parentAui","config","chainOfThought","getMessagePart","t1","index","length","Error","message","part","t2","s"],"sources":["../../../src/react/providers/ChainOfThoughtByIndicesProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport {\n useAui,\n useAuiState,\n AuiConfig,\n AuiProvider,\n} from \"@assistant-ui/store\";\nimport { ChainOfThoughtClient } from \"../../store/clients/chain-of-thought-client\";\nimport type { ChainOfThoughtPart } from \"../../store/scopes/chain-of-thought\";\n\nexport const ChainOfThoughtByIndicesProvider: FC<\n PropsWithChildren<{\n startIndex: number;\n endIndex: number;\n }>\n> = ({ startIndex, endIndex, children }) => {\n const parts = useAuiState((s) => s.message.parts).slice(\n startIndex,\n endIndex + 1,\n ) as ChainOfThoughtPart[];\n\n const parentAui = useAui();\n\n const config = AuiConfig({\n chainOfThought: ChainOfThoughtClient({\n parts,\n getMessagePart: ({ index }) => {\n if (index < 0 || index >= parts.length) {\n throw new Error(\n `ChainOfThought part index ${index} is out of bounds (0..${parts.length - 1})`,\n );\n }\n return parentAui.message.part({ index: startIndex + index });\n },\n }),\n });\n return (\n <AuiProvider extends={parentAui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;;AAUA,MAAaQ,mCAKTG,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAJ,YAAAC,UAAAI,aAAAH;CACH,MAAAI,QAAcZ,YAAYa,KAAsB,CAAC,CAAAC,MAC/CR,YACAC,WAAW,CACb;CAEA,MAAAQ,YAAkBhB,OAAO;CAEzB,MAAAiB,SAAef,UAAU,EAAAgB,gBACPd,qBAAqB;EAAAS;EAAAM,iBAEnBC,OAAA;GAAC,MAAA,EAAAC,UAAAD;GACf,IAAIC,QAAQ,KAAKA,SAASR,MAAKS,QAC7B,MAAM,IAAIC,MACR,6BAA6BF,MAAK,wBAAyBR,MAAKS,SAAU,EAAC,EAC7E;GACD,OACMN,UAASQ,QAAQC,KAAM,EAAAJ,OAASd,aAAac,MAAM,CAAC;EAAC;CAEhE,CAAC,EACH,CAAC;CAAE,IAAAK;CAAA,IAAAhB,EAAA,OAAAE,YAAAF,EAAA,OAAAO,UAAAP,EAAA,OAAAM,WAAA;EAEDU,KAAA,oBAAC,aAAD;GAAsBV,SAAAA;GAAmBC;GACtCL;EADS,CAAA;EAEEF,EAAA,KAAAE;EAAAF,EAAA,KAAAO;EAAAP,EAAA,KAAAM;EAAAN,EAAA,KAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OAFdgB;AAEc;AAxBd,SAAAZ,MAAAa,GAAA;CAAA,OAC+BA,EAACH,QAAQX;AAAM"}
|
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { AuiProvider, Derived, useAui } from "@assistant-ui/store";
|
|
2
|
+
import { AuiConfig, AuiProvider, Derived, useAui } from "@assistant-ui/store";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/react/providers/ChainOfThoughtPartByIndexProvider.tsx
|
|
5
5
|
const ChainOfThoughtPartByIndexProvider = (t0) => {
|
|
6
|
-
const $ = c(
|
|
6
|
+
const $ = c(6);
|
|
7
7
|
const { index, children } = t0;
|
|
8
|
+
const aui = useAui();
|
|
8
9
|
let t1;
|
|
9
10
|
if ($[0] !== index) {
|
|
10
|
-
t1 = Derived({
|
|
11
|
+
t1 = AuiConfig({ part: Derived({
|
|
11
12
|
source: "chainOfThought",
|
|
12
13
|
query: {
|
|
13
14
|
type: "index",
|
|
14
15
|
index
|
|
15
16
|
},
|
|
16
|
-
get: (
|
|
17
|
-
});
|
|
17
|
+
get: (aui_0) => aui_0.chainOfThought.part({ index })
|
|
18
|
+
}) });
|
|
18
19
|
$[0] = index;
|
|
19
20
|
$[1] = t1;
|
|
20
21
|
} else t1 = $[1];
|
|
22
|
+
const config = t1;
|
|
21
23
|
let t2;
|
|
22
|
-
if ($[2] !==
|
|
23
|
-
t2 =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} else t2 = $[3];
|
|
27
|
-
const aui_0 = useAui(t2);
|
|
28
|
-
let t3;
|
|
29
|
-
if ($[4] !== aui_0 || $[5] !== children) {
|
|
30
|
-
t3 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
31
|
-
value: aui_0,
|
|
24
|
+
if ($[2] !== aui || $[3] !== children || $[4] !== config) {
|
|
25
|
+
t2 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
26
|
+
extends: aui,
|
|
27
|
+
config,
|
|
32
28
|
children
|
|
33
29
|
});
|
|
34
|
-
$[
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
$[2] = aui;
|
|
31
|
+
$[3] = children;
|
|
32
|
+
$[4] = config;
|
|
33
|
+
$[5] = t2;
|
|
34
|
+
} else t2 = $[5];
|
|
35
|
+
return t2;
|
|
39
36
|
};
|
|
40
37
|
//#endregion
|
|
41
38
|
export { ChainOfThoughtPartByIndexProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainOfThoughtPartByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiProvider","Derived","ChainOfThoughtPartByIndexProvider","index","t0","$","_c","children","t1","source","query","type","get","
|
|
1
|
+
{"version":3,"file":"ChainOfThoughtPartByIndexProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","ChainOfThoughtPartByIndexProvider","index","t0","$","_c","children","aui","t1","part","source","query","type","get","aui_0","chainOfThought","config","t2"],"sources":["../../../src/react/providers/ChainOfThoughtPartByIndexProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const ChainOfThoughtPartByIndexProvider: FC<\n PropsWithChildren<{\n index: number;\n }>\n> = ({ index, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n part: Derived({\n source: \"chainOfThought\",\n query: { type: \"index\", index },\n get: (aui) => aui.chainOfThought.part({ index }),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,qCAITE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,OAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EACNM,KAAAV,UAAU,EAAAW,MACjBT,QAAQ;GAAAU,QACJ;GAAgBC,OACjB;IAAAC,MAAQ;IAAOV;GAAQ;GAACW,MAC1BC,UAASP,MAAGQ,eAAeN,KAAM,EAAAP,MAAQ,CAAC;EACjD,CAAC,EACH,CAAC;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CANF,MAAAY,SAAeR;CAMZ,IAAAS;CAAA,IAAAb,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAY,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBV,SAAAA;GAAaS;GAChCV;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAFda;AAEc"}
|
|
@@ -1,55 +1,45 @@
|
|
|
1
1
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
2
|
-
import { AuiProvider, Derived, useAui } from "@assistant-ui/store";
|
|
2
|
+
import { AuiConfig, AuiProvider, Derived, useAui } from "@assistant-ui/store";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/react/providers/MessageByIdProvider.tsx
|
|
5
5
|
const MessageByIdProvider = (t0) => {
|
|
6
|
-
const $ = c(
|
|
6
|
+
const $ = c(6);
|
|
7
7
|
const { id, children } = t0;
|
|
8
|
+
const aui = useAui();
|
|
8
9
|
let t1;
|
|
9
10
|
if ($[0] !== id) {
|
|
10
|
-
t1 =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
t1 = AuiConfig({
|
|
12
|
+
message: Derived({
|
|
13
|
+
source: "thread",
|
|
14
|
+
query: {
|
|
15
|
+
type: "id",
|
|
16
|
+
id
|
|
17
|
+
},
|
|
18
|
+
get: (aui_0) => aui_0.thread.message({ id })
|
|
19
|
+
}),
|
|
20
|
+
composer: Derived({
|
|
21
|
+
source: "message",
|
|
22
|
+
query: {},
|
|
23
|
+
get: (aui_1) => aui_1.thread.message({ id }).composer()
|
|
24
|
+
})
|
|
17
25
|
});
|
|
18
26
|
$[0] = id;
|
|
19
27
|
$[1] = t1;
|
|
20
28
|
} else t1 = $[1];
|
|
29
|
+
const config = t1;
|
|
21
30
|
let t2;
|
|
22
|
-
if ($[2] !==
|
|
23
|
-
t2 =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
get: (aui_0) => aui_0.thread.message({ id }).composer()
|
|
27
|
-
});
|
|
28
|
-
$[2] = id;
|
|
29
|
-
$[3] = t2;
|
|
30
|
-
} else t2 = $[3];
|
|
31
|
-
let t3;
|
|
32
|
-
if ($[4] !== t1 || $[5] !== t2) {
|
|
33
|
-
t3 = {
|
|
34
|
-
message: t1,
|
|
35
|
-
composer: t2
|
|
36
|
-
};
|
|
37
|
-
$[4] = t1;
|
|
38
|
-
$[5] = t2;
|
|
39
|
-
$[6] = t3;
|
|
40
|
-
} else t3 = $[6];
|
|
41
|
-
const aui_1 = useAui(t3);
|
|
42
|
-
let t4;
|
|
43
|
-
if ($[7] !== aui_1 || $[8] !== children) {
|
|
44
|
-
t4 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
45
|
-
value: aui_1,
|
|
31
|
+
if ($[2] !== aui || $[3] !== children || $[4] !== config) {
|
|
32
|
+
t2 = /* @__PURE__ */ jsx(AuiProvider, {
|
|
33
|
+
extends: aui,
|
|
34
|
+
config,
|
|
46
35
|
children
|
|
47
36
|
});
|
|
48
|
-
$[
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
$[2] = aui;
|
|
38
|
+
$[3] = children;
|
|
39
|
+
$[4] = config;
|
|
40
|
+
$[5] = t2;
|
|
41
|
+
} else t2 = $[5];
|
|
42
|
+
return t2;
|
|
53
43
|
};
|
|
54
44
|
//#endregion
|
|
55
45
|
export { MessageByIdProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageByIdProvider.js","names":["FC","PropsWithChildren","useAui","AuiProvider","Derived","MessageByIdProvider","id","t0","$","_c","children","t1","source","query","type","get","
|
|
1
|
+
{"version":3,"file":"MessageByIdProvider.js","names":["FC","PropsWithChildren","useAui","AuiConfig","AuiProvider","Derived","MessageByIdProvider","id","t0","$","_c","children","aui","t1","message","source","query","type","get","aui_0","thread","composer","aui_1","config","t2"],"sources":["../../../src/react/providers/MessageByIdProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useAui, AuiConfig, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const MessageByIdProvider: FC<\n PropsWithChildren<{\n id: string;\n }>\n> = ({ id, children }) => {\n const aui = useAui();\n const config = AuiConfig({\n message: Derived({\n source: \"thread\",\n query: { type: \"id\", id },\n get: (aui) => aui.thread.message({ id }),\n }),\n composer: Derived({\n source: \"message\",\n query: {},\n get: (aui) => aui.thread.message({ id }).composer(),\n }),\n });\n return (\n <AuiProvider extends={aui} config={config}>\n {children}\n </AuiProvider>\n );\n};\n"],"mappings":";;;;AAGA,MAAaM,uBAITE,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAH,IAAAI,aAAAH;CACH,MAAAI,MAAYV,OAAO;CAAE,IAAAW;CAAA,IAAAJ,EAAA,OAAAF,IAAA;EACNM,KAAAV,UAAU;GAAAW,SACdT,QAAQ;IAAAU,QACP;IAAQC,OACT;KAAAC,MAAQ;KAAIV;IAAK;IAACW,MACpBC,UAASP,MAAGQ,OAAON,QAAS,EAAAP,GAAK,CAAC;GACzC,CAAC;GAACc,UACQhB,QAAQ;IAAAU,QACR;IAASC,OACV,CAAC;IAACE,MACJI,UAASV,MAAGQ,OAAON,QAAS,EAAAP,GAAK,CAAC,CAAC,CAAAc,SAAU;GACpD,CAAC;EACH,CAAC;EAACZ,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAXF,MAAAc,SAAeV;CAWZ,IAAAW;CAAA,IAAAf,EAAA,OAAAG,OAAAH,EAAA,OAAAE,YAAAF,EAAA,OAAAc,QAAA;EAEDC,KAAA,oBAAC,aAAD;GAAsBZ,SAAAA;GAAaW;GAChCZ;EADS,CAAA;EAEEF,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAc;EAAAd,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAFde;AAEc"}
|