@dxos/functions 0.8.3 → 0.8.4-main.1068cf700f

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 (172) hide show
  1. package/dist/lib/neutral/index.mjs +1229 -0
  2. package/dist/lib/neutral/index.mjs.map +7 -0
  3. package/dist/lib/neutral/meta.json +1 -0
  4. package/dist/types/src/errors.d.ts +121 -0
  5. package/dist/types/src/errors.d.ts.map +1 -0
  6. package/dist/types/src/example/fib.d.ts +7 -0
  7. package/dist/types/src/example/fib.d.ts.map +1 -0
  8. package/dist/types/src/example/forex-effect.d.ts +3 -0
  9. package/dist/types/src/example/forex-effect.d.ts.map +1 -0
  10. package/dist/types/src/example/index.d.ts +12 -0
  11. package/dist/types/src/example/index.d.ts.map +1 -0
  12. package/dist/types/src/example/reply.d.ts +3 -0
  13. package/dist/types/src/example/reply.d.ts.map +1 -0
  14. package/dist/types/src/example/sleep.d.ts +5 -0
  15. package/dist/types/src/example/sleep.d.ts.map +1 -0
  16. package/dist/types/src/index.d.ts +5 -6
  17. package/dist/types/src/index.d.ts.map +1 -1
  18. package/dist/types/src/operation-compatibility.test.d.ts +2 -0
  19. package/dist/types/src/operation-compatibility.test.d.ts.map +1 -0
  20. package/dist/types/src/protocol/functions-ai-http-client.d.ts +12 -0
  21. package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -0
  22. package/dist/types/src/protocol/index.d.ts +2 -0
  23. package/dist/types/src/protocol/index.d.ts.map +1 -0
  24. package/dist/types/src/protocol/protocol.d.ts +7 -0
  25. package/dist/types/src/protocol/protocol.d.ts.map +1 -0
  26. package/dist/types/src/protocol/protocol.test.d.ts +2 -0
  27. package/dist/types/src/protocol/protocol.test.d.ts.map +1 -0
  28. package/dist/types/src/sdk.d.ts +114 -0
  29. package/dist/types/src/sdk.d.ts.map +1 -0
  30. package/dist/types/src/services/credentials.d.ts +24 -4
  31. package/dist/types/src/services/credentials.d.ts.map +1 -1
  32. package/dist/types/src/services/event-logger.d.ts +74 -30
  33. package/dist/types/src/services/event-logger.d.ts.map +1 -1
  34. package/dist/types/src/services/function-invocation-service.d.ts +16 -0
  35. package/dist/types/src/services/function-invocation-service.d.ts.map +1 -0
  36. package/dist/types/src/services/index.d.ts +5 -6
  37. package/dist/types/src/services/index.d.ts.map +1 -1
  38. package/dist/types/src/services/queues.d.ts +35 -6
  39. package/dist/types/src/services/queues.d.ts.map +1 -1
  40. package/dist/types/src/services/tracing.d.ts +78 -5
  41. package/dist/types/src/services/tracing.d.ts.map +1 -1
  42. package/dist/types/src/types/Function.d.ts +52 -0
  43. package/dist/types/src/types/Function.d.ts.map +1 -0
  44. package/dist/types/src/types/Script.d.ts +21 -0
  45. package/dist/types/src/types/Script.d.ts.map +1 -0
  46. package/dist/types/src/types/Trigger.d.ts +121 -0
  47. package/dist/types/src/types/Trigger.d.ts.map +1 -0
  48. package/dist/types/src/types/TriggerEvent.d.ts +74 -0
  49. package/dist/types/src/types/TriggerEvent.d.ts.map +1 -0
  50. package/dist/types/src/types/index.d.ts +6 -0
  51. package/dist/types/src/types/index.d.ts.map +1 -0
  52. package/dist/types/src/types/url.d.ts +13 -0
  53. package/dist/types/src/types/url.d.ts.map +1 -0
  54. package/dist/types/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +27 -65
  56. package/src/errors.ts +21 -0
  57. package/src/example/fib.ts +32 -0
  58. package/src/example/forex-effect.ts +40 -0
  59. package/src/example/index.ts +13 -0
  60. package/src/example/reply.ts +21 -0
  61. package/src/example/sleep.ts +24 -0
  62. package/src/index.ts +5 -8
  63. package/src/operation-compatibility.test.ts +185 -0
  64. package/src/protocol/functions-ai-http-client.ts +67 -0
  65. package/src/{executor → protocol}/index.ts +1 -1
  66. package/src/protocol/protocol.test.ts +59 -0
  67. package/src/protocol/protocol.ts +262 -0
  68. package/src/sdk.ts +289 -0
  69. package/src/services/credentials.ts +109 -5
  70. package/src/services/event-logger.ts +77 -37
  71. package/src/services/function-invocation-service.ts +37 -0
  72. package/src/services/index.ts +5 -6
  73. package/src/services/queues.ts +56 -11
  74. package/src/services/tracing.ts +151 -11
  75. package/src/types/Function.ts +82 -0
  76. package/src/types/Script.ts +34 -0
  77. package/src/types/Trigger.ts +143 -0
  78. package/src/types/TriggerEvent.ts +62 -0
  79. package/src/types/index.ts +9 -0
  80. package/src/types/url.ts +32 -0
  81. package/dist/lib/browser/bundler/index.mjs +0 -236
  82. package/dist/lib/browser/bundler/index.mjs.map +0 -7
  83. package/dist/lib/browser/chunk-WEFZUEL2.mjs +0 -300
  84. package/dist/lib/browser/chunk-WEFZUEL2.mjs.map +0 -7
  85. package/dist/lib/browser/edge/index.mjs +0 -69
  86. package/dist/lib/browser/edge/index.mjs.map +0 -7
  87. package/dist/lib/browser/index.mjs +0 -486
  88. package/dist/lib/browser/index.mjs.map +0 -7
  89. package/dist/lib/browser/meta.json +0 -1
  90. package/dist/lib/browser/testing/index.mjs +0 -28
  91. package/dist/lib/browser/testing/index.mjs.map +0 -7
  92. package/dist/lib/node/bundler/index.cjs +0 -260
  93. package/dist/lib/node/bundler/index.cjs.map +0 -7
  94. package/dist/lib/node/chunk-IJAE7FZK.cjs +0 -320
  95. package/dist/lib/node/chunk-IJAE7FZK.cjs.map +0 -7
  96. package/dist/lib/node/edge/index.cjs +0 -94
  97. package/dist/lib/node/edge/index.cjs.map +0 -7
  98. package/dist/lib/node/index.cjs +0 -522
  99. package/dist/lib/node/index.cjs.map +0 -7
  100. package/dist/lib/node/meta.json +0 -1
  101. package/dist/lib/node/testing/index.cjs +0 -43
  102. package/dist/lib/node/testing/index.cjs.map +0 -7
  103. package/dist/lib/node-esm/bundler/index.mjs +0 -238
  104. package/dist/lib/node-esm/bundler/index.mjs.map +0 -7
  105. package/dist/lib/node-esm/chunk-LIYPMWNQ.mjs +0 -302
  106. package/dist/lib/node-esm/chunk-LIYPMWNQ.mjs.map +0 -7
  107. package/dist/lib/node-esm/edge/index.mjs +0 -71
  108. package/dist/lib/node-esm/edge/index.mjs.map +0 -7
  109. package/dist/lib/node-esm/index.mjs +0 -487
  110. package/dist/lib/node-esm/index.mjs.map +0 -7
  111. package/dist/lib/node-esm/meta.json +0 -1
  112. package/dist/lib/node-esm/testing/index.mjs +0 -29
  113. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  114. package/dist/types/src/bundler/bundler.d.ts +0 -51
  115. package/dist/types/src/bundler/bundler.d.ts.map +0 -1
  116. package/dist/types/src/bundler/bundler.test.d.ts +0 -2
  117. package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
  118. package/dist/types/src/bundler/index.d.ts +0 -2
  119. package/dist/types/src/bundler/index.d.ts.map +0 -1
  120. package/dist/types/src/edge/functions.d.ts +0 -16
  121. package/dist/types/src/edge/functions.d.ts.map +0 -1
  122. package/dist/types/src/edge/index.d.ts +0 -2
  123. package/dist/types/src/edge/index.d.ts.map +0 -1
  124. package/dist/types/src/executor/executor.d.ts +0 -8
  125. package/dist/types/src/executor/executor.d.ts.map +0 -1
  126. package/dist/types/src/executor/index.d.ts +0 -2
  127. package/dist/types/src/executor/index.d.ts.map +0 -1
  128. package/dist/types/src/handler.d.ts +0 -64
  129. package/dist/types/src/handler.d.ts.map +0 -1
  130. package/dist/types/src/schema.d.ts +0 -38
  131. package/dist/types/src/schema.d.ts.map +0 -1
  132. package/dist/types/src/services/ai.d.ts +0 -12
  133. package/dist/types/src/services/ai.d.ts.map +0 -1
  134. package/dist/types/src/services/database.d.ts +0 -11
  135. package/dist/types/src/services/database.d.ts.map +0 -1
  136. package/dist/types/src/services/function-call-service.d.ts +0 -16
  137. package/dist/types/src/services/function-call-service.d.ts.map +0 -1
  138. package/dist/types/src/services/service-container.d.ts +0 -44
  139. package/dist/types/src/services/service-container.d.ts.map +0 -1
  140. package/dist/types/src/testing/index.d.ts +0 -2
  141. package/dist/types/src/testing/index.d.ts.map +0 -1
  142. package/dist/types/src/testing/logger.d.ts +0 -5
  143. package/dist/types/src/testing/logger.d.ts.map +0 -1
  144. package/dist/types/src/testing/services.d.ts +0 -13
  145. package/dist/types/src/testing/services.d.ts.map +0 -1
  146. package/dist/types/src/trace.d.ts +0 -124
  147. package/dist/types/src/trace.d.ts.map +0 -1
  148. package/dist/types/src/translations.d.ts +0 -12
  149. package/dist/types/src/translations.d.ts.map +0 -1
  150. package/dist/types/src/types.d.ts +0 -411
  151. package/dist/types/src/types.d.ts.map +0 -1
  152. package/dist/types/src/url.d.ts +0 -17
  153. package/dist/types/src/url.d.ts.map +0 -1
  154. package/src/bundler/bundler.test.ts +0 -59
  155. package/src/bundler/bundler.ts +0 -270
  156. package/src/bundler/index.ts +0 -5
  157. package/src/edge/functions.ts +0 -64
  158. package/src/edge/index.ts +0 -9
  159. package/src/executor/executor.ts +0 -47
  160. package/src/handler.ts +0 -113
  161. package/src/schema.ts +0 -57
  162. package/src/services/ai.ts +0 -32
  163. package/src/services/database.ts +0 -28
  164. package/src/services/function-call-service.ts +0 -64
  165. package/src/services/service-container.ts +0 -109
  166. package/src/testing/index.ts +0 -5
  167. package/src/testing/logger.ts +0 -16
  168. package/src/testing/services.ts +0 -32
  169. package/src/trace.ts +0 -180
  170. package/src/translations.ts +0 -20
  171. package/src/types.ts +0 -211
  172. package/src/url.ts +0 -52
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/testing/logger.ts", "../../../../src/testing/services.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Effect, type Context } from 'effect';\n\nimport { LogLevel } from '@dxos/log';\n\nimport { type EventLogger, createEventLogger } from '../services';\n\nexport const noopLogger: Context.Tag.Service<EventLogger> = {\n log: () => Effect.succeed(undefined),\n nodeId: undefined,\n};\n\nexport const consoleLogger: Context.Tag.Service<EventLogger> = createEventLogger(LogLevel.INFO);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Context } from 'effect';\n\nimport type { AiServiceClient } from '@dxos/ai';\nimport type { QueueFactory } from '@dxos/echo-db';\n\nimport { consoleLogger, noopLogger } from './logger';\nimport { AiService, QueueService, ServiceContainer } from '../services';\nimport type { EventLogger } from '../services/event-logger';\n\nexport type TestServiceOptions = {\n ai?: AiServiceClient;\n queueFactory?: QueueFactory;\n enableLogging?: boolean;\n logger?: Context.Tag.Service<EventLogger>;\n};\n\nexport const createTestServices = ({\n ai,\n queueFactory,\n enableLogging = false,\n logger = enableLogging ? consoleLogger : noopLogger,\n}: TestServiceOptions = {}): ServiceContainer => {\n return new ServiceContainer().setServices({\n ai: ai != null ? AiService.make(ai) : undefined,\n eventLogger: logger,\n queues: queueFactory != null ? QueueService.make(queueFactory, undefined) : undefined,\n });\n};\n"],
5
- "mappings": ";;;;;;;;;AAIA,SAASA,cAA4B;AAErC,SAASC,gBAAgB;AAIlB,IAAMC,aAA+C;EAC1DC,KAAK,MAAMC,OAAOC,QAAQC,MAAAA;EAC1BC,QAAQD;AACV;AAEO,IAAME,gBAAkDC,kBAAkBC,SAASC,IAAI;;;ACKvF,IAAMC,qBAAqB,CAAC,EACjCC,IACAC,cACAC,gBAAgB,OAChBC,SAASD,gBAAgBE,gBAAgBC,WAAU,IAC7B,CAAC,MAAC;AACxB,SAAO,IAAIC,iBAAAA,EAAmBC,YAAY;IACxCP,IAAIA,MAAM,OAAOQ,UAAUC,KAAKT,EAAAA,IAAMU;IACtCC,aAAaR;IACbS,QAAQX,gBAAgB,OAAOY,aAAaJ,KAAKR,cAAcS,MAAAA,IAAaA;EAC9E,CAAA;AACF;",
6
- "names": ["Effect", "LogLevel", "noopLogger", "log", "Effect", "succeed", "undefined", "nodeId", "consoleLogger", "createEventLogger", "LogLevel", "INFO", "createTestServices", "ai", "queueFactory", "enableLogging", "logger", "consoleLogger", "noopLogger", "ServiceContainer", "setServices", "AiService", "make", "undefined", "eventLogger", "queues", "QueueService"]
7
- }
@@ -1,51 +0,0 @@
1
- import { type BuildOptions } from 'esbuild';
2
- import { type BuildResult } from 'esbuild-wasm';
3
- export type Import = {
4
- moduleUrl: string;
5
- defaultImport: boolean;
6
- namedImports: string[];
7
- };
8
- export type BundleOptions = {
9
- /**
10
- * Path to the source file on the local file system.
11
- * If provided, the path will be used instead of the `source` code.
12
- */
13
- path?: string;
14
- /**
15
- * Source code to bundle.
16
- * Required if `path` is not provided.
17
- */
18
- source?: string;
19
- };
20
- export type BundleResult = {
21
- timestamp: number;
22
- sourceHash?: Buffer;
23
- imports?: Import[];
24
- bundle?: string;
25
- error?: any;
26
- };
27
- export type BundlerOptions = {
28
- platform: BuildOptions['platform'];
29
- sandboxedModules: string[];
30
- remoteModules: Record<string, string>;
31
- };
32
- export declare const initializeBundler: (options: {
33
- wasmUrl: string;
34
- }) => Promise<void>;
35
- /**
36
- * ESBuild bundler.
37
- */
38
- export declare class Bundler {
39
- private readonly _options;
40
- constructor(_options: BundlerOptions);
41
- bundle({ path, source }: BundleOptions): Promise<BundleResult>;
42
- analyzeImports(result: BuildResult): Import[];
43
- analyzeSourceFileImports(code: string): {
44
- defaultImportName: string;
45
- namedImports: string[];
46
- wildcardImportName: string;
47
- moduleIdentifier: string;
48
- quotes: string;
49
- }[];
50
- }
51
- //# sourceMappingURL=bundler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../../src/bundler/bundler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAqB,KAAK,WAAW,EAAe,MAAM,cAAc,CAAC;AAMhF,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACnC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAU,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,kBAInE,CAAC;AAEF;;GAEG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,cAAc;IAE/C,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAwFpE,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE;IA2B7C,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG;QACtC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;KAChB,EAAE;CAaJ"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=bundler.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundler.test.d.ts","sourceRoot":"","sources":["../../../../src/bundler/bundler.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './bundler';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bundler/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
@@ -1,16 +0,0 @@
1
- import { type DID } from 'iso-did/types';
2
- import { type Client } from '@dxos/client';
3
- import type { PublicKey } from '@dxos/keys';
4
- import { type UploadFunctionResponseBody } from '@dxos/protocols';
5
- export type UploadWorkerArgs = {
6
- client: Client;
7
- source: string;
8
- version: string;
9
- name?: string;
10
- functionId?: string;
11
- ownerPublicKey: PublicKey;
12
- };
13
- export declare const uploadWorkerFunction: ({ client, version, source, name, functionId, ownerPublicKey, }: UploadWorkerArgs) => Promise<UploadFunctionResponseBody>;
14
- export declare const incrementSemverPatch: (version: string) => string;
15
- export declare const publicKeyToDid: (key: PublicKey) => DID;
16
- //# sourceMappingURL=functions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../src/edge/functions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,gEAOxC,gBAAgB,KAAG,OAAO,CAAC,0BAA0B,CAqBvD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,MAKtD,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,KAAK,SAAS,KAAG,GAE/C,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './functions';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/edge/index.ts"],"names":[],"mappings":"AAQA,cAAc,aAAa,CAAC"}
@@ -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":"AAQA,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,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;CA4BxE"}
@@ -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,64 +0,0 @@
1
- import { Schema, type Context, type Effect } from 'effect';
2
- import { type AiServiceClient } from '@dxos/ai';
3
- import type { CoreDatabase, 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
- /**
8
- * Function handler.
9
- */
10
- export type FunctionHandler<TData = {}, TOutput = any> = (params: {
11
- /**
12
- * Services and context available to the function.
13
- */
14
- context: FunctionContext;
15
- /**
16
- * Data passed as the input to the function.
17
- * Must match the function's input schema.
18
- * This will be the payload from the trigger or other data passed into the function in a workflow.
19
- */
20
- data: TData;
21
- }) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any>;
22
- /**
23
- * Function context.
24
- */
25
- export interface FunctionContext {
26
- /**
27
- * Resolves a service available to the function.
28
- * @throws if the service is not available.
29
- */
30
- getService: <T extends Context.Tag<any, any>>(tag: T) => Context.Tag.Service<T>;
31
- getSpace: (spaceId: SpaceId) => Promise<SpaceAPI>;
32
- /**
33
- * Space from which the function was invoked.
34
- */
35
- space: SpaceAPI | undefined;
36
- ai: AiServiceClient;
37
- }
38
- export interface FunctionContextAi {
39
- run(model: string, inputs: any, options?: any): Promise<any>;
40
- }
41
- export interface QueuesAPI {
42
- queryQueue(queue: DXN, options?: {}): Promise<QueryResult>;
43
- insertIntoQueue(queue: DXN, objects: HasId[]): Promise<void>;
44
- }
45
- /**
46
- * Space interface available to functions.
47
- */
48
- export interface SpaceAPI {
49
- get id(): SpaceId;
50
- /**
51
- * @deprecated
52
- */
53
- get crud(): CoreDatabase;
54
- get db(): EchoDatabase;
55
- get queues(): QueuesAPI;
56
- }
57
- export type FunctionDefinition<T = {}, O = any> = {
58
- description?: string;
59
- inputSchema: Schema.Schema<T, any>;
60
- outputSchema?: Schema.Schema<O, any>;
61
- handler: FunctionHandler<T, O>;
62
- };
63
- export declare const defineFunction: <T, O>(params: FunctionDefinition<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;AAED,MAAM,WAAW,iBAAiB;IAEhC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC9D;AAQD,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3D,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,IAAI,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,IAAI,IAAI,YAAY,CAAC;IACzB,IAAI,EAAE,IAAI,YAAY,CAAC;IAEvB,IAAI,MAAM,IAAI,SAAS,CAAC;CACzB;AAOD,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAChC,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAc9F,CAAC"}
@@ -1,38 +0,0 @@
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<Type.Kind.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<Type.Kind.Object> & {
25
- name?: string | undefined;
26
- description?: string | undefined;
27
- changed?: boolean | undefined;
28
- source: Ref<Type.OfKind<Type.Kind.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,12 +0,0 @@
1
- import { Context, Layer } from 'effect';
2
- import type { AiServiceClient } from '@dxos/ai';
3
- declare const AiService_base: Context.TagClass<AiService, "AiService", {
4
- readonly client: AiServiceClient;
5
- }>;
6
- export declare class AiService extends AiService_base {
7
- static make: (client: AiServiceClient) => Context.Tag.Service<AiService>;
8
- static makeLayer: (client: AiServiceClient) => Layer.Layer<AiService>;
9
- static notAvailable: Layer.Layer<AiService, never, never>;
10
- }
11
- export {};
12
- //# sourceMappingURL=ai.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../../../src/services/ai.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;;qBAM3B,eAAe;;AAHpC,qBAAa,SAAU,SAAQ,cAK5B;IACD,MAAM,CAAC,IAAI,GAAI,QAAQ,eAAe,KAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAMrE;IAEF,MAAM,CAAC,SAAS,GAAI,QAAQ,eAAe,KAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CACjB;IAEnD,MAAM,CAAC,YAAY,uCAIhB;CACJ"}
@@ -1,11 +0,0 @@
1
- import { Context, Layer } from 'effect';
2
- import type { EchoDatabase } from '@dxos/echo-db';
3
- declare const DatabaseService_base: Context.TagClass<DatabaseService, "DatabaseService", {
4
- readonly db: EchoDatabase;
5
- }>;
6
- export declare class DatabaseService extends DatabaseService_base {
7
- static notAvailable: Layer.Layer<DatabaseService, never, never>;
8
- static make: (db: EchoDatabase) => Context.Tag.Service<DatabaseService>;
9
- }
10
- export {};
11
- //# sourceMappingURL=database.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../../src/services/database.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;;iBAKjC,YAAY;;AAH7B,qBAAa,eAAgB,SAAQ,oBAKlC;IACD,MAAM,CAAC,YAAY,6CAIhB;IAEH,MAAM,CAAC,IAAI,GAAI,IAAI,YAAY,KAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAMpE;CACH"}
@@ -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,44 +0,0 @@
1
- import { Layer, type Context } from 'effect';
2
- import { AiService } from './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 service tags and their names.
11
- */
12
- export interface ServiceTagRecord {
13
- ai: AiService;
14
- credentials: CredentialsService;
15
- database: DatabaseService;
16
- eventLogger: EventLogger;
17
- functionCallService: FunctionCallService;
18
- tracing: TracingService;
19
- queues: QueueService;
20
- }
21
- /**
22
- * List of all services and their runtime types.
23
- */
24
- export type ServiceRecord = {
25
- [K in keyof ServiceTagRecord]: Context.Tag.Service<ServiceTagRecord[K]>;
26
- };
27
- /**
28
- * Union of all services.
29
- */
30
- export type Services = ServiceTagRecord[keyof ServiceTagRecord];
31
- export declare const SERVICE_TAGS: Context.Tag<any, any>[];
32
- export declare class ServiceContainer {
33
- private _services;
34
- /**
35
- * Set services.
36
- * @param services - Services to set.
37
- * @returns The container instance.
38
- */
39
- setServices(services: Partial<ServiceRecord>): this;
40
- getService<T extends Context.Tag<any, any>>(tag: T): Context.Tag.Service<T>;
41
- clone(): ServiceContainer;
42
- createLayer(): Layer.Layer<Services>;
43
- }
44
- //# 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,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAgC,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBA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1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,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,13 +0,0 @@
1
- import { type Context } from 'effect';
2
- import type { AiServiceClient } from '@dxos/ai';
3
- import type { QueueFactory } from '@dxos/echo-db';
4
- import { ServiceContainer } from '../services';
5
- import type { EventLogger } from '../services/event-logger';
6
- export type TestServiceOptions = {
7
- ai?: AiServiceClient;
8
- queueFactory?: QueueFactory;
9
- enableLogging?: boolean;
10
- logger?: Context.Tag.Service<EventLogger>;
11
- };
12
- export declare const createTestServices: ({ ai, queueFactory, enableLogging, logger, }?: TestServiceOptions) => ServiceContainer;
13
- //# 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,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAA2B,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,+CAKhC,kBAAuB,KAAG,gBAM5B,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,C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,EAAE,KAAG,cAAc,EAkDpF,CAAC"}
@@ -1,12 +0,0 @@
1
- declare const _default: {
2
- 'en-US': {
3
- [x: string]: {
4
- 'typename label': string;
5
- 'typename label_zero': string;
6
- 'typename label_one': string;
7
- 'typename label_other': string;
8
- };
9
- };
10
- }[];
11
- export default _default;
12
- //# sourceMappingURL=translations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;AAQA,wBAWE"}