@dxos/plugin-assistant 0.8.2-main.12df754 → 0.8.2-main.2f9c567
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-77B4BSXR.mjs → AssistantDialog-WX6EKSXI.mjs} +3 -3
- package/dist/lib/browser/{ChatContainer-4AMJKO3T.mjs → ChatContainer-HMNWYDQ5.mjs} +3 -3
- package/dist/lib/browser/{ai-client-CDZLSNXE.mjs → ai-client-OK5SMYJC.mjs} +1 -1
- package/dist/lib/browser/{ai-client-CDZLSNXE.mjs.map → ai-client-OK5SMYJC.mjs.map} +2 -2
- package/dist/lib/browser/{app-graph-builder-GU6ZWSP4.mjs → app-graph-builder-J5ISIFTE.mjs} +5 -35
- package/dist/lib/browser/app-graph-builder-J5ISIFTE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FQ4L5NYW.mjs → chunk-4EXBK6UE.mjs} +95 -105
- package/dist/lib/browser/chunk-4EXBK6UE.mjs.map +7 -0
- package/dist/lib/browser/chunk-5P7U35RJ.mjs +192 -0
- package/dist/lib/browser/chunk-5P7U35RJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SBFJKCVU.mjs → chunk-J3V74ZRF.mjs} +24 -69
- package/dist/lib/browser/chunk-J3V74ZRF.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -8
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-YAQELTFQ.mjs → intent-resolver-MGHOSZY3.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-JOATHBJ4.mjs → react-surface-VP4ABBMH.mjs} +5 -14
- package/dist/lib/browser/react-surface-VP4ABBMH.mjs.map +7 -0
- package/dist/lib/browser/{settings-PAJLJEVW.mjs → settings-OZX7J65A.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +3 -1
- package/dist/lib/node/{AssistantDialog-7V7RRSIL.cjs → AssistantDialog-2OTAZADX.cjs} +7 -7
- package/dist/lib/node/{ChatContainer-UWYNOALW.cjs → ChatContainer-3CTBKBS2.cjs} +7 -7
- package/dist/lib/node/{ai-client-URCCYU6B.cjs → ai-client-3EVTLXTT.cjs} +4 -4
- package/dist/lib/node/{ai-client-URCCYU6B.cjs.map → ai-client-3EVTLXTT.cjs.map} +2 -2
- package/dist/lib/node/{app-graph-builder-CEMLCKAF.cjs → app-graph-builder-BBNLIGYJ.cjs} +12 -42
- package/dist/lib/node/app-graph-builder-BBNLIGYJ.cjs.map +7 -0
- package/dist/lib/node/chunk-VG2UQY4S.cjs +216 -0
- package/dist/lib/node/chunk-VG2UQY4S.cjs.map +7 -0
- package/dist/lib/node/{chunk-KWBQ5P7D.cjs → chunk-WFSXNO4H.cjs} +28 -69
- package/dist/lib/node/chunk-WFSXNO4H.cjs.map +7 -0
- package/dist/lib/node/{chunk-ENBPNIJZ.cjs → chunk-XC7A3KUG.cjs} +103 -106
- package/dist/lib/node/chunk-XC7A3KUG.cjs.map +7 -0
- package/dist/lib/node/index.cjs +41 -41
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-RNMYSJ3E.cjs → intent-resolver-Z2NTL2FV.cjs} +9 -9
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-7RIXMLMN.cjs → react-surface-HNXDAZ7C.cjs} +16 -24
- package/dist/lib/node/react-surface-HNXDAZ7C.cjs.map +7 -0
- package/dist/lib/node/{settings-JBEYMZ4S.cjs → settings-WLTC7XO5.cjs} +6 -6
- package/dist/lib/node/types/index.cjs +14 -12
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{AssistantDialog-N24M73FW.mjs → AssistantDialog-GNLPYXY4.mjs} +3 -3
- package/dist/lib/node-esm/{ChatContainer-KPWY5UK4.mjs → ChatContainer-FGHDDORQ.mjs} +3 -3
- package/dist/lib/node-esm/{ai-client-WMHS5EGV.mjs → ai-client-LYCBXZI7.mjs} +1 -1
- package/dist/lib/node-esm/{ai-client-WMHS5EGV.mjs.map → ai-client-LYCBXZI7.mjs.map} +2 -2
- package/dist/lib/node-esm/{app-graph-builder-Y45WYAWL.mjs → app-graph-builder-245AWCPJ.mjs} +5 -35
- package/dist/lib/node-esm/app-graph-builder-245AWCPJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PFWTW22U.mjs → chunk-G5LUEW72.mjs} +24 -69
- package/dist/lib/node-esm/chunk-G5LUEW72.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JE47GNTB.mjs → chunk-JX73NOSL.mjs} +95 -105
- package/dist/lib/node-esm/chunk-JX73NOSL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UZWYXNR5.mjs +193 -0
- package/dist/lib/node-esm/chunk-UZWYXNR5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -8
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-resolver-V2ZFI5C4.mjs → intent-resolver-DMQXPV2H.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-UUHNOYST.mjs → react-surface-NYXMBFPY.mjs} +5 -14
- package/dist/lib/node-esm/react-surface-NYXMBFPY.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-KAMA6RIY.mjs → settings-CLE57WEP.mjs} +2 -2
- package/dist/lib/node-esm/types/index.mjs +3 -1
- package/dist/types/src/capabilities/ai-client.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -2
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +2 -2
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts.map +1 -1
- package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
- package/dist/types/src/tools/function.d.ts +1 -1
- package/dist/types/src/tools/function.d.ts.map +1 -1
- package/dist/types/src/tools/openapi.d.ts.map +1 -1
- package/dist/types/src/types/service.d.ts +96 -95
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/dist/types/src/types/template.d.ts +52 -52
- package/dist/types/src/types/template.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +20 -18
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +61 -58
- package/src/AssistantPlugin.tsx +2 -2
- package/src/capabilities/ai-client.ts +0 -1
- package/src/capabilities/app-graph-builder.ts +2 -26
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/react-surface.tsx +2 -15
- package/src/components/AssistantSettings/AssistantSettings.tsx +28 -6
- package/src/components/PromptSettings.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
- package/src/components/Thread/ThreadContainer.stories.tsx +6 -5
- package/src/components/Thread/ThreadMessage.tsx +5 -2
- package/src/components/Toolbox/Toolbox.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/processor.ts +25 -2
- package/src/hooks/useChatProcessor.tsx +3 -2
- package/src/tools/function.ts +2 -2
- package/src/tools/openapi.ts +4 -3
- package/src/translations.ts +1 -1
- package/src/types/service.ts +39 -37
- package/src/types/template.ts +27 -25
- package/src/types/types.ts +20 -17
- package/dist/lib/browser/app-graph-builder-GU6ZWSP4.mjs.map +0 -7
- package/dist/lib/browser/chunk-FQ4L5NYW.mjs.map +0 -7
- package/dist/lib/browser/chunk-IAMR2FAE.mjs +0 -183
- package/dist/lib/browser/chunk-IAMR2FAE.mjs.map +0 -7
- package/dist/lib/browser/chunk-SBFJKCVU.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JOATHBJ4.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-CEMLCKAF.cjs.map +0 -7
- package/dist/lib/node/chunk-APRU3QWK.cjs +0 -206
- package/dist/lib/node/chunk-APRU3QWK.cjs.map +0 -7
- package/dist/lib/node/chunk-ENBPNIJZ.cjs.map +0 -7
- package/dist/lib/node/chunk-KWBQ5P7D.cjs.map +0 -7
- package/dist/lib/node/react-surface-7RIXMLMN.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-Y45WYAWL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JE47GNTB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs +0 -184
- package/dist/lib/node-esm/chunk-MXK2EANZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PFWTW22U.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UUHNOYST.mjs.map +0 -7
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -6
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +0 -8
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +0 -1
- package/dist/types/src/components/ServiceRegistry/index.d.ts +0 -2
- package/dist/types/src/components/ServiceRegistry/index.d.ts.map +0 -1
- package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
- package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
- package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
- package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +0 -49
- package/src/components/ServiceRegistry/ServiceRegistry.tsx +0 -76
- package/src/components/ServiceRegistry/index.ts +0 -5
- package/src/hooks/invocation-handler.ts +0 -107
- package/src/hooks/useLocalTriggerManager.ts +0 -82
- /package/dist/lib/browser/{AssistantDialog-77B4BSXR.mjs.map → AssistantDialog-WX6EKSXI.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-4AMJKO3T.mjs.map → ChatContainer-HMNWYDQ5.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-YAQELTFQ.mjs.map → intent-resolver-MGHOSZY3.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-PAJLJEVW.mjs.map → settings-OZX7J65A.mjs.map} +0 -0
- /package/dist/lib/node/{AssistantDialog-7V7RRSIL.cjs.map → AssistantDialog-2OTAZADX.cjs.map} +0 -0
- /package/dist/lib/node/{ChatContainer-UWYNOALW.cjs.map → ChatContainer-3CTBKBS2.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-RNMYSJ3E.cjs.map → intent-resolver-Z2NTL2FV.cjs.map} +0 -0
- /package/dist/lib/node/{settings-JBEYMZ4S.cjs.map → settings-WLTC7XO5.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AssistantDialog-N24M73FW.mjs.map → AssistantDialog-GNLPYXY4.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-KPWY5UK4.mjs.map → ChatContainer-FGHDDORQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-V2ZFI5C4.mjs.map → intent-resolver-DMQXPV2H.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-KAMA6RIY.mjs.map → settings-CLE57WEP.mjs.map} +0 -0
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { AIChatType } from './chat';
|
|
3
3
|
import { TemplateType } from './template';
|
|
4
4
|
export declare namespace AssistantAction {
|
|
5
|
-
const CreateChat_base:
|
|
6
|
-
readonly _tag:
|
|
5
|
+
const CreateChat_base: Schema.TaggedClass<CreateChat, "dxos.org/plugin/assistant/action/create-chat", {
|
|
6
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/assistant/action/create-chat">;
|
|
7
7
|
} & {
|
|
8
|
-
input:
|
|
9
|
-
spaceId:
|
|
10
|
-
name:
|
|
8
|
+
input: Schema.Struct<{
|
|
9
|
+
spaceId: Schema.optional<typeof Schema.String>;
|
|
10
|
+
name: Schema.optional<typeof Schema.String>;
|
|
11
11
|
}>;
|
|
12
|
-
output:
|
|
12
|
+
output: Schema.Struct<{
|
|
13
13
|
object: typeof AIChatType;
|
|
14
14
|
}>;
|
|
15
15
|
}>;
|
|
16
16
|
export class CreateChat extends CreateChat_base {
|
|
17
17
|
}
|
|
18
|
-
const CreateTemplate_base:
|
|
19
|
-
readonly _tag:
|
|
18
|
+
const CreateTemplate_base: Schema.TaggedClass<CreateTemplate, "dxos.org/plugin/assistant/action/create-template", {
|
|
19
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/assistant/action/create-template">;
|
|
20
20
|
} & {
|
|
21
|
-
input:
|
|
22
|
-
name:
|
|
21
|
+
input: Schema.Struct<{
|
|
22
|
+
name: Schema.optional<typeof Schema.String>;
|
|
23
23
|
}>;
|
|
24
|
-
output:
|
|
24
|
+
output: Schema.Struct<{
|
|
25
25
|
object: typeof TemplateType;
|
|
26
26
|
}>;
|
|
27
27
|
}>;
|
|
@@ -29,11 +29,13 @@ export declare namespace AssistantAction {
|
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
31
31
|
}
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
export declare const LLM_PROVIDERS: readonly ["edge", "ollama", "lmstudio"];
|
|
33
|
+
export declare const AssistantSettingsSchema: Schema.mutable<Schema.Struct<{
|
|
34
|
+
llmProvider: Schema.optional<Schema.Literal<["edge", "ollama", "lmstudio"]>>;
|
|
35
|
+
edgeModel: Schema.optional<typeof Schema.String>;
|
|
36
|
+
ollamaModel: Schema.optional<typeof Schema.String>;
|
|
37
|
+
lmstudioModel: Schema.optional<typeof Schema.String>;
|
|
38
|
+
customPrompts: Schema.optional<typeof Schema.Boolean>;
|
|
37
39
|
}>>;
|
|
38
|
-
export type AssistantSettingsProps =
|
|
40
|
+
export type AssistantSettingsProps = Schema.Schema.Type<typeof AssistantSettingsSchema>;
|
|
39
41
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,yBAAiB,eAAe,CAAC;;;;;;;;;;;;IAG/B,MAAM,OAAO,UAAW,SAAQ,eAQ9B;KAAG;;;;;;;;;;;IAEL,MAAM,OAAO,cAAe,SAAQ,mBAOlC;KAAG;;CACN;AAED,eAAO,MAAM,aAAa,yCAA0C,CAAC;AAErE,eAAO,MAAM,uBAAuB;;;;;;GAQnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-assistant",
|
|
3
|
-
"version": "0.8.2-main.
|
|
3
|
+
"version": "0.8.2-main.2f9c567",
|
|
4
4
|
"description": "Assistant plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -42,79 +42,82 @@
|
|
|
42
42
|
"@lezer/highlight": "^1.2.1",
|
|
43
43
|
"@preact/signals-core": "^1.6.0",
|
|
44
44
|
"@xiechao/codemirror-lang-handlebars": "1.0.4",
|
|
45
|
-
"effect": "3.
|
|
45
|
+
"effect": "3.14.21",
|
|
46
46
|
"jsonpointer": "^5.0.1",
|
|
47
47
|
"lodash.get": "^4.4.2",
|
|
48
48
|
"unified": "^11.0.0",
|
|
49
|
-
"@dxos/app-framework": "0.8.2-main.
|
|
50
|
-
"@dxos/assistant": "0.8.2-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/compute": "0.8.2-main.
|
|
54
|
-
"@dxos/conductor": "0.8.2-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/echo-db": "0.8.2-main.
|
|
58
|
-
"@dxos/echo-protocol": "0.8.2-main.
|
|
59
|
-
"@dxos/echo-schema": "0.8.2-main.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/plugin-
|
|
74
|
-
"@dxos/plugin-
|
|
75
|
-
"@dxos/plugin-
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/react-
|
|
81
|
-
"@dxos/react-
|
|
82
|
-
"@dxos/react-ui-canvas-editor": "0.8.2-main.
|
|
83
|
-
"@dxos/react-ui-components": "0.8.2-main.
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-
|
|
86
|
-
"@dxos/react-ui-
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/react-ui-
|
|
89
|
-
"@dxos/react-ui-
|
|
90
|
-
"@dxos/react-ui-
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/
|
|
49
|
+
"@dxos/app-framework": "0.8.2-main.2f9c567",
|
|
50
|
+
"@dxos/assistant": "0.8.2-main.2f9c567",
|
|
51
|
+
"@dxos/artifact": "0.8.2-main.2f9c567",
|
|
52
|
+
"@dxos/client": "0.8.2-main.2f9c567",
|
|
53
|
+
"@dxos/compute": "0.8.2-main.2f9c567",
|
|
54
|
+
"@dxos/conductor": "0.8.2-main.2f9c567",
|
|
55
|
+
"@dxos/async": "0.8.2-main.2f9c567",
|
|
56
|
+
"@dxos/echo": "0.8.2-main.2f9c567",
|
|
57
|
+
"@dxos/echo-db": "0.8.2-main.2f9c567",
|
|
58
|
+
"@dxos/echo-protocol": "0.8.2-main.2f9c567",
|
|
59
|
+
"@dxos/echo-schema": "0.8.2-main.2f9c567",
|
|
60
|
+
"@dxos/context": "0.8.2-main.2f9c567",
|
|
61
|
+
"@dxos/edge-client": "0.8.2-main.2f9c567",
|
|
62
|
+
"@dxos/effect": "0.8.2-main.2f9c567",
|
|
63
|
+
"@dxos/invariant": "0.8.2-main.2f9c567",
|
|
64
|
+
"@dxos/functions": "0.8.2-main.2f9c567",
|
|
65
|
+
"@dxos/keys": "0.8.2-main.2f9c567",
|
|
66
|
+
"@dxos/log": "0.8.2-main.2f9c567",
|
|
67
|
+
"@dxos/local-storage": "0.8.2-main.2f9c567",
|
|
68
|
+
"@dxos/live-object": "0.8.2-main.2f9c567",
|
|
69
|
+
"@dxos/plugin-deck": "0.8.2-main.2f9c567",
|
|
70
|
+
"@dxos/plugin-client": "0.8.2-main.2f9c567",
|
|
71
|
+
"@dxos/plugin-markdown": "0.8.2-main.2f9c567",
|
|
72
|
+
"@dxos/plugin-graph": "0.8.2-main.2f9c567",
|
|
73
|
+
"@dxos/plugin-inbox": "0.8.2-main.2f9c567",
|
|
74
|
+
"@dxos/plugin-script": "0.8.2-main.2f9c567",
|
|
75
|
+
"@dxos/plugin-sketch": "0.8.2-main.2f9c567",
|
|
76
|
+
"@dxos/plugin-space": "0.8.2-main.2f9c567",
|
|
77
|
+
"@dxos/plugin-stack": "0.8.2-main.2f9c567",
|
|
78
|
+
"@dxos/plugin-transcription": "0.8.2-main.2f9c567",
|
|
79
|
+
"@dxos/plugin-wnfs": "0.8.2-main.2f9c567",
|
|
80
|
+
"@dxos/react-client": "0.8.2-main.2f9c567",
|
|
81
|
+
"@dxos/react-edge-client": "0.8.2-main.2f9c567",
|
|
82
|
+
"@dxos/react-ui-canvas-editor": "0.8.2-main.2f9c567",
|
|
83
|
+
"@dxos/react-ui-components": "0.8.2-main.2f9c567",
|
|
84
|
+
"@dxos/react-ui-editor": "0.8.2-main.2f9c567",
|
|
85
|
+
"@dxos/react-ui-dnd": "0.8.2-main.2f9c567",
|
|
86
|
+
"@dxos/react-ui-canvas-compute": "0.8.2-main.2f9c567",
|
|
87
|
+
"@dxos/react-ui-form": "0.8.2-main.2f9c567",
|
|
88
|
+
"@dxos/react-ui-list": "0.8.2-main.2f9c567",
|
|
89
|
+
"@dxos/react-ui-stack": "0.8.2-main.2f9c567",
|
|
90
|
+
"@dxos/react-ui-sfx": "0.8.2-main.2f9c567",
|
|
91
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-main.2f9c567",
|
|
92
|
+
"@dxos/schema": "0.8.2-main.2f9c567",
|
|
93
|
+
"@dxos/util": "0.8.2-main.2f9c567"
|
|
93
94
|
},
|
|
94
95
|
"devDependencies": {
|
|
95
96
|
"@types/lodash.get": "^4.4.7",
|
|
96
97
|
"@types/react": "~18.2.0",
|
|
97
98
|
"@types/react-dom": "~18.2.0",
|
|
99
|
+
"effect": "3.14.21",
|
|
98
100
|
"openapi-types": "^12.1.3",
|
|
99
101
|
"react": "~18.2.0",
|
|
100
102
|
"react-dom": "~18.2.0",
|
|
101
103
|
"vite": "5.4.7",
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/plugin-chess": "0.8.2-main.
|
|
105
|
-
"@dxos/plugin-
|
|
106
|
-
"@dxos/plugin-table": "0.8.2-main.
|
|
107
|
-
"@dxos/plugin-
|
|
108
|
-
"@dxos/random": "0.8.2-main.
|
|
109
|
-
"@dxos/react-ui-theme": "0.8.2-main.
|
|
110
|
-
"@dxos/
|
|
111
|
-
"@dxos/
|
|
104
|
+
"@dxos/artifact-testing": "0.8.2-main.2f9c567",
|
|
105
|
+
"@dxos/echo-db": "0.8.2-main.2f9c567",
|
|
106
|
+
"@dxos/plugin-chess": "0.8.2-main.2f9c567",
|
|
107
|
+
"@dxos/plugin-inbox": "0.8.2-main.2f9c567",
|
|
108
|
+
"@dxos/plugin-table": "0.8.2-main.2f9c567",
|
|
109
|
+
"@dxos/plugin-map": "0.8.2-main.2f9c567",
|
|
110
|
+
"@dxos/random": "0.8.2-main.2f9c567",
|
|
111
|
+
"@dxos/react-ui-theme": "0.8.2-main.2f9c567",
|
|
112
|
+
"@dxos/react-ui": "0.8.2-main.2f9c567",
|
|
113
|
+
"@dxos/storybook-utils": "0.8.2-main.2f9c567"
|
|
112
114
|
},
|
|
113
115
|
"peerDependencies": {
|
|
116
|
+
"effect": "^3.13.3",
|
|
114
117
|
"react": "~18.2.0",
|
|
115
118
|
"react-dom": "~18.2.0",
|
|
116
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
117
|
-
"@dxos/react-ui-theme": "0.8.2-main.
|
|
119
|
+
"@dxos/react-ui": "0.8.2-main.2f9c567",
|
|
120
|
+
"@dxos/react-ui-theme": "0.8.2-main.2f9c567"
|
|
118
121
|
},
|
|
119
122
|
"publishConfig": {
|
|
120
123
|
"access": "public"
|
package/src/AssistantPlugin.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
|
15
15
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
16
16
|
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
17
17
|
|
|
18
|
-
import { AiClient, AppGraphBuilder, IntentResolver, ReactSurface,
|
|
18
|
+
import { AiClient, AppGraphBuilder, IntentResolver, ReactSurface, Settings } from './capabilities';
|
|
19
19
|
import { meta } from './meta';
|
|
20
20
|
import translations from './translations';
|
|
21
21
|
import { AssistantAction, AIChatType, ServiceType, TemplateType } from './types';
|
|
@@ -30,7 +30,7 @@ export const AssistantPlugin = () =>
|
|
|
30
30
|
defineModule({
|
|
31
31
|
id: `${meta.id}/module/settings`,
|
|
32
32
|
activatesOn: Events.SetupSettings,
|
|
33
|
-
activate:
|
|
33
|
+
activate: Settings,
|
|
34
34
|
}),
|
|
35
35
|
defineModule({
|
|
36
36
|
id: `${meta.id}/module/metadata`,
|
|
@@ -22,7 +22,6 @@ export default (context: PluginsContext) => {
|
|
|
22
22
|
const ai = signal<AIServiceClient>(new AIServiceEdgeClient({ endpoint }));
|
|
23
23
|
|
|
24
24
|
const unsubscribe = effect(() => {
|
|
25
|
-
// TODO(burdon): Could be undefined.
|
|
26
25
|
const settings = context
|
|
27
26
|
.requestCapability(Capabilities.SettingsStore)
|
|
28
27
|
.getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
} from '@dxos/app-framework';
|
|
13
13
|
import { invariant } from '@dxos/invariant';
|
|
14
14
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
15
|
-
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR
|
|
15
|
+
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
16
16
|
import { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';
|
|
17
17
|
import { memoizeQuery } from '@dxos/plugin-space';
|
|
18
18
|
import { SPACE_TYPE, SpaceAction } from '@dxos/plugin-space/types';
|
|
19
|
-
import { type Space, Filter, fullyQualifiedId, getSpace, isLiveObject
|
|
19
|
+
import { type Space, Filter, fullyQualifiedId, getSpace, isLiveObject } from '@dxos/react-client/echo';
|
|
20
20
|
|
|
21
21
|
import { ASSISTANT_DIALOG, ASSISTANT_PLUGIN } from '../meta';
|
|
22
22
|
import { AIChatType, AssistantAction, TemplateType } from '../types';
|
|
@@ -83,30 +83,6 @@ export default (context: PluginsContext) =>
|
|
|
83
83
|
],
|
|
84
84
|
}),
|
|
85
85
|
|
|
86
|
-
createExtension({
|
|
87
|
-
id: `${ASSISTANT_PLUGIN}/service-registry`,
|
|
88
|
-
filter: (node): node is Node<null> => node.id === 'root',
|
|
89
|
-
connector: ({ node }) => {
|
|
90
|
-
const layout = context.requestCapability(Capabilities.Layout);
|
|
91
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
92
|
-
const { spaceId } = parseId(layout.workspace);
|
|
93
|
-
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
94
|
-
|
|
95
|
-
return [
|
|
96
|
-
{
|
|
97
|
-
id: [node.id, 'service-registry'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
98
|
-
type: DECK_COMPANION_TYPE,
|
|
99
|
-
data: space,
|
|
100
|
-
properties: {
|
|
101
|
-
label: ['service registry label', { ns: ASSISTANT_PLUGIN }],
|
|
102
|
-
icon: 'ph--plugs--regular',
|
|
103
|
-
disposition: 'hidden',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
];
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
|
|
110
86
|
createExtension({
|
|
111
87
|
id: `${ASSISTANT_PLUGIN}/object-chat-companion`,
|
|
112
88
|
filter: (node): node is Node<AIChatType> =>
|
|
@@ -8,6 +8,6 @@ export const AiClient = lazy(() => import('./ai-client'));
|
|
|
8
8
|
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
9
9
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
10
10
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
11
|
-
export const
|
|
11
|
+
export const Settings = lazy(() => import('./settings'));
|
|
12
12
|
|
|
13
13
|
export * from './capabilities';
|
|
@@ -7,16 +7,9 @@ import React, { useMemo } from 'react';
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
8
|
import { isInstanceOf, getTypename } from '@dxos/echo-schema';
|
|
9
9
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
|
-
import { fullyQualifiedId, getSpace, isLiveObject,
|
|
10
|
+
import { fullyQualifiedId, getSpace, isLiveObject, type SpaceId } from '@dxos/react-client/echo';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
AssistantDialog,
|
|
14
|
-
AssistantSettings,
|
|
15
|
-
ChatContainer,
|
|
16
|
-
PromptSettings,
|
|
17
|
-
ServiceRegistry,
|
|
18
|
-
TemplateContainer,
|
|
19
|
-
} from '../components';
|
|
12
|
+
import { AssistantDialog, AssistantSettings, ChatContainer, PromptSettings, TemplateContainer } from '../components';
|
|
20
13
|
import { ASSISTANT_PLUGIN, ASSISTANT_DIALOG } from '../meta';
|
|
21
14
|
import { AIChatType, type AssistantSettingsProps, TemplateType } from '../types';
|
|
22
15
|
|
|
@@ -67,12 +60,6 @@ export default () =>
|
|
|
67
60
|
filter: (data): data is { subject: TemplateType } => isInstanceOf(TemplateType, data.subject),
|
|
68
61
|
component: ({ data, role }) => <TemplateContainer role={role} template={data.subject} />,
|
|
69
62
|
}),
|
|
70
|
-
createSurface({
|
|
71
|
-
id: `${ASSISTANT_PLUGIN}/service-registry`,
|
|
72
|
-
role: 'deck-companion--service-registry',
|
|
73
|
-
filter: (data): data is { subject: Space } => isSpace(data.subject),
|
|
74
|
-
component: ({ data }) => <ServiceRegistry space={data.subject} />,
|
|
75
|
-
}),
|
|
76
63
|
createSurface({
|
|
77
64
|
id: `${ASSISTANT_PLUGIN}/prompt-settings`,
|
|
78
65
|
role: 'object-settings',
|
|
@@ -9,11 +9,17 @@ import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
|
9
9
|
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
10
10
|
|
|
11
11
|
import { ASSISTANT_PLUGIN } from '../../meta';
|
|
12
|
-
import { type AssistantSettingsProps } from '../../types';
|
|
12
|
+
import { LLM_PROVIDERS, type AssistantSettingsProps } from '../../types';
|
|
13
13
|
|
|
14
|
-
// TODO(burdon): Factor out.
|
|
14
|
+
// TODO(burdon): Factor out default Selector.
|
|
15
15
|
const DEFAULT_VALUE = '__default';
|
|
16
16
|
|
|
17
|
+
const LLM_PROVIDER_LABELS = {
|
|
18
|
+
edge: 'DXOS',
|
|
19
|
+
ollama: 'Ollama',
|
|
20
|
+
lmstudio: 'LM Studio',
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
17
23
|
export const AssistantSettings = ({ settings }: { settings: AssistantSettingsProps }) => {
|
|
18
24
|
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
19
25
|
|
|
@@ -27,10 +33,26 @@ export const AssistantSettings = ({ settings }: { settings: AssistantSettingsPro
|
|
|
27
33
|
</DeprecatedFormInput>
|
|
28
34
|
|
|
29
35
|
<DeprecatedFormInput label={t('settings llm provider label')}>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
<Select.Root
|
|
37
|
+
value={settings.llmProvider ?? 'edge'}
|
|
38
|
+
onValueChange={(value) => {
|
|
39
|
+
settings.llmProvider = value === DEFAULT_VALUE ? undefined : (value as any);
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<Select.TriggerButton placeholder={t('settings llm provider label')} />
|
|
43
|
+
<Select.Portal>
|
|
44
|
+
<Select.Content>
|
|
45
|
+
<Select.Viewport>
|
|
46
|
+
<Select.Option value={DEFAULT_VALUE}>{t('settings default label')}</Select.Option>
|
|
47
|
+
{LLM_PROVIDERS.map((model) => (
|
|
48
|
+
<Select.Option key={model} value={model}>
|
|
49
|
+
{LLM_PROVIDER_LABELS[model]}
|
|
50
|
+
</Select.Option>
|
|
51
|
+
))}
|
|
52
|
+
</Select.Viewport>
|
|
53
|
+
</Select.Content>
|
|
54
|
+
</Select.Portal>
|
|
55
|
+
</Select.Root>
|
|
34
56
|
</DeprecatedFormInput>
|
|
35
57
|
|
|
36
58
|
<DeprecatedFormInput label={t('settings edge llm model label')}>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Match, type Schema
|
|
5
|
+
import { Match, type Schema } from 'effect';
|
|
6
6
|
import React, { type ChangeEvent, useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
import { debounce } from '@dxos/async';
|
|
@@ -17,7 +17,7 @@ export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
|
17
17
|
const handleKindChange = useCallback(
|
|
18
18
|
(value: string) => {
|
|
19
19
|
const kind = Match.type<string>().pipe(
|
|
20
|
-
Match.withReturnType<
|
|
20
|
+
Match.withReturnType<Schema.Schema.Type<typeof TemplateKindSchema>>(),
|
|
21
21
|
Match.when('always', () => ({ include: 'always' })),
|
|
22
22
|
Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
23
23
|
Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Schema
|
|
5
|
+
import { type Schema } from 'effect';
|
|
6
6
|
import React, { Fragment, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
@@ -15,7 +15,7 @@ import { type TemplateInput, TemplateInputType, type TemplateType } from '../../
|
|
|
15
15
|
|
|
16
16
|
export type TemplateFormProps = {
|
|
17
17
|
template: TemplateType;
|
|
18
|
-
schema?:
|
|
18
|
+
schema?: Schema.Schema<any, any, any>;
|
|
19
19
|
commandEditable?: boolean;
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -18,8 +18,9 @@ import {
|
|
|
18
18
|
} from '@dxos/app-framework';
|
|
19
19
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
20
20
|
import { Message, type Tool } from '@dxos/artifact';
|
|
21
|
-
import { genericTools, localServiceEndpoints
|
|
21
|
+
import { genericTools, localServiceEndpoints } from '@dxos/artifact-testing';
|
|
22
22
|
import { AIServiceEdgeClient } from '@dxos/assistant';
|
|
23
|
+
import { type Type } from '@dxos/echo';
|
|
23
24
|
import { create, ObjectId } from '@dxos/echo-schema';
|
|
24
25
|
import { invariant } from '@dxos/invariant';
|
|
25
26
|
import { DXN } from '@dxos/keys';
|
|
@@ -30,7 +31,7 @@ import { InboxPlugin } from '@dxos/plugin-inbox';
|
|
|
30
31
|
import { MapPlugin } from '@dxos/plugin-map';
|
|
31
32
|
import { SpacePlugin } from '@dxos/plugin-space';
|
|
32
33
|
import { TablePlugin } from '@dxos/plugin-table';
|
|
33
|
-
import {
|
|
34
|
+
import { createQueueDxn, useQueue, useSpace } from '@dxos/react-client/echo';
|
|
34
35
|
import { IconButton, Input, Toolbar } from '@dxos/react-ui';
|
|
35
36
|
import { mx } from '@dxos/react-ui-theme';
|
|
36
37
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
@@ -43,7 +44,7 @@ import translations from '../../translations';
|
|
|
43
44
|
const endpoints = localServiceEndpoints;
|
|
44
45
|
|
|
45
46
|
type RenderProps = {
|
|
46
|
-
items?:
|
|
47
|
+
items?: Type.AnyObject[];
|
|
47
48
|
prompts?: string[];
|
|
48
49
|
} & Pick<ThreadProps, 'debug'>;
|
|
49
50
|
|
|
@@ -76,7 +77,7 @@ const DefaultStory = ({ items: _items, prompts = [], ...props }: RenderProps) =>
|
|
|
76
77
|
}, [aiClient, tools, space, dispatch, artifactDefinitions]);
|
|
77
78
|
|
|
78
79
|
// Queue.
|
|
79
|
-
const [queueDxn, setQueueDxn] = useState<string>(() =>
|
|
80
|
+
const [queueDxn, setQueueDxn] = useState<string>(() => createQueueDxn().toString());
|
|
80
81
|
const queue = useQueue<Message>(DXN.tryParse(queueDxn));
|
|
81
82
|
|
|
82
83
|
useEffect(() => {
|
|
@@ -159,7 +160,7 @@ const DefaultStory = ({ items: _items, prompts = [], ...props }: RenderProps) =>
|
|
|
159
160
|
iconOnly
|
|
160
161
|
label='Clear history'
|
|
161
162
|
icon='ph--trash--regular'
|
|
162
|
-
onClick={() => setQueueDxn(
|
|
163
|
+
onClick={() => setQueueDxn(createQueueDxn().toString())}
|
|
163
164
|
/>
|
|
164
165
|
<IconButton iconOnly label='Stop' icon='ph--stop--regular' onClick={() => processor?.cancel()} />
|
|
165
166
|
</Input.Root>
|
|
@@ -105,7 +105,7 @@ const components: Record<string, BlockComponent> = {
|
|
|
105
105
|
return (
|
|
106
106
|
<ToggleContainer
|
|
107
107
|
// open={open}
|
|
108
|
-
defaultOpen={block.disposition
|
|
108
|
+
defaultOpen={systemDispositions.includes(block.disposition ?? '') && block.pending}
|
|
109
109
|
title={title}
|
|
110
110
|
icon={
|
|
111
111
|
block.pending ? (
|
|
@@ -115,7 +115,7 @@ const components: Record<string, BlockComponent> = {
|
|
|
115
115
|
>
|
|
116
116
|
<MarkdownViewer
|
|
117
117
|
content={block.text}
|
|
118
|
-
classNames={['pbe-2', block.disposition
|
|
118
|
+
classNames={['pbe-2', systemDispositions.includes(block.disposition ?? '') && 'text-sm text-subdued']}
|
|
119
119
|
/>
|
|
120
120
|
</ToggleContainer>
|
|
121
121
|
);
|
|
@@ -193,4 +193,7 @@ const titles: Record<string, string> = {
|
|
|
193
193
|
['tool_use' as const]: 'Tool request',
|
|
194
194
|
['tool_result' as const]: 'Tool result',
|
|
195
195
|
['tool_list' as const]: 'Tools',
|
|
196
|
+
['artifact-update' as const]: 'Artifact(s) changed',
|
|
196
197
|
};
|
|
198
|
+
|
|
199
|
+
const systemDispositions: string[] = ['cot', 'artifact-update'];
|
|
@@ -6,7 +6,7 @@ import React, { useState, useEffect, Fragment, type FC } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, useCapabilities } from '@dxos/app-framework';
|
|
8
8
|
import { parseToolName, type ArtifactDefinition, type Tool } from '@dxos/artifact';
|
|
9
|
-
import { FunctionType } from '@dxos/functions
|
|
9
|
+
import { FunctionType } from '@dxos/functions';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
|
|
12
12
|
import { type ThemedClassName } from '@dxos/react-ui';
|
package/src/components/index.ts
CHANGED
package/src/hooks/index.ts
CHANGED
package/src/hooks/processor.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { type ArtifactDefinition, type Message, type MessageContentBlock, type T
|
|
|
9
9
|
import { type AIServiceClient, AISession, DEFAULT_EDGE_MODEL, type GenerateRequest } from '@dxos/assistant';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
12
|
+
import { getVersion, type Space } from '@dxos/react-client/echo';
|
|
13
13
|
|
|
14
14
|
// TODO(burdon): Factor out.
|
|
15
15
|
declare global {
|
|
@@ -99,7 +99,7 @@ export class ChatProcessor {
|
|
|
99
99
|
* Make GPT request.
|
|
100
100
|
*/
|
|
101
101
|
async request(message: string, options: RequestOptions = {}): Promise<Message[]> {
|
|
102
|
-
this._session = new AISession({ operationModel: '
|
|
102
|
+
this._session = new AISession({ operationModel: 'configured' });
|
|
103
103
|
|
|
104
104
|
// Message complete.
|
|
105
105
|
this._session.message.on((message) => {
|
|
@@ -125,10 +125,33 @@ export class ChatProcessor {
|
|
|
125
125
|
client: this._ai,
|
|
126
126
|
history: options.history ?? [],
|
|
127
127
|
artifacts: this._artifacts ?? [],
|
|
128
|
+
requiredArtifactIds: this._artifacts?.map((artifact) => artifact.id) ?? [],
|
|
128
129
|
tools: this._tools ?? [],
|
|
129
130
|
prompt: message,
|
|
130
131
|
systemPrompt: this._options.systemPrompt,
|
|
131
132
|
extensions: this._extensions,
|
|
133
|
+
artifactDiffResolver: async (artifacts) => {
|
|
134
|
+
const space = this._extensions?.space;
|
|
135
|
+
if (!space) {
|
|
136
|
+
return new Map();
|
|
137
|
+
}
|
|
138
|
+
const versions = new Map();
|
|
139
|
+
await Promise.all(
|
|
140
|
+
artifacts.map(async (artifact) => {
|
|
141
|
+
const {
|
|
142
|
+
objects: [object],
|
|
143
|
+
} = await space.db.query({ id: artifact.id }).run();
|
|
144
|
+
if (!object) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
versions.set(artifact.id, {
|
|
148
|
+
version: getVersion(object),
|
|
149
|
+
diff: `Current state: ${JSON.stringify(object)}`,
|
|
150
|
+
});
|
|
151
|
+
}),
|
|
152
|
+
);
|
|
153
|
+
return versions;
|
|
154
|
+
},
|
|
132
155
|
generationOptions: {
|
|
133
156
|
model: this._options.model,
|
|
134
157
|
},
|
|
@@ -7,7 +7,7 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
import { Capabilities, useCapabilities, useCapability, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type AssociatedArtifact, createSystemPrompt, type Tool } from '@dxos/artifact';
|
|
9
9
|
import { DEFAULT_EDGE_MODEL, DEFAULT_OLLAMA_MODEL } from '@dxos/assistant';
|
|
10
|
-
import { FunctionType } from '@dxos/functions
|
|
10
|
+
import { FunctionType } from '@dxos/functions';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
import { useConfig } from '@dxos/react-client';
|
|
13
13
|
import { Filter, fullyQualifiedId, type Space, useQuery } from '@dxos/react-client/echo';
|
|
@@ -33,7 +33,8 @@ export const useChatProcessor = ({
|
|
|
33
33
|
chat,
|
|
34
34
|
space,
|
|
35
35
|
settings,
|
|
36
|
-
part = 'deck',
|
|
36
|
+
// part = 'deck',
|
|
37
|
+
part,
|
|
37
38
|
associatedArtifact,
|
|
38
39
|
}: UseChatProcessorProps): ChatProcessor => {
|
|
39
40
|
const aiClient = useCapability(AssistantCapabilities.AiClient);
|
package/src/tools/function.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { defineTool, ToolResult } from '@dxos/artifact';
|
|
6
6
|
import type { Tool } from '@dxos/artifact';
|
|
7
7
|
import { toEffectSchema } from '@dxos/echo-schema';
|
|
8
|
-
import { getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions
|
|
9
|
-
import type { FunctionType } from '@dxos/functions
|
|
8
|
+
import { getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
|
|
9
|
+
import type { FunctionType } from '@dxos/functions';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import type { SpaceId } from '@dxos/react-client/echo';
|
|
12
12
|
import { getMeta } from '@dxos/react-client/echo';
|
package/src/tools/openapi.ts
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import jsonpointer from 'jsonpointer';
|
|
6
7
|
import { type OpenAPIV2, type OpenAPIV3_1 } from 'openapi-types';
|
|
7
8
|
|
|
8
9
|
import { ToolResult, type Tool } from '@dxos/artifact';
|
|
9
|
-
import { JsonSchemaType, normalizeSchema,
|
|
10
|
+
import { JsonSchemaType, normalizeSchema, toEffectSchema } from '@dxos/echo-schema';
|
|
10
11
|
import { invariant } from '@dxos/invariant';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
12
13
|
import { deepMapValues } from '@dxos/util';
|
|
@@ -82,7 +83,7 @@ export const createToolsFromApi = async (url: string, options?: CreateToolsFromA
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
log('inputSchema', { inputSchema });
|
|
85
|
-
|
|
86
|
+
Schema.validateSync(JsonSchemaType)(inputSchema);
|
|
86
87
|
|
|
87
88
|
const description = methodItem.description ?? methodItem.summary;
|
|
88
89
|
if (!description) {
|
|
@@ -200,7 +201,7 @@ const callApiEndpoint = async (endpoint: EndpointDescriptor, input: any) => {
|
|
|
200
201
|
|
|
201
202
|
// Client-side validation
|
|
202
203
|
const effectSchema = toEffectSchema(parameter.schema);
|
|
203
|
-
|
|
204
|
+
Schema.validateSync(effectSchema)(value);
|
|
204
205
|
|
|
205
206
|
if (body) {
|
|
206
207
|
throw new Error(`Duplicate body parameter: ${parameter.name}`);
|