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