@dxos/compute 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731

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/{chunk-RCLYF66G.mjs → chunk-7ETNWNHW.mjs} +3 -3
  2. package/dist/lib/neutral/{chunk-LF2ANNYW.mjs → chunk-CHYJAS4L.mjs} +7 -4
  3. package/dist/lib/neutral/chunk-CHYJAS4L.mjs.map +7 -0
  4. package/dist/lib/neutral/{chunk-VSICPGGY.mjs → chunk-DC4S2HKY.mjs} +9 -9
  5. package/dist/lib/neutral/chunk-DC4S2HKY.mjs.map +7 -0
  6. package/dist/lib/neutral/{chunk-AKVCVI6N.mjs → chunk-HXPMSLL7.mjs} +3 -3
  7. package/dist/lib/neutral/{chunk-SEBWOTOU.mjs → chunk-OKWXDYEB.mjs} +26 -30
  8. package/dist/lib/neutral/chunk-OKWXDYEB.mjs.map +7 -0
  9. package/dist/lib/neutral/{chunk-LRCABAWU.mjs → chunk-T43BXITP.mjs} +3 -3
  10. package/dist/lib/neutral/fib-CAER5YCY.mjs +10 -0
  11. package/dist/lib/neutral/index.mjs +97 -178
  12. package/dist/lib/neutral/index.mjs.map +3 -3
  13. package/dist/lib/neutral/meta.json +1 -1
  14. package/dist/lib/neutral/reply-NWUOJJ3N.mjs +10 -0
  15. package/dist/lib/neutral/sleep-M2ARBDMV.mjs +10 -0
  16. package/dist/lib/neutral/testing/index.mjs +7 -7
  17. package/dist/types/src/Blueprint.d.ts +22 -33
  18. package/dist/types/src/Blueprint.d.ts.map +1 -1
  19. package/dist/types/src/LayerSpec.d.ts +3 -3
  20. package/dist/types/src/LayerSpec.d.ts.map +1 -1
  21. package/dist/types/src/McpServer.d.ts +1 -2
  22. package/dist/types/src/McpServer.d.ts.map +1 -1
  23. package/dist/types/src/Operation.d.ts +49 -19
  24. package/dist/types/src/Operation.d.ts.map +1 -1
  25. package/dist/types/src/OperationHandlerSet.d.ts +2 -0
  26. package/dist/types/src/OperationHandlerSet.d.ts.map +1 -1
  27. package/dist/types/src/Process.d.ts +8 -3
  28. package/dist/types/src/Process.d.ts.map +1 -1
  29. package/dist/types/src/Routine.d.ts +10 -19
  30. package/dist/types/src/Routine.d.ts.map +1 -1
  31. package/dist/types/src/Script.d.ts +3 -4
  32. package/dist/types/src/Script.d.ts.map +1 -1
  33. package/dist/types/src/ServiceResolver.d.ts +5 -4
  34. package/dist/types/src/ServiceResolver.d.ts.map +1 -1
  35. package/dist/types/src/Template.d.ts +5 -6
  36. package/dist/types/src/Template.d.ts.map +1 -1
  37. package/dist/types/src/Trace.d.ts +10 -12
  38. package/dist/types/src/Trace.d.ts.map +1 -1
  39. package/dist/types/src/Trigger.d.ts +61 -19
  40. package/dist/types/src/Trigger.d.ts.map +1 -1
  41. package/dist/types/src/TriggerEvent.d.ts +14 -6
  42. package/dist/types/src/TriggerEvent.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 +15 -15
  46. package/src/Blueprint.ts +20 -101
  47. package/src/LayerSpec.ts +3 -3
  48. package/src/McpServer.ts +1 -1
  49. package/src/Operation.ts +68 -40
  50. package/src/OperationHandlerSet.test.ts +17 -12
  51. package/src/OperationHandlerSet.ts +8 -1
  52. package/src/Process.ts +13 -4
  53. package/src/Routine.ts +10 -18
  54. package/src/Script.ts +4 -11
  55. package/src/ServiceResolver.ts +5 -4
  56. package/src/Template.test.ts +3 -1
  57. package/src/Template.ts +5 -6
  58. package/src/Trace.ts +11 -17
  59. package/src/Trigger.ts +15 -29
  60. package/src/TriggerEvent.ts +5 -5
  61. package/src/errors.ts +1 -1
  62. package/src/testing/definitions.ts +8 -6
  63. package/dist/lib/neutral/chunk-LF2ANNYW.mjs.map +0 -7
  64. package/dist/lib/neutral/chunk-SEBWOTOU.mjs.map +0 -7
  65. package/dist/lib/neutral/chunk-VSICPGGY.mjs.map +0 -7
  66. package/dist/lib/neutral/fib-ZSJYREBW.mjs +0 -10
  67. package/dist/lib/neutral/reply-YH3BVOUT.mjs +0 -10
  68. package/dist/lib/neutral/sleep-TSPIQ5EY.mjs +0 -10
  69. /package/dist/lib/neutral/{chunk-RCLYF66G.mjs.map → chunk-7ETNWNHW.mjs.map} +0 -0
  70. /package/dist/lib/neutral/{chunk-AKVCVI6N.mjs.map → chunk-HXPMSLL7.mjs.map} +0 -0
  71. /package/dist/lib/neutral/{chunk-LRCABAWU.mjs.map → chunk-T43BXITP.mjs.map} +0 -0
  72. /package/dist/lib/neutral/{fib-ZSJYREBW.mjs.map → fib-CAER5YCY.mjs.map} +0 -0
  73. /package/dist/lib/neutral/{reply-YH3BVOUT.mjs.map → reply-NWUOJJ3N.mjs.map} +0 -0
  74. /package/dist/lib/neutral/{sleep-TSPIQ5EY.mjs.map → sleep-M2ARBDMV.mjs.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Reply
3
- } from "./chunk-VSICPGGY.mjs";
3
+ } from "./chunk-DC4S2HKY.mjs";
4
4
  import {
5
5
  withHandler
6
- } from "./chunk-SEBWOTOU.mjs";
6
+ } from "./chunk-OKWXDYEB.mjs";
7
7
 
8
8
  // src/testing/reply.ts
9
9
  import * as Console from "effect/Console";
@@ -18,4 +18,4 @@ var reply_default = Reply.pipe(withHandler(Effect.fn(function* (input) {
18
18
  export {
19
19
  reply_default
20
20
  };
21
- //# sourceMappingURL=chunk-RCLYF66G.mjs.map
21
+ //# sourceMappingURL=chunk-7ETNWNHW.mjs.map
@@ -24,8 +24,8 @@ var ServiceNotAvailableError = class extends BaseError.extend("ServiceNotAvailab
24
24
  context: {
25
25
  service
26
26
  },
27
- ...options,
28
- message: `Service not available: ${service}`
27
+ message: `Service not available: ${service}`,
28
+ ...options
29
29
  });
30
30
  }
31
31
  };
@@ -74,6 +74,7 @@ import { pipe } from "effect/Function";
74
74
  import * as Layer from "effect/Layer";
75
75
  import { runAndForwardErrors } from "@dxos/effect";
76
76
  import { assertArgument } from "@dxos/invariant";
77
+ import { DXN } from "@dxos/keys";
77
78
  var TypeId = "~@dxos/operation/OperationHandlerSet";
78
79
  var isOperationHandlerSet = (value) => {
79
80
  return typeof value === "object" && value !== null && TypeId in value;
@@ -141,7 +142,9 @@ var getHandler = (set, definition) => Effect.gen(function* () {
141
142
  });
142
143
  var getHandlerByKey = (set, key) => Effect.gen(function* () {
143
144
  const handlers = yield* set.handlers;
144
- const handler = handlers.find((handler2) => handler2.meta.key === key);
145
+ const normalizeKey = (k) => DXN.isDXN(k) ? DXN.getName(k) : k;
146
+ const normalizedKey = normalizeKey(key);
147
+ const handler = handlers.find((handler2) => normalizeKey(handler2.meta.key) === normalizedKey);
145
148
  if (!handler) {
146
149
  return yield* Effect.fail(new NoHandlerError(key));
147
150
  }
@@ -168,4 +171,4 @@ export {
168
171
  OperationHandlerProvider,
169
172
  OperationHandlerSet_exports
170
173
  };
171
- //# sourceMappingURL=chunk-LF2ANNYW.mjs.map
174
+ //# sourceMappingURL=chunk-CHYJAS4L.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/errors.ts", "../../../src/OperationHandlerSet.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { BaseError, type BaseErrorOptions } from '@dxos/errors';\n\n// Errors from @dxos/operation.\n\nexport class InvokerNotInitializedError extends BaseError.extend(\n 'InvokerNotInitializedError',\n 'Invoker not initialized',\n) {\n constructor() {\n super();\n }\n}\n\nexport class NoHandlerError extends BaseError.extend('NoHandlerError', 'No handler found for operation. ') {\n constructor(operationKey: string) {\n super({ context: { operationKey } });\n }\n}\n\n// Errors from @dxos/functions.\n\nexport class ServiceNotAvailableError extends BaseError.extend('ServiceNotAvailable', 'Service not available') {\n constructor(service: string, options?: Omit<BaseErrorOptions, 'context'>) {\n super({ context: { service }, message: `Service not available: ${service}`, ...options });\n }\n}\n\nexport class FunctionNotFoundError extends BaseError.extend('FunctionNotFound', 'Function not found') {\n constructor(functionKey: string, options?: Omit<BaseErrorOptions, 'context'>) {\n super({ context: { function: functionKey }, ...options });\n }\n}\n\nexport class FunctionError extends BaseError.extend('FunctionError', 'Function invocation error') {}\n\nexport class InvalidOperationInputError extends BaseError.extend(\n 'InvalidOperationInput',\n 'Operation input did not match schema',\n) {}\n\nexport class InvalidOperationOutputError extends BaseError.extend(\n 'InvalidOperationOutput',\n 'Operation output did not match schema',\n) {}\n\nexport class TriggerStateNotFoundError extends BaseError.extend('TriggerStateNotFound', 'Trigger state not found') {}\n\n/**\n * Raised when the upstream AI gateway responds with a structured JSON error envelope\n * (`{ \"type\": \"error\", \"error\": { \"type\": ..., \"message\": ... } }`). Surfaces as a typed\n * defect from `FunctionsAiHttpClient`, bypassing `@effect/ai`'s generic `HttpResponseError`\n * wrapping so callers can match on the error class directly.\n */\nexport class FunctionsAiUpstreamError extends BaseError.extend(\n 'FunctionsAiUpstreamError',\n 'Upstream AI service returned an error',\n) {}\n\n/**\n * Specialized `FunctionsAiUpstreamError` for the memoization layer: the recorded fixture for a\n * given cache key was not found and `ALLOW_LLM_GENERATION` is unset. The `cacheKey` is exposed\n * via `context.cacheKey` to make regeneration straightforward.\n */\nexport class FunctionsAiMemoizationMissError extends BaseError.extend(\n 'FunctionsAiMemoizationMissError',\n 'No memoized AI conversation found for the given cache key',\n) {}\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom, type Registry } from '@effect-atom/atom';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport { pipe } from 'effect/Function';\nimport * as Layer from 'effect/Layer';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { assertArgument } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\n\nimport { NoHandlerError } from './errors';\nimport type * as Operation from './Operation';\n\nexport const TypeId = '~@dxos/operation/OperationHandlerSet' as const;\nexport type TypeId = typeof TypeId;\n\nexport interface OperationHandlerSet {\n [TypeId]: TypeId;\n\n readonly handlers: Effect.Effect<Operation.WithHandler<Operation.Definition.Any>[]>;\n\n getHandlers(): Promise<Operation.WithHandler<Operation.Definition.Any>[]>;\n}\n\nexport const isOperationHandlerSet = (value: unknown): value is OperationHandlerSet => {\n return typeof value === 'object' && value !== null && TypeId in value;\n};\n\nexport const empty: OperationHandlerSet = {\n [TypeId]: TypeId,\n handlers: Effect.succeed([]),\n getHandlers: () => Promise.resolve([]),\n};\n\n/**\n * Creates a new operation handler set from a list of handlers.\n *\n * @example\n * ```ts\n * const set = OperationHandlerSet.make(\n * Operation.withHandler(Operation.make({ input: Schema.Void, output: Schema.Void }), (input) => Effect.succeed({})),\n * Operation.withHandler(Operation.make({ input: Schema.Void, output: Schema.Void }), (input) => Effect.succeed({})),\n * );\n * ```\n */\nexport const make = (...handlers: Operation.WithHandler<Operation.Definition.Any>[]): OperationHandlerSet => {\n return async(() => Promise.resolve(handlers));\n};\n\nexport const async = (\n getHandlers: () => Promise<Operation.WithHandler<Operation.Definition.Any>[]>,\n): OperationHandlerSet => {\n // NOTE: Re-runing async module imports has a big performance penalty in Chrome.\n let promise: Promise<Operation.WithHandler<Operation.Definition.Any>[]> | null = null;\n const getHandlersCached = () => {\n if (!promise) {\n promise = getHandlers();\n }\n return promise;\n };\n return {\n [TypeId]: TypeId,\n getHandlers,\n handlers: Effect.promise(getHandlersCached),\n };\n};\n\n/**\n * Builds a set backed by an atom of contributed sets. The merged result is\n * cached and invalidated whenever the atom changes, so most accesses are\n * cheap but newly registered handlers are picked up.\n */\nexport const reactive = (\n registry: Registry.Registry,\n atom: Atom.Atom<readonly OperationHandlerSet[]>,\n): OperationHandlerSet => {\n let cached: Promise<Operation.WithHandler<Operation.Definition.Any>[]> | null = null;\n registry.subscribe(atom, () => {\n cached = null;\n });\n // `suspend` defers `registry.get(atom)` until each run, so re-evaluations\n // after cache invalidation see the current contributed sets.\n const compute = Effect.suspend(() =>\n pipe(\n registry.get(atom),\n Effect.forEach((set) => set.handlers, { concurrency: 'unbounded' }),\n Effect.map((groups) => groups.flat()),\n // Reset cached on failure so a transient error doesn't permanently\n // poison subsequent calls.\n Effect.tapErrorCause(() =>\n Effect.sync(() => {\n cached = null;\n }),\n ),\n ),\n );\n const getHandlers = () => (cached ??= runAndForwardErrors(compute));\n return {\n [TypeId]: TypeId,\n getHandlers,\n handlers: Effect.promise(getHandlers),\n };\n};\n\n/**\n * Merges multiple operation handler sets into a single set.\n *\n */\nexport const merge = (...sets: OperationHandlerSet[]): OperationHandlerSet => {\n assertArgument(sets.every(isOperationHandlerSet), 'sets', 'sets must be an array of OperationHandlerSet');\n return async(() => Promise.all(sets.map((set) => set.getHandlers())).then((handlers) => handlers.flat()));\n};\n\n/**\n * Creates a new operation handler set from a list of lazy-loaded modules.\n *\n * @example\n * ```ts\n * const set = OperationHandlerSet.lazy(\n * () => import('./my-handler'),\n * () => import('./my-other-handler'),\n * );\n * ```\n */\nexport const lazy = (\n ...modules: (() => Promise<{ default: Operation.WithHandler<Operation.Definition.Any> }>)[]\n): OperationHandlerSet => {\n return async(() => Promise.all(modules.map((module) => module().then(({ default: handler }) => handler))));\n};\n\n/**\n * Gets a handler for an operation by definition.\n */\nexport const getHandler = <const Op extends Operation.Definition.Any>(\n set: OperationHandlerSet,\n definition: Op,\n): Effect.Effect<Operation.WithHandler<Op>, NoHandlerError> =>\n Effect.gen(function* () {\n const handlers = yield* set.handlers;\n const handler = handlers.find((handler) => handler.meta.key === definition.meta.key);\n if (!handler) {\n return yield* Effect.fail(new NoHandlerError(definition.meta.key));\n }\n return handler as any;\n });\n\n/**\n * Gets a handler for an operation by key.\n * Accepts either a plain NSID (`org.dxos.function.database.contextAdd`) or a\n * full DXN string (`dxn:org.dxos.function.database.contextAdd`).\n */\nexport const getHandlerByKey = (\n set: OperationHandlerSet,\n key: string,\n): Effect.Effect<Operation.WithHandler<Operation.Definition.Any>, NoHandlerError> =>\n Effect.gen(function* () {\n const handlers = yield* set.handlers;\n // Normalize both sides to plain NSID for comparison so callers can pass\n // either a ToolId (plain NSID) or a full DXN string.\n const normalizeKey = (k: string) => (DXN.isDXN(k) ? DXN.getName(k) : k);\n const normalizedKey = normalizeKey(key);\n const handler = handlers.find((handler) => normalizeKey(handler.meta.key) === normalizedKey);\n if (!handler) {\n return yield* Effect.fail(new NoHandlerError(key));\n }\n return handler as any;\n });\n\nexport class OperationHandlerProvider extends Context.Tag('@dxos/operation/OperationHandlerProvider')<\n OperationHandlerProvider,\n OperationHandlerSet\n>() {}\n\nexport const provide = (handlers: OperationHandlerSet): Layer.Layer<OperationHandlerProvider, never, never> =>\n Layer.succeed(OperationHandlerProvider, handlers);\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,iBAAwC;AAI1C,IAAMC,6BAAN,cAAyCD,UAAUE,OACxD,8BACA,yBAAA,EAAA;EAEA,cAAc;AACZ,UAAK;EACP;AACF;AAEO,IAAMC,iBAAN,cAA6BH,UAAUE,OAAO,kBAAkB,kCAAA,EAAA;EACrE,YAAYE,cAAsB;AAChC,UAAM;MAAEC,SAAS;QAAED;MAAa;IAAE,CAAA;EACpC;AACF;AAIO,IAAME,2BAAN,cAAuCN,UAAUE,OAAO,uBAAuB,uBAAA,EAAA;EACpF,YAAYK,SAAiBC,SAA6C;AACxE,UAAM;MAAEH,SAAS;QAAEE;MAAQ;MAAGE,SAAS,0BAA0BF,OAAAA;MAAW,GAAGC;IAAQ,CAAA;EACzF;AACF;AAEO,IAAME,wBAAN,cAAoCV,UAAUE,OAAO,oBAAoB,oBAAA,EAAA;EAC9E,YAAYS,aAAqBH,SAA6C;AAC5E,UAAM;MAAEH,SAAS;QAAEO,UAAUD;MAAY;MAAG,GAAGH;IAAQ,CAAA;EACzD;AACF;AAEO,IAAMK,gBAAN,cAA4Bb,UAAUE,OAAO,iBAAiB,2BAAA,EAAA;AAA8B;AAE5F,IAAMY,6BAAN,cAAyCd,UAAUE,OACxD,yBACA,sCAAA,EAAA;AACC;AAE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L,aAAaJ,GAAAA;AACnC,QAAMN,UAAUrC,SAASyC,KAAK,CAACJ,aAAYU,aAAaV,SAAQK,KAAKC,GAAG,MAAMS,aAAAA;AAC9E,MAAI,CAACf,SAAS;AACZ,WAAO,OAAcO,YAAK,IAAIC,eAAeF,GAAAA,CAAAA;EAC/C;AACA,SAAON;AACT,CAAA;AAEK,IAAMgB,2BAAN,cAA+CC,YAAI,0CAAA,EAAA,EAAA;AAGrD;AAEE,IAAMC,UAAU,CAACvD,aAChBC,cAAQoD,0BAA0BrD,QAAAA;",
6
+ "names": ["BaseError", "InvokerNotInitializedError", "extend", "NoHandlerError", "operationKey", "context", "ServiceNotAvailableError", "service", "options", "message", "FunctionNotFoundError", "functionKey", "function", "FunctionError", "InvalidOperationInputError", "InvalidOperationOutputError", "TriggerStateNotFoundError", "FunctionsAiUpstreamError", "FunctionsAiMemoizationMissError", "Context", "Effect", "pipe", "Layer", "runAndForwardErrors", "assertArgument", "DXN", "TypeId", "isOperationHandlerSet", "value", "empty", "handlers", "succeed", "getHandlers", "Promise", "resolve", "make", "async", "promise", "getHandlersCached", "reactive", "registry", "atom", "cached", "subscribe", "compute", "suspend", "pipe", "get", "forEach", "set", "concurrency", "map", "groups", "flat", "tapErrorCause", "sync", "runAndForwardErrors", "merge", "sets", "assertArgument", "every", "all", "then", "lazy", "modules", "module", "default", "handler", "getHandler", "definition", "gen", "find", "meta", "key", "fail", "NoHandlerError", "getHandlerByKey", "normalizeKey", "k", "DXN", "isDXN", "getName", "normalizedKey", "OperationHandlerProvider", "Tag", "provide"]
7
+ }
@@ -1,13 +1,13 @@
1
1
  import {
2
- intrinsic,
3
2
  make
4
- } from "./chunk-SEBWOTOU.mjs";
3
+ } from "./chunk-OKWXDYEB.mjs";
5
4
 
6
5
  // src/testing/definitions.ts
7
6
  import * as Schema from "effect/Schema";
7
+ import { DXN } from "@dxos/keys";
8
8
  var Fibonacci = make({
9
9
  meta: {
10
- key: "org.example.function.fib",
10
+ key: DXN.make("org.example.function.fib"),
11
11
  name: "Fibonacci",
12
12
  description: "Function that calculates a Fibonacci number"
13
13
  },
@@ -20,19 +20,19 @@ var Fibonacci = make({
20
20
  output: Schema.Struct({
21
21
  result: Schema.String
22
22
  })
23
- }).pipe(intrinsic);
23
+ });
24
24
  var Reply = make({
25
25
  meta: {
26
- key: "org.example.function.reply",
26
+ key: DXN.make("org.example.function.reply"),
27
27
  name: "Reply",
28
28
  description: "Function that echoes the input"
29
29
  },
30
30
  input: Schema.Any,
31
31
  output: Schema.Any
32
- }).pipe(intrinsic);
32
+ });
33
33
  var Sleep = make({
34
34
  meta: {
35
- key: "org.example.function.sleep",
35
+ key: DXN.make("org.example.function.sleep"),
36
36
  name: "Sleep",
37
37
  description: "Function that sleeps for a given amount of time"
38
38
  },
@@ -43,11 +43,11 @@ var Sleep = make({
43
43
  })
44
44
  }),
45
45
  output: Schema.Void
46
- }).pipe(intrinsic);
46
+ });
47
47
 
48
48
  export {
49
49
  Fibonacci,
50
50
  Reply,
51
51
  Sleep
52
52
  };
53
- //# sourceMappingURL=chunk-VSICPGGY.mjs.map
53
+ //# sourceMappingURL=chunk-DC4S2HKY.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Fibonacci
3
- } from "./chunk-VSICPGGY.mjs";
3
+ } from "./chunk-DC4S2HKY.mjs";
4
4
  import {
5
5
  withHandler
6
- } from "./chunk-SEBWOTOU.mjs";
6
+ } from "./chunk-OKWXDYEB.mjs";
7
7
 
8
8
  // src/testing/fib.ts
9
9
  import * as Effect from "effect/Effect";
@@ -22,4 +22,4 @@ var fib_default = Fibonacci.pipe(withHandler(Effect.fn(function* ({ iterations =
22
22
  export {
23
23
  fib_default
24
24
  };
25
- //# sourceMappingURL=chunk-AKVCVI6N.mjs.map
25
+ //# sourceMappingURL=chunk-HXPMSLL7.mjs.map
@@ -12,7 +12,6 @@ __export(Operation_exports, {
12
12
  deserialize: () => deserialize,
13
13
  getKey: () => getKey,
14
14
  getVersion: () => getVersion,
15
- intrinsic: () => intrinsic,
16
15
  invoke: () => invoke,
17
16
  isOperationDefinition: () => isOperationDefinition,
18
17
  isOperationWithHandler: () => isOperationWithHandler,
@@ -30,7 +29,7 @@ import * as Effect from "effect/Effect";
30
29
  import * as Layer from "effect/Layer";
31
30
  import * as Pipeable from "effect/Pipeable";
32
31
  import * as Schema$ from "effect/Schema";
33
- import { Annotation, JsonSchema, Migration, Obj, Ref, Type } from "@dxos/echo";
32
+ import { DXN, Annotation, JsonSchema, Migration, Obj, Ref, Type } from "@dxos/echo";
34
33
  var DefinitionTypeId = "~@dxos/operation/OperationDefinition";
35
34
  var isOperationDefinition = (value) => {
36
35
  return typeof value === "object" && value !== null && DefinitionTypeId in value;
@@ -50,15 +49,6 @@ var make = (props) => {
50
49
  }
51
50
  };
52
51
  };
53
- var intrinsic = (op) => {
54
- return {
55
- ...op,
56
- meta: {
57
- ...op.meta,
58
- deployedId: `intrinsic:${op.meta.key}`
59
- }
60
- };
61
- };
62
52
  var withHandler = (opOrHandler, handler) => {
63
53
  if (handler === void 0) {
64
54
  const handlerFn = opOrHandler;
@@ -93,14 +83,12 @@ var PersistentOperation = Schema$.Struct({
93
83
  services: Schema$.optional(Schema$.Array(Schema$.String)),
94
84
  // Local binding to a function name.
95
85
  // TODO(dmaretskyi): Add this field to Operation.Definition.
96
- binding: Schema$.optional(Schema$.String)
86
+ binding: Schema$.optional(Schema$.String),
87
+ /**
88
+ * Phosphor icon identifier in `ph--<name>--<variant>` format (e.g. `ph--file-text--regular`).
89
+ */
90
+ icon: Schema$.optional(Schema$.String)
97
91
  }).pipe(
98
- // TODO(dmaretskyi): Keep typename as 'org.dxos.type.function' (not 'operation') to maintain
99
- // backward compatibility with existing data and avoid requiring data migration.
100
- Type.object({
101
- typename: "org.dxos.type.function",
102
- version: "0.2.0"
103
- }),
104
92
  Annotation.LabelAnnotation.set([
105
93
  "name"
106
94
  ]),
@@ -108,7 +96,10 @@ var PersistentOperation = Schema$.Struct({
108
96
  icon: "ph--function--regular",
109
97
  hue: "blue"
110
98
  }),
111
- Annotation.SystemTypeAnnotation.set(true)
99
+ Annotation.HiddenAnnotation.set(true),
100
+ // TODO(dmaretskyi): Keep typename as 'org.dxos.type.function' (not 'operation') to maintain
101
+ // backward compatibility with existing data and avoid requiring data migration.
102
+ Type.makeObject(DXN.make("org.dxos.type.function", "0.2.0"))
112
103
  );
113
104
  var FUNCTION_META_KEY = "org.dxos.service.function";
114
105
  var getKey = (record) => Obj.getMeta(record).key;
@@ -123,10 +114,12 @@ var serialize = (operation) => {
123
114
  source: FUNCTION_META_KEY,
124
115
  id: operation.meta.deployedId
125
116
  }
126
- ] : []
117
+ ] : [],
118
+ annotations: operation.meta.annotations
127
119
  },
128
120
  name: operation.meta.name ?? "",
129
121
  description: operation.meta.description,
122
+ icon: operation.meta.icon,
130
123
  updated: void 0,
131
124
  source: void 0,
132
125
  inputSchema: JsonSchema.toJsonSchema(operation.input),
@@ -144,11 +137,13 @@ var deserialize = (record) => {
144
137
  executionMode: "async",
145
138
  types: [],
146
139
  meta: {
147
- key: meta.key ?? record.name,
140
+ key: DXN.tryMake(meta.key ?? record.name) ?? DXN.make(meta.key ?? record.name),
148
141
  name: record.name,
149
142
  version: meta.version ?? "0.0.0",
150
143
  description: record.description,
151
- deployedId
144
+ icon: record.icon,
145
+ deployedId,
146
+ annotations: meta.annotations ?? {}
152
147
  }
153
148
  });
154
149
  };
@@ -156,6 +151,7 @@ var setFrom = (target, source) => {
156
151
  Obj.update(target, (target2) => {
157
152
  target2.name = source.name ?? target2.name;
158
153
  target2.description = source.description;
154
+ target2.icon = source.icon;
159
155
  target2.updated = source.updated;
160
156
  target2.inputSchema = source.inputSchema ? JSON.parse(JSON.stringify(source.inputSchema)) : void 0;
161
157
  target2.outputSchema = source.outputSchema ? JSON.parse(JSON.stringify(source.outputSchema)) : void 0;
@@ -166,12 +162,13 @@ var setFrom = (target, source) => {
166
162
  if (sourceMeta.keys.length > 0) {
167
163
  targetMeta.keys = JSON.parse(JSON.stringify(sourceMeta.keys));
168
164
  }
165
+ targetMeta.annotations = sourceMeta.annotations ?? targetMeta.annotations;
169
166
  });
170
167
  };
171
168
  var Service = class extends Context.Tag("@dxos/operation/Service")() {
172
169
  };
173
170
  var invoke = (op, ...args) => Effect.flatMap(Service, (ops) => ops.invoke(op, ...args)).pipe(Effect.withSpan("Operation.invoke"));
174
- var schedule = (op, ...args) => Effect.flatMap(Service, (ops) => ops.schedule(op, args[0])).pipe(Effect.withSpan("Operation.schedule"));
171
+ var schedule = (op, ...args) => Effect.flatMap(Service, (ops) => ops.schedule(op, ...args)).pipe(Effect.withSpan("Operation.schedule"));
175
172
  var withInvocationOptions = (options) => Layer.effect(Service, Effect.gen(function* () {
176
173
  const service = yield* Service;
177
174
  return Service.of({
@@ -183,7 +180,10 @@ var withInvocationOptions = (options) => Layer.effect(Service, Effect.gen(functi
183
180
  ...options,
184
181
  ...invocationOptions
185
182
  }),
186
- schedule: service.schedule
183
+ schedule: (op, input, invocationOptions) => service.schedule(op, input, {
184
+ ...options,
185
+ ...invocationOptions
186
+ })
187
187
  });
188
188
  }));
189
189
  var PersistentOperation_v0_1_0 = Schema$.Struct({
@@ -197,10 +197,7 @@ var PersistentOperation_v0_1_0 = Schema$.Struct({
197
197
  outputSchema: Schema$.optional(JsonSchema.JsonSchema),
198
198
  services: Schema$.optional(Schema$.Array(Schema$.String)),
199
199
  binding: Schema$.optional(Schema$.String)
200
- }).pipe(Type.object({
201
- typename: "org.dxos.type.function",
202
- version: "0.1.0"
203
- }));
200
+ }).pipe(Type.makeObject(DXN.make("org.dxos.type.function", "0.1.0")));
204
201
  var _migration = Migration.define({
205
202
  from: PersistentOperation_v0_1_0,
206
203
  to: PersistentOperation,
@@ -225,11 +222,10 @@ var migrations = [
225
222
 
226
223
  export {
227
224
  make,
228
- intrinsic,
229
225
  withHandler,
230
226
  PersistentOperation,
231
227
  deserialize,
232
228
  invoke,
233
229
  Operation_exports
234
230
  };
235
- //# sourceMappingURL=chunk-SEBWOTOU.mjs.map
231
+ //# sourceMappingURL=chunk-OKWXDYEB.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/Operation.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Pipeable from 'effect/Pipeable';\nimport * as Schema$ from 'effect/Schema';\nimport type * as Types from 'effect/Types';\n\nimport { DXN, Annotation, JsonSchema, Migration, Obj, Ref, Type, type Key } from '@dxos/echo';\nimport type { URI } from '@dxos/keys';\n\nimport type { NoHandlerError } from './errors';\nimport type { Operation } from './index';\n\n/**\n * Schema type that accepts any Encoded form but requires no Context.\n * This allows ECHO object schemas where Type !== Encoded due to [KindId] symbol.\n */\ntype Schema<T> = Schema$.Schema<T, any, never>;\n\nexport const DefinitionTypeId = '~@dxos/operation/OperationDefinition' as const;\nexport type DefinitionTypeId = typeof DefinitionTypeId;\n\n/**\n * Serializable definition of an Operation.\n * Contains schema and metadata, but no runtime logic.\n */\nexport interface Definition<I, O, S = any> extends Pipeable.Pipeable, Definition.Variance<I, O, S> {\n /**\n * Input schema for the operation.\n */\n readonly input: Schema<I>;\n /**\n * Output schema for the operation.\n */\n readonly output: Schema<O>;\n\n readonly meta: {\n readonly key: DXN.DXN;\n readonly name?: string;\n readonly version?: string;\n readonly description?: string;\n /**\n * Phosphor icon identifier in `ph--<name>--<variant>` format (e.g. `ph--file-text--regular`).\n */\n readonly icon?: string;\n /**\n * Deployment ID for remote invocation.\n * Assigned by the EDGE function service when deployed.\n */\n readonly deployedId?: string;\n\n /**\n * Dictionary of annotations for the operation.\n */\n // TODO(dmaretskyi): Make required, but this complicates `make` to fill in defaults.\n readonly annotations?: Annotation.Dictionary;\n };\n\n /**\n * Execution mode for the operation.\n * - 'sync': Operation completes synchronously (fast, UI-blocking acceptable).\n * - 'async': Operation may take time (should not block UI).\n */\n readonly executionMode: 'sync' | 'async';\n\n /**\n * ECHO types the operation uses.\n * Ensures types are available when the operation is executed remotely.\n */\n readonly types: readonly Type.AnyEntity[];\n\n /**\n * Effect services required by this operation.\n * These services will be automatically provided to the handler at invocation time.\n */\n readonly services: readonly Context.Tag<any, any>[];\n}\n\n/**\n * Namespace for OperationDefinition helper types.\n */\nexport declare namespace Definition {\n export interface Variance<I, O, S> {\n [DefinitionTypeId]: {\n readonly _Input: Types.Contravariant<I>;\n readonly _Output: Types.Covariant<O>;\n readonly _Services: Types.Covariant<S>;\n };\n }\n\n /**\n * Any operation definition, regardless of input/output types.\n */\n export type Any = Definition<any, any, any>;\n\n /**\n * Extract the input type from an operation definition.\n */\n export type Input<T extends Any> = T extends Variance<infer I, infer _O, infer _S> ? I : never;\n\n /**\n * Extract the output type from an operation definition.\n */\n export type Output<T extends Any> = T extends Variance<infer _I, infer O, infer _S> ? O : never;\n\n /**\n * Extract the service identifier types from an operation's services array.\n * Returns `never` if the operation has no services declared.\n */\n export type Services<T extends Any> = T extends Variance<infer _I, infer _O, infer S> ? S : never;\n\n export type HandlerType<T extends Any> =\n T extends Variance<infer I, infer O, infer S> ? Handler<I, O, any, S> : never;\n}\n\n/**\n * Runtime handler for an Operation.\n */\nexport type Handler<I, O, E = Error, R = never> = (input: I) => Effect.Effect<O, E, R>;\n\nexport type WithHandler<T extends Definition.Any> = T & {\n handler: Definition.HandlerType<T>;\n};\n\n/**\n * Checks if a value is an operation definition.\n */\nexport const isOperationDefinition = (value: unknown): value is Definition.Any => {\n return typeof value === 'object' && value !== null && DefinitionTypeId in value;\n};\n\n/**\n * Checks if a value is an operation with a handler.\n */\nexport const isOperationWithHandler = (value: unknown): value is WithHandler<Definition.Any> => {\n return isOperationDefinition(value) && 'handler' in value;\n};\n\n/**\n * Props for creating an Operation definition.\n * Derived from OperationDefinition with executionMode made optional (defaults to 'async').\n */\nexport type Props<I, O> = Omit<Definition<I, O>, DefinitionTypeId | 'pipe' | 'executionMode' | 'types' | 'services'> & {\n readonly executionMode?: 'sync' | 'async';\n readonly types?: Definition<I, O>['types'];\n readonly services?: Definition<I, O>['services'];\n};\n\n/**\n * Creates a new Operation definition.\n * Applies default executionMode of 'async' if not specified.\n * The returned type preserves the literal types of props (including services).\n */\nexport const make = <const P extends Types.NoExcessProperties<Props<any, any>, P>>(\n props: P,\n): Definition<\n Schema$.Schema.Type<P['input']>,\n Schema$.Schema.Type<P['output']>,\n Context.Tag.Identifier<NonNullable<P['services']>[number]>\n> => {\n return {\n [DefinitionTypeId]: {},\n ...props,\n executionMode: props.executionMode ?? 'async',\n types: props.types ?? [],\n services: props.services ?? [],\n pipe() {\n // eslint-disable-next-line prefer-rest-params\n return Pipeable.pipeArguments(this, arguments);\n },\n } as any;\n};\n\n/**\n * Attaches a handler to an Operation definition.\n * The handler may use any services declared in the operation, plus Operation.Service (always available).\n * Dual API: can be called directly or used in a pipe.\n *\n * @example\n * ```ts\n * const MyOp = Operation.make({\n * input: Schema.Void,\n * output: Schema.Void,\n * meta: { key: 'my-op' },\n * services: [DatabaseService],\n * });\n *\n * // Direct call - handler can use DatabaseService\n * const op = Operation.withHandler(MyOp, (input) =>\n * Effect.gen(function* () {\n * const db = yield* DatabaseService;\n * return {};\n * }),\n * );\n *\n * // Piped call\n * const op = MyOp.pipe(Operation.withHandler((input) => Effect.succeed({})));\n * ```\n */\nexport const withHandler: {\n <Def extends Definition<any, any>, E = never>(\n handler: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n ): (op: Def) => WithHandler<Def>;\n <Def extends Definition<any, any>, E = never>(\n op: Def,\n handler: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n ): WithHandler<Def>;\n} = <Def extends Definition<any, any>, E = never>(\n opOrHandler: Def | Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n handler?: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>,\n): WithHandler<Def> => {\n // If called with just handler (piped usage).\n if (handler === undefined) {\n const handlerFn = opOrHandler as Handler<\n Definition.Input<Def>,\n Definition.Output<Def>,\n E,\n Definition.Services<Def> | Service\n >;\n return ((op: Def) => ({\n ...op,\n handler: handlerFn,\n })) as any;\n }\n\n // If called with both op and handler (direct usage).\n const op = opOrHandler as Def;\n return {\n ...op,\n handler,\n } as any;\n};\n\n/**\n * Helper to make the handler type opaque.\n * Workaround for TypeScript's inability to infer the handler type from the operation definition:\n * ```\n * error TS2742: The inferred type of 'default' cannot be named without a reference.\n * ```\n *\n * Most of the time the exact handler type is not needed.\n *\n * @example\n * ```ts\n * const MyOp = Operation.make({\n * input: Schema.Void,\n * output: Schema.Void,\n * meta: { key: 'my-op' },\n * services: [DatabaseService],\n * });\n *\n * export default MyOp.pipe(\n * Operation.withHandler(\n * Effect.fn(function* (input) {\n * return { result: 'ok' };\n * }),\n * ),\n * Operation.opaqueHandler,\n * );\n * ```\n */\nexport const opaqueHandler = <T extends Operation.Definition.Any>(\n handler: Operation.WithHandler<T>,\n): Operation.WithHandler<Operation.Definition.Any> => handler;\n\n//\n// Invocation Interfaces\n//\n\n/**\n * Local invocation of an operation.\n */\nexport type Invoke = <I, O, E>(op: Definition<I, O>, input: I) => Effect.Effect<O, E>;\n\n/**\n * Remote invocation of an operation.\n */\nexport type InvokeRemote = <I, O, E>(\n op: Definition<I, O>,\n input: I,\n options?: { timeout?: number },\n) => Effect.Effect<O, E>;\n\n/**\n * Database record of an operation.\n * The registry `key` and `version` live in the object meta — access via\n * `Obj.getMeta(record).key` and `Obj.getMeta(record).version`.\n */\nexport const PersistentOperation = Schema$.Struct({\n name: Schema$.NonEmptyString,\n\n description: Schema$.optional(Schema$.String),\n\n /**\n * ISO date string of the last deployment.\n */\n updated: Schema$.optional(Schema$.String),\n\n // Reference to a source script if it exists within ECHO.\n // TODO(burdon): Don't ref ScriptType directly (core).\n source: Schema$.optional(Ref.Ref(Obj.Unknown)),\n\n inputSchema: Schema$.optional(JsonSchema.JsonSchema),\n outputSchema: Schema$.optional(JsonSchema.JsonSchema),\n\n /**\n * List of required services.\n * Match the Context.Tag keys of the FunctionServices variants.\n */\n services: Schema$.optional(Schema$.Array(Schema$.String)),\n\n // Local binding to a function name.\n // TODO(dmaretskyi): Add this field to Operation.Definition.\n binding: Schema$.optional(Schema$.String),\n\n /**\n * Phosphor icon identifier in `ph--<name>--<variant>` format (e.g. `ph--file-text--regular`).\n */\n icon: Schema$.optional(Schema$.String),\n}).pipe(\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--function--regular', hue: 'blue' }),\n Annotation.HiddenAnnotation.set(true),\n // TODO(dmaretskyi): Keep typename as 'org.dxos.type.function' (not 'operation') to maintain\n // backward compatibility with existing data and avoid requiring data migration.\n Type.makeObject(DXN.make('org.dxos.type.function', '0.2.0')),\n);\nexport type PersistentOperation = Type.InstanceType<typeof PersistentOperation>;\n\nconst FUNCTION_META_KEY = 'org.dxos.service.function';\n\n/**\n * Get the registry key for a persistent operation record (from the object meta).\n */\nexport const getKey = (record: PersistentOperation): string | undefined => Obj.getMeta(record).key;\n\n/**\n * Get the registry version for a persistent operation record (from the object meta).\n */\nexport const getVersion = (record: PersistentOperation): string | undefined => Obj.getMeta(record).version;\n\n/**\n * Serialize an operation definition to a persistent operation record.\n */\nexport const serialize = (operation: Definition.Any): PersistentOperation => {\n return Obj.make(PersistentOperation, {\n [Obj.Meta]: {\n key: operation.meta.key,\n version: operation.meta.version ?? '0.0.0',\n keys: operation.meta.deployedId ? [{ source: FUNCTION_META_KEY, id: operation.meta.deployedId }] : [],\n annotations: operation.meta.annotations,\n },\n name: operation.meta.name ?? '',\n description: operation.meta.description,\n icon: operation.meta.icon,\n updated: undefined,\n source: undefined,\n inputSchema: JsonSchema.toJsonSchema(operation.input),\n outputSchema: JsonSchema.toJsonSchema(operation.output),\n services: operation.services.map((service) => service.key),\n });\n};\n\n/**\n * Deserialize a persistent operation record to an operation definition.\n */\nexport const deserialize = (record: PersistentOperation): Definition.Any => {\n const meta = Obj.getMeta(record);\n // Extract deployed function ID from ECHO meta keys (matches FUNCTIONS_META_KEY in @dxos/functions).\n const deployedId = meta.keys.find((key) => key.source === FUNCTION_META_KEY)?.id;\n return make({\n input: record.inputSchema ? JsonSchema.toEffectSchema(record.inputSchema) : Schema$.Unknown,\n output: record.outputSchema ? JsonSchema.toEffectSchema(record.outputSchema) : Schema$.Unknown,\n services: record.services?.map((service) => Context.GenericTag(service)) ?? [],\n executionMode: 'async',\n types: [],\n meta: {\n key: DXN.tryMake(meta.key ?? record.name) ?? DXN.make(meta.key ?? record.name),\n name: record.name,\n version: meta.version ?? '0.0.0',\n description: record.description,\n icon: record.icon,\n deployedId,\n annotations: meta.annotations ?? {},\n },\n });\n};\n\n/**\n * Update properties on the target operation record from the source operation record.\n */\nexport const setFrom = (target: PersistentOperation, source: PersistentOperation) => {\n Obj.update(target, (target) => {\n target.name = source.name ?? target.name;\n target.description = source.description;\n target.icon = source.icon;\n target.updated = source.updated;\n // TODO(dmaretskyi): A workaround for an ECHO bug.\n target.inputSchema = source.inputSchema ? JSON.parse(JSON.stringify(source.inputSchema)) : undefined;\n target.outputSchema = source.outputSchema ? JSON.parse(JSON.stringify(source.outputSchema)) : undefined;\n const sourceMeta = Obj.getMeta(source);\n const targetMeta = Obj.getMeta(target);\n targetMeta.key = sourceMeta.key ?? targetMeta.key;\n targetMeta.version = sourceMeta.version;\n // Only overwrite foreign keys when the source actually carries them; otherwise we'd wipe\n // bindings (e.g. the deployedId set by `deserialize`) on records produced by `serialize`.\n if (sourceMeta.keys.length > 0) {\n targetMeta.keys = JSON.parse(JSON.stringify(sourceMeta.keys));\n }\n targetMeta.annotations = sourceMeta.annotations ?? targetMeta.annotations;\n });\n};\n\n/**\n * Translatable label — a plain string or an i18next-style `[key, options]` tuple.\n * Defined locally to avoid a core dependency on UI translation packages; structurally compatible with\n * the app-level `Label` type so values flow into UI toasts unchanged.\n */\nexport type Label = string | [string, { ns: string | readonly string[]; count?: number; defaultValue?: string }];\n\n/**\n * Per-phase user notification messages for an invocation.\n * A phase is notified to the user iff its message is provided; messages are translatable {@link Label}s.\n */\nexport interface NotifyOptions {\n /** Shown when the invocation starts. */\n start?: Label;\n /** Shown when the invocation succeeds. */\n success?: Label;\n /** Shown when the invocation fails. */\n error?: Label;\n}\n\n/**\n * Options for operation invocation.\n */\nexport interface InvokeOptions {\n /**\n * Space ID to provide database context for the handler.\n */\n spaceId?: Key.SpaceId;\n /**\n * Request user-facing notifications at the given invocation phases.\n */\n notify?: NotifyOptions;\n /**\n * URI of the conversation feed (queue) — today always an EID, but typed as\n * `URI.URI` to accommodate future entity-kind extensions. Narrow with `EID.parse`\n * at the point of use.\n * Passed to the process environment so nested operations can resolve AiContext.Service and related services.\n */\n conversation?: URI.URI;\n /**\n * Optional process-runtime tracing metadata (consumed by `@dxos/functions-runtime` when wired).\n */\n tracing?: unknown;\n}\n\n/**\n * Operation service interface - provides unified access to operation invocation and scheduling.\n * This service is automatically provided to operation handlers.\n */\nexport interface OperationService {\n /**\n * Invoke an operation as an Effect.\n * Returns an Effect that resolves to the operation output.\n */\n invoke: <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n ) => Effect.Effect<O, NoHandlerError>;\n\n /**\n * Schedule an operation to run as a followup.\n * The followup is tracked and won't be cancelled when the parent operation completes.\n * Returns an Effect that completes immediately after scheduling.\n */\n schedule: <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n ) => Effect.Effect<void>;\n\n /**\n * Invoke an operation and return a Promise.\n * Useful for async contexts where Effect is not available.\n */\n invokePromise: <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n ) => Promise<{ data?: O; error?: Error }>;\n}\n\n/**\n * Context tag for the Operation service.\n * Operation handlers can yield this to invoke other operations or schedule followups.\n *\n * @example\n * ```ts\n * const handler = (input) => Effect.gen(function* () {\n * // Schedule a followup (fire and forget)\n * yield* Operation.schedule(AnalyticsOperation, { event: 'completed' });\n *\n * // Invoke another operation\n * return yield* Operation.invoke(OtherOperation, { data: input.data });\n * });\n * ```\n */\n// TODO(dmaretskyi): Rename Operation.Invoker\nexport class Service extends Context.Tag('@dxos/operation/Service')<Service, OperationService>() {}\n\n//\n// Namespace functions - ergonomic access to Operation.Service methods.\n//\n\n/**\n * Invoke an operation as an Effect.\n * Yields the Operation.Service internally.\n *\n * @example\n * ```ts\n * yield* Operation.invoke(MyOperation, { data: 'test' });\n * ```\n */\nexport const invoke = <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n): Effect.Effect<O, NoHandlerError, Service> =>\n Effect.flatMap(Service, (ops) => ops.invoke(op, ...(args as [I, InvokeOptions?]))).pipe(\n Effect.withSpan('Operation.invoke'),\n );\n\n/**\n * Schedule an operation to run as a followup.\n * Yields the Operation.Service internally.\n *\n * @example\n * ```ts\n * yield* Operation.schedule(AnalyticsOperation, { event: 'completed' });\n * yield* Operation.schedule(VoidOperation); // input optional when void\n * ```\n */\nexport const schedule = <I, O>(\n op: Operation.Definition<I, O>,\n ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]\n): Effect.Effect<void, never, Service> =>\n Effect.flatMap(Service, (ops) => ops.schedule(op, ...(args as [I, InvokeOptions?]))).pipe(\n Effect.withSpan('Operation.schedule'),\n );\n\n/**\n * Provides additional invocation options to all invocations.\n */\nexport const withInvocationOptions = (options: InvokeOptions): Layer.Layer<Service, never, Service> =>\n Layer.effect(\n Service,\n Effect.gen(function* () {\n const service = yield* Service;\n return Service.of({\n invoke: ((op: Operation.Definition.Any, input: any, invocationOptions: InvokeOptions) =>\n service.invoke(op, input, { ...options, ...invocationOptions })) as any,\n invokePromise: ((op: Operation.Definition.Any, input: any, invocationOptions: InvokeOptions) =>\n service.invokePromise(op, input, { ...options, ...invocationOptions })) as any,\n schedule: ((op: Operation.Definition.Any, input: any, invocationOptions: InvokeOptions) =>\n service.schedule(op, input, { ...options, ...invocationOptions })) as any,\n });\n }),\n );\n\n//\n// Legacy schemas and migrations.\n//\n\n/**\n * Persistent operation schema v0.1.0 — `key` and `version` are stored as data properties.\n * @deprecated Use {@link PersistentOperation} (v0.2.0) instead; the `key` and `version` now live in the object meta.\n */\nexport const PersistentOperation_v0_1_0 = Schema$.Struct({\n key: Schema$.optional(Schema$.String),\n name: Schema$.NonEmptyString,\n version: Schema$.String,\n description: Schema$.optional(Schema$.String),\n updated: Schema$.optional(Schema$.String),\n source: Schema$.optional(Ref.Ref(Obj.Unknown)),\n inputSchema: Schema$.optional(JsonSchema.JsonSchema),\n outputSchema: Schema$.optional(JsonSchema.JsonSchema),\n services: Schema$.optional(Schema$.Array(Schema$.String)),\n binding: Schema$.optional(Schema$.String),\n}).pipe(Type.makeObject(DXN.make('org.dxos.type.function', '0.1.0')));\nexport type PersistentOperation_v0_1_0 = Type.InstanceType<typeof PersistentOperation_v0_1_0>;\n\n/**\n * Migration from {@link PersistentOperation_v0_1_0} (v0.1.0) to {@link PersistentOperation} (v0.2.0).\n * Moves `key` and `version` from the data section into the object meta.\n */\nconst _migration = Migration.define({\n from: PersistentOperation_v0_1_0,\n to: PersistentOperation,\n transform: async (from) => ({\n [Obj.Meta]: { key: from.key, version: from.version },\n name: from.name,\n description: from.description,\n updated: from.updated,\n source: from.source as any,\n inputSchema: from.inputSchema,\n outputSchema: from.outputSchema,\n services: from.services,\n binding: from.binding,\n }),\n});\n\n/**\n * Schema migrations exported by this module.\n * Exported as an array for extensibility — append future versions here.\n */\nexport const migrations = [_migration];\n"],
5
+ "mappings": ";;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAMA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,cAAc;AAC1B,YAAYC,aAAa;AAGzB,SAASC,KAAKC,YAAYC,YAAYC,WAAWC,KAAKC,KAAKC,YAAsB;AAY1E,IAAMC,mBAAmB;AA4GzB,IAAMC,wBAAwB,CAACC,UAAAA;AACpC,SAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQF,oBAAoBE;AAC5E;AAKO,IAAMC,yBAAyB,CAACD,UAAAA;AACrC,SAAOD,sBAAsBC,KAAAA,KAAU,aAAaA;AACtD;AAiBO,IAAME,OAAO,CAClBC,UAAAA;AAMA,SAAO;IACL,CAACL,gBAAAA,GAAmB,CAAC;IACrB,GAAGK;IACHC,eAAeD,MAAMC,iBAAiB;IACtCC,OAAOF,MAAME,SAAS,CAAA;IACtBC,UAAUH,MAAMG,YAAY,CAAA;IAC5BC,OAAAA;AAEE,aAAgBC,uBAAc,MAAMC,SAAAA;IACtC;EACF;AACF;AA4BO,IAAMC,cAQT,CACFC,aACAC,YAAAA;AAGA,MAAIA,YAAYC,QAAW;AACzB,UAAMC,YAAYH;AAMlB,WAAQ,CAACI,SAAa;MACpB,GAAGA;MACHH,SAASE;IACX;EACF;AAGA,QAAMC,KAAKJ;AACX,SAAO;IACL,GAAGI;IACHH;EACF;AACF;AA8BO,IAAMI,gBAAgB,CAC3BJ,YACoDA;AAyB/C,IAAMK,sBAA8BC,eAAO;EAChDC,MAAcC;EAEdC,aAA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IAAIuC,OAAO;MAAE,GAAG2B;MAAS,GAAGI;IAAkB,CAAA;EACnE,CAAA;AACF,CAAA,CAAA;AAWG,IAAME,6BAAqCrE,eAAO;EACvDwB,KAAapB,iBAAiBC,cAAM;EACpCJ,MAAcC;EACdwB,SAAiBrB;EACjBF,aAAqBC,iBAAiBC,cAAM;EAC5CC,SAAiBF,iBAAiBC,cAAM;EACxCE,QAAgBH,iBAAS1B,IAAIA,IAAID,IAAI+B,OAAO,CAAA;EAC5CC,aAAqBL,iBAAS7B,WAAWA,UAAU;EACnDmC,cAAsBN,iBAAS7B,WAAWA,UAAU;EACpDa,UAAkBgB,iBAAiBO,cAAcN,cAAM,CAAA;EACvDO,SAAiBR,iBAAiBC,cAAM;AAC1C,CAAA,EAAGhB,KAAKV,KAAKwC,WAAW9C,IAAIW,KAAK,0BAA0B,OAAA,CAAA,CAAA;AAO3D,IAAMsF,aAAa9F,UAAU+F,OAAO;EAClCC,MAAMH;EACNI,IAAI1E;EACJ2E,WAAW,OAAOF,UAAU;IAC1B,CAAC/F,IAAIoD,IAAI,GAAG;MAAEL,KAAKgD,KAAKhD;MAAKE,SAAS8C,KAAK9C;IAAQ;IACnDzB,MAAMuE,KAAKvE;IACXE,aAAaqE,KAAKrE;IAClBG,SAASkE,KAAKlE;IACdC,QAAQiE,KAAKjE;IACbE,aAAa+D,KAAK/D;IAClBC,cAAc8D,KAAK9D;IACnBtB,UAAUoF,KAAKpF;IACfwB,SAAS4D,KAAK5D;EAChB;AACF,CAAA;AAMO,IAAM+D,aAAa;EAACL;;",
6
+ "names": ["Context", "Effect", "Layer", "Pipeable", "Schema$", "DXN", "Annotation", "JsonSchema", "Migration", "Obj", "Ref", "Type", "DefinitionTypeId", "isOperationDefinition", "value", "isOperationWithHandler", "make", "props", "executionMode", "types", "services", "pipe", "pipeArguments", "arguments", "withHandler", "opOrHandler", "handler", "undefined", "handlerFn", "op", "opaqueHandler", "PersistentOperation", "Struct", "name", "NonEmptyString", "description", "optional", "String", "updated", "source", "Unknown", "inputSchema", "outputSchema", "Array", "binding", "icon", "LabelAnnotation", "set", "IconAnnotation", "hue", "HiddenAnnotation", "makeObject", "FUNCTION_META_KEY", "getKey", "record", "getMeta", "key", "getVersion", "version", "serialize", "operation", "Meta", "meta", "keys", "deployedId", "id", "annotations", "toJsonSchema", "input", "output", "map", "service", "deserialize", "find", "toEffectSchema", "GenericTag", "tryMake", "setFrom", "target", "update", "JSON", "parse", "stringify", "sourceMeta", "targetMeta", "length", "Service", "Tag", "invoke", "args", "flatMap", "ops", "withSpan", "schedule", "withInvocationOptions", "options", "effect", "gen", "of", "invocationOptions", "invokePromise", "PersistentOperation_v0_1_0", "_migration", "define", "from", "to", "transform", "migrations"]
7
+ }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Sleep
3
- } from "./chunk-VSICPGGY.mjs";
3
+ } from "./chunk-DC4S2HKY.mjs";
4
4
  import {
5
5
  withHandler
6
- } from "./chunk-SEBWOTOU.mjs";
6
+ } from "./chunk-OKWXDYEB.mjs";
7
7
 
8
8
  // src/testing/sleep.ts
9
9
  import * as Effect from "effect/Effect";
@@ -14,4 +14,4 @@ var sleep_default = Sleep.pipe(withHandler(Effect.fn(function* ({ duration = 1e5
14
14
  export {
15
15
  sleep_default
16
16
  };
17
- //# sourceMappingURL=chunk-LRCABAWU.mjs.map
17
+ //# sourceMappingURL=chunk-T43BXITP.mjs.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ fib_default
3
+ } from "./chunk-HXPMSLL7.mjs";
4
+ import "./chunk-DC4S2HKY.mjs";
5
+ import "./chunk-OKWXDYEB.mjs";
6
+ import "./chunk-J5LGTIGS.mjs";
7
+ export {
8
+ fib_default as default
9
+ };
10
+ //# sourceMappingURL=fib-CAER5YCY.mjs.map