@dxos/functions 0.8.1 → 0.8.2-main.2f9c567

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 (168) hide show
  1. package/dist/lib/browser/bundler/index.mjs +0 -3
  2. package/dist/lib/browser/bundler/index.mjs.map +1 -1
  3. package/dist/lib/browser/edge/index.mjs +63 -7
  4. package/dist/lib/browser/edge/index.mjs.map +4 -4
  5. package/dist/lib/browser/index.mjs +368 -98
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/node/bundler/index.cjs +0 -1
  9. package/dist/lib/node/bundler/index.cjs.map +1 -1
  10. package/dist/lib/node/edge/index.cjs +65 -5
  11. package/dist/lib/node/edge/index.cjs.map +4 -4
  12. package/dist/lib/node/index.cjs +383 -93
  13. package/dist/lib/node/index.cjs.map +4 -4
  14. package/dist/lib/node/meta.json +1 -1
  15. package/dist/lib/node-esm/bundler/index.mjs +0 -1
  16. package/dist/lib/node-esm/bundler/index.mjs.map +1 -1
  17. package/dist/lib/node-esm/edge/index.mjs +64 -6
  18. package/dist/lib/node-esm/edge/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/index.mjs +368 -96
  20. package/dist/lib/node-esm/index.mjs.map +4 -4
  21. package/dist/lib/node-esm/meta.json +1 -1
  22. package/dist/types/src/edge/index.d.ts.map +1 -1
  23. package/dist/types/src/handler.d.ts +15 -63
  24. package/dist/types/src/handler.d.ts.map +1 -1
  25. package/dist/types/src/index.d.ts +3 -3
  26. package/dist/types/src/index.d.ts.map +1 -1
  27. package/dist/types/src/schema.d.ts +57 -0
  28. package/dist/types/src/schema.d.ts.map +1 -0
  29. package/dist/types/src/trace.d.ts +148 -0
  30. package/dist/types/src/trace.d.ts.map +1 -0
  31. package/dist/types/src/{types/types.d.ts → types.d.ts} +191 -49
  32. package/dist/types/src/types.d.ts.map +1 -0
  33. package/dist/types/src/{types/url.d.ts → url.d.ts} +6 -0
  34. package/dist/types/src/url.d.ts.map +1 -0
  35. package/package.json +20 -35
  36. package/src/edge/index.ts +4 -0
  37. package/src/handler.ts +17 -120
  38. package/src/index.ts +4 -5
  39. package/src/schema.ts +53 -0
  40. package/src/{types/trace.ts → trace.ts} +33 -31
  41. package/src/translations.ts +1 -1
  42. package/src/types.ts +214 -0
  43. package/src/{types/url.ts → url.ts} +5 -0
  44. package/dist/lib/browser/chunk-HI7YZO2K.mjs +0 -482
  45. package/dist/lib/browser/chunk-HI7YZO2K.mjs.map +0 -7
  46. package/dist/lib/browser/chunk-LT4LR4VU.mjs +0 -72
  47. package/dist/lib/browser/chunk-LT4LR4VU.mjs.map +0 -7
  48. package/dist/lib/browser/chunk-RVSG6WTL.mjs +0 -358
  49. package/dist/lib/browser/chunk-RVSG6WTL.mjs.map +0 -7
  50. package/dist/lib/browser/chunk-XRCXIG74.mjs +0 -12
  51. package/dist/lib/browser/chunk-XRCXIG74.mjs.map +0 -7
  52. package/dist/lib/browser/testing/index.mjs +0 -670
  53. package/dist/lib/browser/testing/index.mjs.map +0 -7
  54. package/dist/lib/browser/types/index.mjs +0 -49
  55. package/dist/lib/browser/types/index.mjs.map +0 -7
  56. package/dist/lib/node/chunk-DSUGRAAL.cjs +0 -392
  57. package/dist/lib/node/chunk-DSUGRAAL.cjs.map +0 -7
  58. package/dist/lib/node/chunk-JEQ2X3Z6.cjs +0 -34
  59. package/dist/lib/node/chunk-JEQ2X3Z6.cjs.map +0 -7
  60. package/dist/lib/node/chunk-NXZNXVT3.cjs +0 -94
  61. package/dist/lib/node/chunk-NXZNXVT3.cjs.map +0 -7
  62. package/dist/lib/node/chunk-RXMCVAMJ.cjs +0 -496
  63. package/dist/lib/node/chunk-RXMCVAMJ.cjs.map +0 -7
  64. package/dist/lib/node/testing/index.cjs +0 -687
  65. package/dist/lib/node/testing/index.cjs.map +0 -7
  66. package/dist/lib/node/types/index.cjs +0 -70
  67. package/dist/lib/node/types/index.cjs.map +0 -7
  68. package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs +0 -12
  69. package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map +0 -7
  70. package/dist/lib/node-esm/chunk-HBD2FZXO.mjs +0 -358
  71. package/dist/lib/node-esm/chunk-HBD2FZXO.mjs.map +0 -7
  72. package/dist/lib/node-esm/chunk-O2SXVYU5.mjs +0 -72
  73. package/dist/lib/node-esm/chunk-O2SXVYU5.mjs.map +0 -7
  74. package/dist/lib/node-esm/chunk-SQSJO5HI.mjs +0 -482
  75. package/dist/lib/node-esm/chunk-SQSJO5HI.mjs.map +0 -7
  76. package/dist/lib/node-esm/testing/index.mjs +0 -670
  77. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  78. package/dist/lib/node-esm/types/index.mjs +0 -49
  79. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  80. package/dist/types/src/browser/index.d.ts +0 -2
  81. package/dist/types/src/browser/index.d.ts.map +0 -1
  82. package/dist/types/src/function/function-registry.d.ts +0 -25
  83. package/dist/types/src/function/function-registry.d.ts.map +0 -1
  84. package/dist/types/src/function/function-registry.test.d.ts +0 -2
  85. package/dist/types/src/function/function-registry.test.d.ts.map +0 -1
  86. package/dist/types/src/function/index.d.ts +0 -2
  87. package/dist/types/src/function/index.d.ts.map +0 -1
  88. package/dist/types/src/runtime/dev-server.d.ts +0 -52
  89. package/dist/types/src/runtime/dev-server.d.ts.map +0 -1
  90. package/dist/types/src/runtime/dev-server.test.d.ts +0 -2
  91. package/dist/types/src/runtime/dev-server.test.d.ts.map +0 -1
  92. package/dist/types/src/runtime/index.d.ts +0 -3
  93. package/dist/types/src/runtime/index.d.ts.map +0 -1
  94. package/dist/types/src/runtime/scheduler.d.ts +0 -34
  95. package/dist/types/src/runtime/scheduler.d.ts.map +0 -1
  96. package/dist/types/src/runtime/scheduler.test.d.ts +0 -2
  97. package/dist/types/src/runtime/scheduler.test.d.ts.map +0 -1
  98. package/dist/types/src/testing/functions-integration.test.d.ts +0 -2
  99. package/dist/types/src/testing/functions-integration.test.d.ts.map +0 -1
  100. package/dist/types/src/testing/index.d.ts +0 -5
  101. package/dist/types/src/testing/index.d.ts.map +0 -1
  102. package/dist/types/src/testing/manifest.d.ts +0 -3
  103. package/dist/types/src/testing/manifest.d.ts.map +0 -1
  104. package/dist/types/src/testing/plugin-init.d.ts +0 -6
  105. package/dist/types/src/testing/plugin-init.d.ts.map +0 -1
  106. package/dist/types/src/testing/setup.d.ts +0 -15
  107. package/dist/types/src/testing/setup.d.ts.map +0 -1
  108. package/dist/types/src/testing/test/handler.d.ts +0 -4
  109. package/dist/types/src/testing/test/handler.d.ts.map +0 -1
  110. package/dist/types/src/testing/test/index.d.ts +0 -3
  111. package/dist/types/src/testing/test/index.d.ts.map +0 -1
  112. package/dist/types/src/testing/types.d.ts +0 -10
  113. package/dist/types/src/testing/types.d.ts.map +0 -1
  114. package/dist/types/src/testing/util.d.ts +0 -5
  115. package/dist/types/src/testing/util.d.ts.map +0 -1
  116. package/dist/types/src/trigger/index.d.ts +0 -3
  117. package/dist/types/src/trigger/index.d.ts.map +0 -1
  118. package/dist/types/src/trigger/trigger-registry.d.ts +0 -38
  119. package/dist/types/src/trigger/trigger-registry.d.ts.map +0 -1
  120. package/dist/types/src/trigger/trigger-registry.test.d.ts +0 -2
  121. package/dist/types/src/trigger/trigger-registry.test.d.ts.map +0 -1
  122. package/dist/types/src/trigger/type/index.d.ts +0 -3
  123. package/dist/types/src/trigger/type/index.d.ts.map +0 -1
  124. package/dist/types/src/trigger/type/subscription-trigger.d.ts +0 -4
  125. package/dist/types/src/trigger/type/subscription-trigger.d.ts.map +0 -1
  126. package/dist/types/src/trigger/type/timer-trigger.d.ts +0 -4
  127. package/dist/types/src/trigger/type/timer-trigger.d.ts.map +0 -1
  128. package/dist/types/src/trigger/type/webhook-trigger.d.ts +0 -4
  129. package/dist/types/src/trigger/type/webhook-trigger.d.ts.map +0 -1
  130. package/dist/types/src/types/index.d.ts +0 -5
  131. package/dist/types/src/types/index.d.ts.map +0 -1
  132. package/dist/types/src/types/schema.d.ts +0 -53
  133. package/dist/types/src/types/schema.d.ts.map +0 -1
  134. package/dist/types/src/types/trace.d.ts +0 -146
  135. package/dist/types/src/types/trace.d.ts.map +0 -1
  136. package/dist/types/src/types/types.d.ts.map +0 -1
  137. package/dist/types/src/types/url.d.ts.map +0 -1
  138. package/dist/types/tools/schema.d.ts +0 -2
  139. package/dist/types/tools/schema.d.ts.map +0 -1
  140. package/schema/functions.json +0 -211
  141. package/src/browser/index.ts +0 -5
  142. package/src/function/function-registry.test.ts +0 -118
  143. package/src/function/function-registry.ts +0 -104
  144. package/src/function/index.ts +0 -5
  145. package/src/runtime/dev-server.test.ts +0 -79
  146. package/src/runtime/dev-server.ts +0 -240
  147. package/src/runtime/index.ts +0 -6
  148. package/src/runtime/scheduler.test.ts +0 -152
  149. package/src/runtime/scheduler.ts +0 -170
  150. package/src/testing/functions-integration.test.ts +0 -65
  151. package/src/testing/index.ts +0 -8
  152. package/src/testing/manifest.ts +0 -15
  153. package/src/testing/plugin-init.ts +0 -20
  154. package/src/testing/setup.ts +0 -109
  155. package/src/testing/test/handler.ts +0 -15
  156. package/src/testing/test/index.ts +0 -7
  157. package/src/testing/types.ts +0 -9
  158. package/src/testing/util.ts +0 -26
  159. package/src/trigger/index.ts +0 -6
  160. package/src/trigger/trigger-registry.test.ts +0 -278
  161. package/src/trigger/trigger-registry.ts +0 -218
  162. package/src/trigger/type/index.ts +0 -7
  163. package/src/trigger/type/subscription-trigger.ts +0 -84
  164. package/src/trigger/type/timer-trigger.ts +0 -48
  165. package/src/trigger/type/webhook-trigger.ts +0 -48
  166. package/src/types/index.ts +0 -8
  167. package/src/types/schema.ts +0 -46
  168. package/src/types/types.ts +0 -163
@@ -1,4 +1,6 @@
1
- import { S } from '@dxos/echo-schema';
1
+ import { Schema as S } from 'effect';
2
+ import { Expando, Ref } from '@dxos/echo-schema';
3
+ import { FunctionType } from './schema';
2
4
  /**
3
5
  * Type discriminator for TriggerType.
4
6
  * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.
@@ -79,11 +81,53 @@ export declare const TriggerSchema: S.Union<[S.mutable<S.Struct<{
79
81
  queue: S.refine<string, typeof S.NonEmptyString>;
80
82
  }>>]>;
81
83
  export type TriggerType = S.Schema.Type<typeof TriggerSchema>;
84
+ export type EventType = EmailTriggerOutput | WebhookTriggerOutput | QueueTriggerOutput | SubscriptionTriggerOutput | TimerTriggerOutput;
85
+ export declare const EmailTriggerOutput: S.mutable<S.Struct<{
86
+ from: typeof S.String;
87
+ to: typeof S.String;
88
+ subject: typeof S.String;
89
+ created: typeof S.String;
90
+ body: typeof S.String;
91
+ }>>;
92
+ export type EmailTriggerOutput = S.Schema.Type<typeof EmailTriggerOutput>;
93
+ export declare const WebhookTriggerOutput: S.mutable<S.Struct<{
94
+ url: typeof S.String;
95
+ method: S.Literal<["GET", "POST"]>;
96
+ headers: S.Record$<typeof S.String, typeof S.String>;
97
+ bodyText: typeof S.String;
98
+ }>>;
99
+ export type WebhookTriggerOutput = S.Schema.Type<typeof WebhookTriggerOutput>;
100
+ export declare const QueueTriggerOutput: S.mutable<S.Struct<{
101
+ queue: S.refine<string, typeof S.NonEmptyString>;
102
+ item: typeof S.Any;
103
+ cursor: typeof S.String;
104
+ }>>;
105
+ export type QueueTriggerOutput = S.Schema.Type<typeof QueueTriggerOutput>;
106
+ export declare const SubscriptionTriggerOutput: S.mutable<S.Struct<{
107
+ type: typeof S.String;
108
+ changedObjectId: typeof S.String;
109
+ }>>;
110
+ export type SubscriptionTriggerOutput = S.Schema.Type<typeof SubscriptionTriggerOutput>;
111
+ export declare const TimerTriggerOutput: S.mutable<S.Struct<{
112
+ tick: typeof S.Number;
113
+ }>>;
114
+ export type TimerTriggerOutput = S.Schema.Type<typeof TimerTriggerOutput>;
82
115
  /**
83
116
  * Function trigger.
117
+ * Function is invoked with the `payload` passed as input data.
118
+ * The event that triggers the function is available in the function context.
84
119
  */
85
120
  export declare const FunctionTriggerSchema: S.Struct<{
86
- function: S.optional<S.SchemaClass<string, string, never>>;
121
+ /**
122
+ * Function or workflow to invoke.
123
+ */
124
+ function: S.optional<S.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
125
+ /**
126
+ * Only used for workflows.
127
+ * Specifies the input node in the circuit.
128
+ * @deprecated Remove and enforce a single input node in all compute graphs.
129
+ */
130
+ inputNodeId: S.optional<S.SchemaClass<string, string, never>>;
87
131
  enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
88
132
  spec: S.optional<S.Union<[S.mutable<S.Struct<{
89
133
  type: S.Literal<[TriggerKind.Timer]>;
@@ -108,13 +152,33 @@ export declare const FunctionTriggerSchema: S.Struct<{
108
152
  type: S.Literal<[TriggerKind.Queue]>;
109
153
  queue: S.refine<string, typeof S.NonEmptyString>;
110
154
  }>>]>>;
111
- meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
155
+ /**
156
+ * Passed as the input data to the function.
157
+ * Must match the function's input schema.
158
+ *
159
+ * @example
160
+ * {
161
+ * item: '{{$.trigger.event}}',
162
+ * instructions: 'Summarize and perform entity-extraction'
163
+ * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
164
+ * }
165
+ */
166
+ input: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
112
167
  }>;
113
168
  export type FunctionTriggerType = S.Schema.Type<typeof FunctionTriggerSchema>;
114
- declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
115
- readonly function: S.optional<S.SchemaClass<string, string, never>>;
116
- readonly enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
117
- readonly spec: S.optional<S.Union<[S.mutable<S.Struct<{
169
+ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<Readonly<{
170
+ /**
171
+ * Function or workflow to invoke.
172
+ */
173
+ function: S.optional<S.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
174
+ /**
175
+ * Only used for workflows.
176
+ * Specifies the input node in the circuit.
177
+ * @deprecated Remove and enforce a single input node in all compute graphs.
178
+ */
179
+ inputNodeId: S.optional<S.SchemaClass<string, string, never>>;
180
+ enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
181
+ spec: S.optional<S.Union<[S.mutable<S.Struct<{
118
182
  type: S.Literal<[TriggerKind.Timer]>;
119
183
  cron: S.SchemaClass<string, string, never>;
120
184
  }>>, S.mutable<S.Struct<{
@@ -137,11 +201,31 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectProto
137
201
  type: S.Literal<[TriggerKind.Queue]>;
138
202
  queue: S.refine<string, typeof S.NonEmptyString>;
139
203
  }>>]>>;
140
- readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
141
- }, import("@dxos/echo-schema").TypedObjectOptions>, S.Struct.Encoded<{
142
- readonly function: S.optional<S.SchemaClass<string, string, never>>;
143
- readonly enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
144
- readonly spec: S.optional<S.Union<[S.mutable<S.Struct<{
204
+ /**
205
+ * Passed as the input data to the function.
206
+ * Must match the function's input schema.
207
+ *
208
+ * @example
209
+ * {
210
+ * item: '{{$.trigger.event}}',
211
+ * instructions: 'Summarize and perform entity-extraction'
212
+ * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
213
+ * }
214
+ */
215
+ input: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
216
+ }>, import("@dxos/echo-schema").TypedObjectOptions>, S.Struct.Encoded<Readonly<{
217
+ /**
218
+ * Function or workflow to invoke.
219
+ */
220
+ function: S.optional<S.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
221
+ /**
222
+ * Only used for workflows.
223
+ * Specifies the input node in the circuit.
224
+ * @deprecated Remove and enforce a single input node in all compute graphs.
225
+ */
226
+ inputNodeId: S.optional<S.SchemaClass<string, string, never>>;
227
+ enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
228
+ spec: S.optional<S.Union<[S.mutable<S.Struct<{
145
229
  type: S.Literal<[TriggerKind.Timer]>;
146
230
  cron: S.SchemaClass<string, string, never>;
147
231
  }>>, S.mutable<S.Struct<{
@@ -164,49 +248,76 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectProto
164
248
  type: S.Literal<[TriggerKind.Queue]>;
165
249
  queue: S.refine<string, typeof S.NonEmptyString>;
166
250
  }>>]>>;
167
- readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
168
- }>>;
251
+ /**
252
+ * Passed as the input data to the function.
253
+ * Must match the function's input schema.
254
+ *
255
+ * @example
256
+ * {
257
+ * item: '{{$.trigger.event}}',
258
+ * instructions: 'Summarize and perform entity-extraction'
259
+ * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
260
+ * }
261
+ */
262
+ input: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
263
+ }>>>;
169
264
  /**
170
265
  * Function trigger.
171
266
  */
172
267
  export declare class FunctionTrigger extends FunctionTrigger_base {
173
268
  }
174
- declare const FunctionDef_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
175
- uri: typeof S.String;
176
- description: S.optional<typeof S.String>;
177
- route: typeof S.String;
178
- handler: typeof S.String;
179
- }, import("@dxos/echo-schema").TypedObjectOptions>, S.Struct.Encoded<{
180
- uri: typeof S.String;
181
- description: S.optional<typeof S.String>;
182
- route: typeof S.String;
183
- handler: typeof S.String;
184
- }>>;
185
- /**
186
- * Function definition.
187
- * @deprecated (Use dxos.org/type/Function)
188
- */
189
- export declare class FunctionDef extends FunctionDef_base {
190
- }
191
269
  /**
192
270
  * Function manifest file.
193
271
  */
194
272
  export declare const FunctionManifestSchema: S.Struct<{
195
273
  functions: S.optional<S.mutable<S.Array$<S.Schema<import("@dxos/echo-schema").ExcludeId<import("@dxos/echo-schema").TypedObjectFields<{
196
- uri: typeof S.String;
274
+ name: typeof S.NonEmptyString;
275
+ version: typeof S.String;
197
276
  description: S.optional<typeof S.String>;
198
- route: typeof S.String;
199
- handler: typeof S.String;
277
+ source: S.optional<import("@dxos/echo-schema").Ref$<{
278
+ readonly id: string;
279
+ name?: string | undefined;
280
+ description?: string | undefined;
281
+ changed?: boolean | undefined;
282
+ source: Ref<{
283
+ readonly id: string;
284
+ content: string;
285
+ }>;
286
+ }>>;
287
+ inputSchema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
288
+ outputSchema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
289
+ binding: S.optional<typeof S.String>;
200
290
  }, import("@dxos/echo-schema").TypedObjectOptions>> & import("@dxos/echo-schema").WithMeta, S.Struct.Encoded<{
201
- uri: typeof S.String;
291
+ name: typeof S.NonEmptyString;
292
+ version: typeof S.String;
202
293
  description: S.optional<typeof S.String>;
203
- route: typeof S.String;
204
- handler: typeof S.String;
294
+ source: S.optional<import("@dxos/echo-schema").Ref$<{
295
+ readonly id: string;
296
+ name?: string | undefined;
297
+ description?: string | undefined;
298
+ changed?: boolean | undefined;
299
+ source: Ref<{
300
+ readonly id: string;
301
+ content: string;
302
+ }>;
303
+ }>>;
304
+ inputSchema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
305
+ outputSchema: S.optional<S.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
306
+ binding: S.optional<typeof S.String>;
205
307
  }>, never>>>>;
206
- triggers: S.optional<S.mutable<S.Array$<S.Schema<import("@dxos/echo-schema").ExcludeId<import("@dxos/echo-schema").TypedObjectFields<{
207
- readonly function: S.optional<S.SchemaClass<string, string, never>>;
208
- readonly enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
209
- readonly spec: S.optional<S.Union<[S.mutable<S.Struct<{
308
+ triggers: S.optional<S.mutable<S.Array$<S.Schema<import("@dxos/echo-schema").ExcludeId<import("@dxos/echo-schema").TypedObjectFields<Readonly<{
309
+ /**
310
+ * Function or workflow to invoke.
311
+ */
312
+ function: S.optional<S.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
313
+ /**
314
+ * Only used for workflows.
315
+ * Specifies the input node in the circuit.
316
+ * @deprecated Remove and enforce a single input node in all compute graphs.
317
+ */
318
+ inputNodeId: S.optional<S.SchemaClass<string, string, never>>;
319
+ enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
320
+ spec: S.optional<S.Union<[S.mutable<S.Struct<{
210
321
  type: S.Literal<[TriggerKind.Timer]>;
211
322
  cron: S.SchemaClass<string, string, never>;
212
323
  }>>, S.mutable<S.Struct<{
@@ -229,11 +340,31 @@ export declare const FunctionManifestSchema: S.Struct<{
229
340
  type: S.Literal<[TriggerKind.Queue]>;
230
341
  queue: S.refine<string, typeof S.NonEmptyString>;
231
342
  }>>]>>;
232
- readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
233
- }, import("@dxos/echo-schema").TypedObjectOptions>> & import("@dxos/echo-schema").WithMeta, S.Struct.Encoded<{
234
- readonly function: S.optional<S.SchemaClass<string, string, never>>;
235
- readonly enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
236
- readonly spec: S.optional<S.Union<[S.mutable<S.Struct<{
343
+ /**
344
+ * Passed as the input data to the function.
345
+ * Must match the function's input schema.
346
+ *
347
+ * @example
348
+ * {
349
+ * item: '{{$.trigger.event}}',
350
+ * instructions: 'Summarize and perform entity-extraction'
351
+ * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
352
+ * }
353
+ */
354
+ input: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
355
+ }>, import("@dxos/echo-schema").TypedObjectOptions>> & import("@dxos/echo-schema").WithMeta, S.Struct.Encoded<Readonly<{
356
+ /**
357
+ * Function or workflow to invoke.
358
+ */
359
+ function: S.optional<S.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
360
+ /**
361
+ * Only used for workflows.
362
+ * Specifies the input node in the circuit.
363
+ * @deprecated Remove and enforce a single input node in all compute graphs.
364
+ */
365
+ inputNodeId: S.optional<S.SchemaClass<string, string, never>>;
366
+ enabled: S.optional<S.SchemaClass<boolean, boolean, never>>;
367
+ spec: S.optional<S.Union<[S.mutable<S.Struct<{
237
368
  type: S.Literal<[TriggerKind.Timer]>;
238
369
  cron: S.SchemaClass<string, string, never>;
239
370
  }>>, S.mutable<S.Struct<{
@@ -256,10 +387,21 @@ export declare const FunctionManifestSchema: S.Struct<{
256
387
  type: S.Literal<[TriggerKind.Queue]>;
257
388
  queue: S.refine<string, typeof S.NonEmptyString>;
258
389
  }>>]>>;
259
- readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
260
- }>, never>>>>;
390
+ /**
391
+ * Passed as the input data to the function.
392
+ * Must match the function's input schema.
393
+ *
394
+ * @example
395
+ * {
396
+ * item: '{{$.trigger.event}}',
397
+ * instructions: 'Summarize and perform entity-extraction'
398
+ * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
399
+ * }
400
+ */
401
+ input: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
402
+ }>>, never>>>>;
261
403
  }>;
262
404
  export type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;
263
- export declare const FUNCTION_TYPES: (typeof FunctionTrigger | typeof FunctionDef)[];
405
+ export declare const FUNCTION_TYPES: (typeof FunctionType | typeof FunctionTrigger)[];
264
406
  export {};
265
407
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"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"}
@@ -3,6 +3,12 @@ import { type SpaceId } from '@dxos/keys';
3
3
  export declare const FUNCTIONS_PRESET_META_KEY = "dxos.org/service/function-preset";
4
4
  export declare const getUserFunctionUrlInMetadata: (meta: ObjectMeta) => string | undefined;
5
5
  export declare const setUserFunctionUrlInMetadata: (meta: ObjectMeta, functionUrl: string) => void;
6
+ /**
7
+ * NOTE: functionId is backend ID, not ECHO object id.
8
+ */
9
+ export declare const makeFunctionUrl: (spaceId: SpaceId, fn: {
10
+ functionId: string;
11
+ }) => string;
6
12
  export declare const getInvocationUrl: (functionUrl: string, edgeUrl: string, options?: InvocationOptions) => string;
7
13
  export type InvocationOptions = {
8
14
  spaceId?: SpaceId;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/url.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAK1C,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAM5E,eAAO,MAAM,4BAA4B,SAAU,UAAU,uBAE5D,CAAC;AAEF,eAAO,MAAM,4BAA4B,SAAU,UAAU,eAAe,MAAM,SASjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,YAAa,OAAO,MAAM;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,WAAmC,CAAC;AAEhH,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,WAAW,MAAM,YAAW,iBAAiB,WAUhG,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/functions",
3
- "version": "0.8.1",
3
+ "version": "0.8.2-main.2f9c567",
4
4
  "description": "Functions API and runtime.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -23,16 +23,6 @@
23
23
  "types": "./dist/types/src/edge/index.d.ts",
24
24
  "browser": "./dist/lib/browser/edge/index.mjs",
25
25
  "node": "./dist/lib/node-esm/edge/index.mjs"
26
- },
27
- "./testing": {
28
- "types": "./dist/types/src/testing/index.d.ts",
29
- "browser": "./dist/lib/browser/testing/index.mjs",
30
- "node": "./dist/lib/node-esm/testing/index.mjs"
31
- },
32
- "./types": {
33
- "types": "./dist/types/src/types/index.d.ts",
34
- "browser": "./dist/lib/browser/types/index.mjs",
35
- "node": "./dist/lib/node-esm/types/index.mjs"
36
26
  }
37
27
  },
38
28
  "types": "dist/types/src/index.d.ts",
@@ -43,12 +33,6 @@
43
33
  ],
44
34
  "edge": [
45
35
  "dist/types/src/edge/index.d.ts"
46
- ],
47
- "testing": [
48
- "dist/types/src/testing/index.d.ts"
49
- ],
50
- "types": [
51
- "dist/types/src/types/index.d.ts"
52
36
  ]
53
37
  }
54
38
  },
@@ -61,33 +45,34 @@
61
45
  "@preact/signals-core": "^1.6.0",
62
46
  "cron": "^3.1.6",
63
47
  "cron-schedule": "^5.0.4",
64
- "effect": "3.13.3",
48
+ "effect": "3.14.21",
65
49
  "esbuild-wasm": "^0.16.14",
66
50
  "express": "^4.19.2",
67
51
  "get-port-please": "^3.1.1",
68
52
  "iso-did": "^1.6.0",
69
53
  "ws": "^8.14.2",
70
- "@dxos/async": "0.8.1",
71
- "@dxos/client": "0.8.1",
72
- "@dxos/context": "0.8.1",
73
- "@dxos/crypto": "0.8.1",
74
- "@dxos/echo-db": "0.8.1",
75
- "@dxos/echo-protocol": "0.8.1",
76
- "@dxos/echo-schema": "0.8.1",
77
- "@dxos/edge-client": "0.8.1",
78
- "@dxos/invariant": "0.8.1",
79
- "@dxos/live-object": "0.8.1",
80
- "@dxos/keys": "0.8.1",
81
- "@dxos/log": "0.8.1",
82
- "@dxos/node-std": "0.8.1",
83
- "@dxos/protocols": "0.8.1",
84
- "@dxos/schema": "0.8.1",
85
- "@dxos/util": "0.8.1"
54
+ "@dxos/assistant": "0.8.2-main.2f9c567",
55
+ "@dxos/async": "0.8.2-main.2f9c567",
56
+ "@dxos/client": "0.8.2-main.2f9c567",
57
+ "@dxos/context": "0.8.2-main.2f9c567",
58
+ "@dxos/echo-db": "0.8.2-main.2f9c567",
59
+ "@dxos/echo-schema": "0.8.2-main.2f9c567",
60
+ "@dxos/echo-protocol": "0.8.2-main.2f9c567",
61
+ "@dxos/edge-client": "0.8.2-main.2f9c567",
62
+ "@dxos/crypto": "0.8.2-main.2f9c567",
63
+ "@dxos/invariant": "0.8.2-main.2f9c567",
64
+ "@dxos/keys": "0.8.2-main.2f9c567",
65
+ "@dxos/log": "0.8.2-main.2f9c567",
66
+ "@dxos/node-std": "0.8.2-main.2f9c567",
67
+ "@dxos/live-object": "0.8.2-main.2f9c567",
68
+ "@dxos/protocols": "0.8.2-main.2f9c567",
69
+ "@dxos/schema": "0.8.2-main.2f9c567",
70
+ "@dxos/util": "0.8.2-main.2f9c567"
86
71
  },
87
72
  "devDependencies": {
88
73
  "@types/express": "^4.17.17",
89
74
  "@types/ws": "^7.4.0",
90
- "@dxos/agent": "0.8.1"
75
+ "@dxos/agent": "0.8.2-main.2f9c567"
91
76
  },
92
77
  "publishConfig": {
93
78
  "access": "public"
package/src/edge/index.ts CHANGED
@@ -2,4 +2,8 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ // NOTE: This module is separate because it uses the edge client.
6
+ // This means it cannot be used on edge itself.
7
+ // TODO(wittjosiah): Factor out.
8
+
5
9
  export * from './functions';
package/src/handler.ts CHANGED
@@ -5,14 +5,11 @@
5
5
  import { Schema as S } from 'effect';
6
6
  import { type Effect } from 'effect';
7
7
 
8
- import { type Client, PublicKey } from '@dxos/client';
9
- import { type Space, type SpaceId } from '@dxos/client/echo';
10
- import type { CoreDatabase, EchoDatabase, ReactiveEchoObject } from '@dxos/echo-db';
8
+ import { type AIServiceClient } from '@dxos/assistant';
9
+ import type { CoreDatabase, EchoDatabase } from '@dxos/echo-db';
11
10
  import { type HasId } from '@dxos/echo-schema';
12
- import { type DXN } from '@dxos/keys';
13
- import { log } from '@dxos/log';
11
+ import { type SpaceId, type DXN } from '@dxos/keys';
14
12
  import { type QueryResult } from '@dxos/protocols';
15
- import { isNonNullable } from '@dxos/util';
16
13
 
17
14
  // TODO(burdon): Model after http request. Ref Lambda/OpenFaaS.
18
15
  // https://docs.aws.amazon.com/lambda/latest/dg/typescript-handler.html
@@ -22,13 +19,18 @@ import { isNonNullable } from '@dxos/util';
22
19
  /**
23
20
  * Function handler.
24
21
  */
25
- export type FunctionHandler<TData = {}, TMeta = {}, TOutput = any> = (params: {
22
+ export type FunctionHandler<TData = {}, TOutput = any> = (params: {
23
+ /**
24
+ * Services and context available to the function.
25
+ */
26
26
  context: FunctionContext;
27
- event: FunctionEvent<TData, TMeta>;
27
+
28
28
  /**
29
- * @deprecated
29
+ * Data passed as the input to the function.
30
+ * Must match the function's input schema.
31
+ * This will be the payload from the trigger or other data passed into the function in a workflow.
30
32
  */
31
- response: FunctionResponse;
33
+ data: TData;
32
34
  }) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any>;
33
35
 
34
36
  /**
@@ -42,18 +44,7 @@ export interface FunctionContext {
42
44
  */
43
45
  space: SpaceAPI | undefined;
44
46
 
45
- ai: FunctionContextAi;
46
-
47
- /**
48
- * @deprecated
49
- */
50
- // TODO(burdon): Limit access to individual space.
51
- client: Client;
52
- /**
53
- * @deprecated
54
- */
55
- // TODO(burdon): Replace with storage service abstraction.
56
- dataDir?: string;
47
+ ai: AIServiceClient;
57
48
  }
58
49
 
59
50
  export interface FunctionContextAi {
@@ -61,28 +52,6 @@ export interface FunctionContextAi {
61
52
  run(model: string, inputs: any, options?: any): Promise<any>;
62
53
  }
63
54
 
64
- /**
65
- * Event payload.
66
- */
67
- // TODO(dmaretskyi): Update type definitions to match the actual payload.
68
- export type FunctionEvent<TData = {}, TMeta = {}> = {
69
- data: FunctionEventMeta<TMeta> & TData;
70
- };
71
-
72
- /**
73
- * Metadata from trigger.
74
- */
75
- export type FunctionEventMeta<TMeta = {}> = {
76
- meta: TMeta;
77
- };
78
-
79
- /**
80
- * Function response.
81
- */
82
- export type FunctionResponse = {
83
- status(code: number): FunctionResponse;
84
- };
85
-
86
55
  //
87
56
  // API.
88
57
  //
@@ -108,27 +77,19 @@ export interface SpaceAPI {
108
77
  get queues(): QueuesAPI;
109
78
  }
110
79
 
111
- // TODO(wittjosiah): Fix this.
112
80
  const __assertFunctionSpaceIsCompatibleWithTheClientSpace = () => {
113
- // const _: SpaceAPI = {} as Space;
114
- };
115
-
116
- export type FunctionDefinition = {
117
- description?: string;
118
- inputSchema: S.Schema.AnyNoContext;
119
- outputSchema?: S.Schema.AnyNoContext;
120
- handler: FunctionHandler<any>;
81
+ const _: SpaceAPI = {} as SpaceAPI;
121
82
  };
122
83
 
123
- export type DefineFunctionParams<T, O = any> = {
84
+ export type FunctionDefinition<T = {}, O = any> = {
124
85
  description?: string;
125
86
  inputSchema: S.Schema<T, any>;
126
87
  outputSchema?: S.Schema<O, any>;
127
- handler: FunctionHandler<T, any, O>;
88
+ handler: FunctionHandler<T, O>;
128
89
  };
129
90
 
130
91
  // TODO(dmaretskyi): Bind input type to function handler.
131
- export const defineFunction = <T, O>(params: DefineFunctionParams<T, O>): FunctionDefinition => {
92
+ export const defineFunction = <T, O>(params: FunctionDefinition<T, O>): FunctionDefinition<T, O> => {
132
93
  if (!S.isSchema(params.inputSchema)) {
133
94
  throw new Error('Input schema must be a valid schema');
134
95
  }
@@ -143,67 +104,3 @@ export const defineFunction = <T, O>(params: DefineFunctionParams<T, O>): Functi
143
104
  handler: params.handler,
144
105
  };
145
106
  };
146
-
147
- //
148
- // Subscription utils.
149
- //
150
-
151
- export type RawSubscriptionData = {
152
- spaceKey?: string;
153
- objects?: string[];
154
- };
155
-
156
- export type SubscriptionData = {
157
- space?: Space;
158
- objects?: ReactiveEchoObject<any>[];
159
- };
160
-
161
- /**
162
- * Handler wrapper for subscription events; extracts space and objects.
163
- *
164
- * To test:
165
- * ```
166
- * curl -s -X POST -H "Content-Type: application/json" --data '{"space": "0446...1cbb"}' http://localhost:7100/dev/email-extractor
167
- * ```
168
- *
169
- * NOTE: Get space key from devtools or `dx space list --json`
170
- */
171
- // TODO(burdon): Evolve into plugin definition like Composer.
172
- export const subscriptionHandler = <TMeta>(
173
- handler: FunctionHandler<SubscriptionData, TMeta>,
174
- types?: S.Schema.AnyNoContext[],
175
- ): FunctionHandler<RawSubscriptionData, TMeta> => {
176
- return async ({ event: { data }, context, response, ...rest }) => {
177
- const { client } = context;
178
- const space = data.spaceKey ? client.spaces.get(PublicKey.from(data.spaceKey)) : undefined;
179
- if (!space) {
180
- log.error('Invalid space');
181
- return response.status(500);
182
- }
183
-
184
- registerTypes(space, types);
185
- const objects = space
186
- ? data.objects
187
- ?.map<ReactiveEchoObject<any> | undefined>((id) => space!.db.getObjectById(id))
188
- .filter(isNonNullable)
189
- : [];
190
-
191
- if (!!data.spaceKey && !space) {
192
- log.warn('invalid space', { data });
193
- } else {
194
- log.info('handler', { space: space?.key.truncate(), objects: objects?.length });
195
- }
196
-
197
- return handler({ event: { data: { ...data, space, objects } }, context, response, ...rest });
198
- };
199
- };
200
-
201
- // TODO(burdon): Evolve types as part of function metadata.
202
- const registerTypes = (space: Space, types: S.Schema.AnyNoContext[] = []) => {
203
- const registry = space.db.graph.schemaRegistry;
204
- for (const type of types) {
205
- if (!registry.hasSchema(type)) {
206
- registry.addSchema([type]);
207
- }
208
- }
209
- };
package/src/index.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  //
2
- // Copyright 2023 DXOS.org
2
+ // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export * from './edge';
6
- export * from './function';
7
5
  export * from './handler';
8
- // export * from './runtime';
9
- export * from './trigger';
6
+ export * from './schema';
7
+ export * from './trace';
10
8
  export * from './types';
9
+ export * from './url';