@dxos/compute 0.8.4-main.fcfe5033a5 → 0.8.4-staging.60fe92afc8
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/LICENSE +102 -5
- package/README.md +36 -1
- package/dist/lib/neutral/StorageService.mjs +22 -0
- package/dist/lib/neutral/StorageService.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2B2KSJT6.mjs +17 -0
- package/dist/lib/neutral/chunk-2B2KSJT6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-AFBNVFAY.mjs +25 -0
- package/dist/lib/neutral/chunk-AFBNVFAY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JAU4E4EK.mjs +53 -0
- package/dist/lib/neutral/chunk-JAU4E4EK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MEPE4HHX.mjs +21 -0
- package/dist/lib/neutral/chunk-MEPE4HHX.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QZS4G6PE.mjs +240 -0
- package/dist/lib/neutral/chunk-QZS4G6PE.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XEVFBI6S.mjs +62 -0
- package/dist/lib/neutral/chunk-XEVFBI6S.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Z3Y7FQGN.mjs +174 -0
- package/dist/lib/neutral/chunk-Z3Y7FQGN.mjs.map +7 -0
- package/dist/lib/neutral/fib-HBDUGQW7.mjs +10 -0
- package/dist/lib/neutral/fib-HBDUGQW7.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1179 -51
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/reply-RJIAJ6FV.mjs +10 -0
- package/dist/lib/neutral/reply-RJIAJ6FV.mjs.map +7 -0
- package/dist/lib/neutral/sleep-3T2CZ7RE.mjs +10 -0
- package/dist/lib/neutral/sleep-3T2CZ7RE.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +27 -214
- package/dist/lib/neutral/testing/index.mjs.map +4 -4
- package/dist/types/src/Blueprint.d.ts +182 -0
- package/dist/types/src/Blueprint.d.ts.map +1 -0
- package/dist/types/src/Credential.d.ts +27 -0
- package/dist/types/src/Credential.d.ts.map +1 -0
- package/dist/types/src/Header.d.ts +9 -0
- package/dist/types/src/Header.d.ts.map +1 -0
- package/dist/types/src/Header.test.d.ts +2 -0
- package/dist/types/src/Header.test.d.ts.map +1 -0
- package/dist/types/src/LayerSpec.d.ts +56 -0
- package/dist/types/src/LayerSpec.d.ts.map +1 -0
- package/dist/types/src/McpServer.d.ts +26 -0
- package/dist/types/src/McpServer.d.ts.map +1 -0
- package/dist/types/src/Operation.d.ts +385 -0
- package/dist/types/src/Operation.d.ts.map +1 -0
- package/dist/types/src/OperationHandlerSet.d.ts +69 -0
- package/dist/types/src/OperationHandlerSet.d.ts.map +1 -0
- package/dist/types/src/OperationHandlerSet.test.d.ts +2 -0
- package/dist/types/src/OperationHandlerSet.test.d.ts.map +1 -0
- package/dist/types/src/OperationRegistry.d.ts +23 -0
- package/dist/types/src/OperationRegistry.d.ts.map +1 -0
- package/dist/types/src/Process.d.ts +255 -0
- package/dist/types/src/Process.d.ts.map +1 -0
- package/dist/types/src/Routine.d.ts +54 -0
- package/dist/types/src/Routine.d.ts.map +1 -0
- package/dist/types/src/Script.d.ts +21 -0
- package/dist/types/src/Script.d.ts.map +1 -0
- package/dist/types/src/ServiceResolver.d.ts +92 -0
- package/dist/types/src/ServiceResolver.d.ts.map +1 -0
- package/dist/types/src/StorageService.d.ts +58 -0
- package/dist/types/src/StorageService.d.ts.map +1 -0
- package/dist/types/src/Template.d.ts +61 -0
- package/dist/types/src/Template.d.ts.map +1 -0
- package/dist/types/src/Template.test.d.ts +2 -0
- package/dist/types/src/Template.test.d.ts.map +1 -0
- package/dist/types/src/Trace.d.ts +266 -0
- package/dist/types/src/Trace.d.ts.map +1 -0
- package/dist/types/src/Trigger.d.ts +192 -0
- package/dist/types/src/Trigger.d.ts.map +1 -0
- package/dist/types/src/TriggerEvent.d.ts +83 -0
- package/dist/types/src/TriggerEvent.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +308 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +18 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing/definitions.d.ts +11 -0
- package/dist/types/src/testing/definitions.d.ts.map +1 -0
- package/dist/types/src/testing/fib.d.ts +8 -0
- package/dist/types/src/testing/fib.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +6 -4
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/reply.d.ts +4 -0
- package/dist/types/src/testing/reply.d.ts.map +1 -0
- package/dist/types/src/testing/sleep.d.ts +6 -0
- package/dist/types/src/testing/sleep.d.ts.map +1 -0
- package/dist/types/src/umbrella.test.d.ts +2 -0
- package/dist/types/src/umbrella.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -36
- package/src/Blueprint.ts +224 -0
- package/src/Credential.ts +53 -0
- package/src/Header.test.ts +132 -0
- package/src/Header.ts +38 -0
- package/src/LayerSpec.ts +91 -0
- package/src/McpServer.ts +44 -0
- package/src/Operation.ts +646 -0
- package/src/OperationHandlerSet.test.ts +97 -0
- package/src/OperationHandlerSet.ts +181 -0
- package/src/OperationRegistry.ts +50 -0
- package/src/Process.ts +541 -0
- package/src/Routine.ts +68 -0
- package/src/Script.ts +33 -0
- package/src/ServiceResolver.ts +200 -0
- package/src/StorageService.ts +101 -0
- package/src/Template.test.ts +164 -0
- package/src/Template.ts +125 -0
- package/src/Trace.ts +363 -0
- package/src/Trigger.ts +196 -0
- package/src/TriggerEvent.ts +64 -0
- package/src/errors.ts +71 -0
- package/src/index.ts +20 -6
- package/src/testing/definitions.ts +51 -0
- package/src/testing/fib.ts +22 -0
- package/src/testing/index.ts +13 -5
- package/src/testing/reply.ts +18 -0
- package/src/testing/sleep.ts +16 -0
- package/src/umbrella.test.ts +51 -0
- package/dist/lib/neutral/chunk-JRV42MW3.mjs +0 -3101
- package/dist/lib/neutral/chunk-JRV42MW3.mjs.map +0 -7
- package/dist/types/src/compute-graph-registry.d.ts +0 -37
- package/dist/types/src/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/compute-graph-registry.test.d.ts +0 -2
- package/dist/types/src/compute-graph-registry.test.d.ts.map +0 -1
- package/dist/types/src/compute-graph.d.ts +0 -67
- package/dist/types/src/compute-graph.d.ts.map +0 -1
- package/dist/types/src/compute-graph.test.d.ts +0 -2
- package/dist/types/src/compute-graph.test.d.ts.map +0 -1
- package/dist/types/src/compute-node.d.ts +0 -24
- package/dist/types/src/compute-node.d.ts.map +0 -1
- package/dist/types/src/functions/async-function.d.ts +0 -68
- package/dist/types/src/functions/async-function.d.ts.map +0 -1
- package/dist/types/src/functions/edge-function.d.ts +0 -20
- package/dist/types/src/functions/edge-function.d.ts.map +0 -1
- package/dist/types/src/functions/function-defs.d.ts +0 -11
- package/dist/types/src/functions/function-defs.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/hyperformula.test.d.ts +0 -2
- package/dist/types/src/hyperformula.test.d.ts.map +0 -1
- package/dist/types/src/testing/test-builder.d.ts +0 -15
- package/dist/types/src/testing/test-builder.d.ts.map +0 -1
- package/dist/types/src/testing/test-plugin.d.ts +0 -35
- package/dist/types/src/testing/test-plugin.d.ts.map +0 -1
- package/dist/types/src/testing/test-runtime.d.ts +0 -10
- package/dist/types/src/testing/test-runtime.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -2
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/dist/types/src/types/hyperformula.d.ts +0 -8
- package/dist/types/src/types/hyperformula.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -3
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -20
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/dist/types/src/types/types.test.d.ts +0 -2
- package/dist/types/src/types/types.test.d.ts.map +0 -1
- package/dist/types/src/util.d.ts +0 -2
- package/dist/types/src/util.d.ts.map +0 -1
- package/src/compute-graph-registry.test.ts +0 -167
- package/src/compute-graph-registry.ts +0 -97
- package/src/compute-graph.test.ts +0 -139
- package/src/compute-graph.ts +0 -265
- package/src/compute-node.ts +0 -59
- package/src/functions/async-function.ts +0 -184
- package/src/functions/edge-function.ts +0 -108
- package/src/functions/function-defs.ts +0 -2427
- package/src/functions/index.ts +0 -7
- package/src/hyperformula.test.ts +0 -14
- package/src/testing/test-builder.ts +0 -59
- package/src/testing/test-plugin.ts +0 -98
- package/src/testing/test-runtime.ts +0 -53
- package/src/testing/util.ts +0 -9
- package/src/types/hyperformula.ts +0 -19
- package/src/types/index.ts +0 -6
- package/src/types/types.test.ts +0 -91
- package/src/types/types.ts +0 -80
- package/src/util.ts +0 -8
|
@@ -1,219 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
invoke: (op, ...args) => {
|
|
22
|
-
const handler = handlers.find((h) => h.meta.key === op.meta.key);
|
|
23
|
-
if (!handler) {
|
|
24
|
-
return Effect.die(`No handler found for operation: ${op.meta.key}`);
|
|
25
|
-
}
|
|
26
|
-
const result = handler.handler(args[0]);
|
|
27
|
-
if (Effect.isEffect(result)) {
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
return Effect.promise(() => Promise.resolve(result));
|
|
31
|
-
},
|
|
32
|
-
schedule: () => Effect.void,
|
|
33
|
-
invokePromise: async () => ({
|
|
34
|
-
error: new Error("Not implemented in test runtime")
|
|
35
|
-
})
|
|
36
|
-
};
|
|
37
|
-
})) : Layer.succeed(Operation.Service, {
|
|
38
|
-
invoke: () => Effect.die("Operation.Service not available in test."),
|
|
39
|
-
schedule: () => Effect.die("Operation.Service not available in test."),
|
|
40
|
-
invokePromise: async () => ({
|
|
41
|
-
error: new Error("Not available")
|
|
42
|
-
})
|
|
43
|
-
}))
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/testing/test-builder.ts
|
|
48
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/src/testing/test-builder.ts";
|
|
49
|
-
var TestBuilder = class extends Resource {
|
|
50
|
-
_options;
|
|
51
|
-
_client;
|
|
52
|
-
_registry;
|
|
53
|
-
constructor(_options = {}) {
|
|
54
|
-
super(), this._options = _options;
|
|
55
|
-
}
|
|
56
|
-
get ctx() {
|
|
57
|
-
return this._ctx;
|
|
58
|
-
}
|
|
59
|
-
get client() {
|
|
60
|
-
invariant(this._client, void 0, {
|
|
61
|
-
F: __dxlog_file,
|
|
62
|
-
L: 28,
|
|
63
|
-
S: this,
|
|
64
|
-
A: [
|
|
65
|
-
"this._client",
|
|
66
|
-
""
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
return this._client;
|
|
70
|
-
}
|
|
71
|
-
get registry() {
|
|
72
|
-
invariant(this._registry, void 0, {
|
|
73
|
-
F: __dxlog_file,
|
|
74
|
-
L: 33,
|
|
75
|
-
S: this,
|
|
76
|
-
A: [
|
|
77
|
-
"this._registry",
|
|
78
|
-
""
|
|
79
|
-
]
|
|
80
|
-
});
|
|
81
|
-
return this._registry;
|
|
82
|
-
}
|
|
83
|
-
async _open() {
|
|
84
|
-
const client = new Client(this._options);
|
|
85
|
-
await client.initialize();
|
|
86
|
-
await client.halo.createIdentity();
|
|
87
|
-
this._client = client;
|
|
88
|
-
this._ctx.onDispose(async () => {
|
|
89
|
-
await client.destroy();
|
|
90
|
-
this._client = void 0;
|
|
91
|
-
});
|
|
92
|
-
const registry = new ComputeGraphRegistry({
|
|
93
|
-
...this._options,
|
|
94
|
-
// Provide a default runtime provider for tests if not supplied.
|
|
95
|
-
computeRuntime: this._options.computeRuntime ?? createMockedComputeRuntimeProvider()
|
|
96
|
-
});
|
|
97
|
-
await registry.open();
|
|
98
|
-
this._registry = registry;
|
|
99
|
-
this._ctx.onDispose(async () => {
|
|
100
|
-
await registry.close();
|
|
101
|
-
this._registry = void 0;
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// src/testing/test-plugin.ts
|
|
107
|
-
import { getDeep } from "@dxos/util";
|
|
108
|
-
import { FunctionArgumentType } from "@dxos/vendor-hyperformula";
|
|
109
|
-
|
|
110
|
-
// src/util.ts
|
|
111
|
-
var parseNumberString = (str) => {
|
|
112
|
-
return parseFloat(str.replace(/[^\d.]/g, ""));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// src/testing/test-plugin.ts
|
|
116
|
-
var TestPlugin = class extends AsyncFunctionPlugin {
|
|
117
|
-
/**
|
|
118
|
-
* Simple local function returns input value.
|
|
119
|
-
*/
|
|
120
|
-
test(ast, state) {
|
|
121
|
-
const handler = async (_value) => {
|
|
122
|
-
return _value;
|
|
123
|
-
};
|
|
124
|
-
return this.runAsyncFunction(ast, state, handler);
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Simple local function returns random number.
|
|
128
|
-
*/
|
|
129
|
-
random(ast, state) {
|
|
130
|
-
const handler = async () => {
|
|
131
|
-
return Math.random();
|
|
132
|
-
};
|
|
133
|
-
return this.runAsyncFunction(ast, state, handler);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Async HTTP function.
|
|
137
|
-
*/
|
|
138
|
-
crypto(ast, state) {
|
|
139
|
-
const handler = async (_currency) => {
|
|
140
|
-
const currency = (_currency || "USD").toUpperCase();
|
|
141
|
-
const result = await fetch(`https://api.coindesk.com/v1/bpi/currentprice/${currency}.json`);
|
|
142
|
-
const data = await result.json();
|
|
143
|
-
const rate = getDeep(data, [
|
|
144
|
-
"bpi",
|
|
145
|
-
currency,
|
|
146
|
-
"rate"
|
|
147
|
-
]);
|
|
148
|
-
if (!rate) {
|
|
149
|
-
return NaN;
|
|
150
|
-
}
|
|
151
|
-
return parseNumberString(rate);
|
|
152
|
-
};
|
|
153
|
-
return this.runAsyncFunction(ast, state, handler, {
|
|
154
|
-
ttl: 1e4
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
TestPlugin.implementedFunctions = {
|
|
159
|
-
TEST: {
|
|
160
|
-
method: "test",
|
|
161
|
-
parameters: [
|
|
162
|
-
{
|
|
163
|
-
argumentType: FunctionArgumentType.NUMBER,
|
|
164
|
-
optionalArg: false
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
isVolatile: true
|
|
168
|
-
},
|
|
169
|
-
RANDOM: {
|
|
170
|
-
method: "random",
|
|
171
|
-
parameters: [],
|
|
172
|
-
isVolatile: true
|
|
173
|
-
},
|
|
174
|
-
CRYPTO: {
|
|
175
|
-
method: "crypto",
|
|
176
|
-
parameters: [
|
|
177
|
-
{
|
|
178
|
-
argumentType: FunctionArgumentType.STRING,
|
|
179
|
-
optionalArg: true
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
isVolatile: true
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
var TestPluginTranslations = {
|
|
186
|
-
enGB: {
|
|
187
|
-
TEST: "Returns input value",
|
|
188
|
-
RANDOM: "Random number",
|
|
189
|
-
CRYPTO: "Crypto token value"
|
|
190
|
-
},
|
|
191
|
-
enUS: {
|
|
192
|
-
TEST: "Returns input value",
|
|
193
|
-
RANDOM: "Random number",
|
|
194
|
-
CRYPTO: "Crypto token value"
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
var testFunctionPlugins = [
|
|
198
|
-
{
|
|
199
|
-
plugin: TestPlugin,
|
|
200
|
-
translations: TestPluginTranslations
|
|
201
|
-
}
|
|
202
|
-
];
|
|
2
|
+
lazy
|
|
3
|
+
} from "../chunk-Z3Y7FQGN.mjs";
|
|
4
|
+
import {
|
|
5
|
+
fib_default
|
|
6
|
+
} from "../chunk-AFBNVFAY.mjs";
|
|
7
|
+
import {
|
|
8
|
+
reply_default
|
|
9
|
+
} from "../chunk-MEPE4HHX.mjs";
|
|
10
|
+
import {
|
|
11
|
+
sleep_default
|
|
12
|
+
} from "../chunk-2B2KSJT6.mjs";
|
|
13
|
+
import {
|
|
14
|
+
Fibonacci,
|
|
15
|
+
Reply,
|
|
16
|
+
Sleep
|
|
17
|
+
} from "../chunk-JAU4E4EK.mjs";
|
|
18
|
+
import "../chunk-QZS4G6PE.mjs";
|
|
19
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
203
20
|
|
|
204
|
-
// src/testing/
|
|
205
|
-
import
|
|
206
|
-
var getRegisteredFunctionNames = () => {
|
|
207
|
-
return HyperFormula.buildEmpty({
|
|
208
|
-
licenseKey: "gpl-v3"
|
|
209
|
-
}).getRegisteredFunctionNames();
|
|
210
|
-
};
|
|
21
|
+
// src/testing/index.ts
|
|
22
|
+
var ExampleHandlers = lazy(() => import("../fib-HBDUGQW7.mjs"), () => import("../reply-RJIAJ6FV.mjs"), () => import("../sleep-3T2CZ7RE.mjs"));
|
|
211
23
|
export {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
24
|
+
ExampleHandlers,
|
|
25
|
+
Fibonacci,
|
|
26
|
+
fib_default as FibonacciHandler,
|
|
27
|
+
Reply,
|
|
28
|
+
reply_default as ReplyHandler,
|
|
29
|
+
Sleep,
|
|
30
|
+
sleep_default as SleepHandler
|
|
218
31
|
};
|
|
219
32
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/testing/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../../src/testing/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as OperationHandlerSet from '../OperationHandlerSet';\n\nexport { Fibonacci, Reply, Sleep } from './definitions';\nexport { default as FibonacciHandler } from './fib';\nexport { default as ReplyHandler } from './reply';\nexport { default as SleepHandler } from './sleep';\n\nexport const ExampleHandlers = OperationHandlerSet.lazy(\n () => import('./fib'),\n () => import('./reply'),\n () => import('./sleep'),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAWO,IAAMA,kBAAsCC,KACjD,MAAM,OAAO,qBAAA,GACb,MAAM,OAAO,uBAAA,GACb,MAAM,OAAO,uBAAA,CAAA;",
|
|
6
|
+
"names": ["ExampleHandlers", "lazy"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import { Database, Migration, Obj, Registry, Type, URI } from '@dxos/echo';
|
|
4
|
+
import { BaseError } from '@dxos/errors';
|
|
5
|
+
import * as Operation from './Operation';
|
|
6
|
+
/**
|
|
7
|
+
* Blueprint schema defines the structure for AI assistant blueprints.
|
|
8
|
+
* Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.
|
|
9
|
+
* Blueprints may use tools to create and read artifacts, which are managed by the assistant.
|
|
10
|
+
*
|
|
11
|
+
* The registry `key` and `version` are stored in the object meta — access them via
|
|
12
|
+
* `Obj.getMeta(blueprint).key` and `Obj.getMeta(blueprint).version`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Blueprint: Type.Obj<{
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly description?: string | undefined;
|
|
17
|
+
readonly instructions: {
|
|
18
|
+
readonly source: import("@dxos/echo/internal").Ref<{
|
|
19
|
+
readonly name?: string | undefined;
|
|
20
|
+
readonly content: string;
|
|
21
|
+
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
22
|
+
readonly inputs?: readonly {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly kind: "operation" | "value";
|
|
25
|
+
readonly default?: any;
|
|
26
|
+
readonly operation?: string | undefined;
|
|
27
|
+
}[] | undefined;
|
|
28
|
+
};
|
|
29
|
+
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
30
|
+
readonly agentCanEnable?: boolean | undefined;
|
|
31
|
+
readonly mcpServers?: readonly {
|
|
32
|
+
readonly name?: string | undefined;
|
|
33
|
+
readonly url: string;
|
|
34
|
+
readonly protocol: "http" | "sse";
|
|
35
|
+
readonly apiKey?: string | undefined;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
}, Schema.Struct.Fields>;
|
|
38
|
+
/**
|
|
39
|
+
* TypeScript type for Blueprint.
|
|
40
|
+
*/
|
|
41
|
+
export type Blueprint = Type.InstanceType<typeof Blueprint>;
|
|
42
|
+
type MakeProps = {
|
|
43
|
+
key: string;
|
|
44
|
+
version?: string;
|
|
45
|
+
name: string;
|
|
46
|
+
} & Partial<Blueprint>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a new Blueprint.
|
|
49
|
+
* The `key` (and optional `version`) are stored in the object meta.
|
|
50
|
+
*/
|
|
51
|
+
export declare const make: ({ key, version, tools, instructions, ...props }: MakeProps) => Obj.OfShape<{
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly description?: string | undefined;
|
|
54
|
+
readonly instructions: {
|
|
55
|
+
readonly source: import("@dxos/echo/internal").Ref<{
|
|
56
|
+
readonly name?: string | undefined;
|
|
57
|
+
readonly content: string;
|
|
58
|
+
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
59
|
+
readonly inputs?: readonly {
|
|
60
|
+
readonly name: string;
|
|
61
|
+
readonly kind: "operation" | "value";
|
|
62
|
+
readonly default?: any;
|
|
63
|
+
readonly operation?: string | undefined;
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
};
|
|
66
|
+
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
67
|
+
readonly agentCanEnable?: boolean | undefined;
|
|
68
|
+
readonly mcpServers?: readonly {
|
|
69
|
+
readonly name?: string | undefined;
|
|
70
|
+
readonly url: string;
|
|
71
|
+
readonly protocol: "http" | "sse";
|
|
72
|
+
readonly apiKey?: string | undefined;
|
|
73
|
+
}[] | undefined;
|
|
74
|
+
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>>;
|
|
75
|
+
/**
|
|
76
|
+
* Get the registry key for a blueprint.
|
|
77
|
+
*/
|
|
78
|
+
export declare const getKey: (blueprint: Blueprint) => string;
|
|
79
|
+
/**
|
|
80
|
+
* Get the registry version for a blueprint, if any.
|
|
81
|
+
*/
|
|
82
|
+
export declare const getVersion: (blueprint: Blueprint) => string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Util to create tool definitions for a blueprint.
|
|
85
|
+
*/
|
|
86
|
+
export declare const toolDefinitions: ({ tools, operations, }: {
|
|
87
|
+
tools?: string[];
|
|
88
|
+
operations?: Operation.Definition.Any[];
|
|
89
|
+
}) => (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
90
|
+
/**
|
|
91
|
+
* Factory for the blueprints.
|
|
92
|
+
*/
|
|
93
|
+
export type Definition = {
|
|
94
|
+
key: string;
|
|
95
|
+
make: () => Blueprint;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Returns the canonical URI used to reference this blueprint in the registry.
|
|
99
|
+
* Valid DXN keys produce `dxn:<key>`; other keys use the raw key as a URI.
|
|
100
|
+
* Use this URI with `Ref.fromURI` to bind a blueprint without cloning it to the DB.
|
|
101
|
+
*
|
|
102
|
+
* TODO(wittjosiah): Should use Obj.getURI instead once it supports options to prefer meta key over EID.
|
|
103
|
+
*/
|
|
104
|
+
export declare const registryURI: (key: string) => URI.URI;
|
|
105
|
+
/**
|
|
106
|
+
* Resolves a blueprint from the registry by its meta key.
|
|
107
|
+
* Does not check the local database for the blueprint.
|
|
108
|
+
*/
|
|
109
|
+
export declare const resolve: (key: string) => Effect.Effect<Blueprint, NotFoundError, Registry.Service>;
|
|
110
|
+
/**
|
|
111
|
+
* Upserts a blueprint into the database.
|
|
112
|
+
* If the blueprint already exists in the database, the local (possibly forked) copy is returned as-is.
|
|
113
|
+
* Otherwise, a fresh copy is cloned from the registry and added.
|
|
114
|
+
* @deprecated Since we're using a registry we no longer need to store blueprints in the database.
|
|
115
|
+
*/
|
|
116
|
+
export declare const upsert: (key: string) => Effect.Effect<Blueprint, NotFoundError, Registry.Service | Database.Service>;
|
|
117
|
+
declare const NotFoundError_base: {
|
|
118
|
+
new (options?: import("@dxos/errors").BaseErrorOptions): {
|
|
119
|
+
cause?: unknown;
|
|
120
|
+
stack?: string;
|
|
121
|
+
name: "BlueprintNotFound";
|
|
122
|
+
context: Record<string, unknown>;
|
|
123
|
+
readonly message: string;
|
|
124
|
+
readonly _tag: "BlueprintNotFound";
|
|
125
|
+
};
|
|
126
|
+
isError(error: unknown): error is Error;
|
|
127
|
+
name: "BlueprintNotFound";
|
|
128
|
+
is(error: unknown): error is BaseError;
|
|
129
|
+
wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
|
|
130
|
+
ifTypeDiffers?: boolean;
|
|
131
|
+
}): (error: unknown) => {
|
|
132
|
+
cause?: unknown;
|
|
133
|
+
stack?: string;
|
|
134
|
+
name: "BlueprintNotFound";
|
|
135
|
+
context: Record<string, unknown>;
|
|
136
|
+
readonly message: string;
|
|
137
|
+
readonly _tag: "BlueprintNotFound";
|
|
138
|
+
};
|
|
139
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
140
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
141
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
142
|
+
stackTraceLimit: number;
|
|
143
|
+
};
|
|
144
|
+
export declare class NotFoundError extends NotFoundError_base {
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Blueprint schema v0.1.0 — `key` is stored as a data property.
|
|
148
|
+
* @deprecated Use {@link Blueprint} (v0.2.0) instead; the `key` and `version` now live in the object meta.
|
|
149
|
+
*/
|
|
150
|
+
export declare const Blueprint_v0_1_0: Type.Obj<{
|
|
151
|
+
readonly key: string;
|
|
152
|
+
readonly name: string;
|
|
153
|
+
readonly description?: string | undefined;
|
|
154
|
+
readonly instructions: {
|
|
155
|
+
readonly source: import("@dxos/echo/internal").Ref<{
|
|
156
|
+
readonly name?: string | undefined;
|
|
157
|
+
readonly content: string;
|
|
158
|
+
} & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
159
|
+
readonly inputs?: readonly {
|
|
160
|
+
readonly name: string;
|
|
161
|
+
readonly kind: "operation" | "value";
|
|
162
|
+
readonly default?: any;
|
|
163
|
+
readonly operation?: string | undefined;
|
|
164
|
+
}[] | undefined;
|
|
165
|
+
};
|
|
166
|
+
readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
167
|
+
readonly agentCanEnable?: boolean | undefined;
|
|
168
|
+
readonly mcpServers?: readonly {
|
|
169
|
+
readonly name?: string | undefined;
|
|
170
|
+
readonly url: string;
|
|
171
|
+
readonly protocol: "http" | "sse";
|
|
172
|
+
readonly apiKey?: string | undefined;
|
|
173
|
+
}[] | undefined;
|
|
174
|
+
}, Schema.Struct.Fields>;
|
|
175
|
+
export type Blueprint_v0_1_0 = Type.InstanceType<typeof Blueprint_v0_1_0>;
|
|
176
|
+
/**
|
|
177
|
+
* Schema migrations exported by this module.
|
|
178
|
+
* Exported as an array for extensibility — append future versions here.
|
|
179
|
+
*/
|
|
180
|
+
export declare const migrations: Migration.ObjectMigration[];
|
|
181
|
+
export {};
|
|
182
|
+
//# sourceMappingURL=Blueprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Blueprint.d.ts","sourceRoot":"","sources":["../../../src/Blueprint.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAmB,QAAQ,EAAU,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC;;;;;;;GAOG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;wBA6CrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAE5D,KAAK,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,IAAI,oDAA4E,SAAS;;;;;;;;;;;;;;;;;;;;;;;wFAMlG,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,MAAM,cAAe,SAAS,KAAG,MAM7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,cAAe,SAAS,KAAG,MAAM,GAAG,SAA2C,CAAC;AAEvG;;GAEG;AACH,eAAO,MAAM,eAAe,2BAGzB;IACD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;CACzC,wDAAkH,CAAC;AAEpH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,SAAS,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,GAAG,CAAC,GAA8D,CAAC;AAE7G;;;GAGG;AACH,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,CAAC,OAAO,CAQ1F,CAAC;AAEL;;;;;GAKG;AAEH,eAAO,MAAM,MAAM,QAAS,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAO5G,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,aAAc,SAAQ,kBAA4D;CAAG;AAMlG;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;wBAsByC,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAmB1E;;;GAGG;AACH,eAAO,MAAM,UAAU,6BAAe,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Redacted from 'effect/Redacted';
|
|
4
|
+
export type CredentialQuery = {
|
|
5
|
+
service?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ServiceCredential = {
|
|
8
|
+
service: string;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const CredentialsService_base: Context.TagClass<CredentialsService, "@dxos/functions/CredentialsService", {
|
|
12
|
+
/**
|
|
13
|
+
* Query all.
|
|
14
|
+
*/
|
|
15
|
+
queryCredentials: (query: CredentialQuery) => Promise<ServiceCredential[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Get a single credential.
|
|
18
|
+
* @throws {Error} If no credential is found.
|
|
19
|
+
*/
|
|
20
|
+
getCredential: (query: CredentialQuery) => Promise<ServiceCredential>;
|
|
21
|
+
}>;
|
|
22
|
+
export declare class CredentialsService extends CredentialsService_base {
|
|
23
|
+
static getCredential: (query: CredentialQuery) => Effect.Effect<ServiceCredential, never, CredentialsService>;
|
|
24
|
+
static getApiKey: (query: CredentialQuery) => Effect.Effect<Redacted.Redacted<string>, never, CredentialsService>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=Credential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Credential.d.ts","sourceRoot":"","sources":["../../../src/Credential.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAGhB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;;IAKE;;OAEG;sBACe,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAE1E;;;OAGG;mBACY,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,iBAAiB,CAAC;;AAZzE,qBAAa,kBAAmB,SAAQ,uBAcrC;IACD,MAAM,CAAC,aAAa,UAAW,eAAe,KAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAIvG;IAEL,MAAM,CAAC,SAAS,UAAW,eAAe,KAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAO3G;CACN"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as HttpClient from '@effect/platform/HttpClient';
|
|
2
|
+
import * as Layer from 'effect/Layer';
|
|
3
|
+
import * as Credential from './Credential';
|
|
4
|
+
/**
|
|
5
|
+
* Wraps an `HttpClient` so outbound requests carry `X-BYOK: <apiKey>` whenever the active space
|
|
6
|
+
* has an `AccessToken` for `providerHost`. Lookup failures pass the request through unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export declare const byokLayer: (providerHost: string) => Layer.Layer<HttpClient.HttpClient, never, HttpClient.HttpClient | Credential.CredentialsService>;
|
|
9
|
+
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/Header.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAG1D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,SAAS,iBACN,MAAM,KACnB,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,kBAAkB,CAgB/F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.test.d.ts","sourceRoot":"","sources":["../../../src/Header.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Layer from 'effect/Layer';
|
|
3
|
+
import * as Types from 'effect/Types';
|
|
4
|
+
import { SpaceId, type URI } from '@dxos/keys';
|
|
5
|
+
import type * as Process from './Process';
|
|
6
|
+
export declare const TypeId: '~@dxos/functions/LayerSpec';
|
|
7
|
+
export type TypeId = typeof TypeId;
|
|
8
|
+
/**
|
|
9
|
+
* Opaque layer with introspectable tags.
|
|
10
|
+
*/
|
|
11
|
+
export interface LayerSpec {
|
|
12
|
+
readonly [TypeId]: TypeId;
|
|
13
|
+
readonly affinity: Affinity;
|
|
14
|
+
readonly requires: readonly Context.Tag<any, any>[];
|
|
15
|
+
readonly provides: readonly Context.Tag<any, any>[];
|
|
16
|
+
readonly make: (context: LayerContext) => Layer.Layer<unknown, never, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Affinity defines the lifetime and scope of a service.
|
|
20
|
+
*
|
|
21
|
+
* - `application` - single service instance is available throughout the entire application.
|
|
22
|
+
* - `space` - service is instantiated per space.
|
|
23
|
+
* - `process` - separate service instance is created and destroyed for each process.
|
|
24
|
+
*/
|
|
25
|
+
export type Affinity = 'application' | 'space' | 'process';
|
|
26
|
+
/**
|
|
27
|
+
* Provides context for service resolution.
|
|
28
|
+
*/
|
|
29
|
+
export interface LayerContext {
|
|
30
|
+
/**
|
|
31
|
+
* Under which space the process is running.
|
|
32
|
+
* Space affinity and up only.
|
|
33
|
+
*/
|
|
34
|
+
readonly space?: SpaceId;
|
|
35
|
+
/**
|
|
36
|
+
* URI of the conversation feed the process is running in.
|
|
37
|
+
* Process affinity only.
|
|
38
|
+
*/
|
|
39
|
+
readonly conversation?: URI.URI;
|
|
40
|
+
/**
|
|
41
|
+
* Under which process the process is running.
|
|
42
|
+
* Process affinity only.
|
|
43
|
+
*/
|
|
44
|
+
readonly process?: Process.ID;
|
|
45
|
+
}
|
|
46
|
+
interface MakeOpts {
|
|
47
|
+
readonly affinity: Affinity;
|
|
48
|
+
readonly requires: readonly Context.Tag<any, any>[];
|
|
49
|
+
readonly provides: readonly Context.Tag<any, any>[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Make a service.
|
|
53
|
+
*/
|
|
54
|
+
export declare const make: <const Opts extends Types.NoExcessProperties<MakeOpts, Opts>>(opts: Opts, make: (context: LayerContext) => Layer.Layer<Context.Tag.Identifier<Opts['provides'][number]>, never, Context.Tag.Identifier<Opts['requires'][number]>>) => LayerSpec;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=LayerSpec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayerSpec.d.ts","sourceRoot":"","sources":["../../../src/LayerSpec.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAC;AAI1C,eAAO,MAAM,MAAM,EAAG,4BAAqC,CAAC;AAC5D,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACpD,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAGpD,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;CAChF;AAED;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3D;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;CAC/B;AAED,UAAU,QAAQ;IAChB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACpD,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;CACrD;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,IAAI,SAAS,KAAK,CAAC,kBAAkB,CAAC,QAAQ,EAAE,IAAI,CAAC,QACxE,IAAI,QACJ,CACJ,OAAO,EAAE,YAAY,KAClB,KAAK,CAAC,KAAK,CACd,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,EAChD,KAAK,EACL,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CACjD,KACA,SAQF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
/**
|
|
3
|
+
* MCP server connection spec — the minimal fields needed to dial an MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Used as a value type embedded in blueprints and passed to runtime session connect logic.
|
|
6
|
+
* The user-facing ECHO object (`@dxos/assistant-toolkit` `McpServer`) composes this struct
|
|
7
|
+
* and adds instance-level fields (`name`, `enabled`) and ECHO annotations.
|
|
8
|
+
*/
|
|
9
|
+
export declare const McpServer: Schema.Struct<{
|
|
10
|
+
name: Schema.optional<typeof Schema.String>;
|
|
11
|
+
url: Schema.SchemaClass<string, string, never>;
|
|
12
|
+
/**
|
|
13
|
+
* Transport protocol. Prefer `'http'` (Streamable HTTP) for new servers; `'sse'` is
|
|
14
|
+
* kept for compatibility with servers that haven't migrated and is deprecated per
|
|
15
|
+
* the MCP SDK. Clients support both during the migration period.
|
|
16
|
+
*/
|
|
17
|
+
protocol: Schema.Union<[Schema.Literal<["http"]>, Schema.Literal<["sse"]>]>;
|
|
18
|
+
/**
|
|
19
|
+
* Optional API key sent with requests.
|
|
20
|
+
* Persisted in plaintext when stored on a space-replicated ECHO object — see the
|
|
21
|
+
* `@dxos/assistant-toolkit` `McpServer` type for security implications.
|
|
22
|
+
*/
|
|
23
|
+
apiKey: Schema.optional<typeof Schema.String>;
|
|
24
|
+
}>;
|
|
25
|
+
export type McpServer = Schema.Schema.Type<typeof McpServer>;
|
|
26
|
+
//# sourceMappingURL=McpServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpServer.d.ts","sourceRoot":"","sources":["../../../src/McpServer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;IASpB;;;;OAIG;;IAKH;;;;OAIG;;EAIH,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC"}
|