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