@dxos/plugin-assistant 0.8.1-main.ae460ac → 0.8.1-staging.391c573
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-6KB6INZE.mjs → AssistantDialog-CM33SOCT.mjs} +3 -3
- package/dist/lib/browser/{ChatContainer-DQNUNADE.mjs → ChatContainer-VW73VNUY.mjs} +3 -3
- package/dist/lib/browser/{ai-client-PORKRZXM.mjs → ai-client-HZPB7E6M.mjs} +1 -12
- package/dist/lib/browser/ai-client-HZPB7E6M.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-AXAIFOGV.mjs → app-graph-builder-4DIOTGOG.mjs} +3 -10
- package/dist/lib/browser/app-graph-builder-4DIOTGOG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FRIKXDDQ.mjs → chunk-FPXC3LKK.mjs} +2 -2
- package/dist/lib/browser/{chunk-FRIKXDDQ.mjs.map → chunk-FPXC3LKK.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-6F6FUSOV.mjs → chunk-M2SADJVS.mjs} +5 -5
- package/dist/lib/browser/{chunk-6F6FUSOV.mjs.map → chunk-M2SADJVS.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-NIESO4DA.mjs → chunk-WVME6K4X.mjs} +35 -19
- package/dist/lib/browser/chunk-WVME6K4X.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -3
- package/dist/lib/browser/{intent-resolver-QRVRZL6K.mjs → intent-resolver-FQRN6747.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-UX6A7C24.mjs → react-surface-ZT6EQ7FJ.mjs} +4 -4
- package/dist/lib/browser/{settings-JTT62IHD.mjs → settings-VVQUGG56.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{AssistantDialog-DSBHAWOS.cjs → AssistantDialog-5PVOCPE2.cjs} +7 -7
- package/dist/lib/node/{ChatContainer-3RAAOIWP.cjs → ChatContainer-I45I3ICI.cjs} +7 -7
- package/dist/lib/node/{ai-client-RBDOGK6W.cjs → ai-client-6CY35ZIR.cjs} +4 -15
- package/dist/lib/node/ai-client-6CY35ZIR.cjs.map +7 -0
- package/dist/lib/node/{app-graph-builder-D7SHQTZS.cjs → app-graph-builder-7O4U4RXH.cjs} +9 -16
- package/dist/lib/node/app-graph-builder-7O4U4RXH.cjs.map +7 -0
- package/dist/lib/node/{chunk-37GI4NYH.cjs → chunk-34WE2FD2.cjs} +6 -6
- package/dist/lib/node/{chunk-37GI4NYH.cjs.map → chunk-34WE2FD2.cjs.map} +2 -2
- package/dist/lib/node/{chunk-XANPLPBO.cjs → chunk-HFOUAFOW.cjs} +11 -11
- package/dist/lib/node/{chunk-XANPLPBO.cjs.map → chunk-HFOUAFOW.cjs.map} +2 -2
- package/dist/lib/node/{chunk-KOSGO3RY.cjs → chunk-JWUHUQ56.cjs} +50 -34
- package/dist/lib/node/chunk-JWUHUQ56.cjs.map +7 -0
- package/dist/lib/node/index.cjs +36 -36
- package/dist/lib/node/{intent-resolver-YMMAFVOB.cjs → intent-resolver-Z37RNNMC.cjs} +9 -9
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-HTFYCQUK.cjs → react-surface-KFXP3GGK.cjs} +14 -14
- package/dist/lib/node/{settings-4YEO7KXF.cjs → settings-TJHHVI6B.cjs} +6 -6
- package/dist/lib/node/types/index.cjs +10 -10
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{AssistantDialog-Y2AN6UPH.mjs → AssistantDialog-Q2ZBOHOV.mjs} +3 -3
- package/dist/lib/node-esm/{ChatContainer-OZO2R4TX.mjs → ChatContainer-5ULBF3GW.mjs} +3 -3
- package/dist/lib/node-esm/{ai-client-OTZVBDUH.mjs → ai-client-GSA67EIB.mjs} +1 -12
- package/dist/lib/node-esm/ai-client-GSA67EIB.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-H2GC2AZA.mjs → app-graph-builder-SX3SREXF.mjs} +3 -10
- package/dist/lib/node-esm/app-graph-builder-SX3SREXF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KICG37HX.mjs → chunk-2OUUYMBT.mjs} +5 -5
- package/dist/lib/node-esm/{chunk-KICG37HX.mjs.map → chunk-2OUUYMBT.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-GKBHTBON.mjs → chunk-ASMI7PQ2.mjs} +35 -19
- package/dist/lib/node-esm/chunk-ASMI7PQ2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CJ4Y3QW5.mjs → chunk-LELXJPGJ.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-CJ4Y3QW5.mjs.map → chunk-LELXJPGJ.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +3 -3
- package/dist/lib/node-esm/{intent-resolver-MR7BOKEW.mjs → intent-resolver-LOTXWV4J.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-AMVW4HZ7.mjs → react-surface-NZNNP2QI.mjs} +4 -4
- package/dist/lib/node-esm/{settings-S7P5RWQI.mjs → settings-BVWR244C.mjs} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -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/components/AmbientDialog/AmbientDialog.d.ts +2 -2
- package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +2 -1
- package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +2 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts +2 -1
- package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +2 -1
- package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +1 -1
- package/dist/types/src/components/TemplateContainer.d.ts +2 -1
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +2 -1
- package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
- package/dist/types/src/components/Thread/Thread.d.ts +2 -1
- package/dist/types/src/components/Thread/Thread.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +2 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -3
- package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/invocation-handler.d.ts +1 -1
- package/dist/types/src/hooks/invocation-handler.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts +3 -0
- package/dist/types/src/hooks/processor.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/types/service.d.ts +1 -1
- package/dist/types/src/types/service.d.ts.map +1 -1
- package/package.json +55 -55
- package/src/capabilities/ai-client.ts +0 -2
- package/src/capabilities/app-graph-builder.ts +0 -2
- package/src/components/Prompt/PromptBar.tsx +15 -6
- package/src/components/Toolbox/Toolbox.tsx +1 -1
- package/src/components/index.ts +3 -0
- package/src/hooks/invocation-handler.ts +3 -5
- package/src/hooks/processor.ts +10 -1
- package/src/hooks/useChatProcessor.tsx +1 -1
- package/src/hooks/useLocalTriggerManager.ts +1 -1
- package/src/tools/function.ts +2 -2
- package/src/types/service.ts +1 -1
- package/dist/lib/browser/ai-client-PORKRZXM.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-AXAIFOGV.mjs.map +0 -7
- package/dist/lib/browser/chunk-NIESO4DA.mjs.map +0 -7
- package/dist/lib/node/ai-client-RBDOGK6W.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-D7SHQTZS.cjs.map +0 -7
- package/dist/lib/node/chunk-KOSGO3RY.cjs.map +0 -7
- package/dist/lib/node-esm/ai-client-OTZVBDUH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-H2GC2AZA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GKBHTBON.mjs.map +0 -7
- /package/dist/lib/browser/{AssistantDialog-6KB6INZE.mjs.map → AssistantDialog-CM33SOCT.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-DQNUNADE.mjs.map → ChatContainer-VW73VNUY.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-QRVRZL6K.mjs.map → intent-resolver-FQRN6747.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-UX6A7C24.mjs.map → react-surface-ZT6EQ7FJ.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-JTT62IHD.mjs.map → settings-VVQUGG56.mjs.map} +0 -0
- /package/dist/lib/node/{AssistantDialog-DSBHAWOS.cjs.map → AssistantDialog-5PVOCPE2.cjs.map} +0 -0
- /package/dist/lib/node/{ChatContainer-3RAAOIWP.cjs.map → ChatContainer-I45I3ICI.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-YMMAFVOB.cjs.map → intent-resolver-Z37RNNMC.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-HTFYCQUK.cjs.map → react-surface-KFXP3GGK.cjs.map} +0 -0
- /package/dist/lib/node/{settings-4YEO7KXF.cjs.map → settings-TJHHVI6B.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AssistantDialog-Y2AN6UPH.mjs.map → AssistantDialog-Q2ZBOHOV.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-OZO2R4TX.mjs.map → ChatContainer-5ULBF3GW.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-MR7BOKEW.mjs.map → intent-resolver-LOTXWV4J.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-AMVW4HZ7.mjs.map → react-surface-NZNNP2QI.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-S7P5RWQI.mjs.map → settings-BVWR244C.mjs.map} +0 -0
|
@@ -16,18 +16,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var ai_client_6CY35ZIR_exports = {};
|
|
20
|
+
__export(ai_client_6CY35ZIR_exports, {
|
|
21
21
|
default: () => ai_client_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(ai_client_6CY35ZIR_exports);
|
|
24
24
|
var import_chunk_3WXG6WA6 = require("./chunk-3WXG6WA6.cjs");
|
|
25
25
|
var import_chunk_GNPXCHFT = require("./chunk-GNPXCHFT.cjs");
|
|
26
26
|
var import_app_framework = require("@dxos/app-framework");
|
|
27
27
|
var import_assistant = require("@dxos/assistant");
|
|
28
|
-
var import_log = require("@dxos/log");
|
|
29
28
|
var import_plugin_client = require("@dxos/plugin-client");
|
|
30
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-assistant/src/capabilities/ai-client.ts";
|
|
31
29
|
var DEFAULT_AI_SERVICE_URL = "http://localhost:8788";
|
|
32
30
|
var ai_client_default = (context) => {
|
|
33
31
|
const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
|
|
@@ -35,15 +33,6 @@ var ai_client_default = (context) => {
|
|
|
35
33
|
const ai = new import_assistant.AIServiceEdgeClient({
|
|
36
34
|
endpoint
|
|
37
35
|
});
|
|
38
|
-
import_log.log.info("ai", {
|
|
39
|
-
endpoint,
|
|
40
|
-
context
|
|
41
|
-
}, {
|
|
42
|
-
F: __dxlog_file,
|
|
43
|
-
L: 20,
|
|
44
|
-
S: void 0,
|
|
45
|
-
C: (f, a) => f(...a)
|
|
46
|
-
});
|
|
47
36
|
return (0, import_app_framework.contributes)(import_chunk_3WXG6WA6.AssistantCapabilities.AiClient, ai);
|
|
48
37
|
};
|
|
49
|
-
//# sourceMappingURL=ai-client-
|
|
38
|
+
//# sourceMappingURL=ai-client-6CY35ZIR.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/ai-client.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes, type PluginsContext } from '@dxos/app-framework';\nimport { AIServiceEdgeClient } from '@dxos/assistant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AssistantCapabilities } from './capabilities';\n\n// TODO(wittjosiah): Factor out.\nconst DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';\n\nexport default (context: PluginsContext) => {\n const client = context.requestCapability(ClientCapabilities.Client);\n const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;\n // TODO(burdon): Use prefs.\n const ai = new AIServiceEdgeClient({ endpoint });\n return contributes(AssistantCapabilities.AiClient, ai);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAAiD;AACjD,uBAAoC;AACpC,2BAAmC;AAKnC,IAAMA,yBAAyB;AAE/B,IAAA,oBAAe,CAACC,YAAAA;AACd,QAAMC,SAASD,QAAQE,kBAAkBC,wCAAmBC,MAAM;AAClE,QAAMC,WAAWJ,OAAOK,OAAOC,OAAOC,SAASC,UAAUC,IAAIC,UAAUZ;AAEvE,QAAMW,KAAK,IAAIE,qCAAoB;IAAEP;EAAS,CAAA;AAC9C,aAAOQ,kCAAYC,4CAAsBC,UAAUL,EAAAA;AACrD;",
|
|
6
|
+
"names": ["DEFAULT_AI_SERVICE_URL", "context", "client", "requestCapability", "ClientCapabilities", "Client", "endpoint", "config", "values", "runtime", "services", "ai", "server", "AIServiceEdgeClient", "contributes", "AssistantCapabilities", "AiClient"]
|
|
7
|
+
}
|
|
@@ -16,16 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var app_graph_builder_7O4U4RXH_exports = {};
|
|
20
|
+
__export(app_graph_builder_7O4U4RXH_exports, {
|
|
21
21
|
default: () => app_graph_builder_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(app_graph_builder_7O4U4RXH_exports);
|
|
24
|
+
var import_chunk_34WE2FD2 = require("./chunk-34WE2FD2.cjs");
|
|
25
25
|
var import_chunk_GNPXCHFT = require("./chunk-GNPXCHFT.cjs");
|
|
26
26
|
var import_app_framework = require("@dxos/app-framework");
|
|
27
27
|
var import_invariant = require("@dxos/invariant");
|
|
28
|
-
var import_log = require("@dxos/log");
|
|
29
28
|
var import_plugin_client = require("@dxos/plugin-client");
|
|
30
29
|
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
31
30
|
var import_types = require("@dxos/plugin-space/types");
|
|
@@ -57,12 +56,6 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
|
|
|
57
56
|
chat = await getOrCreateChat(dispatch, space);
|
|
58
57
|
}
|
|
59
58
|
if (!chat) {
|
|
60
|
-
import_log.log.warn("no chat found", void 0, {
|
|
61
|
-
F: __dxlog_file,
|
|
62
|
-
L: 54,
|
|
63
|
-
S: void 0,
|
|
64
|
-
C: (f, a) => f(...a)
|
|
65
|
-
});
|
|
66
59
|
return;
|
|
67
60
|
}
|
|
68
61
|
await dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.UpdateDialog, {
|
|
@@ -97,16 +90,16 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
|
|
|
97
90
|
})
|
|
98
91
|
]);
|
|
99
92
|
var getOrCreateChat = async (dispatch, space) => {
|
|
100
|
-
const { objects } = await space.db.query(import_echo.Filter.schema(
|
|
93
|
+
const { objects } = await space.db.query(import_echo.Filter.schema(import_chunk_34WE2FD2.AIChatType)).run();
|
|
101
94
|
if (objects.length > 0) {
|
|
102
95
|
return objects[objects.length - 1];
|
|
103
96
|
}
|
|
104
|
-
const { data } = await dispatch((0, import_app_framework.createIntent)(
|
|
97
|
+
const { data } = await dispatch((0, import_app_framework.createIntent)(import_chunk_34WE2FD2.AssistantAction.CreateChat, {
|
|
105
98
|
spaceId: space.id
|
|
106
99
|
}));
|
|
107
|
-
(0, import_invariant.invariant)(data?.object instanceof
|
|
100
|
+
(0, import_invariant.invariant)(data?.object instanceof import_chunk_34WE2FD2.AIChatType, void 0, {
|
|
108
101
|
F: __dxlog_file,
|
|
109
|
-
L:
|
|
102
|
+
L: 95,
|
|
110
103
|
S: void 0,
|
|
111
104
|
A: [
|
|
112
105
|
"data?.object instanceof AIChatType",
|
|
@@ -119,4 +112,4 @@ var getOrCreateChat = async (dispatch, space) => {
|
|
|
119
112
|
}));
|
|
120
113
|
return data.object;
|
|
121
114
|
};
|
|
122
|
-
//# sourceMappingURL=app-graph-builder-
|
|
115
|
+
//# sourceMappingURL=app-graph-builder-7O4U4RXH.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n LayoutAction,\n type PromiseIntentDispatcher,\n type PluginsContext,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { type Space, Filter, getSpace } from '@dxos/react-client/echo';\n\nimport { ASSISTANT_DIALOG, ASSISTANT_PLUGIN } from '../meta';\nimport { AIChatType, AssistantAction } from '../types';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${ASSISTANT_PLUGIN}/assistant`,\n filter: (node): node is Node<null> => node.id === ROOT_ID,\n actions: () => [\n {\n id: `${LayoutAction.UpdateDialog._tag}/assistant/open`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const client = context.requestCapability(ClientCapabilities.Client);\n const layout = context.requestCapability(Capabilities.Layout);\n const { graph } = context.requestCapability(Capabilities.AppGraph);\n\n // TODO(burdon): Get space from workspace.\n // TODO(burdon): If need to create chat, then add to dispatch stack below.\n let chat: AIChatType | undefined;\n if (layout.active.length > 0) {\n const node = graph.findNode(layout.active[0]);\n if (node) {\n const space = getSpace(node.data);\n if (space) {\n chat = await getOrCreateChat(dispatch, space);\n }\n }\n } else {\n const space = client.spaces.default;\n chat = await getOrCreateChat(dispatch, space);\n }\n\n if (!chat) {\n return;\n }\n\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: ASSISTANT_DIALOG,\n options: {\n state: true,\n blockAlign: 'end',\n props: {\n chat,\n },\n },\n }),\n );\n },\n properties: {\n label: ['open assistant label', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--chat-centered-text--regular',\n disposition: 'pin-end',\n position: 'hoist',\n keyBinding: {\n macos: 'shift+meta+k',\n windows: 'shift+ctrl+k',\n },\n },\n },\n ],\n }),\n ]);\n\n// TODO(burdon): Factor out.\nconst getOrCreateChat = async (dispatch: PromiseIntentDispatcher, space: Space): Promise<AIChatType | undefined> => {\n const { objects } = await space.db.query(Filter.schema(AIChatType)).run();\n // console.log('objects', JSON.stringify(objects, null, 2));\n if (objects.length > 0) {\n // TODO(burdon): Is this the most recent?\n return objects[objects.length - 1];\n }\n\n const { data } = await dispatch(createIntent(AssistantAction.CreateChat, { spaceId: space.id }));\n invariant(data?.object instanceof AIChatType);\n await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));\n return data.object;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAOO;AACP,uBAA0B;AAC1B,2BAAmC;AACnC,0BAAoD;AACpD,mBAA4B;AAC5B,kBAA6C;;AAK7C,IAAA,4BAAe,CAACA,gBACdC,kCAAYC,kCAAaC,iBAAiB;MACxCC,qCAAgB;IACdC,IAAI,GAAGC,sCAAAA;IACPC,QAAQ,CAACC,SAA6BA,KAAKH,OAAOI;IAClDC,SAAS,MAAM;MACb;QACEL,IAAI,GAAGM,kCAAaC,aAAaC,IAAI;QACrCC,MAAM,YAAA;AACJ,gBAAM,EAAEC,iBAAiBC,SAAQ,IAAKhB,QAAQiB,kBAAkBf,kCAAagB,gBAAgB;AAC7F,gBAAMC,SAASnB,QAAQiB,kBAAkBG,wCAAmBC,MAAM;AAClE,gBAAMC,SAAStB,QAAQiB,kBAAkBf,kCAAaqB,MAAM;AAC5D,gBAAM,EAAEC,MAAK,IAAKxB,QAAQiB,kBAAkBf,kCAAauB,QAAQ;AAIjE,cAAIC;AACJ,cAAIJ,OAAOK,OAAOC,SAAS,GAAG;AAC5B,kBAAMpB,OAAOgB,MAAMK,SAASP,OAAOK,OAAO,CAAA,CAAE;AAC5C,gBAAInB,MAAM;AACR,oBAAMsB,YAAQC,sBAASvB,KAAKM,IAAI;AAChC,kBAAIgB,OAAO;AACTJ,uBAAO,MAAMM,gBAAgBhB,UAAUc,KAAAA;cACzC;YACF;UACF,OAAO;AACL,kBAAMA,QAAQX,OAAOc,OAAOC;AAC5BR,mBAAO,MAAMM,gBAAgBhB,UAAUc,KAAAA;UACzC;AAEA,cAAI,CAACJ,MAAM;AACT;UACF;AAEA,gBAAMV,aACJmB,mCAAaxB,kCAAaC,cAAc;YACtCwB,MAAM;YACNC,SAASC;YACTC,SAAS;cACPC,OAAO;cACPC,YAAY;cACZC,OAAO;gBACLhB;cACF;YACF;UACF,CAAA,CAAA;QAEJ;QACAiB,YAAY;UACVC,OAAO;YAAC;YAAwB;cAAEC,IAAIvC;YAAiB;;UACvDwC,MAAM;UACNC,aAAa;UACbC,UAAU;UACVC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF;;EAEJ,CAAA;CACD;AAGH,IAAMnB,kBAAkB,OAAOhB,UAAmCc,UAAAA;AAChE,QAAM,EAAEsB,QAAO,IAAK,MAAMtB,MAAMuB,GAAGC,MAAMC,mBAAOC,OAAOC,gCAAAA,CAAAA,EAAaC,IAAG;AAEvE,MAAIN,QAAQxB,SAAS,GAAG;AAEtB,WAAOwB,QAAQA,QAAQxB,SAAS,CAAA;EAClC;AAEA,QAAM,EAAEd,KAAI,IAAK,MAAME,aAASmB,mCAAawB,sCAAgBC,YAAY;IAAEC,SAAS/B,MAAMzB;EAAG,CAAA,CAAA;AAC7FyD,kCAAUhD,MAAMiD,kBAAkBN,kCAAAA,QAAAA;;;;;;;;;AAClC,QAAMzC,aAASmB,mCAAa6B,yBAAYC,WAAW;IAAEC,QAAQpC;IAAOiC,QAAQjD,KAAKiD;EAAO,CAAA,CAAA;AACxF,SAAOjD,KAAKiD;AACd;",
|
|
6
|
+
"names": ["context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "ASSISTANT_PLUGIN", "filter", "node", "ROOT_ID", "actions", "LayoutAction", "UpdateDialog", "_tag", "data", "dispatchPromise", "dispatch", "requestCapability", "IntentDispatcher", "client", "ClientCapabilities", "Client", "layout", "Layout", "graph", "AppGraph", "chat", "active", "length", "findNode", "space", "getSpace", "getOrCreateChat", "spaces", "default", "createIntent", "part", "subject", "ASSISTANT_DIALOG", "options", "state", "blockAlign", "props", "properties", "label", "ns", "icon", "disposition", "position", "keyBinding", "macos", "windows", "objects", "db", "query", "Filter", "schema", "AIChatType", "run", "AssistantAction", "CreateChat", "spaceId", "invariant", "object", "SpaceAction", "AddObject", "target"]
|
|
7
|
+
}
|
|
@@ -16,8 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_34WE2FD2_exports = {};
|
|
20
|
+
__export(chunk_34WE2FD2_exports, {
|
|
21
21
|
AIChatType: () => AIChatType,
|
|
22
22
|
ApiAuthorization: () => ApiAuthorization,
|
|
23
23
|
AssistantAction: () => AssistantAction,
|
|
@@ -28,12 +28,12 @@ __export(chunk_37GI4NYH_exports, {
|
|
|
28
28
|
TemplateType: () => TemplateType,
|
|
29
29
|
categoryIcons: () => categoryIcons
|
|
30
30
|
});
|
|
31
|
-
module.exports = __toCommonJS(
|
|
31
|
+
module.exports = __toCommonJS(chunk_34WE2FD2_exports);
|
|
32
32
|
var import_chunk_GNPXCHFT = require("./chunk-GNPXCHFT.cjs");
|
|
33
33
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
34
34
|
var import_conductor = require("@dxos/conductor");
|
|
35
35
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
36
|
-
var
|
|
36
|
+
var import_types = require("@dxos/functions/types");
|
|
37
37
|
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
38
38
|
var import_echo_schema4 = require("@dxos/echo-schema");
|
|
39
39
|
var AIChatType = class extends (0, import_echo_schema.TypedObject)({
|
|
@@ -65,7 +65,7 @@ var ApiAuthorizationOauth = import_echo_schema2.S.Struct({
|
|
|
65
65
|
var ApiAuthorization = import_echo_schema2.S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);
|
|
66
66
|
var ServiceInterfaceFunction = import_echo_schema2.S.Struct({
|
|
67
67
|
kind: import_echo_schema2.S.Literal("function"),
|
|
68
|
-
fn: (0, import_echo_schema2.Ref)(
|
|
68
|
+
fn: (0, import_echo_schema2.Ref)(import_types.FunctionType)
|
|
69
69
|
});
|
|
70
70
|
var ServiceInterfaceWorkflow = import_echo_schema2.S.Struct({
|
|
71
71
|
kind: import_echo_schema2.S.Literal("workflow"),
|
|
@@ -180,4 +180,4 @@ var AssistantSettingsSchema = import_echo_schema4.S.mutable(import_echo_schema4.
|
|
|
180
180
|
TemplateType,
|
|
181
181
|
categoryIcons
|
|
182
182
|
});
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-34WE2FD2.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/chat.ts", "../../../src/types/service.ts", "../../../src/types/template.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, Ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({\n name: S.optional(S.String),\n // TODO(wittjosiah): Should be a ref to a Queue.\n queue: Ref(Expando),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Ref, S, TypedObject, type Ref$ } from '@dxos/echo-schema';\nimport { FunctionType } from '@dxos/functions';\n\nconst ApiAuthorizationKey = S.Struct({\n type: S.Literal('api-key'),\n key: S.String,\n placement: S.Union(\n S.Struct({\n type: S.Literal('authorization-header'),\n }),\n S.Struct({\n type: S.Literal('query'),\n name: S.String,\n }),\n ),\n});\n\nconst ApiAuthorizationOauth = S.Struct({\n type: S.Literal('oauth'),\n clientId: S.String,\n clientSecret: S.String,\n tokenUrl: S.String,\n grantType: S.String,\n});\n\nexport const ApiAuthorization = S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);\nexport type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;\n\nconst ServiceInterfaceFunction = S.Struct({\n kind: S.Literal('function'),\n fn: Ref(FunctionType) as Ref$<FunctionType>,\n});\n\nconst ServiceInterfaceWorkflow = S.Struct({\n kind: S.Literal('workflow'),\n workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,\n});\n\nconst ServiceInterfaceApi = S.Struct({\n kind: S.Literal('api'),\n\n /**\n * URL to fetch the openapi schema.\n */\n schemaUrl: S.optional(S.String),\n\n /**\n * Inlined openapi schema.\n */\n schema: S.optional(S.Any),\n\n /**\n * Authorization configuration if required.\n */\n authorization: S.optional(ApiAuthorization),\n});\n\nconst ServiceInterface = S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);\nexport type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;\n\nexport class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({\n serviceId: S.String,\n name: S.optional(S.String),\n description: S.optional(S.String),\n category: S.optional(S.String),\n enabled: S.optional(S.Boolean),\n\n /**\n * Entries exposed: functions, workflows, and APIs.\n */\n interfaces: S.optional(S.Array(ServiceInterface)),\n}) {}\n\n//\n// Service Registry\n//\n\nexport type ServiceQuery = {\n name?: string;\n category?: string;\n};\n\nexport interface BaseServiceRegistry {\n queryServices(query?: ServiceQuery): Promise<ServiceType[]>;\n}\n\nexport const categoryIcons: Record<string, string> = {\n finance: 'ph--bank--regular',\n health: 'ph--heart--regular',\n geolocation: 'ph--globe-simple--regular',\n education: 'ph--books--regular',\n entertainment: 'ph--music-notes--regular',\n shopping: 'ph--shopping-cart--regular',\n travel: 'ph--airplane-takeoff--regular',\n utilities: 'ph--lightning--regular',\n weather: 'ph--cloud-rain--regular',\n} as const;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Change to S.Literal (and discriminated union).\nexport enum TemplateInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n\nexport const TemplateInputSchema = S.mutable(\n S.Struct({\n name: S.String,\n type: S.optional(S.Enums(TemplateInputType)),\n value: S.optional(S.String),\n }),\n);\n\nexport type TemplateInput = S.Schema.Type<typeof TemplateInputSchema>;\n\nexport class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({\n name: S.optional(S.String),\n source: S.String,\n inputs: S.optional(S.mutable(S.Array(TemplateInputSchema))),\n command: S.optional(S.String),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { AIChatType } from './chat';\nimport { TemplateType } from './template';\nimport { ASSISTANT_PLUGIN } from '../meta';\n\nexport namespace AssistantAction {\n const ASSISTANT_ACTION = `${ASSISTANT_PLUGIN}/action`;\n\n export class CreateChat extends S.TaggedClass<CreateChat>()(`${ASSISTANT_ACTION}/create-chat`, {\n input: S.Struct({\n spaceId: S.optional(S.String),\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: AIChatType,\n }),\n }) {}\n\n export class CreateTemplate extends S.TaggedClass<CreateTemplate>()(`${ASSISTANT_ACTION}/create-template`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: TemplateType,\n }),\n }) {}\n}\n\nexport const AssistantSettingsSchema = S.mutable(\n S.Struct({\n llmModel: S.optional(S.String),\n customPrompts: S.optional(S.Boolean),\n }),\n);\n\nexport type AssistantSettingsProps = S.Schema.Type<typeof AssistantSettingsSchema>;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAA6C;ACA7C,uBAA6B;AAC7B,IAAAA,sBAA+C;AAC/C,
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, Ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({\n name: S.optional(S.String),\n // TODO(wittjosiah): Should be a ref to a Queue.\n queue: Ref(Expando),\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Ref, S, TypedObject, type Ref$ } from '@dxos/echo-schema';\nimport { FunctionType } from '@dxos/functions/types';\n\nconst ApiAuthorizationKey = S.Struct({\n type: S.Literal('api-key'),\n key: S.String,\n placement: S.Union(\n S.Struct({\n type: S.Literal('authorization-header'),\n }),\n S.Struct({\n type: S.Literal('query'),\n name: S.String,\n }),\n ),\n});\n\nconst ApiAuthorizationOauth = S.Struct({\n type: S.Literal('oauth'),\n clientId: S.String,\n clientSecret: S.String,\n tokenUrl: S.String,\n grantType: S.String,\n});\n\nexport const ApiAuthorization = S.Union(ApiAuthorizationKey, ApiAuthorizationOauth);\nexport type ApiAuthorization = S.Schema.Type<typeof ApiAuthorization>;\n\nconst ServiceInterfaceFunction = S.Struct({\n kind: S.Literal('function'),\n fn: Ref(FunctionType) as Ref$<FunctionType>,\n});\n\nconst ServiceInterfaceWorkflow = S.Struct({\n kind: S.Literal('workflow'),\n workflow: Ref(ComputeGraph) as Ref$<ComputeGraph>,\n});\n\nconst ServiceInterfaceApi = S.Struct({\n kind: S.Literal('api'),\n\n /**\n * URL to fetch the openapi schema.\n */\n schemaUrl: S.optional(S.String),\n\n /**\n * Inlined openapi schema.\n */\n schema: S.optional(S.Any),\n\n /**\n * Authorization configuration if required.\n */\n authorization: S.optional(ApiAuthorization),\n});\n\nconst ServiceInterface = S.Union(ServiceInterfaceFunction, ServiceInterfaceWorkflow, ServiceInterfaceApi);\nexport type ServiceInterface = S.Schema.Type<typeof ServiceInterface>;\n\nexport class ServiceType extends TypedObject({ typename: 'dxos.org/type/ServiceType', version: '0.1.0' })({\n serviceId: S.String,\n name: S.optional(S.String),\n description: S.optional(S.String),\n category: S.optional(S.String),\n enabled: S.optional(S.Boolean),\n\n /**\n * Entries exposed: functions, workflows, and APIs.\n */\n interfaces: S.optional(S.Array(ServiceInterface)),\n}) {}\n\n//\n// Service Registry\n//\n\nexport type ServiceQuery = {\n name?: string;\n category?: string;\n};\n\nexport interface BaseServiceRegistry {\n queryServices(query?: ServiceQuery): Promise<ServiceType[]>;\n}\n\nexport const categoryIcons: Record<string, string> = {\n finance: 'ph--bank--regular',\n health: 'ph--heart--regular',\n geolocation: 'ph--globe-simple--regular',\n education: 'ph--books--regular',\n entertainment: 'ph--music-notes--regular',\n shopping: 'ph--shopping-cart--regular',\n travel: 'ph--airplane-takeoff--regular',\n utilities: 'ph--lightning--regular',\n weather: 'ph--cloud-rain--regular',\n} as const;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Change to S.Literal (and discriminated union).\nexport enum TemplateInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n\nexport const TemplateInputSchema = S.mutable(\n S.Struct({\n name: S.String,\n type: S.optional(S.Enums(TemplateInputType)),\n value: S.optional(S.String),\n }),\n);\n\nexport type TemplateInput = S.Schema.Type<typeof TemplateInputSchema>;\n\nexport class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({\n name: S.optional(S.String),\n source: S.String,\n inputs: S.optional(S.mutable(S.Array(TemplateInputSchema))),\n command: S.optional(S.String),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { S } from '@dxos/echo-schema';\n\nimport { AIChatType } from './chat';\nimport { TemplateType } from './template';\nimport { ASSISTANT_PLUGIN } from '../meta';\n\nexport namespace AssistantAction {\n const ASSISTANT_ACTION = `${ASSISTANT_PLUGIN}/action`;\n\n export class CreateChat extends S.TaggedClass<CreateChat>()(`${ASSISTANT_ACTION}/create-chat`, {\n input: S.Struct({\n spaceId: S.optional(S.String),\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: AIChatType,\n }),\n }) {}\n\n export class CreateTemplate extends S.TaggedClass<CreateTemplate>()(`${ASSISTANT_ACTION}/create-template`, {\n input: S.Struct({\n name: S.optional(S.String),\n }),\n output: S.Struct({\n object: TemplateType,\n }),\n }) {}\n}\n\nexport const AssistantSettingsSchema = S.mutable(\n S.Struct({\n llmModel: S.optional(S.String),\n customPrompts: S.optional(S.Boolean),\n }),\n);\n\nexport type AssistantSettingsProps = S.Schema.Type<typeof AssistantSettingsSchema>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAA6C;ACA7C,uBAA6B;AAC7B,IAAAA,sBAA+C;AAC/C,mBAA6B;ACF7B,IAAAA,sBAA+B;ACA/B,IAAAA,sBAAkB;AHEX,IAAMC,aAAN,kBAAyBC,gCAAY;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,EAAG;EAClGC,MAAMC,qBAAEC,SAASD,qBAAEE,MAAM;;EAEzBC,WAAOC,wBAAIC,0BAAAA;AACb,CAAA,EAAA;AAAI;ACFJ,IAAMC,sBAAsBN,oBAAAA,EAAEO,OAAO;EACnCC,MAAMR,oBAAAA,EAAES,QAAQ,SAAA;EAChBC,KAAKV,oBAAAA,EAAEE;EACPS,WAAWX,oBAAAA,EAAEY,MACXZ,oBAAAA,EAAEO,OAAO;IACPC,MAAMR,oBAAAA,EAAES,QAAQ,sBAAA;EAClB,CAAA,GACAT,oBAAAA,EAAEO,OAAO;IACPC,MAAMR,oBAAAA,EAA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AAEO,OAAO;MACd0D,SAASjE,oBAAAA,EAAEC,SAASD,oBAAAA,EAAEE,MAAM;MAC5BH,MAAMC,oBAAAA,EAAEC,SAASD,oBAAAA,EAAEE,MAAM;IAC3B,CAAA;IACAgE,QAAQlE,oBAAAA,EAAEO,OAAO;MACf4D,QAAQxE;IACV,CAAA;EACF,CAAA,EAAA;EAAI;mBARSmE,aAAAA;EAUN,MAAMM,uBAAuBpE,oBAAAA,EAAE+D,YAAW,EAAmB,GAAGH,gBAAAA,oBAAoC;IACzGI,OAAOhE,oBAAAA,EAAEO,OAAO;MACdR,MAAMC,oBAAAA,EAAEC,SAASD,oBAAAA,EAAEE,MAAM;IAC3B,CAAA;IACAgE,QAAQlE,oBAAAA,EAAEO,OAAO;MACf4D,QAAQZ;IACV,CAAA;EACF,CAAA,EAAA;EAAI;mBAPSa,iBAAAA;AAQf,GArBiBT,oBAAAA,kBAAAA,CAAAA,EAAAA;AAuBV,IAAMU,0BAA0BrE,oBAAAA,EAAEoD,QACvCpD,oBAAAA,EAAEO,OAAO;EACP+D,UAAUtE,oBAAAA,EAAEC,SAASD,oBAAAA,EAAEE,MAAM;EAC7BqE,eAAevE,oBAAAA,EAAEC,SAASD,oBAAAA,EAAEqC,OAAO;AACrC,CAAA,CAAA;",
|
|
6
6
|
"names": ["import_echo_schema", "AIChatType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "queue", "Ref", "Expando", "ApiAuthorizationKey", "Struct", "type", "Literal", "key", "placement", "Union", "ApiAuthorizationOauth", "clientId", "clientSecret", "tokenUrl", "grantType", "ApiAuthorization", "ServiceInterfaceFunction", "kind", "fn", "FunctionType", "ServiceInterfaceWorkflow", "workflow", "ComputeGraph", "ServiceInterfaceApi", "schemaUrl", "schema", "Any", "authorization", "ServiceInterface", "ServiceType", "serviceId", "description", "category", "enabled", "Boolean", "interfaces", "Array", "categoryIcons", "finance", "health", "geolocation", "education", "entertainment", "shopping", "travel", "utilities", "weather", "TemplateInputType", "TemplateInputSchema", "mutable", "Enums", "value", "TemplateType", "source", "inputs", "command", "AssistantAction", "ASSISTANT_ACTION", "ASSISTANT_PLUGIN", "CreateChat", "TaggedClass", "input", "spaceId", "output", "object", "CreateTemplate", "AssistantSettingsSchema", "llmModel", "customPrompts"]
|
|
7
7
|
}
|
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_HFOUAFOW_exports = {};
|
|
30
|
+
__export(chunk_HFOUAFOW_exports, {
|
|
31
31
|
AssistantDialog: () => AssistantDialog,
|
|
32
32
|
AssistantSettings: () => AssistantSettings,
|
|
33
33
|
ChatContainer: () => ChatContainer,
|
|
34
34
|
ServiceRegistry: () => ServiceRegistry,
|
|
35
35
|
TemplateContainer: () => TemplateContainer
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
38
|
-
var
|
|
39
|
-
var
|
|
37
|
+
module.exports = __toCommonJS(chunk_HFOUAFOW_exports);
|
|
38
|
+
var import_chunk_JWUHUQ56 = require("./chunk-JWUHUQ56.cjs");
|
|
39
|
+
var import_chunk_34WE2FD2 = require("./chunk-34WE2FD2.cjs");
|
|
40
40
|
var import_chunk_GNPXCHFT = require("./chunk-GNPXCHFT.cjs");
|
|
41
41
|
var import_react = __toESM(require("react"));
|
|
42
42
|
var import_assistant = require("@dxos/assistant");
|
|
@@ -69,8 +69,8 @@ var AssistantSettings = ({ settings }) => {
|
|
|
69
69
|
}, model))))))));
|
|
70
70
|
};
|
|
71
71
|
var ServiceRegistry = ({ space }) => {
|
|
72
|
-
const matchingServices = (0,
|
|
73
|
-
const enabledServices = (0, import_echo2.useQuery)(space, import_echo.Filter.schema(
|
|
72
|
+
const matchingServices = (0, import_chunk_JWUHUQ56.useServices)(space);
|
|
73
|
+
const enabledServices = (0, import_echo2.useQuery)(space, import_echo.Filter.schema(import_chunk_34WE2FD2.ServiceType));
|
|
74
74
|
const services = (0, import_react2.useMemo)(() => {
|
|
75
75
|
return matchingServices.map((service) => enabledServices.find((s) => s.serviceId === service.serviceId) ?? service);
|
|
76
76
|
}, [
|
|
@@ -101,7 +101,7 @@ var ServiceItem = ({ service, enabled, setEnabled }) => {
|
|
|
101
101
|
}, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
102
102
|
className: "flex gow justify-center items-center"
|
|
103
103
|
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.Icon, {
|
|
104
|
-
icon:
|
|
104
|
+
icon: import_chunk_34WE2FD2.categoryIcons[service.category ?? "default"] ?? "ph--placeholder--regular",
|
|
105
105
|
size: 6
|
|
106
106
|
})), /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
107
107
|
className: "grow items-center truncate mie-2"
|
|
@@ -116,8 +116,8 @@ var ServiceItem = ({ service, enabled, setEnabled }) => {
|
|
|
116
116
|
className: "text-sm text-subdued line-clamp-2 mie-1"
|
|
117
117
|
}, service.description)));
|
|
118
118
|
};
|
|
119
|
-
var AssistantDialog = (0, import_react3.lazy)(() => import("./AssistantDialog-
|
|
120
|
-
var ChatContainer = (0, import_react3.lazy)(() => import("./ChatContainer-
|
|
119
|
+
var AssistantDialog = (0, import_react3.lazy)(() => import("./AssistantDialog-5PVOCPE2.cjs"));
|
|
120
|
+
var ChatContainer = (0, import_react3.lazy)(() => import("./ChatContainer-I45I3ICI.cjs"));
|
|
121
121
|
var TemplateContainer = (0, import_react3.lazy)(() => import("./TemplateContainer-R4BZZP3E.cjs"));
|
|
122
122
|
// Annotate the CommonJS export names for ESM import in node:
|
|
123
123
|
0 && (module.exports = {
|
|
@@ -127,4 +127,4 @@ var TemplateContainer = (0, import_react3.lazy)(() => import("./TemplateContaine
|
|
|
127
127
|
ServiceRegistry,
|
|
128
128
|
TemplateContainer
|
|
129
129
|
});
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
130
|
+
//# sourceMappingURL=chunk-HFOUAFOW.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/AssistantSettings/AssistantSettings.tsx", "../../../src/components/ServiceRegistry/ServiceRegistry.tsx", "../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DEFAULT_LLM_MODELS } from '@dxos/assistant';\nimport { Input, Select, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { ASSISTANT_PLUGIN } from '../../meta';\nimport { type AssistantSettingsProps } from '../../types';\n\nexport const AssistantSettings = ({ settings }: { settings: AssistantSettingsProps }) => {\n const { t } = useTranslation(ASSISTANT_PLUGIN);\n\n return (\n <DeprecatedFormContainer>\n <DeprecatedFormInput label={t('settings custom prompts label')}>\n <Input.Switch\n checked={!!settings.customPrompts}\n onCheckedChange={(checked) => (settings.customPrompts = checked)}\n />\n </DeprecatedFormInput>\n\n <DeprecatedFormInput label={t('settings llm model label')}>\n <Select.Root\n value={settings.llmModel ?? 'default'}\n onValueChange={(value) => {\n settings.llmModel = value;\n }}\n >\n <Select.TriggerButton placeholder={t('settings default llm model label')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {DEFAULT_LLM_MODELS.map((model) => (\n <Select.Option key={model} value={model}>\n {model}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </DeprecatedFormInput>\n </DeprecatedFormContainer>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { Filter, type Space } from '@dxos/client/echo';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { Icon, Input, List, ListItem } from '@dxos/react-ui';\n\nimport { useServices } from '../../hooks';\nimport { categoryIcons, ServiceType } from '../../types';\n\n// TODO(burdon): Option to show all/enabled/filter.\nexport const ServiceRegistry = ({ space }: { space: Space }) => {\n const matchingServices = useServices(space);\n const enabledServices = useQuery(space, Filter.schema(ServiceType));\n\n // Join matching services with enabled services.\n const services = useMemo(() => {\n return matchingServices.map((service) => enabledServices.find((s) => s.serviceId === service.serviceId) ?? service);\n }, [matchingServices, enabledServices]);\n\n // TODO(burdon): Reaplce with SpacePlugin intent.\n const handleSetEnabled = (service: ServiceType, enabled: boolean) => {\n if (enabled) {\n space.db.add(service);\n } else {\n // TODO(burdon): Remove or disable?\n space.db.remove(service);\n }\n };\n\n return (\n <List classNames='h-full grid auto-rows-[5rem] gap-2 p-2 pis-2 pie-2 overflow-y-auto scrollbar-thin'>\n {services.map((service) => (\n <ServiceItem\n key={service.serviceId}\n service={service}\n enabled={service.enabled}\n setEnabled={(enabled) => handleSetEnabled(service, enabled)}\n />\n ))}\n </List>\n );\n};\n\nconst ServiceItem = ({\n service,\n enabled,\n setEnabled,\n}: {\n service: ServiceType;\n enabled?: boolean;\n setEnabled?: (enabled: boolean) => void;\n}) => {\n return (\n <ListItem.Root classNames='flex flex-col gap-1 p-1 overflow-hidden rounded-md border border-separator'>\n <div className='grid grid-cols-[40px_1fr_40px]'>\n <div className='flex gow justify-center items-center'>\n <Icon icon={categoryIcons[service.category ?? 'default'] ?? 'ph--placeholder--regular'} size={6} />\n </div>\n <div className='grow items-center truncate mie-2'>{service.name}</div>\n <div className='flex gow justify-center items-center'>\n <Input.Root>\n <Input.Switch checked={enabled} onClick={() => setEnabled?.(!enabled)} />\n </Input.Root>\n </div>\n </div>\n <div className='grid grid-cols-[40px_1fr]'>\n <div />\n <div className='text-sm text-subdued line-clamp-2 mie-1'>{service.description}</div>\n </div>\n </ListItem.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './AssistantSettings';\nexport * from './ServiceRegistry';\nexport * from './TemplateEditor';\nexport * from './Thread';\nexport * from './Toolbox';\n\nexport const AssistantDialog = lazy(() => import('./AssistantDialog'));\nexport const ChatContainer = lazy(() => import('./ChatContainer'));\nexport const TemplateContainer = lazy(() => import('./TemplateContainer'));\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,uBAAmC;AACnC,sBAA8C;AAC9C,2BAA6D;ACJ7D,IAAAA,gBAA+B;AAE/B,kBAAmC;AACnC,IAAAC,eAAyB;AACzB,IAAAC,mBAA4C;ACJ5C,IAAAF,gBAAqB;AFSd,IAAMG,oBAAoB,CAAC,EAAEC,SAAQ,MAAwC;AAClF,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,sCAAAA;AAE7B,SACE,6BAAAC,QAAA,cAACC,8CAAAA,MACC,6BAAAD,QAAA,cAACE,0CAAAA;IAAoBC,OAAON,EAAE,+BAAA;KAC5B,6BAAAG,QAAA,cAACI,sBAAMC,QAAM;IACXC,SAAS,CAAC,CAACV,SAASW;IACpBC,iBAAiB,CAACF,YAAaV,SAASW,gBAAgBD;OAI5D,6BAAAN,QAAA,cAACE,0CAAAA;IAAoBC,OAAON,EAAE,0BAAA;KAC5B,6BAAAG,QAAA,cAACS,uBAAOC,MAAI;IACVC,OAAOf,SAASgB,YAAY;IAC5BC,eAAe,CAACF,UAAAA;AACdf,eAASgB,WAAWD;IACtB;KAEA,6BAAAX,QAAA,cAACS,uBAAOK,eAAa;IAACC,aAAalB,EAAE,kCAAA;MACrC,6BAAAG,QAAA,cAACS,uBAAOO,QAAM,MACZ,6BAAAhB,QAAA,cAACS,uBAAOQ,SAAO,MACb,6BAAAjB,QAAA,cAACS,uBAAOS,UAAQ,MACbC,oCAAmBC,IAAI,CAACC,UACvB,6BAAArB,QAAA,cAACS,uBAAOa,QAAM;IAACC,KAAKF;IAAOV,OAAOU;KAC/BA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAA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AAI,MACTV,8BAAAA,QAAA,cAACI,iBAAAA,MAAMC,QAAM;IAACC,SAASkC;IAASiB,SAAS,MAAMV,aAAa,CAACP,OAAAA;SAInExC,8BAAAA,QAAA,cAACiD,OAAAA;IAAIC,WAAU;KACblD,8BAAAA,QAAA,cAACiD,OAAAA,IAAAA,GACDjD,8BAAAA,QAAA,cAACiD,OAAAA;IAAIC,WAAU;KAA2Cf,QAAQuB,WAAW,CAAA,CAAA;AAIrF;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DEFAULT_LLM_MODELS } from '@dxos/assistant';\nimport { Input, Select, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { ASSISTANT_PLUGIN } from '../../meta';\nimport { type AssistantSettingsProps } from '../../types';\n\nexport const AssistantSettings = ({ settings }: { settings: AssistantSettingsProps }) => {\n const { t } = useTranslation(ASSISTANT_PLUGIN);\n\n return (\n <DeprecatedFormContainer>\n <DeprecatedFormInput label={t('settings custom prompts label')}>\n <Input.Switch\n checked={!!settings.customPrompts}\n onCheckedChange={(checked) => (settings.customPrompts = checked)}\n />\n </DeprecatedFormInput>\n\n <DeprecatedFormInput label={t('settings llm model label')}>\n <Select.Root\n value={settings.llmModel ?? 'default'}\n onValueChange={(value) => {\n settings.llmModel = value;\n }}\n >\n <Select.TriggerButton placeholder={t('settings default llm model label')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {DEFAULT_LLM_MODELS.map((model) => (\n <Select.Option key={model} value={model}>\n {model}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </DeprecatedFormInput>\n </DeprecatedFormContainer>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { Filter, type Space } from '@dxos/client/echo';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { Icon, Input, List, ListItem } from '@dxos/react-ui';\n\nimport { useServices } from '../../hooks';\nimport { categoryIcons, ServiceType } from '../../types';\n\n// TODO(burdon): Option to show all/enabled/filter.\nexport const ServiceRegistry = ({ space }: { space: Space }) => {\n const matchingServices = useServices(space);\n const enabledServices = useQuery(space, Filter.schema(ServiceType));\n\n // Join matching services with enabled services.\n const services = useMemo(() => {\n return matchingServices.map((service) => enabledServices.find((s) => s.serviceId === service.serviceId) ?? service);\n }, [matchingServices, enabledServices]);\n\n // TODO(burdon): Reaplce with SpacePlugin intent.\n const handleSetEnabled = (service: ServiceType, enabled: boolean) => {\n if (enabled) {\n space.db.add(service);\n } else {\n // TODO(burdon): Remove or disable?\n space.db.remove(service);\n }\n };\n\n return (\n <List classNames='h-full grid auto-rows-[5rem] gap-2 p-2 pis-2 pie-2 overflow-y-auto scrollbar-thin'>\n {services.map((service) => (\n <ServiceItem\n key={service.serviceId}\n service={service}\n enabled={service.enabled}\n setEnabled={(enabled) => handleSetEnabled(service, enabled)}\n />\n ))}\n </List>\n );\n};\n\nconst ServiceItem = ({\n service,\n enabled,\n setEnabled,\n}: {\n service: ServiceType;\n enabled?: boolean;\n setEnabled?: (enabled: boolean) => void;\n}) => {\n return (\n <ListItem.Root classNames='flex flex-col gap-1 p-1 overflow-hidden rounded-md border border-separator'>\n <div className='grid grid-cols-[40px_1fr_40px]'>\n <div className='flex gow justify-center items-center'>\n <Icon icon={categoryIcons[service.category ?? 'default'] ?? 'ph--placeholder--regular'} size={6} />\n </div>\n <div className='grow items-center truncate mie-2'>{service.name}</div>\n <div className='flex gow justify-center items-center'>\n <Input.Root>\n <Input.Switch checked={enabled} onClick={() => setEnabled?.(!enabled)} />\n </Input.Root>\n </div>\n </div>\n <div className='grid grid-cols-[40px_1fr]'>\n <div />\n <div className='text-sm text-subdued line-clamp-2 mie-1'>{service.description}</div>\n </div>\n </ListItem.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './AssistantSettings';\nexport * from './ServiceRegistry';\nexport * from './TemplateEditor';\nexport * from './Thread';\nexport * from './Toolbox';\n\n// TODO(burdon): Lazy loading causes issues with Tabster.\n// Repro: open assistant dialog then close.\n// https://github.com/microsoft/fluentui/issues/34020\nexport const AssistantDialog = lazy(() => import('./AssistantDialog'));\nexport const ChatContainer = lazy(() => import('./ChatContainer'));\nexport const TemplateContainer = lazy(() => import('./TemplateContainer'));\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,uBAAmC;AACnC,sBAA8C;AAC9C,2BAA6D;ACJ7D,IAAAA,gBAA+B;AAE/B,kBAAmC;AACnC,IAAAC,eAAyB;AACzB,IAAAC,mBAA4C;ACJ5C,IAAAF,gBAAqB;AFSd,IAAMG,oBAAoB,CAAC,EAAEC,SAAQ,MAAwC;AAClF,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,sCAAAA;AAE7B,SACE,6BAAAC,QAAA,cAACC,8CAAAA,MACC,6BAAAD,QAAA,cAACE,0CAAAA;IAAoBC,OAAON,EAAE,+BAAA;KAC5B,6BAAAG,QAAA,cAACI,sBAAMC,QAAM;IACXC,SAAS,CAAC,CAACV,SAASW;IACpBC,iBAAiB,CAACF,YAAaV,SAASW,gBAAgBD;OAI5D,6BAAAN,QAAA,cAACE,0CAAAA;IAAoBC,OAAON,EAAE,0BAAA;KAC5B,6BAAAG,QAAA,cAACS,uBAAOC,MAAI;IACVC,OAAOf,SAASgB,YAAY;IAC5BC,eAAe,CAACF,UAAAA;AACdf,eAASgB,WAAWD;IACtB;KAEA,6BAAAX,QAAA,cAACS,uBAAOK,eAAa;IAACC,aAAalB,EAAE,kCAAA;MACrC,6BAAAG,QAAA,cAACS,uBAAOO,QAAM,MACZ,6BAAAhB,QAAA,cAACS,uBAAOQ,SAAO,MACb,6BAAAjB,QAAA,cAACS,uBAAOS,UAAQ,MACbC,oCAAmBC,IAAI,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AAIC,WAAU;KAAoCf,QAAQqB,IAAI,GAC/DxD,8BAAAA,QAAA,cAACiD,OAAAA;IAAIC,WAAU;KACblD,8BAAAA,QAAA,cAACI,iBAAAA,MAAMM,MAAI,MACTV,8BAAAA,QAAA,cAACI,iBAAAA,MAAMC,QAAM;IAACC,SAASkC;IAASiB,SAAS,MAAMV,aAAa,CAACP,OAAAA;SAInExC,8BAAAA,QAAA,cAACiD,OAAAA;IAAIC,WAAU;KACblD,8BAAAA,QAAA,cAACiD,OAAAA,IAAAA,GACDjD,8BAAAA,QAAA,cAACiD,OAAAA;IAAIC,WAAU;KAA2Cf,QAAQuB,WAAW,CAAA,CAAA;AAIrF;AC5DO,IAAMC,sBAAkBC,oBAAK,MAAM,OAAO,gCAAA,CAAA;AAC1C,IAAMC,oBAAgBD,oBAAK,MAAM,OAAO,8BAAA,CAAA;AACxC,IAAME,wBAAoBF,oBAAK,MAAM,OAAO,kCAAA,CAAA;",
|
|
6
6
|
"names": ["import_react", "import_echo", "import_react_ui", "AssistantSettings", "settings", "t", "useTranslation", "ASSISTANT_PLUGIN", "React", "DeprecatedFormContainer", "DeprecatedFormInput", "label", "Input", "Switch", "checked", "customPrompts", "onCheckedChange", "Select", "Root", "value", "llmModel", "onValueChange", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "DEFAULT_LLM_MODELS", "map", "model", "Option", "key", "ServiceRegistry", "space", "matchingServices", "useServices", "enabledServices", "useQuery", "Filter", "schema", "ServiceType", "services", "useMemo", "service", "find", "s", "serviceId", "handleSetEnabled", "enabled", "db", "add", "remove", "List", "classNames", "ServiceItem", "setEnabled", "ListItem", "div", "className", "Icon", "icon", "categoryIcons", "category", "size", "name", "onClick", "description", "AssistantDialog", "lazy", "ChatContainer", "TemplateContainer"]
|
|
7
7
|
}
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_JWUHUQ56_exports = {};
|
|
30
|
+
__export(chunk_JWUHUQ56_exports, {
|
|
31
31
|
AiClient: () => AiClient,
|
|
32
32
|
AppGraphBuilder: () => AppGraphBuilder,
|
|
33
33
|
AssistantSettings: () => AssistantSettings,
|
|
@@ -39,20 +39,20 @@ __export(chunk_KOSGO3RY_exports, {
|
|
|
39
39
|
ToolboxContainer: () => ToolboxContainer,
|
|
40
40
|
useServices: () => useServices
|
|
41
41
|
});
|
|
42
|
-
module.exports = __toCommonJS(
|
|
42
|
+
module.exports = __toCommonJS(chunk_JWUHUQ56_exports);
|
|
43
43
|
var import_chunk_3WXG6WA6 = require("./chunk-3WXG6WA6.cjs");
|
|
44
|
-
var
|
|
44
|
+
var import_chunk_34WE2FD2 = require("./chunk-34WE2FD2.cjs");
|
|
45
45
|
var import_chunk_GNPXCHFT = require("./chunk-GNPXCHFT.cjs");
|
|
46
46
|
var import_react = __toESM(require("react"));
|
|
47
47
|
var import_app_framework = require("@dxos/app-framework");
|
|
48
48
|
var import_artifact = require("@dxos/artifact");
|
|
49
|
-
var
|
|
49
|
+
var import_types = require("@dxos/functions/types");
|
|
50
50
|
var import_log = require("@dxos/log");
|
|
51
51
|
var import_echo = require("@dxos/react-client/echo");
|
|
52
52
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
53
53
|
var import_artifact2 = require("@dxos/artifact");
|
|
54
54
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
55
|
-
var
|
|
55
|
+
var import_types2 = require("@dxos/functions/types");
|
|
56
56
|
var import_log2 = require("@dxos/log");
|
|
57
57
|
var import_echo2 = require("@dxos/react-client/echo");
|
|
58
58
|
var import_jsonpointer = __toESM(require("jsonpointer"));
|
|
@@ -103,7 +103,7 @@ var import_react8 = require("react");
|
|
|
103
103
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
104
104
|
var import_artifact5 = require("@dxos/artifact");
|
|
105
105
|
var import_assistant2 = require("@dxos/assistant");
|
|
106
|
-
var
|
|
106
|
+
var import_types3 = require("@dxos/functions/types");
|
|
107
107
|
var import_log7 = require("@dxos/log");
|
|
108
108
|
var import_react_client = require("@dxos/react-client");
|
|
109
109
|
var import_echo4 = require("@dxos/react-client/echo");
|
|
@@ -112,15 +112,15 @@ var import_app_framework3 = require("@dxos/app-framework");
|
|
|
112
112
|
var import_react9 = require("react");
|
|
113
113
|
var import_async = require("@dxos/async");
|
|
114
114
|
var import_context = require("@dxos/context");
|
|
115
|
-
var
|
|
116
|
-
var
|
|
115
|
+
var import_functions = require("@dxos/functions");
|
|
116
|
+
var import_types4 = require("@dxos/functions/types");
|
|
117
117
|
var import_invariant5 = require("@dxos/invariant");
|
|
118
118
|
var import_log8 = require("@dxos/log");
|
|
119
119
|
var import_react_client2 = require("@dxos/react-client");
|
|
120
120
|
var import_echo5 = require("@dxos/react-client/echo");
|
|
121
121
|
var import_async2 = require("@dxos/async");
|
|
122
122
|
var import_echo_db = require("@dxos/echo-db");
|
|
123
|
-
var
|
|
123
|
+
var import_types5 = require("@dxos/functions/types");
|
|
124
124
|
var import_invariant6 = require("@dxos/invariant");
|
|
125
125
|
var import_keys = require("@dxos/keys");
|
|
126
126
|
var import_log9 = require("@dxos/log");
|
|
@@ -138,11 +138,11 @@ var covertFunctionToTool = (fn, edgeUrl, spaceId) => {
|
|
|
138
138
|
if (!fn.description || !fn.inputSchema) {
|
|
139
139
|
return void 0;
|
|
140
140
|
}
|
|
141
|
-
const existingFunctionUrl = (0,
|
|
141
|
+
const existingFunctionUrl = (0, import_types2.getUserFunctionUrlInMetadata)((0, import_echo2.getMeta)(fn));
|
|
142
142
|
if (!existingFunctionUrl) {
|
|
143
143
|
return void 0;
|
|
144
144
|
}
|
|
145
|
-
const url = (0,
|
|
145
|
+
const url = (0, import_types2.getInvocationUrl)(existingFunctionUrl, edgeUrl, {
|
|
146
146
|
spaceId
|
|
147
147
|
});
|
|
148
148
|
return (0, import_artifact2.defineTool)("user-function", {
|
|
@@ -609,7 +609,7 @@ var Section = ({ title, items, striped }) => {
|
|
|
609
609
|
};
|
|
610
610
|
var ToolboxContainer = ({ classNames, space }) => {
|
|
611
611
|
const artifactDefinitions = (0, import_app_framework.useCapabilities)(import_app_framework.Capabilities.ArtifactDefinition);
|
|
612
|
-
const services = (0, import_echo.useQuery)(space, import_echo.Filter.schema(
|
|
612
|
+
const services = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_chunk_34WE2FD2.ServiceType));
|
|
613
613
|
const [serviceTools, setServiceTools] = (0, import_react.useState)([]);
|
|
614
614
|
(0, import_react.useEffect)(() => {
|
|
615
615
|
(0, import_log.log)("creating service tools...", {
|
|
@@ -630,7 +630,7 @@ var ToolboxContainer = ({ classNames, space }) => {
|
|
|
630
630
|
}, [
|
|
631
631
|
services
|
|
632
632
|
]);
|
|
633
|
-
const functions = (0, import_echo.useQuery)(space, import_echo.Filter.schema(
|
|
633
|
+
const functions = (0, import_echo.useQuery)(space, import_echo.Filter.schema(import_types.FunctionType));
|
|
634
634
|
return /* @__PURE__ */ import_react.default.createElement(Toolbox, {
|
|
635
635
|
classNames,
|
|
636
636
|
artifacts: artifactDefinitions,
|
|
@@ -1190,14 +1190,18 @@ var PromptBar = ({ classNames, placeholder, processing, error, microphone, onCan
|
|
|
1190
1190
|
}
|
|
1191
1191
|
});
|
|
1192
1192
|
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
1193
|
-
className: (0, import_react_ui_theme5.mx)("
|
|
1193
|
+
className: (0, import_react_ui_theme5.mx)("shrink-0 w-full grid grid-cols-[var(--rail-action)_1fr_var(--rail-action)] overflow-hidden", classNames)
|
|
1194
1194
|
}, /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
1195
1195
|
className: "flex w-[--rail-action] h-[--rail-action] items-center justify-center"
|
|
1196
|
-
}, error && /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.
|
|
1196
|
+
}, error && /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Tooltip.Root, {
|
|
1197
|
+
delayDuration: 0
|
|
1198
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Tooltip.Trigger, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Icon, {
|
|
1197
1199
|
icon: "ph--warning-circle--regular",
|
|
1198
1200
|
classNames: import_react_ui_theme5.errorText,
|
|
1199
1201
|
size: 5
|
|
1200
|
-
})
|
|
1202
|
+
})), /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Tooltip.Portal, null, /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Tooltip.Content, null, /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
1203
|
+
className: "text-sm text-error-500"
|
|
1204
|
+
}, error.message), /* @__PURE__ */ import_react6.default.createElement(import_react_ui3.Tooltip.Arrow, null)))) || /* @__PURE__ */ import_react6.default.createElement(import_react_ui_sfx.Spinner, {
|
|
1201
1205
|
active: processing
|
|
1202
1206
|
})), /* @__PURE__ */ import_react6.default.createElement(Prompt, {
|
|
1203
1207
|
ref: promptRef,
|
|
@@ -1485,26 +1489,38 @@ var ChatProcessor = class {
|
|
|
1485
1489
|
S: this,
|
|
1486
1490
|
C: (f, a) => f(...a)
|
|
1487
1491
|
});
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1492
|
+
if (err instanceof Error && err.message.includes("Overloaded")) {
|
|
1493
|
+
this.error.value = new AIServiecOverloadedError("AI service overloaded", {
|
|
1494
|
+
cause: err
|
|
1495
|
+
});
|
|
1496
|
+
} else {
|
|
1497
|
+
this.error.value = new Error("AI service error", {
|
|
1498
|
+
cause: err
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1491
1501
|
} finally {
|
|
1492
1502
|
this._stream = void 0;
|
|
1493
1503
|
}
|
|
1494
1504
|
}
|
|
1495
1505
|
};
|
|
1496
|
-
var
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1506
|
+
var AIServiecOverloadedError = class extends Error {
|
|
1507
|
+
constructor() {
|
|
1508
|
+
super(...arguments);
|
|
1509
|
+
this.code = "AI_SERVICE_OVERLOADED";
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
var AiClient = (0, import_app_framework3.lazy)(() => import("./ai-client-6CY35ZIR.cjs"));
|
|
1513
|
+
var AppGraphBuilder = (0, import_app_framework3.lazy)(() => import("./app-graph-builder-7O4U4RXH.cjs"));
|
|
1514
|
+
var IntentResolver = (0, import_app_framework3.lazy)(() => import("./intent-resolver-Z37RNNMC.cjs"));
|
|
1515
|
+
var ReactSurface = (0, import_app_framework3.lazy)(() => import("./react-surface-KFXP3GGK.cjs"));
|
|
1516
|
+
var AssistantSettings = (0, import_app_framework3.lazy)(() => import("./settings-TJHHVI6B.cjs"));
|
|
1501
1517
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-assistant/src/hooks/useChatProcessor.tsx";
|
|
1502
1518
|
var useChatProcessor = (space, settings) => {
|
|
1503
1519
|
const aiClient = (0, import_app_framework2.useCapability)(import_chunk_3WXG6WA6.AssistantCapabilities.AiClient);
|
|
1504
1520
|
const globalTools = (0, import_app_framework2.useCapabilities)(import_app_framework2.Capabilities.Tools);
|
|
1505
1521
|
const artifactDefinitions = (0, import_app_framework2.useCapabilities)(import_app_framework2.Capabilities.ArtifactDefinition);
|
|
1506
1522
|
const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
|
|
1507
|
-
const services = (0, import_echo4.useQuery)(space, import_echo4.Filter.schema(
|
|
1523
|
+
const services = (0, import_echo4.useQuery)(space, import_echo4.Filter.schema(import_chunk_34WE2FD2.ServiceType));
|
|
1508
1524
|
const [serviceTools, setServiceTools] = (0, import_react8.useState)([]);
|
|
1509
1525
|
(0, import_react8.useEffect)(() => {
|
|
1510
1526
|
(0, import_log7.log)("creating service tools...", void 0, {
|
|
@@ -1521,7 +1537,7 @@ var useChatProcessor = (space, settings) => {
|
|
|
1521
1537
|
services
|
|
1522
1538
|
]);
|
|
1523
1539
|
const config = (0, import_react_client.useConfig)();
|
|
1524
|
-
const functions = (0, import_echo4.useQuery)(space, import_echo4.Filter.schema(
|
|
1540
|
+
const functions = (0, import_echo4.useQuery)(space, import_echo4.Filter.schema(import_types3.FunctionType));
|
|
1525
1541
|
const [tools, extensions] = (0, import_react8.useMemo)(() => {
|
|
1526
1542
|
(0, import_log7.log)("creating tools...", void 0, {
|
|
1527
1543
|
F: __dxlog_file7,
|
|
@@ -1618,7 +1634,7 @@ var VISUAL_CROSSING_CREDENTIALS = {
|
|
|
1618
1634
|
}
|
|
1619
1635
|
};
|
|
1620
1636
|
var TEST_SERVICES = [
|
|
1621
|
-
(0, import_echo_schema4.createStatic)(
|
|
1637
|
+
(0, import_echo_schema4.createStatic)(import_chunk_34WE2FD2.ServiceType, {
|
|
1622
1638
|
serviceId: "amadeus.com/service/FlightSearch",
|
|
1623
1639
|
name: "Amadeus Flight Search",
|
|
1624
1640
|
description: "Search for local and international flights.",
|
|
@@ -1631,7 +1647,7 @@ var TEST_SERVICES = [
|
|
|
1631
1647
|
}
|
|
1632
1648
|
]
|
|
1633
1649
|
}),
|
|
1634
|
-
(0, import_echo_schema4.createStatic)(
|
|
1650
|
+
(0, import_echo_schema4.createStatic)(import_chunk_34WE2FD2.ServiceType, {
|
|
1635
1651
|
serviceId: "amadeus.com/service/HotelSearch",
|
|
1636
1652
|
name: "Amadeus Hotel Search",
|
|
1637
1653
|
description: "Search for local and international hotels.",
|
|
@@ -1644,7 +1660,7 @@ var TEST_SERVICES = [
|
|
|
1644
1660
|
}
|
|
1645
1661
|
]
|
|
1646
1662
|
}),
|
|
1647
|
-
(0, import_echo_schema4.createStatic)(
|
|
1663
|
+
(0, import_echo_schema4.createStatic)(import_chunk_34WE2FD2.ServiceType, {
|
|
1648
1664
|
serviceId: "visualcrossing.com/service/Weather",
|
|
1649
1665
|
name: "Visual Crossing Weather",
|
|
1650
1666
|
description: "Search for global weather forecasts.",
|
|
@@ -1658,7 +1674,7 @@ var TEST_SERVICES = [
|
|
|
1658
1674
|
]
|
|
1659
1675
|
}),
|
|
1660
1676
|
// TODO(burdon): Needs auth.
|
|
1661
|
-
(0, import_echo_schema4.createStatic)(
|
|
1677
|
+
(0, import_echo_schema4.createStatic)(import_chunk_34WE2FD2.ServiceType, {
|
|
1662
1678
|
serviceId: "abstractapi.com/service/GeoLocation",
|
|
1663
1679
|
name: "Abstract GeoLocation",
|
|
1664
1680
|
description: "Get the location of any IP address.",
|
|
@@ -1675,11 +1691,11 @@ var TEST_SERVICES = [
|
|
|
1675
1691
|
//
|
|
1676
1692
|
...Array.from({
|
|
1677
1693
|
length: 20
|
|
1678
|
-
}, (_, i) => (0, import_echo_schema4.createStatic)(
|
|
1694
|
+
}, (_, i) => (0, import_echo_schema4.createStatic)(import_chunk_34WE2FD2.ServiceType, {
|
|
1679
1695
|
serviceId: `example.com/service/test-${i}`,
|
|
1680
1696
|
name: `Test ${i}`,
|
|
1681
1697
|
description: `Test ${i}`,
|
|
1682
|
-
category: Object.keys(
|
|
1698
|
+
category: Object.keys(import_chunk_34WE2FD2.categoryIcons)[Math.floor(Math.random() * Object.keys(import_chunk_34WE2FD2.categoryIcons).length)],
|
|
1683
1699
|
interfaces: [
|
|
1684
1700
|
{
|
|
1685
1701
|
kind: "api",
|
|
@@ -1778,4 +1794,4 @@ var ThreadContainer = ({ classNames, chat, settings, onOpenChange, ...props }) =
|
|
|
1778
1794
|
ToolboxContainer,
|
|
1779
1795
|
useServices
|
|
1780
1796
|
});
|
|
1781
|
-
//# sourceMappingURL=chunk-
|
|
1797
|
+
//# sourceMappingURL=chunk-JWUHUQ56.cjs.map
|