@dxos/functions 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5

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 (194) hide show
  1. package/README.md +4 -6
  2. package/dist/lib/neutral/Trace.mjs +42 -0
  3. package/dist/lib/neutral/Trace.mjs.map +7 -0
  4. package/dist/lib/neutral/chunk-27Y24OTY.mjs +167 -0
  5. package/dist/lib/neutral/chunk-27Y24OTY.mjs.map +7 -0
  6. package/dist/lib/neutral/chunk-IVDUS56O.mjs +49 -0
  7. package/dist/lib/neutral/chunk-IVDUS56O.mjs.map +7 -0
  8. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  9. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  10. package/dist/lib/neutral/fib-N45KAC7C.mjs +23 -0
  11. package/dist/lib/neutral/fib-N45KAC7C.mjs.map +7 -0
  12. package/dist/lib/neutral/index.mjs +1218 -0
  13. package/dist/lib/neutral/index.mjs.map +7 -0
  14. package/dist/lib/neutral/meta.json +1 -0
  15. package/dist/lib/neutral/reply-EUEPKNJF.mjs +19 -0
  16. package/dist/lib/neutral/reply-EUEPKNJF.mjs.map +7 -0
  17. package/dist/lib/neutral/sleep-PUK3D4FF.mjs +15 -0
  18. package/dist/lib/neutral/sleep-PUK3D4FF.mjs.map +7 -0
  19. package/dist/types/src/Trace.d.ts +174 -0
  20. package/dist/types/src/Trace.d.ts.map +1 -0
  21. package/dist/types/src/errors.d.ts +89 -38
  22. package/dist/types/src/errors.d.ts.map +1 -1
  23. package/dist/types/src/example/definitions.d.ts +11 -0
  24. package/dist/types/src/example/definitions.d.ts.map +1 -0
  25. package/dist/types/src/example/fib.d.ts +8 -0
  26. package/dist/types/src/example/fib.d.ts.map +1 -0
  27. package/dist/types/src/example/forex-effect.d.ts +3 -0
  28. package/dist/types/src/example/forex-effect.d.ts.map +1 -0
  29. package/dist/types/src/example/index.d.ts +4 -0
  30. package/dist/types/src/example/index.d.ts.map +1 -0
  31. package/dist/types/src/example/reply.d.ts +4 -0
  32. package/dist/types/src/example/reply.d.ts.map +1 -0
  33. package/dist/types/src/example/sleep.d.ts +6 -0
  34. package/dist/types/src/example/sleep.d.ts.map +1 -0
  35. package/dist/types/src/index.d.ts +9 -7
  36. package/dist/types/src/index.d.ts.map +1 -1
  37. package/dist/types/src/process/Process.d.ts +246 -0
  38. package/dist/types/src/process/Process.d.ts.map +1 -0
  39. package/dist/types/src/process/ServiceResolver.d.ts +74 -0
  40. package/dist/types/src/process/ServiceResolver.d.ts.map +1 -0
  41. package/dist/types/src/process/StorageService.d.ts +58 -0
  42. package/dist/types/src/process/StorageService.d.ts.map +1 -0
  43. package/dist/types/src/protocol/functions-ai-http-client.d.ts +12 -0
  44. package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -0
  45. package/dist/types/src/protocol/index.d.ts +2 -0
  46. package/dist/types/src/protocol/index.d.ts.map +1 -0
  47. package/dist/types/src/protocol/protocol.d.ts +7 -0
  48. package/dist/types/src/protocol/protocol.d.ts.map +1 -0
  49. package/dist/types/src/protocol/protocol.test.d.ts +2 -0
  50. package/dist/types/src/protocol/protocol.test.d.ts.map +1 -0
  51. package/dist/types/src/sdk.d.ts +11 -0
  52. package/dist/types/src/sdk.d.ts.map +1 -0
  53. package/dist/types/src/services/credentials.d.ts +20 -4
  54. package/dist/types/src/services/credentials.d.ts.map +1 -1
  55. package/dist/types/src/services/event-logger.d.ts +38 -33
  56. package/dist/types/src/services/event-logger.d.ts.map +1 -1
  57. package/dist/types/src/services/function-invocation-service.d.ts +16 -0
  58. package/dist/types/src/services/function-invocation-service.d.ts.map +1 -0
  59. package/dist/types/src/services/index.d.ts +5 -6
  60. package/dist/types/src/services/index.d.ts.map +1 -1
  61. package/dist/types/src/services/queues.d.ts +11 -5
  62. package/dist/types/src/services/queues.d.ts.map +1 -1
  63. package/dist/types/src/services/tracing.d.ts +1 -51
  64. package/dist/types/src/services/tracing.d.ts.map +1 -1
  65. package/dist/types/src/types/Script.d.ts +22 -0
  66. package/dist/types/src/types/Script.d.ts.map +1 -0
  67. package/dist/types/src/types/Trigger.d.ts +150 -0
  68. package/dist/types/src/types/Trigger.d.ts.map +1 -0
  69. package/dist/types/src/types/TriggerEvent.d.ts +75 -0
  70. package/dist/types/src/types/TriggerEvent.d.ts.map +1 -0
  71. package/dist/types/src/types/index.d.ts +5 -0
  72. package/dist/types/src/types/index.d.ts.map +1 -0
  73. package/dist/types/src/types/url.d.ts +13 -0
  74. package/dist/types/src/types/url.d.ts.map +1 -0
  75. package/dist/types/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +31 -73
  77. package/src/Trace.ts +225 -0
  78. package/src/errors.ts +13 -5
  79. package/src/example/definitions.ts +49 -0
  80. package/src/example/fib.ts +23 -0
  81. package/src/example/forex-effect.ts +40 -0
  82. package/src/example/index.ts +12 -0
  83. package/src/example/reply.ts +19 -0
  84. package/src/example/sleep.ts +17 -0
  85. package/src/index.ts +9 -9
  86. package/src/process/Process.ts +487 -0
  87. package/src/process/ServiceResolver.ts +174 -0
  88. package/src/process/StorageService.ts +99 -0
  89. package/src/protocol/functions-ai-http-client.ts +67 -0
  90. package/src/{executor → protocol}/index.ts +1 -1
  91. package/src/protocol/protocol.test.ts +58 -0
  92. package/src/protocol/protocol.ts +273 -0
  93. package/src/sdk.ts +30 -0
  94. package/src/services/credentials.ts +70 -9
  95. package/src/services/event-logger.ts +15 -22
  96. package/src/services/function-invocation-service.ts +35 -0
  97. package/src/services/index.ts +5 -6
  98. package/src/services/queues.ts +19 -5
  99. package/src/services/tracing.ts +1 -116
  100. package/src/types/Script.ts +38 -0
  101. package/src/types/Trigger.ts +207 -0
  102. package/src/types/TriggerEvent.ts +62 -0
  103. package/src/types/index.ts +8 -0
  104. package/src/types/url.ts +32 -0
  105. package/dist/lib/browser/bundler/index.mjs +0 -248
  106. package/dist/lib/browser/bundler/index.mjs.map +0 -7
  107. package/dist/lib/browser/chunk-IGZ7KK4A.mjs +0 -526
  108. package/dist/lib/browser/chunk-IGZ7KK4A.mjs.map +0 -7
  109. package/dist/lib/browser/edge/index.mjs +0 -69
  110. package/dist/lib/browser/edge/index.mjs.map +0 -7
  111. package/dist/lib/browser/index.mjs +0 -502
  112. package/dist/lib/browser/index.mjs.map +0 -7
  113. package/dist/lib/browser/meta.json +0 -1
  114. package/dist/lib/browser/testing/index.mjs +0 -59
  115. package/dist/lib/browser/testing/index.mjs.map +0 -7
  116. package/dist/lib/node-esm/bundler/index.mjs +0 -250
  117. package/dist/lib/node-esm/bundler/index.mjs.map +0 -7
  118. package/dist/lib/node-esm/chunk-NE5CWLJE.mjs +0 -528
  119. package/dist/lib/node-esm/chunk-NE5CWLJE.mjs.map +0 -7
  120. package/dist/lib/node-esm/edge/index.mjs +0 -71
  121. package/dist/lib/node-esm/edge/index.mjs.map +0 -7
  122. package/dist/lib/node-esm/index.mjs +0 -503
  123. package/dist/lib/node-esm/index.mjs.map +0 -7
  124. package/dist/lib/node-esm/meta.json +0 -1
  125. package/dist/lib/node-esm/testing/index.mjs +0 -60
  126. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  127. package/dist/types/src/bundler/bundler.d.ts +0 -50
  128. package/dist/types/src/bundler/bundler.d.ts.map +0 -1
  129. package/dist/types/src/bundler/bundler.test.d.ts +0 -2
  130. package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
  131. package/dist/types/src/bundler/index.d.ts +0 -2
  132. package/dist/types/src/bundler/index.d.ts.map +0 -1
  133. package/dist/types/src/edge/functions.d.ts +0 -16
  134. package/dist/types/src/edge/functions.d.ts.map +0 -1
  135. package/dist/types/src/edge/index.d.ts +0 -2
  136. package/dist/types/src/edge/index.d.ts.map +0 -1
  137. package/dist/types/src/executor/executor.d.ts +0 -11
  138. package/dist/types/src/executor/executor.d.ts.map +0 -1
  139. package/dist/types/src/executor/index.d.ts +0 -2
  140. package/dist/types/src/executor/index.d.ts.map +0 -1
  141. package/dist/types/src/handler.d.ts +0 -65
  142. package/dist/types/src/handler.d.ts.map +0 -1
  143. package/dist/types/src/schema.d.ts +0 -38
  144. package/dist/types/src/schema.d.ts.map +0 -1
  145. package/dist/types/src/services/database.d.ts +0 -79
  146. package/dist/types/src/services/database.d.ts.map +0 -1
  147. package/dist/types/src/services/local-function-execution.d.ts +0 -12
  148. package/dist/types/src/services/local-function-execution.d.ts.map +0 -1
  149. package/dist/types/src/services/remote-function-execution-service.d.ts +0 -15
  150. package/dist/types/src/services/remote-function-execution-service.d.ts.map +0 -1
  151. package/dist/types/src/services/service-container.d.ts +0 -56
  152. package/dist/types/src/services/service-container.d.ts.map +0 -1
  153. package/dist/types/src/services/service-registry.d.ts +0 -29
  154. package/dist/types/src/services/service-registry.d.ts.map +0 -1
  155. package/dist/types/src/services/service-registry.test.d.ts +0 -2
  156. package/dist/types/src/services/service-registry.test.d.ts.map +0 -1
  157. package/dist/types/src/testing/index.d.ts +0 -3
  158. package/dist/types/src/testing/index.d.ts.map +0 -1
  159. package/dist/types/src/testing/layer.d.ts +0 -10
  160. package/dist/types/src/testing/layer.d.ts.map +0 -1
  161. package/dist/types/src/testing/logger.d.ts +0 -5
  162. package/dist/types/src/testing/logger.d.ts.map +0 -1
  163. package/dist/types/src/testing/services.d.ts +0 -59
  164. package/dist/types/src/testing/services.d.ts.map +0 -1
  165. package/dist/types/src/trace.d.ts +0 -122
  166. package/dist/types/src/trace.d.ts.map +0 -1
  167. package/dist/types/src/translations.d.ts +0 -12
  168. package/dist/types/src/translations.d.ts.map +0 -1
  169. package/dist/types/src/types.d.ts +0 -411
  170. package/dist/types/src/types.d.ts.map +0 -1
  171. package/dist/types/src/url.d.ts +0 -17
  172. package/dist/types/src/url.d.ts.map +0 -1
  173. package/src/bundler/bundler.test.ts +0 -59
  174. package/src/bundler/bundler.ts +0 -292
  175. package/src/bundler/index.ts +0 -5
  176. package/src/edge/functions.ts +0 -64
  177. package/src/edge/index.ts +0 -9
  178. package/src/executor/executor.ts +0 -54
  179. package/src/handler.ts +0 -122
  180. package/src/schema.ts +0 -57
  181. package/src/services/database.ts +0 -116
  182. package/src/services/local-function-execution.ts +0 -74
  183. package/src/services/remote-function-execution-service.ts +0 -66
  184. package/src/services/service-container.ts +0 -114
  185. package/src/services/service-registry.test.ts +0 -42
  186. package/src/services/service-registry.ts +0 -59
  187. package/src/testing/index.ts +0 -6
  188. package/src/testing/layer.ts +0 -31
  189. package/src/testing/logger.ts +0 -16
  190. package/src/testing/services.ts +0 -115
  191. package/src/trace.ts +0 -178
  192. package/src/translations.ts +0 -20
  193. package/src/types.ts +0 -211
  194. package/src/url.ts +0 -52
@@ -0,0 +1,58 @@
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Option from 'effect/Option';
4
+ import * as Pipeable from 'effect/Pipeable';
5
+ import * as Schema from 'effect/Schema';
6
+ export interface Service {
7
+ /** Read a value by key. Returns `None` if key does not exist. */
8
+ get<S extends Schema.Schema<any, string, any>>(schema: S, key: string): Effect.Effect<Option.Option<Schema.Schema.Type<S>>, never, Schema.Schema.Context<S>>;
9
+ /** Write a value for the given key. */
10
+ set<S extends Schema.Schema<any, string, any>>(schema: S, key: string, value: Schema.Schema.Type<S>): Effect.Effect<void, never, Schema.Schema.Context<S>>;
11
+ /** Remove a key. */
12
+ delete(key: string): Effect.Effect<void>;
13
+ /** List all keys, optionally filtered by prefix. */
14
+ list(prefix?: string): Effect.Effect<readonly string[]>;
15
+ /** Remove all keys managed by this scoped store. */
16
+ clear(): Effect.Effect<void>;
17
+ }
18
+ declare const StorageService_base: Context.TagClass<StorageService, "@dxos/functions/StorageService", Service>;
19
+ /**
20
+ * Scoped key-value storage service for processes.
21
+ * Each process receives its own namespaced instance via the process manager.
22
+ * Construct a live implementation with `StorageService.layer` from `@dxos/functions-runtime`.
23
+ */
24
+ export declare class StorageService extends StorageService_base {
25
+ }
26
+ export declare const get: <S extends Schema.Schema<any, string, any>>(schema: S, key: string) => Effect.Effect<Option.Option<Schema.Schema.Type<S>>, never, Schema.Schema.Context<S> | StorageService>;
27
+ export declare const set: <S extends Schema.Schema<any, string, any>>(schema: S, key: string, value: Schema.Schema.Type<S>) => Effect.Effect<void, never, Schema.Schema.Context<S> | StorageService>;
28
+ export declare const deleteKey: (key: string) => Effect.Effect<void, never, StorageService>;
29
+ export declare const list: (prefix?: string | undefined) => Effect.Effect<readonly string[], never, StorageService>;
30
+ export declare const clear: () => Effect.Effect<void, never, StorageService>;
31
+ /**
32
+ * Typed key in a storage service.
33
+ */
34
+ export interface Key<T> extends Pipeable.Pipeable {
35
+ readonly key: string;
36
+ get: Effect.Effect<Option.Option<T>, never, StorageService>;
37
+ set(value: T): Effect.Effect<void, never, StorageService>;
38
+ delete(): Effect.Effect<void, never, StorageService>;
39
+ }
40
+ /**
41
+ * Create a typed key in a storage service.
42
+ */
43
+ export declare const key: <S extends Schema.Schema<any, string, any>>(schema: S, key: string) => Key<Schema.Schema.Type<S>>;
44
+ /**
45
+ * Typed key in a storage service with a default value.
46
+ */
47
+ export interface KeyWithDefault<T, U> extends Pipeable.Pipeable {
48
+ readonly key: string;
49
+ get: Effect.Effect<T | U, never, StorageService>;
50
+ set(value: U): Effect.Effect<void, never, StorageService>;
51
+ delete(): Effect.Effect<void, never, StorageService>;
52
+ }
53
+ /**
54
+ * Assign a default value to a key if it is not present.
55
+ */
56
+ export declare const withDefault: <T>(getDefault: () => NoInfer<T>) => (key: Key<T>) => KeyWithDefault<T, T>;
57
+ export {};
58
+ //# sourceMappingURL=StorageService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageService.d.ts","sourceRoot":"","sources":["../../../../src/process/StorageService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,C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AAC;IAC1D,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;CACtD;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,GACrB,CAAC,EAAE,YAAY,MAAM,OAAO,CAAC,CAAC,CAAC,MAC/B,KAAK,GAAG,CAAC,CAAC,CAAC,KAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAUjC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import * as HttpClient from '@effect/platform/HttpClient';
2
+ import * as Layer from 'effect/Layer';
3
+ import { type EdgeFunctionEnv } from '@dxos/protocols';
4
+ /**
5
+ * Copy pasted from https://github.com/Effect-TS/effect/blob/main/packages/platform/src/internal/fetchHttpClient.ts
6
+ */
7
+ export declare const requestInitTagKey = "@effect/platform/FetchHttpClient/FetchOptions";
8
+ export declare class FunctionsAiHttpClient {
9
+ static make: (service: EdgeFunctionEnv.FunctionsAiService) => HttpClient.HttpClient;
10
+ static layer: (service: EdgeFunctionEnv.FunctionsAiService) => Layer.Layer<HttpClient.HttpClient, never, never>;
11
+ }
12
+ //# sourceMappingURL=functions-ai-http-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions-ai-http-client.d.ts","sourceRoot":"","sources":["../../../../src/protocol/functions-ai-http-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAK1D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,KAAK,eAAe,EAAc,MAAM,iBAAiB,CAAC;AACnE;;GAEG;AACH,eAAO,MAAM,iBAAiB,kDAAkD,CAAC;AAEjF,qBAAa,qBAAqB;IAChC,MAAM,CAAC,IAAI,GAAI,SAAS,eAAe,CAAC,kBAAkB,2BAyCrD;IAEL,MAAM,CAAC,KAAK,GAAI,SAAS,eAAe,CAAC,kBAAkB,sDACiB;CAC7E"}
@@ -0,0 +1,2 @@
1
+ export * from './protocol';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/protocol/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Operation } from '@dxos/operation';
2
+ import { type FunctionProtocol } from '@dxos/protocols';
3
+ /**
4
+ * Wraps a function handler made with `defineFunction` to a protocol that the functions-runtime expects.
5
+ */
6
+ export declare const wrapFunctionHandler: (func: Operation.WithHandler<Operation.Definition.Any>) => FunctionProtocol.Func;
7
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../src/protocol/protocol.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAQxD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,KAAG,gBAAgB,CAAC,IAwE5G,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=protocol.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.test.d.ts","sourceRoot":"","sources":["../../../../src/protocol/protocol.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { type AiService } from '@dxos/ai';
2
+ import { type Database, type Feed } from '@dxos/echo';
3
+ import { type Trace } from '@dxos/functions';
4
+ import type { Operation } from '@dxos/operation';
5
+ import { type CredentialsService, type FunctionInvocationService, type QueueService } from './services';
6
+ /**
7
+ * Services that are available to invoked functions.
8
+ * @deprecated
9
+ */
10
+ export type FunctionServices = AiService.AiService | CredentialsService | Database.Service | QueueService | Feed.FeedService | Trace.TraceService | FunctionInvocationService | Operation.Service;
11
+ //# sourceMappingURL=sdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,yBAAyB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAOxG;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,CAAC,SAAS,GACnB,kBAAkB,GAClB,QAAQ,CAAC,OAAO,GAEhB,YAAY,GACZ,IAAI,CAAC,WAAW,GAChB,KAAK,CAAC,YAAY,GAClB,yBAAyB,GACzB,SAAS,CAAC,OAAO,CAAC"}
@@ -1,6 +1,11 @@
1
- import { Context, Effect, Layer } from 'effect';
2
- import { DatabaseService } from './database';
3
- type CredentialQuery = {
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';
8
+ export type CredentialQuery = {
4
9
  service?: string;
5
10
  };
6
11
  export type ServiceCredential = {
@@ -20,8 +25,15 @@ declare const CredentialsService_base: Context.TagClass<CredentialsService, "@dx
20
25
  }>;
21
26
  export declare class CredentialsService extends CredentialsService_base {
22
27
  static getCredential: (query: CredentialQuery) => Effect.Effect<ServiceCredential, never, CredentialsService>;
28
+ static getApiKey: (query: CredentialQuery) => Effect.Effect<Redacted.Redacted<string>, never, CredentialsService>;
23
29
  static configuredLayer: (credentials: ServiceCredential[]) => Layer.Layer<CredentialsService, never, never>;
24
- static layerFromDatabase: () => Layer.Layer<CredentialsService, never, DatabaseService>;
30
+ static layerConfig: (credentials: {
31
+ service: string;
32
+ apiKey: Config.Config<Redacted.Redacted<string>>;
33
+ }[]) => Layer.Layer<CredentialsService, import("effect/ConfigError").ConfigError, never>;
34
+ static layerFromDatabase: ({ caching }?: {
35
+ caching?: boolean;
36
+ }) => Layer.Layer<CredentialsService, never, Database.Service>;
25
37
  }
26
38
  export declare class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {
27
39
  private readonly credentials;
@@ -30,5 +42,9 @@ export declare class ConfiguredCredentialsService implements Context.Tag.Service
30
42
  queryCredentials(query: CredentialQuery): Promise<ServiceCredential[]>;
31
43
  getCredential(query: CredentialQuery): Promise<ServiceCredential>;
32
44
  }
45
+ /**
46
+ * Maps the request to include the given token in the Authorization header.
47
+ */
48
+ export declare const withAuthorization: (token: string, kind?: "Bearer" | "Basic") => <E, R>(self: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, R>;
33
49
  export {};
34
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,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,KAAK,eAAe,GAAG;IACrB,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,eA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O,MAAM,EAAE,OAAO,QAAQ,GAAG,OAAO,uFAItE,CAAC"}
@@ -1,15 +1,23 @@
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
- import { TracingService } from './tracing';
5
7
  export declare const ComputeEventPayload: Schema.Union<[Schema.Struct<{
6
8
  type: Schema.Literal<["begin-compute"]>;
7
9
  nodeId: typeof Schema.String;
8
- inputs: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
10
+ /**
11
+ * Names of the inputs begin computed.
12
+ */
13
+ inputs: Schema.Array$<typeof Schema.String>;
9
14
  }>, Schema.Struct<{
10
15
  type: Schema.Literal<["end-compute"]>;
11
16
  nodeId: typeof Schema.String;
12
- outputs: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
17
+ /**
18
+ * Names of the outputs computed.
19
+ */
20
+ outputs: Schema.Array$<typeof Schema.String>;
13
21
  }>, Schema.Struct<{
14
22
  type: Schema.Literal<["compute-input"]>;
15
23
  nodeId: typeof Schema.String;
@@ -26,31 +34,31 @@ export declare const ComputeEventPayload: Schema.Union<[Schema.Struct<{
26
34
  event: typeof Schema.Any;
27
35
  }>]>;
28
36
  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
- }>>;
37
+ export declare const ComputeEvent: Type.Obj<{
38
+ readonly payload: {
39
+ readonly type: "begin-compute";
40
+ readonly nodeId: string;
41
+ readonly inputs: readonly string[];
42
+ } | {
43
+ readonly type: "end-compute";
44
+ readonly nodeId: string;
45
+ readonly outputs: readonly string[];
46
+ } | {
47
+ readonly type: "compute-input";
48
+ readonly value: any;
49
+ readonly property: string;
50
+ readonly nodeId: string;
51
+ } | {
52
+ readonly type: "compute-output";
53
+ readonly value: any;
54
+ readonly property: string;
55
+ readonly nodeId: string;
56
+ } | {
57
+ readonly type: "custom";
58
+ readonly nodeId: string;
59
+ readonly event: any;
60
+ };
61
+ }, Schema.Struct.Fields>;
54
62
  declare const ComputeEventLogger_base: Context.TagClass<ComputeEventLogger, "@dxos/functions/ComputeEventLogger", {
55
63
  readonly log: (event: ComputeEventPayload) => void;
56
64
  readonly nodeId: string | undefined;
@@ -60,10 +68,7 @@ declare const ComputeEventLogger_base: Context.TagClass<ComputeEventLogger, "@dx
60
68
  */
61
69
  export declare class ComputeEventLogger extends ComputeEventLogger_base {
62
70
  static noop: Context.Tag.Service<ComputeEventLogger>;
63
- /**
64
- * Implements ComputeEventLogger using TracingService.
65
- */
66
- static layerFromTracing: Layer.Layer<ComputeEventLogger, never, TracingService>;
71
+ static layerNoop: Layer.Layer<ComputeEventLogger>;
67
72
  }
68
73
  export declare const logCustomEvent: (data: any) => Effect.Effect<void, never, ComputeEventLogger>;
69
74
  export declare const createDefectLogger: <A, E, R>() => ((self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>);
@@ -1 +1 @@
1
-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MAAgB,KACxB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAiBxC,CAAC"}
@@ -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 { Operation } from '@dxos/operation';
5
+ import type { FunctionNotFoundError } from '../errors';
6
+ declare const FunctionInvocationService_base: Context.TagClass<FunctionInvocationService, "@dxos/functions/FunctionInvocationService", {
7
+ invokeFunction<I, O>(functionDef: Operation.Definition<I, O, any>, input: I): Effect.Effect<O>;
8
+ resolveFunction(key: string): Effect.Effect<Operation.Definition.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: Operation.Definition<I, O, any>, input: I) => Effect.Effect<O, never, FunctionInvocationService>;
13
+ static resolveFunction: (key: string) => Effect.Effect<Operation.Definition.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,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;;mBAKpC,CAAC,EAAE,CAAC,eAAe,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;yBAEzE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,CAAC;;AALhG,qBAAa,yBAA0B,SAAQ,8BAO5C;IACD,MAAM,CAAC,iBAAiB,uDAGrB;IAEH,MAAM,CAAC,cAAc,GAAI,CAAC,EAAE,CAAC,EAC3B,aAAa,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAC5C,OAAO,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAC8D;IAEnH,MAAM,CAAC,eAAe,GACpB,KAAK,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACS;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 { MESSAGE_PROPERTY_TOOL_CALL_ID } 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,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC"}
@@ -1,6 +1,8 @@
1
- import { Context, Effect, Layer } from 'effect';
2
- import type { Obj, Relation } from '@dxos/echo';
3
- import type { Queue, QueueAPI, QueueFactory } from '@dxos/echo-db';
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';
5
+ import { type Queue, type QueueAPI, type 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", {
6
8
  /**
@@ -15,6 +17,7 @@ declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions
15
17
  }>;
16
18
  /**
17
19
  * Gives access to all queues.
20
+ * @deprecated Use Feed.FeedService instead.
18
21
  */
19
22
  export declare class QueueService extends QueueService_base {
20
23
  static notAvailable: Layer.Layer<QueueService, never, never>;
@@ -23,22 +26,25 @@ export declare class QueueService extends QueueService_base {
23
26
  /**
24
27
  * Gets a queue by its DXN.
25
28
  */
26
- static getQueue: <T extends Obj.Any | Relation.Any = Obj.Any | Relation.Any>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
29
+ static getQueue: <T extends Entity.Unknown = Entity.Unknown>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
27
30
  /**
28
31
  * Creates a new queue.
29
32
  */
30
- static createQueue: <T extends Obj.Any | Relation.Any = Obj.Any | Relation.Any>(options?: {
33
+ static createQueue: <T extends Entity.Unknown = Entity.Unknown>(options?: {
31
34
  subspaceTag?: QueueSubspaceTag;
32
35
  }) => Effect.Effect<Queue<T>, never, QueueService>;
36
+ static append: <T extends Entity.Unknown = Entity.Unknown>(queue: Queue<T>, objects: T[]) => Effect.Effect<void>;
33
37
  }
34
38
  declare const ContextQueueService_base: Context.TagClass<ContextQueueService, "@dxos/functions/ContextQueueService", {
35
39
  readonly queue: Queue;
36
40
  }>;
37
41
  /**
38
42
  * Gives access to a specific queue passed as a context.
43
+ * @deprecated Use Feed.FeedService instead.
39
44
  */
40
45
  export declare class ContextQueueService extends ContextQueueService_base {
41
46
  static layer: (queue: Queue) => Layer.Layer<ContextQueueService, never, never>;
42
47
  }
48
+ export declare const feedServiceFromQueueServiceLayer: Layer.Layer<import("@dxos/echo/Feed").FeedService, never, QueueService>;
43
49
  export {};
44
50
  //# sourceMappingURL=queues.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;;IAQpD;;OAEG;qBACc,QAAQ;IAEzB;;;OAGG;oBACa,KAAK,GAAG,SAAS;;AAfrC;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAc/B;IACD,MAAM,CAAC,YAAY,0CAUhB;IAEH,MAAM,CAAC,IAAI,GAAI,QAAQ,YAAY,EAAE,QAAQ,KAAK,KAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAKpF;IAEF,MAAM,CAAC,KAAK,GAAI,QAAQ,YAAY,EAAE,QAAQ,KAA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ue } from '@dxos/echo-db';
5
- import type { ObjectId } from '@dxos/echo-schema';
6
- import { DataType } from '@dxos/schema';
7
- declare const TracingService_base: Context.TagClass<TracingService, "@dxos/functions/TracingService", {
8
- /**
9
- * Gets the parent message ID.
10
- */
11
- getTraceContext: () => TracingService.TraceContext;
12
- /**
13
- * Write an event to the tracing queue.
14
- * @param event - The event to write. Must be an a typed object.
15
- */
16
- write: (event: Obj.Any) => void;
17
- }>;
18
1
  /**
19
- * Provides a way for compute primitives (functions, workflows, tools)
20
- * to emit an execution trace as a series of structured ECHO objects.
21
- */
22
- export declare class TracingService extends TracingService_base {
23
- 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
- /**
28
- * Creates a TracingService layer that emits events to the parent tracing service.
29
- */
30
- static layerSubframe: (mapContext: (currentContext: TracingService.TraceContext) => TracingService.TraceContext) => Layer.Layer<TracingService, never, TracingService>;
31
- static layerQueue: (queue: Queue) => Layer.Layer<TracingService, never, never>;
32
- /**
33
- * Emit the current human-readable execution status.
34
- */
35
- static emitStatus: (data: Obj.MakeProps<typeof AgentStatus>) => Effect.Effect<void, never, TracingService>;
36
- static emitConverationMessage: (data: Obj.MakeProps<typeof DataType.Message>) => Effect.Effect<void, never, TracingService>;
37
- }
38
- export declare namespace TracingService {
39
- interface TraceContext {
40
- /**
41
- * If this thread sprung from a tool call, this is the ID of the message containing the tool call.
42
- */
43
- parentMessage?: ObjectId;
44
- /**
45
- * If the current thread is a byproduct of a tool call, this is the ID of the tool call.
46
- */
47
- toolCallId?: string;
48
- }
49
- }
50
- /**
51
- * Goes into {@link DataType.Message['properties']}
2
+ * Goes into {@link Message['properties']}
52
3
  */
53
4
  export declare const MESSAGE_PROPERTY_TOOL_CALL_ID: "toolCallId";
54
- export {};
55
5
  //# sourceMappingURL=tracing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file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AAC,OAAO,CAAC,KACzC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAY5C;CACJ;AAED,yBAAiB,cAAc,CAAC;IAC9B,UAAiB,YAAY;QAC3B;;WAEG;QACH,aAAa,CAAC,EAAE,QAAQ,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;CACF;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
1
+ {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
@@ -0,0 +1,22 @@
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 name?: string | undefined;
8
+ readonly description?: string | undefined;
9
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
10
+ readonly name?: string | undefined;
11
+ readonly content: string;
12
+ }>;
13
+ readonly changed?: boolean | undefined;
14
+ }, Schema.Struct.Fields>;
15
+ export interface Script extends Schema.Schema.Type<typeof Script> {
16
+ }
17
+ type Props = Omit<Obj.MakeProps<typeof Script>, 'source'> & {
18
+ source?: string;
19
+ };
20
+ export declare const make: ({ source, ...props }?: Props) => Script;
21
+ export {};
22
+ //# 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;;;;;;;;wBAiBlB,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,MACqB,CAAC"}