@dxos/plugin-assistant 0.8.4-main.67995b8 → 0.8.4-main.dedc0f3
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/{BlueprintContainer-IZ4AK5EO.mjs → BlueprintContainer-BFNN6K46.mjs} +4 -3
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs +126 -0
- package/dist/lib/browser/ChatCompanion-YYYCHZYV.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-RP3QEXYX.mjs → ChatContainer-G6YHR6GJ.mjs} +34 -13
- package/dist/lib/browser/ChatContainer-G6YHR6GJ.mjs.map +7 -0
- package/dist/lib/browser/{ChatDialog-ZVLXFHEY.mjs → ChatDialog-HJ7VDRQO.mjs} +28 -12
- package/dist/lib/browser/ChatDialog-HJ7VDRQO.mjs.map +7 -0
- package/dist/lib/browser/{SequenceContainer-3UDVKWPA.mjs → SequenceContainer-TF5QNXYM.mjs} +5 -17
- package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +7 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs +22 -0
- package/dist/lib/browser/ai-service-YC2EQPHA.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-XSEOKJLG.mjs → app-graph-builder-3C43MLCD.mjs} +25 -36
- package/dist/lib/browser/app-graph-builder-3C43MLCD.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-VHFSRTEJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs +19 -0
- package/dist/lib/browser/chunk-EZUSNS2J.mjs.map +7 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs +161 -0
- package/dist/lib/browser/chunk-GLWD66TA.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-O4LUJEDV.mjs +20 -0
- package/dist/lib/browser/{chunk-FDCJSQYF.mjs.map → chunk-O4LUJEDV.mjs.map} +2 -2
- package/dist/lib/browser/chunk-PL4O4ZJU.mjs +1974 -0
- package/dist/lib/browser/chunk-PL4O4ZJU.mjs.map +7 -0
- package/dist/lib/browser/chunk-PPJAIE2T.mjs +299 -0
- package/dist/lib/browser/chunk-PPJAIE2T.mjs.map +7 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs +169 -0
- package/dist/lib/browser/chunk-PQI3MGDN.mjs.map +7 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs +216 -0
- package/dist/lib/browser/chunk-R6LRGW3I.mjs.map +7 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs +202 -0
- package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs +155 -0
- package/dist/lib/browser/compute-runtime-X6IREJN3.mjs.map +7 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs +22 -0
- package/dist/lib/browser/edge-model-resolver-JNEB355N.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +148 -62
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs +112 -0
- package/dist/lib/browser/intent-resolver-I6M3ZDAS.mjs.map +7 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs +21 -0
- package/dist/lib/browser/local-model-resolver-EUXSRZ7X.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-3GYEHQRP.mjs → react-surface-WNLA2636.mjs} +25 -66
- package/dist/lib/browser/react-surface-WNLA2636.mjs.map +7 -0
- package/dist/lib/browser/{settings-5GTTCVGD.mjs → settings-36V3VUMW.mjs} +6 -5
- package/dist/lib/{node-esm/settings-J2EXEM5H.mjs.map → browser/settings-36V3VUMW.mjs.map} +1 -1
- package/dist/lib/browser/state-AINRYS5W.mjs +21 -0
- package/dist/lib/browser/state-AINRYS5W.mjs.map +7 -0
- package/dist/lib/browser/toolkit-Y5OYX5PO.mjs +191 -0
- package/dist/lib/browser/toolkit-Y5OYX5PO.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -4
- package/dist/lib/node-esm/{BlueprintContainer-RGTMNLNX.mjs → BlueprintContainer-X4MRBKDR.mjs} +4 -3
- package/dist/lib/{browser/BlueprintContainer-IZ4AK5EO.mjs.map → node-esm/BlueprintContainer-X4MRBKDR.mjs.map} +1 -1
- package/dist/lib/node-esm/ChatCompanion-PUAFRIEC.mjs +127 -0
- package/dist/lib/node-esm/ChatCompanion-PUAFRIEC.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-W3W6FWV3.mjs → ChatContainer-EZZF7RSQ.mjs} +34 -13
- package/dist/lib/node-esm/ChatContainer-EZZF7RSQ.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatDialog-QW4JRKVO.mjs → ChatDialog-PTQLZNJU.mjs} +28 -12
- package/dist/lib/node-esm/ChatDialog-PTQLZNJU.mjs.map +7 -0
- package/dist/lib/node-esm/{SequenceContainer-RQQH5XOC.mjs → SequenceContainer-UXOVZPZO.mjs} +5 -17
- package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +7 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs +23 -0
- package/dist/lib/node-esm/ai-service-XUMZVFCK.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-PANCJUHV.mjs → app-graph-builder-NM3JDLQ2.mjs} +25 -36
- package/dist/lib/node-esm/app-graph-builder-NM3JDLQ2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs +13 -0
- package/dist/lib/node-esm/blueprint-definition-4E6XTLVN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs +170 -0
- package/dist/lib/node-esm/chunk-4WLFSXZG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs +203 -0
- package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs +217 -0
- package/dist/lib/node-esm/chunk-LVTG5JTW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs +163 -0
- package/dist/lib/node-esm/chunk-QG2KT3AT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-VFY2JG62.mjs +22 -0
- package/dist/lib/node-esm/{chunk-QN2H2EHV.mjs.map → chunk-VFY2JG62.mjs.map} +2 -2
- package/dist/lib/node-esm/chunk-VH3LTD76.mjs +300 -0
- package/dist/lib/node-esm/chunk-VH3LTD76.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs +20 -0
- package/dist/lib/node-esm/chunk-XD4CDA4R.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZIDP7HBI.mjs +1975 -0
- package/dist/lib/node-esm/chunk-ZIDP7HBI.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs +156 -0
- package/dist/lib/node-esm/compute-runtime-NRHLLTSC.mjs.map +7 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs +23 -0
- package/dist/lib/node-esm/edge-model-resolver-UE5TLLJZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +148 -62
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs +113 -0
- package/dist/lib/node-esm/intent-resolver-VIINHFMT.mjs.map +7 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs +22 -0
- package/dist/lib/node-esm/local-model-resolver-JBEFVVZA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-QDQWJ7FZ.mjs → react-surface-GP3LU6DX.mjs} +25 -66
- package/dist/lib/node-esm/react-surface-GP3LU6DX.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-J2EXEM5H.mjs → settings-7ZCZ6AS5.mjs} +6 -5
- package/dist/lib/{browser/settings-5GTTCVGD.mjs.map → node-esm/settings-7ZCZ6AS5.mjs.map} +1 -1
- package/dist/lib/node-esm/state-EQS5KP6M.mjs +22 -0
- package/dist/lib/node-esm/state-EQS5KP6M.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs +192 -0
- package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -4
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/ai-service.d.ts +5 -0
- package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +7 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +32 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +12 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/local-model-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit.d.ts +4 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/Chat/Chat.d.ts +20 -17
- package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
- package/dist/types/src/components/Chat/events.d.ts +5 -0
- package/dist/types/src/components/Chat/events.d.ts.map +1 -1
- package/dist/types/src/components/ChatCompanion.d.ts +13 -0
- package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
- 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.map +1 -1
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
- package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
- package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
- package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
- package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
- package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +4 -5
- package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
- package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
- package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -7
- package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +115 -32
- package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
- package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts +40 -0
- package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
- package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
- package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
- package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -1
- package/dist/types/src/components/SequenceContainer.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +1 -1
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +261 -2
- package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +0 -5
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +261 -6
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +258 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts +12 -0
- package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
- package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
- package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
- package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
- package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/index.d.ts +2 -0
- package/dist/types/src/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +11 -0
- package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +1 -0
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -9
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +262 -4
- package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/execution-graph/execution-graph.d.ts +21 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +2 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/functions/analysis.d.ts +5 -0
- package/dist/types/src/functions/analysis.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +4 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/list.d.ts +10 -0
- package/dist/types/src/functions/list.d.ts.map +1 -0
- package/dist/types/src/functions/load.d.ts +8 -0
- package/dist/types/src/functions/load.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +9 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts +24 -0
- package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
- package/dist/types/src/hooks/useChatProcessor.d.ts +8 -21
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatServices.d.ts +5 -6
- package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
- package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
- package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
- package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts +6 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useFlush.d.ts +6 -0
- package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
- package/dist/types/src/hooks/useItemTypes.d.ts +4 -0
- package/dist/types/src/hooks/useItemTypes.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnline.d.ts +3 -0
- package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
- package/dist/types/src/hooks/usePresets.d.ts +7 -0
- package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
- package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
- package/dist/types/src/processor/index.d.ts +3 -0
- package/dist/types/src/processor/index.d.ts.map +1 -0
- package/dist/types/src/{hooks → processor}/presets.d.ts +2 -2
- package/dist/types/src/processor/presets.d.ts.map +1 -0
- package/dist/types/src/processor/processor.d.ts +73 -0
- package/dist/types/src/processor/processor.d.ts.map +1 -0
- package/dist/types/src/processor/processor.test.d.ts +2 -0
- package/dist/types/src/processor/processor.test.d.ts.map +1 -0
- package/dist/types/src/stories/Chat.stories.d.ts +25 -202
- package/dist/types/src/stories/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/stories/components/BlueprintContainer.d.ts +4 -0
- package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChatContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts +4 -0
- package/dist/types/src/stories/components/ChessContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/CommentsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/DebugCard.d.ts +8 -0
- package/dist/types/src/stories/components/DebugCard.d.ts.map +1 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts +6 -0
- package/dist/types/src/stories/components/GraphContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts +4 -0
- package/dist/types/src/stories/components/InvocationsContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts +7 -0
- package/dist/types/src/stories/components/LoggingContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts +4 -0
- package/dist/types/src/stories/components/MessageContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/stories/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchInputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts +4 -0
- package/dist/types/src/stories/components/ResearchOutputStack.d.ts.map +1 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts +4 -0
- package/dist/types/src/stories/components/TasksContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts +3 -0
- package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts +14 -0
- package/dist/types/src/stories/components/TriggersContainer.d.ts.map +1 -0
- package/dist/types/src/stories/components/index.d.ts +16 -0
- package/dist/types/src/stories/components/index.d.ts.map +1 -0
- package/dist/types/src/stories/components/types.d.ts +7 -0
- package/dist/types/src/stories/components/types.d.ts.map +1 -0
- package/dist/types/src/stories/testing/data.d.ts +9 -0
- package/dist/types/src/stories/testing/data.d.ts.map +1 -0
- package/dist/types/src/stories/testing/index.d.ts +3 -0
- package/dist/types/src/stories/testing/index.d.ts.map +1 -0
- package/dist/types/src/stories/testing/schema.d.ts +7 -0
- package/dist/types/src/stories/testing/schema.d.ts.map +1 -0
- package/dist/types/src/stories/testing/testing.d.ts +48 -0
- package/dist/types/src/stories/testing/testing.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +14 -0
- package/dist/types/src/testing/test-data.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +5 -2
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing/test-generator.d.ts +7 -0
- package/dist/types/src/testing/test-generator.d.ts.map +1 -0
- package/dist/types/src/testing/test-sequence.d.ts +0 -4
- package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +28 -12
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Assistant.d.ts +42 -0
- package/dist/types/src/types/Assistant.d.ts.map +1 -0
- package/dist/types/src/types/AssistantAction.d.ts +107 -0
- package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
- package/dist/types/src/types/defs.d.ts +2 -0
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +6 -3
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +108 -86
- package/src/AssistantPlugin.tsx +61 -17
- package/src/capabilities/ai-service.ts +28 -0
- package/src/capabilities/app-graph-builder.ts +41 -48
- package/src/capabilities/blueprint-definition.ts +58 -0
- package/src/capabilities/capabilities.ts +71 -0
- package/src/capabilities/compute-runtime.ts +124 -0
- package/src/capabilities/edge-model-resolver.ts +27 -0
- package/src/capabilities/index.ts +10 -0
- package/src/capabilities/intent-resolver.ts +45 -23
- package/src/capabilities/local-model-resolver.ts +32 -0
- package/src/capabilities/react-surface.tsx +10 -57
- package/src/capabilities/state.ts +20 -0
- package/src/capabilities/toolkit.ts +163 -0
- package/src/components/AssistantSettings/AssistantSettings.tsx +83 -76
- package/src/components/Chat/Chat.tsx +175 -174
- package/src/components/Chat/events.ts +7 -0
- package/src/components/ChatCompanion.tsx +111 -0
- package/src/components/ChatContainer.tsx +19 -13
- package/src/components/ChatDialog.tsx +18 -14
- package/src/components/ChatProgress/ChatProgress.tsx +68 -0
- package/src/components/ChatProgress/index.ts +5 -0
- package/src/components/ChatPrompt/ChatActions.tsx +10 -24
- package/src/components/ChatPrompt/ChatOptions.tsx +233 -0
- package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
- package/src/components/ChatPrompt/ChatReferences.tsx +31 -36
- package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
- package/src/components/ChatPrompt/index.ts +1 -1
- package/src/components/ChatThread/ChatThread.stories.tsx +97 -110
- package/src/components/ChatThread/ChatThread.tsx +65 -29
- package/src/components/ChatThread/Link.tsx +26 -0
- package/src/components/ChatThread/reducers.ts +151 -0
- package/src/components/ChatThread/registry.tsx +189 -0
- package/src/components/ChatThread/sync.test.ts +81 -0
- package/src/components/ChatThread/sync.ts +113 -0
- package/src/components/PromptSettings.tsx +1 -0
- package/src/components/SequenceContainer.tsx +27 -28
- package/src/components/SequenceEditor/SequenceEditor.stories.tsx +5 -4
- package/src/components/SequenceEditor/SequenceEditor.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +25 -12
- package/src/components/TemplateEditor/TemplateEditor.tsx +14 -47
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +12 -5
- package/src/components/TemplateEditor/TemplateForm.tsx +3 -1
- package/src/components/TemplateEditor/handlebars-extension.ts +165 -0
- package/src/components/ToolBlock/ToolBlock.tsx +152 -0
- package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
- package/src/components/ToolBlock/index.ts +6 -0
- package/src/components/Toolbar/Toolbar.tsx +21 -0
- package/src/components/Toolbar/index.ts +5 -0
- package/src/components/Toolbar/useChatToolbarActions.ts +126 -0
- package/src/components/Toolbox/Toolbox.stories.tsx +10 -16
- package/src/components/Toolbox/Toolbox.tsx +21 -51
- package/src/components/index.ts +3 -4
- package/src/events.ts +2 -2
- package/src/execution-graph/execution-graph.ts +211 -0
- package/src/execution-graph/index.ts +5 -0
- package/src/functions/analysis.ts +20 -0
- package/src/functions/index.ts +7 -0
- package/src/functions/list.ts +46 -0
- package/src/functions/load.ts +42 -0
- package/src/hooks/index.ts +9 -4
- package/src/hooks/useBlueprintRegistry.ts +80 -0
- package/src/hooks/useChatProcessor.ts +21 -98
- package/src/hooks/useChatServices.ts +29 -48
- package/src/hooks/useComputeRuntimeCallback.ts +25 -0
- package/src/hooks/useContextBinder.ts +18 -0
- package/src/hooks/useContextObjects.ts +58 -0
- package/src/hooks/useExecutionGraph.ts +20 -0
- package/src/hooks/useFlush.ts +35 -0
- package/src/hooks/useItemTypes.ts +37 -0
- package/src/hooks/useOnline.ts +10 -0
- package/src/hooks/usePresets.ts +44 -0
- package/src/hooks/useReferencesProvider.ts +11 -9
- package/src/meta.ts +1 -1
- package/src/processor/index.ts +6 -0
- package/src/{hooks → processor}/presets.ts +14 -6
- package/src/processor/processor.test.ts +77 -0
- package/src/processor/processor.ts +302 -0
- package/src/queue-logger.ts +10 -10
- package/src/stories/Chat.stories.tsx +594 -308
- package/src/stories/components/BlueprintContainer.tsx +34 -0
- package/src/stories/components/ChatContainer.tsx +74 -0
- package/src/stories/components/ChessContainer.tsx +17 -0
- package/src/stories/components/CommentsContainer.tsx +25 -0
- package/src/stories/components/DebugCard.tsx +61 -0
- package/src/stories/components/GraphContainer.tsx +119 -0
- package/src/stories/components/InvocationsContainer.tsx +17 -0
- package/src/stories/components/LoggingContainer.tsx +33 -0
- package/src/stories/components/MessageContainer.tsx +22 -0
- package/src/stories/components/PromptContainer.tsx +52 -0
- package/src/stories/components/ResearchInputStack.tsx +30 -0
- package/src/stories/components/ResearchOutputStack.tsx +29 -0
- package/src/stories/components/TasksContainer.tsx +49 -0
- package/src/stories/components/TokenManagerContainer.tsx +14 -0
- package/src/stories/components/TriggersContainer.tsx +75 -0
- package/src/stories/components/index.ts +20 -0
- package/src/stories/components/types.ts +11 -0
- package/src/stories/testing/data.ts +142 -0
- package/src/stories/testing/index.ts +6 -0
- package/src/stories/testing/schema.ts +17 -0
- package/src/stories/testing/testing.tsx +279 -0
- package/src/testing/index.ts +3 -1
- package/src/testing/test-data.ts +245 -0
- package/src/testing/test-functions.ts +8 -3
- package/src/testing/test-generator.ts +257 -0
- package/src/testing/test-sequence.ts +2 -27
- package/src/translations.ts +31 -12
- package/src/types/Assistant.ts +61 -0
- package/src/types/AssistantAction.ts +62 -0
- package/src/types/defs.ts +5 -0
- package/src/types/index.ts +4 -1
- package/src/vite-env.d.ts +30 -0
- package/dist/lib/browser/ChatContainer-RP3QEXYX.mjs.map +0 -7
- package/dist/lib/browser/ChatDialog-ZVLXFHEY.mjs.map +0 -7
- package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-XSEOKJLG.mjs.map +0 -7
- package/dist/lib/browser/chunk-63GG6U6D.mjs +0 -2226
- package/dist/lib/browser/chunk-63GG6U6D.mjs.map +0 -7
- package/dist/lib/browser/chunk-7W7LHTRH.mjs +0 -171
- package/dist/lib/browser/chunk-7W7LHTRH.mjs.map +0 -7
- package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
- package/dist/lib/browser/chunk-KFXSBNZR.mjs +0 -89
- package/dist/lib/browser/chunk-KFXSBNZR.mjs.map +0 -7
- package/dist/lib/browser/chunk-LERGF5YG.mjs +0 -108
- package/dist/lib/browser/chunk-LERGF5YG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs +0 -75
- package/dist/lib/browser/intent-resolver-MV3VSZLS.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GYEHQRP.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-W3W6FWV3.mjs.map +0 -7
- package/dist/lib/node-esm/ChatDialog-QW4JRKVO.mjs.map +0 -7
- package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PANCJUHV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs +0 -2227
- package/dist/lib/node-esm/chunk-BFO3KHYL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs +0 -109
- package/dist/lib/node-esm/chunk-MS3PJARN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs +0 -90
- package/dist/lib/node-esm/chunk-VIIMA3XQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs +0 -172
- package/dist/lib/node-esm/chunk-Z7PUODRT.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs +0 -76
- package/dist/lib/node-esm/intent-resolver-3FMC3GHC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QDQWJ7FZ.mjs.map +0 -7
- package/dist/types/src/capability-definitions.d.ts +0 -7
- package/dist/types/src/capability-definitions.d.ts.map +0 -1
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
- package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
- package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
- package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
- package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
- package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.d.ts +0 -86
- package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
- package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
- package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
- package/dist/types/src/hooks/presets.d.ts.map +0 -1
- package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
- package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.d.ts +0 -4
- package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
- package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
- package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
- package/dist/types/src/parser/index.d.ts +0 -4
- package/dist/types/src/parser/index.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.d.ts +0 -15
- package/dist/types/src/parser/query-parser.d.ts.map +0 -1
- package/dist/types/src/parser/query-parser.test.d.ts +0 -2
- package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
- package/dist/types/src/parser/types.d.ts +0 -24
- package/dist/types/src/parser/types.d.ts.map +0 -1
- package/dist/types/src/tools/function.d.ts +0 -5
- package/dist/types/src/tools/function.d.ts.map +0 -1
- package/dist/types/src/tools/index.d.ts +0 -3
- package/dist/types/src/tools/index.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.d.ts +0 -10
- package/dist/types/src/tools/openapi.d.ts.map +0 -1
- package/dist/types/src/tools/openapi.test.d.ts +0 -2
- package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -120
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capability-definitions.ts +0 -15
- package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
- package/src/components/ChatThread/ChatMessage.tsx +0 -268
- package/src/components/ChatThread/ToolBlock.tsx +0 -121
- package/src/components/ChatThread/reducer.ts +0 -52
- package/src/hooks/chat-processor.test.ts +0 -16
- package/src/hooks/chat-processor.ts +0 -314
- package/src/hooks/useBlueprints.ts +0 -57
- package/src/parser/filter-generator.test.ts +0 -32
- package/src/parser/filter-generator.ts +0 -81
- package/src/parser/index.ts +0 -7
- package/src/parser/query-parser.test.ts +0 -139
- package/src/parser/query-parser.ts +0 -199
- package/src/parser/types.ts +0 -34
- package/src/shims.d.ts +0 -8
- package/src/tools/function.ts +0 -46
- package/src/tools/index.ts +0 -6
- package/src/tools/openapi.test.ts +0 -217
- package/src/tools/openapi.ts +0 -338
- package/src/types/schema.ts +0 -108
- package/src/typings.d.ts +0 -9
- /package/dist/lib/{node-esm/BlueprintContainer-RGTMNLNX.mjs.map → browser/BlueprintContainer-BFNN6K46.mjs.map} +0 -0
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, test } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { QueryParser } from './query-parser';
|
|
8
|
-
|
|
9
|
-
describe('QueryParser', () => {
|
|
10
|
-
test('empty', ({ expect }) => {
|
|
11
|
-
const parser = new QueryParser('');
|
|
12
|
-
expect(parser.parse()).toEqual({
|
|
13
|
-
type: 'literal',
|
|
14
|
-
value: '*',
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('invalid queries', ({ expect }) => {
|
|
19
|
-
const cases = [
|
|
20
|
-
//
|
|
21
|
-
'!',
|
|
22
|
-
'X:',
|
|
23
|
-
':Y',
|
|
24
|
-
'X;Y',
|
|
25
|
-
'x==100',
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
for (const query of cases) {
|
|
29
|
-
const parser = new QueryParser(query);
|
|
30
|
-
expect(() => parser.parse()).toThrow();
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test('valid queries', ({ expect }) => {
|
|
35
|
-
const cases = [
|
|
36
|
-
//
|
|
37
|
-
'',
|
|
38
|
-
'type:Person',
|
|
39
|
-
'$title = "foo"',
|
|
40
|
-
'(type:Person OR type:Organization) AND $title = "DXOS" AND $ts < TODAY',
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
for (const query of cases) {
|
|
44
|
-
const parser = new QueryParser(query);
|
|
45
|
-
expect(parser.parse()).to.exist;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
test('simple queries', ({ expect }) => {
|
|
50
|
-
const cases = [
|
|
51
|
-
{
|
|
52
|
-
query: 'type:Person',
|
|
53
|
-
ast: {
|
|
54
|
-
type: 'binary',
|
|
55
|
-
operator: 'EQ',
|
|
56
|
-
left: { type: 'identifier', name: 'type' },
|
|
57
|
-
right: { type: 'literal', value: 'Person' },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
query: '$title = "DXOS"',
|
|
62
|
-
ast: {
|
|
63
|
-
type: 'binary',
|
|
64
|
-
operator: 'EQ',
|
|
65
|
-
left: { type: 'identifier', name: '$title' },
|
|
66
|
-
right: { type: 'literal', value: 'DXOS' },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
query: '(type:Person OR type:Organization) AND $title = "DXOS" AND $ts < TODAY',
|
|
71
|
-
ast: {
|
|
72
|
-
left: {
|
|
73
|
-
left: {
|
|
74
|
-
left: {
|
|
75
|
-
left: {
|
|
76
|
-
name: 'type',
|
|
77
|
-
type: 'identifier',
|
|
78
|
-
},
|
|
79
|
-
operator: 'EQ',
|
|
80
|
-
right: {
|
|
81
|
-
type: 'literal',
|
|
82
|
-
value: 'Person',
|
|
83
|
-
},
|
|
84
|
-
type: 'binary',
|
|
85
|
-
},
|
|
86
|
-
operator: 'OR',
|
|
87
|
-
right: {
|
|
88
|
-
left: {
|
|
89
|
-
name: 'type',
|
|
90
|
-
type: 'identifier',
|
|
91
|
-
},
|
|
92
|
-
operator: 'EQ',
|
|
93
|
-
right: {
|
|
94
|
-
type: 'literal',
|
|
95
|
-
value: 'Organization',
|
|
96
|
-
},
|
|
97
|
-
type: 'binary',
|
|
98
|
-
},
|
|
99
|
-
type: 'binary',
|
|
100
|
-
},
|
|
101
|
-
operator: 'AND',
|
|
102
|
-
right: {
|
|
103
|
-
left: {
|
|
104
|
-
name: '$title',
|
|
105
|
-
type: 'identifier',
|
|
106
|
-
},
|
|
107
|
-
operator: 'EQ',
|
|
108
|
-
right: {
|
|
109
|
-
type: 'literal',
|
|
110
|
-
value: 'DXOS',
|
|
111
|
-
},
|
|
112
|
-
type: 'binary',
|
|
113
|
-
},
|
|
114
|
-
type: 'binary',
|
|
115
|
-
},
|
|
116
|
-
operator: 'AND',
|
|
117
|
-
right: {
|
|
118
|
-
left: {
|
|
119
|
-
name: '$ts',
|
|
120
|
-
type: 'identifier',
|
|
121
|
-
},
|
|
122
|
-
operator: 'LT',
|
|
123
|
-
right: {
|
|
124
|
-
type: 'literal',
|
|
125
|
-
value: 'TODAY',
|
|
126
|
-
},
|
|
127
|
-
type: 'binary',
|
|
128
|
-
},
|
|
129
|
-
type: 'binary',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
];
|
|
133
|
-
|
|
134
|
-
for (const { query, ast } of cases) {
|
|
135
|
-
const parser = new QueryParser(query);
|
|
136
|
-
expect(parser.parse()).toEqual(ast);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { invariant } from '@dxos/invariant';
|
|
6
|
-
|
|
7
|
-
import { type Expression, type BinaryOperator, type RelationalOperator } from './types';
|
|
8
|
-
|
|
9
|
-
// TODO(burdon): Move to echo-schema?
|
|
10
|
-
|
|
11
|
-
type RelationalSymbol = '=' | '<' | '>';
|
|
12
|
-
|
|
13
|
-
const operators: Record<RelationalSymbol, RelationalOperator> = {
|
|
14
|
-
'=': 'EQ',
|
|
15
|
-
'<': 'LT',
|
|
16
|
-
'>': 'GT',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export class QueryParser {
|
|
20
|
-
private tokens: string[] = [];
|
|
21
|
-
private current = 0;
|
|
22
|
-
|
|
23
|
-
constructor(input: string) {
|
|
24
|
-
// Tokenize the input string.
|
|
25
|
-
this.tokens = this.tokenize(input);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
private tokenize(input: string): string[] {
|
|
29
|
-
// Handle empty input.
|
|
30
|
-
if (!input.trim()) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Split on spaces but preserve quoted strings.
|
|
35
|
-
const tokens: string[] = [];
|
|
36
|
-
let current = '';
|
|
37
|
-
let inQuotes = false;
|
|
38
|
-
|
|
39
|
-
for (let i = 0; i < input.length; i++) {
|
|
40
|
-
const char = input[i];
|
|
41
|
-
|
|
42
|
-
if (char === '"') {
|
|
43
|
-
// Handle quoted strings.
|
|
44
|
-
inQuotes = !inQuotes;
|
|
45
|
-
current += char;
|
|
46
|
-
} else if (char === '(' || char === ')') {
|
|
47
|
-
// If we have accumulated tokens, add them first.
|
|
48
|
-
if (current) {
|
|
49
|
-
tokens.push(current);
|
|
50
|
-
current = '';
|
|
51
|
-
}
|
|
52
|
-
// Add the parenthesis as a separate token.
|
|
53
|
-
tokens.push(char);
|
|
54
|
-
} else if (operators[char as RelationalSymbol]) {
|
|
55
|
-
// If we have accumulated tokens, add them first.
|
|
56
|
-
if (current) {
|
|
57
|
-
tokens.push(current);
|
|
58
|
-
current = '';
|
|
59
|
-
}
|
|
60
|
-
// Add the operator as a separate token.
|
|
61
|
-
tokens.push(operators[char as RelationalSymbol]);
|
|
62
|
-
} else if (char === ' ' && !inQuotes) {
|
|
63
|
-
if (current) {
|
|
64
|
-
tokens.push(current);
|
|
65
|
-
current = '';
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
current += char;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (current) {
|
|
73
|
-
tokens.push(current);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return tokens;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private peek(): string {
|
|
80
|
-
return this.tokens[this.current];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private advance(): string {
|
|
84
|
-
return this.tokens[this.current++];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
private match(type: string): boolean {
|
|
88
|
-
if (this.peek() === type) {
|
|
89
|
-
this.advance();
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private isAtEnd(): boolean {
|
|
96
|
-
return this.current >= this.tokens.length;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
private parseExpression(): Expression {
|
|
100
|
-
let expr = this.parseTerm();
|
|
101
|
-
|
|
102
|
-
while (!this.isAtEnd()) {
|
|
103
|
-
const operator = this.peek();
|
|
104
|
-
if (operator === 'AND' || operator === 'OR') {
|
|
105
|
-
this.advance();
|
|
106
|
-
const right = this.parseTerm();
|
|
107
|
-
expr = {
|
|
108
|
-
type: 'binary',
|
|
109
|
-
operator: operator as BinaryOperator,
|
|
110
|
-
left: expr,
|
|
111
|
-
right,
|
|
112
|
-
};
|
|
113
|
-
} else {
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return expr;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
private parseTerm(): Expression {
|
|
122
|
-
// Handle NOT operator
|
|
123
|
-
if (this.peek() === 'NOT') {
|
|
124
|
-
this.advance();
|
|
125
|
-
const argument = this.parseTerm();
|
|
126
|
-
return {
|
|
127
|
-
type: 'unary',
|
|
128
|
-
operator: 'NOT',
|
|
129
|
-
argument,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Handle parentheses.
|
|
134
|
-
if (this.match('(')) {
|
|
135
|
-
const expr = this.parseExpression();
|
|
136
|
-
if (!this.match(')')) {
|
|
137
|
-
throw new Error('Expected closing parenthesis');
|
|
138
|
-
}
|
|
139
|
-
return expr;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const token = this.peek();
|
|
143
|
-
|
|
144
|
-
// Handle type:Person style expressions.
|
|
145
|
-
if (token.includes(':')) {
|
|
146
|
-
const [field, value] = token.split(':');
|
|
147
|
-
this.advance();
|
|
148
|
-
if (!field || !value) {
|
|
149
|
-
throw new Error(`Invalid type expression: ${token}`);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
type: 'binary',
|
|
154
|
-
operator: 'EQ',
|
|
155
|
-
left: { type: 'identifier', name: field },
|
|
156
|
-
right: { type: 'literal', value },
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Handle $field expressions with operators.
|
|
161
|
-
if (token.startsWith('$')) {
|
|
162
|
-
const field = token;
|
|
163
|
-
this.advance();
|
|
164
|
-
|
|
165
|
-
// Get the operator.
|
|
166
|
-
const operator = this.peek();
|
|
167
|
-
if (operator !== 'EQ' && operator !== 'LT' && operator !== 'GT') {
|
|
168
|
-
throw new Error(`Expected operator after field ${field}, got ${operator}`);
|
|
169
|
-
}
|
|
170
|
-
this.advance();
|
|
171
|
-
|
|
172
|
-
// Get the value
|
|
173
|
-
const value = this.peek();
|
|
174
|
-
this.advance();
|
|
175
|
-
invariant(value);
|
|
176
|
-
|
|
177
|
-
return {
|
|
178
|
-
type: 'binary',
|
|
179
|
-
operator: operator as BinaryOperator,
|
|
180
|
-
left: { type: 'identifier', name: field },
|
|
181
|
-
right: { type: 'literal', value: value.replace(/^"|"$/g, '') },
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
throw new Error(`Unexpected token: ${token}`);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
public parse(): Expression {
|
|
189
|
-
// Return a special expression for empty input.
|
|
190
|
-
if (this.tokens.length === 0) {
|
|
191
|
-
return {
|
|
192
|
-
type: 'literal',
|
|
193
|
-
value: '*',
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return this.parseExpression();
|
|
198
|
-
}
|
|
199
|
-
}
|
package/src/parser/types.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
export type UnaryOperator = 'NOT';
|
|
6
|
-
|
|
7
|
-
export type RelationalOperator = 'EQ' | 'LT' | 'GT';
|
|
8
|
-
|
|
9
|
-
export type BinaryOperator = RelationalOperator | 'AND' | 'OR';
|
|
10
|
-
|
|
11
|
-
export type Expression = BinaryExpression | UnaryExpression | Identifier | Literal;
|
|
12
|
-
|
|
13
|
-
export interface BinaryExpression {
|
|
14
|
-
type: 'binary';
|
|
15
|
-
operator: BinaryOperator;
|
|
16
|
-
left: Expression;
|
|
17
|
-
right: Expression;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface UnaryExpression {
|
|
21
|
-
type: 'unary';
|
|
22
|
-
operator: UnaryOperator;
|
|
23
|
-
argument: Expression;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface Identifier {
|
|
27
|
-
type: 'identifier';
|
|
28
|
-
name: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface Literal {
|
|
32
|
-
type: 'literal';
|
|
33
|
-
value: string;
|
|
34
|
-
}
|
package/src/shims.d.ts
DELETED
package/src/tools/function.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { createTool, type ExecutableTool, ToolResult } from '@dxos/ai';
|
|
6
|
-
import { Type } from '@dxos/echo';
|
|
7
|
-
import { getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
|
|
8
|
-
import { type FunctionType } from '@dxos/functions';
|
|
9
|
-
import { log } from '@dxos/log';
|
|
10
|
-
import { type SpaceId } from '@dxos/react-client/echo';
|
|
11
|
-
import { getMeta } from '@dxos/react-client/echo';
|
|
12
|
-
|
|
13
|
-
// TODO(burdon): Move to @dxos/ai.
|
|
14
|
-
export const convertFunctionToTool = (
|
|
15
|
-
fn: FunctionType,
|
|
16
|
-
edgeUrl: string,
|
|
17
|
-
spaceId?: SpaceId | undefined,
|
|
18
|
-
): ExecutableTool | undefined => {
|
|
19
|
-
if (!fn.description || !fn.inputSchema) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
const existingFunctionUrl = getUserFunctionUrlInMetadata(getMeta(fn));
|
|
23
|
-
if (!existingFunctionUrl) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const url = getInvocationUrl(existingFunctionUrl, edgeUrl, { spaceId });
|
|
28
|
-
|
|
29
|
-
return createTool('user-function', {
|
|
30
|
-
name: fn.name,
|
|
31
|
-
description: fn.description,
|
|
32
|
-
schema: Type.toEffectSchema(fn.inputSchema),
|
|
33
|
-
execute: async (input) => {
|
|
34
|
-
log.info('execute function tool', { name: fn.name, url, input });
|
|
35
|
-
const response = await fetch(url, {
|
|
36
|
-
method: 'POST',
|
|
37
|
-
headers: {
|
|
38
|
-
'Content-Type': 'application/json',
|
|
39
|
-
},
|
|
40
|
-
body: JSON.stringify(input),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return ToolResult.Success(await response.text());
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
};
|
package/src/tools/index.ts
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { describe, expect, test } from 'vitest';
|
|
6
|
-
|
|
7
|
-
import { log } from '@dxos/log';
|
|
8
|
-
|
|
9
|
-
import { createToolsFromApi, resolveAuthorization } from './openapi';
|
|
10
|
-
import { ChatProcessor } from '../hooks';
|
|
11
|
-
import { type ApiAuthorization } from '../types';
|
|
12
|
-
|
|
13
|
-
describe.skip('openapi', () => {
|
|
14
|
-
describe.skip('mapping', () => {
|
|
15
|
-
test('amadeus flight availabilities', async () => {
|
|
16
|
-
const tools = await createToolsFromApi(FLIGHT_SEARCH_API);
|
|
17
|
-
log.info('tools', { tools });
|
|
18
|
-
// for (const tool of tools) {
|
|
19
|
-
// const schema = tool.parameters;
|
|
20
|
-
// // log.info('schema', { schema });
|
|
21
|
-
// }
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test('amadeus hotel search', async () => {
|
|
25
|
-
const tools = await createToolsFromApi(HOTEL_SEARCH_API);
|
|
26
|
-
log.info('tools', { tools });
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test('amadeus hotel name autocomplete', async () => {
|
|
30
|
-
const tools = await createToolsFromApi(HOTEL_NAME_AUTOCOMPLETE_API);
|
|
31
|
-
log.info('tools', { tools });
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test('weather', async () => {
|
|
35
|
-
const tools = await createToolsFromApi(WEATHER_API, { authorization: VISUAL_CROSSING_CREDENTIALS });
|
|
36
|
-
log.info('tools', { tools });
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe.skip('invoke tools', () => {
|
|
41
|
-
test('amadeus hotel name autocomplete', async () => {
|
|
42
|
-
const tools = await createToolsFromApi(HOTEL_NAME_AUTOCOMPLETE_API, { authorization: AMADEUS_AUTH });
|
|
43
|
-
const result = await tools[0].execute(
|
|
44
|
-
{
|
|
45
|
-
keyword: 'William Vale Brooklyn',
|
|
46
|
-
subType: ['HOTEL_LEISURE', 'HOTEL_GDS'],
|
|
47
|
-
countryCode: 'US',
|
|
48
|
-
},
|
|
49
|
-
{},
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
log.info('result', { result });
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
test('weather API', async () => {
|
|
56
|
-
const tools = await createToolsFromApi(WEATHER_API, { authorization: VISUAL_CROSSING_CREDENTIALS });
|
|
57
|
-
const forecastTool = tools.find((tool) => tool.name.includes('forecast'));
|
|
58
|
-
const result = await forecastTool?.execute(
|
|
59
|
-
{
|
|
60
|
-
locations: 'Brooklyn, NY',
|
|
61
|
-
aggregateHours: '24',
|
|
62
|
-
},
|
|
63
|
-
{},
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
log.info('result', { result });
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe.skip('AI uses tools', () => {
|
|
71
|
-
test('amadeus flight availabilities', { timeout: 60_000 }, async () => {
|
|
72
|
-
const tools = await createToolsFromApi(FLIGHT_SEARCH_API, { authorization: AMADEUS_AUTH });
|
|
73
|
-
// const aiClient = new Edge AiServiceClient({ endpoint: AI_SERVICE_ENDPOINT.LOCAL });
|
|
74
|
-
// TODO(dmaretskyi): FIX ME.
|
|
75
|
-
const processor = new ChatProcessor(null as any, null as any, { tools });
|
|
76
|
-
const reply = await processor.request(
|
|
77
|
-
`What is the cheapest flight from New York to Paris? going on ${new Date().toISOString()} and returning after a week. 1 adult traveler`,
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
log.info('reply', { reply });
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// TODO(dmaretskyi): Doesn't work.
|
|
84
|
-
test('amadeus hotel name autocomplete', { timeout: 60_000 }, async () => {
|
|
85
|
-
const tools = await createToolsFromApi(HOTEL_NAME_AUTOCOMPLETE_API, { authorization: AMADEUS_AUTH });
|
|
86
|
-
// const aiClient = new Edge AiServiceClient({ endpoint: AI_SERVICE_ENDPOINT.LOCAL });
|
|
87
|
-
// TODO(dmaretskyi): FIX ME.
|
|
88
|
-
const processor = new ChatProcessor(null as any, null as any, { tools });
|
|
89
|
-
const reply = await processor.request('Find me the William Wale in Brooklyn New York');
|
|
90
|
-
|
|
91
|
-
log.info('reply', { reply });
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
test.only('weather forecast', { timeout: 60_000 }, async () => {
|
|
95
|
-
const tools = await createToolsFromApi(WEATHER_API, {
|
|
96
|
-
authorization: VISUAL_CROSSING_CREDENTIALS,
|
|
97
|
-
instructions: WEATHER_INSTRUCTIONS,
|
|
98
|
-
});
|
|
99
|
-
// const aiClient = new Edge AiServiceClient({ endpoint: AI_SERVICE_ENDPOINT.LOCAL });
|
|
100
|
-
// TODO(dmaretskyi): FIX ME.
|
|
101
|
-
const processor = new ChatProcessor(null as any, null as any, { tools });
|
|
102
|
-
const reply = await processor.request(
|
|
103
|
-
`Today's date is ${new Date().toISOString().split('T')[0]}. Give me weather forecast for Warsaw for next 5 days.`,
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
log.info('reply', { reply });
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
describe.skip('invoke api directly', { timeout: 10_000 }, () => {
|
|
111
|
-
test('amadeus flight availabilities', async () => {
|
|
112
|
-
const response = await fetch('https://test.api.amadeus.com/v1/shopping/availability/flight-availabilities', {
|
|
113
|
-
method: 'POST',
|
|
114
|
-
headers: {
|
|
115
|
-
accept: 'application/vnd.amadeus+json',
|
|
116
|
-
'X-HTTP-Method-Override': 'GET',
|
|
117
|
-
'Content-Type': 'application/vnd.amadeus+json',
|
|
118
|
-
Authorization: await resolveAuthorization(AMADEUS_AUTH),
|
|
119
|
-
},
|
|
120
|
-
body: JSON.stringify({
|
|
121
|
-
originDestinations: [
|
|
122
|
-
{
|
|
123
|
-
departureDateTime: {
|
|
124
|
-
date: new Date().toISOString().split('T')[0],
|
|
125
|
-
time: new Date().toTimeString().split(' ')[0],
|
|
126
|
-
},
|
|
127
|
-
destinationLocationCode: 'MAD',
|
|
128
|
-
id: '1',
|
|
129
|
-
originLocationCode: 'BOS',
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
sources: ['GDS'],
|
|
133
|
-
travelers: [
|
|
134
|
-
{
|
|
135
|
-
id: '1',
|
|
136
|
-
travelerType: 'ADULT',
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
}),
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
log.info('response', { status: response.status, body: await response.json() });
|
|
143
|
-
expect(response.status).toBe(200);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
test.only('amadeus hotel name autocomplete', async () => {
|
|
147
|
-
const response = await fetch(
|
|
148
|
-
'https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subtype=HOTEL_LEISURE,HOTEL_GDS',
|
|
149
|
-
{
|
|
150
|
-
method: 'GET',
|
|
151
|
-
headers: {
|
|
152
|
-
// accept: 'application/vnd.amadeus+json',
|
|
153
|
-
// 'X-HTTP-Method-Override': 'GET',
|
|
154
|
-
Authorization: await resolveAuthorization(AMADEUS_AUTH),
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
log.info('response', { status: response.status, body: await response.json() });
|
|
160
|
-
expect(response.status).toBe(200);
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
describe.skip('rapidapi', () => {
|
|
165
|
-
test('amadeus flight availabilities', async () => {
|
|
166
|
-
const departureDate = new Date().toISOString().split('T')[0];
|
|
167
|
-
const arrivalDate = new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0];
|
|
168
|
-
|
|
169
|
-
const url = `https://amadeus-api2.p.rapidapi.com/serpapi-flight-search?departure_id=PEK&arrival_id=AUS&outbound_date=${departureDate}&return_date=${arrivalDate}¤cy=USD&hl=en`;
|
|
170
|
-
const options = {
|
|
171
|
-
method: 'GET',
|
|
172
|
-
headers: {
|
|
173
|
-
'x-rapidapi-key': RAPID_API_CREDENTIALS.key,
|
|
174
|
-
'x-rapidapi-host': 'amadeus-api2.p.rapidapi.com',
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
const response = await fetch(url, options);
|
|
179
|
-
log.info('response', { status: response.status, body: await response.json() });
|
|
180
|
-
expect(response.status).toBe(200);
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
const FLIGHT_SEARCH_API =
|
|
186
|
-
'https://api.apis.guru/v2/specs/amadeus.com/amadeus-flight-availabilities-search/1.0.2/swagger.json';
|
|
187
|
-
const HOTEL_SEARCH_API = 'https://api.apis.guru/v2/specs/amadeus.com/amadeus-hotel-search/3.0.8/swagger.json';
|
|
188
|
-
const HOTEL_NAME_AUTOCOMPLETE_API =
|
|
189
|
-
'https://api.apis.guru/v2/specs/amadeus.com/amadeus-hotel-name-autocomplete/1.0.3/swagger.json';
|
|
190
|
-
const WEATHER_API = 'https://api.apis.guru/v2/specs/visualcrossing.com/weather/4.6/openapi.json';
|
|
191
|
-
|
|
192
|
-
const WEATHER_INSTRUCTIONS = `
|
|
193
|
-
If the user doesn't provide a date, use today's date.
|
|
194
|
-
Make sure to provide the start and end dates when possible to reduce the amount of data returned.
|
|
195
|
-
Use the tool that accepts the date parameters.
|
|
196
|
-
`;
|
|
197
|
-
|
|
198
|
-
const AMADEUS_AUTH: ApiAuthorization = {
|
|
199
|
-
type: 'oauth',
|
|
200
|
-
clientId: 'BOEnpLd1sMyKjAPGKYeAPFFy60u53QEG',
|
|
201
|
-
clientSecret: 'n4qldSN7usvD57gm',
|
|
202
|
-
tokenUrl: 'https://test.api.amadeus.com/v1/security/oauth2/token',
|
|
203
|
-
grantType: 'client_credentials',
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const VISUAL_CROSSING_CREDENTIALS: ApiAuthorization = {
|
|
207
|
-
type: 'api-key',
|
|
208
|
-
key: 'FDPRVS953KB4GQQLD25GRT975',
|
|
209
|
-
placement: {
|
|
210
|
-
type: 'query',
|
|
211
|
-
name: 'key',
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
const RAPID_API_CREDENTIALS = {
|
|
216
|
-
key: '92271b6740msh32fd821d70f050dp16665bjsna69195c9e838',
|
|
217
|
-
};
|