@dxos/plugin-assistant 0.8.4-main.3c1ae3b → 0.8.4-main.3eb6e50203
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-6SP2ZWJ2.mjs +30 -0
- package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs.map +7 -0
- package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs +200 -0
- package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs.map +7 -0
- package/dist/lib/browser/ChatContainer-QB37VONJ.mjs +73 -0
- package/dist/lib/browser/ChatContainer-QB37VONJ.mjs.map +7 -0
- package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs +85 -0
- package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs.map +7 -0
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs +266 -0
- package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs.map +7 -0
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs +52 -0
- package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs.map +7 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
- package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs +234 -0
- package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs +14 -0
- package/dist/lib/browser/blueprints/index.mjs +12 -0
- package/dist/lib/browser/chunk-3ETBCBMH.mjs +47 -0
- package/dist/lib/browser/chunk-3ETBCBMH.mjs.map +7 -0
- package/dist/lib/browser/chunk-6BVCG5SJ.mjs +230 -0
- package/dist/lib/browser/chunk-6BVCG5SJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7ZJIXQ2Y.mjs → chunk-DKQMSMBN.mjs} +54 -63
- package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WBG5PTSX.mjs → chunk-EXVT7D4B.mjs} +1 -1
- package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F6YX2HHA.mjs → chunk-IJYAKPEU.mjs} +45 -21
- package/dist/lib/browser/chunk-IJYAKPEU.mjs.map +7 -0
- package/dist/lib/browser/chunk-JA7PUZC7.mjs +1974 -0
- package/dist/lib/browser/chunk-JA7PUZC7.mjs.map +7 -0
- package/dist/lib/browser/chunk-POPBT2AQ.mjs +198 -0
- package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
- package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +205 -177
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +20 -0
- 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-2673CFJS.mjs +133 -0
- package/dist/lib/browser/operation-resolver-2673CFJS.mjs.map +7 -0
- package/dist/lib/browser/react-surface-T3FN4GVP.mjs +125 -0
- package/dist/lib/browser/react-surface-T3FN4GVP.mjs.map +7 -0
- package/dist/lib/browser/{repair-3MZXLUHO.mjs → repair-IRXDYF4R.mjs} +24 -17
- package/dist/lib/browser/repair-IRXDYF4R.mjs.map +7 -0
- package/dist/lib/browser/settings-XF6GKHCG.mjs +33 -0
- package/dist/lib/browser/settings-XF6GKHCG.mjs.map +7 -0
- package/dist/lib/browser/state-OYDPWLKA.mjs +26 -0
- package/dist/lib/browser/state-OYDPWLKA.mjs.map +7 -0
- 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 +8 -4
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs +31 -0
- package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +7 -0
- package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs +201 -0
- package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs.map +7 -0
- package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs +74 -0
- package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs.map +7 -0
- package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs +86 -0
- package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs.map +7 -0
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs +267 -0
- package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs.map +7 -0
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs +53 -0
- package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
- package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs +235 -0
- package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-S3DNWJFV.mjs → blueprint-definition-H3LFAEK2.mjs} +6 -4
- package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +13 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs +48 -0
- package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3XC7LQSO.mjs +1975 -0
- package/dist/lib/node-esm/chunk-3XC7LQSO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CKW4IYLY.mjs → chunk-75PHXBN3.mjs} +54 -63
- package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-F6LA7XNS.mjs +199 -0
- package/dist/lib/node-esm/chunk-F6LA7XNS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LB72WG6R.mjs +231 -0
- package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GWKWQSEQ.mjs → chunk-MJD5XWQV.mjs} +45 -21
- package/dist/lib/node-esm/chunk-MJD5XWQV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WE6KTH72.mjs → chunk-POWB2BPC.mjs} +1 -1
- package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +22 -0
- package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +205 -177
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +21 -0
- 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-2ZD2DXOU.mjs +134 -0
- package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-AOBQALOV.mjs → react-surface-T4VMCCKZ.mjs} +57 -32
- package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs.map +7 -0
- package/dist/lib/node-esm/{repair-RER5H7Y6.mjs → repair-DMI55PON.mjs} +24 -17
- package/dist/lib/node-esm/repair-DMI55PON.mjs.map +7 -0
- package/dist/lib/node-esm/settings-NGGZA7S7.mjs +34 -0
- package/dist/lib/node-esm/settings-NGGZA7S7.mjs.map +7 -0
- package/dist/lib/node-esm/state-VSCPGN7R.mjs +27 -0
- package/dist/lib/node-esm/state-VSCPGN7R.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs +20 -0
- package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -4
- package/dist/types/src/AssistantPlugin.d.ts +2 -1
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/assistant-blueprint.d.ts +11 -0
- package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +7 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts +6 -0
- package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
- package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +26 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +13 -0
- package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/index.d.ts +3 -0
- package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
- package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +15 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +18 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +6 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/BlueprintArticle.d.ts +2 -2
- package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +13 -11
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +1 -1
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +3 -3
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +8 -8
- 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/ChatPrompt/ChatOptions.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +2 -2
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +116 -2
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
- package/dist/types/src/components/InitiativeContainer.d.ts +9 -0
- package/dist/types/src/components/InitiativeContainer.d.ts.map +1 -0
- package/dist/types/src/components/PromptArticle.d.ts +2 -2
- package/dist/types/src/components/PromptArticle.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.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.d.ts +11 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +115 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +3 -3
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -5
- 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/Typewriter/AssistantToolbar.d.ts +12 -0
- package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
- package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
- package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
- package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
- package/dist/types/src/components/Typewriter/index.d.ts +2 -0
- package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +10 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +1 -1
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/object-list.d.ts +1 -1
- package/dist/types/src/functions/object-load.d.ts +1 -1
- package/dist/types/src/functions/object-load.d.ts.map +1 -1
- package/dist/types/src/functions/object-search.d.ts +10 -0
- package/dist/types/src/functions/object-search.d.ts.map +1 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
- 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 +5 -5
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatToolbarActions.d.ts +3 -3
- package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
- package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
- package/dist/types/src/hooks/useFilteredTypes.d.ts +2 -3
- package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/processor/processor.d.ts +13 -9
- 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/queue-logger.d.ts.map +1 -1
- package/dist/types/src/testing/test-services.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 +7 -32
- package/dist/types/src/types/Assistant.d.ts.map +1 -1
- package/dist/types/src/types/AssistantAction.d.ts +90 -122
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +33 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +11 -260
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +116 -93
- package/src/AssistantPlugin.tsx +104 -99
- package/src/blueprints/assistant-blueprint.ts +57 -0
- package/src/blueprints/index.ts +12 -0
- package/src/capabilities/ai-service/ai-service.ts +30 -0
- package/src/capabilities/ai-service/index.ts +7 -0
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +200 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +74 -0
- package/src/capabilities/blueprint-definition/index.ts +8 -0
- package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +33 -0
- package/src/capabilities/edge-model-resolver/index.ts +7 -0
- package/src/capabilities/index.ts +10 -15
- package/src/capabilities/local-model-resolver/index.ts +7 -0
- package/src/capabilities/local-model-resolver/local-model-resolver.ts +38 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +112 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +111 -0
- package/src/capabilities/repair/index.ts +7 -0
- package/src/capabilities/{repair.ts → repair/repair.ts} +24 -11
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +27 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +28 -20
- package/src/components/BlueprintArticle.tsx +5 -6
- package/src/components/Chat/Chat.tsx +104 -77
- package/src/components/Chat/events.ts +1 -1
- package/src/components/ChatCompanion.tsx +103 -43
- package/src/components/ChatContainer.tsx +30 -24
- package/src/components/ChatDialog.tsx +8 -8
- package/src/components/ChatProgress/ChatProgress.tsx +5 -19
- package/src/components/ChatPrompt/ChatActions.tsx +9 -1
- package/src/components/ChatPrompt/ChatOptions.tsx +62 -58
- package/src/components/ChatPrompt/ChatReferences.tsx +5 -6
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +9 -8
- package/src/components/ChatThread/ChatThread.tsx +14 -5
- package/src/components/ChatThread/Link.tsx +3 -3
- package/src/components/ChatThread/registry.tsx +1 -1
- package/src/components/ChatThread/sync.test.ts +13 -5
- package/src/components/ChatThread/sync.ts +8 -2
- package/src/components/InitiativeContainer.tsx +340 -0
- package/src/components/PromptArticle.tsx +9 -11
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -3
- package/src/components/TemplateEditor/TemplateEditor.tsx +7 -4
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -7
- package/src/components/TemplateEditor/TemplateForm.tsx +75 -28
- package/src/components/TemplateEditor/extensions/handlebars-extension.ts +10 -5
- package/src/components/ToolBlock/ToolBlock.tsx +6 -6
- package/src/components/Toolbox/Toolbox.stories.tsx +10 -11
- package/src/components/Toolbox/Toolbox.tsx +50 -52
- package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
- package/src/components/TriggerStatus/index.ts +5 -0
- package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
- package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
- package/src/components/Typewriter/Typewriter.tsx +54 -0
- package/src/components/Typewriter/assistant-extension.tsx +144 -0
- package/src/components/Typewriter/index.ts +5 -0
- package/src/components/index.ts +11 -2
- package/src/functions/index.ts +1 -1
- package/src/functions/object-list.ts +2 -2
- package/src/functions/object-load.ts +9 -11
- package/src/functions/object-search.ts +46 -0
- package/src/hooks/useBlueprintRegistry.ts +31 -21
- package/src/hooks/useChatProcessor.ts +7 -3
- package/src/hooks/useChatServices.ts +14 -18
- package/src/hooks/useChatToolbarActions.ts +27 -27
- package/src/hooks/useContextBinder.ts +4 -2
- package/src/hooks/useContextObjects.ts +13 -25
- package/src/hooks/useFilteredTypes.ts +6 -7
- package/src/hooks/useReferencesProvider.ts +4 -4
- package/src/index.ts +0 -1
- package/src/meta.ts +2 -2
- package/src/processor/processor.test.ts +8 -8
- package/src/processor/processor.ts +49 -25
- package/src/processor/update-name.ts +6 -4
- package/src/queue-logger.ts +4 -1
- package/src/testing/test-services.ts +8 -6
- package/src/translations.ts +23 -2
- package/src/types/Assistant.ts +4 -39
- package/src/types/AssistantAction.ts +61 -64
- package/src/types/capabilities.ts +27 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +6 -1
- package/src/types/service.ts +10 -7
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs +0 -36
- package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs.map +0 -7
- package/dist/lib/browser/ChatCompanion-U7VMDYO6.mjs +0 -159
- package/dist/lib/browser/ChatCompanion-U7VMDYO6.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-JXDZQ2EY.mjs +0 -79
- package/dist/lib/browser/ChatContainer-JXDZQ2EY.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-5NNGCRKJ.mjs +0 -90
- package/dist/lib/browser/ChatDialog-5NNGCRKJ.mjs.map +0 -7
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs +0 -59
- package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs.map +0 -7
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
- package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ADZRPJ3V.mjs +0 -199
- package/dist/lib/browser/app-graph-builder-ADZRPJ3V.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-7HPQPCL7.mjs +0 -12
- package/dist/lib/browser/chunk-5JZRYQZL.mjs +0 -229
- package/dist/lib/browser/chunk-5JZRYQZL.mjs.map +0 -7
- package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-F6YX2HHA.mjs.map +0 -7
- package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
- package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
- package/dist/lib/browser/chunk-SWEOO227.mjs +0 -1930
- package/dist/lib/browser/chunk-SWEOO227.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
- package/dist/lib/browser/chunk-YDSFERCV.mjs +0 -178
- package/dist/lib/browser/chunk-YDSFERCV.mjs.map +0 -7
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
- package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-Q7TX3MV7.mjs +0 -143
- package/dist/lib/browser/intent-resolver-Q7TX3MV7.mjs.map +0 -7
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
- package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VXXS6ZVC.mjs +0 -100
- package/dist/lib/browser/react-surface-VXXS6ZVC.mjs.map +0 -7
- package/dist/lib/browser/repair-3MZXLUHO.mjs.map +0 -7
- package/dist/lib/browser/settings-HD5WA24I.mjs +0 -23
- package/dist/lib/browser/settings-HD5WA24I.mjs.map +0 -7
- package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
- package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
- package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs +0 -37
- package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs.map +0 -7
- package/dist/lib/node-esm/ChatCompanion-O4T7PMMC.mjs +0 -160
- package/dist/lib/node-esm/ChatCompanion-O4T7PMMC.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-OWAZI6ZF.mjs +0 -80
- package/dist/lib/node-esm/ChatContainer-OWAZI6ZF.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-IBXH5FRI.mjs +0 -91
- package/dist/lib/node-esm/ChatDialog-IBXH5FRI.mjs.map +0 -7
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs +0 -60
- package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs.map +0 -7
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
- package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-26KXQ5ZY.mjs +0 -200
- package/dist/lib/node-esm/app-graph-builder-26KXQ5ZY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CKW4IYLY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs +0 -230
- package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GWKWQSEQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VGSP5WMV.mjs +0 -180
- package/dist/lib/node-esm/chunk-VGSP5WMV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
- package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZNSHGWE4.mjs +0 -1931
- package/dist/lib/node-esm/chunk-ZNSHGWE4.mjs.map +0 -7
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
- package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-LTKMN3YB.mjs +0 -144
- package/dist/lib/node-esm/intent-resolver-LTKMN3YB.mjs.map +0 -7
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
- package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-AOBQALOV.mjs.map +0 -7
- package/dist/lib/node-esm/repair-RER5H7Y6.mjs.map +0 -7
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs +0 -24
- package/dist/lib/node-esm/settings-YJQVKHH5.mjs.map +0 -7
- package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
- package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
- package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
- package/dist/types/src/capabilities/ai-service.d.ts +0 -4
- package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -10
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +0 -10
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/repair.d.ts +0 -4
- package/dist/types/src/capabilities/repair.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/toolkit.d.ts +0 -4
- package/dist/types/src/capabilities/toolkit.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/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/functions/analysis.d.ts +0 -5
- package/dist/types/src/functions/analysis.d.ts.map +0 -1
- package/src/capabilities/ai-service.ts +0 -27
- package/src/capabilities/app-graph-builder.ts +0 -208
- package/src/capabilities/blueprint-definition.ts +0 -66
- package/src/capabilities/capabilities.ts +0 -17
- package/src/capabilities/edge-model-resolver.ts +0 -25
- package/src/capabilities/intent-resolver.ts +0 -135
- package/src/capabilities/local-model-resolver.ts +0 -30
- package/src/capabilities/react-surface.tsx +0 -87
- package/src/capabilities/settings.ts +0 -19
- package/src/capabilities/state.ts +0 -22
- package/src/capabilities/toolkit.ts +0 -17
- package/src/components/ChatThread/reducers.ts +0 -151
- package/src/events.ts +0 -11
- package/src/functions/analysis.ts +0 -22
- /package/dist/lib/browser/{blueprint-definition-7HPQPCL7.mjs.map → blueprint-definition-YAGWYVCL.mjs.map} +0 -0
- /package/dist/lib/{node-esm/blueprint-definition-S3DNWJFV.mjs.map → browser/blueprints/index.mjs.map} +0 -0
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta } from '@storybook/react-vite';
|
|
6
|
-
import React, { useState } from 'react';
|
|
6
|
+
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { useClient } from '@dxos/react-client';
|
|
10
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
11
12
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
@@ -13,15 +14,15 @@ import { trim } from '@dxos/util';
|
|
|
13
14
|
|
|
14
15
|
import { translations } from '../../translations';
|
|
15
16
|
|
|
16
|
-
import { TemplateForm } from './TemplateForm';
|
|
17
|
+
import { type TemplateChangeCallback, TemplateForm } from './TemplateForm';
|
|
17
18
|
|
|
18
19
|
const TEMPLATE = trim`
|
|
19
20
|
You are a machine that is an expert chess player.
|
|
20
21
|
The move history of the current game is: {{history}}
|
|
21
22
|
If asked to suggest a move explain why it is a good move.
|
|
22
|
-
|
|
23
|
+
|
|
23
24
|
---
|
|
24
|
-
|
|
25
|
+
|
|
25
26
|
{{input}},
|
|
26
27
|
`;
|
|
27
28
|
|
|
@@ -38,9 +39,16 @@ const DefaultStory = () => {
|
|
|
38
39
|
);
|
|
39
40
|
});
|
|
40
41
|
|
|
42
|
+
const handleChange: TemplateChangeCallback = useCallback(
|
|
43
|
+
(mutate) => {
|
|
44
|
+
Obj.change(blueprint, (b) => mutate(b.instructions));
|
|
45
|
+
},
|
|
46
|
+
[blueprint],
|
|
47
|
+
);
|
|
48
|
+
|
|
41
49
|
return (
|
|
42
50
|
<div role='none' className='flex is-[40rem] border border-separator overflow-hidden'>
|
|
43
|
-
<TemplateForm id={blueprint.id} template={blueprint.instructions} />
|
|
51
|
+
<TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
|
|
44
52
|
</div>
|
|
45
53
|
);
|
|
46
54
|
};
|
|
@@ -50,8 +58,8 @@ const meta = {
|
|
|
50
58
|
component: TemplateForm,
|
|
51
59
|
render: DefaultStory,
|
|
52
60
|
decorators: [
|
|
53
|
-
withTheme,
|
|
54
|
-
withLayout({
|
|
61
|
+
withTheme(),
|
|
62
|
+
withLayout({ layout: 'column' }),
|
|
55
63
|
withClientProvider({
|
|
56
64
|
types: [Blueprint.Blueprint],
|
|
57
65
|
createIdentity: true,
|
|
@@ -3,27 +3,62 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import type * as Schema from 'effect/Schema';
|
|
6
|
-
import React, { Fragment, useEffect } from 'react';
|
|
6
|
+
import React, { Fragment, useCallback, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type Template } from '@dxos/blueprints';
|
|
9
|
+
import { type Obj } from '@dxos/echo';
|
|
9
10
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
10
|
-
import { attentionSurface, groupBorder, mx } from '@dxos/
|
|
11
|
+
import { attentionSurface, groupBorder, mx } from '@dxos/ui-theme';
|
|
11
12
|
import { isNonNullable } from '@dxos/util';
|
|
12
13
|
|
|
13
14
|
import { meta } from '../../meta';
|
|
14
15
|
|
|
15
16
|
import { TemplateEditor } from './TemplateEditor';
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Callback type for mutating template within a parent object's Obj.change context.
|
|
20
|
+
*/
|
|
21
|
+
export type TemplateChangeCallback = (mutate: (template: Obj.Mutable<Template.Template>) => void) => void;
|
|
22
|
+
|
|
17
23
|
export type TemplateFormProps = {
|
|
18
24
|
id: string;
|
|
19
25
|
template: Template.Template;
|
|
20
26
|
schema?: Schema.Schema<any, any, any>;
|
|
21
27
|
commandEditable?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback to mutate the template. Should wrap mutations in parent's Obj.change.
|
|
30
|
+
* If not provided, the component is read-only.
|
|
31
|
+
*/
|
|
32
|
+
onChange?: TemplateChangeCallback;
|
|
22
33
|
};
|
|
23
34
|
|
|
24
|
-
export const TemplateForm = ({ id, template, commandEditable = true }: TemplateFormProps) => {
|
|
35
|
+
export const TemplateForm = ({ id, template, commandEditable = true, onChange }: TemplateFormProps) => {
|
|
25
36
|
const { t } = useTranslation(meta.id);
|
|
26
|
-
usePromptInputs(template);
|
|
37
|
+
usePromptInputs(template, onChange);
|
|
38
|
+
|
|
39
|
+
const handleInputKindChange = useCallback(
|
|
40
|
+
(inputName: string, kind: Template.InputKind) => {
|
|
41
|
+
onChange?.((t) => {
|
|
42
|
+
const input = t.inputs?.find((i) => i?.name === inputName);
|
|
43
|
+
if (input) {
|
|
44
|
+
input.kind = kind;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
[onChange],
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const handleInputDefaultChange = useCallback(
|
|
52
|
+
(inputName: string, value: string) => {
|
|
53
|
+
onChange?.((t) => {
|
|
54
|
+
const input = t.inputs?.find((i) => i?.name === inputName);
|
|
55
|
+
if (input) {
|
|
56
|
+
input.default = value;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
[onChange],
|
|
61
|
+
);
|
|
27
62
|
|
|
28
63
|
return (
|
|
29
64
|
<div className={mx('flex flex-col is-full overflow-hidden gap-4', groupBorder)}>
|
|
@@ -36,7 +71,9 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
36
71
|
classNames='is-full bg-transparent m-2'
|
|
37
72
|
value={template.command ?? ''}
|
|
38
73
|
onChange={(event) => {
|
|
39
|
-
|
|
74
|
+
onChange?.((t) => {
|
|
75
|
+
t.command = event.target.value.replace(/\w/g, '');
|
|
76
|
+
});
|
|
40
77
|
}}
|
|
41
78
|
/>
|
|
42
79
|
</Input.Root>
|
|
@@ -54,9 +91,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
54
91
|
<Input.Root>
|
|
55
92
|
<Select.Root
|
|
56
93
|
value={input.kind}
|
|
57
|
-
onValueChange={(kind) =>
|
|
58
|
-
input.kind = kind as Template.InputKind;
|
|
59
|
-
}}
|
|
94
|
+
onValueChange={(kind) => handleInputKindChange(input.name, kind as Template.InputKind)}
|
|
60
95
|
>
|
|
61
96
|
<Select.TriggerButton placeholder='Type' classNames='is-full' />
|
|
62
97
|
<Select.Portal>
|
|
@@ -82,9 +117,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
|
|
|
82
117
|
placeholder={t('command placeholder')}
|
|
83
118
|
classNames='is-full bg-transparent'
|
|
84
119
|
value={input.default ?? ''}
|
|
85
|
-
onChange={(event) =>
|
|
86
|
-
input.default = event.target.value;
|
|
87
|
-
}}
|
|
120
|
+
onChange={(event) => handleInputDefaultChange(input.name, event.target.value)}
|
|
88
121
|
/>
|
|
89
122
|
</Input.Root>
|
|
90
123
|
</div>
|
|
@@ -136,13 +169,14 @@ const inputs: { kind: Template.InputKind; label: string }[] = [
|
|
|
136
169
|
|
|
137
170
|
export const NAME_REGEXP = /\{\{([\w-]+)\}\}/;
|
|
138
171
|
|
|
139
|
-
const usePromptInputs = (template: Template.Template) => {
|
|
172
|
+
const usePromptInputs = (template: Template.Template, onChange?: TemplateChangeCallback) => {
|
|
140
173
|
useEffect(() => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
template.inputs = []; // TODO(burdon): Required?
|
|
174
|
+
if (!onChange) {
|
|
175
|
+
return;
|
|
144
176
|
}
|
|
145
177
|
|
|
178
|
+
const text = template.source ?? '';
|
|
179
|
+
|
|
146
180
|
const regex = new RegExp(NAME_REGEXP, 'g');
|
|
147
181
|
const variables = new Set<string>([...(text.target?.content.matchAll(regex) ?? [])].map((m) => m[1]));
|
|
148
182
|
|
|
@@ -161,19 +195,32 @@ const usePromptInputs = (template: Template.Template) => {
|
|
|
161
195
|
|
|
162
196
|
// Match or create new inputs.
|
|
163
197
|
const values = unclaimed.values();
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
next.name = name;
|
|
168
|
-
} else {
|
|
169
|
-
template.inputs?.push({ name });
|
|
198
|
+
onChange((t) => {
|
|
199
|
+
if (!t.inputs) {
|
|
200
|
+
t.inputs = [];
|
|
170
201
|
}
|
|
171
|
-
});
|
|
172
202
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
203
|
+
missing.forEach((name) => {
|
|
204
|
+
const next = values.next().value;
|
|
205
|
+
if (next) {
|
|
206
|
+
// Find the input in the mutable draft and update it.
|
|
207
|
+
const inputIndex = t.inputs!.findIndex((i) => i?.name === next.name);
|
|
208
|
+
if (inputIndex !== -1) {
|
|
209
|
+
t.inputs![inputIndex].name = name;
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
t.inputs!.push({ name });
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Remove unclaimed (deleted) inputs.
|
|
217
|
+
// TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?
|
|
218
|
+
for (const input of values) {
|
|
219
|
+
const inputIndex = t.inputs!.findIndex((i) => i?.name === input.name);
|
|
220
|
+
if (inputIndex !== -1) {
|
|
221
|
+
t.inputs!.splice(inputIndex, 1);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}, [template.source, onChange]);
|
|
179
226
|
};
|
|
@@ -19,8 +19,7 @@ import {
|
|
|
19
19
|
keymap,
|
|
20
20
|
} from '@codemirror/view';
|
|
21
21
|
|
|
22
|
-
import { Domino } from '@dxos/
|
|
23
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
22
|
+
import { Domino, mx } from '@dxos/ui';
|
|
24
23
|
|
|
25
24
|
export type HandlebarsOptions = {};
|
|
26
25
|
|
|
@@ -87,7 +86,11 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
87
86
|
// NOTE: Decorations may clash with other extensions (e.g., markdown).
|
|
88
87
|
buildDecorations(view: EditorView) {
|
|
89
88
|
const selection = view.state.selection.main;
|
|
90
|
-
const decorations: Array<{
|
|
89
|
+
const decorations: Array<{
|
|
90
|
+
from: number;
|
|
91
|
+
to: number;
|
|
92
|
+
decoration: Decoration;
|
|
93
|
+
}> = [];
|
|
91
94
|
|
|
92
95
|
for (const { from, to } of view.visibleRanges) {
|
|
93
96
|
const text = view.state.doc.sliceString(from, to);
|
|
@@ -121,7 +124,9 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
|
|
|
121
124
|
decorations.push({
|
|
122
125
|
from: start,
|
|
123
126
|
to: end,
|
|
124
|
-
decoration: Decoration.mark({
|
|
127
|
+
decoration: Decoration.mark({
|
|
128
|
+
class: mx('dx-tag--blue', tagPadding),
|
|
129
|
+
}),
|
|
125
130
|
});
|
|
126
131
|
}
|
|
127
132
|
}
|
|
@@ -222,7 +227,7 @@ class DXNWidget extends WidgetType {
|
|
|
222
227
|
return part;
|
|
223
228
|
})
|
|
224
229
|
.join(':');
|
|
225
|
-
return Domino.of('span').classNames(
|
|
230
|
+
return Domino.of('span').classNames(mx('font-mono dx-tag--blue', tagPadding)).text(text).root;
|
|
226
231
|
}
|
|
227
232
|
}
|
|
228
233
|
|
|
@@ -7,9 +7,9 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
7
7
|
|
|
8
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { NumericTabs, TextCrawl, ToggleContainer, type ToggleContainerRootProps } from '@dxos/react-ui-components';
|
|
10
|
-
import { type XmlWidgetProps } from '@dxos/react-ui-editor';
|
|
11
10
|
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
12
11
|
import { type ContentBlock, type Message } from '@dxos/types';
|
|
12
|
+
import { type XmlWidgetProps } from '@dxos/ui-editor';
|
|
13
13
|
import { isNonNullable, safeParseJson } from '@dxos/util';
|
|
14
14
|
|
|
15
15
|
import { meta } from '../../meta';
|
|
@@ -25,7 +25,7 @@ export type ToolBlockProps = XmlWidgetProps<{
|
|
|
25
25
|
export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
26
26
|
const { t } = useTranslation(meta.id);
|
|
27
27
|
|
|
28
|
-
const items = useMemo<
|
|
28
|
+
const items = useMemo<ToolContainerProps['items']>(() => {
|
|
29
29
|
let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
|
|
30
30
|
// TODO(burdon): Get from context?
|
|
31
31
|
const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
|
|
@@ -101,11 +101,11 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
|
|
|
101
101
|
|
|
102
102
|
ToolBlock.displayName = 'ToolBlock';
|
|
103
103
|
|
|
104
|
-
type
|
|
104
|
+
type ToolContainerProps = {
|
|
105
105
|
items: { title: string; content: any }[];
|
|
106
106
|
} & Pick<ToggleContainerRootProps, 'onChangeOpen'>;
|
|
107
107
|
|
|
108
|
-
export const ToolContainer = ({ items, onChangeOpen }:
|
|
108
|
+
export const ToolContainer = ({ items, onChangeOpen }: ToolContainerProps) => {
|
|
109
109
|
const tabsRef = useRef<HTMLDivElement>(null);
|
|
110
110
|
const [selected, setSelected] = useState(0);
|
|
111
111
|
const [open, setOpen] = useState(false);
|
|
@@ -117,9 +117,9 @@ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerParams) => {
|
|
|
117
117
|
}
|
|
118
118
|
}, [open, onChangeOpen]);
|
|
119
119
|
|
|
120
|
-
const handleSelect = (index: number) => {
|
|
120
|
+
const handleSelect = useCallback((index: number) => {
|
|
121
121
|
setSelected(index);
|
|
122
|
-
};
|
|
122
|
+
}, []);
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
125
|
<ToggleContainer.Root classNames='mbs-2 is-full rounded-sm' open={open} onChangeOpen={setOpen}>
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
8
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { capabilities } from '@dxos/assistant-toolkit';
|
|
10
|
+
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
11
11
|
import { ChessPlugin } from '@dxos/plugin-chess';
|
|
12
12
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
13
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
14
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
15
14
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
15
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
16
16
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
17
17
|
|
|
18
18
|
import { translations } from '../../translations';
|
|
@@ -20,7 +20,7 @@ import { translations } from '../../translations';
|
|
|
20
20
|
import { Toolbox, type ToolboxProps } from './Toolbox';
|
|
21
21
|
|
|
22
22
|
const DefaultStory = (props: ToolboxProps) => {
|
|
23
|
-
return <Toolbox {...props} classNames='
|
|
23
|
+
return <Toolbox {...props} classNames='bs-[15rem] is-[30rem] plb-1 rounded-sm border border-separator' />;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const meta = {
|
|
@@ -28,17 +28,16 @@ const meta = {
|
|
|
28
28
|
component: Toolbox as any,
|
|
29
29
|
render: DefaultStory,
|
|
30
30
|
decorators: [
|
|
31
|
-
withTheme,
|
|
31
|
+
withTheme(),
|
|
32
32
|
withPluginManager({
|
|
33
33
|
plugins: [
|
|
34
|
+
...corePlugins(),
|
|
34
35
|
ClientPlugin({
|
|
35
|
-
onClientInitialized:
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
onClientInitialized: ({ client }) =>
|
|
37
|
+
Effect.gen(function* () {
|
|
38
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
39
|
+
}),
|
|
38
40
|
}),
|
|
39
|
-
SpacePlugin({}),
|
|
40
|
-
SettingsPlugin(),
|
|
41
|
-
IntentPlugin(),
|
|
42
41
|
ChessPlugin(),
|
|
43
42
|
MapPlugin(),
|
|
44
43
|
TablePlugin(),
|
|
@@ -5,15 +5,13 @@
|
|
|
5
5
|
import React, { type FC, Fragment, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type Blueprint } from '@dxos/blueprints';
|
|
8
|
-
import { type Ref } from '@dxos/echo';
|
|
8
|
+
import { type Database, type Ref } from '@dxos/echo';
|
|
9
9
|
import { Function } from '@dxos/functions';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
|
-
import { Filter,
|
|
12
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
14
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
11
|
+
import { Filter, useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
|
|
13
|
+
import { mx } from '@dxos/ui-theme';
|
|
15
14
|
|
|
16
|
-
import { meta } from '../../meta';
|
|
17
15
|
import { type AiChatProcessor } from '../../processor';
|
|
18
16
|
import { ServiceType } from '../../types';
|
|
19
17
|
|
|
@@ -21,52 +19,52 @@ export type ToolboxProps = ThemedClassName<{
|
|
|
21
19
|
services?: { service: ServiceType }[];
|
|
22
20
|
functions?: Function.Function[];
|
|
23
21
|
// TODO(burdon): Combine into single array.
|
|
24
|
-
blueprints?: readonly
|
|
22
|
+
blueprints?: readonly Blueprint.Blueprint[];
|
|
25
23
|
activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
|
|
26
24
|
}>;
|
|
27
25
|
|
|
28
26
|
export const Toolbox = ({ classNames, functions, services, blueprints, activeBlueprints }: ToolboxProps) => {
|
|
29
|
-
const { t } = useTranslation(meta.id);
|
|
30
|
-
|
|
31
27
|
return (
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
28
|
+
<ScrollArea.Root thin orientation='vertical'>
|
|
29
|
+
<ScrollArea.Viewport classNames={classNames}>
|
|
30
|
+
{blueprints && blueprints.length > 0 && (
|
|
31
|
+
<Section
|
|
32
|
+
title='Blueprints'
|
|
33
|
+
items={blueprints.map(({ name, description, tools }) => ({
|
|
34
|
+
name,
|
|
35
|
+
description,
|
|
36
|
+
subitems: tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
37
|
+
}))}
|
|
38
|
+
/>
|
|
39
|
+
)}
|
|
40
|
+
|
|
41
|
+
{activeBlueprints && activeBlueprints.length > 0 && (
|
|
42
|
+
<Section
|
|
43
|
+
title='Blueprints'
|
|
44
|
+
items={activeBlueprints.map(({ target }) => ({
|
|
45
|
+
name: target?.name ?? '',
|
|
46
|
+
description: target?.description ?? '',
|
|
47
|
+
subitems: target?.tools.map((toolId) => ({ name: `∙ ${safeToolId(toolId)}` })),
|
|
48
|
+
}))}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
|
|
52
|
+
{services && services.length > 0 && (
|
|
53
|
+
<Section
|
|
54
|
+
title='Services'
|
|
55
|
+
items={services.map(({ service: { serviceId, name, description } }) => ({
|
|
56
|
+
name: name ?? serviceId,
|
|
57
|
+
description,
|
|
58
|
+
// subitems: tools.map(({ name, description }) => ({ name: `∙ ${name}`, description })),
|
|
59
|
+
}))}
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
{functions && functions.length > 0 && (
|
|
64
|
+
<Section title='Functions' items={functions.map(({ name, description }) => ({ name, description }))} />
|
|
65
|
+
)}
|
|
66
|
+
</ScrollArea.Viewport>
|
|
67
|
+
</ScrollArea.Root>
|
|
70
68
|
);
|
|
71
69
|
};
|
|
72
70
|
|
|
@@ -105,13 +103,13 @@ const Section: FC<{
|
|
|
105
103
|
};
|
|
106
104
|
|
|
107
105
|
export type ToolboxContainerProps = ThemedClassName<{
|
|
108
|
-
|
|
106
|
+
db?: Database.Database;
|
|
109
107
|
processor?: AiChatProcessor;
|
|
110
108
|
}>;
|
|
111
109
|
|
|
112
|
-
export const ToolboxContainer = ({ classNames,
|
|
110
|
+
export const ToolboxContainer = ({ classNames, db, processor }: ToolboxContainerProps) => {
|
|
113
111
|
// Registered services.
|
|
114
|
-
const services = useQuery(
|
|
112
|
+
const services = useQuery(db, Filter.type(ServiceType));
|
|
115
113
|
const [serviceTools, setServiceTools] = useState<{ service: ServiceType }[]>([]);
|
|
116
114
|
useEffect(() => {
|
|
117
115
|
log('creating service tools...', { services: services.length });
|
|
@@ -125,12 +123,12 @@ export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContai
|
|
|
125
123
|
}, [services]);
|
|
126
124
|
|
|
127
125
|
// Deployed functions.
|
|
128
|
-
const functions = useQuery(
|
|
126
|
+
const functions = useQuery(db, Filter.type(Function.Function));
|
|
129
127
|
|
|
130
128
|
return (
|
|
131
129
|
<Toolbox
|
|
132
130
|
classNames={classNames}
|
|
133
|
-
blueprints={processor?.context.
|
|
131
|
+
blueprints={processor?.context.getBlueprints()}
|
|
134
132
|
services={serviceTools}
|
|
135
133
|
functions={functions}
|
|
136
134
|
/>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
8
|
+
import { useLayout } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type InvocationsState } from '@dxos/functions-runtime';
|
|
10
|
+
import { useTriggerRuntimeControls } from '@dxos/plugin-automation';
|
|
11
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
12
|
+
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
13
|
+
import { parseId } from '@dxos/react-client/echo';
|
|
14
|
+
import { Icon, Input, Popover, useTranslation } from '@dxos/react-ui';
|
|
15
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
16
|
+
import { mx } from '@dxos/ui-theme';
|
|
17
|
+
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
|
|
20
|
+
type TriggerStatusState = 'disabled' | 'idle' | 'running' | 'error';
|
|
21
|
+
|
|
22
|
+
const getIcon = (state: TriggerStatusState): string => {
|
|
23
|
+
switch (state) {
|
|
24
|
+
case 'disabled':
|
|
25
|
+
return 'ph--lightning-slash--regular';
|
|
26
|
+
case 'idle':
|
|
27
|
+
return 'ph--lightning--regular';
|
|
28
|
+
case 'running':
|
|
29
|
+
return 'ph--lightning--fill';
|
|
30
|
+
case 'error':
|
|
31
|
+
return 'ph--warning--regular';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getIconClassNames = (state: TriggerStatusState): string | undefined => {
|
|
36
|
+
switch (state) {
|
|
37
|
+
case 'running':
|
|
38
|
+
return 'animate-pulse text-accentText';
|
|
39
|
+
case 'error':
|
|
40
|
+
return 'text-errorText';
|
|
41
|
+
default:
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const useCurrentSpace = () => {
|
|
47
|
+
const layout = useLayout();
|
|
48
|
+
const client = useCapability(ClientCapabilities.Client);
|
|
49
|
+
const { spaceId } = parseId(layout.workspace);
|
|
50
|
+
const space = spaceId ? client.spaces.get(spaceId) : undefined;
|
|
51
|
+
return space;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const TriggerStatus = () => {
|
|
55
|
+
const space = useCurrentSpace();
|
|
56
|
+
const db = space?.db;
|
|
57
|
+
const { state, start, stop } = useTriggerRuntimeControls(db);
|
|
58
|
+
const isRunning = state?.enabled ?? false;
|
|
59
|
+
|
|
60
|
+
// Determine the current trigger status state.
|
|
61
|
+
const triggerState: TriggerStatusState = useMemo(() => {
|
|
62
|
+
if (!isRunning) {
|
|
63
|
+
return 'disabled';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Check if there's any pending invocation.
|
|
67
|
+
const hasPending = state?.invocations.some((invocation) => invocation.result === null);
|
|
68
|
+
if (hasPending) {
|
|
69
|
+
return 'running';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Check if the last invocation failed.
|
|
73
|
+
const lastInvocation = state?.invocations.at(-1);
|
|
74
|
+
if (lastInvocation?.result?._tag === 'Failure') {
|
|
75
|
+
return 'error';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return 'idle';
|
|
79
|
+
}, [isRunning, state?.invocations]);
|
|
80
|
+
|
|
81
|
+
const { t } = useTranslation(meta.id);
|
|
82
|
+
const title = t(`trigger status ${triggerState} label`);
|
|
83
|
+
const icon = <Icon icon={getIcon(triggerState)} classNames={getIconClassNames(triggerState)} />;
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Popover.Root>
|
|
87
|
+
<Popover.Trigger asChild>
|
|
88
|
+
<StatusBar.Item title={title}>{icon}</StatusBar.Item>
|
|
89
|
+
</Popover.Trigger>
|
|
90
|
+
<Popover.Portal>
|
|
91
|
+
<Popover.Content>
|
|
92
|
+
<TriggerStatusPopover
|
|
93
|
+
isRunning={isRunning}
|
|
94
|
+
state={triggerState}
|
|
95
|
+
currentFunctionName={state?.invocations.at(-1)?.function?.name ?? state?.invocations.at(-1)?.function?.key}
|
|
96
|
+
lastInvocation={state?.invocations.at(-1)}
|
|
97
|
+
onToggle={isRunning ? stop : start}
|
|
98
|
+
/>
|
|
99
|
+
<Popover.Arrow />
|
|
100
|
+
</Popover.Content>
|
|
101
|
+
</Popover.Portal>
|
|
102
|
+
</Popover.Root>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
interface TriggerStatusPopoverProps {
|
|
107
|
+
isRunning: boolean;
|
|
108
|
+
state: TriggerStatusState;
|
|
109
|
+
currentFunctionName?: string;
|
|
110
|
+
lastInvocation?: InvocationsState;
|
|
111
|
+
onToggle: () => void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const TriggerStatusPopover = ({
|
|
115
|
+
isRunning,
|
|
116
|
+
state,
|
|
117
|
+
currentFunctionName,
|
|
118
|
+
lastInvocation,
|
|
119
|
+
onToggle,
|
|
120
|
+
}: TriggerStatusPopoverProps) => {
|
|
121
|
+
const { t } = useTranslation(meta.id);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div className='min-is-[240px] p-2 space-y-3'>
|
|
125
|
+
{/* Runtime Toggle */}
|
|
126
|
+
<Settings.ItemInput title={t('trigger runtime label')} description={t('trigger runtime description')}>
|
|
127
|
+
<Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={onToggle} />
|
|
128
|
+
</Settings.ItemInput>
|
|
129
|
+
|
|
130
|
+
{/* Status Indicator */}
|
|
131
|
+
<div className='flex items-center gap-2 pt-2 border-t border-separator'>
|
|
132
|
+
<Icon icon={getIcon(state)} classNames={mx(getIconClassNames(state), 'shrink-0')} />
|
|
133
|
+
<span className='text-sm'>{t(`trigger status ${state} label`)}</span>
|
|
134
|
+
{currentFunctionName && state === 'running' && (
|
|
135
|
+
<span className='text-xs text-description'>{currentFunctionName}</span>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export default TriggerStatus;
|