@dxos/compute 0.10.0 → 0.11.0

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 (131) hide show
  1. package/dist/lib/AgentService.mjs +16 -0
  2. package/dist/lib/AgentService.mjs.map +1 -0
  3. package/dist/lib/StorageService.mjs +59 -0
  4. package/dist/lib/StorageService.mjs.map +1 -0
  5. package/dist/lib/chunk-OperationHandlerSet.mjs +660 -0
  6. package/dist/lib/chunk-OperationHandlerSet.mjs.map +1 -0
  7. package/dist/lib/chunk-definitions.mjs +41 -0
  8. package/dist/lib/chunk-definitions.mjs.map +1 -0
  9. package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
  10. package/dist/lib/index.mjs +1576 -0
  11. package/dist/lib/index.mjs.map +1 -0
  12. package/dist/lib/testing.mjs +43 -0
  13. package/dist/lib/testing.mjs.map +1 -0
  14. package/dist/types/src/AgentIdentity.d.ts +27 -0
  15. package/dist/types/src/AgentIdentity.d.ts.map +1 -0
  16. package/dist/types/src/AgentService.d.ts +10 -2
  17. package/dist/types/src/AgentService.d.ts.map +1 -1
  18. package/dist/types/src/Cancellation.d.ts +19 -0
  19. package/dist/types/src/Cancellation.d.ts.map +1 -0
  20. package/dist/types/src/Credential.d.ts +41 -0
  21. package/dist/types/src/Credential.d.ts.map +1 -1
  22. package/dist/types/src/Operation.d.ts +79 -1
  23. package/dist/types/src/Operation.d.ts.map +1 -1
  24. package/dist/types/src/Process.d.ts +15 -3
  25. package/dist/types/src/Process.d.ts.map +1 -1
  26. package/dist/types/src/Trace.d.ts +55 -3
  27. package/dist/types/src/Trace.d.ts.map +1 -1
  28. package/dist/types/src/Trace.test.d.ts +2 -0
  29. package/dist/types/src/Trace.test.d.ts.map +1 -0
  30. package/dist/types/src/errors.d.ts +35 -1
  31. package/dist/types/src/errors.d.ts.map +1 -1
  32. package/dist/types/src/index.d.ts +3 -6
  33. package/dist/types/src/index.d.ts.map +1 -1
  34. package/dist/types/src/testing/index.d.ts +1 -0
  35. package/dist/types/src/testing/index.d.ts.map +1 -1
  36. package/dist/types/src/testing/operation.d.ts +5 -0
  37. package/dist/types/src/testing/operation.d.ts.map +1 -0
  38. package/dist/types/src/{Instructions.d.ts → types/Instructions.d.ts} +14 -1
  39. package/dist/types/src/types/Instructions.d.ts.map +1 -0
  40. package/dist/types/src/types/Instructions.test.d.ts +2 -0
  41. package/dist/types/src/types/Instructions.test.d.ts.map +1 -0
  42. package/dist/types/src/types/Project.d.ts +53 -0
  43. package/dist/types/src/types/Project.d.ts.map +1 -0
  44. package/dist/types/src/types/Project.test.d.ts +2 -0
  45. package/dist/types/src/types/Project.test.d.ts.map +1 -0
  46. package/dist/types/src/types/Routine.d.ts +42 -0
  47. package/dist/types/src/types/Routine.d.ts.map +1 -0
  48. package/dist/types/src/types/Routine.test.d.ts +2 -0
  49. package/dist/types/src/types/Routine.test.d.ts.map +1 -0
  50. package/dist/types/src/types/Script.d.ts.map +1 -0
  51. package/dist/types/src/{Skill.d.ts → types/Skill.d.ts} +1 -1
  52. package/dist/types/src/types/Skill.d.ts.map +1 -0
  53. package/dist/types/src/{Template.d.ts → types/Template.d.ts} +2 -2
  54. package/dist/types/src/types/Template.d.ts.map +1 -0
  55. package/dist/types/src/types/Template.test.d.ts.map +1 -0
  56. package/dist/types/src/types/Trigger.d.ts +249 -0
  57. package/dist/types/src/types/Trigger.d.ts.map +1 -0
  58. package/dist/types/src/{TriggerEvent.d.ts → types/TriggerEvent.d.ts} +19 -6
  59. package/dist/types/src/types/TriggerEvent.d.ts.map +1 -0
  60. package/dist/types/src/types/index.d.ts +9 -0
  61. package/dist/types/src/types/index.d.ts.map +1 -0
  62. package/dist/types/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +18 -17
  64. package/src/AgentIdentity.ts +35 -0
  65. package/src/AgentService.ts +10 -2
  66. package/src/Cancellation.ts +33 -0
  67. package/src/Credential.ts +52 -0
  68. package/src/Operation.ts +92 -2
  69. package/src/Process.ts +21 -4
  70. package/src/Trace.test.ts +155 -0
  71. package/src/Trace.ts +207 -6
  72. package/src/errors.ts +9 -5
  73. package/src/index.ts +3 -6
  74. package/src/testing/index.ts +1 -0
  75. package/src/testing/operation.ts +21 -0
  76. package/src/types/Instructions.test.ts +18 -0
  77. package/src/{Instructions.ts → types/Instructions.ts} +22 -1
  78. package/src/types/Project.test.ts +52 -0
  79. package/src/types/Project.ts +99 -0
  80. package/src/types/Routine.test.ts +18 -0
  81. package/src/types/Routine.ts +85 -0
  82. package/src/{Skill.ts → types/Skill.ts} +2 -2
  83. package/src/{Template.test.ts → types/Template.test.ts} +2 -2
  84. package/src/{Template.ts → types/Template.ts} +2 -2
  85. package/src/{Trigger.ts → types/Trigger.ts} +126 -8
  86. package/src/{TriggerEvent.ts → types/TriggerEvent.ts} +23 -5
  87. package/src/types/index.ts +12 -0
  88. package/dist/lib/neutral/AgentService.mjs +0 -12
  89. package/dist/lib/neutral/AgentService.mjs.map +0 -7
  90. package/dist/lib/neutral/StorageService.mjs +0 -22
  91. package/dist/lib/neutral/StorageService.mjs.map +0 -7
  92. package/dist/lib/neutral/chunk-2ZN64ZS7.mjs +0 -25
  93. package/dist/lib/neutral/chunk-2ZN64ZS7.mjs.map +0 -7
  94. package/dist/lib/neutral/chunk-5VAXF6AH.mjs +0 -53
  95. package/dist/lib/neutral/chunk-5VAXF6AH.mjs.map +0 -7
  96. package/dist/lib/neutral/chunk-EVROJER7.mjs +0 -285
  97. package/dist/lib/neutral/chunk-EVROJER7.mjs.map +0 -7
  98. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  99. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  100. package/dist/lib/neutral/chunk-PF7XP7XP.mjs +0 -62
  101. package/dist/lib/neutral/chunk-PF7XP7XP.mjs.map +0 -7
  102. package/dist/lib/neutral/chunk-SJ37RWHU.mjs +0 -21
  103. package/dist/lib/neutral/chunk-SJ37RWHU.mjs.map +0 -7
  104. package/dist/lib/neutral/chunk-VSAZPWSJ.mjs +0 -25
  105. package/dist/lib/neutral/chunk-VSAZPWSJ.mjs.map +0 -7
  106. package/dist/lib/neutral/chunk-WEO4FCQY.mjs +0 -17
  107. package/dist/lib/neutral/chunk-WEO4FCQY.mjs.map +0 -7
  108. package/dist/lib/neutral/chunk-Z3Y7FQGN.mjs +0 -174
  109. package/dist/lib/neutral/chunk-Z3Y7FQGN.mjs.map +0 -7
  110. package/dist/lib/neutral/fib-5XIYECL5.mjs +0 -10
  111. package/dist/lib/neutral/fib-5XIYECL5.mjs.map +0 -7
  112. package/dist/lib/neutral/index.mjs +0 -1232
  113. package/dist/lib/neutral/index.mjs.map +0 -7
  114. package/dist/lib/neutral/meta.json +0 -1
  115. package/dist/lib/neutral/reply-GCBRCUVM.mjs +0 -10
  116. package/dist/lib/neutral/reply-GCBRCUVM.mjs.map +0 -7
  117. package/dist/lib/neutral/sleep-XR6CL6W3.mjs +0 -10
  118. package/dist/lib/neutral/sleep-XR6CL6W3.mjs.map +0 -7
  119. package/dist/lib/neutral/testing/index.mjs +0 -32
  120. package/dist/lib/neutral/testing/index.mjs.map +0 -7
  121. package/dist/types/src/Instructions.d.ts.map +0 -1
  122. package/dist/types/src/Script.d.ts.map +0 -1
  123. package/dist/types/src/Skill.d.ts.map +0 -1
  124. package/dist/types/src/Template.d.ts.map +0 -1
  125. package/dist/types/src/Template.test.d.ts.map +0 -1
  126. package/dist/types/src/Trigger.d.ts +0 -157
  127. package/dist/types/src/Trigger.d.ts.map +0 -1
  128. package/dist/types/src/TriggerEvent.d.ts.map +0 -1
  129. /package/dist/types/src/{Script.d.ts → types/Script.d.ts} +0 -0
  130. /package/dist/types/src/{Template.test.d.ts → types/Template.test.d.ts} +0 -0
  131. /package/src/{Script.ts → types/Script.ts} +0 -0
@@ -15,8 +15,8 @@ import { BaseError } from '@dxos/errors';
15
15
  // eslint-disable-next-line unused-imports/no-unused-imports
16
16
  import { type Text } from '@dxos/schema';
17
17
 
18
- import * as McpServer from './McpServer';
19
- import * as Operation from './Operation';
18
+ import * as McpServer from '../McpServer';
19
+ import * as Operation from '../Operation';
20
20
  import * as Template from './Template';
21
21
  import * as Trigger from './Trigger';
22
22
 
@@ -9,8 +9,8 @@ import { describe, expect, test } from 'vitest';
9
9
  import { registryLayer } from '@dxos/echo-client';
10
10
  import { DXN } from '@dxos/keys';
11
11
 
12
- import { FunctionNotFoundError } from './errors';
13
- import * as Operation from './Operation';
12
+ import { FunctionNotFoundError } from '../errors';
13
+ import * as Operation from '../Operation';
14
14
  import * as Template from './Template';
15
15
 
16
16
  describe('Template', () => {
@@ -14,8 +14,8 @@ import { log } from '@dxos/log';
14
14
  import { Text } from '@dxos/schema';
15
15
  import Handlebars from '@dxos/vendor-kbn-handlebars';
16
16
 
17
- import { FunctionNotFoundError } from './errors';
18
- import * as Operation from './Operation';
17
+ import { FunctionNotFoundError } from '../errors';
18
+ import * as Operation from '../Operation';
19
19
 
20
20
  /**
21
21
  * Template input kind determines how template variables are resolved.
@@ -4,6 +4,10 @@
4
4
 
5
5
  // @import-as-namespace
6
6
 
7
+ import type { Atom } from '@effect-atom/atom';
8
+ import * as Context from 'effect/Context';
9
+ import type * as Effect from 'effect/Effect';
10
+ import * as Exit from 'effect/Exit';
7
11
  import * as Schema from 'effect/Schema';
8
12
  import * as SchemaAST from 'effect/SchemaAST';
9
13
 
@@ -11,14 +15,15 @@ import { Annotation, DXN, Feed, Obj, type Query, QueryAST, Ref, Type } from '@dx
11
15
  import { HiddenAnnotation } from '@dxos/echo/Annotation';
12
16
  import { OptionsAnnotationId } from '@dxos/echo/Format';
13
17
 
14
- import * as Runnable from './Runnable';
18
+ import * as Runnable from '../Runnable';
19
+ import type * as TriggerEvent from './TriggerEvent';
15
20
 
16
21
  /**
17
22
  * Type discriminator for TriggerType.
18
23
  * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.
19
24
  * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions
20
25
  */
21
- export const Kinds = ['email', 'feed', 'subscription', 'timer', 'webhook'] as const;
26
+ export const Kinds = ['email', 'feed', 'direct', 'subscription', 'timer', 'webhook'] as const;
22
27
  export type Kind = (typeof Kinds)[number];
23
28
 
24
29
  const kindLiteralAnnotations = { title: 'Kind' };
@@ -90,6 +95,19 @@ export const specSubscription = (
90
95
  : undefined,
91
96
  });
92
97
 
98
+ /**
99
+ * Direct invocation only; never scheduled by the dispatcher (invoked on demand by a caller).
100
+ */
101
+ export const DirectSpec = Schema.Struct({
102
+ kind: Schema.Literal('direct').annotations(kindLiteralAnnotations),
103
+ });
104
+ export type DirectSpec = Schema.Schema.Type<typeof DirectSpec>;
105
+
106
+ /**
107
+ * Construct a Direct trigger spec.
108
+ */
109
+ export const specDirect = (): DirectSpec => ({ kind: 'direct' });
110
+
93
111
  /**
94
112
  * Cron timer.
95
113
  */
@@ -138,9 +156,11 @@ export const specWebhook = (opts?: { method?: string; port?: number }): WebhookS
138
156
  /**
139
157
  * Trigger schema.
140
158
  */
141
- export const Spec = Schema.Union(EmailSpec, FeedSpec, SubscriptionSpec, TimerSpec, WebhookSpec).annotations({
142
- title: 'Trigger',
143
- });
159
+ export const Spec = Schema.Union(EmailSpec, FeedSpec, DirectSpec, SubscriptionSpec, TimerSpec, WebhookSpec).annotations(
160
+ {
161
+ title: 'Trigger',
162
+ },
163
+ );
144
164
  export type Spec = Schema.Schema.Type<typeof Spec>;
145
165
 
146
166
  /**
@@ -165,10 +185,23 @@ export class Trigger extends Type.makeObject<Trigger>(DXN.make('org.dxos.type.tr
165
185
  Schema.Struct({
166
186
  /**
167
187
  * Runnable (operation or workflow) to invoke.
188
+ * Wired programmatically (see plugin-routine's `wireTriggers`); not user-editable, so hidden from forms.
168
189
  */
169
- runnable: Schema.optional(Ref.Ref(Runnable.Runnable).annotations({ title: 'Runnable' })),
170
- spec: Schema.optional(Spec),
171
- enabled: Schema.optional(Schema.Boolean),
190
+ runnable: Ref.Ref(Runnable.Runnable).pipe(
191
+ Schema.annotations({ title: 'Runnable' }),
192
+ Annotation.FormInputAnnotation.set(false),
193
+ Schema.optional,
194
+ ),
195
+
196
+ spec: Spec.pipe(Schema.optional),
197
+
198
+ enabled: Schema.Boolean.pipe(Schema.optional),
199
+
200
+ /**
201
+ * Runs this trigger on the edge rather than locally.
202
+ * When unset, the trigger runs locally on the client.
203
+ */
204
+ remote: Schema.Boolean.pipe(Schema.annotations({ title: 'Remote' }), Schema.optional),
172
205
 
173
206
  concurrency: Schema.Number.pipe(
174
207
  Schema.annotations({
@@ -199,3 +232,88 @@ export class Trigger extends Type.makeObject<Trigger>(DXN.make('org.dxos.type.tr
199
232
  ) {}
200
233
 
201
234
  export const make = (props: Obj.MakeProps<typeof Trigger>) => Obj.make(Trigger, props);
235
+
236
+ /**
237
+ * Checks if a trigger having this spec can be manually invoked (a `direct` or `timer` trigger).
238
+ */
239
+ export const isManuallyInvokable = (spec?: Spec): boolean => spec?.kind === 'direct' || spec?.kind === 'timer';
240
+
241
+ /**
242
+ * Runtime state of a trigger.
243
+ */
244
+ export interface State {
245
+ /**
246
+ * Reference to the trigger object.
247
+ */
248
+ readonly trigger: Ref.Ref<Trigger>;
249
+
250
+ /**
251
+ * Where is this trigger running.
252
+ */
253
+ readonly environment: 'edge' | 'local';
254
+
255
+ /**
256
+ * Next scheduled cron execution. Set only for `timer` triggers.
257
+ */
258
+ readonly nextExecution?: Date;
259
+
260
+ /**
261
+ * Time until which scheduled invocations of this trigger are skipped after a genuine failure.
262
+ * Applies to all trigger kinds. Manual {@link TriggerDispatcher.invokeTrigger} calls bypass it.
263
+ */
264
+ readonly cooldownUntil?: Date;
265
+
266
+ /**
267
+ * Pending re-invocation requested via {@link Operation.runAgain} ({@link RunAgainError}).
268
+ * Retries are drained at the tail of the invocation queue, ordered by `enqueuedAt`.
269
+ */
270
+ readonly retry?: {
271
+ /**
272
+ * Event to replay on the retry. Re-running is assumed safe with the same input.
273
+ */
274
+ readonly event: TriggerEvent.TriggerEvent;
275
+
276
+ /**
277
+ * Monotonic sequence number used to order pending retries FIFO at the tail of the queue.
278
+ */
279
+ readonly enqueuedAt: number;
280
+ };
281
+
282
+ /**
283
+ * Result of the most recent invocation of this trigger.
284
+ */
285
+ readonly lastResult: Exit.Exit<unknown> | null;
286
+ }
287
+
288
+ export interface InvokeOptions {
289
+ trigger: Trigger;
290
+ event: TriggerEvent.TriggerEvent;
291
+ }
292
+
293
+ /**
294
+ * Service for monitoring trigger dispatcher state.
295
+ */
296
+ export interface Monitor {
297
+ /**
298
+ * Triggers actively registered in the dispatcher.
299
+ * Could contain entries for both local and edge triggers, but only the edge ones are actually running.
300
+ */
301
+ readonly triggers: Atom.Atom<readonly State[]>;
302
+
303
+ readonly localDispatcherEnabled: boolean;
304
+
305
+ /**
306
+ * Invoke a trigger.
307
+ * Available only for direct and timer triggers.
308
+ * Invocation respects the trigger's concurrency limit.
309
+ */
310
+ readonly invokeTrigger: (options: InvokeOptions) => Effect.Effect<void>;
311
+ }
312
+
313
+ /**
314
+ * Service for monitoring trigger executions.
315
+ */
316
+ export class TriggerMonitorService extends Context.Tag('@dxos/functions/TriggerMonitorService')<
317
+ TriggerMonitorService,
318
+ Monitor
319
+ >() {}
@@ -30,20 +30,26 @@ export const FeedEvent = Schema.Struct({
30
30
  });
31
31
  export type FeedEvent = Schema.Schema.Type<typeof FeedEvent>;
32
32
 
33
+ /**
34
+ * Kind of mutation a subscription trigger observed for its subject.
35
+ */
36
+ export const SubscriptionMutationType = Schema.Literal('created', 'updated', 'deleted');
37
+ export type SubscriptionMutationType = Schema.Schema.Type<typeof SubscriptionMutationType>;
38
+
33
39
  export const SubscriptionEvent = Schema.Struct({
34
40
  /**
35
41
  * Type of the mutation.
36
42
  */
37
- // TODO(dmaretskyi): Specify enum.
38
- type: Schema.String,
43
+ type: SubscriptionMutationType,
39
44
 
40
45
  /**
41
- * Reference to the object that was changed or created.
46
+ * Reference to the object that was changed or created. For `deleted`, carries the object's URI;
47
+ * dereferencing may yield `undefined` since the object is gone.
42
48
  */
43
49
  subject: Ref.Ref(Obj.Unknown),
44
50
 
45
51
  /**
46
- * @deprecated
52
+ * @deprecated Use `subject`.
47
53
  */
48
54
  changedObjectId: Schema.optional(Schema.String),
49
55
  });
@@ -52,6 +58,11 @@ export type SubscriptionEvent = Schema.Schema.Type<typeof SubscriptionEvent>;
52
58
  export const TimerEvent = Schema.Struct({ tick: Schema.Number });
53
59
  export type TimerEvent = Schema.Schema.Type<typeof TimerEvent>;
54
60
 
61
+ export const DirectEvent = Schema.Struct({
62
+ data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
63
+ });
64
+ export type DirectEvent = Schema.Schema.Type<typeof DirectEvent>;
65
+
55
66
  export const WebhookEvent = Schema.Struct({
56
67
  url: Schema.String,
57
68
  method: Schema.Literal('GET', 'POST'),
@@ -60,5 +71,12 @@ export const WebhookEvent = Schema.Struct({
60
71
  });
61
72
  export type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
62
73
 
63
- export const TriggerEvent = Schema.Union(EmailEvent, FeedEvent, SubscriptionEvent, TimerEvent, WebhookEvent);
74
+ export const TriggerEvent = Schema.Union(
75
+ EmailEvent,
76
+ FeedEvent,
77
+ DirectEvent,
78
+ SubscriptionEvent,
79
+ TimerEvent,
80
+ WebhookEvent,
81
+ );
64
82
  export type TriggerEvent = Schema.Schema.Type<typeof TriggerEvent>;
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ export * as Instructions from './Instructions';
6
+ export * as Project from './Project';
7
+ export * as Routine from './Routine';
8
+ export * as Script from './Script';
9
+ export * as Skill from './Skill';
10
+ export * as Template from './Template';
11
+ export * as Trigger from './Trigger';
12
+ export * as TriggerEvent from './TriggerEvent';
@@ -1,12 +0,0 @@
1
- import {
2
- AgentService,
3
- getSession,
4
- hydrate
5
- } from "./chunk-VSAZPWSJ.mjs";
6
- import "./chunk-J5LGTIGS.mjs";
7
- export {
8
- AgentService,
9
- getSession,
10
- hydrate
11
- };
12
- //# sourceMappingURL=AgentService.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,22 +0,0 @@
1
- import {
2
- StorageService,
3
- cell,
4
- clear,
5
- deleteKey,
6
- get,
7
- list,
8
- set,
9
- withDefault
10
- } from "./chunk-PF7XP7XP.mjs";
11
- import "./chunk-J5LGTIGS.mjs";
12
- export {
13
- StorageService,
14
- cell,
15
- clear,
16
- deleteKey,
17
- get,
18
- list,
19
- set,
20
- withDefault
21
- };
22
- //# sourceMappingURL=StorageService.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,25 +0,0 @@
1
- import {
2
- Fibonacci
3
- } from "./chunk-5VAXF6AH.mjs";
4
- import {
5
- withHandler
6
- } from "./chunk-EVROJER7.mjs";
7
-
8
- // src/testing/fib.ts
9
- import * as Effect from "effect/Effect";
10
- var fib_default = Fibonacci.pipe(withHandler(Effect.fn(function* ({ iterations = 1e5 }) {
11
- let a = 0n;
12
- let b = 1n;
13
- for (let i = 0; i < iterations; i++) {
14
- a += b;
15
- b = a - b;
16
- }
17
- return {
18
- result: a.toString()
19
- };
20
- })));
21
-
22
- export {
23
- fib_default
24
- };
25
- //# sourceMappingURL=chunk-2ZN64ZS7.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/testing/fib.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '../Operation';\nimport { Fibonacci } from './definitions';\n\nexport default Fibonacci.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ iterations = 100_000 }) {\n let a = 0n;\n let b = 1n;\n for (let i = 0; i < iterations; i++) {\n a += b;\n b = a - b;\n }\n return { result: a.toString() };\n }),\n ),\n);\n"],
5
- "mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAKxB,IAAA,cAAeC,UAAUC,KACbC,YACDC,UAAG,WAAW,EAAEC,aAAa,IAAO,GAAE;AAC3C,MAAIC,IAAI;AACR,MAAIC,IAAI;AACR,WAASC,IAAI,GAAGA,IAAIH,YAAYG,KAAK;AACnCF,SAAKC;AACLA,QAAID,IAAIC;EACV;AACA,SAAO;IAAEE,QAAQH,EAAEI,SAAQ;EAAG;AAChC,CAAA,CAAA,CAAA;",
6
- "names": ["Effect", "Fibonacci", "pipe", "withHandler", "fn", "iterations", "a", "b", "i", "result", "toString"]
7
- }
@@ -1,53 +0,0 @@
1
- import {
2
- make
3
- } from "./chunk-EVROJER7.mjs";
4
-
5
- // src/testing/definitions.ts
6
- import * as Schema from "effect/Schema";
7
- import { DXN } from "@dxos/keys";
8
- var Fibonacci = make({
9
- meta: {
10
- key: DXN.make("org.example.function.fib"),
11
- name: "Fibonacci",
12
- description: "Function that calculates a Fibonacci number"
13
- },
14
- input: Schema.Struct({
15
- iterations: Schema.optional(Schema.Number).annotations({
16
- description: "Number of iterations",
17
- default: 1e5
18
- })
19
- }),
20
- output: Schema.Struct({
21
- result: Schema.String
22
- })
23
- });
24
- var Reply = make({
25
- meta: {
26
- key: DXN.make("org.example.function.reply"),
27
- name: "Reply",
28
- description: "Function that echoes the input"
29
- },
30
- input: Schema.Any,
31
- output: Schema.Any
32
- });
33
- var Sleep = make({
34
- meta: {
35
- key: DXN.make("org.example.function.sleep"),
36
- name: "Sleep",
37
- description: "Function that sleeps for a given amount of time"
38
- },
39
- input: Schema.Struct({
40
- duration: Schema.optional(Schema.Number).annotations({
41
- description: "Milliseconds to sleep",
42
- default: 1e5
43
- })
44
- }),
45
- output: Schema.Void
46
- });
47
-
48
- export {
49
- Fibonacci,
50
- Reply,
51
- Sleep
52
- };
53
- //# sourceMappingURL=chunk-5VAXF6AH.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/testing/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN } from '@dxos/keys';\n\nimport * as Operation from '../Operation';\n\nexport const Fibonacci = Operation.make({\n meta: {\n key: DXN.make('org.example.function.fib'),\n name: 'Fibonacci',\n description: 'Function that calculates a Fibonacci number',\n },\n input: Schema.Struct({\n iterations: Schema.optional(Schema.Number).annotations({\n description: 'Number of iterations',\n default: 100_000,\n }),\n }),\n output: Schema.Struct({\n result: Schema.String,\n }),\n});\n\nexport const Reply = Operation.make({\n meta: {\n key: DXN.make('org.example.function.reply'),\n name: 'Reply',\n description: 'Function that echoes the input',\n },\n input: Schema.Any,\n output: Schema.Any,\n});\n\nexport const Sleep = Operation.make({\n meta: {\n key: DXN.make('org.example.function.sleep'),\n name: 'Sleep',\n description: 'Function that sleeps for a given amount of time',\n },\n input: Schema.Struct({\n duration: Schema.optional(Schema.Number).annotations({\n description: 'Milliseconds to sleep',\n default: 100_000,\n }),\n }),\n output: Schema.Void,\n});\n"],
5
- "mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAW;AAIb,IAAMC,YAAsBC,KAAK;EACtCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,0BAAA;IACdI,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBC,YAAmBC,gBAAgBC,aAAM,EAAEC,YAAY;MACrDN,aAAa;MACbO,SAAS;IACX,CAAA;EACF,CAAA;EACAC,QAAeN,cAAO;IACpBO,QAAeC;EACjB,CAAA;AACF,CAAA;AAEO,IAAMC,QAAkBhB,KAAK;EAClCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,4BAAA;IACdI,MAAM;IACNC,aAAa;EACf;EACAC,OAAcW;EACdJ,QAAeI;AACjB,CAAA;AAEO,IAAMC,QAAkBlB,KAAK;EAClCC,MAAM;IACJC,KAAKC,IAAIH,KAAK,4BAAA;IACdI,MAAM;IACNC,aAAa;EACf;EACAC,OAAcC,cAAO;IACnBY,UAAiBV,gBAAgBC,aAAM,EAAEC,YAAY;MACnDN,aAAa;MACbO,SAAS;IACX,CAAA;EACF,CAAA;EACAC,QAAeO;AACjB,CAAA;",
6
- "names": ["Schema", "DXN", "Fibonacci", "make", "meta", "key", "DXN", "name", "description", "input", "Struct", "iterations", "optional", "Number", "annotations", "default", "output", "result", "String", "Reply", "Any", "Sleep", "duration", "Void"]
7
- }