@dxos/plugin-assistant 0.8.1-staging.5be625a → 0.8.1-staging.97aedb1
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/{AssistantDialog-EIUUSXDS.mjs → AssistantDialog-YSHMAHW5.mjs} +9 -9
- package/dist/lib/browser/AssistantDialog-YSHMAHW5.mjs.map +7 -0
- package/dist/lib/browser/{ChatContainer-NHHA6CSP.mjs → ChatContainer-V5GP7DYF.mjs} +11 -11
- package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs.map +7 -0
- package/dist/lib/browser/{TemplateContainer-7IQ6V5AD.mjs → TemplateContainer-K4EJNGIL.mjs} +7 -7
- package/dist/lib/browser/{TemplateContainer-7IQ6V5AD.mjs.map → TemplateContainer-K4EJNGIL.mjs.map} +2 -2
- package/dist/lib/browser/{ai-client-BAPVMSNX.mjs → ai-client-CDZLSNXE.mjs} +4 -4
- package/dist/lib/browser/{app-graph-builder-DTCUWBKB.mjs → app-graph-builder-MF5EVDWW.mjs} +63 -8
- package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AF7VQAKS.mjs → chunk-3HCI5FIL.mjs} +2 -2
- package/dist/lib/browser/{chunk-KGIACFAX.mjs → chunk-FMB7RGMP.mjs} +69 -65
- package/dist/lib/browser/{chunk-KGIACFAX.mjs.map → chunk-FMB7RGMP.mjs.map} +3 -3
- package/dist/lib/browser/chunk-IAMR2FAE.mjs +183 -0
- package/dist/lib/browser/chunk-IAMR2FAE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-25APJ3ZK.mjs → chunk-KYMKVE6M.mjs} +10 -10
- package/dist/lib/browser/{chunk-6FTPLBSC.mjs → chunk-NFUHCW2J.mjs} +3 -3
- package/dist/lib/browser/{chunk-SVUCJXGN.mjs → chunk-TXJWGWJ7.mjs} +3 -3
- package/dist/lib/browser/index.mjs +18 -32
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-U57FXP3I.mjs → intent-resolver-WJGLKKVO.mjs} +5 -6
- package/dist/lib/browser/{intent-resolver-U57FXP3I.mjs.map → intent-resolver-WJGLKKVO.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-YNN5NYJW.mjs → react-surface-57VRDOQT.mjs} +34 -14
- package/dist/lib/browser/react-surface-57VRDOQT.mjs.map +7 -0
- package/dist/lib/browser/{settings-VAW6UWFL.mjs → settings-U6UFQX32.mjs} +4 -4
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node/{AssistantDialog-GT7R7MKH.cjs → AssistantDialog-YI2BSGSX.cjs} +12 -12
- package/dist/lib/node/AssistantDialog-YI2BSGSX.cjs.map +7 -0
- package/dist/lib/node/{ChatContainer-JUZOEZZ7.cjs → ChatContainer-ZJ5JXF6A.cjs} +15 -15
- package/dist/lib/node/ChatContainer-ZJ5JXF6A.cjs.map +7 -0
- package/dist/lib/node/{TemplateContainer-VPAZRFQA.cjs → TemplateContainer-XWFYJB4T.cjs} +12 -12
- package/dist/lib/node/{TemplateContainer-VPAZRFQA.cjs.map → TemplateContainer-XWFYJB4T.cjs.map} +2 -2
- package/dist/lib/node/{ai-client-5ESLYXAV.cjs → ai-client-URCCYU6B.cjs} +8 -8
- package/dist/lib/node/{app-graph-builder-3P6WSON2.cjs → app-graph-builder-N5ZUUI2Z.cjs} +82 -27
- package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs.map +7 -0
- package/dist/lib/node/{chunk-KLSNCP34.cjs → chunk-APRU3QWK.cjs} +7 -8
- package/dist/lib/node/chunk-APRU3QWK.cjs.map +7 -0
- package/dist/lib/node/{chunk-VRXFIS4X.cjs → chunk-GBUNQ257.cjs} +6 -6
- package/dist/lib/node/{chunk-U6J2GO7I.cjs → chunk-Q5XWEMHB.cjs} +4 -4
- package/dist/lib/node/{chunk-JAB6KLPP.cjs → chunk-RPBKMP2E.cjs} +50 -46
- package/dist/lib/node/{chunk-JAB6KLPP.cjs.map → chunk-RPBKMP2E.cjs.map} +3 -3
- package/dist/lib/node/{chunk-N3SW6DJ6.cjs → chunk-XI2ARIEO.cjs} +6 -6
- package/dist/lib/node/{chunk-G2HY3UJ4.cjs → chunk-ZKOC4ZFY.cjs} +14 -14
- package/dist/lib/node/index.cjs +62 -76
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-YIFAMM3B.cjs → intent-resolver-R3OSTIMH.cjs} +11 -12
- package/dist/lib/node/intent-resolver-R3OSTIMH.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-IDGIN55C.cjs → react-surface-NUQTM6MS.cjs} +46 -26
- package/dist/lib/node/react-surface-NUQTM6MS.cjs.map +7 -0
- package/dist/lib/node/{settings-2FEYGLYU.cjs → settings-TXGRCYAL.cjs} +8 -8
- package/dist/lib/node/types/index.cjs +13 -13
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{AssistantDialog-JMBFM6QH.mjs → AssistantDialog-U2FQX5TD.mjs} +9 -9
- package/dist/lib/node-esm/AssistantDialog-U2FQX5TD.mjs.map +7 -0
- package/dist/lib/node-esm/{ChatContainer-ZNN5CMVL.mjs → ChatContainer-QW3OOXTT.mjs} +11 -11
- package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs.map +7 -0
- package/dist/lib/node-esm/{TemplateContainer-YLA6BJY6.mjs → TemplateContainer-EUM2X65J.mjs} +7 -7
- package/dist/lib/node-esm/{TemplateContainer-YLA6BJY6.mjs.map → TemplateContainer-EUM2X65J.mjs.map} +2 -2
- package/dist/lib/node-esm/{ai-client-XYZ5N7CR.mjs → ai-client-WMHS5EGV.mjs} +4 -4
- package/dist/lib/node-esm/{app-graph-builder-PMAQLTTN.mjs → app-graph-builder-DWBNIMHM.mjs} +63 -8
- package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2CIYX3SD.mjs → chunk-6JK5HEUQ.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-N6BVC2C2.mjs → chunk-ECRK6TUQ.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-SMUINDXQ.mjs → chunk-GBBXIW5F.mjs} +10 -10
- package/dist/lib/node-esm/{chunk-PK5JCOYB.mjs → chunk-MVDAY3CZ.mjs} +69 -65
- package/dist/lib/node-esm/{chunk-PK5JCOYB.mjs.map → chunk-MVDAY3CZ.mjs.map} +3 -3
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs +184 -0
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-J63VQFQO.mjs → chunk-PBZA7XJR.mjs} +3 -3
- package/dist/lib/node-esm/index.mjs +18 -32
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-SQ4HLL5L.mjs → intent-resolver-H32TL4X6.mjs} +5 -6
- package/dist/lib/node-esm/{intent-resolver-SQ4HLL5L.mjs.map → intent-resolver-H32TL4X6.mjs.map} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-424JZTZ4.mjs → react-surface-JBVZF6CP.mjs} +34 -14
- package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-VHR5KT4J.mjs → settings-DZU5PNXM.mjs} +4 -4
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +4 -2
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +3 -3
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts +2 -0
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +3 -3
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts +3 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/chat.d.ts +4 -6
- package/dist/types/src/types/chat.d.ts.map +1 -1
- package/package.json +57 -55
- package/src/AssistantPlugin.tsx +8 -19
- package/src/capabilities/app-graph-builder.ts +53 -2
- package/src/capabilities/intent-resolver.ts +3 -2
- package/src/capabilities/react-surface.tsx +25 -8
- package/src/components/AmbientDialog/AmbientDialog.stories.tsx +3 -1
- package/src/components/AssistantDialog.tsx +1 -1
- package/src/components/ChatContainer.tsx +18 -4
- package/src/components/Prompt/PromptBar.tsx +2 -2
- package/src/components/TemplateContainer.tsx +1 -1
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -4
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -2
- package/src/components/Thread/Thread.stories.tsx +3 -3
- package/src/components/Thread/ThreadContainer.stories.tsx +4 -4
- package/src/components/Thread/ThreadContainer.tsx +4 -1
- package/src/components/Toolbox/Toolbox.stories.tsx +2 -2
- package/src/hooks/processor.ts +1 -1
- package/src/hooks/useChatProcessor.tsx +12 -4
- package/src/hooks/useMessageQueue.ts +2 -2
- package/src/translations.ts +1 -0
- package/src/types/chat.ts +2 -3
- package/dist/lib/browser/AssistantDialog-EIUUSXDS.mjs.map +0 -7
- package/dist/lib/browser/ChatContainer-NHHA6CSP.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DTCUWBKB.mjs.map +0 -7
- package/dist/lib/browser/chunk-X6ALDUA5.mjs +0 -184
- package/dist/lib/browser/chunk-X6ALDUA5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-YNN5NYJW.mjs.map +0 -7
- package/dist/lib/node/AssistantDialog-GT7R7MKH.cjs.map +0 -7
- package/dist/lib/node/ChatContainer-JUZOEZZ7.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-3P6WSON2.cjs.map +0 -7
- package/dist/lib/node/chunk-KLSNCP34.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-YIFAMM3B.cjs.map +0 -7
- package/dist/lib/node/react-surface-IDGIN55C.cjs.map +0 -7
- package/dist/lib/node-esm/AssistantDialog-JMBFM6QH.mjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-ZNN5CMVL.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PMAQLTTN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NMMRHHAR.mjs +0 -185
- package/dist/lib/node-esm/chunk-NMMRHHAR.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-424JZTZ4.mjs.map +0 -7
- package/dist/types/src/hooks/email.d.ts +0 -4
- package/dist/types/src/hooks/email.d.ts.map +0 -1
- package/src/hooks/email.ts +0 -49
- /package/dist/lib/browser/{ai-client-BAPVMSNX.mjs.map → ai-client-CDZLSNXE.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-AF7VQAKS.mjs.map → chunk-3HCI5FIL.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-25APJ3ZK.mjs.map → chunk-KYMKVE6M.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-6FTPLBSC.mjs.map → chunk-NFUHCW2J.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-SVUCJXGN.mjs.map → chunk-TXJWGWJ7.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-VAW6UWFL.mjs.map → settings-U6UFQX32.mjs.map} +0 -0
- /package/dist/lib/node/{ai-client-5ESLYXAV.cjs.map → ai-client-URCCYU6B.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-VRXFIS4X.cjs.map → chunk-GBUNQ257.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-U6J2GO7I.cjs.map → chunk-Q5XWEMHB.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-N3SW6DJ6.cjs.map → chunk-XI2ARIEO.cjs.map} +0 -0
- /package/dist/lib/node/{chunk-G2HY3UJ4.cjs.map → chunk-ZKOC4ZFY.cjs.map} +0 -0
- /package/dist/lib/node/{settings-2FEYGLYU.cjs.map → settings-TXGRCYAL.cjs.map} +0 -0
- /package/dist/lib/node-esm/{ai-client-XYZ5N7CR.mjs.map → ai-client-WMHS5EGV.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-2CIYX3SD.mjs.map → chunk-6JK5HEUQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-N6BVC2C2.mjs.map → chunk-ECRK6TUQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-SMUINDXQ.mjs.map → chunk-GBBXIW5F.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-J63VQFQO.mjs.map → chunk-PBZA7XJR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-VHR5KT4J.mjs.map → settings-DZU5PNXM.mjs.map} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AssistantCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TXJWGWJ7.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ServiceType,
|
|
6
6
|
categoryIcons
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IAMR2FAE.mjs";
|
|
8
8
|
import {
|
|
9
9
|
ASSISTANT_PLUGIN
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3HCI5FIL.mjs";
|
|
11
11
|
|
|
12
|
-
// packages/plugins/
|
|
12
|
+
// packages/plugins/plugin-assistant/src/components/Toolbox/Toolbox.tsx
|
|
13
13
|
import React, { useState, useEffect, Fragment } from "react";
|
|
14
14
|
import { Capabilities, useCapabilities } from "@dxos/app-framework";
|
|
15
15
|
import { parseToolName } from "@dxos/artifact";
|
|
@@ -18,13 +18,13 @@ import { log as log3 } from "@dxos/log";
|
|
|
18
18
|
import { Filter, useQuery } from "@dxos/react-client/echo";
|
|
19
19
|
import { mx } from "@dxos/react-ui-theme";
|
|
20
20
|
|
|
21
|
-
// packages/plugins/
|
|
21
|
+
// packages/plugins/plugin-assistant/src/tools/function.ts
|
|
22
22
|
import { defineTool, ToolResult } from "@dxos/artifact";
|
|
23
23
|
import { toEffectSchema } from "@dxos/echo-schema";
|
|
24
24
|
import { getInvocationUrl, getUserFunctionUrlInMetadata } from "@dxos/functions/types";
|
|
25
25
|
import { log } from "@dxos/log";
|
|
26
26
|
import { getMeta } from "@dxos/react-client/echo";
|
|
27
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
27
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/tools/function.ts";
|
|
28
28
|
var covertFunctionToTool = (fn, edgeUrl, spaceId) => {
|
|
29
29
|
if (!fn.description || !fn.inputSchema) {
|
|
30
30
|
return void 0;
|
|
@@ -63,14 +63,14 @@ var covertFunctionToTool = (fn, edgeUrl, spaceId) => {
|
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
// packages/plugins/
|
|
66
|
+
// packages/plugins/plugin-assistant/src/tools/openapi.ts
|
|
67
67
|
import jsonpointer from "jsonpointer";
|
|
68
68
|
import { ToolResult as ToolResult2 } from "@dxos/artifact";
|
|
69
69
|
import { JsonSchemaType, normalizeSchema, S, toEffectSchema as toEffectSchema2 } from "@dxos/echo-schema";
|
|
70
70
|
import { invariant } from "@dxos/invariant";
|
|
71
71
|
import { log as log2 } from "@dxos/log";
|
|
72
72
|
import { deepMapValues } from "@dxos/util";
|
|
73
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
73
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/tools/openapi.ts";
|
|
74
74
|
var createToolsFromService = async (service) => {
|
|
75
75
|
invariant(service.interfaces?.length === 1 && service.interfaces[0].kind === "api", void 0, {
|
|
76
76
|
F: __dxlog_file2,
|
|
@@ -450,8 +450,8 @@ var isV3_1 = (document2) => {
|
|
|
450
450
|
return document2.openapi === "3.0.1";
|
|
451
451
|
};
|
|
452
452
|
|
|
453
|
-
// packages/plugins/
|
|
454
|
-
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
453
|
+
// packages/plugins/plugin-assistant/src/components/Toolbox/Toolbox.tsx
|
|
454
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/components/Toolbox/Toolbox.tsx";
|
|
455
455
|
var Toolbox = ({ classNames, artifacts, functions, services, striped }) => {
|
|
456
456
|
return /* @__PURE__ */ React.createElement("div", {
|
|
457
457
|
className: mx("flex flex-col overflow-y-auto box-content", classNames)
|
|
@@ -540,14 +540,14 @@ var ToolboxContainer = ({ classNames, space }) => {
|
|
|
540
540
|
});
|
|
541
541
|
};
|
|
542
542
|
|
|
543
|
-
// packages/plugins/
|
|
543
|
+
// packages/plugins/plugin-assistant/src/components/Thread/Thread.tsx
|
|
544
544
|
import React6, { useCallback, useMemo as useMemo2, useRef as useRef3 } from "react";
|
|
545
545
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
546
546
|
import { ScrollContainer } from "@dxos/react-ui-components";
|
|
547
547
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
548
548
|
import { keyToFallback } from "@dxos/util";
|
|
549
549
|
|
|
550
|
-
// packages/plugins/
|
|
550
|
+
// packages/plugins/plugin-assistant/src/components/Thread/ThreadMessage.tsx
|
|
551
551
|
import React3 from "react";
|
|
552
552
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
553
553
|
import { Button, Icon, IconButton } from "@dxos/react-ui";
|
|
@@ -556,13 +556,13 @@ import { Json as Json2 } from "@dxos/react-ui-syntax-highlighter";
|
|
|
556
556
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
557
557
|
import { safeParseJson } from "@dxos/util";
|
|
558
558
|
|
|
559
|
-
// packages/plugins/
|
|
559
|
+
// packages/plugins/plugin-assistant/src/components/Thread/ToolInvocations.tsx
|
|
560
560
|
import React2, { useEffect as useEffect2, useMemo, useRef, useState as useState2 } from "react";
|
|
561
561
|
import { log as log4 } from "@dxos/log";
|
|
562
562
|
import { NumericTabs, StatusRoll, ToggleContainer } from "@dxos/react-ui-components";
|
|
563
563
|
import { Json } from "@dxos/react-ui-syntax-highlighter";
|
|
564
564
|
import { isNonNullable, isNotFalsy } from "@dxos/util";
|
|
565
|
-
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
565
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/components/Thread/ToolInvocations.tsx";
|
|
566
566
|
var isToolMessage = (message) => {
|
|
567
567
|
return message.content.some((block) => block.type === "tool_use" || block.type === "tool_result");
|
|
568
568
|
};
|
|
@@ -678,8 +678,8 @@ var ToolContainer = ({ classNames, items }) => {
|
|
|
678
678
|
})));
|
|
679
679
|
};
|
|
680
680
|
|
|
681
|
-
// packages/plugins/
|
|
682
|
-
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
681
|
+
// packages/plugins/plugin-assistant/src/components/Thread/ThreadMessage.tsx
|
|
682
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/components/Thread/ThreadMessage.tsx";
|
|
683
683
|
var panelClassNames = "flex flex-col w-full px-2 bg-groupSurface rounded-md";
|
|
684
684
|
var userClassNames = "bg-[--user-fill] text-inverse";
|
|
685
685
|
var ToggleContainer2 = (props) => {
|
|
@@ -844,7 +844,7 @@ var titles = {
|
|
|
844
844
|
["tool_list"]: "Tools"
|
|
845
845
|
};
|
|
846
846
|
|
|
847
|
-
// packages/plugins/
|
|
847
|
+
// packages/plugins/plugin-assistant/src/components/Thread/reducer.ts
|
|
848
848
|
var messageReducer = ({ current, messages }, message) => {
|
|
849
849
|
let i = 0;
|
|
850
850
|
for (const block of message.content) {
|
|
@@ -892,14 +892,14 @@ var messageReducer = ({ current, messages }, message) => {
|
|
|
892
892
|
};
|
|
893
893
|
};
|
|
894
894
|
|
|
895
|
-
// packages/plugins/
|
|
895
|
+
// packages/plugins/plugin-assistant/src/components/Prompt/Prompt.tsx
|
|
896
896
|
import { Prec as Prec2 } from "@codemirror/state";
|
|
897
897
|
import React4, { forwardRef, useImperativeHandle } from "react";
|
|
898
898
|
import { useThemeContext } from "@dxos/react-ui";
|
|
899
899
|
import { createBasicExtensions, createThemeExtensions, keymap as keymap3, useTextEditor } from "@dxos/react-ui-editor";
|
|
900
900
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
901
901
|
|
|
902
|
-
// packages/plugins/
|
|
902
|
+
// packages/plugins/plugin-assistant/src/components/Prompt/autocomplete.ts
|
|
903
903
|
import { Prec } from "@codemirror/state";
|
|
904
904
|
import { EditorView, Decoration, ViewPlugin, keymap, WidgetType } from "@codemirror/view";
|
|
905
905
|
var createAutocompleteExtension = ({ onSubmit, onSuggest }) => {
|
|
@@ -1053,7 +1053,7 @@ var InlineSuggestionWidget = class extends WidgetType {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
};
|
|
1055
1055
|
|
|
1056
|
-
// packages/plugins/
|
|
1056
|
+
// packages/plugins/plugin-assistant/src/components/Prompt/references.ts
|
|
1057
1057
|
import { autocompletion, completionKeymap } from "@codemirror/autocomplete";
|
|
1058
1058
|
import { RangeSet } from "@codemirror/state";
|
|
1059
1059
|
import { Decoration as Decoration2, EditorView as EditorView2, keymap as keymap2, ViewPlugin as ViewPlugin2, WidgetType as WidgetType2 } from "@codemirror/view";
|
|
@@ -1169,7 +1169,7 @@ var ReferenceWidget = class extends WidgetType2 {
|
|
|
1169
1169
|
}
|
|
1170
1170
|
};
|
|
1171
1171
|
|
|
1172
|
-
// packages/plugins/
|
|
1172
|
+
// packages/plugins/plugin-assistant/src/components/Prompt/Prompt.tsx
|
|
1173
1173
|
var Prompt = /* @__PURE__ */ forwardRef(({ classNames, autoFocus, lineWrapping = false, placeholder, onSubmit, onSuggest, onOpenChange, references }, forwardRef2) => {
|
|
1174
1174
|
const { themeMode } = useThemeContext();
|
|
1175
1175
|
const { parentRef, view } = useTextEditor({
|
|
@@ -1244,12 +1244,12 @@ var Prompt = /* @__PURE__ */ forwardRef(({ classNames, autoFocus, lineWrapping =
|
|
|
1244
1244
|
});
|
|
1245
1245
|
});
|
|
1246
1246
|
|
|
1247
|
-
// packages/plugins/
|
|
1247
|
+
// packages/plugins/plugin-assistant/src/components/Prompt/PromptBar.tsx
|
|
1248
1248
|
import React5, { useRef as useRef2, useState as useState3 } from "react";
|
|
1249
1249
|
import { useVoiceInput } from "@dxos/plugin-transcription";
|
|
1250
1250
|
import { Icon as Icon2, IconButton as IconButton2, Tooltip, useTranslation } from "@dxos/react-ui";
|
|
1251
1251
|
import { Spinner } from "@dxos/react-ui-sfx";
|
|
1252
|
-
import { errorText, mx as mx4 } from "@dxos/react-ui-theme";
|
|
1252
|
+
import { errorMessageColors, errorText, mx as mx4 } from "@dxos/react-ui-theme";
|
|
1253
1253
|
var PromptBar = ({ classNames, placeholder, processing, error, microphone, onCancel, references, ...props }) => {
|
|
1254
1254
|
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
1255
1255
|
const promptRef = useRef2(null);
|
|
@@ -1272,7 +1272,7 @@ var PromptBar = ({ classNames, placeholder, processing, error, microphone, onCan
|
|
|
1272
1272
|
classNames: errorText,
|
|
1273
1273
|
size: 5
|
|
1274
1274
|
})), /* @__PURE__ */ React5.createElement(Tooltip.Portal, null, /* @__PURE__ */ React5.createElement(Tooltip.Content, null, /* @__PURE__ */ React5.createElement("div", {
|
|
1275
|
-
className: "text-sm
|
|
1275
|
+
className: mx4("text-sm", errorMessageColors)
|
|
1276
1276
|
}, error.message), /* @__PURE__ */ React5.createElement(Tooltip.Arrow, null)))) || /* @__PURE__ */ React5.createElement(Spinner, {
|
|
1277
1277
|
active: processing
|
|
1278
1278
|
})), /* @__PURE__ */ React5.createElement(Prompt, {
|
|
@@ -1308,7 +1308,7 @@ var PromptBar = ({ classNames, placeholder, processing, error, microphone, onCan
|
|
|
1308
1308
|
})));
|
|
1309
1309
|
};
|
|
1310
1310
|
|
|
1311
|
-
// packages/plugins/
|
|
1311
|
+
// packages/plugins/plugin-assistant/src/components/Thread/Thread.tsx
|
|
1312
1312
|
var Thread = ({ classNames, space, messages, collapse = true, transcription, processing, error, onSubmit, onCancel, onOpenChange, contextProvider, ...props }) => {
|
|
1313
1313
|
const scroller = useRef3(null);
|
|
1314
1314
|
const identity = useIdentity();
|
|
@@ -1379,18 +1379,18 @@ var Thread = ({ classNames, space, messages, collapse = true, transcription, pro
|
|
|
1379
1379
|
}));
|
|
1380
1380
|
};
|
|
1381
1381
|
|
|
1382
|
-
// packages/plugins/
|
|
1382
|
+
// packages/plugins/plugin-assistant/src/components/Thread/ThreadContainer.tsx
|
|
1383
1383
|
import React7, { useCallback as useCallback3 } from "react";
|
|
1384
1384
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
1385
1385
|
import { log as log10 } from "@dxos/log";
|
|
1386
1386
|
import { getSpace as getSpace2 } from "@dxos/react-client/echo";
|
|
1387
1387
|
|
|
1388
|
-
// packages/plugins/
|
|
1388
|
+
// packages/plugins/plugin-assistant/src/hooks/processor.ts
|
|
1389
1389
|
import { batch, computed, signal } from "@preact/signals-core";
|
|
1390
1390
|
import { AISession, DEFAULT_EDGE_MODEL } from "@dxos/assistant";
|
|
1391
1391
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1392
1392
|
import { log as log5 } from "@dxos/log";
|
|
1393
|
-
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
1393
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/processor.ts";
|
|
1394
1394
|
var defaultOptions = {
|
|
1395
1395
|
model: DEFAULT_EDGE_MODEL,
|
|
1396
1396
|
systemPrompt: "you are a helpful assistant"
|
|
@@ -1477,10 +1477,10 @@ var ChatProcessor = class {
|
|
|
1477
1477
|
artifacts: this._artifacts ?? [],
|
|
1478
1478
|
tools: this._tools ?? [],
|
|
1479
1479
|
prompt: message,
|
|
1480
|
+
systemPrompt: this._options.systemPrompt,
|
|
1480
1481
|
extensions: this._extensions,
|
|
1481
1482
|
generationOptions: {
|
|
1482
|
-
model: this._options.model
|
|
1483
|
-
systemPrompt: this._options.systemPrompt
|
|
1483
|
+
model: this._options.model
|
|
1484
1484
|
}
|
|
1485
1485
|
});
|
|
1486
1486
|
log5.info("completed", {
|
|
@@ -1543,7 +1543,7 @@ var AIServiceOverloadedError = class extends Error {
|
|
|
1543
1543
|
}
|
|
1544
1544
|
};
|
|
1545
1545
|
|
|
1546
|
-
// packages/plugins/
|
|
1546
|
+
// packages/plugins/plugin-assistant/src/hooks/useChatProcessor.tsx
|
|
1547
1547
|
import { useEffect as useEffect3, useMemo as useMemo3, useState as useState4 } from "react";
|
|
1548
1548
|
import { Capabilities as Capabilities2, useCapabilities as useCapabilities2, useCapability, useIntentDispatcher } from "@dxos/app-framework";
|
|
1549
1549
|
import { createSystemPrompt } from "@dxos/artifact";
|
|
@@ -1554,17 +1554,17 @@ import { useConfig } from "@dxos/react-client";
|
|
|
1554
1554
|
import { Filter as Filter2, fullyQualifiedId, useQuery as useQuery2 } from "@dxos/react-client/echo";
|
|
1555
1555
|
import { isNonNullable as isNonNullable2 } from "@dxos/util";
|
|
1556
1556
|
|
|
1557
|
-
// packages/plugins/
|
|
1557
|
+
// packages/plugins/plugin-assistant/src/capabilities/index.ts
|
|
1558
1558
|
import { lazy } from "@dxos/app-framework";
|
|
1559
|
-
var AiClient = lazy(() => import("./ai-client-
|
|
1560
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
1561
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
1562
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
1563
|
-
var AssistantSettings = lazy(() => import("./settings-
|
|
1559
|
+
var AiClient = lazy(() => import("./ai-client-CDZLSNXE.mjs"));
|
|
1560
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-MF5EVDWW.mjs"));
|
|
1561
|
+
var IntentResolver = lazy(() => import("./intent-resolver-WJGLKKVO.mjs"));
|
|
1562
|
+
var ReactSurface = lazy(() => import("./react-surface-57VRDOQT.mjs"));
|
|
1563
|
+
var AssistantSettings = lazy(() => import("./settings-U6UFQX32.mjs"));
|
|
1564
1564
|
|
|
1565
|
-
// packages/plugins/
|
|
1566
|
-
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
1567
|
-
var useChatProcessor = ({ chat, space, settings, part = "deck" }) => {
|
|
1565
|
+
// packages/plugins/plugin-assistant/src/hooks/useChatProcessor.tsx
|
|
1566
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/useChatProcessor.tsx";
|
|
1567
|
+
var useChatProcessor = ({ chat, space, settings, part = "deck", associatedArtifact }) => {
|
|
1568
1568
|
const aiClient = useCapability(AssistantCapabilities.AiClient);
|
|
1569
1569
|
const globalTools = useCapabilities2(Capabilities2.Tools);
|
|
1570
1570
|
const artifactDefinitions = useCapabilities2(Capabilities2.ArtifactDefinition);
|
|
@@ -1574,7 +1574,7 @@ var useChatProcessor = ({ chat, space, settings, part = "deck" }) => {
|
|
|
1574
1574
|
useEffect3(() => {
|
|
1575
1575
|
log6("creating service tools...", void 0, {
|
|
1576
1576
|
F: __dxlog_file7,
|
|
1577
|
-
L:
|
|
1577
|
+
L: 48,
|
|
1578
1578
|
S: void 0,
|
|
1579
1579
|
C: (f, a) => f(...a)
|
|
1580
1580
|
});
|
|
@@ -1593,7 +1593,7 @@ var useChatProcessor = ({ chat, space, settings, part = "deck" }) => {
|
|
|
1593
1593
|
const [tools, extensions] = useMemo3(() => {
|
|
1594
1594
|
log6("creating tools...", void 0, {
|
|
1595
1595
|
F: __dxlog_file7,
|
|
1596
|
-
L:
|
|
1596
|
+
L: 60,
|
|
1597
1597
|
S: void 0,
|
|
1598
1598
|
C: (f, a) => f(...a)
|
|
1599
1599
|
});
|
|
@@ -1621,9 +1621,12 @@ var useChatProcessor = ({ chat, space, settings, part = "deck" }) => {
|
|
|
1621
1621
|
functions
|
|
1622
1622
|
]);
|
|
1623
1623
|
const systemPrompt = useMemo3(() => createSystemPrompt({
|
|
1624
|
-
artifacts: artifactDefinitions.map((definition) => definition.
|
|
1624
|
+
artifacts: artifactDefinitions.map((definition) => `${definition.name}
|
|
1625
|
+
${definition.instructions}`),
|
|
1626
|
+
associatedArtifact
|
|
1625
1627
|
}), [
|
|
1626
|
-
artifactDefinitions
|
|
1628
|
+
artifactDefinitions,
|
|
1629
|
+
associatedArtifact
|
|
1627
1630
|
]);
|
|
1628
1631
|
const model = settings?.llmProvider === "ollama" ? settings?.ollamaModel ?? DEFAULT_OLLAMA_MODEL : settings?.edgeModel ?? DEFAULT_EDGE_MODEL2;
|
|
1629
1632
|
const processor = useMemo3(() => {
|
|
@@ -1631,7 +1634,7 @@ var useChatProcessor = ({ chat, space, settings, part = "deck" }) => {
|
|
|
1631
1634
|
settings
|
|
1632
1635
|
}, {
|
|
1633
1636
|
F: __dxlog_file7,
|
|
1634
|
-
L:
|
|
1637
|
+
L: 91,
|
|
1635
1638
|
S: void 0,
|
|
1636
1639
|
C: (f, a) => f(...a)
|
|
1637
1640
|
});
|
|
@@ -1649,7 +1652,7 @@ var useChatProcessor = ({ chat, space, settings, part = "deck" }) => {
|
|
|
1649
1652
|
return processor;
|
|
1650
1653
|
};
|
|
1651
1654
|
|
|
1652
|
-
// packages/plugins/
|
|
1655
|
+
// packages/plugins/plugin-assistant/src/hooks/useLocalTriggerManager.ts
|
|
1653
1656
|
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1654
1657
|
import { Mutex as Mutex2 } from "@dxos/async";
|
|
1655
1658
|
import { Context } from "@dxos/context";
|
|
@@ -1660,7 +1663,7 @@ import { log as log8 } from "@dxos/log";
|
|
|
1660
1663
|
import { useClient } from "@dxos/react-client";
|
|
1661
1664
|
import { Filter as Filter3, useQuery as useQuery3 } from "@dxos/react-client/echo";
|
|
1662
1665
|
|
|
1663
|
-
// packages/plugins/
|
|
1666
|
+
// packages/plugins/plugin-assistant/src/hooks/invocation-handler.ts
|
|
1664
1667
|
import { sleep } from "@dxos/async";
|
|
1665
1668
|
import { getObjectCore, ResultFormat } from "@dxos/echo-db";
|
|
1666
1669
|
import { FunctionType as FunctionType3, getUserFunctionUrlInMetadata as getUserFunctionUrlInMetadata2 } from "@dxos/functions/types";
|
|
@@ -1668,17 +1671,17 @@ import { invariant as invariant4 } from "@dxos/invariant";
|
|
|
1668
1671
|
import { DXN, LOCAL_SPACE_TAG } from "@dxos/keys";
|
|
1669
1672
|
import { log as log7 } from "@dxos/log";
|
|
1670
1673
|
|
|
1671
|
-
// packages/plugins/
|
|
1674
|
+
// packages/plugins/plugin-assistant/src/hooks/useLocalTriggerManager.ts
|
|
1672
1675
|
var registerTriggersMutex = new Mutex2();
|
|
1673
1676
|
|
|
1674
|
-
// packages/plugins/
|
|
1677
|
+
// packages/plugins/plugin-assistant/src/hooks/useMessageQueue.ts
|
|
1675
1678
|
import { useMemo as useMemo4 } from "react";
|
|
1676
1679
|
import { DXN as DXN2, QueueSubspaceTags } from "@dxos/keys";
|
|
1677
1680
|
import { getSpace, useQueue } from "@dxos/react-client/echo";
|
|
1678
1681
|
var useMessageQueue = (chat) => {
|
|
1679
1682
|
const space = getSpace(chat);
|
|
1680
1683
|
const queueDxn = useMemo4(() => {
|
|
1681
|
-
const dxn = space && chat?.
|
|
1684
|
+
const dxn = space && chat?.assistantChatQueue.dxn;
|
|
1682
1685
|
return dxn ? new DXN2(DXN2.kind.QUEUE, [
|
|
1683
1686
|
QueueSubspaceTags.DATA,
|
|
1684
1687
|
space.id,
|
|
@@ -1686,19 +1689,19 @@ var useMessageQueue = (chat) => {
|
|
|
1686
1689
|
]) : void 0;
|
|
1687
1690
|
}, [
|
|
1688
1691
|
space,
|
|
1689
|
-
chat?.
|
|
1692
|
+
chat?.assistantChatQueue.dxn
|
|
1690
1693
|
]);
|
|
1691
1694
|
return useQueue(queueDxn);
|
|
1692
1695
|
};
|
|
1693
1696
|
|
|
1694
|
-
// packages/plugins/
|
|
1697
|
+
// packages/plugins/plugin-assistant/src/hooks/useServices.ts
|
|
1695
1698
|
import { useEffect as useEffect5, useMemo as useMemo5, useState as useState6 } from "react";
|
|
1696
1699
|
|
|
1697
|
-
// packages/plugins/
|
|
1700
|
+
// packages/plugins/plugin-assistant/src/testing/test-functions.ts
|
|
1698
1701
|
import { createSystemPrompt as createSystemPrompt2 } from "@dxos/artifact";
|
|
1699
1702
|
import { DEFAULT_EDGE_MODEL as DEFAULT_EDGE_MODEL3 } from "@dxos/assistant";
|
|
1700
1703
|
|
|
1701
|
-
// packages/plugins/
|
|
1704
|
+
// packages/plugins/plugin-assistant/src/testing/test-services.ts
|
|
1702
1705
|
import { createStatic } from "@dxos/echo-schema";
|
|
1703
1706
|
var MockServiceRegistry = class {
|
|
1704
1707
|
async queryServices(query) {
|
|
@@ -1792,7 +1795,7 @@ var TEST_SERVICES = [
|
|
|
1792
1795
|
}))
|
|
1793
1796
|
];
|
|
1794
1797
|
|
|
1795
|
-
// packages/plugins/
|
|
1798
|
+
// packages/plugins/plugin-assistant/src/hooks/useServices.ts
|
|
1796
1799
|
var useServices = (space, query) => {
|
|
1797
1800
|
const registry = useMemo5(() => new MockServiceRegistry(), []);
|
|
1798
1801
|
const [services, setServices] = useState6([]);
|
|
@@ -1809,16 +1812,16 @@ var useServices = (space, query) => {
|
|
|
1809
1812
|
return services;
|
|
1810
1813
|
};
|
|
1811
1814
|
|
|
1812
|
-
// packages/plugins/
|
|
1815
|
+
// packages/plugins/plugin-assistant/src/hooks/useTextInputEvents.ts
|
|
1813
1816
|
import { useState as useState7, useCallback as useCallback2 } from "react";
|
|
1814
1817
|
|
|
1815
|
-
// packages/plugins/
|
|
1818
|
+
// packages/plugins/plugin-assistant/src/hooks/useContextProvider.ts
|
|
1816
1819
|
import { useMemo as useMemo6 } from "react";
|
|
1817
1820
|
import { Capabilities as Capabilities3, useCapabilities as useCapabilities3 } from "@dxos/app-framework";
|
|
1818
1821
|
import { getDXN, getLabel, getSchema } from "@dxos/echo-schema";
|
|
1819
1822
|
import { log as log9 } from "@dxos/log";
|
|
1820
1823
|
import { Filter as Filter4 } from "@dxos/react-client/echo";
|
|
1821
|
-
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
1824
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/useContextProvider.ts";
|
|
1822
1825
|
var stringMatch = (query, label) => label.toLowerCase().startsWith(query.toLowerCase());
|
|
1823
1826
|
var useContextProvider = (space) => {
|
|
1824
1827
|
const artifactDefinitions = useCapabilities3(Capabilities3.ArtifactDefinition);
|
|
@@ -1862,16 +1865,17 @@ var useContextProvider = (space) => {
|
|
|
1862
1865
|
]);
|
|
1863
1866
|
};
|
|
1864
1867
|
|
|
1865
|
-
// packages/plugins/
|
|
1866
|
-
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/plugins/
|
|
1867
|
-
var ThreadContainer = ({ classNames, chat, settings, part, onOpenChange, ...props }) => {
|
|
1868
|
+
// packages/plugins/plugin-assistant/src/components/Thread/ThreadContainer.tsx
|
|
1869
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/plugins/plugin-assistant/src/components/Thread/ThreadContainer.tsx";
|
|
1870
|
+
var ThreadContainer = ({ classNames, chat, settings, part, associatedArtifact, onOpenChange, ...props }) => {
|
|
1868
1871
|
const space = getSpace2(chat);
|
|
1869
1872
|
const contextProvider = useContextProvider(space);
|
|
1870
1873
|
const processor = useChatProcessor({
|
|
1871
1874
|
chat,
|
|
1872
1875
|
space,
|
|
1873
1876
|
settings,
|
|
1874
|
-
part
|
|
1877
|
+
part,
|
|
1878
|
+
associatedArtifact
|
|
1875
1879
|
});
|
|
1876
1880
|
const messageQueue = useMessageQueue(chat);
|
|
1877
1881
|
const messages = [
|
|
@@ -1882,7 +1886,7 @@ var ThreadContainer = ({ classNames, chat, settings, part, onOpenChange, ...prop
|
|
|
1882
1886
|
if (processor.streaming.value) {
|
|
1883
1887
|
log10.warn("ignoring submit; still processing.", void 0, {
|
|
1884
1888
|
F: __dxlog_file9,
|
|
1885
|
-
L:
|
|
1889
|
+
L: 44,
|
|
1886
1890
|
S: void 0,
|
|
1887
1891
|
C: (f, a) => f(...a)
|
|
1888
1892
|
});
|
|
@@ -1891,7 +1895,7 @@ var ThreadContainer = ({ classNames, chat, settings, part, onOpenChange, ...prop
|
|
|
1891
1895
|
onOpenChange?.(true);
|
|
1892
1896
|
invariant6(messageQueue, void 0, {
|
|
1893
1897
|
F: __dxlog_file9,
|
|
1894
|
-
L:
|
|
1898
|
+
L: 50,
|
|
1895
1899
|
S: void 0,
|
|
1896
1900
|
A: [
|
|
1897
1901
|
"messageQueue",
|
|
@@ -1945,4 +1949,4 @@ export {
|
|
|
1945
1949
|
Thread,
|
|
1946
1950
|
ThreadContainer
|
|
1947
1951
|
};
|
|
1948
|
-
//# sourceMappingURL=chunk-
|
|
1952
|
+
//# sourceMappingURL=chunk-FMB7RGMP.mjs.map
|