@dxos/plugin-assistant 0.8.2-main.f081794 → 0.8.2-main.f11618f
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-I47GUXWR.mjs} +3 -3
- package/dist/lib/browser/{ChatContainer-4AMJKO3T.mjs → ChatContainer-GAYN3FEF.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-ZXKGE3H5.mjs} +5 -35
- package/dist/lib/browser/app-graph-builder-ZXKGE3H5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FQ4L5NYW.mjs → chunk-7CAHKTZQ.mjs} +56 -45
- package/dist/lib/browser/chunk-7CAHKTZQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SBFJKCVU.mjs → chunk-BGMQ2YYP.mjs} +24 -69
- package/dist/lib/browser/chunk-BGMQ2YYP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IAMR2FAE.mjs → chunk-E7BN4QKP.mjs} +9 -2
- package/dist/lib/browser/{chunk-IAMR2FAE.mjs.map → chunk-E7BN4QKP.mjs.map} +3 -3
- 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-W6XREK5F.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-JOATHBJ4.mjs → react-surface-QMI5KG4H.mjs} +5 -14
- package/dist/lib/browser/react-surface-QMI5KG4H.mjs.map +7 -0
- package/dist/lib/browser/{settings-PAJLJEVW.mjs → settings-LAJZQI4H.mjs} +2 -2
- package/dist/lib/browser/types/index.mjs +3 -1
- package/dist/lib/node/{AssistantDialog-7V7RRSIL.cjs → AssistantDialog-SDS2TE5L.cjs} +7 -7
- package/dist/lib/node/{ChatContainer-UWYNOALW.cjs → ChatContainer-U6AVMAHY.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-TXHPXIIC.cjs} +12 -42
- package/dist/lib/node/app-graph-builder-TXHPXIIC.cjs.map +7 -0
- package/dist/lib/node/{chunk-APRU3QWK.cjs → chunk-5UELRDHQ.cjs} +13 -5
- package/dist/lib/node/{chunk-APRU3QWK.cjs.map → chunk-5UELRDHQ.cjs.map} +3 -3
- package/dist/lib/node/{chunk-ENBPNIJZ.cjs → chunk-CWHFK36A.cjs} +76 -64
- package/dist/lib/node/chunk-CWHFK36A.cjs.map +7 -0
- package/dist/lib/node/{chunk-KWBQ5P7D.cjs → chunk-XBJO453B.cjs} +28 -69
- package/dist/lib/node/chunk-XBJO453B.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-MUJMV7II.cjs} +9 -9
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-7RIXMLMN.cjs → react-surface-SAJF4XBB.cjs} +16 -24
- package/dist/lib/node/react-surface-SAJF4XBB.cjs.map +7 -0
- package/dist/lib/node/{settings-JBEYMZ4S.cjs → settings-NPXTE6ND.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-KGA5HBFO.mjs} +3 -3
- package/dist/lib/node-esm/{ChatContainer-KPWY5UK4.mjs → ChatContainer-XPNXNPSW.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-SV4WC2E2.mjs} +5 -35
- package/dist/lib/node-esm/app-graph-builder-SV4WC2E2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MXK2EANZ.mjs → chunk-ECYNZYEG.mjs} +9 -2
- package/dist/lib/node-esm/{chunk-MXK2EANZ.mjs.map → chunk-ECYNZYEG.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-PFWTW22U.mjs → chunk-R7Q3OHWG.mjs} +24 -69
- package/dist/lib/node-esm/chunk-R7Q3OHWG.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JE47GNTB.mjs → chunk-XFUXN5QU.mjs} +56 -45
- package/dist/lib/node-esm/chunk-XFUXN5QU.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-DZY2O2DG.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-UUHNOYST.mjs → react-surface-R43NHNMC.mjs} +5 -14
- package/dist/lib/node-esm/react-surface-R43NHNMC.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-KAMA6RIY.mjs → settings-K3JDH2I5.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/index.d.ts +0 -1
- package/dist/types/src/components/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/types/types.d.ts +3 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +57 -57
- 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/Thread/ThreadContainer.stories.tsx +3 -3
- package/src/components/Thread/ThreadMessage.tsx +5 -2
- package/src/components/index.ts +0 -1
- package/src/hooks/processor.ts +25 -2
- package/src/hooks/useChatProcessor.tsx +2 -1
- package/src/translations.ts +1 -1
- package/src/types/types.ts +4 -1
- 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-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-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-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/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/dist/lib/browser/{AssistantDialog-77B4BSXR.mjs.map → AssistantDialog-I47GUXWR.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-4AMJKO3T.mjs.map → ChatContainer-GAYN3FEF.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-YAQELTFQ.mjs.map → intent-resolver-W6XREK5F.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-PAJLJEVW.mjs.map → settings-LAJZQI4H.mjs.map} +0 -0
- /package/dist/lib/node/{AssistantDialog-7V7RRSIL.cjs.map → AssistantDialog-SDS2TE5L.cjs.map} +0 -0
- /package/dist/lib/node/{ChatContainer-UWYNOALW.cjs.map → ChatContainer-U6AVMAHY.cjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-RNMYSJ3E.cjs.map → intent-resolver-MUJMV7II.cjs.map} +0 -0
- /package/dist/lib/node/{settings-JBEYMZ4S.cjs.map → settings-NPXTE6ND.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AssistantDialog-N24M73FW.mjs.map → AssistantDialog-KGA5HBFO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-KPWY5UK4.mjs.map → ChatContainer-XPNXNPSW.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-V2ZFI5C4.mjs.map → intent-resolver-DZY2O2DG.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-KAMA6RIY.mjs.map → settings-K3JDH2I5.mjs.map} +0 -0
|
@@ -26,15 +26,15 @@ 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 ChatContainer_U6AVMAHY_exports = {};
|
|
30
|
+
__export(ChatContainer_U6AVMAHY_exports, {
|
|
31
31
|
ChatContainer: () => ChatContainer,
|
|
32
32
|
default: () => ChatContainer_default
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(ChatContainer_U6AVMAHY_exports);
|
|
35
|
+
var import_chunk_CWHFK36A = require("./chunk-CWHFK36A.cjs");
|
|
36
36
|
var import_chunk_GBUNQ257 = require("./chunk-GBUNQ257.cjs");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_5UELRDHQ = require("./chunk-5UELRDHQ.cjs");
|
|
38
38
|
var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
|
|
39
39
|
var import_react = __toESM(require("react"));
|
|
40
40
|
var import_app_framework = require("@dxos/app-framework");
|
|
@@ -46,7 +46,7 @@ var ChatContainer = ({ role, chat, associatedArtifact }) => {
|
|
|
46
46
|
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_stack.StackItem.Content, {
|
|
47
47
|
role,
|
|
48
48
|
classNames: "container-max-width"
|
|
49
|
-
}, /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_chunk_CWHFK36A.ThreadContainer, {
|
|
50
50
|
chat,
|
|
51
51
|
settings,
|
|
52
52
|
transcription,
|
|
@@ -58,4 +58,4 @@ var ChatContainer_default = ChatContainer;
|
|
|
58
58
|
0 && (module.exports = {
|
|
59
59
|
ChatContainer
|
|
60
60
|
});
|
|
61
|
-
//# sourceMappingURL=ChatContainer-
|
|
61
|
+
//# sourceMappingURL=ChatContainer-U6AVMAHY.cjs.map
|
|
@@ -16,11 +16,11 @@ 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_3EVTLXTT_exports = {};
|
|
20
|
+
__export(ai_client_3EVTLXTT_exports, {
|
|
21
21
|
default: () => ai_client_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(ai_client_3EVTLXTT_exports);
|
|
24
24
|
var import_chunk_GBUNQ257 = require("./chunk-GBUNQ257.cjs");
|
|
25
25
|
var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
|
|
26
26
|
var import_signals_core = require("@preact/signals-core");
|
|
@@ -46,4 +46,4 @@ var ai_client_default = (context) => {
|
|
|
46
46
|
});
|
|
47
47
|
return (0, import_app_framework.contributes)(import_chunk_GBUNQ257.AssistantCapabilities.AiClient, ai, () => unsubscribe());
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=ai-client-
|
|
49
|
+
//# sourceMappingURL=ai-client-3EVTLXTT.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/ai-client.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect, signal } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type AIServiceClient, AIServiceEdgeClient, OllamaClient } from '@dxos/assistant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AssistantCapabilities } from './capabilities';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps } from '../types';\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\n const ai = signal<AIServiceClient>(new AIServiceEdgeClient({ endpoint }));\n\n const unsubscribe = effect(() => {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAA+B;AAE/B,2BAA+D;AAC/D,uBAAwE;AACxE,2BAAmC;AAOnC,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,SAAKE,4BAAwB,IAAIC,qCAAoB;IAAER;EAAS,CAAA,CAAA;AAEtE,QAAMS,kBAAcC,4BAAO,MAAA;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect, signal } from '@preact/signals-core';\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type AIServiceClient, AIServiceEdgeClient, OllamaClient } from '@dxos/assistant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AssistantCapabilities } from './capabilities';\nimport { ASSISTANT_PLUGIN } from '../meta';\nimport { type AssistantSettingsProps } from '../types';\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\n const ai = signal<AIServiceClient>(new AIServiceEdgeClient({ endpoint }));\n\n const unsubscribe = effect(() => {\n const settings = context\n .requestCapability(Capabilities.SettingsStore)\n .getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;\n\n if (settings?.llmProvider === 'ollama') {\n ai.value = new OllamaClient();\n } else {\n ai.value = new AIServiceEdgeClient({ endpoint });\n }\n });\n\n return contributes(AssistantCapabilities.AiClient, ai, () => unsubscribe());\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,0BAA+B;AAE/B,2BAA+D;AAC/D,uBAAwE;AACxE,2BAAmC;AAOnC,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,SAAKE,4BAAwB,IAAIC,qCAAoB;IAAER;EAAS,CAAA,CAAA;AAEtE,QAAMS,kBAAcC,4BAAO,MAAA;AACzB,UAAMC,WAAWhB,QACdE,kBAAkBe,kCAAaC,aAAa,EAC5CC,SAAiCC,sCAAAA,GAAmBC;AAEvD,QAAIL,UAAUM,gBAAgB,UAAU;AACtCZ,SAAGW,QAAQ,IAAIE,8BAAAA;IACjB,OAAO;AACLb,SAAGW,QAAQ,IAAIR,qCAAoB;QAAER;MAAS,CAAA;IAChD;EACF,CAAA;AAEA,aAAOmB,kCAAYC,4CAAsBC,UAAUhB,IAAI,MAAMI,YAAAA,CAAAA;AAC/D;",
|
|
6
6
|
"names": ["DEFAULT_AI_SERVICE_URL", "context", "client", "requestCapability", "ClientCapabilities", "Client", "endpoint", "config", "values", "runtime", "services", "ai", "server", "signal", "AIServiceEdgeClient", "unsubscribe", "effect", "settings", "Capabilities", "SettingsStore", "getStore", "ASSISTANT_PLUGIN", "value", "llmProvider", "OllamaClient", "contributes", "AssistantCapabilities", "AiClient"]
|
|
7
7
|
}
|
|
@@ -16,12 +16,12 @@ 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_TXHPXIIC_exports = {};
|
|
20
|
+
__export(app_graph_builder_TXHPXIIC_exports, {
|
|
21
21
|
default: () => app_graph_builder_default
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(app_graph_builder_TXHPXIIC_exports);
|
|
24
|
+
var import_chunk_5UELRDHQ = require("./chunk-5UELRDHQ.cjs");
|
|
25
25
|
var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
|
|
26
26
|
var import_app_framework = require("@dxos/app-framework");
|
|
27
27
|
var import_invariant = require("@dxos/invariant");
|
|
@@ -90,39 +90,9 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
|
|
|
90
90
|
}
|
|
91
91
|
]
|
|
92
92
|
}),
|
|
93
|
-
(0, import_plugin_graph.createExtension)({
|
|
94
|
-
id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/service-registry`,
|
|
95
|
-
filter: (node) => node.id === "root",
|
|
96
|
-
connector: ({ node }) => {
|
|
97
|
-
const layout = context.requestCapability(import_app_framework.Capabilities.Layout);
|
|
98
|
-
const client = context.requestCapability(import_plugin_client.ClientCapabilities.Client);
|
|
99
|
-
const { spaceId } = (0, import_echo.parseId)(layout.workspace);
|
|
100
|
-
const space = spaceId ? client.spaces.get(spaceId) : null;
|
|
101
|
-
return [
|
|
102
|
-
{
|
|
103
|
-
id: [
|
|
104
|
-
node.id,
|
|
105
|
-
"service-registry"
|
|
106
|
-
].join(import_types.ATTENDABLE_PATH_SEPARATOR),
|
|
107
|
-
type: import_types.DECK_COMPANION_TYPE,
|
|
108
|
-
data: space,
|
|
109
|
-
properties: {
|
|
110
|
-
label: [
|
|
111
|
-
"service registry label",
|
|
112
|
-
{
|
|
113
|
-
ns: import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
icon: "ph--plugs--regular",
|
|
117
|
-
disposition: "hidden"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
];
|
|
121
|
-
}
|
|
122
|
-
}),
|
|
123
93
|
(0, import_plugin_graph.createExtension)({
|
|
124
94
|
id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/object-chat-companion`,
|
|
125
|
-
filter: (node) => (0, import_echo.isLiveObject)(node.data) && node.data.assistantChatQueue && node.data.type !==
|
|
95
|
+
filter: (node) => (0, import_echo.isLiveObject)(node.data) && node.data.assistantChatQueue && node.data.type !== import_chunk_5UELRDHQ.AIChatType.typename,
|
|
126
96
|
connector: ({ node }) => [
|
|
127
97
|
{
|
|
128
98
|
id: [
|
|
@@ -148,7 +118,7 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
|
|
|
148
118
|
id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/root`,
|
|
149
119
|
filter: (node) => node.type === import_types2.SPACE_TYPE,
|
|
150
120
|
connector: ({ node }) => {
|
|
151
|
-
const templates = (0, import_plugin_space.memoizeQuery)(node.data, import_echo.Filter.schema(
|
|
121
|
+
const templates = (0, import_plugin_space.memoizeQuery)(node.data, import_echo.Filter.schema(import_chunk_5UELRDHQ.TemplateType));
|
|
152
122
|
return templates.length > 0 ? [
|
|
153
123
|
{
|
|
154
124
|
id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/templates`,
|
|
@@ -172,7 +142,7 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
|
|
|
172
142
|
id: `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/templates`,
|
|
173
143
|
filter: (node) => node.id === `${import_chunk_Q5XWEMHB.ASSISTANT_PLUGIN}/templates`,
|
|
174
144
|
connector: ({ node }) => {
|
|
175
|
-
const templates = (0, import_plugin_space.memoizeQuery)(node.properties.space, import_echo.Filter.schema(
|
|
145
|
+
const templates = (0, import_plugin_space.memoizeQuery)(node.properties.space, import_echo.Filter.schema(import_chunk_5UELRDHQ.TemplateType));
|
|
176
146
|
return templates.toSorted((a, b) => {
|
|
177
147
|
const nameA = a.name ?? "";
|
|
178
148
|
const nameB = b.name ?? "";
|
|
@@ -195,16 +165,16 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
|
|
|
195
165
|
})
|
|
196
166
|
]);
|
|
197
167
|
var getOrCreateChat = async (dispatch, space) => {
|
|
198
|
-
const { objects } = await space.db.query(import_echo.Filter.schema(
|
|
168
|
+
const { objects } = await space.db.query(import_echo.Filter.schema(import_chunk_5UELRDHQ.AIChatType)).run();
|
|
199
169
|
if (objects.length > 0) {
|
|
200
170
|
return objects[objects.length - 1];
|
|
201
171
|
}
|
|
202
|
-
const { data } = await dispatch((0, import_app_framework.createIntent)(
|
|
172
|
+
const { data } = await dispatch((0, import_app_framework.createIntent)(import_chunk_5UELRDHQ.AssistantAction.CreateChat, {
|
|
203
173
|
spaceId: space.id
|
|
204
174
|
}));
|
|
205
|
-
(0, import_invariant.invariant)(data?.object instanceof
|
|
175
|
+
(0, import_invariant.invariant)(data?.object instanceof import_chunk_5UELRDHQ.AIChatType, void 0, {
|
|
206
176
|
F: __dxlog_file,
|
|
207
|
-
L:
|
|
177
|
+
L: 160,
|
|
208
178
|
S: void 0,
|
|
209
179
|
A: [
|
|
210
180
|
"data?.object instanceof AIChatType",
|
|
@@ -217,4 +187,4 @@ var getOrCreateChat = async (dispatch, space) => {
|
|
|
217
187
|
}));
|
|
218
188
|
return data.object;
|
|
219
189
|
};
|
|
220
|
-
//# sourceMappingURL=app-graph-builder-
|
|
190
|
+
//# sourceMappingURL=app-graph-builder-TXHPXIIC.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 { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';\nimport { memoizeQuery } from '@dxos/plugin-space';\nimport { SPACE_TYPE, SpaceAction } from '@dxos/plugin-space/types';\nimport { type Space, Filter, fullyQualifiedId, getSpace, isLiveObject } from '@dxos/react-client/echo';\n\nimport { ASSISTANT_DIALOG, ASSISTANT_PLUGIN } from '../meta';\nimport { AIChatType, AssistantAction, TemplateType } 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--star-four--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 createExtension({\n id: `${ASSISTANT_PLUGIN}/object-chat-companion`,\n filter: (node): node is Node<AIChatType> =>\n isLiveObject(node.data) && node.data.assistantChatQueue && node.data.type !== AIChatType.typename,\n connector: ({ node }) => [\n {\n id: [node.id, 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),\n type: PLANK_COMPANION_TYPE,\n data: 'assistant-chat',\n properties: {\n label: ['assistant chat label', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--star-four--regular',\n position: 'hoist',\n },\n },\n ],\n }),\n\n createExtension({\n id: `${ASSISTANT_PLUGIN}/root`,\n filter: (node): node is Node<Space> => node.type === SPACE_TYPE,\n connector: ({ node }) => {\n const templates = memoizeQuery(node.data, Filter.schema(TemplateType));\n return templates.length > 0\n ? [\n {\n id: `${ASSISTANT_PLUGIN}/templates`,\n type: `${ASSISTANT_PLUGIN}/templates`,\n data: null,\n properties: {\n label: ['templates label', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--file-code--regular',\n space: node.data,\n },\n },\n ]\n : [];\n },\n }),\n\n createExtension({\n id: `${ASSISTANT_PLUGIN}/templates`,\n filter: (node): node is Node<null, { space: Space }> => node.id === `${ASSISTANT_PLUGIN}/templates`,\n connector: ({ node }) => {\n const templates = memoizeQuery(node.properties.space, Filter.schema(TemplateType));\n return templates\n .toSorted((a, b) => {\n const nameA = a.name ?? '';\n const nameB = b.name ?? '';\n return nameA.localeCompare(nameB);\n })\n .map((template) => ({\n id: fullyQualifiedId(template),\n type: `${ASSISTANT_PLUGIN}/template`,\n data: template,\n properties: {\n label: template.name ?? ['object placeholder', { ns: ASSISTANT_PLUGIN }],\n icon: 'ph--file-code--regular',\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,mBAAgE;AAChE,0BAAoD;AACpD,0BAA6B;AAC7B,IAAAA,gBAAwC;AACxC,kBAA6E;;AAK7E,IAAA,4BAAe,CAACC,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;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AO,CAAA,CAAA;AACxF,SAAOvE,KAAKuE;AACd;",
|
|
6
|
+
"names": ["import_types", "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", "isLiveObject", "assistantChatQueue", "type", "AIChatType", "typename", "connector", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "SPACE_TYPE", "templates", "memoizeQuery", "Filter", "schema", "TemplateType", "toSorted", "a", "b", "nameA", "name", "nameB", "localeCompare", "map", "template", "fullyQualifiedId", "objects", "db", "query", "run", "AssistantAction", "CreateChat", "spaceId", "invariant", "object", "SpaceAction", "AddObject", "target"]
|
|
7
|
+
}
|
|
@@ -16,12 +16,13 @@ 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_5UELRDHQ_exports = {};
|
|
20
|
+
__export(chunk_5UELRDHQ_exports, {
|
|
21
21
|
AIChatType: () => AIChatType,
|
|
22
22
|
ApiAuthorization: () => ApiAuthorization,
|
|
23
23
|
AssistantAction: () => AssistantAction,
|
|
24
24
|
AssistantSettingsSchema: () => AssistantSettingsSchema,
|
|
25
|
+
LLM_PROVIDERS: () => LLM_PROVIDERS,
|
|
25
26
|
ServiceType: () => ServiceType,
|
|
26
27
|
TemplateInputSchema: () => TemplateInputSchema,
|
|
27
28
|
TemplateInputType: () => TemplateInputType,
|
|
@@ -30,7 +31,7 @@ __export(chunk_APRU3QWK_exports, {
|
|
|
30
31
|
TemplateType: () => TemplateType,
|
|
31
32
|
categoryIcons: () => categoryIcons
|
|
32
33
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_5UELRDHQ_exports);
|
|
34
35
|
var import_chunk_Q5XWEMHB = require("./chunk-Q5XWEMHB.cjs");
|
|
35
36
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
36
37
|
var import_conductor = require("@dxos/conductor");
|
|
@@ -183,10 +184,16 @@ var AssistantAction;
|
|
|
183
184
|
}
|
|
184
185
|
AssistantAction2.CreateTemplate = CreateTemplate;
|
|
185
186
|
})(AssistantAction || (AssistantAction = {}));
|
|
187
|
+
var LLM_PROVIDERS = [
|
|
188
|
+
"edge",
|
|
189
|
+
"ollama",
|
|
190
|
+
"lmstudio"
|
|
191
|
+
];
|
|
186
192
|
var AssistantSettingsSchema = import_echo_schema4.S.mutable(import_echo_schema4.S.Struct({
|
|
187
|
-
llmProvider: import_echo_schema4.S.optional(import_echo_schema4.S.Literal(
|
|
193
|
+
llmProvider: import_echo_schema4.S.optional(import_echo_schema4.S.Literal(...LLM_PROVIDERS)),
|
|
188
194
|
edgeModel: import_echo_schema4.S.optional(import_echo_schema4.S.String),
|
|
189
195
|
ollamaModel: import_echo_schema4.S.optional(import_echo_schema4.S.String),
|
|
196
|
+
lmstudioModel: import_echo_schema4.S.optional(import_echo_schema4.S.String),
|
|
190
197
|
customPrompts: import_echo_schema4.S.optional(import_echo_schema4.S.Boolean)
|
|
191
198
|
}));
|
|
192
199
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -195,6 +202,7 @@ var AssistantSettingsSchema = import_echo_schema4.S.mutable(import_echo_schema4.
|
|
|
195
202
|
ApiAuthorization,
|
|
196
203
|
AssistantAction,
|
|
197
204
|
AssistantSettingsSchema,
|
|
205
|
+
LLM_PROVIDERS,
|
|
198
206
|
ServiceType,
|
|
199
207
|
TemplateInputSchema,
|
|
200
208
|
TemplateInputType,
|
|
@@ -203,4 +211,4 @@ var AssistantSettingsSchema = import_echo_schema4.S.mutable(import_echo_schema4.
|
|
|
203
211
|
TemplateType,
|
|
204
212
|
categoryIcons
|
|
205
213
|
});
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
214
|
+
//# sourceMappingURL=chunk-5UELRDHQ.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, TypedObject } from '@dxos/echo-schema';\n\nexport class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({\n // TODO(wittjosiah): Should be a ref to a Queue.\n assistantChatQueue: 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 const TemplateKinds = ['always', 'schema-matching', 'automatically', 'manual'] as const;\nexport type TemplateKind = (typeof TemplateKinds)[number];\n\nexport const TemplateKindSchema = S.Union(\n S.Struct({\n include: S.Literal('always'),\n }),\n S.Struct({\n include: S.Literal('schema-matching'),\n typename: S.String,\n }),\n S.Struct({\n include: S.Literal('automatically'),\n description: S.String,\n }),\n S.Struct({\n include: S.Literal('manual'),\n }),\n);\n\nexport type TemplateKindType = S.Schema.Type<typeof TemplateKindSchema>;\nexport class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({\n name: S.optional(S.String),\n kind: S.mutable(TemplateKindSchema),\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 llmProvider: S.optional(S.Literal(
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["import_echo_schema", "AIChatType", "TypedObject", "typename", "version", "assistantChatQueue", "Ref", "Expando", "ApiAuthorizationKey", "S", "Struct", "type", "Literal", "key", "String", "placement", "Union", "name", "ApiAuthorizationOauth", "clientId", "clientSecret", "tokenUrl", "grantType", "ApiAuthorization", "ServiceInterfaceFunction", "kind", "fn", "FunctionType", "ServiceInterfaceWorkflow", "workflow", "ComputeGraph", "ServiceInterfaceApi", "schemaUrl", "optional", "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", "TemplateKinds", "TemplateKindSchema", "include", "TemplateType", "source", "inputs", "command", "AssistantAction", "ASSISTANT_ACTION", "ASSISTANT_PLUGIN", "CreateChat", "TaggedClass", "input", "spaceId", "output", "object", "CreateTemplate", "AssistantSettingsSchema", "llmProvider", "edgeModel", "ollamaModel", "customPrompts"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, Ref, TypedObject } from '@dxos/echo-schema';\n\nexport class AIChatType extends TypedObject({ typename: 'dxos.org/type/AIChat', version: '0.1.0' })({\n // TODO(wittjosiah): Should be a ref to a Queue.\n assistantChatQueue: 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 const TemplateKinds = ['always', 'schema-matching', 'automatically', 'manual'] as const;\nexport type TemplateKind = (typeof TemplateKinds)[number];\n\nexport const TemplateKindSchema = S.Union(\n S.Struct({\n include: S.Literal('always'),\n }),\n S.Struct({\n include: S.Literal('schema-matching'),\n typename: S.String,\n }),\n S.Struct({\n include: S.Literal('automatically'),\n description: S.String,\n }),\n S.Struct({\n include: S.Literal('manual'),\n }),\n);\n\nexport type TemplateKindType = S.Schema.Type<typeof TemplateKindSchema>;\nexport class TemplateType extends TypedObject({ typename: 'dxos.org/type/Template', version: '0.1.0' })({\n name: S.optional(S.String),\n kind: S.mutable(TemplateKindSchema),\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 LLM_PROVIDERS = ['edge', 'ollama', 'lmstudio'] as const;\n\nexport const AssistantSettingsSchema = S.mutable(\n S.Struct({\n llmProvider: S.optional(S.Literal(...LLM_PROVIDERS)),\n edgeModel: S.optional(S.String),\n ollamaModel: S.optional(S.String),\n lmstudioModel: 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,yBAA0C;ACA1C,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;;EAElGC,wBAAoBC,wBAAIC,0BAAAA;AAC1B,CAAA,EAAA;AAAI;ACDJ,IAAMC,sBAAsBC,sBAAEC,OAAO;EACnCC,MAAMF,sBAAEG,QAAQ,SAAA;EAChBC,KAAKJ,sBAAEK;EACPC,WAAWN,sBAAEO,MACXP,sBAAEC,OAAO;IACPC,MAAMF,sBAAEG,QAAQ,sBAAA;EAClB,CAAA,GACAH,sBAAEC,OAAO;IACPC,MAAMF,sBAAEG,QAAQ,OAAA;IAChBK,MAAMR,sBAAEK;EACV,CAAA,CAAA;AAEJ,CAAA;AAEA,IAAMI,wBAAwBT,sBAAEC,OAAO;EACrCC,MAAMF,sBAAEG,QAAQ,OAAA;EAChBO,UAAUV,sBAAEK;EACZM,cAAcX,sBAAEK;EAChBO,UAAUZ,sBAAEK;EACZQ,WAAWb,sBAAEK;AACf,CAAA;AAEO,IAAMS,mBAAmBd,sBAAEO,MAAMR,qBAAqBU,qBAAAA;AAG7D,IAAMM,2BAA2Bf,sBAAEC,OAAO;EACxCe,MAAMhB,sBAAEG,QAAQ,UAAA;EAChBc,QAAIpB,oBAAAA,KAAIqB,yBAAAA;AACV,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AC5BG,MAAMR,oBAAAA,EAAEwB,SAASxB,oBAAAA,EAAEK,MAAM;IAC3B,CAAA;IACA6D,QAAQlE,oBAAAA,EAAEC,OAAO;MACfkE,QAAQ3E;IACV,CAAA;EACF,CAAA,EAAA;EAAI;mBARSsE,aAAAA;EAUN,MAAMM,uBAAuBpE,oBAAAA,EAAE+D,YAAW,EAAmB,GAAGH,gBAAAA,oBAAoC;IACzGI,OAAOhE,oBAAAA,EAAEC,OAAO;MACdO,MAAMR,oBAAAA,EAAEwB,SAASxB,oBAAAA,EAAEK,MAAM;IAC3B,CAAA;IACA6D,QAAQlE,oBAAAA,EAAEC,OAAO;MACfkE,QAAQZ;IACV,CAAA;EACF,CAAA,EAAA;EAAI;mBAPSa,iBAAAA;AAQf,GArBiBT,oBAAAA,kBAAAA,CAAAA,EAAAA;AAuBV,IAAMU,gBAAgB;EAAC;EAAQ;EAAU;;AAEzC,IAAMC,0BAA0BtE,oBAAAA,EAAEiD,QACvCjD,oBAAAA,EAAEC,OAAO;EACPsE,aAAavE,oBAAAA,EAAEwB,SAASxB,oBAAAA,EAAEG,QAAO,GAAIkE,aAAAA,CAAAA;EACrCG,WAAWxE,oBAAAA,EAAEwB,SAASxB,oBAAAA,EAAEK,MAAM;EAC9BoE,aAAazE,oBAAAA,EAAEwB,SAASxB,oBAAAA,EAAEK,MAAM;EAChCqE,eAAe1E,oBAAAA,EAAEwB,SAASxB,oBAAAA,EAAEK,MAAM;EAClCsE,eAAe3E,oBAAAA,EAAEwB,SAASxB,oBAAAA,EAAEkC,OAAO;AACrC,CAAA,CAAA;",
|
|
6
|
+
"names": ["import_echo_schema", "AIChatType", "TypedObject", "typename", "version", "assistantChatQueue", "Ref", "Expando", "ApiAuthorizationKey", "S", "Struct", "type", "Literal", "key", "String", "placement", "Union", "name", "ApiAuthorizationOauth", "clientId", "clientSecret", "tokenUrl", "grantType", "ApiAuthorization", "ServiceInterfaceFunction", "kind", "fn", "FunctionType", "ServiceInterfaceWorkflow", "workflow", "ComputeGraph", "ServiceInterfaceApi", "schemaUrl", "optional", "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", "TemplateKinds", "TemplateKindSchema", "include", "TemplateType", "source", "inputs", "command", "AssistantAction", "ASSISTANT_ACTION", "ASSISTANT_PLUGIN", "CreateChat", "TaggedClass", "input", "spaceId", "output", "object", "CreateTemplate", "LLM_PROVIDERS", "AssistantSettingsSchema", "llmProvider", "edgeModel", "ollamaModel", "lmstudioModel", "customPrompts"]
|
|
7
7
|
}
|