@dxos/functions 0.8.2-main.2f9c567 → 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.
- package/dist/lib/browser/edge/index.mjs +4 -5
- package/dist/lib/browser/edge/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +108 -108
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/edge/index.cjs +4 -5
- package/dist/lib/node/edge/index.cjs.map +3 -3
- package/dist/lib/node/index.cjs +11 -11
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/edge/index.mjs +4 -5
- package/dist/lib/node-esm/edge/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +108 -108
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/bundler/bundler.d.ts.map +1 -1
- package/dist/types/src/edge/functions.d.ts +2 -3
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/handler.d.ts +3 -3
- package/dist/types/src/handler.d.ts.map +1 -1
- package/dist/types/src/trace.d.ts +5 -5
- package/dist/types/src/trace.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +225 -225
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/url.d.ts +1 -1
- package/dist/types/src/url.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -19
- package/src/edge/functions.ts +2 -4
- package/src/handler.ts +8 -6
- package/src/types.ts +77 -81
- package/src/url.ts +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// packages/core/functions/src/handler.ts
|
|
4
|
-
import { Schema
|
|
4
|
+
import { Schema } from "effect";
|
|
5
5
|
var defineFunction = (params) => {
|
|
6
|
-
if (!
|
|
6
|
+
if (!Schema.isSchema(params.inputSchema)) {
|
|
7
7
|
throw new Error("Input schema must be a valid schema");
|
|
8
8
|
}
|
|
9
9
|
if (typeof params.handler !== "function") {
|
|
@@ -12,21 +12,21 @@ var defineFunction = (params) => {
|
|
|
12
12
|
return {
|
|
13
13
|
description: params.description,
|
|
14
14
|
inputSchema: params.inputSchema,
|
|
15
|
-
outputSchema: params.outputSchema ??
|
|
15
|
+
outputSchema: params.outputSchema ?? Schema.Any,
|
|
16
16
|
handler: params.handler
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// packages/core/functions/src/schema.ts
|
|
21
|
-
import { Schema } from "effect";
|
|
21
|
+
import { Schema as Schema2 } from "effect";
|
|
22
22
|
import { EchoObject, JsonSchemaType, LabelAnnotationId, Ref, TypedObject } from "@dxos/echo-schema";
|
|
23
23
|
import { DataType } from "@dxos/schema";
|
|
24
|
-
var ScriptType =
|
|
25
|
-
name:
|
|
26
|
-
description:
|
|
24
|
+
var ScriptType = Schema2.Struct({
|
|
25
|
+
name: Schema2.optional(Schema2.String),
|
|
26
|
+
description: Schema2.optional(Schema2.String),
|
|
27
27
|
// TODO(burdon): Change to hash of deployed content.
|
|
28
28
|
// Whether source has changed since last deploy.
|
|
29
|
-
changed:
|
|
29
|
+
changed: Schema2.optional(Schema2.Boolean),
|
|
30
30
|
source: Ref(DataType.Text)
|
|
31
31
|
}).annotations({
|
|
32
32
|
[LabelAnnotationId]: "name"
|
|
@@ -39,26 +39,26 @@ var FunctionType = class extends TypedObject({
|
|
|
39
39
|
version: "0.1.0"
|
|
40
40
|
})({
|
|
41
41
|
// TODO(burdon): Rename to id/uri?
|
|
42
|
-
name:
|
|
43
|
-
version:
|
|
44
|
-
description:
|
|
42
|
+
name: Schema2.NonEmptyString,
|
|
43
|
+
version: Schema2.String,
|
|
44
|
+
description: Schema2.optional(Schema2.String),
|
|
45
45
|
// Reference to a source script if it exists within ECHO.
|
|
46
46
|
// TODO(burdon): Don't ref ScriptType directly (core).
|
|
47
|
-
source:
|
|
48
|
-
inputSchema:
|
|
49
|
-
outputSchema:
|
|
47
|
+
source: Schema2.optional(Ref(ScriptType)),
|
|
48
|
+
inputSchema: Schema2.optional(JsonSchemaType),
|
|
49
|
+
outputSchema: Schema2.optional(JsonSchemaType),
|
|
50
50
|
// Local binding to a function name.
|
|
51
|
-
binding:
|
|
51
|
+
binding: Schema2.optional(Schema2.String)
|
|
52
52
|
}) {
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
// packages/core/functions/src/trace.ts
|
|
56
|
-
import { Schema as
|
|
56
|
+
import { Schema as Schema4 } from "effect";
|
|
57
57
|
import { EchoObject as EchoObject2, Expando as Expando2, ObjectId, Ref as Ref3 } from "@dxos/echo-schema";
|
|
58
58
|
import { log } from "@dxos/log";
|
|
59
59
|
|
|
60
60
|
// packages/core/functions/src/types.ts
|
|
61
|
-
import { Schema as
|
|
61
|
+
import { Schema as Schema3, SchemaAST } from "effect";
|
|
62
62
|
import { Expando, OptionsAnnotationId, TypedObject as TypedObject2, DXN, Ref as Ref2, RawObject } from "@dxos/echo-schema";
|
|
63
63
|
var TriggerKind;
|
|
64
64
|
(function(TriggerKind2) {
|
|
@@ -68,117 +68,117 @@ var TriggerKind;
|
|
|
68
68
|
TriggerKind2["Email"] = "email";
|
|
69
69
|
TriggerKind2["Queue"] = "queue";
|
|
70
70
|
})(TriggerKind || (TriggerKind = {}));
|
|
71
|
-
var
|
|
72
|
-
[SchemaAST.TitleAnnotationId]: "
|
|
71
|
+
var kindLiteralAnnotations = {
|
|
72
|
+
[SchemaAST.TitleAnnotationId]: "Kind"
|
|
73
73
|
};
|
|
74
|
-
var TimerTriggerSchema =
|
|
75
|
-
|
|
76
|
-
cron:
|
|
74
|
+
var TimerTriggerSchema = Schema3.Struct({
|
|
75
|
+
kind: Schema3.Literal("timer").annotations(kindLiteralAnnotations),
|
|
76
|
+
cron: Schema3.String.annotations({
|
|
77
77
|
[SchemaAST.TitleAnnotationId]: "Cron",
|
|
78
78
|
[SchemaAST.ExamplesAnnotationId]: [
|
|
79
79
|
"0 0 * * *"
|
|
80
80
|
]
|
|
81
81
|
})
|
|
82
|
-
}).pipe(
|
|
83
|
-
var EmailTriggerSchema =
|
|
84
|
-
|
|
85
|
-
}).pipe(
|
|
86
|
-
var QueueTriggerSchema =
|
|
87
|
-
|
|
82
|
+
}).pipe(Schema3.mutable);
|
|
83
|
+
var EmailTriggerSchema = Schema3.Struct({
|
|
84
|
+
kind: Schema3.Literal("email").annotations(kindLiteralAnnotations)
|
|
85
|
+
}).pipe(Schema3.mutable);
|
|
86
|
+
var QueueTriggerSchema = Schema3.Struct({
|
|
87
|
+
kind: Schema3.Literal("queue").annotations(kindLiteralAnnotations),
|
|
88
88
|
queue: DXN
|
|
89
|
-
}).pipe(
|
|
90
|
-
var WebhookTriggerSchema =
|
|
91
|
-
|
|
92
|
-
method:
|
|
89
|
+
}).pipe(Schema3.mutable);
|
|
90
|
+
var WebhookTriggerSchema = Schema3.Struct({
|
|
91
|
+
kind: Schema3.Literal("webhook").annotations(kindLiteralAnnotations),
|
|
92
|
+
method: Schema3.optional(Schema3.String.annotations({
|
|
93
93
|
[SchemaAST.TitleAnnotationId]: "Method",
|
|
94
94
|
[OptionsAnnotationId]: [
|
|
95
95
|
"GET",
|
|
96
96
|
"POST"
|
|
97
97
|
]
|
|
98
98
|
})),
|
|
99
|
-
port:
|
|
99
|
+
port: Schema3.optional(Schema3.Number.annotations({
|
|
100
100
|
[SchemaAST.TitleAnnotationId]: "Port"
|
|
101
101
|
}))
|
|
102
|
-
}).pipe(
|
|
103
|
-
var QuerySchema =
|
|
104
|
-
type:
|
|
102
|
+
}).pipe(Schema3.mutable);
|
|
103
|
+
var QuerySchema = Schema3.Struct({
|
|
104
|
+
type: Schema3.optional(Schema3.String.annotations({
|
|
105
105
|
[SchemaAST.TitleAnnotationId]: "Type"
|
|
106
106
|
})),
|
|
107
|
-
props:
|
|
108
|
-
key:
|
|
109
|
-
value:
|
|
107
|
+
props: Schema3.optional(Schema3.Record({
|
|
108
|
+
key: Schema3.String,
|
|
109
|
+
value: Schema3.Any
|
|
110
110
|
}))
|
|
111
111
|
}).annotations({
|
|
112
112
|
[SchemaAST.TitleAnnotationId]: "Query"
|
|
113
113
|
});
|
|
114
|
-
var SubscriptionTriggerSchema =
|
|
115
|
-
|
|
114
|
+
var SubscriptionTriggerSchema = Schema3.Struct({
|
|
115
|
+
kind: Schema3.Literal("subscription").annotations(kindLiteralAnnotations),
|
|
116
116
|
// TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.
|
|
117
117
|
filter: QuerySchema,
|
|
118
|
-
options:
|
|
118
|
+
options: Schema3.optional(Schema3.Struct({
|
|
119
119
|
// Watch changes to object (not just creation).
|
|
120
|
-
deep:
|
|
120
|
+
deep: Schema3.optional(Schema3.Boolean.annotations({
|
|
121
121
|
[SchemaAST.TitleAnnotationId]: "Nested"
|
|
122
122
|
})),
|
|
123
123
|
// Debounce changes (delay in ms).
|
|
124
|
-
delay:
|
|
124
|
+
delay: Schema3.optional(Schema3.Number.annotations({
|
|
125
125
|
[SchemaAST.TitleAnnotationId]: "Delay"
|
|
126
126
|
}))
|
|
127
127
|
}).annotations({
|
|
128
128
|
[SchemaAST.TitleAnnotationId]: "Options"
|
|
129
129
|
}))
|
|
130
|
-
}).pipe(
|
|
131
|
-
var TriggerSchema =
|
|
130
|
+
}).pipe(Schema3.mutable);
|
|
131
|
+
var TriggerSchema = Schema3.Union(TimerTriggerSchema, WebhookTriggerSchema, SubscriptionTriggerSchema, EmailTriggerSchema, QueueTriggerSchema).annotations({
|
|
132
132
|
[SchemaAST.TitleAnnotationId]: "Trigger"
|
|
133
133
|
});
|
|
134
|
-
var EmailTriggerOutput =
|
|
135
|
-
from:
|
|
136
|
-
to:
|
|
137
|
-
subject:
|
|
138
|
-
created:
|
|
139
|
-
body:
|
|
134
|
+
var EmailTriggerOutput = Schema3.mutable(Schema3.Struct({
|
|
135
|
+
from: Schema3.String,
|
|
136
|
+
to: Schema3.String,
|
|
137
|
+
subject: Schema3.String,
|
|
138
|
+
created: Schema3.String,
|
|
139
|
+
body: Schema3.String
|
|
140
140
|
}));
|
|
141
|
-
var WebhookTriggerOutput =
|
|
142
|
-
url:
|
|
143
|
-
method:
|
|
144
|
-
headers:
|
|
145
|
-
key:
|
|
146
|
-
value:
|
|
141
|
+
var WebhookTriggerOutput = Schema3.mutable(Schema3.Struct({
|
|
142
|
+
url: Schema3.String,
|
|
143
|
+
method: Schema3.Literal("GET", "POST"),
|
|
144
|
+
headers: Schema3.Record({
|
|
145
|
+
key: Schema3.String,
|
|
146
|
+
value: Schema3.String
|
|
147
147
|
}),
|
|
148
|
-
bodyText:
|
|
148
|
+
bodyText: Schema3.String
|
|
149
149
|
}));
|
|
150
|
-
var QueueTriggerOutput =
|
|
150
|
+
var QueueTriggerOutput = Schema3.mutable(Schema3.Struct({
|
|
151
151
|
queue: DXN,
|
|
152
|
-
item:
|
|
153
|
-
cursor:
|
|
152
|
+
item: Schema3.Any,
|
|
153
|
+
cursor: Schema3.String
|
|
154
154
|
}));
|
|
155
|
-
var SubscriptionTriggerOutput =
|
|
156
|
-
type:
|
|
157
|
-
changedObjectId:
|
|
155
|
+
var SubscriptionTriggerOutput = Schema3.mutable(Schema3.Struct({
|
|
156
|
+
type: Schema3.String,
|
|
157
|
+
changedObjectId: Schema3.String
|
|
158
158
|
}));
|
|
159
|
-
var TimerTriggerOutput =
|
|
160
|
-
tick:
|
|
159
|
+
var TimerTriggerOutput = Schema3.mutable(Schema3.Struct({
|
|
160
|
+
tick: Schema3.Number
|
|
161
161
|
}));
|
|
162
|
-
var FunctionTriggerSchema =
|
|
162
|
+
var FunctionTriggerSchema = Schema3.Struct({
|
|
163
163
|
/**
|
|
164
164
|
* Function or workflow to invoke.
|
|
165
165
|
*/
|
|
166
166
|
// TODO(dmaretskyi): Can be a Ref(FunctionType) or Ref(ComputeGraphType).
|
|
167
|
-
function:
|
|
167
|
+
function: Schema3.optional(Ref2(Expando).annotations({
|
|
168
168
|
[SchemaAST.TitleAnnotationId]: "Function"
|
|
169
169
|
})),
|
|
170
170
|
/**
|
|
171
|
-
* Only used for
|
|
171
|
+
* Only used for workflowSchema.
|
|
172
172
|
* Specifies the input node in the circuit.
|
|
173
|
-
* @deprecated Remove and enforce a single input node in all compute
|
|
173
|
+
* @deprecated Remove and enforce a single input node in all compute graphSchema.
|
|
174
174
|
*/
|
|
175
|
-
inputNodeId:
|
|
175
|
+
inputNodeId: Schema3.optional(Schema3.String.annotations({
|
|
176
176
|
[SchemaAST.TitleAnnotationId]: "Input Node ID"
|
|
177
177
|
})),
|
|
178
|
-
enabled:
|
|
178
|
+
enabled: Schema3.optional(Schema3.Boolean.annotations({
|
|
179
179
|
[SchemaAST.TitleAnnotationId]: "Enabled"
|
|
180
180
|
})),
|
|
181
|
-
spec:
|
|
181
|
+
spec: Schema3.optional(TriggerSchema),
|
|
182
182
|
/**
|
|
183
183
|
* Passed as the input data to the function.
|
|
184
184
|
* Must match the function's input schema.
|
|
@@ -190,19 +190,19 @@ var FunctionTriggerSchema = S2.Struct({
|
|
|
190
190
|
* mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
|
|
191
191
|
* }
|
|
192
192
|
*/
|
|
193
|
-
input:
|
|
194
|
-
key:
|
|
195
|
-
value:
|
|
193
|
+
input: Schema3.optional(Schema3.mutable(Schema3.Record({
|
|
194
|
+
key: Schema3.String,
|
|
195
|
+
value: Schema3.Any
|
|
196
196
|
})))
|
|
197
197
|
});
|
|
198
198
|
var FunctionTrigger = class extends TypedObject2({
|
|
199
199
|
typename: "dxos.org/type/FunctionTrigger",
|
|
200
|
-
version: "0.
|
|
200
|
+
version: "0.2.0"
|
|
201
201
|
})(FunctionTriggerSchema.fields) {
|
|
202
202
|
};
|
|
203
|
-
var FunctionManifestSchema =
|
|
204
|
-
functions:
|
|
205
|
-
triggers:
|
|
203
|
+
var FunctionManifestSchema = Schema3.Struct({
|
|
204
|
+
functions: Schema3.optional(Schema3.mutable(Schema3.Array(RawObject(FunctionType)))),
|
|
205
|
+
triggers: Schema3.optional(Schema3.mutable(Schema3.Array(RawObject(FunctionTrigger))))
|
|
206
206
|
});
|
|
207
207
|
var FUNCTION_TYPES = [
|
|
208
208
|
FunctionType,
|
|
@@ -222,18 +222,18 @@ var InvocationTraceEventType;
|
|
|
222
222
|
InvocationTraceEventType2["START"] = "start";
|
|
223
223
|
InvocationTraceEventType2["END"] = "end";
|
|
224
224
|
})(InvocationTraceEventType || (InvocationTraceEventType = {}));
|
|
225
|
-
var TraceEventException =
|
|
226
|
-
timestampMs:
|
|
227
|
-
message:
|
|
228
|
-
name:
|
|
229
|
-
stack:
|
|
225
|
+
var TraceEventException = Schema4.Struct({
|
|
226
|
+
timestampMs: Schema4.Number,
|
|
227
|
+
message: Schema4.String,
|
|
228
|
+
name: Schema4.String,
|
|
229
|
+
stack: Schema4.optional(Schema4.String)
|
|
230
230
|
});
|
|
231
|
-
var InvocationTraceStartEvent =
|
|
231
|
+
var InvocationTraceStartEvent = Schema4.Struct({
|
|
232
232
|
/**
|
|
233
233
|
* Queue message id.
|
|
234
234
|
*/
|
|
235
235
|
id: ObjectId,
|
|
236
|
-
type:
|
|
236
|
+
type: Schema4.Literal("start"),
|
|
237
237
|
/**
|
|
238
238
|
* Invocation id, the same for invocation start and end events.
|
|
239
239
|
*/
|
|
@@ -241,12 +241,12 @@ var InvocationTraceStartEvent = Schema2.Struct({
|
|
|
241
241
|
/**
|
|
242
242
|
* Event generation time.
|
|
243
243
|
*/
|
|
244
|
-
timestampMs:
|
|
244
|
+
timestampMs: Schema4.Number,
|
|
245
245
|
/**
|
|
246
246
|
* Data passed to function / workflow as an argument.
|
|
247
247
|
*/
|
|
248
248
|
// TODO(burdon): Input schema?
|
|
249
|
-
input:
|
|
249
|
+
input: Schema4.Object,
|
|
250
250
|
/**
|
|
251
251
|
* Queue DXN for function/workflow invocation events.
|
|
252
252
|
*/
|
|
@@ -259,17 +259,17 @@ var InvocationTraceStartEvent = Schema2.Struct({
|
|
|
259
259
|
/**
|
|
260
260
|
* Present for automatic invocations.
|
|
261
261
|
*/
|
|
262
|
-
trigger:
|
|
262
|
+
trigger: Schema4.optional(Ref3(FunctionTrigger))
|
|
263
263
|
}).pipe(EchoObject2({
|
|
264
264
|
typename: "dxos.org/type/InvocationTraceStart",
|
|
265
265
|
version: "0.1.0"
|
|
266
266
|
}));
|
|
267
|
-
var InvocationTraceEndEvent =
|
|
267
|
+
var InvocationTraceEndEvent = Schema4.Struct({
|
|
268
268
|
/**
|
|
269
269
|
* Trace event id.
|
|
270
270
|
*/
|
|
271
271
|
id: ObjectId,
|
|
272
|
-
type:
|
|
272
|
+
type: Schema4.Literal("end"),
|
|
273
273
|
/**
|
|
274
274
|
* Invocation id, will be the same for invocation start and end.
|
|
275
275
|
*/
|
|
@@ -278,30 +278,30 @@ var InvocationTraceEndEvent = Schema2.Struct({
|
|
|
278
278
|
* Event generation time.
|
|
279
279
|
*/
|
|
280
280
|
// TODO(burdon): Remove ms suffix.
|
|
281
|
-
timestampMs:
|
|
282
|
-
outcome:
|
|
283
|
-
exception:
|
|
281
|
+
timestampMs: Schema4.Number,
|
|
282
|
+
outcome: Schema4.Enums(InvocationOutcome),
|
|
283
|
+
exception: Schema4.optional(TraceEventException)
|
|
284
284
|
}).pipe(EchoObject2({
|
|
285
285
|
typename: "dxos.org/type/InvocationTraceEnd",
|
|
286
286
|
version: "0.1.0"
|
|
287
287
|
}));
|
|
288
|
-
var TraceEventLog =
|
|
289
|
-
timestampMs:
|
|
290
|
-
level:
|
|
291
|
-
message:
|
|
292
|
-
context:
|
|
288
|
+
var TraceEventLog = Schema4.Struct({
|
|
289
|
+
timestampMs: Schema4.Number,
|
|
290
|
+
level: Schema4.String,
|
|
291
|
+
message: Schema4.String,
|
|
292
|
+
context: Schema4.optional(Schema4.Object)
|
|
293
293
|
});
|
|
294
|
-
var TraceEvent =
|
|
294
|
+
var TraceEvent = Schema4.Struct({
|
|
295
295
|
id: ObjectId,
|
|
296
296
|
// TODO(burdon): Need enum/numeric result (not string).
|
|
297
|
-
outcome:
|
|
298
|
-
truncated:
|
|
297
|
+
outcome: Schema4.String,
|
|
298
|
+
truncated: Schema4.Boolean,
|
|
299
299
|
/**
|
|
300
300
|
* Time when the event was persisted.
|
|
301
301
|
*/
|
|
302
|
-
ingestionTimestampMs:
|
|
303
|
-
logs:
|
|
304
|
-
exceptions:
|
|
302
|
+
ingestionTimestampMs: Schema4.Number,
|
|
303
|
+
logs: Schema4.Array(TraceEventLog),
|
|
304
|
+
exceptions: Schema4.Array(TraceEventException)
|
|
305
305
|
}).pipe(EchoObject2({
|
|
306
306
|
typename: "dxos.org/type/TraceEvent",
|
|
307
307
|
version: "0.1.0"
|
|
@@ -379,7 +379,7 @@ var setUserFunctionUrlInMetadata = (meta, functionUrl) => {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
|
-
var makeFunctionUrl = (
|
|
382
|
+
var makeFunctionUrl = (fn) => `/${fn.functionId}`;
|
|
383
383
|
var getInvocationUrl = (functionUrl, edgeUrl, options = {}) => {
|
|
384
384
|
const baseUrl = new URL("functions/", edgeUrl);
|
|
385
385
|
const relativeUrl = functionUrl.replace(/^\//, "");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/handler.ts", "../../../src/schema.ts", "../../../src/trace.ts", "../../../src/types.ts", "../../../src/url.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema as S } from 'effect';\nimport { type Effect } from 'effect';\n\nimport { type AIServiceClient } from '@dxos/assistant';\nimport type { CoreDatabase, EchoDatabase } from '@dxos/echo-db';\nimport { type HasId } from '@dxos/echo-schema';\nimport { type SpaceId, type DXN } from '@dxos/keys';\nimport { type QueryResult } from '@dxos/protocols';\n\n// TODO(burdon): Model after http request. Ref Lambda/OpenFaaS.\n// https://docs.aws.amazon.com/lambda/latest/dg/typescript-handler.html\n// https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/#functions\n// https://www.npmjs.com/package/aws-lambda\n\n/**\n * Function handler.\n */\nexport type FunctionHandler<TData = {}, TOutput = any> = (params: {\n /**\n * Services and context available to the function.\n */\n context: FunctionContext;\n\n /**\n * Data passed as the input to the function.\n * Must match the function's input schema.\n * This will be the payload from the trigger or other data passed into the function in a workflow.\n */\n data: TData;\n}) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any>;\n\n/**\n * Function context.\n */\nexport interface FunctionContext {\n getSpace: (spaceId: SpaceId) => Promise<SpaceAPI>;\n\n /**\n * Space from which the function was invoked.\n */\n space: SpaceAPI | undefined;\n\n ai: AIServiceClient;\n}\n\nexport interface FunctionContextAi {\n // TODO(dmaretskyi): Refer to cloudflare AI docs for more comprehensive typedefs.\n run(model: string, inputs: any, options?: any): Promise<any>;\n}\n\n//\n// API.\n//\n\n// TODO(dmaretskyi): Temporary API to get the queues working.\n// TODO(dmaretskyi): To be replaced with integrating queues into echo.\nexport interface QueuesAPI {\n queryQueue(queue: DXN, options?: {}): Promise<QueryResult>;\n insertIntoQueue(queue: DXN, objects: HasId[]): Promise<void>;\n}\n\n/**\n * Space interface available to functions.\n */\nexport interface SpaceAPI {\n get id(): SpaceId;\n /**\n * @deprecated\n */\n get crud(): CoreDatabase;\n get db(): EchoDatabase;\n // TODO(dmaretskyi): Align with echo api --- queues.get(id).append(items);\n get queues(): QueuesAPI;\n}\n\nconst __assertFunctionSpaceIsCompatibleWithTheClientSpace = () => {\n const _: SpaceAPI = {} as SpaceAPI;\n};\n\nexport type FunctionDefinition<T = {}, O = any> = {\n description?: string;\n inputSchema: S.Schema<T, any>;\n outputSchema?: S.Schema<O, any>;\n handler: FunctionHandler<T, O>;\n};\n\n// TODO(dmaretskyi): Bind input type to function handler.\nexport const defineFunction = <T, O>(params: FunctionDefinition<T, O>): FunctionDefinition<T, O> => {\n if (!S.isSchema(params.inputSchema)) {\n throw new Error('Input schema must be a valid schema');\n }\n if (typeof params.handler !== 'function') {\n throw new Error('Handler must be a function');\n }\n\n return {\n description: params.description,\n inputSchema: params.inputSchema,\n outputSchema: params.outputSchema ?? S.Any,\n handler: params.handler,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { EchoObject, JsonSchemaType, LabelAnnotationId, Ref, TypedObject } from '@dxos/echo-schema';\nimport { DataType } from '@dxos/schema';\n\n/**\n * Source script.\n */\nexport const ScriptType = Schema.Struct({\n name: Schema.optional(Schema.String),\n description: Schema.optional(Schema.String),\n // TODO(burdon): Change to hash of deployed content.\n // Whether source has changed since last deploy.\n changed: Schema.optional(Schema.Boolean),\n source: Ref(DataType.Text),\n})\n .annotations({ [LabelAnnotationId]: 'name' })\n .pipe(\n EchoObject({\n typename: 'dxos.org/type/Script',\n version: '0.1.0',\n }),\n );\n\nexport type ScriptType = Schema.Schema.Type<typeof ScriptType>;\n\n/**\n * Function deployment.\n */\nexport class FunctionType extends TypedObject({\n typename: 'dxos.org/type/Function',\n version: '0.1.0',\n})({\n // TODO(burdon): Rename to id/uri?\n name: Schema.NonEmptyString,\n version: Schema.String,\n\n description: Schema.optional(Schema.String),\n\n // Reference to a source script if it exists within ECHO.\n // TODO(burdon): Don't ref ScriptType directly (core).\n source: Schema.optional(Ref(ScriptType)),\n\n inputSchema: Schema.optional(JsonSchemaType),\n outputSchema: Schema.optional(JsonSchemaType),\n\n // Local binding to a function name.\n binding: Schema.optional(Schema.String),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { EchoObject, Expando, ObjectId, Ref } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\n\nimport { FunctionTrigger, type FunctionTriggerType } from './types';\n\nexport enum InvocationOutcome {\n SUCCESS = 'success',\n FAILURE = 'failure',\n PENDING = 'pending',\n}\n\n// TODO(burdon): Convert to extensible discriminated union of EDGE events.\nexport enum InvocationTraceEventType {\n START = 'start',\n END = 'end',\n}\n\nexport const TraceEventException = Schema.Struct({\n timestampMs: Schema.Number,\n message: Schema.String,\n name: Schema.String,\n stack: Schema.optional(Schema.String),\n});\nexport type TraceEventException = Schema.Schema.Type<typeof TraceEventException>;\n\nexport const InvocationTraceStartEvent = Schema.Struct({\n /**\n * Queue message id.\n */\n id: ObjectId,\n type: Schema.Literal(InvocationTraceEventType.START),\n /**\n * Invocation id, the same for invocation start and end events.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n timestampMs: Schema.Number,\n /**\n * Data passed to function / workflow as an argument.\n */\n // TODO(burdon): Input schema?\n input: Schema.Object,\n /**\n * Queue DXN for function/workflow invocation events.\n */\n // TODO(burdon): Need reference type for queue. vs. string?\n invocationTraceQueue: Ref(Expando),\n /**\n * DXN of the invoked function/workflow.\n */\n invocationTarget: Ref(Expando),\n /**\n * Present for automatic invocations.\n */\n trigger: Schema.optional(Ref(FunctionTrigger)),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceStart', version: '0.1.0' }));\n\nexport type InvocationTraceStartEvent = Schema.Schema.Type<typeof InvocationTraceStartEvent>;\n\nexport const InvocationTraceEndEvent = Schema.Struct({\n /**\n * Trace event id.\n */\n id: ObjectId,\n type: Schema.Literal(InvocationTraceEventType.END),\n /**\n * Invocation id, will be the same for invocation start and end.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n // TODO(burdon): Remove ms suffix.\n timestampMs: Schema.Number,\n outcome: Schema.Enums(InvocationOutcome),\n exception: Schema.optional(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceEnd', version: '0.1.0' }));\n\nexport type InvocationTraceEndEvent = Schema.Schema.Type<typeof InvocationTraceEndEvent>;\n\nexport type InvocationTraceEvent = InvocationTraceStartEvent | InvocationTraceEndEvent;\n\nexport const TraceEventLog = Schema.Struct({\n timestampMs: Schema.Number,\n level: Schema.String,\n message: Schema.String,\n context: Schema.optional(Schema.Object),\n});\n\nexport const TraceEvent = Schema.Struct({\n id: ObjectId,\n // TODO(burdon): Need enum/numeric result (not string).\n outcome: Schema.String,\n truncated: Schema.Boolean,\n /**\n * Time when the event was persisted.\n */\n ingestionTimestampMs: Schema.Number,\n logs: Schema.Array(TraceEventLog),\n exceptions: Schema.Array(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/TraceEvent', version: '0.1.0' }));\n\nexport type TraceEvent = Schema.Schema.Type<typeof TraceEvent>;\n\n/**\n * Deprecated InvocationTrace event format.\n * @deprecated\n */\n// TODO(burdon): Remove.\nexport type InvocationSpan = {\n id: string;\n timestampMs: number;\n outcome: InvocationOutcome;\n input: object;\n durationMs: number;\n invocationTraceQueue: Ref<Expando>;\n invocationTarget: Ref<Expando>;\n trigger?: Ref<FunctionTriggerType>;\n exception?: TraceEventException;\n};\n\nexport const createInvocationSpans = (items?: InvocationTraceEvent[]): InvocationSpan[] => {\n if (!items) {\n return [];\n }\n\n const eventsByInvocationId = new Map<string, { start?: InvocationTraceStartEvent; end?: InvocationTraceEndEvent }>();\n for (const event of items) {\n if (!('invocationId' in event)) {\n // Skip legacy format entries.\n continue;\n }\n\n const invocationId = event.invocationId;\n const entry = eventsByInvocationId.get(invocationId) || { start: undefined, end: undefined };\n if (event.type === InvocationTraceEventType.START) {\n entry.start = event as InvocationTraceStartEvent;\n } else if (event.type === InvocationTraceEventType.END) {\n entry.end = event as InvocationTraceEndEvent;\n }\n\n eventsByInvocationId.set(invocationId, entry);\n }\n\n const now = Date.now();\n const result: InvocationSpan[] = [];\n\n // Create spans for each invocation\n for (const [invocationId, { start, end }] of eventsByInvocationId.entries()) {\n if (!start) {\n // No start event, can't create a meaningful span\n log.warn('found end event without matching start', { invocationId });\n continue;\n }\n\n const isInProgress = end === undefined;\n\n result.push({\n id: invocationId,\n timestampMs: start.timestampMs,\n durationMs: isInProgress ? now - start.timestampMs : end!.timestampMs - start.timestampMs,\n outcome: end?.outcome ?? InvocationOutcome.PENDING,\n exception: end?.exception,\n input: start.input,\n invocationTraceQueue: start.invocationTraceQueue,\n invocationTarget: start.invocationTarget,\n trigger: start.trigger,\n });\n }\n\n return result;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema as S, SchemaAST } from 'effect';\n\nimport { Expando, OptionsAnnotationId, TypedObject, DXN, Ref, RawObject } from '@dxos/echo-schema';\n\nimport { FunctionType } from './schema';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n Email = 'email',\n Queue = 'queue',\n}\n\n// TODO(burdon): Rename prop kind.\nconst typeLiteralAnnotations = { [SchemaAST.TitleAnnotationId]: 'Type' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Timer).annotations(typeLiteralAnnotations),\n cron: S.String.annotations({\n [SchemaAST.TitleAnnotationId]: 'Cron',\n [SchemaAST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\nconst EmailTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Email).annotations(typeLiteralAnnotations),\n}).pipe(S.mutable);\n\nexport type EmailTrigger = S.Schema.Type<typeof EmailTriggerSchema>;\n\nconst QueueTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Queue).annotations(typeLiteralAnnotations),\n queue: DXN,\n}).pipe(S.mutable);\n\nexport type QueueTrigger = S.Schema.Type<typeof QueueTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Webhook).annotations(typeLiteralAnnotations),\n method: S.optional(\n S.String.annotations({\n [SchemaAST.TitleAnnotationId]: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: S.optional(\n S.Number.annotations({\n [SchemaAST.TitleAnnotationId]: 'Port',\n }),\n ),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = S.Struct({\n type: S.optional(S.String.annotations({ [SchemaAST.TitleAnnotationId]: 'Type' })),\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).annotations({ [SchemaAST.TitleAnnotationId]: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Subscription).annotations(typeLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean.annotations({ [SchemaAST.TitleAnnotationId]: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number.annotations({ [SchemaAST.TitleAnnotationId]: 'Delay' })),\n }).annotations({ [SchemaAST.TitleAnnotationId]: 'Options' }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = S.Union(\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n EmailTriggerSchema,\n QueueTriggerSchema,\n).annotations({\n [SchemaAST.TitleAnnotationId]: 'Trigger',\n});\nexport type TriggerType = S.Schema.Type<typeof TriggerSchema>;\n\nexport type EventType =\n | EmailTriggerOutput\n | WebhookTriggerOutput\n | QueueTriggerOutput\n | SubscriptionTriggerOutput\n | TimerTriggerOutput;\n\n// TODO(burdon): Reuse trigger schema from @dxos/functions (TriggerType).\nexport const EmailTriggerOutput = S.mutable(\n S.Struct({\n from: S.String,\n to: S.String,\n subject: S.String,\n created: S.String,\n body: S.String,\n }),\n);\nexport type EmailTriggerOutput = S.Schema.Type<typeof EmailTriggerOutput>;\n\nexport const WebhookTriggerOutput = S.mutable(\n S.Struct({\n url: S.String,\n method: S.Literal('GET', 'POST'),\n headers: S.Record({ key: S.String, value: S.String }),\n bodyText: S.String,\n }),\n);\nexport type WebhookTriggerOutput = S.Schema.Type<typeof WebhookTriggerOutput>;\n\nexport const QueueTriggerOutput = S.mutable(\n S.Struct({\n queue: DXN,\n item: S.Any,\n cursor: S.String,\n }),\n);\nexport type QueueTriggerOutput = S.Schema.Type<typeof QueueTriggerOutput>;\n\nexport const SubscriptionTriggerOutput = S.mutable(S.Struct({ type: S.String, changedObjectId: S.String }));\nexport type SubscriptionTriggerOutput = S.Schema.Type<typeof SubscriptionTriggerOutput>;\n\nexport const TimerTriggerOutput = S.mutable(S.Struct({ tick: S.Number }));\nexport type TimerTriggerOutput = S.Schema.Type<typeof TimerTriggerOutput>;\n\n/**\n * Function trigger.\n * Function is invoked with the `payload` passed as input data.\n * The event that triggers the function is available in the function context.\n */\nexport const FunctionTriggerSchema = S.Struct({\n /**\n * Function or workflow to invoke.\n */\n // TODO(dmaretskyi): Can be a Ref(FunctionType) or Ref(ComputeGraphType).\n function: S.optional(Ref(Expando).annotations({ [SchemaAST.TitleAnnotationId]: 'Function' })),\n\n /**\n * Only used for workflows.\n * Specifies the input node in the circuit.\n * @deprecated Remove and enforce a single input node in all compute graphs.\n */\n inputNodeId: S.optional(S.String.annotations({ [SchemaAST.TitleAnnotationId]: 'Input Node ID' })),\n\n enabled: S.optional(S.Boolean.annotations({ [SchemaAST.TitleAnnotationId]: 'Enabled' })),\n\n spec: S.optional(TriggerSchema),\n\n /**\n * Passed as the input data to the function.\n * Must match the function's input schema.\n *\n * @example\n * {\n * item: '{{$.trigger.event}}',\n * instructions: 'Summarize and perform entity-extraction'\n * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }\n * }\n */\n input: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n});\n\nexport type FunctionTriggerType = S.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})(FunctionTriggerSchema.fields) {}\n\n// TODO(wittjosiah): Remove?\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = S.Struct({\n functions: S.optional(S.mutable(S.Array(RawObject(FunctionType)))),\n triggers: S.optional(S.mutable(S.Array(RawObject(FunctionTrigger)))),\n});\nexport type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionType, FunctionTrigger];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ObjectMeta } from '@dxos/echo-schema';\nimport { type SpaceId } from '@dxos/keys';\n\n// TODO: use URL scheme for source?\nconst FUNCTIONS_META_KEY = 'dxos.org/service/function';\n\nexport const FUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';\n\nconst isSecure = (protocol: string) => {\n return protocol === 'https:' || protocol === 'wss:';\n};\n\nexport const getUserFunctionUrlInMetadata = (meta: ObjectMeta) => {\n return meta.keys.find((key) => key.source === FUNCTIONS_META_KEY)?.id;\n};\n\nexport const setUserFunctionUrlInMetadata = (meta: ObjectMeta, functionUrl: string) => {\n const key = meta.keys.find((key) => key.source === FUNCTIONS_META_KEY);\n if (key) {\n if (key.id !== functionUrl) {\n throw new Error('Metadata mismatch');\n }\n } else {\n meta.keys.push({ source: FUNCTIONS_META_KEY, id: functionUrl });\n }\n};\n\n/**\n * NOTE: functionId is backend ID, not ECHO object id.\n */\nexport const makeFunctionUrl = (spaceId: SpaceId, fn: { functionId: string }) => `/${spaceId}/${fn.functionId}`;\n\nexport const getInvocationUrl = (functionUrl: string, edgeUrl: string, options: InvocationOptions = {}) => {\n const baseUrl = new URL('functions/', edgeUrl);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = functionUrl.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n options.spaceId && url.searchParams.set('spaceId', options.spaceId);\n options.subjectId && url.searchParams.set('subjectId', options.subjectId);\n url.protocol = isSecure(url.protocol) ? 'https' : 'http';\n return url.toString();\n};\n\nexport type InvocationOptions = {\n spaceId?: SpaceId;\n subjectId?: string;\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,
|
|
6
|
-
"names": ["Schema", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport { type Effect } from 'effect';\n\nimport { type AIServiceClient } from '@dxos/assistant';\n// import { type Space } from '@dxos/client/echo';\nimport type { CoreDatabase, EchoDatabase } from '@dxos/echo-db';\nimport { type HasId } from '@dxos/echo-schema';\nimport { type SpaceId, type DXN } from '@dxos/keys';\nimport { type QueryResult } from '@dxos/protocols';\n\n// TODO(burdon): Model after http request. Ref Lambda/OpenFaaS.\n// https://docs.aws.amazon.com/lambda/latest/dg/typescript-handler.html\n// https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/#functions\n// https://www.npmjs.com/package/aws-lambda\n\n/**\n * Function handler.\n */\nexport type FunctionHandler<TData = {}, TOutput = any> = (params: {\n /**\n * Services and context available to the function.\n */\n context: FunctionContext;\n\n /**\n * Data passed as the input to the function.\n * Must match the function's input schema.\n * This will be the payload from the trigger or other data passed into the function in a workflow.\n */\n data: TData;\n}) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any>;\n\n/**\n * Function context.\n */\nexport interface FunctionContext {\n getSpace: (spaceId: SpaceId) => Promise<SpaceAPI>;\n\n /**\n * Space from which the function was invoked.\n */\n space: SpaceAPI | undefined;\n\n ai: AIServiceClient;\n}\n\nexport interface FunctionContextAi {\n // TODO(dmaretskyi): Refer to cloudflare AI docs for more comprehensive typedefs.\n run(model: string, inputs: any, options?: any): Promise<any>;\n}\n\n//\n// API.\n//\n\n// TODO(dmaretskyi): Temporary API to get the queues working.\n// TODO(dmaretskyi): To be replaced with integrating queues into echo.\nexport interface QueuesAPI {\n queryQueue(queue: DXN, options?: {}): Promise<QueryResult>;\n insertIntoQueue(queue: DXN, objects: HasId[]): Promise<void>;\n}\n\n/**\n * Space interface available to functions.\n */\nexport interface SpaceAPI {\n get id(): SpaceId;\n /**\n * @deprecated\n */\n get crud(): CoreDatabase;\n get db(): EchoDatabase;\n // TODO(dmaretskyi): Align with echo api --- queues.get(id).append(items);\n get queues(): QueuesAPI;\n}\n\n// TODO(wittjosiah): Queues are incompatible.\nconst __assertFunctionSpaceIsCompatibleWithTheClientSpace = () => {\n // const _: SpaceAPI = {} as Space;\n};\n\nexport type FunctionDefinition<T = {}, O = any> = {\n description?: string;\n inputSchema: Schema.Schema<T, any>;\n outputSchema?: Schema.Schema<O, any>;\n handler: FunctionHandler<T, O>;\n};\n\n// TODO(dmaretskyi): Bind input type to function handler.\nexport const defineFunction = <T, O>(params: FunctionDefinition<T, O>): FunctionDefinition<T, O> => {\n if (!Schema.isSchema(params.inputSchema)) {\n throw new Error('Input schema must be a valid schema');\n }\n if (typeof params.handler !== 'function') {\n throw new Error('Handler must be a function');\n }\n\n return {\n description: params.description,\n inputSchema: params.inputSchema,\n outputSchema: params.outputSchema ?? Schema.Any,\n handler: params.handler,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { EchoObject, JsonSchemaType, LabelAnnotationId, Ref, TypedObject } from '@dxos/echo-schema';\nimport { DataType } from '@dxos/schema';\n\n/**\n * Source script.\n */\nexport const ScriptType = Schema.Struct({\n name: Schema.optional(Schema.String),\n description: Schema.optional(Schema.String),\n // TODO(burdon): Change to hash of deployed content.\n // Whether source has changed since last deploy.\n changed: Schema.optional(Schema.Boolean),\n source: Ref(DataType.Text),\n})\n .annotations({ [LabelAnnotationId]: 'name' })\n .pipe(\n EchoObject({\n typename: 'dxos.org/type/Script',\n version: '0.1.0',\n }),\n );\n\nexport type ScriptType = Schema.Schema.Type<typeof ScriptType>;\n\n/**\n * Function deployment.\n */\nexport class FunctionType extends TypedObject({\n typename: 'dxos.org/type/Function',\n version: '0.1.0',\n})({\n // TODO(burdon): Rename to id/uri?\n name: Schema.NonEmptyString,\n version: Schema.String,\n\n description: Schema.optional(Schema.String),\n\n // Reference to a source script if it exists within ECHO.\n // TODO(burdon): Don't ref ScriptType directly (core).\n source: Schema.optional(Ref(ScriptType)),\n\n inputSchema: Schema.optional(JsonSchemaType),\n outputSchema: Schema.optional(JsonSchemaType),\n\n // Local binding to a function name.\n binding: Schema.optional(Schema.String),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { EchoObject, Expando, ObjectId, Ref } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\n\nimport { FunctionTrigger, type FunctionTriggerType } from './types';\n\nexport enum InvocationOutcome {\n SUCCESS = 'success',\n FAILURE = 'failure',\n PENDING = 'pending',\n}\n\n// TODO(burdon): Convert to extensible discriminated union of EDGE events.\nexport enum InvocationTraceEventType {\n START = 'start',\n END = 'end',\n}\n\nexport const TraceEventException = Schema.Struct({\n timestampMs: Schema.Number,\n message: Schema.String,\n name: Schema.String,\n stack: Schema.optional(Schema.String),\n});\nexport type TraceEventException = Schema.Schema.Type<typeof TraceEventException>;\n\nexport const InvocationTraceStartEvent = Schema.Struct({\n /**\n * Queue message id.\n */\n id: ObjectId,\n type: Schema.Literal(InvocationTraceEventType.START),\n /**\n * Invocation id, the same for invocation start and end events.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n timestampMs: Schema.Number,\n /**\n * Data passed to function / workflow as an argument.\n */\n // TODO(burdon): Input schema?\n input: Schema.Object,\n /**\n * Queue DXN for function/workflow invocation events.\n */\n // TODO(burdon): Need reference type for queue. vs. string?\n invocationTraceQueue: Ref(Expando),\n /**\n * DXN of the invoked function/workflow.\n */\n invocationTarget: Ref(Expando),\n /**\n * Present for automatic invocations.\n */\n trigger: Schema.optional(Ref(FunctionTrigger)),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceStart', version: '0.1.0' }));\n\nexport type InvocationTraceStartEvent = Schema.Schema.Type<typeof InvocationTraceStartEvent>;\n\nexport const InvocationTraceEndEvent = Schema.Struct({\n /**\n * Trace event id.\n */\n id: ObjectId,\n type: Schema.Literal(InvocationTraceEventType.END),\n /**\n * Invocation id, will be the same for invocation start and end.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n // TODO(burdon): Remove ms suffix.\n timestampMs: Schema.Number,\n outcome: Schema.Enums(InvocationOutcome),\n exception: Schema.optional(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceEnd', version: '0.1.0' }));\n\nexport type InvocationTraceEndEvent = Schema.Schema.Type<typeof InvocationTraceEndEvent>;\n\nexport type InvocationTraceEvent = InvocationTraceStartEvent | InvocationTraceEndEvent;\n\nexport const TraceEventLog = Schema.Struct({\n timestampMs: Schema.Number,\n level: Schema.String,\n message: Schema.String,\n context: Schema.optional(Schema.Object),\n});\n\nexport const TraceEvent = Schema.Struct({\n id: ObjectId,\n // TODO(burdon): Need enum/numeric result (not string).\n outcome: Schema.String,\n truncated: Schema.Boolean,\n /**\n * Time when the event was persisted.\n */\n ingestionTimestampMs: Schema.Number,\n logs: Schema.Array(TraceEventLog),\n exceptions: Schema.Array(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/TraceEvent', version: '0.1.0' }));\n\nexport type TraceEvent = Schema.Schema.Type<typeof TraceEvent>;\n\n/**\n * Deprecated InvocationTrace event format.\n * @deprecated\n */\n// TODO(burdon): Remove.\nexport type InvocationSpan = {\n id: string;\n timestampMs: number;\n outcome: InvocationOutcome;\n input: object;\n durationMs: number;\n invocationTraceQueue: Ref<Expando>;\n invocationTarget: Ref<Expando>;\n trigger?: Ref<FunctionTriggerType>;\n exception?: TraceEventException;\n};\n\nexport const createInvocationSpans = (items?: InvocationTraceEvent[]): InvocationSpan[] => {\n if (!items) {\n return [];\n }\n\n const eventsByInvocationId = new Map<string, { start?: InvocationTraceStartEvent; end?: InvocationTraceEndEvent }>();\n for (const event of items) {\n if (!('invocationId' in event)) {\n // Skip legacy format entries.\n continue;\n }\n\n const invocationId = event.invocationId;\n const entry = eventsByInvocationId.get(invocationId) || { start: undefined, end: undefined };\n if (event.type === InvocationTraceEventType.START) {\n entry.start = event as InvocationTraceStartEvent;\n } else if (event.type === InvocationTraceEventType.END) {\n entry.end = event as InvocationTraceEndEvent;\n }\n\n eventsByInvocationId.set(invocationId, entry);\n }\n\n const now = Date.now();\n const result: InvocationSpan[] = [];\n\n // Create spans for each invocation\n for (const [invocationId, { start, end }] of eventsByInvocationId.entries()) {\n if (!start) {\n // No start event, can't create a meaningful span\n log.warn('found end event without matching start', { invocationId });\n continue;\n }\n\n const isInProgress = end === undefined;\n\n result.push({\n id: invocationId,\n timestampMs: start.timestampMs,\n durationMs: isInProgress ? now - start.timestampMs : end!.timestampMs - start.timestampMs,\n outcome: end?.outcome ?? InvocationOutcome.PENDING,\n exception: end?.exception,\n input: start.input,\n invocationTraceQueue: start.invocationTraceQueue,\n invocationTarget: start.invocationTarget,\n trigger: start.trigger,\n });\n }\n\n return result;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema, SchemaAST } from 'effect';\n\nimport { Expando, OptionsAnnotationId, TypedObject, DXN, Ref, RawObject } from '@dxos/echo-schema';\n\nimport { FunctionType } from './schema';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n Email = 'email',\n Queue = 'queue',\n}\n\nconst kindLiteralAnnotations = { [SchemaAST.TitleAnnotationId]: 'Kind' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Timer).annotations(kindLiteralAnnotations),\n cron: Schema.String.annotations({\n [SchemaAST.TitleAnnotationId]: 'Cron',\n [SchemaAST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(Schema.mutable);\nexport type TimerTrigger = Schema.Schema.Type<typeof TimerTriggerSchema>;\n\nconst EmailTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Email).annotations(kindLiteralAnnotations),\n}).pipe(Schema.mutable);\nexport type EmailTrigger = Schema.Schema.Type<typeof EmailTriggerSchema>;\n\nconst QueueTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Queue).annotations(kindLiteralAnnotations),\n queue: DXN,\n}).pipe(Schema.mutable);\nexport type QueueTrigger = Schema.Schema.Type<typeof QueueTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Webhook).annotations(kindLiteralAnnotations),\n method: Schema.optional(\n Schema.String.annotations({\n [SchemaAST.TitleAnnotationId]: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: Schema.optional(\n Schema.Number.annotations({\n [SchemaAST.TitleAnnotationId]: 'Port',\n }),\n ),\n}).pipe(Schema.mutable);\nexport type WebhookTrigger = Schema.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = Schema.Struct({\n type: Schema.optional(Schema.String.annotations({ [SchemaAST.TitleAnnotationId]: 'Type' })),\n props: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n}).annotations({ [SchemaAST.TitleAnnotationId]: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Subscription).annotations(kindLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\n options: Schema.optional(\n Schema.Struct({\n // Watch changes to object (not just creation).\n deep: Schema.optional(Schema.Boolean.annotations({ [SchemaAST.TitleAnnotationId]: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: Schema.optional(Schema.Number.annotations({ [SchemaAST.TitleAnnotationId]: 'Delay' })),\n }).annotations({ [SchemaAST.TitleAnnotationId]: 'Options' }),\n ),\n}).pipe(Schema.mutable);\nexport type SubscriptionTrigger = Schema.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = Schema.Union(\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n EmailTriggerSchema,\n QueueTriggerSchema,\n).annotations({\n [SchemaAST.TitleAnnotationId]: 'Trigger',\n});\nexport type TriggerType = Schema.Schema.Type<typeof TriggerSchema>;\n\nexport type EventType =\n | EmailTriggerOutput\n | WebhookTriggerOutput\n | QueueTriggerOutput\n | SubscriptionTriggerOutput\n | TimerTriggerOutput;\n\n// TODO(burdon): Reuse trigger schema from @dxos/functions (TriggerType).\nexport const EmailTriggerOutput = Schema.mutable(\n Schema.Struct({\n from: Schema.String,\n to: Schema.String,\n subject: Schema.String,\n created: Schema.String,\n body: Schema.String,\n }),\n);\nexport type EmailTriggerOutput = Schema.Schema.Type<typeof EmailTriggerOutput>;\n\nexport const WebhookTriggerOutput = Schema.mutable(\n Schema.Struct({\n url: Schema.String,\n method: Schema.Literal('GET', 'POST'),\n headers: Schema.Record({ key: Schema.String, value: Schema.String }),\n bodyText: Schema.String,\n }),\n);\nexport type WebhookTriggerOutput = Schema.Schema.Type<typeof WebhookTriggerOutput>;\n\nexport const QueueTriggerOutput = Schema.mutable(\n Schema.Struct({\n queue: DXN,\n item: Schema.Any,\n cursor: Schema.String,\n }),\n);\nexport type QueueTriggerOutput = Schema.Schema.Type<typeof QueueTriggerOutput>;\n\nexport const SubscriptionTriggerOutput = Schema.mutable(\n Schema.Struct({ type: Schema.String, changedObjectId: Schema.String }),\n);\nexport type SubscriptionTriggerOutput = Schema.Schema.Type<typeof SubscriptionTriggerOutput>;\n\nexport const TimerTriggerOutput = Schema.mutable(Schema.Struct({ tick: Schema.Number }));\nexport type TimerTriggerOutput = Schema.Schema.Type<typeof TimerTriggerOutput>;\n\n/**\n * Function trigger.\n * Function is invoked with the `payload` passed as input data.\n * The event that triggers the function is available in the function context.\n */\nexport const FunctionTriggerSchema = Schema.Struct({\n /**\n * Function or workflow to invoke.\n */\n // TODO(dmaretskyi): Can be a Ref(FunctionType) or Ref(ComputeGraphType).\n function: Schema.optional(Ref(Expando).annotations({ [SchemaAST.TitleAnnotationId]: 'Function' })),\n\n /**\n * Only used for workflowSchema.\n * Specifies the input node in the circuit.\n * @deprecated Remove and enforce a single input node in all compute graphSchema.\n */\n inputNodeId: Schema.optional(Schema.String.annotations({ [SchemaAST.TitleAnnotationId]: 'Input Node ID' })),\n\n enabled: Schema.optional(Schema.Boolean.annotations({ [SchemaAST.TitleAnnotationId]: 'Enabled' })),\n\n spec: Schema.optional(TriggerSchema),\n\n /**\n * Passed as the input data to the function.\n * Must match the function's input schema.\n *\n * @example\n * {\n * item: '{{$.trigger.event}}',\n * instructions: 'Summarize and perform entity-extraction'\n * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }\n * }\n */\n input: Schema.optional(Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.Any }))),\n});\n\nexport type FunctionTriggerType = Schema.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.2.0',\n})(FunctionTriggerSchema.fields) {}\n\n// TODO(wittjosiah): Remove?\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = Schema.Struct({\n functions: Schema.optional(Schema.mutable(Schema.Array(RawObject(FunctionType)))),\n triggers: Schema.optional(Schema.mutable(Schema.Array(RawObject(FunctionTrigger)))),\n});\nexport type FunctionManifest = Schema.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionType, FunctionTrigger];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ObjectMeta } from '@dxos/echo-schema';\nimport { type SpaceId } from '@dxos/keys';\n\n// TODO: use URL scheme for source?\nconst FUNCTIONS_META_KEY = 'dxos.org/service/function';\n\nexport const FUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';\n\nconst isSecure = (protocol: string) => {\n return protocol === 'https:' || protocol === 'wss:';\n};\n\nexport const getUserFunctionUrlInMetadata = (meta: ObjectMeta) => {\n return meta.keys.find((key) => key.source === FUNCTIONS_META_KEY)?.id;\n};\n\nexport const setUserFunctionUrlInMetadata = (meta: ObjectMeta, functionUrl: string) => {\n const key = meta.keys.find((key) => key.source === FUNCTIONS_META_KEY);\n if (key) {\n if (key.id !== functionUrl) {\n throw new Error('Metadata mismatch');\n }\n } else {\n meta.keys.push({ source: FUNCTIONS_META_KEY, id: functionUrl });\n }\n};\n\n/**\n * NOTE: functionId is backend ID, not ECHO object id.\n */\nexport const makeFunctionUrl = (fn: { functionId: string }) => `/${fn.functionId}`;\n\nexport const getInvocationUrl = (functionUrl: string, edgeUrl: string, options: InvocationOptions = {}) => {\n const baseUrl = new URL('functions/', edgeUrl);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = functionUrl.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n options.spaceId && url.searchParams.set('spaceId', options.spaceId);\n options.subjectId && url.searchParams.set('subjectId', options.subjectId);\n url.protocol = isSecure(url.protocol) ? 'https' : 'http';\n return url.toString();\n};\n\nexport type InvocationOptions = {\n spaceId?: SpaceId;\n subjectId?: string;\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAc;AAyFhB,IAAMC,iBAAiB,CAAOC,W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ema", "defineFunction", "params", "Schema", "isSchema", "inputSchema", "Error", "handler", "description", "outputSchema", "Any", "Schema", "EchoObject", "JsonSchemaType", "LabelAnnotationId", "Ref", "TypedObject", "DataType", "ScriptType", "Schema", "Struct", "name", "optional", "String", "description", "changed", "Boolean", "source", "Ref", "DataType", "Text", "annotations", "LabelAnnotationId", "pipe", "EchoObject", "typename", "version", "FunctionType", "TypedObject", "NonEmptyString", "inputSchema", "JsonSchemaType", "outputSchema", "binding", "Schema", "EchoObject", "Expando", "ObjectId", "Ref", "log", "Schema", "SchemaAST", "Expando", "OptionsAnnotationId", "TypedObject", "DXN", "Ref", "RawObject", "TriggerKind", "kindLiteralAnnotations", "SchemaAST", "TitleAnnotationId", "TimerTriggerSchema", "Schema", "Struct", "kind", "Literal", "annotations", "cron", "String", "ExamplesAnnotationId", "pipe", "mutable", "EmailTriggerSchema", "QueueTriggerSchema", "queue", "DXN", "WebhookTriggerSchema", "method", "optional", "OptionsAnnotationId", "port", "Number", "QuerySchema", "type", "props", "Record", "key", "value", "Any", "SubscriptionTriggerSchema", "filter", "options", "deep", "Boolean", "delay", "TriggerSchema", "Union", "EmailTriggerOutput", "from", "to", "subject", "created", "body", "WebhookTriggerOutput", "url", "headers", "bodyText", "QueueTriggerOutput", "item", "cursor", "SubscriptionTriggerOutput", "changedObjectId", "TimerTriggerOutput", "tick", "FunctionTriggerSchema", "function", "Ref", "Expando", "inputNodeId", "enabled", "spec", "input", "FunctionTrigger", "TypedObject", "typename", "version", "fields", "FunctionManifestSchema", "functions", "Array", "RawObject", "FunctionType", "triggers", "FUNCTION_TYPES", "InvocationOutcome", "InvocationTraceEventType", "TraceEventException", "Schema", "Struct", "timestampMs", "Number", "message", "String", "name", "stack", "optional", "InvocationTraceStartEvent", "id", "ObjectId", "type", "Literal", "invocationId", "input", "Object", "invocationTraceQueue", "Ref", "Expando", "invocationTarget", "trigger", "FunctionTrigger", "pipe", "EchoObject", "typename", "version", "InvocationTraceEndEvent", "outcome", "Enums", "exception", "TraceEventLog", "level", "context", "TraceEvent", "truncated", "Boolean", "ingestionTimestampMs", "logs", "Array", "exceptions", "createInvocationSpans", "items", "eventsByInvocationId", "Map", "event", "entry", "get", "start", "undefined", "end", "set", "now", "Date", "result", "entries", "log", "warn", "isInProgress", "push", "durationMs", "FUNCTIONS_META_KEY", "FUNCTIONS_PRESET_META_KEY", "isSecure", "protocol", "getUserFunctionUrlInMetadata", "meta", "keys", "find", "key", "source", "id", "setUserFunctionUrlInMetadata", "functionUrl", "Error", "push", "makeFunctionUrl", "fn", "functionId", "getInvocationUrl", "edgeUrl", "options", "baseUrl", "URL", "relativeUrl", "replace", "url", "toString", "spaceId", "searchParams", "set", "subjectId"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30383,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":502,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30383,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":502,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":6457,"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/edge/index.ts":{"bytes":909,"imports":[{"path":"packages/core/functions/src/edge/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":6118,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/schema.ts":{"bytes":5170,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types.ts":{"bytes":22432,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/core/functions/src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"},"packages/core/functions/src/trace.ts":{"bytes":16775,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/url.ts":{"bytes":6090,"imports":[],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":821,"imports":[{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/core/functions/src/trace.ts","kind":"import-statement","original":"./trace"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/url.ts","kind":"import-statement","original":"./url"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/node-esm/bundler/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14436},"packages/core/functions/dist/lib/node-esm/bundler/index.mjs":{"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Bundler","initializeBundler"],"entryPoint":"packages/core/functions/src/bundler/index.ts","inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytesInOutput":7125},"packages/core/functions/src/bundler/index.ts":{"bytesInOutput":0}},"bytes":7346},"packages/core/functions/dist/lib/node-esm/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3205},"packages/core/functions/dist/lib/node-esm/edge/index.mjs":{"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":1632},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":1886},"packages/core/functions/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":29620},"packages/core/functions/dist/lib/node-esm/index.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["EmailTriggerOutput","FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","QueueTriggerOutput","ScriptType","SubscriptionTriggerOutput","TimerTriggerOutput","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","WebhookTriggerOutput","createInvocationSpans","defineFunction","getInvocationUrl","getUserFunctionUrlInMetadata","makeFunctionUrl","setUserFunctionUrlInMetadata"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/handler.ts":{"bytesInOutput":453},"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/schema.ts":{"bytesInOutput":1226},"packages/core/functions/src/trace.ts":{"bytesInOutput":4316},"packages/core/functions/src/types.ts":{"bytesInOutput":5011},"packages/core/functions/src/url.ts":{"bytesInOutput":1189}},"bytes":13183}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../../src/bundler/bundler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAqB,KAAK,WAAW,EAAe,MAAM,cAAc,CAAC;AAMhF,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACnC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC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