@dxos/functions 0.8.2-main.12df754 → 0.8.2-main.30e4dbb

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 (176) 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 +62 -7
  4. package/dist/lib/browser/edge/index.mjs.map +4 -4
  5. package/dist/lib/browser/index.mjs +370 -102
  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 +64 -5
  11. package/dist/lib/node/edge/index.cjs.map +4 -4
  12. package/dist/lib/node/index.cjs +382 -94
  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 +63 -6
  18. package/dist/lib/node-esm/edge/index.mjs.map +4 -4
  19. package/dist/lib/node-esm/index.mjs +370 -100
  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/bundler/bundler.d.ts.map +1 -1
  23. package/dist/types/src/edge/functions.d.ts +2 -3
  24. package/dist/types/src/edge/functions.d.ts.map +1 -1
  25. package/dist/types/src/edge/index.d.ts.map +1 -1
  26. package/dist/types/src/handler.d.ts +15 -64
  27. package/dist/types/src/handler.d.ts.map +1 -1
  28. package/dist/types/src/index.d.ts +3 -3
  29. package/dist/types/src/index.d.ts.map +1 -1
  30. package/dist/types/src/schema.d.ts +57 -0
  31. package/dist/types/src/schema.d.ts.map +1 -0
  32. package/dist/types/src/trace.d.ts +148 -0
  33. package/dist/types/src/trace.d.ts.map +1 -0
  34. package/dist/types/src/translations.d.ts +2 -1
  35. package/dist/types/src/translations.d.ts.map +1 -1
  36. package/dist/types/src/types.d.ts +407 -0
  37. package/dist/types/src/types.d.ts.map +1 -0
  38. package/dist/types/src/{types/url.d.ts → url.d.ts} +1 -1
  39. package/dist/types/src/url.d.ts.map +1 -0
  40. package/dist/types/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +20 -36
  42. package/src/edge/functions.ts +2 -4
  43. package/src/edge/index.ts +4 -0
  44. package/src/handler.ts +20 -122
  45. package/src/index.ts +4 -5
  46. package/src/schema.ts +53 -0
  47. package/src/{types/trace.ts → trace.ts} +33 -31
  48. package/src/translations.ts +1 -1
  49. package/src/types.ts +210 -0
  50. package/src/{types/url.ts → url.ts} +1 -1
  51. package/dist/lib/browser/chunk-2YE6S7XY.mjs +0 -360
  52. package/dist/lib/browser/chunk-2YE6S7XY.mjs.map +0 -7
  53. package/dist/lib/browser/chunk-7CHDHCV3.mjs +0 -482
  54. package/dist/lib/browser/chunk-7CHDHCV3.mjs.map +0 -7
  55. package/dist/lib/browser/chunk-LT4LR4VU.mjs +0 -72
  56. package/dist/lib/browser/chunk-LT4LR4VU.mjs.map +0 -7
  57. package/dist/lib/browser/chunk-XRCXIG74.mjs +0 -12
  58. package/dist/lib/browser/chunk-XRCXIG74.mjs.map +0 -7
  59. package/dist/lib/browser/testing/index.mjs +0 -670
  60. package/dist/lib/browser/testing/index.mjs.map +0 -7
  61. package/dist/lib/browser/types/index.mjs +0 -51
  62. package/dist/lib/browser/types/index.mjs.map +0 -7
  63. package/dist/lib/node/chunk-FBIUZ7SD.cjs +0 -496
  64. package/dist/lib/node/chunk-FBIUZ7SD.cjs.map +0 -7
  65. package/dist/lib/node/chunk-JEQ2X3Z6.cjs +0 -34
  66. package/dist/lib/node/chunk-JEQ2X3Z6.cjs.map +0 -7
  67. package/dist/lib/node/chunk-NXZNXVT3.cjs +0 -94
  68. package/dist/lib/node/chunk-NXZNXVT3.cjs.map +0 -7
  69. package/dist/lib/node/chunk-SV5NRE5L.cjs +0 -395
  70. package/dist/lib/node/chunk-SV5NRE5L.cjs.map +0 -7
  71. package/dist/lib/node/testing/index.cjs +0 -687
  72. package/dist/lib/node/testing/index.cjs.map +0 -7
  73. package/dist/lib/node/types/index.cjs +0 -72
  74. package/dist/lib/node/types/index.cjs.map +0 -7
  75. package/dist/lib/node-esm/chunk-3XMJFSID.mjs +0 -360
  76. package/dist/lib/node-esm/chunk-3XMJFSID.mjs.map +0 -7
  77. package/dist/lib/node-esm/chunk-C6YINTWG.mjs +0 -482
  78. package/dist/lib/node-esm/chunk-C6YINTWG.mjs.map +0 -7
  79. package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs +0 -12
  80. package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map +0 -7
  81. package/dist/lib/node-esm/chunk-O2SXVYU5.mjs +0 -72
  82. package/dist/lib/node-esm/chunk-O2SXVYU5.mjs.map +0 -7
  83. package/dist/lib/node-esm/testing/index.mjs +0 -670
  84. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  85. package/dist/lib/node-esm/types/index.mjs +0 -51
  86. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  87. package/dist/types/src/browser/index.d.ts +0 -2
  88. package/dist/types/src/browser/index.d.ts.map +0 -1
  89. package/dist/types/src/function/function-registry.d.ts +0 -25
  90. package/dist/types/src/function/function-registry.d.ts.map +0 -1
  91. package/dist/types/src/function/function-registry.test.d.ts +0 -2
  92. package/dist/types/src/function/function-registry.test.d.ts.map +0 -1
  93. package/dist/types/src/function/index.d.ts +0 -2
  94. package/dist/types/src/function/index.d.ts.map +0 -1
  95. package/dist/types/src/runtime/dev-server.d.ts +0 -52
  96. package/dist/types/src/runtime/dev-server.d.ts.map +0 -1
  97. package/dist/types/src/runtime/dev-server.test.d.ts +0 -2
  98. package/dist/types/src/runtime/dev-server.test.d.ts.map +0 -1
  99. package/dist/types/src/runtime/index.d.ts +0 -3
  100. package/dist/types/src/runtime/index.d.ts.map +0 -1
  101. package/dist/types/src/runtime/scheduler.d.ts +0 -34
  102. package/dist/types/src/runtime/scheduler.d.ts.map +0 -1
  103. package/dist/types/src/runtime/scheduler.test.d.ts +0 -2
  104. package/dist/types/src/runtime/scheduler.test.d.ts.map +0 -1
  105. package/dist/types/src/testing/functions-integration.test.d.ts +0 -2
  106. package/dist/types/src/testing/functions-integration.test.d.ts.map +0 -1
  107. package/dist/types/src/testing/index.d.ts +0 -5
  108. package/dist/types/src/testing/index.d.ts.map +0 -1
  109. package/dist/types/src/testing/manifest.d.ts +0 -3
  110. package/dist/types/src/testing/manifest.d.ts.map +0 -1
  111. package/dist/types/src/testing/plugin-init.d.ts +0 -6
  112. package/dist/types/src/testing/plugin-init.d.ts.map +0 -1
  113. package/dist/types/src/testing/setup.d.ts +0 -15
  114. package/dist/types/src/testing/setup.d.ts.map +0 -1
  115. package/dist/types/src/testing/test/handler.d.ts +0 -4
  116. package/dist/types/src/testing/test/handler.d.ts.map +0 -1
  117. package/dist/types/src/testing/test/index.d.ts +0 -3
  118. package/dist/types/src/testing/test/index.d.ts.map +0 -1
  119. package/dist/types/src/testing/types.d.ts +0 -10
  120. package/dist/types/src/testing/types.d.ts.map +0 -1
  121. package/dist/types/src/testing/util.d.ts +0 -5
  122. package/dist/types/src/testing/util.d.ts.map +0 -1
  123. package/dist/types/src/trigger/index.d.ts +0 -3
  124. package/dist/types/src/trigger/index.d.ts.map +0 -1
  125. package/dist/types/src/trigger/trigger-registry.d.ts +0 -38
  126. package/dist/types/src/trigger/trigger-registry.d.ts.map +0 -1
  127. package/dist/types/src/trigger/trigger-registry.test.d.ts +0 -2
  128. package/dist/types/src/trigger/trigger-registry.test.d.ts.map +0 -1
  129. package/dist/types/src/trigger/type/index.d.ts +0 -3
  130. package/dist/types/src/trigger/type/index.d.ts.map +0 -1
  131. package/dist/types/src/trigger/type/subscription-trigger.d.ts +0 -4
  132. package/dist/types/src/trigger/type/subscription-trigger.d.ts.map +0 -1
  133. package/dist/types/src/trigger/type/timer-trigger.d.ts +0 -4
  134. package/dist/types/src/trigger/type/timer-trigger.d.ts.map +0 -1
  135. package/dist/types/src/trigger/type/webhook-trigger.d.ts +0 -4
  136. package/dist/types/src/trigger/type/webhook-trigger.d.ts.map +0 -1
  137. package/dist/types/src/types/index.d.ts +0 -5
  138. package/dist/types/src/types/index.d.ts.map +0 -1
  139. package/dist/types/src/types/schema.d.ts +0 -53
  140. package/dist/types/src/types/schema.d.ts.map +0 -1
  141. package/dist/types/src/types/trace.d.ts +0 -146
  142. package/dist/types/src/types/trace.d.ts.map +0 -1
  143. package/dist/types/src/types/types.d.ts +0 -265
  144. package/dist/types/src/types/types.d.ts.map +0 -1
  145. package/dist/types/src/types/url.d.ts.map +0 -1
  146. package/dist/types/tools/schema.d.ts +0 -2
  147. package/dist/types/tools/schema.d.ts.map +0 -1
  148. package/schema/functions.json +0 -211
  149. package/src/browser/index.ts +0 -5
  150. package/src/function/function-registry.test.ts +0 -118
  151. package/src/function/function-registry.ts +0 -104
  152. package/src/function/index.ts +0 -5
  153. package/src/runtime/dev-server.test.ts +0 -79
  154. package/src/runtime/dev-server.ts +0 -240
  155. package/src/runtime/index.ts +0 -6
  156. package/src/runtime/scheduler.test.ts +0 -152
  157. package/src/runtime/scheduler.ts +0 -170
  158. package/src/testing/functions-integration.test.ts +0 -65
  159. package/src/testing/index.ts +0 -8
  160. package/src/testing/manifest.ts +0 -15
  161. package/src/testing/plugin-init.ts +0 -20
  162. package/src/testing/setup.ts +0 -109
  163. package/src/testing/test/handler.ts +0 -15
  164. package/src/testing/test/index.ts +0 -7
  165. package/src/testing/types.ts +0 -9
  166. package/src/testing/util.ts +0 -26
  167. package/src/trigger/index.ts +0 -6
  168. package/src/trigger/trigger-registry.test.ts +0 -278
  169. package/src/trigger/trigger-registry.ts +0 -218
  170. package/src/trigger/type/index.ts +0 -7
  171. package/src/trigger/type/subscription-trigger.ts +0 -84
  172. package/src/trigger/type/timer-trigger.ts +0 -48
  173. package/src/trigger/type/webhook-trigger.ts +0 -48
  174. package/src/types/index.ts +0 -8
  175. package/src/types/schema.ts +0 -46
  176. package/src/types/types.ts +0 -163
@@ -0,0 +1,407 @@
1
+ import { Schema } from 'effect';
2
+ import { Expando, Ref } from '@dxos/echo-schema';
3
+ import { FunctionType } from './schema';
4
+ /**
5
+ * Type discriminator for TriggerType.
6
+ * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.
7
+ * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions
8
+ */
9
+ export declare enum TriggerKind {
10
+ Timer = "timer",
11
+ Webhook = "webhook",
12
+ Subscription = "subscription",
13
+ Email = "email",
14
+ Queue = "queue"
15
+ }
16
+ /**
17
+ * Cron timer.
18
+ */
19
+ declare const TimerTriggerSchema: Schema.mutable<Schema.Struct<{
20
+ kind: Schema.Literal<[TriggerKind.Timer]>;
21
+ cron: Schema.SchemaClass<string, string, never>;
22
+ }>>;
23
+ export type TimerTrigger = Schema.Schema.Type<typeof TimerTriggerSchema>;
24
+ declare const EmailTriggerSchema: Schema.mutable<Schema.Struct<{
25
+ kind: Schema.Literal<[TriggerKind.Email]>;
26
+ }>>;
27
+ export type EmailTrigger = Schema.Schema.Type<typeof EmailTriggerSchema>;
28
+ declare const QueueTriggerSchema: Schema.mutable<Schema.Struct<{
29
+ kind: Schema.Literal<[TriggerKind.Queue]>;
30
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
31
+ }>>;
32
+ export type QueueTrigger = Schema.Schema.Type<typeof QueueTriggerSchema>;
33
+ /**
34
+ * Webhook.
35
+ */
36
+ declare const WebhookTriggerSchema: Schema.mutable<Schema.Struct<{
37
+ kind: Schema.Literal<[TriggerKind.Webhook]>;
38
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
39
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
40
+ }>>;
41
+ export type WebhookTrigger = Schema.Schema.Type<typeof WebhookTriggerSchema>;
42
+ /**
43
+ * Subscription.
44
+ */
45
+ declare const SubscriptionTriggerSchema: Schema.mutable<Schema.Struct<{
46
+ kind: Schema.Literal<[TriggerKind.Subscription]>;
47
+ filter: Schema.Struct<{
48
+ type: Schema.optional<Schema.SchemaClass<string, string, never>>;
49
+ props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
50
+ }>;
51
+ options: Schema.optional<Schema.Struct<{
52
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
53
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
54
+ }>>;
55
+ }>>;
56
+ export type SubscriptionTrigger = Schema.Schema.Type<typeof SubscriptionTriggerSchema>;
57
+ /**
58
+ * Trigger schema (discriminated union).
59
+ */
60
+ export declare const TriggerSchema: Schema.Union<[Schema.mutable<Schema.Struct<{
61
+ kind: Schema.Literal<[TriggerKind.Timer]>;
62
+ cron: Schema.SchemaClass<string, string, never>;
63
+ }>>, Schema.mutable<Schema.Struct<{
64
+ kind: Schema.Literal<[TriggerKind.Webhook]>;
65
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
66
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
67
+ }>>, Schema.mutable<Schema.Struct<{
68
+ kind: Schema.Literal<[TriggerKind.Subscription]>;
69
+ filter: Schema.Struct<{
70
+ type: Schema.optional<Schema.SchemaClass<string, string, never>>;
71
+ props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
72
+ }>;
73
+ options: Schema.optional<Schema.Struct<{
74
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
75
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
76
+ }>>;
77
+ }>>, Schema.mutable<Schema.Struct<{
78
+ kind: Schema.Literal<[TriggerKind.Email]>;
79
+ }>>, Schema.mutable<Schema.Struct<{
80
+ kind: Schema.Literal<[TriggerKind.Queue]>;
81
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
82
+ }>>]>;
83
+ export type TriggerType = Schema.Schema.Type<typeof TriggerSchema>;
84
+ export type EventType = EmailTriggerOutput | WebhookTriggerOutput | QueueTriggerOutput | SubscriptionTriggerOutput | TimerTriggerOutput;
85
+ export declare const EmailTriggerOutput: Schema.mutable<Schema.Struct<{
86
+ from: typeof Schema.String;
87
+ to: typeof Schema.String;
88
+ subject: typeof Schema.String;
89
+ created: typeof Schema.String;
90
+ body: typeof Schema.String;
91
+ }>>;
92
+ export type EmailTriggerOutput = Schema.Schema.Type<typeof EmailTriggerOutput>;
93
+ export declare const WebhookTriggerOutput: Schema.mutable<Schema.Struct<{
94
+ url: typeof Schema.String;
95
+ method: Schema.Literal<["GET", "POST"]>;
96
+ headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
97
+ bodyText: typeof Schema.String;
98
+ }>>;
99
+ export type WebhookTriggerOutput = Schema.Schema.Type<typeof WebhookTriggerOutput>;
100
+ export declare const QueueTriggerOutput: Schema.mutable<Schema.Struct<{
101
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
102
+ item: typeof Schema.Any;
103
+ cursor: typeof Schema.String;
104
+ }>>;
105
+ export type QueueTriggerOutput = Schema.Schema.Type<typeof QueueTriggerOutput>;
106
+ export declare const SubscriptionTriggerOutput: Schema.mutable<Schema.Struct<{
107
+ type: typeof Schema.String;
108
+ changedObjectId: typeof Schema.String;
109
+ }>>;
110
+ export type SubscriptionTriggerOutput = Schema.Schema.Type<typeof SubscriptionTriggerOutput>;
111
+ export declare const TimerTriggerOutput: Schema.mutable<Schema.Struct<{
112
+ tick: typeof Schema.Number;
113
+ }>>;
114
+ export type TimerTriggerOutput = Schema.Schema.Type<typeof TimerTriggerOutput>;
115
+ /**
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.
119
+ */
120
+ export declare const FunctionTriggerSchema: Schema.Struct<{
121
+ /**
122
+ * Function or workflow to invoke.
123
+ */
124
+ function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
125
+ /**
126
+ * Only used for workflowSchema.
127
+ * Specifies the input node in the circuit.
128
+ * @deprecated Remove and enforce a single input node in all compute graphSchema.
129
+ */
130
+ inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
131
+ enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
132
+ spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
133
+ kind: Schema.Literal<[TriggerKind.Timer]>;
134
+ cron: Schema.SchemaClass<string, string, never>;
135
+ }>>, Schema.mutable<Schema.Struct<{
136
+ kind: Schema.Literal<[TriggerKind.Webhook]>;
137
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
138
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
139
+ }>>, Schema.mutable<Schema.Struct<{
140
+ kind: Schema.Literal<[TriggerKind.Subscription]>;
141
+ filter: Schema.Struct<{
142
+ type: Schema.optional<Schema.SchemaClass<string, string, never>>;
143
+ props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
144
+ }>;
145
+ options: Schema.optional<Schema.Struct<{
146
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
147
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
148
+ }>>;
149
+ }>>, Schema.mutable<Schema.Struct<{
150
+ kind: Schema.Literal<[TriggerKind.Email]>;
151
+ }>>, Schema.mutable<Schema.Struct<{
152
+ kind: Schema.Literal<[TriggerKind.Queue]>;
153
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
154
+ }>>]>>;
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: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
167
+ }>;
168
+ export type FunctionTriggerType = Schema.Schema.Type<typeof FunctionTriggerSchema>;
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: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
174
+ /**
175
+ * Only used for workflowSchema.
176
+ * Specifies the input node in the circuit.
177
+ * @deprecated Remove and enforce a single input node in all compute graphSchema.
178
+ */
179
+ inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
180
+ enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
181
+ spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
182
+ kind: Schema.Literal<[TriggerKind.Timer]>;
183
+ cron: Schema.SchemaClass<string, string, never>;
184
+ }>>, Schema.mutable<Schema.Struct<{
185
+ kind: Schema.Literal<[TriggerKind.Webhook]>;
186
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
187
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
188
+ }>>, Schema.mutable<Schema.Struct<{
189
+ kind: Schema.Literal<[TriggerKind.Subscription]>;
190
+ filter: Schema.Struct<{
191
+ type: Schema.optional<Schema.SchemaClass<string, string, never>>;
192
+ props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
193
+ }>;
194
+ options: Schema.optional<Schema.Struct<{
195
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
196
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
197
+ }>>;
198
+ }>>, Schema.mutable<Schema.Struct<{
199
+ kind: Schema.Literal<[TriggerKind.Email]>;
200
+ }>>, Schema.mutable<Schema.Struct<{
201
+ kind: Schema.Literal<[TriggerKind.Queue]>;
202
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
203
+ }>>]>>;
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: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
216
+ }>, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<Readonly<{
217
+ /**
218
+ * Function or workflow to invoke.
219
+ */
220
+ function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
221
+ /**
222
+ * Only used for workflowSchema.
223
+ * Specifies the input node in the circuit.
224
+ * @deprecated Remove and enforce a single input node in all compute graphSchema.
225
+ */
226
+ inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
227
+ enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
228
+ spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
229
+ kind: Schema.Literal<[TriggerKind.Timer]>;
230
+ cron: Schema.SchemaClass<string, string, never>;
231
+ }>>, Schema.mutable<Schema.Struct<{
232
+ kind: Schema.Literal<[TriggerKind.Webhook]>;
233
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
234
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
235
+ }>>, Schema.mutable<Schema.Struct<{
236
+ kind: Schema.Literal<[TriggerKind.Subscription]>;
237
+ filter: Schema.Struct<{
238
+ type: Schema.optional<Schema.SchemaClass<string, string, never>>;
239
+ props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
240
+ }>;
241
+ options: Schema.optional<Schema.Struct<{
242
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
243
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
244
+ }>>;
245
+ }>>, Schema.mutable<Schema.Struct<{
246
+ kind: Schema.Literal<[TriggerKind.Email]>;
247
+ }>>, Schema.mutable<Schema.Struct<{
248
+ kind: Schema.Literal<[TriggerKind.Queue]>;
249
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
250
+ }>>]>>;
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: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
263
+ }>>>;
264
+ /**
265
+ * Function trigger.
266
+ */
267
+ export declare class FunctionTrigger extends FunctionTrigger_base {
268
+ }
269
+ /**
270
+ * Function manifest file.
271
+ */
272
+ export declare const FunctionManifestSchema: Schema.Struct<{
273
+ functions: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo-schema").ExcludeId<import("@dxos/echo-schema").TypedObjectFields<{
274
+ name: typeof Schema.NonEmptyString;
275
+ version: typeof Schema.String;
276
+ description: Schema.optional<typeof Schema.String>;
277
+ source: Schema.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: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
288
+ outputSchema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
289
+ binding: Schema.optional<typeof Schema.String>;
290
+ }, import("@dxos/echo-schema").TypedObjectOptions>> & import("@dxos/echo-schema").WithMeta, Schema.Struct.Encoded<{
291
+ name: typeof Schema.NonEmptyString;
292
+ version: typeof Schema.String;
293
+ description: Schema.optional<typeof Schema.String>;
294
+ source: Schema.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: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
305
+ outputSchema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
306
+ binding: Schema.optional<typeof Schema.String>;
307
+ }>, never>>>>;
308
+ triggers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo-schema").ExcludeId<import("@dxos/echo-schema").TypedObjectFields<Readonly<{
309
+ /**
310
+ * Function or workflow to invoke.
311
+ */
312
+ function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
313
+ /**
314
+ * Only used for workflowSchema.
315
+ * Specifies the input node in the circuit.
316
+ * @deprecated Remove and enforce a single input node in all compute graphSchema.
317
+ */
318
+ inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
319
+ enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
320
+ spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
321
+ kind: Schema.Literal<[TriggerKind.Timer]>;
322
+ cron: Schema.SchemaClass<string, string, never>;
323
+ }>>, Schema.mutable<Schema.Struct<{
324
+ kind: Schema.Literal<[TriggerKind.Webhook]>;
325
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
326
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
327
+ }>>, Schema.mutable<Schema.Struct<{
328
+ kind: Schema.Literal<[TriggerKind.Subscription]>;
329
+ filter: Schema.Struct<{
330
+ type: Schema.optional<Schema.SchemaClass<string, string, never>>;
331
+ props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
332
+ }>;
333
+ options: Schema.optional<Schema.Struct<{
334
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
335
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
336
+ }>>;
337
+ }>>, Schema.mutable<Schema.Struct<{
338
+ kind: Schema.Literal<[TriggerKind.Email]>;
339
+ }>>, Schema.mutable<Schema.Struct<{
340
+ kind: Schema.Literal<[TriggerKind.Queue]>;
341
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
342
+ }>>]>>;
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: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
355
+ }>, import("@dxos/echo-schema").TypedObjectOptions>> & import("@dxos/echo-schema").WithMeta, Schema.Struct.Encoded<Readonly<{
356
+ /**
357
+ * Function or workflow to invoke.
358
+ */
359
+ function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
360
+ /**
361
+ * Only used for workflowSchema.
362
+ * Specifies the input node in the circuit.
363
+ * @deprecated Remove and enforce a single input node in all compute graphSchema.
364
+ */
365
+ inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
366
+ enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
367
+ spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
368
+ kind: Schema.Literal<[TriggerKind.Timer]>;
369
+ cron: Schema.SchemaClass<string, string, never>;
370
+ }>>, Schema.mutable<Schema.Struct<{
371
+ kind: Schema.Literal<[TriggerKind.Webhook]>;
372
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
373
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
374
+ }>>, Schema.mutable<Schema.Struct<{
375
+ kind: Schema.Literal<[TriggerKind.Subscription]>;
376
+ filter: Schema.Struct<{
377
+ type: Schema.optional<Schema.SchemaClass<string, string, never>>;
378
+ props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
379
+ }>;
380
+ options: Schema.optional<Schema.Struct<{
381
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
382
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
383
+ }>>;
384
+ }>>, Schema.mutable<Schema.Struct<{
385
+ kind: Schema.Literal<[TriggerKind.Email]>;
386
+ }>>, Schema.mutable<Schema.Struct<{
387
+ kind: Schema.Literal<[TriggerKind.Queue]>;
388
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
389
+ }>>]>>;
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: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
402
+ }>>, never>>>>;
403
+ }>;
404
+ export type FunctionManifest = Schema.Schema.Type<typeof FunctionManifestSchema>;
405
+ export declare const FUNCTION_TYPES: (typeof FunctionType | typeof FunctionTrigger)[];
406
+ export {};
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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"}
@@ -6,7 +6,7 @@ export declare const setUserFunctionUrlInMetadata: (meta: ObjectMeta, functionUr
6
6
  /**
7
7
  * NOTE: functionId is backend ID, not ECHO object id.
8
8
  */
9
- export declare const makeFunctionUrl: (spaceId: SpaceId, fn: {
9
+ export declare const makeFunctionUrl: (fn: {
10
10
  functionId: string;
11
11
  }) => string;
12
12
  export declare const getInvocationUrl: (functionUrl: string, edgeUrl: string, options?: InvocationOptions) => string;
@@ -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,GAAI,MAAM,UAAU,uBAE5D,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,MAAM,UAAU,EAAE,aAAa,MAAM,SASjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,IAAI;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,WAAwB,CAAC;AAEnF,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,EAAE,SAAS,MAAM,EAAE,UAAS,iBAAsB,WAUrG,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":"5.7.3"}
1
+ {"version":"5.8.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/functions",
3
- "version": "0.8.2-main.12df754",
3
+ "version": "0.8.2-main.30e4dbb",
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,34 +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/assistant": "0.8.2-main.12df754",
71
- "@dxos/async": "0.8.2-main.12df754",
72
- "@dxos/client": "0.8.2-main.12df754",
73
- "@dxos/context": "0.8.2-main.12df754",
74
- "@dxos/crypto": "0.8.2-main.12df754",
75
- "@dxos/echo-protocol": "0.8.2-main.12df754",
76
- "@dxos/echo-db": "0.8.2-main.12df754",
77
- "@dxos/edge-client": "0.8.2-main.12df754",
78
- "@dxos/echo-schema": "0.8.2-main.12df754",
79
- "@dxos/invariant": "0.8.2-main.12df754",
80
- "@dxos/keys": "0.8.2-main.12df754",
81
- "@dxos/live-object": "0.8.2-main.12df754",
82
- "@dxos/log": "0.8.2-main.12df754",
83
- "@dxos/node-std": "0.8.2-main.12df754",
84
- "@dxos/util": "0.8.2-main.12df754",
85
- "@dxos/protocols": "0.8.2-main.12df754",
86
- "@dxos/schema": "0.8.2-main.12df754"
54
+ "@dxos/assistant": "0.8.2-main.30e4dbb",
55
+ "@dxos/client": "0.8.2-main.30e4dbb",
56
+ "@dxos/context": "0.8.2-main.30e4dbb",
57
+ "@dxos/async": "0.8.2-main.30e4dbb",
58
+ "@dxos/echo-db": "0.8.2-main.30e4dbb",
59
+ "@dxos/crypto": "0.8.2-main.30e4dbb",
60
+ "@dxos/echo-protocol": "0.8.2-main.30e4dbb",
61
+ "@dxos/echo-schema": "0.8.2-main.30e4dbb",
62
+ "@dxos/invariant": "0.8.2-main.30e4dbb",
63
+ "@dxos/live-object": "0.8.2-main.30e4dbb",
64
+ "@dxos/edge-client": "0.8.2-main.30e4dbb",
65
+ "@dxos/keys": "0.8.2-main.30e4dbb",
66
+ "@dxos/log": "0.8.2-main.30e4dbb",
67
+ "@dxos/node-std": "0.8.2-main.30e4dbb",
68
+ "@dxos/protocols": "0.8.2-main.30e4dbb",
69
+ "@dxos/schema": "0.8.2-main.30e4dbb",
70
+ "@dxos/util": "0.8.2-main.30e4dbb"
87
71
  },
88
72
  "devDependencies": {
89
73
  "@types/express": "^4.17.17",
90
74
  "@types/ws": "^7.4.0",
91
- "@dxos/agent": "0.8.2-main.12df754"
75
+ "@dxos/agent": "0.8.2-main.30e4dbb"
92
76
  },
93
77
  "publishConfig": {
94
78
  "access": "public"
@@ -8,13 +8,12 @@ import { type Client } from '@dxos/client';
8
8
  import { createEdgeIdentity } from '@dxos/client/edge';
9
9
  import { EdgeHttpClient } from '@dxos/edge-client';
10
10
  import { invariant } from '@dxos/invariant';
11
- import type { PublicKey, SpaceId } from '@dxos/keys';
11
+ import type { PublicKey } from '@dxos/keys';
12
12
  import { log } from '@dxos/log';
13
13
  import { type UploadFunctionResponseBody } from '@dxos/protocols';
14
14
 
15
15
  export type UploadWorkerArgs = {
16
16
  client: Client;
17
- spaceId: SpaceId;
18
17
  source: string;
19
18
  version: string;
20
19
  name?: string;
@@ -23,7 +22,6 @@ export type UploadWorkerArgs = {
23
22
 
24
23
  export const uploadWorkerFunction = async ({
25
24
  client,
26
- spaceId,
27
25
  version,
28
26
  source,
29
27
  name,
@@ -34,7 +32,7 @@ export const uploadWorkerFunction = async ({
34
32
  const edgeClient = new EdgeHttpClient(edgeUrl);
35
33
  const edgeIdentity = createEdgeIdentity(client);
36
34
  edgeClient.setIdentity(edgeIdentity);
37
- const response = await edgeClient.uploadFunction({ spaceId, functionId }, { name, version, script: source });
35
+ const response = await edgeClient.uploadFunction({ functionId }, { name, version, script: source });
38
36
 
39
37
  // TODO(burdon): Edge service log.
40
38
  log.info('Uploaded', {
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';