@dxos/compute 0.8.4-main.cb12b3f963 → 0.8.4-main.dfabb4ec29

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.
Files changed (74) hide show
  1. package/dist/lib/neutral/StorageService.mjs +1 -1
  2. package/dist/lib/neutral/{chunk-S24LL2D5.mjs → chunk-CXDV2FPU.mjs} +6 -5
  3. package/dist/lib/neutral/chunk-CXDV2FPU.mjs.map +7 -0
  4. package/dist/lib/neutral/{chunk-FEABF5XY.mjs → chunk-EG7VLX2F.mjs} +3 -3
  5. package/dist/lib/neutral/{chunk-N462A6NO.mjs → chunk-JTZYM2QW.mjs} +7 -1
  6. package/dist/lib/neutral/chunk-JTZYM2QW.mjs.map +7 -0
  7. package/dist/lib/neutral/{chunk-4N4JAXCP.mjs → chunk-OA7JMLJK.mjs} +3 -3
  8. package/dist/lib/neutral/{chunk-QPCDM7MF.mjs → chunk-VIRNEVFD.mjs} +22 -2
  9. package/dist/lib/neutral/chunk-VIRNEVFD.mjs.map +7 -0
  10. package/dist/lib/neutral/{chunk-DDEBBRCI.mjs → chunk-XEVFBI6S.mjs} +1 -1
  11. package/dist/lib/neutral/chunk-XEVFBI6S.mjs.map +7 -0
  12. package/dist/lib/neutral/{chunk-H6EHIVDN.mjs → chunk-YEDUHFRC.mjs} +3 -3
  13. package/dist/lib/neutral/fib-WSN4EY7R.mjs +10 -0
  14. package/dist/lib/neutral/index.mjs +186 -147
  15. package/dist/lib/neutral/index.mjs.map +4 -4
  16. package/dist/lib/neutral/meta.json +1 -1
  17. package/dist/lib/neutral/reply-XRLTFNDF.mjs +10 -0
  18. package/dist/lib/neutral/sleep-7O76LQCA.mjs +10 -0
  19. package/dist/lib/neutral/testing/index.mjs +7 -7
  20. package/dist/types/src/Blueprint.d.ts +8 -16
  21. package/dist/types/src/Blueprint.d.ts.map +1 -1
  22. package/dist/types/src/Credential.d.ts.map +1 -1
  23. package/dist/types/src/McpServer.d.ts +27 -0
  24. package/dist/types/src/McpServer.d.ts.map +1 -0
  25. package/dist/types/src/Operation.d.ts +6 -0
  26. package/dist/types/src/Operation.d.ts.map +1 -1
  27. package/dist/types/src/OperationHandlerSet.d.ts.map +1 -1
  28. package/dist/types/src/OperationRegistry.d.ts.map +1 -1
  29. package/dist/types/src/Routine.d.ts +6 -4
  30. package/dist/types/src/Routine.d.ts.map +1 -1
  31. package/dist/types/src/Script.d.ts.map +1 -1
  32. package/dist/types/src/StorageService.d.ts.map +1 -1
  33. package/dist/types/src/Template.d.ts +18 -12
  34. package/dist/types/src/Template.d.ts.map +1 -1
  35. package/dist/types/src/Template.test.d.ts +2 -0
  36. package/dist/types/src/Template.test.d.ts.map +1 -0
  37. package/dist/types/src/Trigger.d.ts.map +1 -1
  38. package/dist/types/src/TriggerEvent.d.ts.map +1 -1
  39. package/dist/types/src/errors.d.ts +69 -0
  40. package/dist/types/src/errors.d.ts.map +1 -1
  41. package/dist/types/src/index.d.ts +2 -1
  42. package/dist/types/src/index.d.ts.map +1 -1
  43. package/dist/types/src/testing/definitions.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +10 -10
  46. package/src/Blueprint.ts +5 -19
  47. package/src/Credential.ts +2 -0
  48. package/src/McpServer.ts +44 -0
  49. package/src/Operation.ts +23 -3
  50. package/src/OperationHandlerSet.ts +2 -0
  51. package/src/OperationRegistry.ts +2 -0
  52. package/src/Routine.ts +4 -0
  53. package/src/Script.ts +2 -0
  54. package/src/StorageService.ts +2 -0
  55. package/src/Template.test.ts +151 -0
  56. package/src/Template.ts +48 -31
  57. package/src/Trigger.ts +2 -0
  58. package/src/TriggerEvent.ts +2 -0
  59. package/src/errors.ts +21 -0
  60. package/src/index.ts +3 -1
  61. package/src/testing/definitions.ts +3 -3
  62. package/dist/lib/neutral/chunk-DDEBBRCI.mjs.map +0 -7
  63. package/dist/lib/neutral/chunk-N462A6NO.mjs.map +0 -7
  64. package/dist/lib/neutral/chunk-QPCDM7MF.mjs.map +0 -7
  65. package/dist/lib/neutral/chunk-S24LL2D5.mjs.map +0 -7
  66. package/dist/lib/neutral/fib-HDHBZHPE.mjs +0 -10
  67. package/dist/lib/neutral/reply-XSQMXAPX.mjs +0 -10
  68. package/dist/lib/neutral/sleep-WHTJQ56P.mjs +0 -10
  69. /package/dist/lib/neutral/{chunk-FEABF5XY.mjs.map → chunk-EG7VLX2F.mjs.map} +0 -0
  70. /package/dist/lib/neutral/{chunk-4N4JAXCP.mjs.map → chunk-OA7JMLJK.mjs.map} +0 -0
  71. /package/dist/lib/neutral/{chunk-H6EHIVDN.mjs.map → chunk-YEDUHFRC.mjs.map} +0 -0
  72. /package/dist/lib/neutral/{fib-HDHBZHPE.mjs.map → fib-WSN4EY7R.mjs.map} +0 -0
  73. /package/dist/lib/neutral/{reply-XSQMXAPX.mjs.map → reply-XRLTFNDF.mjs.map} +0 -0
  74. /package/dist/lib/neutral/{sleep-WHTJQ56P.mjs.map → sleep-7O76LQCA.mjs.map} +0 -0
@@ -1,9 +1,11 @@
1
1
  import {
2
2
  StorageService_exports
3
- } from "./chunk-DDEBBRCI.mjs";
3
+ } from "./chunk-XEVFBI6S.mjs";
4
4
  import {
5
5
  FunctionError,
6
6
  FunctionNotFoundError,
7
+ FunctionsAiMemoizationMissError,
8
+ FunctionsAiUpstreamError,
7
9
  InvalidOperationInputError,
8
10
  InvalidOperationOutputError,
9
11
  InvokerNotInitializedError,
@@ -14,13 +16,13 @@ import {
14
16
  TriggerStateNotFoundError,
15
17
  getHandler,
16
18
  getHandlerByKey
17
- } from "./chunk-N462A6NO.mjs";
19
+ } from "./chunk-JTZYM2QW.mjs";
18
20
  import {
19
21
  Operation_exports,
20
22
  PersistentOperation,
21
23
  deserialize,
22
24
  invoke
23
- } from "./chunk-QPCDM7MF.mjs";
25
+ } from "./chunk-VIRNEVFD.mjs";
24
26
  import {
25
27
  __export
26
28
  } from "./chunk-J5LGTIGS.mjs";
@@ -29,7 +31,6 @@ import {
29
31
  var Blueprint_exports = {};
30
32
  __export(Blueprint_exports, {
31
33
  Blueprint: () => Blueprint,
32
- McpServer: () => McpServer,
33
34
  NotFoundError: () => NotFoundError,
34
35
  Registry: () => Registry,
35
36
  RegistryService: () => RegistryService,
@@ -40,12 +41,43 @@ __export(Blueprint_exports, {
40
41
  });
41
42
  import * as Context2 from "effect/Context";
42
43
  import * as Effect3 from "effect/Effect";
43
- import * as Schema2 from "effect/Schema";
44
+ import * as Schema3 from "effect/Schema";
44
45
  import { ToolId } from "@dxos/ai";
45
46
  import { Annotation, Database as Database3, Filter, Obj, Type } from "@dxos/echo";
46
47
  import { BaseError } from "@dxos/errors";
47
48
  import { log as log2 } from "@dxos/log";
48
49
 
50
+ // src/McpServer.ts
51
+ var McpServer_exports = {};
52
+ __export(McpServer_exports, {
53
+ McpServer: () => McpServer
54
+ });
55
+ import * as Schema from "effect/Schema";
56
+ var McpServer = Schema.Struct({
57
+ name: Schema.String.pipe(Schema.optional).annotations({
58
+ description: "Human-readable name of the MCP server"
59
+ }),
60
+ url: Schema.String.annotations({
61
+ description: "URL of the MCP server"
62
+ }),
63
+ /**
64
+ * Transport protocol. Prefer `'http'` (Streamable HTTP) for new servers; `'sse'` is
65
+ * kept for compatibility with servers that haven't migrated and is deprecated per
66
+ * the MCP SDK. Clients support both during the migration period.
67
+ */
68
+ protocol: Schema.Union(Schema.Literal("http"), Schema.Literal("sse")).annotations({
69
+ description: 'Transport protocol of the MCP server (prefer "http"; "sse" deprecated)'
70
+ }),
71
+ /**
72
+ * Optional API key sent with requests.
73
+ * Persisted in plaintext when stored on a space-replicated ECHO object — see the
74
+ * `@dxos/assistant-toolkit` `McpServer` type for security implications.
75
+ */
76
+ apiKey: Schema.optional(Schema.String).annotations({
77
+ description: "Optional API key sent with requests"
78
+ })
79
+ });
80
+
49
81
  // src/Template.ts
50
82
  var Template_exports = {};
51
83
  __export(Template_exports, {
@@ -57,13 +89,12 @@ __export(Template_exports, {
57
89
  processTemplate: () => processTemplate
58
90
  });
59
91
  import * as Effect2 from "effect/Effect";
60
- import * as Record from "effect/Record";
61
- import * as Schema from "effect/Schema";
62
- import handlebars from "handlebars";
92
+ import * as Schema2 from "effect/Schema";
63
93
  import { Database as Database2, Ref } from "@dxos/echo";
64
94
  import { invariant } from "@dxos/invariant";
65
95
  import { log } from "@dxos/log";
66
96
  import { Text } from "@dxos/schema";
97
+ import Handlebars from "@dxos/vendor-kbn-handlebars";
67
98
 
68
99
  // src/OperationRegistry.ts
69
100
  var OperationRegistry_exports = {};
@@ -91,21 +122,25 @@ var layer = Layer.effect(Service, Effect.gen(function* () {
91
122
 
92
123
  // src/Template.ts
93
124
  var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/compute/src/Template.ts";
94
- var InputKind = Schema.Literal("value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema");
95
- var Input = Schema.Struct({
96
- name: Schema.String,
97
- kind: Schema.optional(InputKind),
98
- default: Schema.optional(Schema.Any),
125
+ var InputKind = Schema2.Literal("value", "operation");
126
+ var Input = Schema2.Struct({
127
+ name: Schema2.String,
128
+ kind: InputKind,
129
+ default: Schema2.optional(Schema2.Any),
99
130
  /**
100
- * Function to call if the kind is 'function'.
131
+ * Operation key invoked when `kind === 'operation'`. The referenced operation must accept void input —
132
+ * template inputs have no mechanism for passing arguments.
101
133
  */
102
- function: Schema.optional(Schema.String)
134
+ operation: Schema2.optional(Schema2.String)
103
135
  });
104
- var Template = Schema.Struct({
136
+ var Template = Schema2.Struct({
105
137
  source: Ref.Ref(Text.Text).annotations({
106
- description: "Handlebars template source"
138
+ description: "Markdown + Handlebars template."
107
139
  }),
108
- inputs: Schema.optional(Schema.Array(Input))
140
+ /**
141
+ * NOTE: We use an array rather than map so that updating variable names in the template doesn't disconnect existing inputs.
142
+ */
143
+ inputs: Schema2.optional(Schema2.Array(Input))
109
144
  });
110
145
  var make = ({ id, source, inputs = [] } = {}) => ({
111
146
  source: Ref.make(Text.make({
@@ -115,64 +150,65 @@ var make = ({ id, source, inputs = [] } = {}) => ({
115
150
  inputs
116
151
  });
117
152
  var process = (source, variables = {}) => {
118
- invariant(typeof source === "string", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 47, S: void 0, A: ["typeof source === 'string'", ""] });
153
+ invariant(typeof source === "string", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 50, S: void 0, A: ["typeof source === 'string'", ""] });
119
154
  let section = 0;
155
+ const handlebars = Handlebars.create();
120
156
  handlebars.registerHelper("section", () => String(++section));
121
- const template = handlebars.compile(source.trim());
157
+ const template = handlebars.compileAST(source.trim());
122
158
  const output = template(variables);
123
159
  return output.trim().replace(/(\n\s*){3,}/g, "\n\n");
124
160
  };
125
161
  var processTemplate = (template) => Effect2.gen(function* () {
126
- const variables = yield* Effect2.forEach(template.inputs ?? [], (input) => Effect2.gen(function* () {
127
- if (input.kind === "function") {
128
- const fn = yield* resolve(input.function).pipe(Effect2.flatten, Effect2.catchTag("NoSuchElementException", () => Effect2.fail(new FunctionNotFoundError(input.function))));
129
- const result = yield* invoke(fn, {}).pipe(Effect2.orDie);
130
- return [
131
- input.name,
132
- result
133
- ];
134
- } else {
135
- return yield* Effect2.dieMessage(`Unsupported input kind: ${input.kind}`);
162
+ const entries = yield* Effect2.forEach(template.inputs ?? [], (input) => Effect2.gen(function* () {
163
+ switch (input.kind) {
164
+ case "value": {
165
+ return [
166
+ input.name,
167
+ input.default
168
+ ];
169
+ }
170
+ case "operation": {
171
+ invariant(input.operation, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 70, S: this, A: ["input.operation", ""] });
172
+ const fn = yield* resolve(input.operation).pipe(Effect2.flatten, Effect2.catchTag("NoSuchElementException", () => Effect2.fail(new FunctionNotFoundError(input.operation))));
173
+ const result = yield* invoke(fn, void 0).pipe(Effect2.orDie);
174
+ return [
175
+ input.name,
176
+ result
177
+ ];
178
+ }
179
+ default: {
180
+ return yield* Effect2.dieMessage(`Unsupported input kind: ${input.kind}`);
181
+ }
136
182
  }
137
- })).pipe(Effect2.map(Record.fromEntries));
183
+ }));
184
+ const variables = Object.fromEntries(entries);
138
185
  log("processTemplate", {
139
186
  variables
140
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: this });
187
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 86, S: this });
141
188
  return process((yield* Database2.load(template.source)).content, variables);
142
189
  });
143
190
 
144
191
  // src/Blueprint.ts
145
192
  var __dxlog_file2 = "/__w/dxos/dxos/packages/core/compute/compute/src/Blueprint.ts";
146
- var McpServer = Schema2.Struct({
147
- /**
148
- * URL of the MCP server.
149
- */
150
- url: Schema2.String.annotations({
151
- description: "URL of the MCP server"
152
- }),
153
- protocol: Schema2.Union(Schema2.Literal("sse"), Schema2.Literal("http")).annotations({
154
- description: "Protocol of the MCP server"
155
- })
156
- });
157
- var Blueprint = Schema2.Struct({
193
+ var Blueprint = Schema3.Struct({
158
194
  /**
159
195
  * Global registry ID.
160
196
  * NOTE: The `key` property refers to the original registry entry.
161
197
  */
162
198
  // TODO(burdon): Create Format type for DXN-like ids, such as this and schema type.
163
- key: Schema2.String.annotations({
199
+ key: Schema3.String.annotations({
164
200
  description: "Unique registration key for the blueprint"
165
201
  }),
166
202
  /**
167
203
  * Human-readable name of the blueprint.
168
204
  */
169
- name: Schema2.String.annotations({
205
+ name: Schema3.String.annotations({
170
206
  description: "Human-readable name of the blueprint"
171
207
  }),
172
208
  /**
173
209
  * Description of the blueprint's purpose and functionality.
174
210
  */
175
- description: Schema2.optional(Schema2.String).annotations({
211
+ description: Schema3.optional(Schema3.String).annotations({
176
212
  description: "Description of the blueprint's purpose and functionality"
177
213
  }),
178
214
  /**
@@ -185,21 +221,20 @@ var Blueprint = Schema2.Struct({
185
221
  /**
186
222
  * Array of tools that the AI assistant can use when this blueprint is active.
187
223
  */
188
- tools: Schema2.Array(ToolId).annotations({
224
+ tools: Schema3.Array(ToolId).annotations({
189
225
  description: "Array of tools that the AI assistant can use when this blueprint is active"
190
226
  }),
191
227
  /**
192
228
  * Whether an agent is allowed to auto-enable this blueprint in a conversation.
193
229
  */
194
- agentCanEnable: Schema2.optional(Schema2.Boolean).annotations({
230
+ agentCanEnable: Schema3.optional(Schema3.Boolean).annotations({
195
231
  description: "Whether an agent is allowed to auto-enable this blueprint in a conversation."
196
232
  }),
197
233
  /**
198
234
  * Array of MCP servers that the AI assistant can use when this blueprint is active.
199
235
  */
200
- mcpServers: Schema2.optional(Schema2.Array(McpServer))
236
+ mcpServers: Schema3.optional(Schema3.Array(McpServer))
201
237
  }).pipe(Type.object({
202
- // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.
203
238
  typename: "org.dxos.type.blueprint",
204
239
  version: "0.1.0"
205
240
  }), Annotation.LabelAnnotation.set([
@@ -225,7 +260,7 @@ var Registry = class {
225
260
  if (seen.has(blueprint.key)) {
226
261
  log2.warn("duplicate blueprint", {
227
262
  key: blueprint.key
228
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 99, S: this });
263
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 89, S: this });
229
264
  } else {
230
265
  seen.add(blueprint.key);
231
266
  this._blueprints.push(blueprint);
@@ -326,7 +361,7 @@ __export(Process_exports, {
326
361
  });
327
362
  import * as Context5 from "effect/Context";
328
363
  import * as Effect6 from "effect/Effect";
329
- import * as Schema4 from "effect/Schema";
364
+ import * as Schema5 from "effect/Schema";
330
365
  import { assertArgument } from "@dxos/invariant";
331
366
  import { log as log4 } from "@dxos/log";
332
367
 
@@ -355,7 +390,7 @@ __export(Trace_exports, {
355
390
  import * as Context4 from "effect/Context";
356
391
  import * as Effect5 from "effect/Effect";
357
392
  import * as Layer2 from "effect/Layer";
358
- import * as Schema3 from "effect/Schema";
393
+ import * as Schema4 from "effect/Schema";
359
394
  import { Annotation as Annotation2, Obj as Obj2, Type as Type2 } from "@dxos/echo";
360
395
  import { log as log3 } from "@dxos/log";
361
396
  var __dxlog_file3 = "/__w/dxos/dxos/packages/core/compute/compute/src/Trace.ts";
@@ -378,35 +413,35 @@ var EventType = (key, opts) => {
378
413
  isEphemeral: opts.isEphemeral
379
414
  };
380
415
  };
381
- var Event = Schema3.Struct({
382
- timestamp: Schema3.Number,
383
- type: Schema3.String,
384
- data: Schema3.Unknown
416
+ var Event = Schema4.Struct({
417
+ timestamp: Schema4.Number,
418
+ type: Schema4.String,
419
+ data: Schema4.Unknown
385
420
  });
386
421
  var isOfType = (eventType, event) => {
387
422
  return event.type === eventType.key;
388
423
  };
389
- var Meta = Schema3.Struct({
390
- pid: Schema3.optional(Schema3.String),
391
- parentPid: Schema3.optional(Schema3.String),
392
- processName: Schema3.optional(Schema3.String),
424
+ var Meta = Schema4.Struct({
425
+ pid: Schema4.optional(Schema4.String),
426
+ parentPid: Schema4.optional(Schema4.String),
427
+ processName: Schema4.optional(Schema4.String),
393
428
  /**
394
429
  * ID of the conversation feed object if present.
395
430
  */
396
- conversationId: Schema3.optional(Obj2.ID),
431
+ conversationId: Schema4.optional(Obj2.ID),
397
432
  /**
398
433
  * ID of the trigger object if invocation resulted from a trigger.
399
434
  */
400
- triggerId: Schema3.optional(Obj2.ID),
435
+ triggerId: Schema4.optional(Obj2.ID),
401
436
  /**
402
437
  * ID of the tool call that created the current process.
403
438
  */
404
- toolCallId: Schema3.optional(Schema3.String)
439
+ toolCallId: Schema4.optional(Schema4.String)
405
440
  });
406
- var MessageData = Schema3.Struct({
441
+ var MessageData = Schema4.Struct({
407
442
  meta: Meta,
408
- isEphemeral: Schema3.Boolean,
409
- events: Schema3.Array(Event)
443
+ isEphemeral: Schema4.Boolean,
444
+ events: Schema4.Array(Event)
410
445
  });
411
446
  var Message = MessageData.pipe(Type2.object({
412
447
  typename: "org.dxos.type.traceMessage",
@@ -450,31 +485,31 @@ var testTraceService = (opts = {}) => Layer2.effect(TraceService, Effect5.gen(fu
450
485
  };
451
486
  }));
452
487
  var OperationStart = EventType("operation.start", {
453
- schema: Schema3.Struct({
488
+ schema: Schema4.Struct({
454
489
  /** Operation key. */
455
- key: Schema3.String,
490
+ key: Schema4.String,
456
491
  /** Human-readable operation name. */
457
- name: Schema3.optional(Schema3.String)
492
+ name: Schema4.optional(Schema4.String)
458
493
  }),
459
494
  isEphemeral: false
460
495
  });
461
496
  var OperationEnd = EventType("operation.end", {
462
- schema: Schema3.Struct({
497
+ schema: Schema4.Struct({
463
498
  /** Operation key. */
464
- key: Schema3.String,
499
+ key: Schema4.String,
465
500
  /** Human-readable operation name. */
466
- name: Schema3.optional(Schema3.String),
501
+ name: Schema4.optional(Schema4.String),
467
502
  /** Outcome of the operation. */
468
- outcome: Schema3.Literal("success", "failure"),
503
+ outcome: Schema4.Literal("success", "failure"),
469
504
  /** Error message if the operation failed. */
470
- error: Schema3.optional(Schema3.String)
505
+ error: Schema4.optional(Schema4.String)
471
506
  }),
472
507
  isEphemeral: false
473
508
  });
474
509
  var StatusUpdate = EventType("status.update", {
475
- schema: Schema3.Struct({
510
+ schema: Schema4.Struct({
476
511
  /** Human-readable status message. */
477
- message: Schema3.String
512
+ message: Schema4.String
478
513
  }),
479
514
  isEphemeral: true
480
515
  });
@@ -484,7 +519,7 @@ var emitStatus = (message) => write(StatusUpdate, {
484
519
 
485
520
  // src/Process.ts
486
521
  var __dxlog_file4 = "/__w/dxos/dxos/packages/core/compute/compute/src/Process.ts";
487
- var ID = Schema4.String.pipe(Schema4.brand("ProcessId"));
522
+ var ID = Schema5.String.pipe(Schema5.brand("ProcessId"));
488
523
  var ProcessTypeId = "~@dxos/functions/Process";
489
524
  var isProcess = (executable) => typeof executable === "object" && executable !== null && ProcessTypeId in executable;
490
525
  var make4 = (opts, create) => {
@@ -552,12 +587,12 @@ var State = /* @__PURE__ */ (function(State2) {
552
587
  var ProcessMonitorService = class extends Context5.Tag("@dxos/functions/ProcessMonitorService")() {
553
588
  };
554
589
  var SpawnedEvent = EventType("process.spawned", {
555
- schema: Schema4.Void,
590
+ schema: Schema5.Void,
556
591
  isEphemeral: false
557
592
  });
558
593
  var ExitedEvent = EventType("process.exited", {
559
- schema: Schema4.Struct({
560
- outcome: Schema4.Literal("succeeded", "failed", "terminated")
594
+ schema: Schema5.Struct({
595
+ outcome: Schema5.Literal("succeeded", "failed", "terminated")
561
596
  }),
562
597
  isEphemeral: false
563
598
  });
@@ -626,18 +661,18 @@ __export(Routine_exports, {
626
661
  Routine: () => Routine,
627
662
  make: () => make5
628
663
  });
629
- import * as Schema5 from "effect/Schema";
664
+ import * as Schema6 from "effect/Schema";
630
665
  import { Annotation as Annotation3, JsonSchema, Obj as Obj3, Ref as Ref2, Type as Type3 } from "@dxos/echo";
631
- var Routine = Schema5.Struct({
666
+ var Routine = Schema6.Struct({
632
667
  /**
633
668
  * Name of the routine.
634
669
  */
635
- name: Schema5.optional(Schema5.String),
670
+ name: Schema6.optional(Schema6.String),
636
671
  /**
637
672
  * Description of the routine's purpose and functionality.
638
673
  * Allows AI agents to execute routines automatically as tools.
639
674
  */
640
- description: Schema5.optional(Schema5.String),
675
+ description: Schema6.optional(Schema6.String),
641
676
  /**
642
677
  * Input schema of the routine.
643
678
  */
@@ -650,15 +685,16 @@ var Routine = Schema5.Struct({
650
685
  * Natural language instructions for the routine.
651
686
  * These should provide concrete course of action for the AI to follow.
652
687
  */
688
+ // TODO(burdon): Form editor.
653
689
  instructions: Template.pipe(Annotation3.FormInputAnnotation.set(false)),
654
690
  /**
655
691
  * Blueprints that the routine may utilize.
656
692
  */
657
- blueprints: Schema5.Array(Ref2.Ref(Blueprint)),
693
+ blueprints: Schema6.Array(Ref2.Ref(Blueprint)),
658
694
  /**
659
695
  * Additional context that the routine may utilize.
660
696
  */
661
- context: Schema5.Array(Schema5.Any).pipe(Annotation3.FormInputAnnotation.set(false))
697
+ context: Schema6.Array(Schema6.Any).pipe(Annotation3.FormInputAnnotation.set(false))
662
698
  }).pipe(Type3.object({
663
699
  typename: "org.dxos.type.routine",
664
700
  version: "0.1.0"
@@ -671,8 +707,8 @@ var Routine = Schema5.Struct({
671
707
  var make5 = (params) => Obj3.make(Routine, {
672
708
  name: params.name,
673
709
  description: params.description,
674
- input: JsonSchema.toJsonSchema(params.input ?? Schema5.Void),
675
- output: JsonSchema.toJsonSchema(params.output ?? Schema5.Void),
710
+ input: JsonSchema.toJsonSchema(params.input ?? Schema6.Void),
711
+ output: JsonSchema.toJsonSchema(params.output ?? Schema6.Void),
676
712
  instructions: make({
677
713
  source: params.instructions
678
714
  }),
@@ -686,16 +722,16 @@ __export(Script_exports, {
686
722
  Script: () => Script,
687
723
  make: () => make6
688
724
  });
689
- import * as Schema6 from "effect/Schema";
725
+ import * as Schema7 from "effect/Schema";
690
726
  import { Annotation as Annotation4, Obj as Obj4, Ref as Ref3, Type as Type4 } from "@dxos/echo";
691
727
  import { FormInputAnnotation } from "@dxos/echo/internal";
692
728
  import { Text as Text2 } from "@dxos/schema";
693
- var Script = Schema6.Struct({
694
- name: Schema6.String.pipe(Schema6.optional),
695
- description: Schema6.String.pipe(Schema6.optional),
729
+ var Script = Schema7.Struct({
730
+ name: Schema7.String.pipe(Schema7.optional),
731
+ description: Schema7.String.pipe(Schema7.optional),
696
732
  // TODO(burdon): Change to hash of deployed content.
697
733
  // Whether source has changed since last deploy.
698
- changed: Schema6.Boolean.pipe(FormInputAnnotation.set(false), Schema6.optional),
734
+ changed: Schema7.Boolean.pipe(FormInputAnnotation.set(false), Schema7.optional),
699
735
  source: Ref3.Ref(Text2.Text).pipe(FormInputAnnotation.set(false))
700
736
  }).pipe(Type4.object({
701
737
  typename: "org.dxos.type.script",
@@ -806,7 +842,7 @@ __export(Trigger_exports, {
806
842
  specTimer: () => specTimer,
807
843
  specWebhook: () => specWebhook
808
844
  });
809
- import * as Schema7 from "effect/Schema";
845
+ import * as Schema8 from "effect/Schema";
810
846
  import * as SchemaAST from "effect/SchemaAST";
811
847
  import { Annotation as Annotation5, Feed, Obj as Obj5, QueryAST, Ref as Ref4, Type as Type5 } from "@dxos/echo";
812
848
  import { OptionsAnnotationId, SystemTypeAnnotation } from "@dxos/echo/internal";
@@ -822,14 +858,14 @@ var Kinds = [
822
858
  var kindLiteralAnnotations = {
823
859
  title: "Kind"
824
860
  };
825
- var EmailSpec = Schema7.Struct({
826
- kind: Schema7.Literal("email").annotations(kindLiteralAnnotations)
861
+ var EmailSpec = Schema8.Struct({
862
+ kind: Schema8.Literal("email").annotations(kindLiteralAnnotations)
827
863
  });
828
864
  var specEmail = () => ({
829
865
  kind: "email"
830
866
  });
831
- var QueueSpec = Schema7.Struct({
832
- kind: Schema7.Literal("queue").annotations(kindLiteralAnnotations),
867
+ var QueueSpec = Schema8.Struct({
868
+ kind: Schema8.Literal("queue").annotations(kindLiteralAnnotations),
833
869
  // TODO(dmaretskyi): Rename to `feed` and change to a reference.
834
870
  queue: DXN.Schema
835
871
  });
@@ -838,21 +874,21 @@ var specQueue = (queueDxn) => ({
838
874
  queue: queueDxn
839
875
  });
840
876
  var specFeed = (feed) => specQueue(Feed.getQueueDxn(feed)?.toString() ?? failedInvariant(new Error("Could not extract DXN from feed")));
841
- var SubscriptionSpec = Schema7.Struct({
842
- kind: Schema7.Literal("subscription").annotations(kindLiteralAnnotations),
843
- query: Schema7.Struct({
844
- raw: Schema7.optional(Schema7.String.annotations({
877
+ var SubscriptionSpec = Schema8.Struct({
878
+ kind: Schema8.Literal("subscription").annotations(kindLiteralAnnotations),
879
+ query: Schema8.Struct({
880
+ raw: Schema8.optional(Schema8.String.annotations({
845
881
  title: "Query"
846
882
  })),
847
883
  ast: QueryAST.Query
848
884
  }),
849
- options: Schema7.optional(Schema7.Struct({
885
+ options: Schema8.optional(Schema8.Struct({
850
886
  // Watch changes to object (not just creation).
851
- deep: Schema7.optional(Schema7.Boolean.annotations({
887
+ deep: Schema8.optional(Schema8.Boolean.annotations({
852
888
  title: "Nested"
853
889
  })),
854
890
  // Debounce changes (delay in ms).
855
- delay: Schema7.optional(Schema7.Number.annotations({
891
+ delay: Schema8.optional(Schema8.Number.annotations({
856
892
  title: "Delay"
857
893
  }))
858
894
  }).annotations({
@@ -869,9 +905,9 @@ var specSubscription = (query, options) => ({
869
905
  delay: options.delay
870
906
  } : void 0
871
907
  });
872
- var TimerSpec = Schema7.Struct({
873
- kind: Schema7.Literal("timer").annotations(kindLiteralAnnotations),
874
- cron: Schema7.String.annotations({
908
+ var TimerSpec = Schema8.Struct({
909
+ kind: Schema8.Literal("timer").annotations(kindLiteralAnnotations),
910
+ cron: Schema8.String.annotations({
875
911
  title: "Cron",
876
912
  [SchemaAST.ExamplesAnnotationId]: [
877
913
  "0 0 * * *"
@@ -882,16 +918,16 @@ var specTimer = (cron) => ({
882
918
  kind: "timer",
883
919
  cron
884
920
  });
885
- var WebhookSpec = Schema7.Struct({
886
- kind: Schema7.Literal("webhook").annotations(kindLiteralAnnotations),
887
- method: Schema7.optional(Schema7.String.annotations({
921
+ var WebhookSpec = Schema8.Struct({
922
+ kind: Schema8.Literal("webhook").annotations(kindLiteralAnnotations),
923
+ method: Schema8.optional(Schema8.String.annotations({
888
924
  title: "Method",
889
925
  [OptionsAnnotationId]: [
890
926
  "GET",
891
927
  "POST"
892
928
  ]
893
929
  })),
894
- port: Schema7.optional(Schema7.Number.annotations({
930
+ port: Schema8.optional(Schema8.Number.annotations({
895
931
  title: "Port"
896
932
  }))
897
933
  });
@@ -900,15 +936,15 @@ var specWebhook = (opts) => ({
900
936
  method: opts?.method,
901
937
  port: opts?.port
902
938
  });
903
- var Spec = Schema7.Union(EmailSpec, QueueSpec, SubscriptionSpec, TimerSpec, WebhookSpec).annotations({
939
+ var Spec = Schema8.Union(EmailSpec, QueueSpec, SubscriptionSpec, TimerSpec, WebhookSpec).annotations({
904
940
  title: "Trigger"
905
941
  });
906
- var TriggerSchema = Schema7.Struct({
942
+ var TriggerSchema = Schema8.Struct({
907
943
  /**
908
944
  * Function or workflow to invoke.
909
945
  */
910
946
  // TODO(dmaretskyi): Can be a Ref(FunctionType) or Ref(ComputeGraphType).
911
- function: Schema7.optional(Ref4.Ref(Obj5.Unknown).annotations({
947
+ function: Schema8.optional(Ref4.Ref(Obj5.Unknown).annotations({
912
948
  title: "Function"
913
949
  })),
914
950
  /**
@@ -916,16 +952,16 @@ var TriggerSchema = Schema7.Struct({
916
952
  * Specifies the input node in the circuit.
917
953
  * @deprecated Remove and enforce a single input node in all compute graphSchema.
918
954
  */
919
- inputNodeId: Schema7.optional(Schema7.String.annotations({
955
+ inputNodeId: Schema8.optional(Schema8.String.annotations({
920
956
  title: "Input Node ID"
921
957
  })),
922
958
  // TODO(burdon): NO BOOLEAN PROPERTIES (enabld/disabled/paused, etc.)
923
959
  // Need lint rule; or agent rule to require PR review for "boolean" key word.
924
- enabled: Schema7.optional(Schema7.Boolean.annotations({
960
+ enabled: Schema8.optional(Schema8.Boolean.annotations({
925
961
  title: "Enabled"
926
962
  })),
927
- spec: Schema7.optional(Spec),
928
- concurrency: Schema7.optional(Schema7.Number.annotations({
963
+ spec: Schema8.optional(Spec),
964
+ concurrency: Schema8.optional(Schema8.Number.annotations({
929
965
  title: "Concurrency",
930
966
  default: 1,
931
967
  description: "Maximum number of concurrent invocations of the trigger. For Feed triggers, this will process Feed items in parallel."
@@ -941,9 +977,9 @@ var TriggerSchema = Schema7.Struct({
941
977
  * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
942
978
  * }
943
979
  */
944
- input: Schema7.optional(Schema7.Record({
945
- key: Schema7.String,
946
- value: Schema7.Any
980
+ input: Schema8.optional(Schema8.Record({
981
+ key: Schema8.String,
982
+ value: Schema8.Any
947
983
  }))
948
984
  }).pipe(Type5.object({
949
985
  typename: "org.dxos.type.trigger",
@@ -965,26 +1001,26 @@ __export(TriggerEvent_exports, {
965
1001
  TriggerEvent: () => TriggerEvent,
966
1002
  WebhookEvent: () => WebhookEvent
967
1003
  });
968
- import * as Schema8 from "effect/Schema";
1004
+ import * as Schema9 from "effect/Schema";
969
1005
  import { DXN as DXN2, Obj as Obj6, Ref as Ref5 } from "@dxos/echo";
970
- var EmailEvent = Schema8.Struct({
971
- from: Schema8.String,
972
- to: Schema8.String,
973
- subject: Schema8.String,
974
- created: Schema8.String,
975
- body: Schema8.String
1006
+ var EmailEvent = Schema9.Struct({
1007
+ from: Schema9.String,
1008
+ to: Schema9.String,
1009
+ subject: Schema9.String,
1010
+ created: Schema9.String,
1011
+ body: Schema9.String
976
1012
  });
977
- var QueueEvent = Schema8.Struct({
1013
+ var QueueEvent = Schema9.Struct({
978
1014
  queue: DXN2.Schema,
979
- item: Schema8.Any,
980
- cursor: Schema8.String
1015
+ item: Schema9.Any,
1016
+ cursor: Schema9.String
981
1017
  });
982
- var SubscriptionEvent = Schema8.Struct({
1018
+ var SubscriptionEvent = Schema9.Struct({
983
1019
  /**
984
1020
  * Type of the mutation.
985
1021
  */
986
1022
  // TODO(dmaretskyi): Specify enum.
987
- type: Schema8.String,
1023
+ type: Schema9.String,
988
1024
  /**
989
1025
  * Reference to the object that was changed or created.
990
1026
  */
@@ -992,29 +1028,32 @@ var SubscriptionEvent = Schema8.Struct({
992
1028
  /**
993
1029
  * @deprecated
994
1030
  */
995
- changedObjectId: Schema8.optional(Schema8.String)
1031
+ changedObjectId: Schema9.optional(Schema9.String)
996
1032
  });
997
- var TimerEvent = Schema8.Struct({
998
- tick: Schema8.Number
1033
+ var TimerEvent = Schema9.Struct({
1034
+ tick: Schema9.Number
999
1035
  });
1000
- var WebhookEvent = Schema8.Struct({
1001
- url: Schema8.String,
1002
- method: Schema8.Literal("GET", "POST"),
1003
- headers: Schema8.Record({
1004
- key: Schema8.String,
1005
- value: Schema8.String
1036
+ var WebhookEvent = Schema9.Struct({
1037
+ url: Schema9.String,
1038
+ method: Schema9.Literal("GET", "POST"),
1039
+ headers: Schema9.Record({
1040
+ key: Schema9.String,
1041
+ value: Schema9.String
1006
1042
  }),
1007
- bodyText: Schema8.String
1043
+ bodyText: Schema9.String
1008
1044
  });
1009
- var TriggerEvent = Schema8.Union(EmailEvent, QueueEvent, SubscriptionEvent, TimerEvent, WebhookEvent);
1045
+ var TriggerEvent = Schema9.Union(EmailEvent, QueueEvent, SubscriptionEvent, TimerEvent, WebhookEvent);
1010
1046
  export {
1011
1047
  Blueprint_exports as Blueprint,
1012
1048
  Credential_exports as Credential,
1013
1049
  FunctionError,
1014
1050
  FunctionNotFoundError,
1051
+ FunctionsAiMemoizationMissError,
1052
+ FunctionsAiUpstreamError,
1015
1053
  InvalidOperationInputError,
1016
1054
  InvalidOperationOutputError,
1017
1055
  InvokerNotInitializedError,
1056
+ McpServer_exports as McpServer,
1018
1057
  NoHandlerError,
1019
1058
  Operation_exports as Operation,
1020
1059
  OperationHandlerSet_exports as OperationHandlerSet,