@dxos/functions 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934

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 (102) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/index.mjs +261 -930
  4. package/dist/lib/neutral/index.mjs.map +4 -4
  5. package/dist/lib/neutral/meta.json +1 -1
  6. package/dist/types/src/index.d.ts +0 -6
  7. package/dist/types/src/index.d.ts.map +1 -1
  8. package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -1
  9. package/dist/types/src/protocol/functions-ai-http-client.test.d.ts +2 -0
  10. package/dist/types/src/protocol/functions-ai-http-client.test.d.ts.map +1 -0
  11. package/dist/types/src/protocol/protocol.d.ts +14 -2
  12. package/dist/types/src/protocol/protocol.d.ts.map +1 -1
  13. package/dist/types/src/sdk.d.ts +3 -7
  14. package/dist/types/src/sdk.d.ts.map +1 -1
  15. package/dist/types/src/services/credentials.d.ts +15 -38
  16. package/dist/types/src/services/credentials.d.ts.map +1 -1
  17. package/dist/types/src/services/function-invocation-service.d.ts +3 -5
  18. package/dist/types/src/services/function-invocation-service.d.ts.map +1 -1
  19. package/dist/types/src/services/index.d.ts +1 -4
  20. package/dist/types/src/services/index.d.ts.map +1 -1
  21. package/dist/types/src/services/queues.d.ts +1 -49
  22. package/dist/types/src/services/queues.d.ts.map +1 -1
  23. package/dist/types/src/services/tracing.d.ts +1 -107
  24. package/dist/types/src/services/tracing.d.ts.map +1 -1
  25. package/dist/types/src/types/index.d.ts +0 -3
  26. package/dist/types/src/types/index.d.ts.map +1 -1
  27. package/dist/types/src/types/url.d.ts +1 -1
  28. package/dist/types/src/types/url.d.ts.map +1 -1
  29. package/dist/types/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +16 -21
  31. package/src/index.ts +0 -6
  32. package/src/protocol/functions-ai-http-client.test.ts +105 -0
  33. package/src/protocol/functions-ai-http-client.ts +75 -1
  34. package/src/protocol/protocol.test.ts +10 -10
  35. package/src/protocol/protocol.ts +213 -40
  36. package/src/sdk.ts +7 -15
  37. package/src/services/credentials.ts +76 -120
  38. package/src/services/function-invocation-service.ts +3 -9
  39. package/src/services/index.ts +1 -4
  40. package/src/services/queues.ts +1 -87
  41. package/src/services/tracing.ts +0 -192
  42. package/src/types/index.ts +0 -3
  43. package/src/types/url.ts +1 -1
  44. package/dist/lib/neutral/Trace.mjs +0 -38
  45. package/dist/lib/neutral/Trace.mjs.map +0 -7
  46. package/dist/lib/neutral/chunk-5T7GOX2V.mjs +0 -149
  47. package/dist/lib/neutral/chunk-5T7GOX2V.mjs.map +0 -7
  48. package/dist/lib/neutral/chunk-IVDUS56O.mjs +0 -49
  49. package/dist/lib/neutral/chunk-IVDUS56O.mjs.map +0 -7
  50. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  51. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  52. package/dist/lib/neutral/fib-N45KAC7C.mjs +0 -23
  53. package/dist/lib/neutral/fib-N45KAC7C.mjs.map +0 -7
  54. package/dist/lib/neutral/reply-EUEPKNJF.mjs +0 -19
  55. package/dist/lib/neutral/reply-EUEPKNJF.mjs.map +0 -7
  56. package/dist/lib/neutral/sleep-PUK3D4FF.mjs +0 -15
  57. package/dist/lib/neutral/sleep-PUK3D4FF.mjs.map +0 -7
  58. package/dist/types/src/Trace.d.ts +0 -155
  59. package/dist/types/src/Trace.d.ts.map +0 -1
  60. package/dist/types/src/errors.d.ts +0 -121
  61. package/dist/types/src/errors.d.ts.map +0 -1
  62. package/dist/types/src/example/definitions.d.ts +0 -11
  63. package/dist/types/src/example/definitions.d.ts.map +0 -1
  64. package/dist/types/src/example/fib.d.ts +0 -8
  65. package/dist/types/src/example/fib.d.ts.map +0 -1
  66. package/dist/types/src/example/forex-effect.d.ts +0 -3
  67. package/dist/types/src/example/forex-effect.d.ts.map +0 -1
  68. package/dist/types/src/example/index.d.ts +0 -4
  69. package/dist/types/src/example/index.d.ts.map +0 -1
  70. package/dist/types/src/example/reply.d.ts +0 -4
  71. package/dist/types/src/example/reply.d.ts.map +0 -1
  72. package/dist/types/src/example/sleep.d.ts +0 -6
  73. package/dist/types/src/example/sleep.d.ts.map +0 -1
  74. package/dist/types/src/process/Process.d.ts +0 -247
  75. package/dist/types/src/process/Process.d.ts.map +0 -1
  76. package/dist/types/src/process/ServiceResolver.d.ts +0 -74
  77. package/dist/types/src/process/ServiceResolver.d.ts.map +0 -1
  78. package/dist/types/src/process/StorageService.d.ts +0 -58
  79. package/dist/types/src/process/StorageService.d.ts.map +0 -1
  80. package/dist/types/src/services/event-logger.d.ts +0 -81
  81. package/dist/types/src/services/event-logger.d.ts.map +0 -1
  82. package/dist/types/src/types/Script.d.ts +0 -22
  83. package/dist/types/src/types/Script.d.ts.map +0 -1
  84. package/dist/types/src/types/Trigger.d.ts +0 -120
  85. package/dist/types/src/types/Trigger.d.ts.map +0 -1
  86. package/dist/types/src/types/TriggerEvent.d.ts +0 -75
  87. package/dist/types/src/types/TriggerEvent.d.ts.map +0 -1
  88. package/src/Trace.ts +0 -202
  89. package/src/errors.ts +0 -21
  90. package/src/example/definitions.ts +0 -49
  91. package/src/example/fib.ts +0 -23
  92. package/src/example/forex-effect.ts +0 -40
  93. package/src/example/index.ts +0 -12
  94. package/src/example/reply.ts +0 -19
  95. package/src/example/sleep.ts +0 -17
  96. package/src/process/Process.ts +0 -486
  97. package/src/process/ServiceResolver.ts +0 -174
  98. package/src/process/StorageService.ts +0 -99
  99. package/src/services/event-logger.ts +0 -127
  100. package/src/types/Script.ts +0 -38
  101. package/src/types/Trigger.ts +0 -154
  102. package/src/types/TriggerEvent.ts +0 -62
@@ -1,149 +0,0 @@
1
- import {
2
- __export
3
- } from "./chunk-J5LGTIGS.mjs";
4
-
5
- // src/Trace.ts
6
- var Trace_exports = {};
7
- __export(Trace_exports, {
8
- Event: () => Event,
9
- EventType: () => EventType,
10
- Message: () => Message,
11
- MessageData: () => MessageData,
12
- Meta: () => Meta,
13
- OperationEnd: () => OperationEnd,
14
- OperationStart: () => OperationStart,
15
- TraceService: () => TraceService,
16
- TraceSink: () => TraceSink,
17
- isOfType: () => isOfType,
18
- layerConsole: () => layerConsole,
19
- layerNoop: () => layerNoop,
20
- noopWriter: () => noopWriter,
21
- testTraceService: () => testTraceService,
22
- write: () => write,
23
- writerLayerNoop: () => writerLayerNoop
24
- });
25
- import * as Context from "effect/Context";
26
- import * as Effect from "effect/Effect";
27
- import * as Layer from "effect/Layer";
28
- import * as Schema from "effect/Schema";
29
- import { Annotation, Obj, Type } from "@dxos/echo";
30
- var TraceService = class extends Context.Tag("@dxos/functions/TraceService")() {
31
- };
32
- var write = Effect.serviceFunction(TraceService, (_) => _.write);
33
- var EventType = (key, opts) => {
34
- return {
35
- key,
36
- schema: opts.schema,
37
- isEphemeral: opts.isEphemeral
38
- };
39
- };
40
- var Event = Schema.Struct({
41
- timestamp: Schema.Number,
42
- type: Schema.String,
43
- data: Schema.Unknown
44
- });
45
- var isOfType = (eventType, event) => {
46
- return event.type === eventType.key;
47
- };
48
- var Meta = Schema.Struct({
49
- pid: Schema.optional(Schema.String),
50
- parentPid: Schema.optional(Schema.String),
51
- processName: Schema.optional(Schema.String),
52
- /**
53
- * ID of the conversation feed object if present.
54
- */
55
- conversationId: Schema.optional(Obj.ID),
56
- /**
57
- * ID of the trigger object if invocation resulted from a trigger.
58
- */
59
- triggerId: Schema.optional(Obj.ID)
60
- });
61
- var MessageData = Schema.Struct({
62
- meta: Meta,
63
- isEphemeral: Schema.Boolean,
64
- events: Schema.Array(Event)
65
- });
66
- var Message = MessageData.pipe(Type.object({
67
- typename: "org.dxos.type.traceMessage",
68
- version: "0.1.0"
69
- }), Annotation.IconAnnotation.set({
70
- icon: "ph--note--regular",
71
- hue: "rose"
72
- }));
73
- var TraceSink = class extends Context.Tag("@dxos/functions/TraceSink")() {
74
- };
75
- var noopWriter = {
76
- write: () => {
77
- }
78
- };
79
- var writerLayerNoop = Layer.succeed(TraceService, noopWriter);
80
- var layerNoop = Layer.succeed(TraceSink, {
81
- write: () => {
82
- }
83
- });
84
- var layerConsole = Layer.succeed(TraceSink, {
85
- write: (message) => {
86
- console.log(message);
87
- }
88
- });
89
- var testTraceService = (opts = {}) => Layer.effect(TraceService, Effect.gen(function* () {
90
- const sink = yield* TraceSink;
91
- return {
92
- write: (event, data) => {
93
- sink.write(Obj.make(Message, {
94
- meta: opts.meta ?? {},
95
- isEphemeral: event.isEphemeral,
96
- events: [
97
- {
98
- type: event.key,
99
- timestamp: Date.now(),
100
- data
101
- }
102
- ]
103
- }));
104
- }
105
- };
106
- }));
107
- var OperationStart = EventType("operation.start", {
108
- schema: Schema.Struct({
109
- /** Operation key. */
110
- key: Schema.String,
111
- /** Human-readable operation name. */
112
- name: Schema.optional(Schema.String)
113
- }),
114
- isEphemeral: false
115
- });
116
- var OperationEnd = EventType("operation.end", {
117
- schema: Schema.Struct({
118
- /** Operation key. */
119
- key: Schema.String,
120
- /** Human-readable operation name. */
121
- name: Schema.optional(Schema.String),
122
- /** Outcome of the operation. */
123
- outcome: Schema.Literal("success", "failure"),
124
- /** Error message if the operation failed. */
125
- error: Schema.optional(Schema.String)
126
- }),
127
- isEphemeral: false
128
- });
129
-
130
- export {
131
- TraceService,
132
- write,
133
- EventType,
134
- Event,
135
- isOfType,
136
- Meta,
137
- MessageData,
138
- Message,
139
- TraceSink,
140
- noopWriter,
141
- writerLayerNoop,
142
- layerNoop,
143
- layerConsole,
144
- testTraceService,
145
- OperationStart,
146
- OperationEnd,
147
- Trace_exports
148
- };
149
- //# sourceMappingURL=chunk-5T7GOX2V.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/Trace.ts"],
4
- "sourcesContent": ["//\n// Copyright 2026 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 Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Type } from '@dxos/echo';\n\n/**\n * Writes ephemeral or persistent events to the trace.\n * Exposed to processes and operations to record events to the trace.\n */\nexport interface TraceWriter {\n write<T>(eventType: EventType<T>, payload: NoInfer<T>): void;\n}\n\n/**\n * Service that writes events to the trace.\n * Exposed to processes and operations to record events to the trace.\n */\nexport class TraceService extends Context.Tag('@dxos/functions/TraceService')<TraceService, TraceWriter>() {}\n\n/**\n * Writes an event to the trace.\n */\nexport const write: <T>(eventType: EventType<T>, payload: NoInfer<T>) => Effect.Effect<void, never, TraceService> =\n Effect.serviceFunction(TraceService, (_) => _.write);\n\n/**\n * Defines an event type for the trace.\n */\nexport interface EventType<T> {\n readonly key: string;\n readonly schema: Schema.Schema<T, any>;\n readonly isEphemeral: boolean;\n}\n\nexport const EventType = <T>(\n key: string,\n opts: { schema: Schema.Schema<T, any>; isEphemeral: boolean },\n): EventType<T> => {\n return {\n key,\n schema: opts.schema,\n isEphemeral: opts.isEphemeral,\n };\n};\n\n/**\n * Extracts the payload type from an event type.\n */\nexport type PayloadType<E extends EventType<any>> = E extends EventType<infer T> ? T : never;\n\nexport const Event = Schema.Struct({\n timestamp: Schema.Number,\n type: Schema.String,\n data: Schema.Unknown, // Type-specific payload;\n});\nexport interface Event extends Schema.Schema.Type<typeof Event> {}\n\n/**\n * Checks if an event is of a given type.\n */\nexport const isOfType = <T, E extends Event>(eventType: EventType<T>, event: E): event is E & { data: T } => {\n return event.type === eventType.key;\n};\n\n/**\n * Metadata on the context of a trace message.\n */\n// TODO(dmaretskyi): Expand on this: conversation id, tool call id, etc.\nexport const Meta = Schema.Struct({\n pid: Schema.optional(Schema.String), // NOTE: Not Process.ID to avoid circular dependency.\n parentPid: Schema.optional(Schema.String),\n processName: Schema.optional(Schema.String),\n /**\n * ID of the conversation feed object if present.\n */\n conversationId: Schema.optional(Obj.ID),\n\n /**\n * ID of the trigger object if invocation resulted from a trigger.\n */\n triggerId: Schema.optional(Obj.ID),\n});\nexport interface Meta extends Schema.Schema.Type<typeof Meta> {}\n\n/**\n * Envelope for a set of events.\n */\nexport const MessageData = Schema.Struct({\n meta: Meta,\n\n isEphemeral: Schema.Boolean,\n events: Schema.Array(Event),\n});\nexport interface MessageData extends Schema.Schema.Type<typeof MessageData> {}\n\nexport const Message = MessageData.pipe(\n Type.object({\n typename: 'org.dxos.type.traceMessage',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--note--regular',\n hue: 'rose',\n }),\n);\nexport interface Message extends Schema.Schema.Type<typeof Message> {}\n\n/**\n * Sink for complete trace messages.\n */\nexport interface Sink {\n write(message: Message): void;\n}\n\n/**\n * Sink for complete trace messages.\n * The Process Manager forwards trace messages to it.\n */\n// TODO(dmaretskyi): Consider moving sink to the Process Manager.\nexport class TraceSink extends Context.Tag('@dxos/functions/TraceSink')<TraceSink, Sink>() {}\n\nexport const noopWriter: TraceWriter = {\n write: () => {},\n};\n\nexport const writerLayerNoop: Layer.Layer<TraceService> = Layer.succeed(TraceService, noopWriter);\n\nexport const layerNoop: Layer.Layer<TraceSink> = Layer.succeed(TraceSink, {\n write: () => {},\n});\n\nexport const layerConsole: Layer.Layer<TraceSink> = Layer.succeed(TraceSink, {\n write: (message) => {\n console.log(message);\n },\n});\n\nexport const testTraceService = (opts: { meta?: Meta } = {}): Layer.Layer<TraceService, never, TraceSink> =>\n Layer.effect(\n TraceService,\n Effect.gen(function* () {\n const sink = yield* TraceSink;\n return {\n write: (event, data) => {\n sink.write(\n Obj.make(Message, {\n meta: opts.meta ?? {},\n isEphemeral: event.isEphemeral,\n events: [{ type: event.key, timestamp: Date.now(), data }],\n }),\n );\n },\n };\n }),\n );\n\n//\n// Operation Trace Events\n//\n\n/**\n * Outcome of an operation invocation.\n */\nexport type OperationOutcome = 'success' | 'failure';\n\n/**\n * Operation invocation started.\n */\nexport const OperationStart = EventType('operation.start', {\n schema: Schema.Struct({\n /** Operation key. */\n key: Schema.String,\n /** Human-readable operation name. */\n name: Schema.optional(Schema.String),\n }),\n isEphemeral: false,\n});\n\n/**\n * Operation invocation ended.\n */\nexport const OperationEnd = EventType('operation.end', {\n schema: Schema.Struct({\n /** Operation key. */\n key: Schema.String,\n /** Human-readable operation name. */\n name: Schema.optional(Schema.String),\n /** Outcome of the operation. */\n outcome: Schema.Literal('success', 'failure'),\n /** Error message if the operation failed. */\n error: Schema.optional(Schema.String),\n }),\n isEphemeral: false,\n});\n"],
5
- "mappings": ";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAMA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AAc/B,IAAMC,eAAN,cAAmCC,YAAI,8BAAA,EAAA,EAAA;AAA8D;AAKrG,IAAMC,QACJC,uBAAgBH,cAAc,CAACI,MAAMA,EAAEF,KAAK;AAW9C,IAAMG,YAAY,CACvBC,KACAC,SAAAA;AAEA,SAAO;IACLD;IACAE,QAAQD,KAAKC;IACbC,aAAaF,KAAKE;EACpB;AACF;AAOO,IAAMC,QAAeC,cAAO;EACjCC,WAAkBC;EAClBC,MAAaC;EACbC,MAAaC;AACf,CAAA;AAMO,IAAMC,WAAW,CAAqBC,WAAyBC,UAAAA;AACpE,SAAOA,MAAMN,SAASK,UAAUb;AAClC;AAMO,IAAMe,OAAcV,cAAO;EAChCW,KAAYC,gBAAgBR,aAAM;EAClCS,WAAkBD,gBAAgBR,aAAM;EACxCU,aAAoBF,gBAAgBR,aAAM;;;;EAI1CW,gBAAuBH,gBAASI,IAAIC,EAAE;;;;EAKtCC,WAAkBN,gBAASI,IAAIC,EAAE;AACnC,CAAA;AAMO,IAAME,cAAqBnB,cAAO;EACvCoB,MAAMV;EAENZ,aAAoBuB;EACpBC,QAAeC,aAAMxB,KAAAA;AACvB,CAAA;AAGO,IAAMyB,UAAUL,YAAYM,KACjCC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,eAAeC,IAAI;EAC5BC,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAgBK,IAAMC,YAAN,cAAgC7C,YAAI,2BAAA,EAAA,EAAA;AAAiD;AAErF,IAAM8C,aAA0B;EACrC7C,OAAO,MAAA;EAAO;AAChB;AAEO,IAAM8C,kBAAmDC,cAAQjD,cAAc+C,UAAAA;AAE/E,IAAMG,YAA0CD,cAAQH,WAAW;EACxE5C,OAAO,MAAA;EAAO;AAChB,CAAA;AAEO,IAAMiD,eAA6CF,cAAQH,WAAW;EAC3E5C,OAAO,CAACkD,YAAAA;AACNC,YAAQC,IAAIF,OAAAA;EACd;AACF,CAAA;AAEO,IAAMG,mBAAmB,CAAChD,OAAwB,CAAC,MAClDiD,aACJxD,cACOyD,WAAI,aAAA;AACT,QAAMC,OAAO,OAAOZ;AACpB,SAAO;IACL5C,OAAO,CAACkB,OAAOJ,SAAAA;AACb0C,WAAKxD,MACHyB,IAAIgC,KAAKxB,SAAS;QAChBJ,MAAMxB,KAAKwB,QAAQ,CAAC;QACpBtB,aAAaW,MAAMX;QACnBwB,QAAQ;UAAC;YAAEnB,MAAMM,MAAMd;YAAKM,WAAWgD,KAAKC,IAAG;YAAI7C;UAAK;;MAC1D,CAAA,CAAA;IAEJ;EACF;AACF,CAAA,CAAA;AAeG,IAAM8C,iBAAiBzD,UAAU,mBAAmB;EACzDG,QAAeG,cAAO;;IAEpBL,KAAYS;;IAEZgD,MAAaxC,gBAAgBR,aAAM;EACrC,CAAA;EACAN,aAAa;AACf,CAAA;AAKO,IAAMuD,eAAe3D,UAAU,iBAAiB;EACrDG,QAAeG,cAAO;;IAEpBL,KAAYS;;IAEZgD,MAAaxC,gBAAgBR,aAAM;;IAEnCkD,SAAgBC,eAAQ,WAAW,SAAA;;IAEnCC,OAAc5C,gBAAgBR,aAAM;EACtC,CAAA;EACAN,aAAa;AACf,CAAA;",
6
- "names": ["Context", "Effect", "Layer", "Schema", "Annotation", "Obj", "Type", "TraceService", "Tag", "write", "serviceFunction", "_", "EventType", "key", "opts", "schema", "isEphemeral", "Event", "Struct", "timestamp", "Number", "type", "String", "data", "Unknown", "isOfType", "eventType", "event", "Meta", "pid", "optional", "parentPid", "processName", "conversationId", "Obj", "ID", "triggerId", "MessageData", "meta", "Boolean", "events", "Array", "Message", "pipe", "Type", "object", "typename", "version", "Annotation", "IconAnnotation", "set", "icon", "hue", "TraceSink", "noopWriter", "writerLayerNoop", "succeed", "layerNoop", "layerConsole", "message", "console", "log", "testTraceService", "effect", "gen", "sink", "make", "Date", "now", "OperationStart", "name", "OperationEnd", "outcome", "Literal", "error"]
7
- }
@@ -1,49 +0,0 @@
1
- // src/example/definitions.ts
2
- import * as Schema from "effect/Schema";
3
- import { Operation } from "@dxos/operation";
4
- var Fibonacci = Operation.make({
5
- meta: {
6
- key: "example.org/function/fib",
7
- name: "Fibonacci",
8
- description: "Function that calculates a Fibonacci number"
9
- },
10
- input: Schema.Struct({
11
- iterations: Schema.optional(Schema.Number).annotations({
12
- description: "Number of iterations",
13
- default: 1e5
14
- })
15
- }),
16
- output: Schema.Struct({
17
- result: Schema.String
18
- })
19
- });
20
- var Reply = Operation.make({
21
- meta: {
22
- key: "example.org/function/reply",
23
- name: "Reply",
24
- description: "Function that echoes the input"
25
- },
26
- input: Schema.Any,
27
- output: Schema.Any
28
- });
29
- var Sleep = Operation.make({
30
- meta: {
31
- key: "example.org/function/sleep",
32
- name: "Sleep",
33
- description: "Function that sleeps for a given amount of time"
34
- },
35
- input: Schema.Struct({
36
- duration: Schema.optional(Schema.Number).annotations({
37
- description: "Milliseconds to sleep",
38
- default: 1e5
39
- })
40
- }),
41
- output: Schema.Void
42
- });
43
-
44
- export {
45
- Fibonacci,
46
- Reply,
47
- Sleep
48
- };
49
- //# sourceMappingURL=chunk-IVDUS56O.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/example/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Operation } from '@dxos/operation';\n\nexport const Fibonacci = Operation.make({\n meta: {\n key: 'example.org/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: 'example.org/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: 'example.org/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,iBAAiB;AAEnB,IAAMC,YAAYC,UAAUC,KAAK;EACtCC,MAAM;IACJC,KAAK;IACLC,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,QAAQhB,UAAUC,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,MAAM;IACNC,aAAa;EACf;EACAC,OAAcW;EACdJ,QAAeI;AACjB,CAAA;AAEO,IAAMC,QAAQlB,UAAUC,KAAK;EAClCC,MAAM;IACJC,KAAK;IACLC,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", "Operation", "Fibonacci", "Operation", "make", "meta", "key", "name", "description", "input", "Struct", "iterations", "optional", "Number", "annotations", "default", "output", "result", "String", "Reply", "Any", "Sleep", "duration", "Void"]
7
- }
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
6
-
7
- export {
8
- __export
9
- };
10
- //# sourceMappingURL=chunk-J5LGTIGS.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,23 +0,0 @@
1
- import {
2
- Fibonacci
3
- } from "./chunk-IVDUS56O.mjs";
4
- import "./chunk-J5LGTIGS.mjs";
5
-
6
- // src/example/fib.ts
7
- import * as Effect from "effect/Effect";
8
- import { Operation } from "@dxos/operation";
9
- var fib_default = Fibonacci.pipe(Operation.withHandler(Effect.fn(function* ({ iterations = 1e5 }) {
10
- let a = 0n;
11
- let b = 1n;
12
- for (let i = 0; i < iterations; i++) {
13
- a += b;
14
- b = a - b;
15
- }
16
- return {
17
- result: a.toString()
18
- };
19
- })));
20
- export {
21
- fib_default as default
22
- };
23
- //# sourceMappingURL=fib-N45KAC7C.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/example/fib.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/operation';\n\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;AAExB,SAASC,iBAAiB;AAI1B,IAAA,cAAeC,UAAUC,KACvBC,UAAUC,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", "Operation", "Fibonacci", "pipe", "Operation", "withHandler", "fn", "iterations", "a", "b", "i", "result", "toString"]
7
- }
@@ -1,19 +0,0 @@
1
- import {
2
- Reply
3
- } from "./chunk-IVDUS56O.mjs";
4
- import "./chunk-J5LGTIGS.mjs";
5
-
6
- // src/example/reply.ts
7
- import * as Console from "effect/Console";
8
- import * as Effect from "effect/Effect";
9
- import { Operation } from "@dxos/operation";
10
- var reply_default = Reply.pipe(Operation.withHandler(Effect.fn(function* (input) {
11
- yield* Console.log("reply", {
12
- input
13
- });
14
- return input;
15
- })));
16
- export {
17
- reply_default as default
18
- };
19
- //# sourceMappingURL=reply-EUEPKNJF.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/example/reply.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/operation';\n\nimport { Reply } from './definitions';\n\nexport default Reply.pipe(\n Operation.withHandler(\n Effect.fn(function* (input) {\n yield* Console.log('reply', { input });\n return input;\n }),\n ),\n);\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAI1B,IAAA,gBAAeC,MAAMC,KACnBC,UAAUC,YACDC,UAAG,WAAWC,OAAK;AACxB,SAAeC,YAAI,SAAS;IAAED;EAAM,CAAA;AACpC,SAAOA;AACT,CAAA,CAAA,CAAA;",
6
- "names": ["Console", "Effect", "Operation", "Reply", "pipe", "Operation", "withHandler", "fn", "input", "log"]
7
- }
@@ -1,15 +0,0 @@
1
- import {
2
- Sleep
3
- } from "./chunk-IVDUS56O.mjs";
4
- import "./chunk-J5LGTIGS.mjs";
5
-
6
- // src/example/sleep.ts
7
- import * as Effect from "effect/Effect";
8
- import { Operation } from "@dxos/operation";
9
- var sleep_default = Sleep.pipe(Operation.withHandler(Effect.fn(function* ({ duration = 1e5 }) {
10
- yield* Effect.sleep(duration);
11
- })));
12
- export {
13
- sleep_default as default
14
- };
15
- //# sourceMappingURL=sleep-PUK3D4FF.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/example/sleep.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/operation';\n\nimport { Sleep } from './definitions';\n\nexport default Sleep.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ duration = 100_000 }) {\n yield* Effect.sleep(duration);\n }),\n ),\n);\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAI1B,IAAA,gBAAeC,MAAMC,KACnBC,UAAUC,YACDC,UAAG,WAAW,EAAEC,WAAW,IAAO,GAAE;AACzC,SAAcC,aAAMD,QAAAA;AACtB,CAAA,CAAA,CAAA;",
6
- "names": ["Effect", "Operation", "Sleep", "pipe", "Operation", "withHandler", "fn", "duration", "sleep"]
7
- }
@@ -1,155 +0,0 @@
1
- import * as Context from 'effect/Context';
2
- import * as Effect from 'effect/Effect';
3
- import * as Layer from 'effect/Layer';
4
- import * as Schema from 'effect/Schema';
5
- import { Type } from '@dxos/echo';
6
- /**
7
- * Writes ephemeral or persistent events to the trace.
8
- * Exposed to processes and operations to record events to the trace.
9
- */
10
- export interface TraceWriter {
11
- write<T>(eventType: EventType<T>, payload: NoInfer<T>): void;
12
- }
13
- declare const TraceService_base: Context.TagClass<TraceService, "@dxos/functions/TraceService", TraceWriter>;
14
- /**
15
- * Service that writes events to the trace.
16
- * Exposed to processes and operations to record events to the trace.
17
- */
18
- export declare class TraceService extends TraceService_base {
19
- }
20
- /**
21
- * Writes an event to the trace.
22
- */
23
- export declare const write: <T>(eventType: EventType<T>, payload: NoInfer<T>) => Effect.Effect<void, never, TraceService>;
24
- /**
25
- * Defines an event type for the trace.
26
- */
27
- export interface EventType<T> {
28
- readonly key: string;
29
- readonly schema: Schema.Schema<T, any>;
30
- readonly isEphemeral: boolean;
31
- }
32
- export declare const EventType: <T>(key: string, opts: {
33
- schema: Schema.Schema<T, any>;
34
- isEphemeral: boolean;
35
- }) => EventType<T>;
36
- /**
37
- * Extracts the payload type from an event type.
38
- */
39
- export type PayloadType<E extends EventType<any>> = E extends EventType<infer T> ? T : never;
40
- export declare const Event: Schema.Struct<{
41
- timestamp: typeof Schema.Number;
42
- type: typeof Schema.String;
43
- data: typeof Schema.Unknown;
44
- }>;
45
- export interface Event extends Schema.Schema.Type<typeof Event> {
46
- }
47
- /**
48
- * Checks if an event is of a given type.
49
- */
50
- export declare const isOfType: <T, E extends Event>(eventType: EventType<T>, event: E) => event is E & {
51
- data: T;
52
- };
53
- /**
54
- * Metadata on the context of a trace message.
55
- */
56
- export declare const Meta: Schema.Struct<{
57
- pid: Schema.optional<typeof Schema.String>;
58
- parentPid: Schema.optional<typeof Schema.String>;
59
- processName: Schema.optional<typeof Schema.String>;
60
- /**
61
- * ID of the conversation feed object if present.
62
- */
63
- conversationId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
64
- /**
65
- * ID of the trigger object if invocation resulted from a trigger.
66
- */
67
- triggerId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
68
- }>;
69
- export interface Meta extends Schema.Schema.Type<typeof Meta> {
70
- }
71
- /**
72
- * Envelope for a set of events.
73
- */
74
- export declare const MessageData: Schema.Struct<{
75
- meta: Schema.Struct<{
76
- pid: Schema.optional<typeof Schema.String>;
77
- parentPid: Schema.optional<typeof Schema.String>;
78
- processName: Schema.optional<typeof Schema.String>;
79
- /**
80
- * ID of the conversation feed object if present.
81
- */
82
- conversationId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
83
- /**
84
- * ID of the trigger object if invocation resulted from a trigger.
85
- */
86
- triggerId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
87
- }>;
88
- isEphemeral: typeof Schema.Boolean;
89
- events: Schema.Array$<Schema.Struct<{
90
- timestamp: typeof Schema.Number;
91
- type: typeof Schema.String;
92
- data: typeof Schema.Unknown;
93
- }>>;
94
- }>;
95
- export interface MessageData extends Schema.Schema.Type<typeof MessageData> {
96
- }
97
- export declare const Message: Type.Obj<{
98
- readonly meta: {
99
- readonly pid?: string | undefined;
100
- readonly parentPid?: string | undefined;
101
- readonly processName?: string | undefined;
102
- readonly conversationId?: string | undefined;
103
- readonly triggerId?: string | undefined;
104
- };
105
- readonly isEphemeral: boolean;
106
- readonly events: readonly {
107
- readonly timestamp: number;
108
- readonly type: string;
109
- readonly data: unknown;
110
- }[];
111
- }, Schema.Struct.Fields>;
112
- export interface Message extends Schema.Schema.Type<typeof Message> {
113
- }
114
- /**
115
- * Sink for complete trace messages.
116
- */
117
- export interface Sink {
118
- write(message: Message): void;
119
- }
120
- declare const TraceSink_base: Context.TagClass<TraceSink, "@dxos/functions/TraceSink", Sink>;
121
- /**
122
- * Sink for complete trace messages.
123
- * The Process Manager forwards trace messages to it.
124
- */
125
- export declare class TraceSink extends TraceSink_base {
126
- }
127
- export declare const noopWriter: TraceWriter;
128
- export declare const writerLayerNoop: Layer.Layer<TraceService>;
129
- export declare const layerNoop: Layer.Layer<TraceSink>;
130
- export declare const layerConsole: Layer.Layer<TraceSink>;
131
- export declare const testTraceService: (opts?: {
132
- meta?: Meta;
133
- }) => Layer.Layer<TraceService, never, TraceSink>;
134
- /**
135
- * Outcome of an operation invocation.
136
- */
137
- export type OperationOutcome = 'success' | 'failure';
138
- /**
139
- * Operation invocation started.
140
- */
141
- export declare const OperationStart: EventType<{
142
- readonly key: string;
143
- readonly name?: string | undefined;
144
- }>;
145
- /**
146
- * Operation invocation ended.
147
- */
148
- export declare const OperationEnd: EventType<{
149
- readonly key: string;
150
- readonly name?: string | undefined;
151
- readonly outcome: "success" | "failure";
152
- readonly error?: string | undefined;
153
- }>;
154
- export {};
155
- //# sourceMappingURL=Trace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Trace.d.ts","sourceRoot":"","sources":["../../../src/Trace.ts"],"names":[],"mappings":"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"}
@@ -1,121 +0,0 @@
1
- import { BaseError, type BaseErrorOptions } from '@dxos/errors';
2
- declare const ServiceNotAvailableError_base: {
3
- new (options?: BaseErrorOptions): {
4
- name: "ServiceNotAvailable";
5
- context: Record<string, unknown>;
6
- readonly message: string;
7
- readonly _tag: "ServiceNotAvailable";
8
- stack?: string;
9
- cause?: unknown;
10
- };
11
- name: "ServiceNotAvailable";
12
- is(error: unknown): error is BaseError;
13
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
14
- ifTypeDiffers?: boolean;
15
- }): (error: unknown) => {
16
- name: "ServiceNotAvailable";
17
- context: Record<string, unknown>;
18
- readonly message: string;
19
- readonly _tag: "ServiceNotAvailable";
20
- stack?: string;
21
- cause?: unknown;
22
- };
23
- extend<Name extends string = string>(name: Name, message?: string): any;
24
- isError(error: unknown): error is Error;
25
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
26
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
27
- stackTraceLimit: number;
28
- };
29
- export declare class ServiceNotAvailableError extends ServiceNotAvailableError_base {
30
- constructor(service: string, options?: Omit<BaseErrorOptions, 'context'>);
31
- }
32
- declare const FunctionNotFoundError_base: {
33
- new (options?: BaseErrorOptions): {
34
- name: "FunctionNotFound";
35
- context: Record<string, unknown>;
36
- readonly message: string;
37
- readonly _tag: "FunctionNotFound";
38
- stack?: string;
39
- cause?: unknown;
40
- };
41
- name: "FunctionNotFound";
42
- is(error: unknown): error is BaseError;
43
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
44
- ifTypeDiffers?: boolean;
45
- }): (error: unknown) => {
46
- name: "FunctionNotFound";
47
- context: Record<string, unknown>;
48
- readonly message: string;
49
- readonly _tag: "FunctionNotFound";
50
- stack?: string;
51
- cause?: unknown;
52
- };
53
- extend<Name extends string = string>(name: Name, message?: string): any;
54
- isError(error: unknown): error is Error;
55
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
56
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
57
- stackTraceLimit: number;
58
- };
59
- export declare class FunctionNotFoundError extends FunctionNotFoundError_base {
60
- constructor(functionKey: string, options?: Omit<BaseErrorOptions, 'context'>);
61
- }
62
- declare const FunctionError_base: {
63
- new (options?: BaseErrorOptions): {
64
- name: "FunctionError";
65
- context: Record<string, unknown>;
66
- readonly message: string;
67
- readonly _tag: "FunctionError";
68
- stack?: string;
69
- cause?: unknown;
70
- };
71
- name: "FunctionError";
72
- is(error: unknown): error is BaseError;
73
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
74
- ifTypeDiffers?: boolean;
75
- }): (error: unknown) => {
76
- name: "FunctionError";
77
- context: Record<string, unknown>;
78
- readonly message: string;
79
- readonly _tag: "FunctionError";
80
- stack?: string;
81
- cause?: unknown;
82
- };
83
- extend<Name extends string = string>(name: Name, message?: string): any;
84
- isError(error: unknown): error is Error;
85
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
86
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
87
- stackTraceLimit: number;
88
- };
89
- export declare class FunctionError extends FunctionError_base {
90
- }
91
- declare const TriggerStateNotFoundError_base: {
92
- new (options?: BaseErrorOptions): {
93
- name: "TriggerStateNotFound";
94
- context: Record<string, unknown>;
95
- readonly message: string;
96
- readonly _tag: "TriggerStateNotFound";
97
- stack?: string;
98
- cause?: unknown;
99
- };
100
- name: "TriggerStateNotFound";
101
- is(error: unknown): error is BaseError;
102
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
103
- ifTypeDiffers?: boolean;
104
- }): (error: unknown) => {
105
- name: "TriggerStateNotFound";
106
- context: Record<string, unknown>;
107
- readonly message: string;
108
- readonly _tag: "TriggerStateNotFound";
109
- stack?: string;
110
- cause?: unknown;
111
- };
112
- extend<Name extends string = string>(name: Name, message?: string): any;
113
- isError(error: unknown): error is Error;
114
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
115
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
116
- stackTraceLimit: number;
117
- };
118
- export declare class TriggerStateNotFoundError extends TriggerStateNotFoundError_base {
119
- }
120
- export {};
121
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;qBAiB8L,CAAC;;;;;;;;;;;;;;;AAf/P,qBAAa,wBAAyB,SAAQ,6BAAgE;gBAChG,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;CAGzE;;;;;;;;;;;;;qBAW6P,CAAC;;;;;;;;;;;;;;;AAT/P,qBAAa,qBAAsB,SAAQ,0BAA0D;gBACvF,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;CAG7E;;;;;;;;;;;;;qBAK6P,CAAC;;;;;;;;;;;;;;;AAH/P,qBAAa,aAAc,SAAQ,kBAA8D;CAAG;;;;;;;;;;;;;qBAG0J,CAAC;;;;;;;;;;;;;;;AAD/P,qBAAa,yBAA0B,SAAQ,8BAAmE;CAAG"}
@@ -1,11 +0,0 @@
1
- import { Operation } from '@dxos/operation';
2
- export declare const Fibonacci: Operation.Definition<{
3
- readonly iterations?: number | undefined;
4
- }, {
5
- readonly result: string;
6
- }, never>;
7
- export declare const Reply: Operation.Definition<any, any, never>;
8
- export declare const Sleep: Operation.Definition<{
9
- readonly duration?: number | undefined;
10
- }, void, never>;
11
- //# sourceMappingURL=definitions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../src/example/definitions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,SAAS;;;;SAepB,CAAC;AAEH,eAAO,MAAM,KAAK,uCAQhB,CAAC;AAEH,eAAO,MAAM,KAAK;;eAahB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Operation } from '@dxos/operation';
2
- declare const _default: Operation.WithHandler<Operation.Definition<{
3
- readonly iterations?: number | undefined;
4
- }, {
5
- readonly result: string;
6
- }, never>>;
7
- export default _default;
8
- //# sourceMappingURL=fib.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fib.d.ts","sourceRoot":"","sources":["../../../../src/example/fib.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;;;;;;AAI5C,wBAYE"}