@dxos/plugin-assistant 0.8.4-main.21d9917 → 0.8.4-main.2244d791bb
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/lib/browser/{BlueprintArticle-WP3G5GLG.mjs → BlueprintArticle-6SP2ZWJ2.mjs} +2 -3
- package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs.map +7 -0
- package/dist/lib/browser/{ChatCompanion-GFSJZTOT.mjs → ChatCompanion-KGPU4DLI.mjs} +67 -20
- package/dist/lib/browser/ChatCompanion-KGPU4DLI.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-IHAPBIZE.mjs → ChatContainer-IHPTKMDK.mjs} +7 -6
- package/dist/lib/browser/ChatContainer-IHPTKMDK.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-EGRMPCTL.mjs → ChatDialog-VALCOM3W.mjs} +5 -5
- package/dist/lib/browser/{ChatDialog-EGRMPCTL.mjs.map → ChatDialog-VALCOM3W.mjs.map} +2 -2
- package/dist/lib/browser/InitiativeContainer-LQHJLTPE.mjs +264 -0
- package/dist/lib/browser/InitiativeContainer-LQHJLTPE.mjs.map +7 -0
- package/dist/lib/browser/{PromptArticle-K362ZPAE.mjs → PromptArticle-YJ5E2YYE.mjs} +21 -9
- package/dist/lib/browser/PromptArticle-YJ5E2YYE.mjs.map +7 -0
- package/dist/lib/browser/{ai-service-5GUDOEWF.mjs → ai-service-CY2BYPH6.mjs} +5 -4
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-DSNH2OMY.mjs → app-graph-builder-MUZGUQSC.mjs} +43 -21
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-4D42KBDM.mjs +33 -0
- package/dist/lib/browser/blueprint-definition-4D42KBDM.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +3 -7
- package/dist/lib/browser/{chunk-V772AMZM.mjs → chunk-6BVCG5SJ.mjs} +17 -37
- package/dist/lib/browser/chunk-6BVCG5SJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ML3QCFKA.mjs → chunk-JYY5AD65.mjs} +50 -29
- package/dist/lib/browser/chunk-JYY5AD65.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MRJVYGLU.mjs → chunk-MEM7ET2A.mjs} +34 -68
- package/dist/lib/browser/chunk-MEM7ET2A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-A75V4MOQ.mjs → chunk-THZPCE3E.mjs} +228 -92
- package/dist/lib/browser/chunk-THZPCE3E.mjs.map +7 -0
- package/dist/lib/browser/{edge-model-resolver-26BOY6HY.mjs → edge-model-resolver-YTMFQEN5.mjs} +4 -3
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +97 -52
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{local-model-resolver-ZFIM6GGV.mjs → local-model-resolver-CGRQH37T.mjs} +4 -3
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-7XJLBRQY.mjs → operation-resolver-MB7OQBPT.mjs} +21 -23
- package/dist/lib/browser/operation-resolver-MB7OQBPT.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-S7SBFOSW.mjs → react-surface-UHDDX6N3.mjs} +37 -21
- package/dist/lib/browser/react-surface-UHDDX6N3.mjs.map +7 -0
- package/dist/lib/browser/{repair-6QGAKOVM.mjs → repair-IRXDYF4R.mjs} +4 -7
- package/dist/lib/browser/repair-IRXDYF4R.mjs.map +7 -0
- package/dist/lib/browser/{settings-4ZDLUMYE.mjs → settings-XF6GKHCG.mjs} +5 -4
- package/dist/lib/browser/settings-XF6GKHCG.mjs.map +7 -0
- package/dist/lib/browser/{state-AN6336ZX.mjs → state-OYDPWLKA.mjs} +2 -2
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs +19 -0
- package/dist/lib/browser/toolkit-IDXQCSTX.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{BlueprintArticle-WZ76E2C4.mjs → BlueprintArticle-7LI6UXKZ.mjs} +2 -3
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatCompanion-UR7DXZ54.mjs → ChatCompanion-XY3MAAKH.mjs} +67 -20
- package/dist/lib/node-esm/ChatCompanion-XY3MAAKH.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-YMLLGOZK.mjs → ChatContainer-3YXC4HOK.mjs} +7 -6
- package/dist/lib/node-esm/ChatContainer-3YXC4HOK.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-D24WJPK4.mjs → ChatDialog-UAYXP3UM.mjs} +5 -5
- package/dist/lib/node-esm/{ChatDialog-D24WJPK4.mjs.map → ChatDialog-UAYXP3UM.mjs.map} +2 -2
- package/dist/lib/node-esm/InitiativeContainer-EAUOSH36.mjs +265 -0
- package/dist/lib/node-esm/InitiativeContainer-EAUOSH36.mjs.map +7 -0
- package/dist/lib/node-esm/{PromptArticle-D4HAIIC6.mjs → PromptArticle-U2IYPLFR.mjs} +21 -9
- package/dist/lib/node-esm/PromptArticle-U2IYPLFR.mjs.map +7 -0
- package/dist/lib/node-esm/{ai-service-PXKKCFIF.mjs → ai-service-ZI3A6RVG.mjs} +5 -4
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-TJCUEXW5.mjs → app-graph-builder-4QN5M6PD.mjs} +43 -21
- package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-EJOAZFY5.mjs +34 -0
- package/dist/lib/node-esm/blueprint-definition-EJOAZFY5.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +3 -7
- package/dist/lib/node-esm/{chunk-4BERCIES.mjs → chunk-3DG7AJES.mjs} +228 -92
- package/dist/lib/node-esm/chunk-3DG7AJES.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DCA5QWQT.mjs → chunk-CTHGEJJA.mjs} +34 -67
- package/dist/lib/node-esm/chunk-CTHGEJJA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZRIPP7YF.mjs → chunk-JMBYVUD6.mjs} +50 -29
- package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-355W5B27.mjs → chunk-LB72WG6R.mjs} +17 -37
- package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +7 -0
- package/dist/lib/node-esm/{edge-model-resolver-G5KMODPO.mjs → edge-model-resolver-CMJ3KNLQ.mjs} +4 -3
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +97 -52
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{local-model-resolver-KDZLYI7Y.mjs → local-model-resolver-FFDAKOXN.mjs} +4 -3
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-SX4WMNA7.mjs → operation-resolver-VWNTUHQQ.mjs} +21 -23
- package/dist/lib/node-esm/operation-resolver-VWNTUHQQ.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-ZR6FXGLF.mjs → react-surface-DTOXFPWM.mjs} +37 -21
- package/dist/lib/node-esm/react-surface-DTOXFPWM.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-QJ7CQDKU.mjs → repair-DMI55PON.mjs} +4 -7
- package/dist/lib/node-esm/repair-DMI55PON.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-CQEOHR3R.mjs → settings-NGGZA7S7.mjs} +5 -4
- package/dist/lib/node-esm/settings-NGGZA7S7.mjs.map +7 -0
- package/dist/lib/node-esm/{state-HDON4REW.mjs → state-VSCPGN7R.mjs} +2 -2
- package/dist/lib/node-esm/{toolkit-OWGCEKOO.mjs → toolkit-JPRJRDDB.mjs} +6 -5
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/functions/index.d.ts +25 -0
- package/dist/types/src/blueprints/assistant/functions/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/functions/object-list.d.ts.map +1 -0
- package/dist/types/src/{functions → blueprints/assistant/functions}/object-load.d.ts +1 -1
- package/dist/types/src/blueprints/assistant/functions/object-load.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/functions/object-search.d.ts.map +1 -0
- package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
- package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -6
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +3 -2
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts +1 -1
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +4 -19
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +1 -2
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +3 -2
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +3 -2
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +3 -2
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +3 -2
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +6 -3
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +2 -2
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +4 -4
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog.d.ts +2 -2
- package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +2 -2
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +115 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/InitiativeContainer/InitiativeContainer.d.ts +7 -0
- package/dist/types/src/components/InitiativeContainer/InitiativeContainer.d.ts.map +1 -0
- package/dist/types/src/components/InitiativeContainer/index.d.ts +3 -0
- package/dist/types/src/components/InitiativeContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/PromptArticle.d.ts +1 -1
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +114 -0
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +114 -0
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +114 -0
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts +4 -0
- package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts.map +1 -0
- package/dist/types/src/components/TriggerStatus/index.d.ts +2 -0
- package/dist/types/src/components/TriggerStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +10 -11
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +2 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +2 -2
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +2 -2
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +7 -3
- package/dist/types/src/processor/processor.d.ts.map +1 -1
- package/dist/types/src/processor/update-name.d.ts +2 -2
- package/dist/types/src/processor/update-name.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +114 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +5 -27
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +3 -1
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +94 -91
- package/src/AssistantPlugin.tsx +62 -29
- package/src/blueprints/assistant/blueprint.ts +34 -0
- package/src/blueprints/assistant/functions/index.ts +13 -0
- package/src/{functions → blueprints/assistant/functions}/object-list.ts +2 -2
- package/src/{functions → blueprints/assistant/functions}/object-load.ts +9 -12
- package/src/{functions → blueprints/assistant/functions}/object-search.ts +1 -1
- package/src/blueprints/assistant/index.ts +5 -0
- package/src/blueprints/index.ts +1 -8
- package/src/capabilities/ai-service/ai-service.ts +4 -3
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +37 -17
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +28 -42
- package/src/capabilities/blueprint-definition/index.ts +0 -1
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +4 -3
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +4 -3
- package/src/capabilities/operation-resolver/operation-resolver.ts +17 -15
- package/src/capabilities/react-surface/react-surface.tsx +35 -19
- package/src/capabilities/repair/repair.ts +3 -4
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/capabilities/toolkit/toolkit.ts +5 -4
- package/src/components/AssistantSettings/AssistantSettings.tsx +15 -15
- package/src/components/BlueprintArticle.tsx +2 -3
- package/src/components/Chat/Chat.tsx +41 -14
- package/src/components/ChatCompanion.tsx +81 -18
- package/src/components/ChatContainer.tsx +20 -13
- package/src/components/ChatDialog.tsx +4 -3
- package/src/components/ChatProgress/ChatProgress.tsx +2 -3
- package/src/components/ChatPrompt/ChatActions.tsx +8 -0
- package/src/components/ChatThread/ChatThread.stories.tsx +3 -3
- package/src/components/ChatThread/ChatThread.tsx +13 -4
- package/src/components/ChatThread/Link.tsx +1 -1
- package/src/components/ChatThread/registry.tsx +18 -1
- package/src/components/ChatThread/sync.test.ts +2 -1
- package/src/components/ChatThread/sync.ts +14 -8
- package/src/components/InitiativeContainer/InitiativeContainer.tsx +340 -0
- package/src/components/InitiativeContainer/index.ts +6 -0
- package/src/components/PromptArticle.tsx +21 -13
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +1 -1
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +1 -1
- package/src/components/Toolbox/Toolbox.stories.tsx +2 -2
- package/src/components/Toolbox/Toolbox.tsx +41 -42
- package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
- package/src/components/TriggerStatus/index.ts +5 -0
- package/src/components/index.ts +11 -2
- package/src/hooks/useBlueprintRegistry.ts +7 -4
- package/src/hooks/useChatProcessor.ts +2 -1
- package/src/hooks/useChatServices.ts +3 -3
- package/src/hooks/useChatToolbarActions.ts +6 -5
- package/src/hooks/useReferencesProvider.ts +1 -5
- package/src/index.ts +1 -0
- package/src/processor/processor.test.ts +7 -7
- package/src/processor/processor.ts +47 -26
- package/src/processor/update-name.ts +2 -3
- package/src/translations.ts +23 -2
- package/src/types/Assistant.ts +4 -38
- package/src/types/AssistantAction.ts +6 -5
- package/src/types/index.ts +3 -0
- package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +0 -7
- package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +0 -14
- package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs.map +0 -7
- package/dist/lib/browser/chunk-A75V4MOQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +0 -7
- package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +0 -7
- package/dist/lib/browser/chunk-V772AMZM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs +0 -41
- package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-S7SBFOSW.mjs.map +0 -7
- package/dist/lib/browser/repair-6QGAKOVM.mjs.map +0 -7
- package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +0 -7
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs +0 -18
- package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs +0 -15
- package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-355W5B27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4BERCIES.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +0 -42
- package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs.map +0 -7
- package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +0 -7
- package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +0 -7
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +0 -209
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducers.d.ts +0 -40
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/object-list.d.ts.map +0 -1
- package/dist/types/src/functions/object-load.d.ts.map +0 -1
- package/dist/types/src/functions/object-search.d.ts.map +0 -1
- package/src/blueprints/assistant-blueprint.ts +0 -62
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/functions/index.ts +0 -7
- /package/dist/lib/browser/{state-AN6336ZX.mjs.map → state-OYDPWLKA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{state-HDON4REW.mjs.map → state-VSCPGN7R.mjs.map} +0 -0
- /package/dist/types/src/{functions → blueprints/assistant/functions}/object-list.d.ts +0 -0
- /package/dist/types/src/{functions → blueprints/assistant/functions}/object-search.d.ts +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AiChatProcessor,
|
|
3
3
|
AiServicePresets
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JYY5AD65.mjs";
|
|
5
5
|
import {
|
|
6
6
|
AssistantOperation,
|
|
7
|
-
Assistant_exports,
|
|
8
7
|
LLM_PROVIDERS,
|
|
9
8
|
ServiceType
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6BVCG5SJ.mjs";
|
|
11
10
|
import {
|
|
12
11
|
meta
|
|
13
12
|
} from "./chunk-EXVT7D4B.mjs";
|
|
@@ -16,7 +15,7 @@ import {
|
|
|
16
15
|
import React from "react";
|
|
17
16
|
import { DEFAULT_EDGE_MODELS, DEFAULT_OLLAMA_MODELS } from "@dxos/ai";
|
|
18
17
|
import { Input, Select, useTranslation } from "@dxos/react-ui";
|
|
19
|
-
import {
|
|
18
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
20
19
|
var DEFAULT_VALUE = "__default";
|
|
21
20
|
var LLM_PROVIDER_LABELS = {
|
|
22
21
|
edge: "DXOS",
|
|
@@ -25,11 +24,11 @@ var LLM_PROVIDER_LABELS = {
|
|
|
25
24
|
};
|
|
26
25
|
var AssistantSettings = ({ settings, onSettingsChange }) => {
|
|
27
26
|
const { t } = useTranslation(meta.id);
|
|
28
|
-
return /* @__PURE__ */ React.createElement(
|
|
27
|
+
return /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
29
28
|
title: t("settings title", {
|
|
30
29
|
ns: meta.id
|
|
31
30
|
})
|
|
32
|
-
}, /* @__PURE__ */ React.createElement(
|
|
31
|
+
}, /* @__PURE__ */ React.createElement(Settings.Group, null, /* @__PURE__ */ React.createElement(Settings.ItemInput, {
|
|
33
32
|
title: t("settings custom prompts label")
|
|
34
33
|
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
35
34
|
checked: !!settings.customPrompts,
|
|
@@ -37,7 +36,7 @@ var AssistantSettings = ({ settings, onSettingsChange }) => {
|
|
|
37
36
|
...s,
|
|
38
37
|
customPrompts: checked
|
|
39
38
|
}))
|
|
40
|
-
})), /* @__PURE__ */ React.createElement(
|
|
39
|
+
})), /* @__PURE__ */ React.createElement(Settings.ItemInput, {
|
|
41
40
|
title: t("settings llm provider label")
|
|
42
41
|
}, /* @__PURE__ */ React.createElement(Select.Root, {
|
|
43
42
|
value: settings.llmProvider ?? "edge",
|
|
@@ -54,7 +53,7 @@ var AssistantSettings = ({ settings, onSettingsChange }) => {
|
|
|
54
53
|
}, t("settings default label")), LLM_PROVIDERS.map((model) => /* @__PURE__ */ React.createElement(Select.Option, {
|
|
55
54
|
key: model,
|
|
56
55
|
value: model
|
|
57
|
-
}, LLM_PROVIDER_LABELS[model]))), /* @__PURE__ */ React.createElement(Select.Arrow, null))))), /* @__PURE__ */ React.createElement(
|
|
56
|
+
}, LLM_PROVIDER_LABELS[model]))), /* @__PURE__ */ React.createElement(Select.Arrow, null))))), /* @__PURE__ */ React.createElement(Settings.ItemInput, {
|
|
58
57
|
title: t("settings edge llm model label")
|
|
59
58
|
}, /* @__PURE__ */ React.createElement(Select.Root, {
|
|
60
59
|
value: settings.edgeModel ?? DEFAULT_VALUE,
|
|
@@ -71,7 +70,7 @@ var AssistantSettings = ({ settings, onSettingsChange }) => {
|
|
|
71
70
|
}, t("settings default label")), DEFAULT_EDGE_MODELS.map((model) => /* @__PURE__ */ React.createElement(Select.Option, {
|
|
72
71
|
key: model,
|
|
73
72
|
value: model
|
|
74
|
-
}, model))), /* @__PURE__ */ React.createElement(Select.Arrow, null))))), /* @__PURE__ */ React.createElement(
|
|
73
|
+
}, model))), /* @__PURE__ */ React.createElement(Select.Arrow, null))))), /* @__PURE__ */ React.createElement(Settings.ItemInput, {
|
|
75
74
|
title: t("settings ollama llm model label")
|
|
76
75
|
}, /* @__PURE__ */ React.createElement(Select.Root, {
|
|
77
76
|
value: settings.ollamaModel ?? DEFAULT_VALUE,
|
|
@@ -93,16 +92,16 @@ var AssistantSettings = ({ settings, onSettingsChange }) => {
|
|
|
93
92
|
|
|
94
93
|
// src/hooks/useBlueprintRegistry.ts
|
|
95
94
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
95
|
+
import { useCapabilities } from "@dxos/app-framework/ui";
|
|
96
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
98
97
|
import { Blueprint } from "@dxos/blueprints";
|
|
99
98
|
import { Filter, Obj, Ref } from "@dxos/echo";
|
|
100
99
|
import { useQuery } from "@dxos/react-client/echo";
|
|
101
100
|
import { distinctBy } from "@dxos/util";
|
|
102
101
|
var useBlueprintRegistry = () => {
|
|
103
|
-
const
|
|
104
|
-
return useMemo(() => new Blueprint.Registry(
|
|
105
|
-
|
|
102
|
+
const blueprintDefinitions = useCapabilities(AppCapabilities.BlueprintDefinition);
|
|
103
|
+
return useMemo(() => new Blueprint.Registry(blueprintDefinitions.map((blueprint) => blueprint.make())), [
|
|
104
|
+
blueprintDefinitions
|
|
106
105
|
]);
|
|
107
106
|
};
|
|
108
107
|
var useBlueprints = ({ blueprintRegistry, db }) => {
|
|
@@ -219,7 +218,7 @@ var useChatProcessor = ({ space, chat, preset, services, blueprintRegistry, sett
|
|
|
219
218
|
settings
|
|
220
219
|
}, {
|
|
221
220
|
F: __dxlog_file,
|
|
222
|
-
L:
|
|
221
|
+
L: 69,
|
|
223
222
|
S: void 0,
|
|
224
223
|
C: (f, a) => f(...a)
|
|
225
224
|
});
|
|
@@ -240,7 +239,7 @@ var useChatProcessor = ({ space, chat, preset, services, blueprintRegistry, sett
|
|
|
240
239
|
// src/hooks/useChatServices.ts
|
|
241
240
|
import * as Effect from "effect/Effect";
|
|
242
241
|
import { useMemo as useMemo3 } from "react";
|
|
243
|
-
import { useCapability } from "@dxos/app-framework/
|
|
242
|
+
import { useCapability } from "@dxos/app-framework/ui";
|
|
244
243
|
import { TracingService } from "@dxos/functions";
|
|
245
244
|
import { TracingServiceExt } from "@dxos/functions-runtime";
|
|
246
245
|
import { AutomationCapabilities } from "@dxos/plugin-automation";
|
|
@@ -261,12 +260,13 @@ var useChatServices = ({ id, chat }) => {
|
|
|
261
260
|
// src/hooks/useChatToolbarActions.ts
|
|
262
261
|
import { Atom } from "@effect-atom/atom-react";
|
|
263
262
|
import * as Effect2 from "effect/Effect";
|
|
264
|
-
import { useMemo as
|
|
265
|
-
import { useOperationInvoker } from "@dxos/app-framework/
|
|
266
|
-
import {
|
|
263
|
+
import { useMemo as useMemo11 } from "react";
|
|
264
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
265
|
+
import { Chat as Chat2 } from "@dxos/assistant-toolkit";
|
|
266
|
+
import { Filter as Filter6, Obj as Obj6, Query } from "@dxos/echo";
|
|
267
267
|
import { runAndForwardErrors } from "@dxos/effect";
|
|
268
268
|
import { invariant } from "@dxos/invariant";
|
|
269
|
-
import { useQuery as
|
|
269
|
+
import { useQuery as useQuery5 } from "@dxos/react-client/echo";
|
|
270
270
|
import { MenuBuilder, useMenuActions } from "@dxos/react-ui-menu";
|
|
271
271
|
|
|
272
272
|
// src/components/index.ts
|
|
@@ -279,11 +279,11 @@ import { useAtomValue } from "@effect-atom/atom-react";
|
|
|
279
279
|
import { createContext } from "@radix-ui/react-context";
|
|
280
280
|
import * as Array2 from "effect/Array";
|
|
281
281
|
import * as Option2 from "effect/Option";
|
|
282
|
-
import React10, { useCallback as useCallback7, useEffect as useEffect7, useMemo as useMemo9, useRef as useRef3, useState as
|
|
282
|
+
import React10, { useCallback as useCallback7, useEffect as useEffect7, useMemo as useMemo9, useRef as useRef3, useState as useState12 } from "react";
|
|
283
283
|
import { Event } from "@dxos/async";
|
|
284
|
-
import { Obj as Obj5 } from "@dxos/echo";
|
|
284
|
+
import { Filter as Filter4, Obj as Obj5 } from "@dxos/echo";
|
|
285
285
|
import { useVoiceInput } from "@dxos/plugin-transcription";
|
|
286
|
-
import {
|
|
286
|
+
import { useQuery as useQuery3 } from "@dxos/react-client/echo";
|
|
287
287
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
288
288
|
import { Input as Input2, useDynamicRef, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
289
289
|
import { ChatEditor } from "@dxos/react-ui-chat";
|
|
@@ -454,11 +454,8 @@ var usePresets = (online) => {
|
|
|
454
454
|
|
|
455
455
|
// src/hooks/useReferencesProvider.ts
|
|
456
456
|
import { useMemo as useMemo5 } from "react";
|
|
457
|
-
import { Common as Common2 } from "@dxos/app-framework";
|
|
458
|
-
import { useCapabilities as useCapabilities2 } from "@dxos/app-framework/react";
|
|
459
457
|
import { Filter as Filter2, Obj as Obj2 } from "@dxos/echo";
|
|
460
458
|
var useReferencesProvider = (space) => {
|
|
461
|
-
const blueprints = useCapabilities2(Common2.Capability.BlueprintDefinition);
|
|
462
459
|
return useMemo5(() => {
|
|
463
460
|
if (!space) {
|
|
464
461
|
return void 0;
|
|
@@ -480,8 +477,7 @@ var useReferencesProvider = (space) => {
|
|
|
480
477
|
}
|
|
481
478
|
};
|
|
482
479
|
}, [
|
|
483
|
-
space
|
|
484
|
-
blueprints
|
|
480
|
+
space
|
|
485
481
|
]);
|
|
486
482
|
};
|
|
487
483
|
var stringMatch = (query, label) => label.toLowerCase().startsWith(query.toLowerCase());
|
|
@@ -523,6 +519,14 @@ var ChatActions = ({ classNames, children, microphone, recording, processing, on
|
|
|
523
519
|
onTouchEnd: () => onEvent?.({
|
|
524
520
|
type: "record-stop"
|
|
525
521
|
})
|
|
522
|
+
}), /* @__PURE__ */ React2.createElement(IconButton, {
|
|
523
|
+
variant: "ghost",
|
|
524
|
+
icon: "ph--wrench--regular",
|
|
525
|
+
iconOnly: true,
|
|
526
|
+
label: t("debug button"),
|
|
527
|
+
onClick: () => onEvent?.({
|
|
528
|
+
type: "toggle-debug"
|
|
529
|
+
})
|
|
526
530
|
}));
|
|
527
531
|
};
|
|
528
532
|
|
|
@@ -792,7 +796,7 @@ var ChatStatusIndicator = ({ classNames, preset, processing, error, ...props })
|
|
|
792
796
|
};
|
|
793
797
|
|
|
794
798
|
// src/components/ChatThread/ChatThread.tsx
|
|
795
|
-
import React9, { forwardRef, useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo8 } from "react";
|
|
799
|
+
import React9, { forwardRef, useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo8, useState as useState11 } from "react";
|
|
796
800
|
import { PublicKey } from "@dxos/keys";
|
|
797
801
|
import { useForwardedRef } from "@dxos/react-ui";
|
|
798
802
|
import { MarkdownStream } from "@dxos/react-ui-components";
|
|
@@ -803,7 +807,7 @@ import { keyToFallback } from "@dxos/util";
|
|
|
803
807
|
import React8 from "react";
|
|
804
808
|
import { log as log2 } from "@dxos/log";
|
|
805
809
|
import { ToggleContainer as ToggleContainer2 } from "@dxos/react-ui-components";
|
|
806
|
-
import { PromptWidget, ReferenceWidget, SelectWidget, SuggestionWidget, SummaryWidget } from "@dxos/react-ui-components";
|
|
810
|
+
import { PromptWidget, ReasoningWidget, ReferenceWidget, SelectWidget, SuggestionWidget, SummaryWidget } from "@dxos/react-ui-components";
|
|
807
811
|
import { Json as Json2 } from "@dxos/react-ui-syntax-highlighter";
|
|
808
812
|
import { ContentBlock } from "@dxos/types";
|
|
809
813
|
import { getXmlTextChild } from "@dxos/ui-editor";
|
|
@@ -962,6 +966,13 @@ var componentRegistry = {
|
|
|
962
966
|
return text ? new PromptWidget(text) : null;
|
|
963
967
|
}
|
|
964
968
|
},
|
|
969
|
+
["reasoning"]: {
|
|
970
|
+
block: true,
|
|
971
|
+
factory: ({ children }) => {
|
|
972
|
+
const text = getXmlTextChild(children);
|
|
973
|
+
return text ? new ReasoningWidget(text) : null;
|
|
974
|
+
}
|
|
975
|
+
},
|
|
965
976
|
["reference"]: {
|
|
966
977
|
block: false,
|
|
967
978
|
factory: ({ children, ref }) => {
|
|
@@ -1025,7 +1036,7 @@ var blockToMarkdownImpl = (context, message, block) => {
|
|
|
1025
1036
|
block: JSON.stringify(block)
|
|
1026
1037
|
}, {
|
|
1027
1038
|
F: __dxlog_file2,
|
|
1028
|
-
L:
|
|
1039
|
+
L: 133,
|
|
1029
1040
|
S: void 0,
|
|
1030
1041
|
C: (f, a) => f(...a)
|
|
1031
1042
|
});
|
|
@@ -1066,7 +1077,9 @@ var blockToMarkdownImpl = (context, message, block) => {
|
|
|
1066
1077
|
return `<toolCall id="${block.toolCallId}" />`;
|
|
1067
1078
|
}
|
|
1068
1079
|
case "toolResult": {
|
|
1069
|
-
context.updateWidget(block.toolCallId, ({ blocks = [] }
|
|
1080
|
+
context.updateWidget(block.toolCallId, ({ blocks = [] } = {
|
|
1081
|
+
blocks: []
|
|
1082
|
+
}) => ({
|
|
1070
1083
|
blocks: [
|
|
1071
1084
|
...blocks,
|
|
1072
1085
|
block
|
|
@@ -1077,6 +1090,13 @@ var blockToMarkdownImpl = (context, message, block) => {
|
|
|
1077
1090
|
case "summary": {
|
|
1078
1091
|
return `<summary>${ContentBlock.createSummaryMessage(block)}</summary>`;
|
|
1079
1092
|
}
|
|
1093
|
+
case "reasoning": {
|
|
1094
|
+
const text = block.reasoningText ?? block.redactedText;
|
|
1095
|
+
if (!text) {
|
|
1096
|
+
return;
|
|
1097
|
+
}
|
|
1098
|
+
return `<reasoning>${text.replace(/\n/g, " ").trim()}</reasoning>`;
|
|
1099
|
+
}
|
|
1080
1100
|
default: {
|
|
1081
1101
|
return `<json id="${message.id}">
|
|
1082
1102
|
${JSON.stringify(block)}
|
|
@@ -1134,6 +1154,10 @@ var MessageSyncer = class {
|
|
|
1134
1154
|
* Syncs messages with the editor.
|
|
1135
1155
|
*/
|
|
1136
1156
|
append(messages, flush = false) {
|
|
1157
|
+
messages = messages.map((message) => ({
|
|
1158
|
+
...message,
|
|
1159
|
+
blocks: message.blocks.filter((block) => !block.pending || block._tag === "text")
|
|
1160
|
+
}));
|
|
1137
1161
|
if (this._initialMessageId !== messages[0]?.id) {
|
|
1138
1162
|
this.reset();
|
|
1139
1163
|
this._initialMessageId = messages[0]?.id;
|
|
@@ -1165,18 +1189,6 @@ var MessageSyncer = class {
|
|
|
1165
1189
|
}
|
|
1166
1190
|
}
|
|
1167
1191
|
process(messages, append) {
|
|
1168
|
-
log3("sync", {
|
|
1169
|
-
doc: this._model.view?.state.doc.length,
|
|
1170
|
-
messages: messages.map((message) => message.blocks.length),
|
|
1171
|
-
currentMessageIndex: this._currentMessageIndex,
|
|
1172
|
-
currentBlockIndex: this._currentBlockIndex,
|
|
1173
|
-
currentBlockContent: this._currentBlockContent
|
|
1174
|
-
}, {
|
|
1175
|
-
F: __dxlog_file3,
|
|
1176
|
-
L: 111,
|
|
1177
|
-
S: this,
|
|
1178
|
-
C: (f, a) => f(...a)
|
|
1179
|
-
});
|
|
1180
1192
|
let i = this._currentMessageIndex;
|
|
1181
1193
|
for (const message of messages.slice(this._currentMessageIndex)) {
|
|
1182
1194
|
if (i > this._currentMessageIndex) {
|
|
@@ -1194,16 +1206,6 @@ var MessageSyncer = class {
|
|
|
1194
1206
|
} else {
|
|
1195
1207
|
content = currentBlockContent;
|
|
1196
1208
|
}
|
|
1197
|
-
log3("append", {
|
|
1198
|
-
message: i,
|
|
1199
|
-
block: j,
|
|
1200
|
-
content
|
|
1201
|
-
}, {
|
|
1202
|
-
F: __dxlog_file3,
|
|
1203
|
-
L: 138,
|
|
1204
|
-
S: this,
|
|
1205
|
-
C: (f, a) => f(...a)
|
|
1206
|
-
});
|
|
1207
1209
|
this._currentBlockContent = currentBlockContent;
|
|
1208
1210
|
append(content);
|
|
1209
1211
|
}
|
|
@@ -1223,7 +1225,13 @@ var MessageSyncer = class {
|
|
|
1223
1225
|
// src/components/ChatThread/ChatThread.tsx
|
|
1224
1226
|
var ChatThread = /* @__PURE__ */ forwardRef(({ classNames, identity, messages = [], error, cursor = false, fadeIn = true, debug = false, onEvent }, forwardedRef) => {
|
|
1225
1227
|
const controllerRef = useForwardedRef(forwardedRef);
|
|
1226
|
-
const controller =
|
|
1228
|
+
const [controller, setController] = useState11(null);
|
|
1229
|
+
const refCallback = useCallback6((node) => {
|
|
1230
|
+
controllerRef.current = node;
|
|
1231
|
+
setController(node);
|
|
1232
|
+
}, [
|
|
1233
|
+
controllerRef
|
|
1234
|
+
]);
|
|
1227
1235
|
const userHue = useMemo8(() => identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue, [
|
|
1228
1236
|
identity
|
|
1229
1237
|
]);
|
|
@@ -1265,7 +1273,7 @@ var ChatThread = /* @__PURE__ */ forwardRef(({ classNames, identity, messages =
|
|
|
1265
1273
|
"--user-fill": `var(--dx-${userHue}Fill)`
|
|
1266
1274
|
}
|
|
1267
1275
|
}, /* @__PURE__ */ React9.createElement(MarkdownStream, {
|
|
1268
|
-
ref:
|
|
1276
|
+
ref: refCallback,
|
|
1269
1277
|
registry: componentRegistry,
|
|
1270
1278
|
cursor,
|
|
1271
1279
|
fadeIn,
|
|
@@ -1277,19 +1285,18 @@ var ChatThread = /* @__PURE__ */ forwardRef(({ classNames, identity, messages =
|
|
|
1277
1285
|
// src/components/Chat/Chat.tsx
|
|
1278
1286
|
var [ChatContextProvider, useChatContext] = createContext("Chat");
|
|
1279
1287
|
var ChatRoot = ({ children, chat, processor, onEvent, ...props }) => {
|
|
1280
|
-
const [debug, setDebug] =
|
|
1288
|
+
const [debug, setDebug] = useState12(false);
|
|
1281
1289
|
const pending = useAtomValue(processor.messages);
|
|
1282
1290
|
const streaming = useAtomValue(processor.streaming);
|
|
1283
1291
|
const lastPrompt = useRef3(void 0);
|
|
1284
|
-
const
|
|
1292
|
+
const storedMessages = useQuery3(chat?.queue?.target, Filter4.type(Message.Message));
|
|
1285
1293
|
const messages = useMemo9(() => {
|
|
1286
|
-
const queueMessages = queue?.objects?.filter(Obj5.instanceOf(Message.Message)) ?? [];
|
|
1287
1294
|
return Array2.dedupeWith([
|
|
1288
|
-
...
|
|
1295
|
+
...storedMessages,
|
|
1289
1296
|
...pending
|
|
1290
1297
|
], ({ id: a }, { id: b }) => a === b);
|
|
1291
1298
|
}, [
|
|
1292
|
-
|
|
1299
|
+
storedMessages,
|
|
1293
1300
|
pending
|
|
1294
1301
|
]);
|
|
1295
1302
|
const event = useMemo9(() => new Event(), []);
|
|
@@ -1298,6 +1305,22 @@ var ChatRoot = ({ children, chat, processor, onEvent, ...props }) => {
|
|
|
1298
1305
|
switch (ev.type) {
|
|
1299
1306
|
case "toggle-debug": {
|
|
1300
1307
|
setDebug((current) => !current);
|
|
1308
|
+
queueMicrotask(async () => {
|
|
1309
|
+
const objects = processor.context.getObjects();
|
|
1310
|
+
const blueprints = processor.context.getBlueprints();
|
|
1311
|
+
const tools = await processor.getTools();
|
|
1312
|
+
const system = await processor.getSystemPrompt();
|
|
1313
|
+
console.log("Chat processor state:", {
|
|
1314
|
+
objects,
|
|
1315
|
+
blueprints
|
|
1316
|
+
});
|
|
1317
|
+
console.log(`
|
|
1318
|
+
==== System Prompt ====
|
|
1319
|
+
${system}
|
|
1320
|
+
==== Tools ====
|
|
1321
|
+
${Object.values(tools).map((tool) => JSON.stringify(tool, null, 2)).join("\n")}
|
|
1322
|
+
`);
|
|
1323
|
+
});
|
|
1301
1324
|
break;
|
|
1302
1325
|
}
|
|
1303
1326
|
case "submit": {
|
|
@@ -1349,14 +1372,17 @@ var ChatRoot = ({ children, chat, processor, onEvent, ...props }) => {
|
|
|
1349
1372
|
}, children);
|
|
1350
1373
|
};
|
|
1351
1374
|
ChatRoot.displayName = "Chat.Root";
|
|
1375
|
+
var CHAT_VIEWPORT_NAME = "Chat.Viewport";
|
|
1352
1376
|
var ChatViewport = ({ classNames, children }) => {
|
|
1353
1377
|
return /* @__PURE__ */ React10.createElement("div", {
|
|
1354
1378
|
role: "none",
|
|
1355
1379
|
className: mx5("flex flex-col bs-full is-full", classNames)
|
|
1356
1380
|
}, children);
|
|
1357
1381
|
};
|
|
1382
|
+
ChatViewport.displayName = CHAT_VIEWPORT_NAME;
|
|
1383
|
+
var CHAT_THREAD_NAME = "Chat.Thread";
|
|
1358
1384
|
var ChatThread2 = (props) => {
|
|
1359
|
-
const { debug, event, messages, processor } = useChatContext(
|
|
1385
|
+
const { debug, event, messages, processor } = useChatContext(CHAT_THREAD_NAME);
|
|
1360
1386
|
const identity = useIdentity();
|
|
1361
1387
|
const error = useAtomValue(processor.error).pipe(Option2.getOrUndefined);
|
|
1362
1388
|
const controllerRef = useRef3(null);
|
|
@@ -1396,16 +1422,17 @@ var ChatThread2 = (props) => {
|
|
|
1396
1422
|
ref: controllerRef
|
|
1397
1423
|
});
|
|
1398
1424
|
};
|
|
1399
|
-
ChatThread2.displayName =
|
|
1425
|
+
ChatThread2.displayName = CHAT_THREAD_NAME;
|
|
1426
|
+
var CHAT_PROMPT_NAME = "Chat.Prompt";
|
|
1400
1427
|
var ChatPrompt = ({ classNames, outline, settings = true, placeholder, expandable, online, presets, preset, onPresetChange, onOnlineChange }) => {
|
|
1401
1428
|
const { t } = useTranslation6(meta.id);
|
|
1402
|
-
const { db, processor, event } = useChatContext(
|
|
1429
|
+
const { db, processor, event } = useChatContext(CHAT_PROMPT_NAME);
|
|
1403
1430
|
const error = useAtomValue(processor.error).pipe(Option2.getOrUndefined);
|
|
1404
1431
|
const streaming = useAtomValue(processor.streaming);
|
|
1405
1432
|
const active = useAtomValue(processor.active);
|
|
1406
1433
|
const activeRef = useDynamicRef(active);
|
|
1407
1434
|
const editorRef = useRef3(null);
|
|
1408
|
-
const [recordingState, setRecordingState] =
|
|
1435
|
+
const [recordingState, setRecordingState] = useState12(false);
|
|
1409
1436
|
useEffect7(() => {
|
|
1410
1437
|
return event.on((event2) => {
|
|
1411
1438
|
switch (event2.type) {
|
|
@@ -1549,9 +1576,10 @@ var ChatPrompt = ({ classNames, outline, settings = true, placeholder, expandabl
|
|
|
1549
1576
|
onCheckedChange: onOnlineChange
|
|
1550
1577
|
})))));
|
|
1551
1578
|
};
|
|
1552
|
-
ChatPrompt.displayName =
|
|
1579
|
+
ChatPrompt.displayName = CHAT_PROMPT_NAME;
|
|
1580
|
+
var CHAT_TOOLBAR_NAME = "Chat.Toolbar";
|
|
1553
1581
|
var ChatToolbar = ({ classNames, companionTo }) => {
|
|
1554
|
-
const { chat } = useChatContext(
|
|
1582
|
+
const { chat } = useChatContext(CHAT_TOOLBAR_NAME);
|
|
1555
1583
|
const menu = useChatToolbarActions({
|
|
1556
1584
|
chat,
|
|
1557
1585
|
companionTo
|
|
@@ -1564,7 +1592,7 @@ var ChatToolbar = ({ classNames, companionTo }) => {
|
|
|
1564
1592
|
textBlockWidth: true
|
|
1565
1593
|
}));
|
|
1566
1594
|
};
|
|
1567
|
-
ChatToolbar.displayName =
|
|
1595
|
+
ChatToolbar.displayName = CHAT_TOOLBAR_NAME;
|
|
1568
1596
|
var Chat = {
|
|
1569
1597
|
Root: ChatRoot,
|
|
1570
1598
|
Viewport: ChatViewport,
|
|
@@ -1574,17 +1602,19 @@ var Chat = {
|
|
|
1574
1602
|
};
|
|
1575
1603
|
|
|
1576
1604
|
// src/components/Toolbox/Toolbox.tsx
|
|
1577
|
-
import React11, { Fragment, useEffect as useEffect8, useState as
|
|
1605
|
+
import React11, { Fragment, useEffect as useEffect8, useState as useState13 } from "react";
|
|
1578
1606
|
import { Function } from "@dxos/functions";
|
|
1579
1607
|
import { log as log4 } from "@dxos/log";
|
|
1580
|
-
import { Filter as
|
|
1581
|
-
import {
|
|
1608
|
+
import { Filter as Filter5, useQuery as useQuery4 } from "@dxos/react-client/echo";
|
|
1609
|
+
import { ScrollArea } from "@dxos/react-ui";
|
|
1582
1610
|
import { mx as mx6 } from "@dxos/ui-theme";
|
|
1583
1611
|
var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/components/Toolbox/Toolbox.tsx";
|
|
1584
1612
|
var Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }) => {
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1613
|
+
return /* @__PURE__ */ React11.createElement(ScrollArea.Root, {
|
|
1614
|
+
thin: true,
|
|
1615
|
+
orientation: "vertical"
|
|
1616
|
+
}, /* @__PURE__ */ React11.createElement(ScrollArea.Viewport, {
|
|
1617
|
+
classNames
|
|
1588
1618
|
}, blueprints && blueprints.length > 0 && /* @__PURE__ */ React11.createElement(Section, {
|
|
1589
1619
|
title: "Blueprints",
|
|
1590
1620
|
items: blueprints.map(({ name, description, tools }) => ({
|
|
@@ -1615,7 +1645,7 @@ var Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }
|
|
|
1615
1645
|
name,
|
|
1616
1646
|
description
|
|
1617
1647
|
}))
|
|
1618
|
-
}));
|
|
1648
|
+
})));
|
|
1619
1649
|
};
|
|
1620
1650
|
var Section = ({ title, items, striped }) => {
|
|
1621
1651
|
const stripeClassNames = "odd:bg-neutral-50 dark:odd:bg-neutral-800";
|
|
@@ -1643,14 +1673,14 @@ var Section = ({ title, items, striped }) => {
|
|
|
1643
1673
|
}, description2)))))));
|
|
1644
1674
|
};
|
|
1645
1675
|
var ToolboxContainer = ({ classNames, db, processor }) => {
|
|
1646
|
-
const services =
|
|
1647
|
-
const [serviceTools, setServiceTools] =
|
|
1676
|
+
const services = useQuery4(db, Filter5.type(ServiceType));
|
|
1677
|
+
const [serviceTools, setServiceTools] = useState13([]);
|
|
1648
1678
|
useEffect8(() => {
|
|
1649
1679
|
log4("creating service tools...", {
|
|
1650
1680
|
services: services.length
|
|
1651
1681
|
}, {
|
|
1652
1682
|
F: __dxlog_file4,
|
|
1653
|
-
L:
|
|
1683
|
+
L: 115,
|
|
1654
1684
|
S: void 0,
|
|
1655
1685
|
C: (f, a) => f(...a)
|
|
1656
1686
|
});
|
|
@@ -1659,7 +1689,7 @@ var ToolboxContainer = ({ classNames, db, processor }) => {
|
|
|
1659
1689
|
}, [
|
|
1660
1690
|
services
|
|
1661
1691
|
]);
|
|
1662
|
-
const functions =
|
|
1692
|
+
const functions = useQuery4(db, Filter5.type(Function.Function));
|
|
1663
1693
|
return /* @__PURE__ */ React11.createElement(Toolbox, {
|
|
1664
1694
|
classNames,
|
|
1665
1695
|
blueprints: processor?.context.getBlueprints(),
|
|
@@ -1671,21 +1701,125 @@ var safeToolId = (name) => {
|
|
|
1671
1701
|
return name.split("_").pop();
|
|
1672
1702
|
};
|
|
1673
1703
|
|
|
1704
|
+
// src/components/TriggerStatus/TriggerStatus.tsx
|
|
1705
|
+
import React12, { useMemo as useMemo10 } from "react";
|
|
1706
|
+
import { useCapability as useCapability2 } from "@dxos/app-framework/ui";
|
|
1707
|
+
import { useLayout } from "@dxos/app-toolkit/ui";
|
|
1708
|
+
import { useTriggerRuntimeControls } from "@dxos/plugin-automation";
|
|
1709
|
+
import { ClientCapabilities } from "@dxos/plugin-client/types";
|
|
1710
|
+
import { StatusBar } from "@dxos/plugin-status-bar";
|
|
1711
|
+
import { parseId } from "@dxos/react-client/echo";
|
|
1712
|
+
import { Icon, Input as Input3, Popover as Popover2, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1713
|
+
import { Settings as Settings2 } from "@dxos/react-ui-form";
|
|
1714
|
+
import { mx as mx7 } from "@dxos/ui-theme";
|
|
1715
|
+
var getIcon = (state) => {
|
|
1716
|
+
switch (state) {
|
|
1717
|
+
case "disabled":
|
|
1718
|
+
return "ph--lightning-slash--regular";
|
|
1719
|
+
case "idle":
|
|
1720
|
+
return "ph--lightning--regular";
|
|
1721
|
+
case "running":
|
|
1722
|
+
return "ph--lightning--fill";
|
|
1723
|
+
case "error":
|
|
1724
|
+
return "ph--warning--regular";
|
|
1725
|
+
}
|
|
1726
|
+
};
|
|
1727
|
+
var getIconClassNames = (state) => {
|
|
1728
|
+
switch (state) {
|
|
1729
|
+
case "running":
|
|
1730
|
+
return "animate-pulse text-accentText";
|
|
1731
|
+
case "error":
|
|
1732
|
+
return "text-errorText";
|
|
1733
|
+
default:
|
|
1734
|
+
return void 0;
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
var useCurrentSpace = () => {
|
|
1738
|
+
const layout = useLayout();
|
|
1739
|
+
const client = useCapability2(ClientCapabilities.Client);
|
|
1740
|
+
const { spaceId } = parseId(layout.workspace);
|
|
1741
|
+
const space = spaceId ? client.spaces.get(spaceId) : void 0;
|
|
1742
|
+
return space;
|
|
1743
|
+
};
|
|
1744
|
+
var TriggerStatus = () => {
|
|
1745
|
+
const space = useCurrentSpace();
|
|
1746
|
+
const db = space?.db;
|
|
1747
|
+
const { state, start, stop } = useTriggerRuntimeControls(db);
|
|
1748
|
+
const isRunning = state?.enabled ?? false;
|
|
1749
|
+
const triggerState = useMemo10(() => {
|
|
1750
|
+
if (!isRunning) {
|
|
1751
|
+
return "disabled";
|
|
1752
|
+
}
|
|
1753
|
+
const hasPending = state?.invocations.some((invocation) => invocation.result === null);
|
|
1754
|
+
if (hasPending) {
|
|
1755
|
+
return "running";
|
|
1756
|
+
}
|
|
1757
|
+
const lastInvocation = state?.invocations.at(-1);
|
|
1758
|
+
if (lastInvocation?.result?._tag === "Failure") {
|
|
1759
|
+
return "error";
|
|
1760
|
+
}
|
|
1761
|
+
return "idle";
|
|
1762
|
+
}, [
|
|
1763
|
+
isRunning,
|
|
1764
|
+
state?.invocations
|
|
1765
|
+
]);
|
|
1766
|
+
const { t } = useTranslation7(meta.id);
|
|
1767
|
+
const title = t(`trigger status ${triggerState} label`);
|
|
1768
|
+
const icon = /* @__PURE__ */ React12.createElement(Icon, {
|
|
1769
|
+
icon: getIcon(triggerState),
|
|
1770
|
+
classNames: getIconClassNames(triggerState)
|
|
1771
|
+
});
|
|
1772
|
+
return /* @__PURE__ */ React12.createElement(Popover2.Root, null, /* @__PURE__ */ React12.createElement(Popover2.Trigger, {
|
|
1773
|
+
asChild: true
|
|
1774
|
+
}, /* @__PURE__ */ React12.createElement(StatusBar.Item, {
|
|
1775
|
+
title
|
|
1776
|
+
}, icon)), /* @__PURE__ */ React12.createElement(Popover2.Portal, null, /* @__PURE__ */ React12.createElement(Popover2.Content, null, /* @__PURE__ */ React12.createElement(TriggerStatusPopover, {
|
|
1777
|
+
isRunning,
|
|
1778
|
+
state: triggerState,
|
|
1779
|
+
currentFunctionName: state?.invocations.at(-1)?.function?.name ?? state?.invocations.at(-1)?.function?.key,
|
|
1780
|
+
lastInvocation: state?.invocations.at(-1),
|
|
1781
|
+
onToggle: isRunning ? stop : start
|
|
1782
|
+
}), /* @__PURE__ */ React12.createElement(Popover2.Arrow, null))));
|
|
1783
|
+
};
|
|
1784
|
+
var TriggerStatusPopover = ({ isRunning, state, currentFunctionName, lastInvocation, onToggle }) => {
|
|
1785
|
+
const { t } = useTranslation7(meta.id);
|
|
1786
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1787
|
+
className: "min-is-[240px] p-2 space-y-3"
|
|
1788
|
+
}, /* @__PURE__ */ React12.createElement(Settings2.ItemInput, {
|
|
1789
|
+
title: t("trigger runtime label"),
|
|
1790
|
+
description: t("trigger runtime description")
|
|
1791
|
+
}, /* @__PURE__ */ React12.createElement(Input3.Switch, {
|
|
1792
|
+
classNames: "justify-self-end",
|
|
1793
|
+
checked: isRunning,
|
|
1794
|
+
onCheckedChange: onToggle
|
|
1795
|
+
})), /* @__PURE__ */ React12.createElement("div", {
|
|
1796
|
+
className: "flex items-center gap-2 pt-2 border-t border-separator"
|
|
1797
|
+
}, /* @__PURE__ */ React12.createElement(Icon, {
|
|
1798
|
+
icon: getIcon(state),
|
|
1799
|
+
classNames: mx7(getIconClassNames(state), "shrink-0")
|
|
1800
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
1801
|
+
className: "text-sm"
|
|
1802
|
+
}, t(`trigger status ${state} label`)), currentFunctionName && state === "running" && /* @__PURE__ */ React12.createElement("span", {
|
|
1803
|
+
className: "text-xs text-description"
|
|
1804
|
+
}, currentFunctionName)));
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1674
1807
|
// src/components/index.ts
|
|
1675
|
-
var BlueprintArticle = lazy(() => import("./BlueprintArticle-
|
|
1676
|
-
var ChatCompanion = lazy(() => import("./ChatCompanion-
|
|
1677
|
-
var ChatContainer = lazy(() => import("./ChatContainer-
|
|
1678
|
-
var ChatDialog = lazy(() => import("./ChatDialog-
|
|
1679
|
-
var
|
|
1808
|
+
var BlueprintArticle = lazy(() => import("./BlueprintArticle-6SP2ZWJ2.mjs"));
|
|
1809
|
+
var ChatCompanion = lazy(() => import("./ChatCompanion-KGPU4DLI.mjs"));
|
|
1810
|
+
var ChatContainer = lazy(() => import("./ChatContainer-IHPTKMDK.mjs"));
|
|
1811
|
+
var ChatDialog = lazy(() => import("./ChatDialog-VALCOM3W.mjs"));
|
|
1812
|
+
var InitiativeContainer = lazy(() => import("./InitiativeContainer-LQHJLTPE.mjs"));
|
|
1813
|
+
var PromptArticle = lazy(() => import("./PromptArticle-YJ5E2YYE.mjs"));
|
|
1680
1814
|
|
|
1681
1815
|
// src/hooks/useChatToolbarActions.ts
|
|
1682
1816
|
var __dxlog_file5 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/useChatToolbarActions.ts";
|
|
1683
1817
|
var useChatToolbarActions = ({ chat, companionTo }) => {
|
|
1684
1818
|
const { invoke } = useOperationInvoker();
|
|
1685
1819
|
const { db } = useChatContext("useChatToolbarActions");
|
|
1686
|
-
const query = companionTo ? Query.select(
|
|
1687
|
-
const chats =
|
|
1688
|
-
return useMenuActions(
|
|
1820
|
+
const query = companionTo ? Query.select(Filter6.id(companionTo.id)).targetOf(Chat2.CompanionTo).source() : Query.select(Filter6.nothing());
|
|
1821
|
+
const chats = useQuery5(db, query);
|
|
1822
|
+
return useMenuActions(useMemo11(() => {
|
|
1689
1823
|
return Atom.make(() => {
|
|
1690
1824
|
const builder = MenuBuilder.make().root({
|
|
1691
1825
|
label: [
|
|
@@ -1707,7 +1841,7 @@ var useChatToolbarActions = ({ chat, companionTo }) => {
|
|
|
1707
1841
|
}, () => {
|
|
1708
1842
|
invariant(companionTo, void 0, {
|
|
1709
1843
|
F: __dxlog_file5,
|
|
1710
|
-
L:
|
|
1844
|
+
L: 53,
|
|
1711
1845
|
S: void 0,
|
|
1712
1846
|
A: [
|
|
1713
1847
|
"companionTo",
|
|
@@ -1731,7 +1865,7 @@ var useChatToolbarActions = ({ chat, companionTo }) => {
|
|
|
1731
1865
|
}, () => Effect2.gen(function* () {
|
|
1732
1866
|
invariant(chat, void 0, {
|
|
1733
1867
|
F: __dxlog_file5,
|
|
1734
|
-
L:
|
|
1868
|
+
L: 70,
|
|
1735
1869
|
S: this,
|
|
1736
1870
|
A: [
|
|
1737
1871
|
"chat",
|
|
@@ -1770,13 +1904,13 @@ var useChatToolbarActions = ({ chat, companionTo }) => {
|
|
|
1770
1904
|
label: Obj6.getLabel(chat2) ?? [
|
|
1771
1905
|
"object name placeholder",
|
|
1772
1906
|
{
|
|
1773
|
-
ns:
|
|
1907
|
+
ns: Chat2.Chat.typename
|
|
1774
1908
|
}
|
|
1775
1909
|
]
|
|
1776
1910
|
}, () => Effect2.gen(function* () {
|
|
1777
1911
|
invariant(companionTo, void 0, {
|
|
1778
1912
|
F: __dxlog_file5,
|
|
1779
|
-
L:
|
|
1913
|
+
L: 106,
|
|
1780
1914
|
S: this,
|
|
1781
1915
|
A: [
|
|
1782
1916
|
"companionTo",
|
|
@@ -1823,10 +1957,12 @@ export {
|
|
|
1823
1957
|
Chat,
|
|
1824
1958
|
Toolbox,
|
|
1825
1959
|
ToolboxContainer,
|
|
1960
|
+
TriggerStatus,
|
|
1826
1961
|
BlueprintArticle,
|
|
1827
1962
|
ChatCompanion,
|
|
1828
1963
|
ChatContainer,
|
|
1829
1964
|
ChatDialog,
|
|
1965
|
+
InitiativeContainer,
|
|
1830
1966
|
PromptArticle
|
|
1831
1967
|
};
|
|
1832
|
-
//# sourceMappingURL=chunk-
|
|
1968
|
+
//# sourceMappingURL=chunk-THZPCE3E.mjs.map
|