@dxos/functions 0.8.4-main.1da679c → 0.8.4-main.21d9917

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 (198) hide show
  1. package/dist/lib/browser/index.mjs +1022 -1123
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +1022 -1123
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/errors.d.ts +44 -60
  8. package/dist/types/src/errors.d.ts.map +1 -1
  9. package/dist/types/src/{examples → example}/fib.d.ts +1 -1
  10. package/dist/types/src/example/fib.d.ts.map +1 -0
  11. package/dist/types/src/example/forex-effect.d.ts +3 -0
  12. package/dist/types/src/example/forex-effect.d.ts.map +1 -0
  13. package/dist/types/src/example/index.d.ts +12 -0
  14. package/dist/types/src/example/index.d.ts.map +1 -0
  15. package/dist/types/src/{examples → example}/reply.d.ts +1 -1
  16. package/dist/types/src/example/reply.d.ts.map +1 -0
  17. package/dist/types/src/{examples → example}/sleep.d.ts +1 -1
  18. package/dist/types/src/example/sleep.d.ts.map +1 -0
  19. package/dist/types/src/index.d.ts +4 -8
  20. package/dist/types/src/index.d.ts.map +1 -1
  21. package/dist/types/src/operation-compatibility.test.d.ts +2 -0
  22. package/dist/types/src/operation-compatibility.test.d.ts.map +1 -0
  23. package/dist/types/src/protocol/functions-ai-http-client.d.ts +12 -0
  24. package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -0
  25. package/dist/types/src/protocol/index.d.ts +2 -0
  26. package/dist/types/src/protocol/index.d.ts.map +1 -0
  27. package/dist/types/src/protocol/protocol.d.ts +7 -0
  28. package/dist/types/src/protocol/protocol.d.ts.map +1 -0
  29. package/dist/types/src/protocol/protocol.test.d.ts +2 -0
  30. package/dist/types/src/protocol/protocol.test.d.ts.map +1 -0
  31. package/dist/types/src/sdk.d.ts +114 -0
  32. package/dist/types/src/sdk.d.ts.map +1 -0
  33. package/dist/types/src/services/credentials.d.ts +12 -6
  34. package/dist/types/src/services/credentials.d.ts.map +1 -1
  35. package/dist/types/src/services/event-logger.d.ts +37 -28
  36. package/dist/types/src/services/event-logger.d.ts.map +1 -1
  37. package/dist/types/src/services/function-invocation-service.d.ts +16 -0
  38. package/dist/types/src/services/function-invocation-service.d.ts.map +1 -0
  39. package/dist/types/src/services/index.d.ts +5 -6
  40. package/dist/types/src/services/index.d.ts.map +1 -1
  41. package/dist/types/src/services/queues.d.ts +7 -5
  42. package/dist/types/src/services/queues.d.ts.map +1 -1
  43. package/dist/types/src/services/tracing.d.ts +45 -14
  44. package/dist/types/src/services/tracing.d.ts.map +1 -1
  45. package/dist/types/src/types/Function.d.ts +52 -0
  46. package/dist/types/src/types/Function.d.ts.map +1 -0
  47. package/dist/types/src/types/Script.d.ts +21 -0
  48. package/dist/types/src/types/Script.d.ts.map +1 -0
  49. package/dist/types/src/types/Trigger.d.ts +121 -0
  50. package/dist/types/src/types/Trigger.d.ts.map +1 -0
  51. package/dist/types/src/types/TriggerEvent.d.ts +74 -0
  52. package/dist/types/src/types/TriggerEvent.d.ts.map +1 -0
  53. package/dist/types/src/types/index.d.ts +6 -0
  54. package/dist/types/src/types/index.d.ts.map +1 -0
  55. package/dist/types/src/types/url.d.ts +13 -0
  56. package/dist/types/src/types/url.d.ts.map +1 -0
  57. package/dist/types/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +23 -70
  59. package/src/errors.ts +4 -4
  60. package/src/{examples → example}/fib.ts +5 -3
  61. package/src/example/forex-effect.ts +40 -0
  62. package/src/example/index.ts +13 -0
  63. package/src/{examples → example}/reply.ts +6 -3
  64. package/src/{examples → example}/sleep.ts +5 -3
  65. package/src/index.ts +4 -8
  66. package/src/operation-compatibility.test.ts +185 -0
  67. package/src/protocol/functions-ai-http-client.ts +67 -0
  68. package/src/{executor → protocol}/index.ts +1 -1
  69. package/src/protocol/protocol.test.ts +59 -0
  70. package/src/protocol/protocol.ts +262 -0
  71. package/src/sdk.ts +289 -0
  72. package/src/services/credentials.ts +41 -19
  73. package/src/services/event-logger.ts +14 -5
  74. package/src/services/function-invocation-service.ts +37 -0
  75. package/src/services/index.ts +5 -6
  76. package/src/services/queues.ts +8 -8
  77. package/src/services/tracing.ts +84 -57
  78. package/src/types/Function.ts +82 -0
  79. package/src/types/Script.ts +34 -0
  80. package/src/types/Trigger.ts +143 -0
  81. package/src/types/TriggerEvent.ts +68 -0
  82. package/src/types/index.ts +9 -0
  83. package/src/types/url.ts +32 -0
  84. package/dist/lib/browser/bundler/index.mjs +0 -265
  85. package/dist/lib/browser/bundler/index.mjs.map +0 -7
  86. package/dist/lib/browser/chunk-D2XO7XXY.mjs +0 -611
  87. package/dist/lib/browser/chunk-D2XO7XXY.mjs.map +0 -7
  88. package/dist/lib/browser/chunk-J5LGTIGS.mjs +0 -10
  89. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +0 -7
  90. package/dist/lib/browser/edge/index.mjs +0 -83
  91. package/dist/lib/browser/edge/index.mjs.map +0 -7
  92. package/dist/lib/browser/testing/index.mjs +0 -129
  93. package/dist/lib/browser/testing/index.mjs.map +0 -7
  94. package/dist/lib/node-esm/bundler/index.mjs +0 -266
  95. package/dist/lib/node-esm/bundler/index.mjs.map +0 -7
  96. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  97. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
  98. package/dist/lib/node-esm/chunk-Z4CJ62WS.mjs +0 -613
  99. package/dist/lib/node-esm/chunk-Z4CJ62WS.mjs.map +0 -7
  100. package/dist/lib/node-esm/edge/index.mjs +0 -84
  101. package/dist/lib/node-esm/edge/index.mjs.map +0 -7
  102. package/dist/lib/node-esm/testing/index.mjs +0 -130
  103. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  104. package/dist/types/src/bundler/bundler.d.ts +0 -49
  105. package/dist/types/src/bundler/bundler.d.ts.map +0 -1
  106. package/dist/types/src/bundler/bundler.test.d.ts +0 -2
  107. package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
  108. package/dist/types/src/bundler/index.d.ts +0 -2
  109. package/dist/types/src/bundler/index.d.ts.map +0 -1
  110. package/dist/types/src/edge/functions.d.ts +0 -17
  111. package/dist/types/src/edge/functions.d.ts.map +0 -1
  112. package/dist/types/src/edge/index.d.ts +0 -2
  113. package/dist/types/src/edge/index.d.ts.map +0 -1
  114. package/dist/types/src/examples/fib.d.ts.map +0 -1
  115. package/dist/types/src/examples/index.d.ts +0 -4
  116. package/dist/types/src/examples/index.d.ts.map +0 -1
  117. package/dist/types/src/examples/reply.d.ts.map +0 -1
  118. package/dist/types/src/examples/sleep.d.ts.map +0 -1
  119. package/dist/types/src/executor/executor.d.ts +0 -11
  120. package/dist/types/src/executor/executor.d.ts.map +0 -1
  121. package/dist/types/src/executor/index.d.ts +0 -2
  122. package/dist/types/src/executor/index.d.ts.map +0 -1
  123. package/dist/types/src/handler.d.ts +0 -94
  124. package/dist/types/src/handler.d.ts.map +0 -1
  125. package/dist/types/src/schema.d.ts +0 -43
  126. package/dist/types/src/schema.d.ts.map +0 -1
  127. package/dist/types/src/services/database.d.ts +0 -63
  128. package/dist/types/src/services/database.d.ts.map +0 -1
  129. package/dist/types/src/services/local-function-execution.d.ts +0 -25
  130. package/dist/types/src/services/local-function-execution.d.ts.map +0 -1
  131. package/dist/types/src/services/remote-function-execution-service.d.ts +0 -15
  132. package/dist/types/src/services/remote-function-execution-service.d.ts.map +0 -1
  133. package/dist/types/src/services/service-container.d.ts +0 -56
  134. package/dist/types/src/services/service-container.d.ts.map +0 -1
  135. package/dist/types/src/services/service-registry.d.ts +0 -29
  136. package/dist/types/src/services/service-registry.d.ts.map +0 -1
  137. package/dist/types/src/services/service-registry.test.d.ts +0 -2
  138. package/dist/types/src/services/service-registry.test.d.ts.map +0 -1
  139. package/dist/types/src/testing/index.d.ts +0 -3
  140. package/dist/types/src/testing/index.d.ts.map +0 -1
  141. package/dist/types/src/testing/layer.d.ts +0 -15
  142. package/dist/types/src/testing/layer.d.ts.map +0 -1
  143. package/dist/types/src/testing/logger.d.ts +0 -5
  144. package/dist/types/src/testing/logger.d.ts.map +0 -1
  145. package/dist/types/src/testing/persist-database.test.d.ts +0 -2
  146. package/dist/types/src/testing/persist-database.test.d.ts.map +0 -1
  147. package/dist/types/src/testing/services.d.ts +0 -59
  148. package/dist/types/src/testing/services.d.ts.map +0 -1
  149. package/dist/types/src/trace.d.ts +0 -122
  150. package/dist/types/src/trace.d.ts.map +0 -1
  151. package/dist/types/src/translations.d.ts +0 -12
  152. package/dist/types/src/translations.d.ts.map +0 -1
  153. package/dist/types/src/triggers/index.d.ts +0 -4
  154. package/dist/types/src/triggers/index.d.ts.map +0 -1
  155. package/dist/types/src/triggers/input-builder.d.ts +0 -3
  156. package/dist/types/src/triggers/input-builder.d.ts.map +0 -1
  157. package/dist/types/src/triggers/invocation-tracer.d.ts +0 -35
  158. package/dist/types/src/triggers/invocation-tracer.d.ts.map +0 -1
  159. package/dist/types/src/triggers/trigger-dispatcher.d.ts +0 -75
  160. package/dist/types/src/triggers/trigger-dispatcher.d.ts.map +0 -1
  161. package/dist/types/src/triggers/trigger-dispatcher.test.d.ts +0 -2
  162. package/dist/types/src/triggers/trigger-dispatcher.test.d.ts.map +0 -1
  163. package/dist/types/src/triggers/trigger-state-store.d.ts +0 -27
  164. package/dist/types/src/triggers/trigger-state-store.d.ts.map +0 -1
  165. package/dist/types/src/types.d.ts +0 -221
  166. package/dist/types/src/types.d.ts.map +0 -1
  167. package/dist/types/src/url.d.ts +0 -21
  168. package/dist/types/src/url.d.ts.map +0 -1
  169. package/src/bundler/bundler.test.ts +0 -58
  170. package/src/bundler/bundler.ts +0 -291
  171. package/src/bundler/index.ts +0 -5
  172. package/src/edge/functions.ts +0 -67
  173. package/src/edge/index.ts +0 -9
  174. package/src/examples/index.ts +0 -7
  175. package/src/executor/executor.ts +0 -54
  176. package/src/handler.ts +0 -203
  177. package/src/schema.ts +0 -68
  178. package/src/services/database.ts +0 -171
  179. package/src/services/local-function-execution.ts +0 -127
  180. package/src/services/remote-function-execution-service.ts +0 -46
  181. package/src/services/service-container.ts +0 -114
  182. package/src/services/service-registry.test.ts +0 -42
  183. package/src/services/service-registry.ts +0 -59
  184. package/src/testing/index.ts +0 -6
  185. package/src/testing/layer.ts +0 -111
  186. package/src/testing/logger.ts +0 -16
  187. package/src/testing/persist-database.test.ts +0 -87
  188. package/src/testing/services.ts +0 -115
  189. package/src/trace.ts +0 -178
  190. package/src/translations.ts +0 -20
  191. package/src/triggers/index.ts +0 -7
  192. package/src/triggers/input-builder.ts +0 -35
  193. package/src/triggers/invocation-tracer.ts +0 -99
  194. package/src/triggers/trigger-dispatcher.test.ts +0 -652
  195. package/src/triggers/trigger-dispatcher.ts +0 -516
  196. package/src/triggers/trigger-state-store.ts +0 -60
  197. package/src/types.ts +0 -214
  198. package/src/url.ts +0 -55
@@ -1,6 +1,10 @@
1
- import { HttpClient } from '@effect/platform';
2
- import { type Config, Context, Effect, Layer, Redacted } from 'effect';
3
- import { DatabaseService } from './database';
1
+ import * as HttpClient from '@effect/platform/HttpClient';
2
+ import type * as Config from 'effect/Config';
3
+ import * as Context from 'effect/Context';
4
+ import * as Effect from 'effect/Effect';
5
+ import * as Layer from 'effect/Layer';
6
+ import * as Redacted from 'effect/Redacted';
7
+ import { Database } from '@dxos/echo';
4
8
  export type CredentialQuery = {
5
9
  service?: string;
6
10
  };
@@ -27,7 +31,9 @@ export declare class CredentialsService extends CredentialsService_base {
27
31
  service: string;
28
32
  apiKey: Config.Config<Redacted.Redacted<string>>;
29
33
  }[]) => Layer.Layer<CredentialsService, import("effect/ConfigError").ConfigError, never>;
30
- static layerFromDatabase: () => Layer.Layer<CredentialsService, never, DatabaseService>;
34
+ static layerFromDatabase: ({ caching }?: {
35
+ caching?: boolean;
36
+ }) => Layer.Layer<CredentialsService, never, Database.Service>;
31
37
  }
32
38
  export declare class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {
33
39
  private readonly credentials;
@@ -37,8 +43,8 @@ export declare class ConfiguredCredentialsService implements Context.Tag.Service
37
43
  getCredential(query: CredentialQuery): Promise<ServiceCredential>;
38
44
  }
39
45
  /**
40
- * Maps the request to include the API key from the credential.
46
+ * Maps the request to include the given token in the Authorization header.
41
47
  */
42
- export declare const withAuthorization: (query: CredentialQuery, kind?: "Bearer" | "Basic") => <E, R>(self: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, CredentialsService | R>;
48
+ export declare const withAuthorization: (token: string, kind?: "Bearer" | "Basic") => <E, R>(self: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, R>;
43
49
  export {};
44
50
  //# sourceMappingURL=credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAKvE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAGhB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;;IAKE;;OAEG;sBACe,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAE1E;;;OAGG;mBACY,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,iBAAiB,CAAC;;AAZzE,qBAAa,kBAAmB,SAAQ,uBAcrC;IACD,MAAM,CAAC,aAAa,GAAI,OAAO,e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CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,GAAE,iBAAiB,EAAO;IAElE,cAAc,CAAC,WAAW,EAAE,iBAAiB,EAAE,GAAG,4BAA4B;IAKxE,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAItE,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAQxE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,EAAE,OAAO,QAAQ,GAAG,OAAO,uFAItE,CAAC"}
@@ -1,15 +1,24 @@
1
- import { Context, Effect, Layer, Schema } from 'effect';
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Layer from 'effect/Layer';
4
+ import * as Schema from 'effect/Schema';
2
5
  import { Type } from '@dxos/echo';
3
6
  import { LogLevel } from '@dxos/log';
4
7
  import { TracingService } from './tracing';
5
8
  export declare const ComputeEventPayload: Schema.Union<[Schema.Struct<{
6
9
  type: Schema.Literal<["begin-compute"]>;
7
10
  nodeId: typeof Schema.String;
8
- inputs: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
11
+ /**
12
+ * Names of the inputs begin computed.
13
+ */
14
+ inputs: Schema.Array$<typeof Schema.String>;
9
15
  }>, Schema.Struct<{
10
16
  type: Schema.Literal<["end-compute"]>;
11
17
  nodeId: typeof Schema.String;
12
- outputs: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
18
+ /**
19
+ * Names of the outputs computed.
20
+ */
21
+ outputs: Schema.Array$<typeof Schema.String>;
13
22
  }>, Schema.Struct<{
14
23
  type: Schema.Literal<["compute-input"]>;
15
24
  nodeId: typeof Schema.String;
@@ -26,31 +35,31 @@ export declare const ComputeEventPayload: Schema.Union<[Schema.Struct<{
26
35
  event: typeof Schema.Any;
27
36
  }>]>;
28
37
  export type ComputeEventPayload = Schema.Schema.Type<typeof ComputeEventPayload>;
29
- export declare const ComputeEvent: Type.obj<Schema.Struct<{
30
- payload: Schema.Union<[Schema.Struct<{
31
- type: Schema.Literal<["begin-compute"]>;
32
- nodeId: typeof Schema.String;
33
- inputs: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
34
- }>, Schema.Struct<{
35
- type: Schema.Literal<["end-compute"]>;
36
- nodeId: typeof Schema.String;
37
- outputs: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
38
- }>, Schema.Struct<{
39
- type: Schema.Literal<["compute-input"]>;
40
- nodeId: typeof Schema.String;
41
- property: typeof Schema.String;
42
- value: typeof Schema.Any;
43
- }>, Schema.Struct<{
44
- type: Schema.Literal<["compute-output"]>;
45
- nodeId: typeof Schema.String;
46
- property: typeof Schema.String;
47
- value: typeof Schema.Any;
48
- }>, Schema.Struct<{
49
- type: Schema.Literal<["custom"]>;
50
- nodeId: typeof Schema.String;
51
- event: typeof Schema.Any;
52
- }>]>;
53
- }>>;
38
+ export declare const ComputeEvent: Type.Obj<{
39
+ readonly payload: {
40
+ readonly type: "begin-compute";
41
+ readonly nodeId: string;
42
+ readonly inputs: readonly string[];
43
+ } | {
44
+ readonly type: "end-compute";
45
+ readonly nodeId: string;
46
+ readonly outputs: readonly string[];
47
+ } | {
48
+ readonly type: "compute-input";
49
+ readonly value: any;
50
+ readonly nodeId: string;
51
+ readonly property: string;
52
+ } | {
53
+ readonly type: "compute-output";
54
+ readonly value: any;
55
+ readonly nodeId: string;
56
+ readonly property: string;
57
+ } | {
58
+ readonly type: "custom";
59
+ readonly nodeId: string;
60
+ readonly event: any;
61
+ };
62
+ }, Schema.Struct.Fields>;
54
63
  declare const ComputeEventLogger_base: Context.TagClass<ComputeEventLogger, "@dxos/functions/ComputeEventLogger", {
55
64
  readonly log: (event: ComputeEventPayload) => void;
56
65
  readonly nodeId: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../../../src/services/event-logger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OA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
@@ -0,0 +1,16 @@
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Layer from 'effect/Layer';
4
+ import type { FunctionNotFoundError } from '../errors';
5
+ import { type FunctionDefinition, type InvocationServices } from '../sdk';
6
+ declare const FunctionInvocationService_base: Context.TagClass<FunctionInvocationService, "@dxos/functions/FunctionInvocationService", {
7
+ invokeFunction<I, O>(functionDef: FunctionDefinition<I, O, any>, input: I): Effect.Effect<O, never, InvocationServices>;
8
+ resolveFunction(key: string): Effect.Effect<FunctionDefinition.Any, FunctionNotFoundError>;
9
+ }>;
10
+ export declare class FunctionInvocationService extends FunctionInvocationService_base {
11
+ static layerNotAvailable: Layer.Layer<FunctionInvocationService, never, never>;
12
+ static invokeFunction: <I, O>(functionDef: FunctionDefinition<I, O, any>, input: I) => Effect.Effect<O, never, FunctionInvocationService | InvocationServices>;
13
+ static resolveFunction: (key: string) => Effect.Effect<FunctionDefinition.Any, FunctionNotFoundError, FunctionInvocationService>;
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=function-invocation-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-invocation-service.d.ts","sourceRoot":"","sources":["../../../../src/services/function-invocation-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;;mBAKvD,CAAC,EAAE,CAAC,eACJ,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SACnC,CAAC,GACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC;yBAEzB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,qBAAqB,CAAC;;AAR9F,qBAAa,yBAA0B,SAAQ,8BAU5C;IACD,MAAM,CAAC,iBAAiB,uDAGrB;IAEH,MAAM,CAAC,cAAc,GAAI,CAAC,EAAE,CAAC,EAC3B,aAAa,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAC1C,OAAO,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,GAAG,kBAAkB,CAAC,CACyC;IAEnH,MAAM,CAAC,eAAe,GACpB,KAAK,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACW;CACtG"}
@@ -1,9 +1,8 @@
1
- export * from './database';
2
- export * from './queues';
3
- export * from './service-container';
4
1
  export * from './credentials';
5
- export * from './tracing';
2
+ export { ConfiguredCredentialsService, type ServiceCredential } from './credentials';
6
3
  export * from './event-logger';
7
- export * from './remote-function-execution-service';
8
- export * from './local-function-execution';
4
+ export { createEventLogger, createDefectLogger } from './event-logger';
5
+ export * from './function-invocation-service';
6
+ export * from './queues';
7
+ export * from './tracing';
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrF,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -1,5 +1,7 @@
1
- import { Context, Effect, Layer } from 'effect';
2
- import type { Obj, Relation } from '@dxos/echo';
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Layer from 'effect/Layer';
4
+ import type { Entity } from '@dxos/echo';
3
5
  import type { Queue, QueueAPI, QueueFactory } from '@dxos/echo-db';
4
6
  import type { DXN, QueueSubspaceTag } from '@dxos/keys';
5
7
  declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions/QueueService", {
@@ -23,14 +25,14 @@ export declare class QueueService extends QueueService_base {
23
25
  /**
24
26
  * Gets a queue by its DXN.
25
27
  */
26
- static getQueue: <T extends Obj.Any | Relation.Any = Obj.Any | Relation.Any>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
28
+ static getQueue: <T extends Entity.Unknown = Entity.Unknown>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
27
29
  /**
28
30
  * Creates a new queue.
29
31
  */
30
- static createQueue: <T extends Obj.Any | Relation.Any = Obj.Any | Relation.Any>(options?: {
32
+ static createQueue: <T extends Entity.Unknown = Entity.Unknown>(options?: {
31
33
  subspaceTag?: QueueSubspaceTag;
32
34
  }) => Effect.Effect<Queue<T>, never, QueueService>;
33
- static append: <T extends Obj.Any | Relation.Any = Obj.Any | Relation.Any>(queue: Queue<T>, objects: T[]) => Effect.Effect<void>;
35
+ static append: <T extends Entity.Unknown = Entity.Unknown>(queue: Queue<T>, objects: T[]) => Effect.Effect<void>;
34
36
  }
35
37
  declare const ContextQueueService_base: Context.TagClass<ContextQueueService, "@dxos/functions/ContextQueueService", {
36
38
  readonly queue: Queue;
@@ -1 +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f;IAEhE;;OAEG;IACH,MAAM,CAAC,QAAQ,GAAI,CAAC,SAAS,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,EAC1D,KAAK,GAAG,KACP,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAsE;IAErH;;OAEG;IACH,MAAM,CAAC,WAAW,GAAI,CAAC,SAAS,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,UAAU;QACzE,WAAW,CAAC,EAAE,gBAAgB,CAAC;KAChC,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAC2B;IAE3E,MAAM,CAAC,MAAM,GAAI,CAAC,SAAS,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CACjE;CAC/C;;oBAQmB,KAAK;;AANzB;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,wBAKtC;IACD,MAAM,CAAC,KAAK,GAAI,OAAO,KAAK,oDAAmD;CAChF"}
@@ -1,9 +1,11 @@
1
- import { Context, Effect, Layer } from 'effect';
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Layer from 'effect/Layer';
2
4
  import { AgentStatus } from '@dxos/ai';
3
- import { Obj } from '@dxos/echo';
4
- import type { Queue } from '@dxos/echo-db';
5
- import type { ObjectId } from '@dxos/echo-schema';
6
- import { DataType } from '@dxos/schema';
5
+ import { type DXN, Obj } from '@dxos/echo';
6
+ import { ObjectId } from '@dxos/keys';
7
+ import { Message } from '@dxos/types';
8
+ import type { Trigger } from '../types';
7
9
  declare const TracingService_base: Context.TagClass<TracingService, "@dxos/functions/TracingService", {
8
10
  /**
9
11
  * Gets the parent message ID.
@@ -13,7 +15,15 @@ declare const TracingService_base: Context.TagClass<TracingService, "@dxos/funct
13
15
  * Write an event to the tracing queue.
14
16
  * @param event - The event to write. Must be an a typed object.
15
17
  */
16
- write: (event: Obj.Any) => void;
18
+ write: (event: Obj.Unknown, traceContext: TracingService.TraceContext) => void;
19
+ traceInvocationStart({ payload, target, }: {
20
+ payload: TracingService.FunctionInvocationPayload;
21
+ target?: DXN;
22
+ }): Effect.Effect<TracingService.InvocationTraceData>;
23
+ traceInvocationEnd({ trace, exception, }: {
24
+ trace: TracingService.InvocationTraceData;
25
+ exception?: any;
26
+ }): Effect.Effect<void>;
17
27
  }>;
18
28
  /**
19
29
  * Provides a way for compute primitives (functions, workflows, tools)
@@ -21,23 +31,26 @@ declare const TracingService_base: Context.TagClass<TracingService, "@dxos/funct
21
31
  */
22
32
  export declare class TracingService extends TracingService_base {
23
33
  static noop: Context.Tag.Service<TracingService>;
24
- static layerNoop: Layer.Layer<TracingService, never, never>;
25
- static console: Context.Tag.Service<TracingService>;
26
- static layerConsole: Layer.Layer<TracingService, never, never>;
27
- static layerLogInfo: () => Layer.Layer<TracingService, never, never>;
34
+ static layerNoop: Layer.Layer<TracingService>;
28
35
  /**
29
36
  * Creates a TracingService layer that emits events to the parent tracing service.
30
37
  */
31
38
  static layerSubframe: (mapContext: (currentContext: TracingService.TraceContext) => TracingService.TraceContext) => Layer.Layer<TracingService, never, TracingService>;
32
- static layerQueue: (queue: Queue) => Layer.Layer<TracingService, never, never>;
39
+ /**
40
+ * Create sublayer to trace an invocation.
41
+ * @param data
42
+ * @returns
43
+ */
44
+ static layerInvocation: (data: TracingService.InvocationTraceData) => Layer.Layer<TracingService, never, TracingService>;
33
45
  /**
34
46
  * Emit the current human-readable execution status.
35
47
  */
36
- static emitStatus: (data: Obj.MakeProps<typeof AgentStatus>) => Effect.Effect<void, never, TracingService>;
37
- static emitConverationMessage: (data: Obj.MakeProps<typeof DataType.Message>) => Effect.Effect<void, never, TracingService>;
48
+ static emitStatus: (data: Omit<Obj.MakeProps<typeof AgentStatus>, 'created'>) => Effect.Effect<void, never, TracingService>;
49
+ static emitConverationMessage: (data: Obj.MakeProps<typeof Message.Message>) => Effect.Effect<void, never, TracingService>;
38
50
  }
39
51
  export declare namespace TracingService {
40
52
  interface TraceContext {
53
+ currentInvocation?: InvocationTraceData;
41
54
  /**
42
55
  * If this thread sprung from a tool call, this is the ID of the message containing the tool call.
43
56
  */
@@ -48,9 +61,27 @@ export declare namespace TracingService {
48
61
  toolCallId?: string;
49
62
  debugInfo?: unknown;
50
63
  }
64
+ /**
65
+ * Trace data for a function/trigger invocation.
66
+ */
67
+ interface InvocationTraceData {
68
+ invocationId: ObjectId;
69
+ invocationTraceQueue?: DXN.String;
70
+ }
71
+ /**
72
+ * Payload for a function/trigger invocation.
73
+ */
74
+ interface FunctionInvocationPayload {
75
+ data?: any;
76
+ inputNodeId?: string;
77
+ trigger?: {
78
+ id: string;
79
+ kind: Trigger.Kind;
80
+ };
81
+ }
51
82
  }
52
83
  /**
53
- * Goes into {@link DataType.Message['properties']}
84
+ * Goes into {@link Message['properties']}
54
85
  */
55
86
  export declare const MESSAGE_PROPERTY_TOOL_CALL_ID: "toolCallId";
56
87
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;;IASpC;;OAEG;qBACc,MAAM,cAAc,CAAC,YAAY;IAElD;;;OAGG;WACI,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wDAI5D;IAEN;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,CACjB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,WAAW,CAAC,EAAE,SAAS,CAAC,KACrD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAW5C;IAEH,MAAM,CAAC,sBAAsB,EAAE,CAC7B,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,KACxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAa5C;CACJ;AAED,yBAAiB,cAAc,CAAC;IAC9B,UAAiB,YAAY;QAC3B,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;QAExC;;WAEG;QACH,aAAa,CAAC,EAAE,QAAQ,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB;IAED;;OAEG;IACH,UAAiB,mBAAmB;QAClC,YAAY,EAAE,QAAQ,CAAC;QACvB,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;KACnC;IAED;;OAEG;IACH,UAAiB,yBAAyB;QACxC,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE;YACR,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC;SACpB,CAAC;KACH;CACF;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
@@ -0,0 +1,52 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { Obj, Type } from '@dxos/echo';
3
+ /**
4
+ * Function deployment.
5
+ */
6
+ export declare const Function: Type.Obj<{
7
+ readonly version: string;
8
+ readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
9
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
10
+ readonly content: string;
11
+ }>;
12
+ readonly description?: string | undefined;
13
+ readonly name?: string | undefined;
14
+ readonly changed?: boolean | undefined;
15
+ }> | undefined;
16
+ readonly description?: string | undefined;
17
+ readonly name: string;
18
+ readonly key?: string | undefined;
19
+ readonly updated?: string | undefined;
20
+ readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
21
+ readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
22
+ readonly services?: readonly string[] | undefined;
23
+ readonly binding?: string | undefined;
24
+ }, Schema.Struct.Fields>;
25
+ export interface Function extends Schema.Schema.Type<typeof Function> {
26
+ }
27
+ export declare const make: (props: Obj.MakeProps<typeof Function>) => Obj.Obj<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
28
+ readonly version: string;
29
+ readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
30
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
31
+ readonly content: string;
32
+ }>;
33
+ readonly description?: string | undefined;
34
+ readonly name?: string | undefined;
35
+ readonly changed?: boolean | undefined;
36
+ }> | undefined;
37
+ readonly description?: string | undefined;
38
+ readonly name: string;
39
+ readonly key?: string | undefined;
40
+ readonly updated?: string | undefined;
41
+ readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
42
+ readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
43
+ readonly services?: readonly string[] | undefined;
44
+ readonly binding?: string | undefined;
45
+ }>;
46
+ /**
47
+ * Copies properties from source to target.
48
+ * @param target - Target object to copy properties to.
49
+ * @param source - Source object to copy properties from.
50
+ */
51
+ export declare const setFrom: (target: Function, source: Function) => void;
52
+ //# sourceMappingURL=Function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Function.d.ts","sourceRoot":"","sources":["../../../../src/types/Function.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAA0B,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAK/D;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;wBA4CpB,CAAC;AAEF,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE,eAAO,MAAM,IAAI,GAAI,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,QAAQ,CAAC;;;;;;;;;;;;;;;;;;EAA8B,CAAC;AAEzF;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,QAAQ,EAAE,QAAQ,QAAQ,SAYzD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { Obj, Type } from '@dxos/echo';
3
+ /**
4
+ * Source script.
5
+ */
6
+ export declare const Script: Type.Obj<{
7
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
8
+ readonly content: string;
9
+ }>;
10
+ readonly description?: string | undefined;
11
+ readonly name?: string | undefined;
12
+ readonly changed?: boolean | undefined;
13
+ }, Schema.Struct.Fields>;
14
+ export interface Script extends Schema.Schema.Type<typeof Script> {
15
+ }
16
+ type Props = Omit<Obj.MakeProps<typeof Script>, 'source'> & {
17
+ source?: string;
18
+ };
19
+ export declare const make: ({ source, ...props }?: Props) => Script;
20
+ export {};
21
+ //# sourceMappingURL=Script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../../src/types/Script.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAc,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;wBAalB,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC;CAAG;AAEpE,KAAK,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,IAAI,GAAI,uBAA2B,KAAU,KAAG,MACQ,CAAC"}
@@ -0,0 +1,121 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { Obj, QueryAST, Type } from '@dxos/echo';
3
+ /**
4
+ * Type discriminator for TriggerType.
5
+ * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.
6
+ * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions
7
+ */
8
+ export declare const Kinds: readonly ["email", "queue", "subscription", "timer", "webhook"];
9
+ export type Kind = (typeof Kinds)[number];
10
+ export declare const EmailSpec: Schema.mutable<Schema.Struct<{
11
+ kind: Schema.Literal<["email"]>;
12
+ }>>;
13
+ export type EmailSpec = Schema.Schema.Type<typeof EmailSpec>;
14
+ export declare const QueueSpec: Schema.mutable<Schema.Struct<{
15
+ kind: Schema.Literal<["queue"]>;
16
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
17
+ }>>;
18
+ export type QueueSpec = Schema.Schema.Type<typeof QueueSpec>;
19
+ /**
20
+ * Subscription.
21
+ */
22
+ export declare const SubscriptionSpec: Schema.mutable<Schema.Struct<{
23
+ kind: Schema.Literal<["subscription"]>;
24
+ query: Schema.mutable<Schema.Struct<{
25
+ raw: Schema.optional<Schema.SchemaClass<string, string, never>>;
26
+ ast: Schema.Schema<QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause, QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause, never>;
27
+ }>>;
28
+ options: Schema.optional<Schema.Struct<{
29
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
30
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
31
+ }>>;
32
+ }>>;
33
+ export type SubscriptionSpec = Schema.Schema.Type<typeof SubscriptionSpec>;
34
+ /**
35
+ * Cron timer.
36
+ */
37
+ export declare const TimerSpec: Schema.mutable<Schema.Struct<{
38
+ kind: Schema.Literal<["timer"]>;
39
+ cron: Schema.SchemaClass<string, string, never>;
40
+ }>>;
41
+ export type TimerSpec = Schema.Schema.Type<typeof TimerSpec>;
42
+ /**
43
+ * Webhook.
44
+ */
45
+ export declare const WebhookSpec: Schema.mutable<Schema.Struct<{
46
+ kind: Schema.Literal<["webhook"]>;
47
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
48
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
49
+ }>>;
50
+ export type WebhookSpec = Schema.Schema.Type<typeof WebhookSpec>;
51
+ /**
52
+ * Trigger schema.
53
+ */
54
+ export declare const Spec: Schema.Union<[Schema.mutable<Schema.Struct<{
55
+ kind: Schema.Literal<["email"]>;
56
+ }>>, Schema.mutable<Schema.Struct<{
57
+ kind: Schema.Literal<["queue"]>;
58
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
59
+ }>>, Schema.mutable<Schema.Struct<{
60
+ kind: Schema.Literal<["subscription"]>;
61
+ query: Schema.mutable<Schema.Struct<{
62
+ raw: Schema.optional<Schema.SchemaClass<string, string, never>>;
63
+ ast: Schema.Schema<QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause, QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause, never>;
64
+ }>>;
65
+ options: Schema.optional<Schema.Struct<{
66
+ deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
67
+ delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
68
+ }>>;
69
+ }>>, Schema.mutable<Schema.Struct<{
70
+ kind: Schema.Literal<["timer"]>;
71
+ cron: Schema.SchemaClass<string, string, never>;
72
+ }>>, Schema.mutable<Schema.Struct<{
73
+ kind: Schema.Literal<["webhook"]>;
74
+ method: Schema.optional<Schema.SchemaClass<string, string, never>>;
75
+ port: Schema.optional<Schema.SchemaClass<number, number, never>>;
76
+ }>>]>;
77
+ export type Spec = Schema.Schema.Type<typeof Spec>;
78
+ /**
79
+ * Function trigger.
80
+ * Function is invoked with the `payload` passed as input data.
81
+ * The event that triggers the function is available in the function context.
82
+ */
83
+ declare const TriggerSchema: Type.Obj<{
84
+ readonly function?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
85
+ readonly [x: string]: any;
86
+ }> | undefined;
87
+ readonly inputNodeId?: string | undefined;
88
+ readonly enabled?: boolean | undefined;
89
+ readonly spec?: {
90
+ kind: "email";
91
+ } | {
92
+ queue: string;
93
+ kind: "queue";
94
+ } | {
95
+ kind: "subscription";
96
+ query: {
97
+ raw?: string | undefined;
98
+ ast: QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause;
99
+ };
100
+ options?: {
101
+ readonly deep?: boolean | undefined;
102
+ readonly delay?: number | undefined;
103
+ } | undefined;
104
+ } | {
105
+ kind: "timer";
106
+ cron: string;
107
+ } | {
108
+ kind: "webhook";
109
+ method?: string | undefined;
110
+ port?: number | undefined;
111
+ } | undefined;
112
+ readonly input?: {
113
+ [x: string]: any;
114
+ } | undefined;
115
+ }, Schema.Struct.Fields>;
116
+ export interface Trigger extends Schema.Schema.Type<typeof TriggerSchema> {
117
+ }
118
+ export declare const Trigger: Type.Obj<Trigger>;
119
+ export declare const make: (props: Obj.MakeProps<typeof Trigger>) => Obj.Obj<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Trigger>;
120
+ export {};
121
+ //# sourceMappingURL=Trigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../src/types/Trigger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAKjD;;;;GAIG;AACH,eAAO,MAAM,KAAK,iEAAkE,CAAC;AACrF,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,C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@ -0,0 +1,74 @@
1
+ import * as Schema from 'effect/Schema';
2
+ export declare const EmailEvent: Schema.mutable<Schema.Struct<{
3
+ from: typeof Schema.String;
4
+ to: typeof Schema.String;
5
+ subject: typeof Schema.String;
6
+ created: typeof Schema.String;
7
+ body: typeof Schema.String;
8
+ }>>;
9
+ export type EmailEvent = Schema.Schema.Type<typeof EmailEvent>;
10
+ export declare const QueueEvent: Schema.mutable<Schema.Struct<{
11
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
12
+ item: typeof Schema.Any;
13
+ cursor: typeof Schema.String;
14
+ }>>;
15
+ export type QueueEvent = Schema.Schema.Type<typeof QueueEvent>;
16
+ export declare const SubscriptionEvent: Schema.mutable<Schema.Struct<{
17
+ /**
18
+ * Type of the mutation.
19
+ */
20
+ type: typeof Schema.String;
21
+ /**
22
+ * Reference to the object that was changed or created.
23
+ */
24
+ subject: import("@dxos/echo/internal").RefSchema<any>;
25
+ /**
26
+ * @deprecated
27
+ */
28
+ changedObjectId: Schema.optional<typeof Schema.String>;
29
+ }>>;
30
+ export type SubscriptionEvent = Schema.Schema.Type<typeof SubscriptionEvent>;
31
+ export declare const TimerEvent: Schema.mutable<Schema.Struct<{
32
+ tick: typeof Schema.Number;
33
+ }>>;
34
+ export type TimerEvent = Schema.Schema.Type<typeof TimerEvent>;
35
+ export declare const WebhookEvent: Schema.mutable<Schema.Struct<{
36
+ url: typeof Schema.String;
37
+ method: Schema.Literal<["GET", "POST"]>;
38
+ headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
39
+ bodyText: typeof Schema.String;
40
+ }>>;
41
+ export type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
42
+ export declare const TriggerEvent: Schema.Union<[Schema.mutable<Schema.Struct<{
43
+ from: typeof Schema.String;
44
+ to: typeof Schema.String;
45
+ subject: typeof Schema.String;
46
+ created: typeof Schema.String;
47
+ body: typeof Schema.String;
48
+ }>>, Schema.mutable<Schema.Struct<{
49
+ queue: Schema.refine<string, typeof Schema.NonEmptyString>;
50
+ item: typeof Schema.Any;
51
+ cursor: typeof Schema.String;
52
+ }>>, Schema.mutable<Schema.Struct<{
53
+ /**
54
+ * Type of the mutation.
55
+ */
56
+ type: typeof Schema.String;
57
+ /**
58
+ * Reference to the object that was changed or created.
59
+ */
60
+ subject: import("@dxos/echo/internal").RefSchema<any>;
61
+ /**
62
+ * @deprecated
63
+ */
64
+ changedObjectId: Schema.optional<typeof Schema.String>;
65
+ }>>, Schema.mutable<Schema.Struct<{
66
+ tick: typeof Schema.Number;
67
+ }>>, Schema.mutable<Schema.Struct<{
68
+ url: typeof Schema.String;
69
+ method: Schema.Literal<["GET", "POST"]>;
70
+ headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
71
+ bodyText: typeof Schema.String;
72
+ }>>]>;
73
+ export type TriggerEvent = Schema.Schema.Type<typeof TriggerEvent>;
74
+ //# sourceMappingURL=TriggerEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerEvent.d.ts","sourceRoot":"","sources":["../../../../src/types/TriggerEvent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAUxC,eAAO,MAAM,UAAU;;;;;;GAQtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,UAAU;;;;GAMtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,iBAAiB;IAC5B;;OAEG;;IAIH;;OAEG;;IAGH;;OAEG;;GAEkB,CAAC;AACxB,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7E,eAAO,MAAM,UAAU;;GAAyD,CAAC;AACjF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,YAAY;;;;;GAOxB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC;AAEnE,eAAO,MAAM,YAAY;;;;;;;;;;;IA/BvB;;OAEG;;IAIH;;OAEG;;IAGH;;OAEG;;;;;;;;;KAkBwG,CAAC;AAC9G,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC"}