@dxos/functions 0.8.4-main.2e9d522 → 0.8.4-main.3c1ae3b

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 (158) hide show
  1. package/dist/lib/browser/index.mjs +901 -369
  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 +901 -369
  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 +89 -28
  8. package/dist/types/src/errors.d.ts.map +1 -1
  9. package/dist/types/src/example/fib.d.ts +7 -0
  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/example/reply.d.ts +3 -0
  16. package/dist/types/src/example/reply.d.ts.map +1 -0
  17. package/dist/types/src/example/sleep.d.ts +5 -0
  18. package/dist/types/src/example/sleep.d.ts.map +1 -0
  19. package/dist/types/src/index.d.ts +5 -7
  20. package/dist/types/src/index.d.ts.map +1 -1
  21. package/dist/types/src/protocol/index.d.ts +2 -0
  22. package/dist/types/src/protocol/index.d.ts.map +1 -0
  23. package/dist/types/src/protocol/protocol.d.ts +7 -0
  24. package/dist/types/src/protocol/protocol.d.ts.map +1 -0
  25. package/dist/types/src/protocol/protocol.test.d.ts +2 -0
  26. package/dist/types/src/protocol/protocol.test.d.ts.map +1 -0
  27. package/dist/types/src/sdk.d.ts +100 -0
  28. package/dist/types/src/sdk.d.ts.map +1 -0
  29. package/dist/types/src/services/credentials.d.ts +20 -3
  30. package/dist/types/src/services/credentials.d.ts.map +1 -1
  31. package/dist/types/src/services/event-logger.d.ts +80 -30
  32. package/dist/types/src/services/event-logger.d.ts.map +1 -1
  33. package/dist/types/src/services/function-invocation-service.d.ts +11 -0
  34. package/dist/types/src/services/function-invocation-service.d.ts.map +1 -0
  35. package/dist/types/src/services/index.d.ts +5 -5
  36. package/dist/types/src/services/index.d.ts.map +1 -1
  37. package/dist/types/src/services/queues.d.ts +23 -6
  38. package/dist/types/src/services/queues.d.ts.map +1 -1
  39. package/dist/types/src/services/tracing.d.ts +35 -6
  40. package/dist/types/src/services/tracing.d.ts.map +1 -1
  41. package/dist/types/src/types/Function.d.ts +63 -0
  42. package/dist/types/src/types/Function.d.ts.map +1 -0
  43. package/dist/types/src/types/Script.d.ts +28 -0
  44. package/dist/types/src/types/Script.d.ts.map +1 -0
  45. package/dist/types/src/types/Trigger.d.ts +141 -0
  46. package/dist/types/src/types/Trigger.d.ts.map +1 -0
  47. package/dist/types/src/types/TriggerEvent.d.ts +43 -0
  48. package/dist/types/src/types/TriggerEvent.d.ts.map +1 -0
  49. package/dist/types/src/types/index.d.ts +6 -0
  50. package/dist/types/src/types/index.d.ts.map +1 -0
  51. package/dist/types/src/types/url.d.ts +12 -0
  52. package/dist/types/src/types/url.d.ts.map +1 -0
  53. package/dist/types/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +20 -68
  55. package/src/errors.ts +13 -5
  56. package/src/example/fib.ts +32 -0
  57. package/src/example/forex-effect.ts +40 -0
  58. package/src/example/index.ts +13 -0
  59. package/src/example/reply.ts +21 -0
  60. package/src/example/sleep.ts +24 -0
  61. package/src/index.ts +5 -9
  62. package/src/{executor → protocol}/index.ts +1 -1
  63. package/src/protocol/protocol.test.ts +59 -0
  64. package/src/protocol/protocol.ts +158 -0
  65. package/src/sdk.ts +240 -0
  66. package/src/services/credentials.ts +101 -3
  67. package/src/services/event-logger.ts +77 -37
  68. package/src/services/function-invocation-service.ts +23 -0
  69. package/src/services/index.ts +5 -5
  70. package/src/services/queues.ts +37 -10
  71. package/src/services/tracing.ts +82 -16
  72. package/src/types/Function.ts +80 -0
  73. package/src/types/Script.ts +33 -0
  74. package/src/types/Trigger.ts +141 -0
  75. package/src/types/TriggerEvent.ts +62 -0
  76. package/src/types/index.ts +9 -0
  77. package/src/types/url.ts +31 -0
  78. package/dist/lib/browser/bundler/index.mjs +0 -247
  79. package/dist/lib/browser/bundler/index.mjs.map +0 -7
  80. package/dist/lib/browser/chunk-3NGCSUEW.mjs +0 -328
  81. package/dist/lib/browser/chunk-3NGCSUEW.mjs.map +0 -7
  82. package/dist/lib/browser/edge/index.mjs +0 -69
  83. package/dist/lib/browser/edge/index.mjs.map +0 -7
  84. package/dist/lib/browser/testing/index.mjs +0 -59
  85. package/dist/lib/browser/testing/index.mjs.map +0 -7
  86. package/dist/lib/node-esm/bundler/index.mjs +0 -249
  87. package/dist/lib/node-esm/bundler/index.mjs.map +0 -7
  88. package/dist/lib/node-esm/chunk-FJ2MU7TL.mjs +0 -330
  89. package/dist/lib/node-esm/chunk-FJ2MU7TL.mjs.map +0 -7
  90. package/dist/lib/node-esm/edge/index.mjs +0 -71
  91. package/dist/lib/node-esm/edge/index.mjs.map +0 -7
  92. package/dist/lib/node-esm/testing/index.mjs +0 -60
  93. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  94. package/dist/types/src/bundler/bundler.d.ts +0 -50
  95. package/dist/types/src/bundler/bundler.d.ts.map +0 -1
  96. package/dist/types/src/bundler/bundler.test.d.ts +0 -2
  97. package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
  98. package/dist/types/src/bundler/index.d.ts +0 -2
  99. package/dist/types/src/bundler/index.d.ts.map +0 -1
  100. package/dist/types/src/edge/functions.d.ts +0 -16
  101. package/dist/types/src/edge/functions.d.ts.map +0 -1
  102. package/dist/types/src/edge/index.d.ts +0 -2
  103. package/dist/types/src/edge/index.d.ts.map +0 -1
  104. package/dist/types/src/executor/executor.d.ts +0 -8
  105. package/dist/types/src/executor/executor.d.ts.map +0 -1
  106. package/dist/types/src/executor/index.d.ts +0 -2
  107. package/dist/types/src/executor/index.d.ts.map +0 -1
  108. package/dist/types/src/handler.d.ts +0 -62
  109. package/dist/types/src/handler.d.ts.map +0 -1
  110. package/dist/types/src/schema.d.ts +0 -38
  111. package/dist/types/src/schema.d.ts.map +0 -1
  112. package/dist/types/src/services/database.d.ts +0 -29
  113. package/dist/types/src/services/database.d.ts.map +0 -1
  114. package/dist/types/src/services/function-call-service.d.ts +0 -16
  115. package/dist/types/src/services/function-call-service.d.ts.map +0 -1
  116. package/dist/types/src/services/service-container.d.ts +0 -56
  117. package/dist/types/src/services/service-container.d.ts.map +0 -1
  118. package/dist/types/src/services/service-registry.d.ts +0 -29
  119. package/dist/types/src/services/service-registry.d.ts.map +0 -1
  120. package/dist/types/src/services/service-registry.test.d.ts +0 -2
  121. package/dist/types/src/services/service-registry.test.d.ts.map +0 -1
  122. package/dist/types/src/testing/index.d.ts +0 -3
  123. package/dist/types/src/testing/index.d.ts.map +0 -1
  124. package/dist/types/src/testing/layer.d.ts +0 -10
  125. package/dist/types/src/testing/layer.d.ts.map +0 -1
  126. package/dist/types/src/testing/logger.d.ts +0 -5
  127. package/dist/types/src/testing/logger.d.ts.map +0 -1
  128. package/dist/types/src/testing/services.d.ts +0 -59
  129. package/dist/types/src/testing/services.d.ts.map +0 -1
  130. package/dist/types/src/trace.d.ts +0 -124
  131. package/dist/types/src/trace.d.ts.map +0 -1
  132. package/dist/types/src/translations.d.ts +0 -12
  133. package/dist/types/src/translations.d.ts.map +0 -1
  134. package/dist/types/src/types.d.ts +0 -411
  135. package/dist/types/src/types.d.ts.map +0 -1
  136. package/dist/types/src/url.d.ts +0 -17
  137. package/dist/types/src/url.d.ts.map +0 -1
  138. package/src/bundler/bundler.test.ts +0 -59
  139. package/src/bundler/bundler.ts +0 -292
  140. package/src/bundler/index.ts +0 -5
  141. package/src/edge/functions.ts +0 -64
  142. package/src/edge/index.ts +0 -9
  143. package/src/executor/executor.ts +0 -54
  144. package/src/handler.ts +0 -120
  145. package/src/schema.ts +0 -57
  146. package/src/services/database.ts +0 -70
  147. package/src/services/function-call-service.ts +0 -64
  148. package/src/services/service-container.ts +0 -113
  149. package/src/services/service-registry.test.ts +0 -42
  150. package/src/services/service-registry.ts +0 -56
  151. package/src/testing/index.ts +0 -6
  152. package/src/testing/layer.ts +0 -31
  153. package/src/testing/logger.ts +0 -16
  154. package/src/testing/services.ts +0 -114
  155. package/src/trace.ts +0 -180
  156. package/src/translations.ts +0 -20
  157. package/src/types.ts +0 -211
  158. package/src/url.ts +0 -52
@@ -1,8 +0,0 @@
1
- import type { FunctionDefinition } from '../handler';
2
- import type { ServiceContainer } from '../services';
3
- export declare class FunctionExecutor {
4
- private readonly _services;
5
- constructor(_services: ServiceContainer);
6
- invoke<F extends FunctionDefinition<any, any>>(fnDef: F, input: F extends FunctionDefinition<infer I, infer _O> ? I : never): Promise<F extends FunctionDefinition<infer _I, infer O> ? O : never>;
7
- }
8
- //# sourceMappingURL=executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/executor/executor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,aAAa,CAAC;AAE9D,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,gBAAgB;IAGlD,MAAM,CAAC,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,EACjD,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,CAAC,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,GACjE,OAAO,CAAC,CAAC,SAAS,kBAAkB,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CAkCxE"}
@@ -1,2 +0,0 @@
1
- export * from './executor';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/executor/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
@@ -1,62 +0,0 @@
1
- import { Schema, type Context, type Effect } from 'effect';
2
- import { type AiServiceClient } from '@dxos/ai';
3
- import type { EchoDatabase } from '@dxos/echo-db';
4
- import { type HasId } from '@dxos/echo-schema';
5
- import { type SpaceId, type DXN } from '@dxos/keys';
6
- import { type QueryResult } from '@dxos/protocols';
7
- import type { Services } from './services';
8
- /**
9
- * Function handler.
10
- */
11
- export type FunctionHandler<TData = {}, TOutput = any> = (params: {
12
- /**
13
- * Services and context available to the function.
14
- */
15
- context: FunctionContext;
16
- /**
17
- * Data passed as the input to the function.
18
- * Must match the function's input schema.
19
- * This will be the payload from the trigger or other data passed into the function in a workflow.
20
- */
21
- data: TData;
22
- }) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any, Services>;
23
- /**
24
- * Function context.
25
- */
26
- export interface FunctionContext {
27
- /**
28
- * Space from which the function was invoked.
29
- */
30
- space: SpaceAPI | undefined;
31
- ai: AiServiceClient;
32
- /**
33
- * Resolves a service available to the function.
34
- * @throws if the service is not available.
35
- */
36
- getService: <T extends Context.Tag<any, any>>(tag: T) => Context.Tag.Service<T>;
37
- getSpace: (spaceId: SpaceId) => Promise<SpaceAPI>;
38
- }
39
- export interface FunctionContextAi {
40
- run(model: string, inputs: any, options?: any): Promise<any>;
41
- }
42
- export interface QueuesAPI {
43
- queryQueue(queue: DXN, options?: {}): Promise<QueryResult>;
44
- insertIntoQueue(queue: DXN, objects: HasId[]): Promise<void>;
45
- }
46
- /**
47
- * Space interface available to functions.
48
- */
49
- export interface SpaceAPI {
50
- get id(): SpaceId;
51
- get db(): EchoDatabase;
52
- get queues(): QueuesAPI;
53
- }
54
- export type FunctionDefinition<T = {}, O = any> = {
55
- name: string;
56
- description?: string;
57
- inputSchema: Schema.Schema<T, any>;
58
- outputSchema?: Schema.Schema<O, any>;
59
- handler: FunctionHandler<T, O>;
60
- };
61
- export declare const defineFunction: <T, O>({ name, description, inputSchema, outputSchema, handler, }: FunctionDefinition<T, O>) => FunctionDefinition<T, O>;
62
- //# sourceMappingURL=handler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE3D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,KAAK,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE;IAChE;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IAEzB;;;;OAIG;IACH,IAAI,EAAE,KAAK,CAAC;CACb,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAE5B,EAAE,EAAE,eAAe,CAAC;IAEpB;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,K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 @@
1
- import { Schema } from 'effect';
2
- import { Type } from '@dxos/echo';
3
- import { Ref } from '@dxos/echo-schema';
4
- /**
5
- * Source script.
6
- */
7
- export declare const ScriptType: Type.obj<Schema.Struct<{
8
- name: Schema.optional<typeof Schema.String>;
9
- description: Schema.optional<typeof Schema.String>;
10
- changed: Schema.optional<typeof Schema.Boolean>;
11
- source: import("@dxos/echo-schema").Ref$<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
12
- content: string;
13
- }>;
14
- }>>;
15
- export interface ScriptType extends Schema.Schema.Type<typeof ScriptType> {
16
- }
17
- /**
18
- * Function deployment.
19
- */
20
- export declare const FunctionType: Type.obj<Schema.Struct<{
21
- name: typeof Schema.NonEmptyString;
22
- version: typeof Schema.String;
23
- description: Schema.optional<typeof Schema.String>;
24
- source: Schema.optional<import("@dxos/echo-schema").Ref$<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
25
- description?: string | undefined;
26
- name?: string | undefined;
27
- changed?: boolean | undefined;
28
- source: Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
29
- content: string;
30
- }>;
31
- }>>;
32
- inputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
33
- outputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
34
- binding: Schema.optional<typeof Schema.String>;
35
- }>>;
36
- export interface FunctionType extends Schema.Schema.Type<typeof FunctionType> {
37
- }
38
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAmC,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGzE;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;GAatB,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC;CAAG;AAE5E;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;GAsBxB,CAAC;AACF,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC;CAAG"}
@@ -1,29 +0,0 @@
1
- import { Context, Effect, Layer } from 'effect';
2
- import type { Filter, Live, Obj, Query, Ref, Relation } from '@dxos/echo';
3
- import type { EchoDatabase, OneShotQueryResult, QueryResult } from '@dxos/echo-db';
4
- import type { DXN } from '@dxos/keys';
5
- declare const DatabaseService_base: Context.TagClass<DatabaseService, "DatabaseService", {
6
- readonly db: EchoDatabase;
7
- }>;
8
- export declare class DatabaseService extends DatabaseService_base {
9
- static notAvailable: Layer.Layer<DatabaseService, never, never>;
10
- static make: (db: EchoDatabase) => Context.Tag.Service<DatabaseService>;
11
- static resolve: (dxn: DXN) => Effect.Effect<Obj.Any | Relation.Any, Error, DatabaseService>;
12
- static loadRef: <T>(ref: Ref.Ref<T>) => Effect.Effect<T, never, never>;
13
- /**
14
- * Creates a `QueryResult` object that can be subscribed to.
15
- */
16
- static query: {
17
- <Q extends Query.Any>(query: Q): Effect.Effect<QueryResult<Live<Query.Type<Q>>>, never, DatabaseService>;
18
- <F extends Filter.Any>(filter: F): Effect.Effect<QueryResult<Live<Filter.Type<F>>>, never, DatabaseService>;
19
- };
20
- /**
21
- * Executes the query once and returns the results.
22
- */
23
- static runQuery: {
24
- <Q extends Query.Any>(query: Q): Effect.Effect<OneShotQueryResult<Live<Query.Type<Q>>>, never, DatabaseService>;
25
- <F extends Filter.Any>(filter: F): Effect.Effect<OneShotQueryResult<Live<Filter.Type<F>>>, never, DatabaseService>;
26
- };
27
- }
28
- export {};
29
- //# sourceMappingURL=database.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":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AC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;KAC7G,CAIG;IAEJ;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE;QACf,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;QAChH,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;KACpH,CAGG;CACL"}
@@ -1,16 +0,0 @@
1
- import { Context } from 'effect';
2
- import type { SpaceId } from '@dxos/keys';
3
- declare const FunctionCallService_base: Context.TagClass<FunctionCallService, "FunctionCallService", {
4
- callFunction(deployedFunctionId: string, input: any, spaceId?: SpaceId): Promise<any>;
5
- }>;
6
- /**
7
- * Allows calling into other functions.
8
- */
9
- export declare class FunctionCallService extends FunctionCallService_base {
10
- static fromClient(baseUrl: string, spaceId: SpaceId): Context.Tag.Service<FunctionCallService>;
11
- static mock: () => {
12
- callFunction: (deployedFunctionId: string, input: any) => Promise<any>;
13
- };
14
- }
15
- export {};
16
- //# sourceMappingURL=function-call-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"function-call-service.d.ts","sourceRoot":"","sources":["../../../../src/services/function-call-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;;qCAQL,MAAM,SAAS,GAAG,YAAY,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;;AANzF;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,wBAKtC;IACD,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAiB9F,MAAM,CAAC,IAAI;2CAEkC,MAAM,SAAS,GAAG;MAI7D;CACH"}
@@ -1,56 +0,0 @@
1
- import { type Context, Layer } from 'effect';
2
- import { AiService } from '@dxos/ai';
3
- import { CredentialsService } from './credentials';
4
- import { DatabaseService } from './database';
5
- import { EventLogger } from './event-logger';
6
- import { FunctionCallService } from './function-call-service';
7
- import { QueueService } from './queues';
8
- import { TracingService } from './tracing';
9
- /**
10
- * List of all services.
11
- */
12
- declare const SERVICES: {
13
- readonly ai: typeof AiService;
14
- readonly credentials: typeof CredentialsService;
15
- readonly database: typeof DatabaseService;
16
- readonly eventLogger: typeof EventLogger;
17
- readonly functionCallService: typeof FunctionCallService;
18
- readonly queues: typeof QueueService;
19
- readonly tracing: typeof TracingService;
20
- };
21
- /**
22
- * Mapping of service names to their tags.
23
- */
24
- export type ServiceTagRecord = {
25
- [K in keyof typeof SERVICES]: (typeof SERVICES)[K] extends {
26
- new (_: never): infer T;
27
- } ? T : never;
28
- };
29
- /**
30
- * Mapping of service names to their runtime types.
31
- */
32
- export type ServiceRecord = {
33
- [K in keyof ServiceTagRecord]: Context.Tag.Service<ServiceTagRecord[K]>;
34
- };
35
- /**
36
- * Union of all services tags.
37
- */
38
- export type Services = ServiceTagRecord[keyof ServiceTagRecord];
39
- export declare const SERVICE_TAGS: Context.Tag<any, any>[];
40
- /**
41
- * @deprecated
42
- */
43
- export declare class ServiceContainer {
44
- private _services;
45
- /**
46
- * Set services.
47
- * @param services - Services to set.
48
- * @returns The container instance.
49
- */
50
- setServices(services: Partial<ServiceRecord>): this;
51
- getService<Id, T>(tag: Context.Tag<Id, T>): T;
52
- clone(): ServiceContainer;
53
- createLayer(): Layer.Layer<Services>;
54
- }
55
- export {};
56
- //# sourceMappingURL=service-container.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-container.d.ts","sourceRoot":"","sources":["../../../../src/services/service-container.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAgC,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAI3C;;GAEG;AACH,QAAA,MAAM,QAAQ;;;;;;;;CAQyD,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;KAC5B,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK;CACnG,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACxE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAMhE,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAA4B,CAAC;AAM7E;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAmD;IAEpE;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAKnD,UAAU,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IAU7C,KAAK,IAAI,gBAAgB;IAKzB,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;CAqBrC"}
@@ -1,29 +0,0 @@
1
- import { Context, Effect, type Option } from 'effect';
2
- import { ServiceNotAvailableError } from '../errors';
3
- export declare namespace ServiceRegistry {
4
- interface Service {
5
- resolve: <T extends Context.Tag<any, any>>(tag: T) => Option.Option<Context.Tag.Service<T>>;
6
- }
7
- }
8
- declare const ServiceRegistry_base: Context.TagClass<ServiceRegistry, "ServiceRegistry", ServiceRegistry.Service>;
9
- export declare class ServiceRegistry extends ServiceRegistry_base {
10
- /**
11
- * Resolves the service from the registry.
12
- * @param tag Service tag to resolve.
13
- * @throws {@link ServiceNotAvailableError} if the service is not found.
14
- * @returns Effect that resolve to the service.
15
- */
16
- static resolve: <T extends Context.Tag<any, any>>(tag: T) => Effect.Effect<T, ServiceNotAvailableError, ServiceRegistry>;
17
- static provide: {
18
- <Tags extends [Context.Tag<any, any>, ...Context.Tag<any, any>[]]>(...tags: Tags): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | ServiceNotAvailableError, Exclude<R, {
19
- [K in keyof Tags]: Context.Tag.Identifier<Tags[K]>;
20
- }[number]> | ServiceRegistry>;
21
- };
22
- static provideOrDie: {
23
- <Tags extends [Context.Tag<any, any>, ...Context.Tag<any, any>[]]>(...tags: Tags): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, {
24
- [K in keyof Tags]: Context.Tag.Identifier<Tags[K]>;
25
- }[number]> | ServiceRegistry>;
26
- };
27
- }
28
- export {};
29
- //# sourceMappingURL=service-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-registry.d.ts","sourceRoot":"","sources":["../../../../src/services/service-registry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAQ,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,yBAAiB,eAAe,CAAC;IAC/B,UAAiB,OAAO;QACtB,OAAO,EAAE,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7F;CACF;;AAED,qBAAa,eAAgB,SAAQ,oBAA0E;IAC7G;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAC9C,GAAG,EAAE,CAAC,KACH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,wBAAwB,EAAE,eAAe,CAAC,CAI5D;IAEJ,MAAM,CAAC,OAAO,EAAE;QACd,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAC/D,GAAG,IAAI,EAAE,IAAI,GACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACT,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAChB,CAAC,EACD,CAAC,GAAG,wBAAwB,EAC5B,OAAO,CAAC,CAAC,EAAE;aAAG,CAAC,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAAE,CAAC,MAAM,CAAC,CAAC,GAAG,eAAe,CAC7F,CAAC;KACH,CAAoH;IAErH,MAAM,CAAC,YAAY,EAAE;QACnB,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAC/D,GAAG,IAAI,EAAE,IAAI,GACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACT,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAChB,CAAC,EACD,CAAC,EACD,OAAO,CAAC,CAAC,EAAE;aAAG,CAAC,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAAE,CAAC,MAAM,CAAC,CAAC,GAAG,eAAe,CAC7F,CAAC;KACH,CAGG;CACL"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=service-registry.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-registry.test.d.ts","sourceRoot":"","sources":["../../../../src/services/service-registry.test.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export * from './services';
2
- export * from './layer';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Layer } from 'effect';
2
- import type { Schema } from 'effect';
3
- import type { EchoHostIndexingConfig } from '@dxos/echo-pipeline';
4
- import { DatabaseService, QueueService } from '../services';
5
- export type TestDatabaseOptions = {
6
- indexing?: Partial<EchoHostIndexingConfig>;
7
- types?: Schema.Schema.AnyNoContext[];
8
- };
9
- export declare const TestDatabaseLayer: ({ indexing, types }?: TestDatabaseOptions) => Layer.Layer<DatabaseService | QueueService, never, never>;
10
- //# sourceMappingURL=layer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../../../src/testing/layer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,sBAAqB,mBAAwB,8DAU5E,CAAC"}
@@ -1,5 +0,0 @@
1
- import { type Context } from 'effect';
2
- import { type EventLogger } from '../services';
3
- export declare const noopLogger: Context.Tag.Service<EventLogger>;
4
- export declare const consoleLogger: Context.Tag.Service<EventLogger>;
5
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/testing/logger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAI9C,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,aAAa,CAAC;AAElE,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAGvD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAoC,CAAC"}
@@ -1,59 +0,0 @@
1
- import { type Context } from 'effect';
2
- import type { Space } from '@dxos/client/echo';
3
- import type { EchoDatabase, QueueFactory } from '@dxos/echo-db';
4
- import { type CredentialsService, type EventLogger, ServiceContainer, type ServiceCredential, type TracingService } from '../services';
5
- export type OneOf<T> = {
6
- [K in keyof T]: {
7
- [P in K]: T[P];
8
- } & {
9
- [P in Exclude<keyof T, K>]?: never;
10
- };
11
- }[keyof T];
12
- export type AiServiceProvider = 'dev' | 'edge' | 'ollama' | 'lmstudio';
13
- export type TestServiceOptions = {
14
- /**
15
- * AI service configuration.
16
- */
17
- ai?: any;
18
- /**
19
- * Credentials service configuration.
20
- */
21
- credentials?: OneOf<{
22
- /**
23
- * Predefined credentials list.
24
- */
25
- services?: ServiceCredential[];
26
- /**
27
- * Custom credentials service.
28
- */
29
- service?: Context.Tag.Service<CredentialsService>;
30
- }>;
31
- /**
32
- * Database configuration.
33
- */
34
- db?: EchoDatabase;
35
- /**
36
- * Gets database and queue services from the space.
37
- * Exclusive with: `db`, `queues`
38
- */
39
- space?: Space;
40
- /**
41
- * Logging configuration.
42
- */
43
- logging?: {
44
- enabled?: boolean;
45
- logger?: Context.Tag.Service<EventLogger>;
46
- };
47
- /**
48
- * Queue service configuration.
49
- */
50
- queues?: QueueFactory;
51
- tracing?: {
52
- service?: Context.Tag.Service<TracingService>;
53
- };
54
- };
55
- /**
56
- * @deprecated
57
- */
58
- export declare const createTestServices: ({ ai, credentials, db, logging, queues, space, tracing, }?: TestServiceOptions) => ServiceContainer;
59
- //# sourceMappingURL=services.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/testing/services.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,KAAK,EAAE,M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O,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;KAC/C,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,4DAQhC,kBAAuB,KAAG,gBAW5B,CAAC"}
@@ -1,124 +0,0 @@
1
- import { Schema } from 'effect';
2
- import { Type, type Ref } from '@dxos/echo';
3
- import { Queue } from '@dxos/echo-db';
4
- import { FunctionTrigger, type FunctionTriggerType } from './types';
5
- export declare enum InvocationOutcome {
6
- SUCCESS = "success",
7
- FAILURE = "failure",
8
- PENDING = "pending"
9
- }
10
- export declare enum InvocationTraceEventType {
11
- START = "start",
12
- END = "end"
13
- }
14
- export declare const TraceEventException: Schema.Struct<{
15
- timestampMs: typeof Schema.Number;
16
- message: typeof Schema.String;
17
- name: typeof Schema.String;
18
- stack: Schema.optional<typeof Schema.String>;
19
- }>;
20
- export type TraceEventException = Schema.Schema.Type<typeof TraceEventException>;
21
- export declare const InvocationTraceStartEvent: Type.obj<Schema.Struct<{
22
- /**
23
- * Queue message id.
24
- */
25
- id: import("@dxos/keys").ObjectIdClass;
26
- type: Schema.Literal<[InvocationTraceEventType.START]>;
27
- /**
28
- * Invocation id, the same for invocation start and end events.
29
- */
30
- invocationId: import("@dxos/keys").ObjectIdClass;
31
- /**
32
- * Event generation time.
33
- */
34
- timestampMs: typeof Schema.Number;
35
- /**
36
- * Data passed to function / workflow as an argument.
37
- */
38
- input: typeof Schema.Object;
39
- /**
40
- * Queue for function/workflow invocation events.
41
- */
42
- invocationTraceQueue: Type.ref<Schema.Schema<Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
43
- /**
44
- * DXN of the invoked function/workflow.
45
- */
46
- invocationTarget: Type.ref<Schema.Schema<Type.Expando, {
47
- [x: string]: any;
48
- id: string;
49
- }, never>>;
50
- /**
51
- * Present for automatic invocations.
52
- */
53
- trigger: Schema.optional<Type.ref<typeof FunctionTrigger>>;
54
- }>>;
55
- export type InvocationTraceStartEvent = Schema.Schema.Type<typeof InvocationTraceStartEvent>;
56
- export declare const InvocationTraceEndEvent: Type.obj<Schema.Struct<{
57
- /**
58
- * Trace event id.
59
- */
60
- id: import("@dxos/keys").ObjectIdClass;
61
- type: Schema.Literal<[InvocationTraceEventType.END]>;
62
- /**
63
- * Invocation id, will be the same for invocation start and end.
64
- */
65
- invocationId: import("@dxos/keys").ObjectIdClass;
66
- /**
67
- * Event generation time.
68
- */
69
- timestampMs: typeof Schema.Number;
70
- outcome: Schema.Enums<typeof InvocationOutcome>;
71
- exception: Schema.optional<Schema.Struct<{
72
- timestampMs: typeof Schema.Number;
73
- message: typeof Schema.String;
74
- name: typeof Schema.String;
75
- stack: Schema.optional<typeof Schema.String>;
76
- }>>;
77
- }>>;
78
- export type InvocationTraceEndEvent = Schema.Schema.Type<typeof InvocationTraceEndEvent>;
79
- export type InvocationTraceEvent = InvocationTraceStartEvent | InvocationTraceEndEvent;
80
- export declare const TraceEventLog: Schema.Struct<{
81
- timestampMs: typeof Schema.Number;
82
- level: typeof Schema.String;
83
- message: typeof Schema.String;
84
- context: Schema.optional<typeof Schema.Object>;
85
- }>;
86
- export declare const TraceEvent: Type.obj<Schema.Struct<{
87
- id: import("@dxos/keys").ObjectIdClass;
88
- outcome: typeof Schema.String;
89
- truncated: typeof Schema.Boolean;
90
- /**
91
- * Time when the event was persisted.
92
- */
93
- ingestionTimestampMs: typeof Schema.Number;
94
- logs: Schema.Array$<Schema.Struct<{
95
- timestampMs: typeof Schema.Number;
96
- level: typeof Schema.String;
97
- message: typeof Schema.String;
98
- context: Schema.optional<typeof Schema.Object>;
99
- }>>;
100
- exceptions: Schema.Array$<Schema.Struct<{
101
- timestampMs: typeof Schema.Number;
102
- message: typeof Schema.String;
103
- name: typeof Schema.String;
104
- stack: Schema.optional<typeof Schema.String>;
105
- }>>;
106
- }>>;
107
- export type TraceEvent = Schema.Schema.Type<typeof TraceEvent>;
108
- /**
109
- * InvocationTrace event format.
110
- * This is the combined format of InvocationTraceStartEvent and InvocationTraceEndEvents for UI consumption.
111
- */
112
- export type InvocationSpan = {
113
- id: string;
114
- timestampMs: number;
115
- outcome: InvocationOutcome;
116
- input: object;
117
- durationMs: number;
118
- invocationTraceQueue: Ref.Ref<Queue>;
119
- invocationTarget: Ref.Ref<Type.Expando>;
120
- trigger?: Ref.Ref<FunctionTriggerType>;
121
- exception?: TraceEventException;
122
- };
123
- export declare const createInvocationSpans: (items?: InvocationTraceEvent[]) => InvocationSpan[];
124
- //# sourceMappingURL=trace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/trace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,OAAO,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEpE,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAGD,oBAAY,wBAAwB;IAClC,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AAED,eAAO,MAAM,mBAAmB;;;;;EAK9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjF,eAAO,MAAM,yBAAyB;IACpC;;OAEG;;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;;;;IAEH;;OAEG;;GAEkF,CAAC;AAExF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7F,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;;IAGH;;OAEG;;IAEH;;OAEG;;;;;;;;;GAKgF,CAAC;AAEtF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzF,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;AAEvF,eAAO,MAAM,aAAa;;;;;EAKxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;IAKrB;;OAEG;;;;;;;;;;;;;;GAIwE,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,QAAQ,oBAAoB,EAAE,KAAG,cAAc,EAkDpF,CAAC"}
@@ -1,12 +0,0 @@
1
- import { ScriptType } from './schema';
2
- export declare const translations: [{
3
- readonly 'en-US': {
4
- readonly [ScriptType.typename]: {
5
- readonly 'typename label': "Script";
6
- readonly 'typename label_zero': "Scripts";
7
- readonly 'typename label_one': "Script";
8
- readonly 'typename label_other': "Scripts";
9
- };
10
- };
11
- }];
12
- //# sourceMappingURL=translations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,UAAU,CAAC,QAAQ,CAAC;;;;;UAKpB;;EAGwB,CAAC"}