@dxos/compute 0.8.4-main.c85a9c8dae → 0.8.4-main.cb12b3f963

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 (157) hide show
  1. package/README.md +36 -1
  2. package/dist/lib/neutral/StorageService.mjs +22 -0
  3. package/dist/lib/neutral/StorageService.mjs.map +7 -0
  4. package/dist/lib/neutral/chunk-4N4JAXCP.mjs +17 -0
  5. package/dist/lib/neutral/chunk-4N4JAXCP.mjs.map +7 -0
  6. package/dist/lib/neutral/chunk-DDEBBRCI.mjs +62 -0
  7. package/dist/lib/neutral/chunk-DDEBBRCI.mjs.map +7 -0
  8. package/dist/lib/neutral/chunk-FEABF5XY.mjs +25 -0
  9. package/dist/lib/neutral/chunk-FEABF5XY.mjs.map +7 -0
  10. package/dist/lib/neutral/chunk-H6EHIVDN.mjs +21 -0
  11. package/dist/lib/neutral/chunk-H6EHIVDN.mjs.map +7 -0
  12. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  13. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-N462A6NO.mjs +138 -0
  15. package/dist/lib/neutral/chunk-N462A6NO.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-QPCDM7MF.mjs +179 -0
  17. package/dist/lib/neutral/chunk-QPCDM7MF.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-S24LL2D5.mjs +52 -0
  19. package/dist/lib/neutral/chunk-S24LL2D5.mjs.map +7 -0
  20. package/dist/lib/neutral/fib-HDHBZHPE.mjs +10 -0
  21. package/dist/lib/neutral/fib-HDHBZHPE.mjs.map +7 -0
  22. package/dist/lib/neutral/index.mjs +1030 -51
  23. package/dist/lib/neutral/index.mjs.map +4 -4
  24. package/dist/lib/neutral/meta.json +1 -1
  25. package/dist/lib/neutral/reply-XSQMXAPX.mjs +10 -0
  26. package/dist/lib/neutral/reply-XSQMXAPX.mjs.map +7 -0
  27. package/dist/lib/neutral/sleep-WHTJQ56P.mjs +10 -0
  28. package/dist/lib/neutral/sleep-WHTJQ56P.mjs.map +7 -0
  29. package/dist/lib/neutral/testing/index.mjs +27 -193
  30. package/dist/lib/neutral/testing/index.mjs.map +4 -4
  31. package/dist/types/src/Blueprint.d.ts +148 -0
  32. package/dist/types/src/Blueprint.d.ts.map +1 -0
  33. package/dist/types/src/Credential.d.ts +27 -0
  34. package/dist/types/src/Credential.d.ts.map +1 -0
  35. package/dist/types/src/Operation.d.ts +303 -0
  36. package/dist/types/src/Operation.d.ts.map +1 -0
  37. package/dist/types/src/OperationHandlerSet.d.ts +60 -0
  38. package/dist/types/src/OperationHandlerSet.d.ts.map +1 -0
  39. package/dist/types/src/OperationRegistry.d.ts +23 -0
  40. package/dist/types/src/OperationRegistry.d.ts.map +1 -0
  41. package/dist/types/src/Process.d.ts +247 -0
  42. package/dist/types/src/Process.d.ts.map +1 -0
  43. package/dist/types/src/Routine.d.ts +61 -0
  44. package/dist/types/src/Routine.d.ts.map +1 -0
  45. package/dist/types/src/Script.d.ts +22 -0
  46. package/dist/types/src/Script.d.ts.map +1 -0
  47. package/dist/types/src/ServiceResolver.d.ts +74 -0
  48. package/dist/types/src/ServiceResolver.d.ts.map +1 -0
  49. package/dist/types/src/StorageService.d.ts +58 -0
  50. package/dist/types/src/StorageService.d.ts.map +1 -0
  51. package/dist/types/src/Template.d.ts +56 -0
  52. package/dist/types/src/Template.d.ts.map +1 -0
  53. package/dist/types/src/Trace.d.ts +174 -0
  54. package/dist/types/src/Trace.d.ts.map +1 -0
  55. package/dist/types/src/Trigger.d.ts +150 -0
  56. package/dist/types/src/Trigger.d.ts.map +1 -0
  57. package/dist/types/src/TriggerEvent.d.ts +75 -0
  58. package/dist/types/src/TriggerEvent.d.ts.map +1 -0
  59. package/dist/types/src/errors.d.ts +239 -0
  60. package/dist/types/src/errors.d.ts.map +1 -0
  61. package/dist/types/src/index.d.ts +15 -5
  62. package/dist/types/src/index.d.ts.map +1 -1
  63. package/dist/types/src/testing/definitions.d.ts +11 -0
  64. package/dist/types/src/testing/definitions.d.ts.map +1 -0
  65. package/dist/types/src/testing/fib.d.ts +8 -0
  66. package/dist/types/src/testing/fib.d.ts.map +1 -0
  67. package/dist/types/src/testing/index.d.ts +6 -4
  68. package/dist/types/src/testing/index.d.ts.map +1 -1
  69. package/dist/types/src/testing/reply.d.ts +4 -0
  70. package/dist/types/src/testing/reply.d.ts.map +1 -0
  71. package/dist/types/src/testing/sleep.d.ts +6 -0
  72. package/dist/types/src/testing/sleep.d.ts.map +1 -0
  73. package/dist/types/src/umbrella.test.d.ts +2 -0
  74. package/dist/types/src/umbrella.test.d.ts.map +1 -0
  75. package/dist/types/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +21 -34
  77. package/src/Blueprint.ts +221 -0
  78. package/src/Credential.ts +51 -0
  79. package/src/Operation.ts +513 -0
  80. package/src/OperationHandlerSet.ts +132 -0
  81. package/src/OperationRegistry.ts +48 -0
  82. package/src/Process.ts +490 -0
  83. package/src/Routine.ts +84 -0
  84. package/src/Script.ts +38 -0
  85. package/src/ServiceResolver.ts +174 -0
  86. package/src/StorageService.ts +99 -0
  87. package/src/Template.ts +105 -0
  88. package/src/Trace.ts +231 -0
  89. package/src/Trigger.ts +207 -0
  90. package/src/TriggerEvent.ts +62 -0
  91. package/src/errors.ts +50 -0
  92. package/src/index.ts +16 -6
  93. package/src/testing/definitions.ts +49 -0
  94. package/src/testing/fib.ts +22 -0
  95. package/src/testing/index.ts +13 -5
  96. package/src/testing/reply.ts +18 -0
  97. package/src/testing/sleep.ts +16 -0
  98. package/src/umbrella.test.ts +51 -0
  99. package/dist/lib/neutral/chunk-KGBGT4NT.mjs +0 -3106
  100. package/dist/lib/neutral/chunk-KGBGT4NT.mjs.map +0 -7
  101. package/dist/types/src/compute-graph-registry.d.ts +0 -37
  102. package/dist/types/src/compute-graph-registry.d.ts.map +0 -1
  103. package/dist/types/src/compute-graph-registry.test.d.ts +0 -2
  104. package/dist/types/src/compute-graph-registry.test.d.ts.map +0 -1
  105. package/dist/types/src/compute-graph.d.ts +0 -67
  106. package/dist/types/src/compute-graph.d.ts.map +0 -1
  107. package/dist/types/src/compute-graph.test.d.ts +0 -2
  108. package/dist/types/src/compute-graph.test.d.ts.map +0 -1
  109. package/dist/types/src/compute-node.d.ts +0 -24
  110. package/dist/types/src/compute-node.d.ts.map +0 -1
  111. package/dist/types/src/functions/async-function.d.ts +0 -68
  112. package/dist/types/src/functions/async-function.d.ts.map +0 -1
  113. package/dist/types/src/functions/edge-function.d.ts +0 -20
  114. package/dist/types/src/functions/edge-function.d.ts.map +0 -1
  115. package/dist/types/src/functions/function-defs.d.ts +0 -11
  116. package/dist/types/src/functions/function-defs.d.ts.map +0 -1
  117. package/dist/types/src/functions/index.d.ts +0 -4
  118. package/dist/types/src/functions/index.d.ts.map +0 -1
  119. package/dist/types/src/hyperformula.test.d.ts +0 -2
  120. package/dist/types/src/hyperformula.test.d.ts.map +0 -1
  121. package/dist/types/src/testing/test-builder.d.ts +0 -15
  122. package/dist/types/src/testing/test-builder.d.ts.map +0 -1
  123. package/dist/types/src/testing/test-plugin.d.ts +0 -35
  124. package/dist/types/src/testing/test-plugin.d.ts.map +0 -1
  125. package/dist/types/src/testing/test-runtime.d.ts +0 -10
  126. package/dist/types/src/testing/test-runtime.d.ts.map +0 -1
  127. package/dist/types/src/testing/util.d.ts +0 -2
  128. package/dist/types/src/testing/util.d.ts.map +0 -1
  129. package/dist/types/src/types/hyperformula.d.ts +0 -8
  130. package/dist/types/src/types/hyperformula.d.ts.map +0 -1
  131. package/dist/types/src/types/index.d.ts +0 -3
  132. package/dist/types/src/types/index.d.ts.map +0 -1
  133. package/dist/types/src/types/types.d.ts +0 -20
  134. package/dist/types/src/types/types.d.ts.map +0 -1
  135. package/dist/types/src/types/types.test.d.ts +0 -2
  136. package/dist/types/src/types/types.test.d.ts.map +0 -1
  137. package/dist/types/src/util.d.ts +0 -2
  138. package/dist/types/src/util.d.ts.map +0 -1
  139. package/src/compute-graph-registry.test.ts +0 -158
  140. package/src/compute-graph-registry.ts +0 -97
  141. package/src/compute-graph.test.ts +0 -107
  142. package/src/compute-graph.ts +0 -264
  143. package/src/compute-node.ts +0 -59
  144. package/src/functions/async-function.ts +0 -184
  145. package/src/functions/edge-function.ts +0 -113
  146. package/src/functions/function-defs.ts +0 -2427
  147. package/src/functions/index.ts +0 -7
  148. package/src/hyperformula.test.ts +0 -14
  149. package/src/testing/test-builder.ts +0 -60
  150. package/src/testing/test-plugin.ts +0 -98
  151. package/src/testing/test-runtime.ts +0 -35
  152. package/src/testing/util.ts +0 -9
  153. package/src/types/hyperformula.ts +0 -19
  154. package/src/types/index.ts +0 -6
  155. package/src/types/types.test.ts +0 -91
  156. package/src/types/types.ts +0 -80
  157. package/src/util.ts +0 -8
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
3
+ "sources": ["../../../src/Blueprint.ts", "../../../src/Template.ts", "../../../src/OperationRegistry.ts", "../../../src/Credential.ts", "../../../src/Process.ts", "../../../src/Trace.ts", "../../../src/Routine.ts", "../../../src/Script.ts", "../../../src/ServiceResolver.ts", "../../../src/Trigger.ts", "../../../src/TriggerEvent.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { ToolId } from '@dxos/ai';\nimport { Annotation, Database, Filter, Obj, Type } from '@dxos/echo';\nimport { BaseError } from '@dxos/errors';\nimport { log } from '@dxos/log';\n\nimport * as Operation from './Operation';\nimport * as Template from './Template';\n\n/**\n * MCP server definition.\n */\nexport const McpServer = Schema.Struct({\n /**\n * URL of the MCP server.\n */\n url: Schema.String.annotations({\n description: 'URL of the MCP server',\n }),\n\n protocol: Schema.Union(Schema.Literal('sse'), Schema.Literal('http')).annotations({\n description: 'Protocol of the MCP server',\n }),\n});\nexport interface McpServer extends Schema.Schema.Type<typeof McpServer> {}\n\n/**\n * Blueprint schema defines the structure for AI assistant blueprints.\n * Blueprints contain instructions, tools, and artifacts that guide the AI's behavior.\n * Blueprints may use tools to create and read artifacts, which are managed by the assistant.\n */\nexport const Blueprint = Schema.Struct({\n /**\n * Global registry ID.\n * NOTE: The `key` property refers to the original registry entry.\n */\n // TODO(burdon): Create Format type for DXN-like ids, such as this and schema type.\n key: Schema.String.annotations({\n description: 'Unique registration key for the blueprint',\n }),\n\n /**\n * Human-readable name of the blueprint.\n */\n name: Schema.String.annotations({\n description: 'Human-readable name of the blueprint',\n }),\n\n /**\n * Description of the blueprint's purpose and functionality.\n */\n description: Schema.optional(Schema.String).annotations({\n description: \"Description of the blueprint's purpose and functionality\",\n }),\n\n /**\n * Instructions that guide the AI assistant's behavior and responses.\n * These are system prompts or guidelines that the AI should follow.\n */\n instructions: Template.Template.annotations({\n description: \"Instructions that guide the AI assistant's behavior and responses\",\n }),\n\n /**\n * Array of tools that the AI assistant can use when this blueprint is active.\n */\n tools: Schema.Array(ToolId).annotations({\n description: 'Array of tools that the AI assistant can use when this blueprint is active',\n }),\n\n /**\n * Whether an agent is allowed to auto-enable this blueprint in a conversation.\n */\n agentCanEnable: Schema.optional(Schema.Boolean).annotations({\n description: 'Whether an agent is allowed to auto-enable this blueprint in a conversation.',\n }),\n\n /**\n * Array of MCP servers that the AI assistant can use when this blueprint is active.\n */\n mcpServers: Schema.optional(Schema.Array(McpServer)),\n}).pipe(\n Type.object({\n // TODO(burdon): Is this a DXN? Need to create a Format type for these IDs.\n typename: 'org.dxos.type.blueprint',\n version: '0.1.0',\n }),\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--blueprint--regular',\n hue: 'sky',\n }),\n);\n\n/**\n * TypeScript type for Blueprint.\n */\nexport interface Blueprint extends Schema.Schema.Type<typeof Blueprint> {}\n\ntype MakeProps = Pick<Blueprint, 'key' | 'name'> & Partial<Blueprint>;\n\n/**\n * Create a new Blueprint.\n */\nexport const make = ({ tools = [], instructions = Template.make(), ...props }: MakeProps) =>\n Obj.make(Blueprint, {\n tools,\n instructions,\n ...props,\n });\n\n/**\n * Util to create tool definitions for a blueprint.\n */\nexport const toolDefinitions = ({\n tools = [],\n operations = [],\n}: {\n tools?: string[];\n operations?: Operation.Definition.Any[];\n}) => [...operations.map((op) => ToolId.make(op.meta.key)), ...tools.map((tool) => ToolId.make(tool))];\n\n/**\n * Factory for the blueprints.\n */\nexport type Definition = {\n key: string;\n make: () => Blueprint;\n};\n\n//\n// Registry\n//\n\n/**\n * Blueprint registry.\n */\nexport class Registry {\n private readonly _blueprints: Blueprint[] = [];\n\n constructor(blueprints: Blueprint[]) {\n const seen = new Set<string>();\n blueprints.forEach((blueprint) => {\n if (seen.has(blueprint.key)) {\n log.warn('duplicate blueprint', { key: blueprint.key });\n } else {\n seen.add(blueprint.key);\n this._blueprints.push(blueprint);\n }\n });\n\n this._blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));\n }\n\n get blueprints(): Blueprint[] {\n return this._blueprints;\n }\n\n getByKey(key: string): Blueprint | undefined {\n return this._blueprints.find((blueprint) => blueprint.key === key);\n }\n\n query(): Blueprint[] {\n return this._blueprints;\n }\n\n updateBlueprints(): Effect.Effect<void, never, Database.Service> {\n return Effect.gen(this, function* () {\n const blueprints = yield* Database.runQuery(Filter.type(Blueprint));\n for (const blueprint of blueprints) {\n const registryBlueprint = this.getByKey(blueprint.key);\n if (!registryBlueprint) {\n continue;\n }\n const source = Obj.clone(registryBlueprint, { deep: true });\n Obj.update(blueprint, (blueprint) => {\n void Obj.updateFrom(blueprint, source);\n });\n }\n }).pipe(Effect.orDie);\n }\n}\n\nexport class RegistryService extends Context.Tag('@dxos/blueprints/RegistryService')<RegistryService, Registry>() {}\n\n/**\n * Resolves a blueprint from the registry.\n * Does not check the local database for the blueprint.\n */\nexport const resolve = (key: string): Effect.Effect<Blueprint, NotFoundError, RegistryService> =>\n Effect.gen(function* () {\n const registry = yield* RegistryService;\n const blueprint = registry.getByKey(key);\n if (!blueprint) {\n return yield* Effect.fail(new NotFoundError({ context: { key } }));\n }\n return blueprint;\n });\n\n/**\n * Upserts a blueprint into the database.\n * If the blueprint already exists in the database, local blueprint is returned.\n * Otherwise, it will be added.\n */\nexport const upsert = (key: string): Effect.Effect<Blueprint, NotFoundError, RegistryService | Database.Service> =>\n Effect.gen(function* () {\n const local = yield* Database.runQuery(Filter.type(Blueprint, { key }));\n if (local.length > 0) {\n return local[0];\n }\n return yield* Database.add(Obj.clone(yield* resolve(key), { deep: true }));\n });\n\nexport class NotFoundError extends BaseError.extend('BlueprintNotFound', 'Blueprint not found') {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Record from 'effect/Record';\nimport * as Schema from 'effect/Schema';\nimport handlebars from 'handlebars';\n\nimport { Database, Ref } from '@dxos/echo';\nimport type { ObjectNotFoundError } from '@dxos/echo/Err';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { Text } from '@dxos/schema';\n\nimport { FunctionNotFoundError } from './errors';\nimport * as Operation from './Operation';\nimport * as OperationRegistry from './OperationRegistry';\n\n/**\n * Template input kind determines how template variables are resolved.\n */\nexport const InputKind = Schema.Literal(\n 'value', // Literal value.\n 'pass-through',\n 'retriever',\n 'function',\n 'query',\n 'resolver',\n 'context',\n 'schema',\n);\n\nexport type InputKind = Schema.Schema.Type<typeof InputKind>;\n\n/**\n * Template input variable.\n * E.g., {{foo}}\n */\nexport const Input = Schema.Struct({\n name: Schema.String,\n kind: Schema.optional(InputKind),\n default: Schema.optional(Schema.Any),\n\n /**\n * Function to call if the kind is 'function'.\n */\n function: Schema.optional(Schema.String),\n});\n\nexport type Input = Schema.Schema.Type<typeof Input>;\n\n/**\n * Template type.\n */\nexport const Template = Schema.Struct({\n source: Ref.Ref(Text.Text).annotations({ description: 'Handlebars template source' }),\n inputs: Schema.optional(Schema.Array(Input)),\n});\n\nexport interface Template extends Schema.Schema.Type<typeof Template> {}\n\nexport const make = ({\n id,\n source,\n inputs = [],\n}: { id?: string; source?: string; inputs?: Input[] } = {}): Template => ({\n source: Ref.make(Text.make({ id, content: source })),\n inputs,\n});\n\n/**\n * Process Handlebars template.\n */\nexport const process = <Options extends {}>(source: string, variables: Partial<Options> = {}): string => {\n invariant(typeof source === 'string');\n let section = 0;\n handlebars.registerHelper('section', () => String(++section));\n const template = handlebars.compile(source.trim());\n const output = template(variables);\n return output.trim().replace(/(\\n\\s*){3,}/g, '\\n\\n');\n};\n\nexport const processTemplate = (\n template: Template,\n): Effect.Effect<string, ObjectNotFoundError | FunctionNotFoundError, OperationRegistry.Service | Operation.Service> =>\n Effect.gen(function* () {\n const variables = yield* Effect.forEach(template.inputs ?? [], (input) =>\n Effect.gen(function* () {\n if (input.kind === 'function') {\n const fn = yield* OperationRegistry.resolve(input.function!).pipe(\n Effect.flatten,\n Effect.catchTag('NoSuchElementException', () => Effect.fail(new FunctionNotFoundError(input.function!))),\n );\n const result = yield* Operation.invoke(fn, {} as any).pipe(Effect.orDie);\n return [input.name, result] as const;\n } else {\n return yield* Effect.dieMessage(`Unsupported input kind: ${input.kind}`);\n }\n }),\n ).pipe(Effect.map(Record.fromEntries));\n\n log('processTemplate', { variables });\n return process((yield* Database.load(template.source)).content, variables);\n });\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\n\nimport { Database, Query } from '@dxos/echo';\n\nimport * as Operation from './Operation';\nimport * as OperationHandlerSet from './OperationHandlerSet';\n\nexport interface OperationRegistry {\n /**\n * Resolve an operation by key.\n */\n resolve(key: string): Effect.Effect<Option.Option<Operation.Definition.Any>>;\n}\n\nexport class Service extends Context.Tag('@dxos/operation/OperationRegistry')<Service, OperationRegistry>() {}\n\n/**\n * Resolve an operation by key.\n */\nexport const resolve: (key: string) => Effect.Effect<Option.Option<Operation.Definition.Any>, never, Service> =\n Effect.serviceFunctionEffect(Service, (service) => service.resolve);\n\nexport const layer: Layer.Layer<Service, never, Database.Service | OperationHandlerSet.OperationHandlerProvider> =\n Layer.effect(\n Service,\n Effect.gen(function* () {\n const database = yield* Database.Service;\n const handlerSet = yield* OperationHandlerSet.OperationHandlerProvider;\n return {\n resolve: (key: string) =>\n Database.runQueryFirst(Query.type(Operation.PersistentOperation, { key }))\n .pipe(\n Effect.flatten,\n Effect.map(Operation.deserialize),\n Effect.catchTag('NoSuchElementException', () => OperationHandlerSet.getHandlerByKey(handlerSet, key)),\n Effect.option,\n )\n .pipe(Effect.provideService(Database.Service, database)),\n };\n }),\n );\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Redacted from 'effect/Redacted';\n\nexport type CredentialQuery = {\n service?: string;\n};\n\n// TODO(dmaretskyi): Unify with other apis.\n// packages/sdk/schema/src/common/access-token.ts\nexport type ServiceCredential = {\n service: string;\n\n // TODO(dmaretskyi): Build out.\n apiKey?: string;\n};\n\nexport class CredentialsService extends Context.Tag('@dxos/functions/CredentialsService')<\n CredentialsService,\n {\n /**\n * Query all.\n */\n queryCredentials: (query: CredentialQuery) => Promise<ServiceCredential[]>;\n\n /**\n * Get a single credential.\n * @throws {Error} If no credential is found.\n */\n getCredential: (query: CredentialQuery) => Promise<ServiceCredential>;\n }\n>() {\n static getCredential = (query: CredentialQuery): Effect.Effect<ServiceCredential, never, CredentialsService> =>\n Effect.gen(function* () {\n const credentials = yield* CredentialsService;\n return yield* Effect.promise(() => credentials.getCredential(query));\n });\n\n static getApiKey = (query: CredentialQuery): Effect.Effect<Redacted.Redacted<string>, never, CredentialsService> =>\n Effect.gen(function* () {\n const credential = yield* CredentialsService.getCredential(query);\n if (!credential.apiKey) {\n throw new Error(`API key not found for service: ${query.service}`);\n }\n return Redacted.make(credential.apiKey);\n });\n}\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport type { Atom } from '@effect-atom/atom';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport type * as Exit from 'effect/Exit';\nimport * as Option from 'effect/Option';\nimport * as Schema from 'effect/Schema';\nimport * as Scope from 'effect/Scope';\nimport type * as Types from 'effect/Types';\n\nimport { assertArgument } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport type { ObjectId } from '@dxos/protocols';\n\nimport * as Operation from './Operation';\nimport * as OperationHandlerSet from './OperationHandlerSet';\nimport * as Trace from './Trace';\n\n//\n// Process.\n//\n\n/** Opaque process id (arbitrary string). */\nexport const ID = Schema.String.pipe(Schema.brand('ProcessId'));\nexport type ID = Schema.Schema.Type<typeof ID>;\n\n/**\n * A running process callbacks.\n *\n * Process lifecycle: Initial -> Running <-> Suspended -> Terminated.\n *\n * - onSpawn -> called once when the process is spawned.\n * - onInput -> called for every input submitted to the process.\n * - onAlarm -> called for processes scheduling alarms.\n * - onChildEvent -> called when child process produces output or exits.\n */\nexport interface Callbacks<I, O, R> {\n /**\n * Called when the process is spawned.\n * Not called for processes that are resumed from a previously suspended state.\n *\n * @returns A signal indicating to the runtime whether the process is finished, or should be resumed later.\n * @throws Throwing in the handler will terminate the process with an error.\n *\n * Note: This function should aim to complete in under 5 seconds to avoid exceeding limits in serverless environments.\n */\n onSpawn(): Effect.Effect<void, never, R | BaseServices>;\n\n /**\n * Called when there's input available to process.\n *\n * The function can be called in parallel.\n *\n * @returns A signal indicating to the runtime whether the process is finished, or should be resumed later.\n * @throws Throwing in the handler will terminate the process with an error.\n *\n * Note: This function should aim to complete in under 5 seconds to avoid exceeding limits in serverless environments.\n */\n onInput(input: I): Effect.Effect<void, never, R | BaseServices>;\n\n /**\n * Called when the process's alarm is triggered.\n *\n * @throws Throwing in the handler will terminate the process with an error.\n */\n onAlarm(): Effect.Effect<void, never, R | BaseServices>;\n\n /**\n * Called when the process's child process produces output or exits.\n *\n * This allows the parent process to hibernate while a long-running child process is running.\n */\n onChildEvent(event: ChildEvent<unknown>): Effect.Effect<void, never, R | BaseServices>;\n}\n\n/**\n * Services that are always available to all processes.\n */\nexport type BaseServices = Trace.TraceService;\n\nexport type ChildEvent<T> =\n | {\n readonly _tag: 'output';\n readonly pid: ID;\n readonly data: T;\n }\n | {\n readonly _tag: 'exited';\n readonly pid: ID;\n readonly result: Exit.Exit<void>;\n };\n\nexport interface ProcessContext<I, O> {\n readonly id: ID;\n\n /**\n * Parameters assigned during process creation.\n */\n readonly params: Params;\n\n /**\n * Complete this process with sucessful result.\n * No additional events will be pushed to the process.\n */\n succeed(): void;\n\n /**\n * Complete this process with an error.\n * No additional events will be pushed to the process.\n */\n fail(error: Error): void;\n\n /**\n * Submit output of the process.\n */\n submitOutput(output: O): void;\n\n /**\n * Set an alarm for the process to be woken up later.\n *\n * @param timeout - Optional timeout in milliseconds. If not provided, the process is woken up as soon as possible.\n */\n setAlarm(timeout?: number): void;\n}\n\n/**\n * Generic parameters for a all processes.\n */\nexport interface Params {\n /**\n * Process name for debugging purposes.\n */\n readonly name: string | null;\n\n /**\n * Target object that this process is assigned to.\n */\n readonly target: ObjectId | null;\n}\n\n//\n// Executable.\n//\n\nexport const ProcessTypeId = '~@dxos/functions/Process' as const;\nexport type ProcessTypeId = typeof ProcessTypeId;\n\n/**\n * A process (factory).\n * Can be instantiated mutlitple times to produce new runtime instance with separate state and callbacks.\n * `create` is used to instantiate a new process.\n * Can store runtime state in scope of `create` function.\n */\nexport interface Process<I, O, R> extends Process.Variance<I, O, R> {\n /**\n * Unique identifier for the executable in the reverse DNS format.\n */\n readonly key: string;\n\n /**\n * Human-readable label from {@link MakeExecutableOpts.name} when provided.\n */\n readonly name?: string;\n\n readonly services: readonly Context.Tag<any, any>[];\n\n /**\n * Create a new instance of the process.\n */\n create(ctx: ProcessContext<I, O>): Effect.Effect<Callbacks<I, O, R>, never, R | BaseServices | Scope.Scope>;\n}\n\nexport const isProcess = (executable: unknown): executable is Process.Any =>\n typeof executable === 'object' && executable !== null && ProcessTypeId in executable;\n\nexport namespace Process {\n export interface Variance<I, O, R> {\n readonly [ProcessTypeId]: {\n readonly _Input: Types.Contravariant<I>;\n readonly _Output: Types.Covariant<O>;\n readonly _Requirements: Types.Covariant<R>;\n };\n }\n\n export type Any = Process<any, any, never>;\n}\n\nexport interface MakeProcessOpts {\n /**\n * Unique identifier for the process in the reverse DNS format.\n */\n readonly key: string;\n\n readonly input: Schema.Schema.AnyNoContext;\n readonly output: Schema.Schema.AnyNoContext;\n readonly services: readonly Context.Tag<any, any>[];\n}\n\nexport const make = <const Opts extends Types.NoExcessProperties<MakeProcessOpts, Opts>>(\n opts: Opts,\n create: (\n ctx: ProcessContext<Schema.Schema.Type<Opts['input']>, Schema.Schema.Type<Opts['output']>>,\n ) => Effect.Effect<\n Partial<\n Callbacks<\n Schema.Schema.Type<Opts['input']>,\n Schema.Schema.Type<Opts['output']>,\n Context.Tag.Identifier<NonNullable<Opts['services']>[number]>\n >\n >,\n never,\n Context.Tag.Identifier<NonNullable<Opts['services']>[number]> | BaseServices | Scope.Scope\n >,\n): Process<\n Schema.Schema.Type<Opts['input']>,\n Schema.Schema.Type<Opts['output']>,\n Context.Tag.Identifier<NonNullable<Opts['services']>[number]>\n> => {\n assertArgument(/^[a-z0-9]([a-z0-9.\\-/]*[a-z0-9])?$/i.test(opts.key), 'key', 'Invalid key');\n return {\n [ProcessTypeId]: {} as any,\n ...opts,\n create: (ctx) =>\n create(ctx).pipe(\n Effect.map((partial) => ({\n onSpawn: () => Effect.void,\n onInput: () => Effect.void,\n onAlarm: () => Effect.void,\n onChildEvent: () => Effect.void,\n ...partial,\n })),\n ),\n };\n};\n\nexport const fromOperation = <const Op extends Operation.Definition.Any>(\n op: Op,\n handler: OperationHandlerSet.OperationHandlerSet,\n): Process<Operation.Definition.Input<Op>, Operation.Definition.Output<Op>, Operation.Definition.Services<Op>> =>\n make(\n {\n key: op.meta.key,\n input: op.input,\n output: op.output,\n services: op.services,\n },\n (ctx) =>\n Effect.gen(function* () {\n const semaphore = yield* Effect.makeSemaphore(1);\n\n return {\n onInput: (input: Operation.Definition.Input<Op>) =>\n Effect.gen(function* () {\n // Emit operation start event.\n log('operation process invoking', { key: op.meta.key, name: op.meta.name });\n yield* Trace.write(Trace.OperationStart, {\n key: op.meta.key,\n name: op.meta.name,\n });\n\n const opHandler = yield* OperationHandlerSet.getHandler(handler, op).pipe(Effect.orDie);\n const output = yield* opHandler\n .handler(input)\n .pipe(Effect.orDie, Effect.withSpan(op.meta.key)) as Effect.Effect<\n Operation.Definition.Output<Op>,\n never,\n never\n >;\n\n ctx.submitOutput(output);\n ctx.succeed();\n\n // Emit operation end event with success after side-effects complete.\n yield* Trace.write(Trace.OperationEnd, {\n key: op.meta.key,\n name: op.meta.name,\n outcome: 'success',\n });\n }).pipe(\n Effect.catchAllDefect((defect) =>\n Effect.gen(function* () {\n // Emit operation end event with failure.\n const errorMessage = defect instanceof Error ? defect.message : String(defect);\n yield* Trace.write(Trace.OperationEnd, {\n key: op.meta.key,\n name: op.meta.name,\n outcome: 'failure',\n error: errorMessage,\n });\n return yield* Effect.die(defect);\n }),\n ),\n semaphore.withPermits(1),\n ),\n };\n }),\n );\n\n/**\n * Runtime state of a process.\n */\nexport enum State {\n // Process is actively running.\n RUNNING = 'RUNNING',\n\n // Process is waiting for a child process to complete or an alarm to trigger.\n HYBERNATING = 'HYBERNATING',\n\n // Process is waiting for input. It will only resume when input is submitted.\n IDLE = 'IDLE',\n\n // Process is terminating and will transition to TERMINATED state.\n // TODO(dmaretskyi): Consider removing.\n TERMINATING = 'TERMINATING',\n\n // Process has been externally terminated.\n TERMINATED = 'TERMINATED',\n\n // Process has completed successfully.\n SUCCEEDED = 'SUCCEEDED',\n\n // Process has failed.\n FAILED = 'FAILED',\n}\n\n/**\n * Read-only view of a process tree\n */\nexport interface Monitor {\n /**\n * Get the current state of the process tree.\n */\n processTree: Effect.Effect<readonly Info[]>;\n\n /**\n * Atom for the process tree.\n */\n processTreeAtom: Atom.Atom<readonly Info[]>;\n}\n\nexport class ProcessMonitorService extends Context.Tag('@dxos/functions/ProcessMonitorService')<\n ProcessMonitorService,\n Monitor\n>() {}\n\nexport interface Info {\n readonly pid: ID;\n readonly parentPid: ID | null;\n\n /**\n * Key of the process.\n *\n * NOTE: There might be multiple running processes with the same key.\n */\n readonly key: string;\n\n /**\n * Parameters of the process.\n */\n readonly params: Params;\n\n /**\n * State of the process.\n */\n readonly state: State;\n\n /**\n * Error of the process.\n * Only for process in FAILED state.\n */\n readonly error: string | null;\n\n /**\n * UNIX timestamp in milliseconds.\n */\n readonly startedAt: number;\n\n /**\n * UNIX timestamp in milliseconds.\n */\n readonly completedAt: Option.Option<number>;\n\n readonly metrics: {\n /**\n * Total wall time of all handler invocations of the process in milliseconds.\n */\n readonly wallTime: number;\n\n /**\n * Total number of inputs submitted to the process.\n */\n readonly inputCount: number;\n\n /**\n * Total number of outputs submitted to the process.\n */\n readonly outputCount: number;\n };\n}\n\n/**\n * New process is spawned.\n */\nexport const SpawnedEvent = Trace.EventType('process.spawned', {\n schema: Schema.Void,\n isEphemeral: false,\n});\n\n/**\n * Process has reached a terminal state.\n */\nexport const ExitedEvent = Trace.EventType('process.exited', {\n schema: Schema.Struct({\n outcome: Schema.Literal('succeeded', 'failed', 'terminated'),\n }),\n isEphemeral: false,\n});\n\n/**\n * Renders spawned processes as a forest: top-level rows use \"- \", nested rows use ├── / └── / │.\n */\nexport const prettyProcessTree = (tree: readonly Info[]): string => {\n if (tree.length === 0) {\n return '';\n }\n\n const pidSet = new Set(tree.map((node) => node.pid));\n const childrenByParent = new Map<string, Info[]>();\n const roots: Info[] = [];\n\n for (const node of tree) {\n const parent = node.parentPid;\n if (parent === null || !pidSet.has(parent)) {\n roots.push(node);\n continue;\n }\n const key = String(parent);\n const siblings = childrenByParent.get(key) ?? [];\n siblings.push(node);\n childrenByParent.set(key, siblings);\n }\n\n const byPid = (a: Info, b: Info) => String(a.pid).localeCompare(String(b.pid));\n roots.sort(byPid);\n for (const siblings of childrenByParent.values()) {\n siblings.sort(byPid);\n }\n\n const formatLabel = (node: Info): string => {\n const idShort = String(node.pid).slice(0, 6);\n const parts = [idShort, node.state];\n if (node.params.name != null && node.params.name !== '') {\n parts.push(node.params.name);\n }\n if (node.error != null) {\n parts.push(`(${node.error})`);\n }\n const { inputCount, outputCount, wallTime } = node.metrics;\n parts.push(`[in:${inputCount} out:${outputCount} wall:${Math.round(wallTime)}ms]`);\n return parts.join(' ');\n };\n\n const lines: string[] = [];\n\n const walk = (node: Info, prefix: string, isLast: boolean, isRoot: boolean): void => {\n if (isRoot) {\n lines.push(`- ${formatLabel(node)}`);\n } else {\n const branch = isLast ? '└── ' : '├── ';\n lines.push(`${prefix}${branch}${formatLabel(node)}`);\n }\n\n const children = childrenByParent.get(String(node.pid)) ?? [];\n const nextPrefix = isRoot ? ' ' : `${prefix}${isLast ? ' ' : '│ '}`;\n children.forEach((child, index) => {\n walk(child, nextPrefix, index === children.length - 1, false);\n });\n };\n\n for (const root of roots) {\n walk(root, '', true, true);\n }\n\n return lines.join('\\n');\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { log } from '@dxos/log';\n\n/**\n * Writes ephemeral or persistent events to the trace.\n * Exposed to processes and operations to record events to the trace.\n */\nexport interface TraceWriter {\n write<T>(eventType: EventType<T>, payload: NoInfer<T>): void;\n}\n\n/**\n * Service that writes events to the trace.\n * Exposed to processes and operations to record events to the trace.\n */\nexport class TraceService extends Context.Tag('@dxos/functions/TraceService')<TraceService, TraceWriter>() {}\n\n/**\n * Writes an event to the trace.\n */\nexport function write<T>(eventType: EventType<T>, payload: NoInfer<T>): Effect.Effect<void, never, TraceService> {\n return Effect.gen(function* () {\n log('trace write', { key: eventType.key, isEphemeral: eventType.isEphemeral });\n const writer = yield* TraceService;\n writer.write(eventType, payload);\n });\n}\n\n/**\n * Defines an event type for the trace.\n */\nexport interface EventType<T> {\n readonly key: string;\n readonly schema: Schema.Schema<T, any>;\n readonly isEphemeral: boolean;\n}\n\nexport const EventType = <T>(\n key: string,\n opts: { schema: Schema.Schema<T, any>; isEphemeral: boolean },\n): EventType<T> => {\n return {\n key,\n schema: opts.schema,\n isEphemeral: opts.isEphemeral,\n };\n};\n\n/**\n * Extracts the payload type from an event type.\n */\nexport type PayloadType<E extends EventType<any>> = E extends EventType<infer T> ? T : never;\n\nexport const Event = Schema.Struct({\n timestamp: Schema.Number,\n type: Schema.String,\n data: Schema.Unknown, // Type-specific payload;\n});\nexport interface Event extends Schema.Schema.Type<typeof Event> {}\n\n/**\n * Checks if an event is of a given type.\n */\nexport const isOfType = <T, E extends Event>(eventType: EventType<T>, event: E): event is E & { data: T } => {\n return event.type === eventType.key;\n};\n\n/**\n * Metadata on the context of a trace message.\n */\n// TODO(dmaretskyi): Expand on this: conversation id, tool call id, etc.\nexport const Meta = Schema.Struct({\n pid: Schema.optional(Schema.String), // NOTE: Not Process.ID to avoid circular dependency.\n parentPid: Schema.optional(Schema.String),\n processName: Schema.optional(Schema.String),\n\n /**\n * ID of the conversation feed object if present.\n */\n conversationId: Schema.optional(Obj.ID),\n\n /**\n * ID of the trigger object if invocation resulted from a trigger.\n */\n triggerId: Schema.optional(Obj.ID),\n\n /**\n * ID of the tool call that created the current process.\n */\n toolCallId: Schema.optional(Schema.String),\n});\nexport interface Meta extends Schema.Schema.Type<typeof Meta> {}\n\n/**\n * Envelope for a set of events.\n */\nexport const MessageData = Schema.Struct({\n meta: Meta,\n\n isEphemeral: Schema.Boolean,\n events: Schema.Array(Event),\n});\nexport interface MessageData extends Schema.Schema.Type<typeof MessageData> {}\n\nexport const Message = MessageData.pipe(\n Type.object({\n typename: 'org.dxos.type.traceMessage',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--note--regular',\n hue: 'rose',\n }),\n);\nexport interface Message extends Schema.Schema.Type<typeof Message> {}\n\n/**\n * Sink for complete trace messages.\n */\nexport interface Sink {\n write(message: Message): void;\n}\n\n/**\n * Sink for complete trace messages.\n * The Process Manager forwards trace messages to it.\n */\n// TODO(dmaretskyi): Consider moving sink to the Process Manager.\nexport class TraceSink extends Context.Tag('@dxos/functions/TraceSink')<TraceSink, Sink>() {}\n\nexport const noopWriter: TraceWriter = {\n write: () => {},\n};\n\nexport const writerLayerNoop: Layer.Layer<TraceService> = Layer.succeed(TraceService, noopWriter);\n\nexport const layerNoop: Layer.Layer<TraceSink> = Layer.succeed(TraceSink, {\n write: () => {},\n});\n\nexport const layerConsole: Layer.Layer<TraceSink> = Layer.succeed(TraceSink, {\n write: (message) => {\n console.log(message);\n },\n});\n\nexport const testTraceService = (opts: { meta?: Meta } = {}): Layer.Layer<TraceService, never, TraceSink> =>\n Layer.effect(\n TraceService,\n Effect.gen(function* () {\n const sink = yield* TraceSink;\n return {\n write: (event, data) => {\n sink.write(\n Obj.make(Message, {\n meta: opts.meta ?? {},\n isEphemeral: event.isEphemeral,\n events: [{ type: event.key, timestamp: Date.now(), data }],\n }),\n );\n },\n };\n }),\n );\n\n//\n// Operation Trace Events\n//\n\n/**\n * Outcome of an operation invocation.\n */\nexport type OperationOutcome = 'success' | 'failure';\n\n/**\n * Operation invocation started.\n */\nexport const OperationStart = EventType('operation.start', {\n schema: Schema.Struct({\n /** Operation key. */\n key: Schema.String,\n /** Human-readable operation name. */\n name: Schema.optional(Schema.String),\n }),\n isEphemeral: false,\n});\n\n/**\n * Operation invocation ended.\n */\nexport const OperationEnd = EventType('operation.end', {\n schema: Schema.Struct({\n /** Operation key. */\n key: Schema.String,\n /** Human-readable operation name. */\n name: Schema.optional(Schema.String),\n /** Outcome of the operation. */\n outcome: Schema.Literal('success', 'failure'),\n /** Error message if the operation failed. */\n error: Schema.optional(Schema.String),\n }),\n isEphemeral: false,\n});\n\n/**\n * Human-readable status update emitted by an agent or operation.\n */\nexport const StatusUpdate = EventType('status.update', {\n schema: Schema.Struct({\n /** Human-readable status message. */\n message: Schema.String,\n }),\n isEphemeral: true,\n});\n\n/**\n * Emit the current human-readable execution status to the trace.\n */\nexport const emitStatus: (message: string) => Effect.Effect<void, never, TraceService> = (message) =>\n write(StatusUpdate, { message });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, JsonSchema, Obj, Ref, Type } from '@dxos/echo';\n\nimport * as Blueprint from './Blueprint';\nimport * as Template from './Template';\n\n/**\n * Executable instructions, which may use Blueprints.\n * May reference additional context.\n */\nexport const Routine = Schema.Struct({\n /**\n * Name of the routine.\n */\n name: Schema.optional(Schema.String),\n\n /**\n * Description of the routine's purpose and functionality.\n * Allows AI agents to execute routines automatically as tools.\n */\n description: Schema.optional(Schema.String),\n\n /**\n * Input schema of the routine.\n */\n input: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)),\n\n /**\n * Output schema of the routine.\n */\n output: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)),\n\n /**\n * Natural language instructions for the routine.\n * These should provide concrete course of action for the AI to follow.\n */\n instructions: Template.Template.pipe(Annotation.FormInputAnnotation.set(false)),\n\n /**\n * Blueprints that the routine may utilize.\n */\n blueprints: Schema.Array(Ref.Ref(Blueprint.Blueprint)),\n\n /**\n * Additional context that the routine may utilize.\n */\n context: Schema.Array(Schema.Any).pipe(Annotation.FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.routine',\n version: '0.1.0',\n }),\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--scroll--regular',\n hue: 'sky',\n }),\n);\n\nexport interface Routine extends Schema.Schema.Type<typeof Routine> {}\n\nexport const make = (params: {\n name?: string;\n description?: string;\n input?: Schema.Schema.AnyNoContext;\n output?: Schema.Schema.AnyNoContext;\n instructions?: string;\n blueprints?: Ref.Ref<Blueprint.Blueprint>[];\n context?: any[];\n}): Routine =>\n Obj.make(Routine, {\n name: params.name,\n description: params.description,\n input: JsonSchema.toJsonSchema(params.input ?? Schema.Void),\n output: JsonSchema.toJsonSchema(params.output ?? Schema.Void),\n instructions: Template.make({ source: params.instructions }),\n blueprints: params.blueprints ?? [],\n context: params.context ?? [],\n });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\nimport { Text } from '@dxos/schema';\n\n/**\n * Source script.\n */\nexport const Script = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n description: Schema.String.pipe(Schema.optional),\n // TODO(burdon): Change to hash of deployed content.\n // Whether source has changed since last deploy.\n changed: Schema.Boolean.pipe(FormInputAnnotation.set(false), Schema.optional),\n source: Ref.Ref(Text.Text).pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.script',\n version: '0.1.0',\n }),\n Annotation.LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--code--regular',\n hue: 'sky',\n }),\n);\n\nexport interface Script extends Schema.Schema.Type<typeof Script> {}\n\ntype Props = Omit<Obj.MakeProps<typeof Script>, 'source'> & { source?: string };\n\nexport const make = ({ source = '', ...props }: Props = {}): Script =>\n Obj.make(Script, { ...props, source: Ref.make(Text.make({ content: source })) });\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Either from 'effect/Either';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Scope from 'effect/Scope';\n\nimport type { DXN, SpaceId } from '@dxos/keys';\n\nimport { ServiceNotAvailableError } from './errors';\nimport * as Process from './Process';\n\nconst ServiceResolverTypeId = '~@dxos/functions/ServiceResolver' as const;\ntype ServiceResolverTypeId = typeof ServiceResolverTypeId;\n\nexport interface ServiceResolver {\n readonly [ServiceResolverTypeId]: ServiceResolverTypeId;\n\n /**\n * Resolve a set of services identified by their tags.\n * Returns a Context containing all requested services, or fails with ServiceNotAvailableError.\n */\n resolve<Tag extends Context.Tag<any, any>>(\n tag: Tag,\n context: ResolutionContext,\n ): Effect.Effect<Context.Tag.Service<Tag>, ServiceNotAvailableError, Scope.Scope>;\n}\n\n/**\n * Tag for the ServiceResolver service.\n */\nexport const ServiceResolver = Context.GenericTag<ServiceResolver>('@dxos/functions/ServiceResolver');\n\nexport const resolve = Effect.serviceFunctionEffect(ServiceResolver, (_) => _.resolve);\n\nexport const resolveAll = <const Tags extends readonly Context.Tag<any, any>[]>(\n tags: Tags,\n context: ResolutionContext,\n): Effect.Effect<Context.Context<Tags[number]>, ServiceNotAvailableError, Scope.Scope | ServiceResolver> =>\n Effect.gen(function* () {\n const services = yield* Effect.forEach(tags, (tag) =>\n resolve(tag, context).pipe(Effect.map((service) => Context.make(tag, service))),\n );\n return Context.mergeAll(...services);\n });\n\n/**\n * Provides context for service resolution.\n */\nexport interface ResolutionContext {\n /**\n * Under which identity the process is running.\n */\n readonly identity?: string;\n\n /**\n * Under which space the process is running.\n */\n readonly space?: SpaceId;\n\n /**\n * DXN of the conversation feed the process is running in.\n */\n readonly conversation?: DXN.String;\n\n /**\n * Under which process the process is running.\n */\n readonly process?: Process.ID;\n}\n\nexport const succeed = <I, S>(\n tag: Context.Tag<I, S>,\n getService: (context: ResolutionContext) => Effect.Effect<S, ServiceNotAvailableError, Scope.Scope>,\n): ServiceResolver => {\n return make((tag1, context) => {\n if (tag1.key !== tag.key) {\n return Effect.fail(new ServiceNotAvailableError(`Service not available: ${String(tag.key ?? tag)}`));\n }\n const service = getService(context);\n return service as any;\n });\n};\n\n/**\n * Create a ServiceResolver from a custom resolution function.\n */\nexport const make = (\n resolveFn: <I, S>(\n tag: Context.Tag<I, S>,\n context: ResolutionContext,\n ) => Effect.Effect<S, ServiceNotAvailableError, Scope.Scope>,\n): ServiceResolver => ({\n [ServiceResolverTypeId]: ServiceResolverTypeId,\n resolve: resolveFn,\n});\n\n/**\n * Create a ServiceResolver backed by a static Context.\n * Tags present in the context are resolved; missing tags fail with ServiceNotAvailableError.\n */\nexport const fromContext = (ctx: Context.Context<any>): ServiceResolver =>\n make((tag, context) =>\n Effect.gen(function* () {\n const service = Context.getOption(ctx, tag);\n if (Option.isNone(service)) {\n return yield* Effect.fail(new ServiceNotAvailableError(String(tag.key ?? tag)));\n }\n return service.value;\n }),\n );\n\n/**\n * Create a ServiceResolver that resolves tags from the current Effect context.\n * Only the specified tags are available; requests for other tags fail.\n */\nexport const fromRequirements = <const Tags extends readonly Context.Tag<any, any>[]>(\n ...tags: Tags\n): Effect.Effect<ServiceResolver, never, Context.Tag.Identifier<Tags[number]>> =>\n Effect.contextWith((parentCtx: Context.Context<any>) => {\n const available = new Set(tags.map((tag) => tag.key));\n return make((tag, context) =>\n Effect.gen(function* () {\n let result: Context.Context<never> = Context.empty() as Context.Context<never>;\n if (!available.has(tag.key)) {\n return yield* Effect.fail(new ServiceNotAvailableError(String(tag.key ?? tag)));\n }\n const service = Context.getOption(parentCtx, tag);\n if (Option.isNone(service)) {\n return yield* Effect.fail(new ServiceNotAvailableError(String(tag.key ?? tag)));\n }\n return service.value;\n }),\n );\n });\n\n/**\n * Like {@link fromRequirements} but returns a Layer that provides ServiceResolver.\n */\nexport const layerRequirements = <const Tags extends readonly Context.Tag<any, any>[]>(\n ...tags: Tags\n): Layer.Layer<ServiceResolver, never, Context.Tag.Identifier<Tags[number]>> =>\n Layer.effect(ServiceResolver, fromRequirements(...tags));\n\n/**\n * Compose multiple resolvers left to right. Earlier resolvers take precedence:\n * the first resolver that can satisfy a tag wins.\n */\nexport const compose = (...resolvers: readonly ServiceResolver[]): ServiceResolver =>\n make((tag, context) =>\n Effect.gen(function* () {\n for (const resolver of resolvers) {\n const single = yield* resolver.resolve(tag, context).pipe(Effect.either);\n if (Either.isRight(single)) {\n return single.right;\n }\n }\n\n return yield* Effect.fail(new ServiceNotAvailableError(String(tag.key ?? tag)));\n }),\n );\n\n/**\n * An empty resolver that fails for any requested service.\n */\nexport const empty: ServiceResolver = make((tag, context) => {\n return Effect.fail(new ServiceNotAvailableError(String(tag.key ?? tag)));\n});\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as SchemaAST from 'effect/SchemaAST';\n\nimport { Annotation, Feed, Obj, QueryAST, Ref, Type, type Query } from '@dxos/echo';\nimport { OptionsAnnotationId, SystemTypeAnnotation } from '@dxos/echo/internal';\nimport { failedInvariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport const Kinds = ['email', 'queue', 'subscription', 'timer', 'webhook'] as const;\nexport type Kind = (typeof Kinds)[number];\n\nconst kindLiteralAnnotations = { title: 'Kind' };\n\nexport const EmailSpec = Schema.Struct({\n kind: Schema.Literal('email').annotations(kindLiteralAnnotations),\n});\nexport type EmailSpec = Schema.Schema.Type<typeof EmailSpec>;\n\n/**\n * Construct an Email trigger spec.\n */\nexport const specEmail = (): EmailSpec => ({ kind: 'email' });\n\n// TODO(burdon): Change to Feed.\n// TODO(wittjosiah): Remove. Migrate to Subscription triggers once EDGE supports them for feed queries.\nexport const QueueSpec = Schema.Struct({\n kind: Schema.Literal('queue').annotations(kindLiteralAnnotations),\n\n // TODO(dmaretskyi): Rename to `feed` and change to a reference.\n queue: DXN.Schema,\n});\nexport type QueueSpec = Schema.Schema.Type<typeof QueueSpec>;\n\n/**\n * Construct a Queue trigger spec from a queue DXN string.\n */\nexport const specQueue = (queueDxn: string): QueueSpec => ({\n kind: 'queue',\n queue: queueDxn,\n});\n\n/**\n * Construct a Queue trigger spec from a Feed object.\n */\nexport const specFeed = (feed: Feed.Feed): QueueSpec =>\n specQueue(Feed.getQueueDxn(feed)?.toString() ?? failedInvariant(new Error('Could not extract DXN from feed')));\n\n/**\n * Subscription.\n */\nexport const SubscriptionSpec = Schema.Struct({\n kind: Schema.Literal('subscription').annotations(kindLiteralAnnotations),\n query: Schema.Struct({\n raw: Schema.optional(Schema.String.annotations({ title: 'Query' })),\n ast: QueryAST.Query,\n }),\n options: Schema.optional(\n Schema.Struct({\n // Watch changes to object (not just creation).\n deep: Schema.optional(Schema.Boolean.annotations({ title: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: Schema.optional(Schema.Number.annotations({ title: 'Delay' })),\n }).annotations({ title: 'Options' }),\n ),\n});\nexport type SubscriptionSpec = Schema.Schema.Type<typeof SubscriptionSpec>;\n\n/**\n * Construct a Subscription trigger spec from a Query object.\n */\nexport const specSubscription = (\n query: Query.Query<any>,\n options?: { deep?: boolean; delay?: number },\n): SubscriptionSpec => ({\n kind: 'subscription',\n query: {\n ast: query.ast,\n },\n options: options\n ? {\n deep: options.deep,\n delay: options.delay,\n }\n : undefined,\n});\n\n/**\n * Cron timer.\n */\nexport const TimerSpec = Schema.Struct({\n kind: Schema.Literal('timer').annotations(kindLiteralAnnotations),\n cron: Schema.String.annotations({\n title: 'Cron',\n [SchemaAST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n});\nexport type TimerSpec = Schema.Schema.Type<typeof TimerSpec>;\n\n/**\n * Construct a Timer trigger spec from a cron string.\n */\nexport const specTimer = (cron: string): TimerSpec => ({ kind: 'timer', cron });\n\n/**\n * Webhook.\n */\nexport const WebhookSpec = Schema.Struct({\n kind: Schema.Literal('webhook').annotations(kindLiteralAnnotations),\n method: Schema.optional(\n Schema.String.annotations({\n title: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: Schema.optional(\n Schema.Number.annotations({\n title: 'Port',\n }),\n ),\n});\nexport type WebhookSpec = Schema.Schema.Type<typeof WebhookSpec>;\n\n/**\n * Construct a Webhook trigger spec from a method and port.\n */\nexport const specWebhook = (opts?: { method?: string; port?: number }): WebhookSpec => ({\n kind: 'webhook',\n method: opts?.method,\n port: opts?.port,\n});\n\n/**\n * Trigger schema.\n */\nexport const Spec = Schema.Union(EmailSpec, QueueSpec, SubscriptionSpec, TimerSpec, WebhookSpec).annotations({\n title: 'Trigger',\n});\nexport type Spec = Schema.Schema.Type<typeof Spec>;\n\n/**\n * Function trigger.\n * Function is invoked with the `payload` passed as input data.\n * The event that triggers the function is available in the function context.\n */\nconst TriggerSchema = Schema.Struct({\n /**\n * Function or workflow to invoke.\n */\n // TODO(dmaretskyi): Can be a Ref(FunctionType) or Ref(ComputeGraphType).\n function: Schema.optional(Ref.Ref(Obj.Unknown).annotations({ title: 'Function' })),\n\n /**\n * Only used for workflowSchema.\n * Specifies the input node in the circuit.\n * @deprecated Remove and enforce a single input node in all compute graphSchema.\n */\n inputNodeId: Schema.optional(Schema.String.annotations({ title: 'Input Node ID' })),\n\n // TODO(burdon): NO BOOLEAN PROPERTIES (enabld/disabled/paused, etc.)\n // Need lint rule; or agent rule to require PR review for \"boolean\" key word.\n enabled: Schema.optional(Schema.Boolean.annotations({ title: 'Enabled' })),\n\n spec: Schema.optional(Spec),\n\n concurrency: Schema.optional(\n Schema.Number.annotations({\n title: 'Concurrency',\n default: 1,\n description:\n 'Maximum number of concurrent invocations of the trigger. For Feed triggers, this will process Feed items in parallel.',\n }),\n ),\n\n /**\n * Passed as the input data to the function.\n * Must match the function's input schema.\n *\n * @example\n * {\n * item: '{{event.item}}',\n * instructions: 'Summarize and perform entity-extraction'\n * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }\n * }\n */\n input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.trigger',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({ icon: 'ph--lightning--regular', hue: 'yellow' }),\n SystemTypeAnnotation.set(true),\n);\n\nexport interface Trigger extends Schema.Schema.Type<typeof TriggerSchema> {}\nexport const Trigger: Type.Obj<Trigger> = TriggerSchema as any;\n\nexport const make = (props: Obj.MakeProps<typeof Trigger>) => Obj.make(Trigger, props);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Obj, Ref } from '@dxos/echo';\n\n// TODO(wittjosiah): Review this type.\n// - Should be discriminated union.\n// - Should be more consistent (e.g. subject vs item).\n// - Should re-use schemas if possible.\n\n// TODO(burdon): Reuse trigger schema from @dxos/functions (TriggerType).\nexport const EmailEvent = Schema.Struct({\n from: Schema.String,\n to: Schema.String,\n subject: Schema.String,\n created: Schema.String,\n body: Schema.String,\n});\nexport type EmailEvent = Schema.Schema.Type<typeof EmailEvent>;\n\nexport const QueueEvent = Schema.Struct({\n queue: DXN.Schema,\n item: Schema.Any,\n cursor: Schema.String,\n});\nexport type QueueEvent = Schema.Schema.Type<typeof QueueEvent>;\n\nexport const SubscriptionEvent = Schema.Struct({\n /**\n * Type of the mutation.\n */\n // TODO(dmaretskyi): Specify enum.\n type: Schema.String,\n\n /**\n * Reference to the object that was changed or created.\n */\n subject: Ref.Ref(Obj.Unknown),\n\n /**\n * @deprecated\n */\n changedObjectId: Schema.optional(Schema.String),\n});\nexport type SubscriptionEvent = Schema.Schema.Type<typeof SubscriptionEvent>;\n\nexport const TimerEvent = Schema.Struct({ tick: Schema.Number });\nexport type TimerEvent = Schema.Schema.Type<typeof TimerEvent>;\n\nexport const WebhookEvent = Schema.Struct({\n url: Schema.String,\n method: Schema.Literal('GET', 'POST'),\n headers: Schema.Record({ key: Schema.String, value: Schema.String }),\n bodyText: Schema.String,\n});\nexport type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;\n\nexport const TriggerEvent = Schema.Union(EmailEvent, QueueEvent, SubscriptionEvent, TimerEvent, WebhookEvent);\nexport type TriggerEvent = Schema.Schema.Type<type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IAAA,CAAA;AAIpB,IAAMG,UAA6BtB;AAEnC,IAAMxD,QAAO,CAAC+E,UAAyC1E,KAAIL,KAAK8E,SAASC,KAAAA;;;AC9MhF;;;;;;;;;AAIA,YAAYC,aAAY;AAExB,SAASC,OAAAA,MAAKC,OAAAA,MAAKC,OAAAA,YAAW;AAQvB,IAAMC,aAAoBC,eAAO;EACtCC,MAAaC;EACbC,IAAWD;EACXE,SAAgBF;EAChBG,SAAgBH;EAChBI,MAAaJ;AACf,CAAA;AAGO,IAAMK,aAAoBP,eAAO;EACtCQ,OAAOZ,KAAID;EACXc,MAAaC;EACbC,QAAeT;AACjB,CAAA;AAGO,IAAMU,oBAA2BZ,eAAO;;;;;EAK7Ca,MAAaX;;;;EAKbE,SAASN,KAAIA,IAAID,KAAIiB,OAAO;;;;EAK5BC,iBAAwBC,iBAAgBd,cAAM;AAChD,CAAA;AAGO,IAAMe,aAAoBjB,eAAO;EAAEkB,MAAaC;AAAO,CAAA;AAGvD,IAAMC,eAAsBpB,eAAO;EACxCqB,KAAYnB;EACZoB,QAAeC,gBAAQ,OAAO,MAAA;EAC9BC,SAAgBC,eAAO;IAAEC,KAAYxB;IAAQyB,OAAczB;EAAO,CAAA;EAClE0B,UAAiB1B;AACnB,CAAA;AAGO,IAAM2B,eAAsBC,cAAM/B,YAAYQ,YAAYK,mBAAmBK,YAAYG,YAAAA;",
6
+ "names": ["make", "resolve", "Context", "Effect", "Schema", "ToolId", "Annotation", "Database", "Filter", "Obj", "Type", "BaseError", "log", "Effect", "Record", "Schema", "handlebars", "Database", "Ref", "invariant", "log", "Text", "Context", "Effect", "Layer", "Database", "Query", "Service", "Tag", "resolve", "serviceFunctionEffect", "service", "layer", "effect", "gen", "database", "Database", "handlerSet", "OperationHandlerProvider", "key", "runQueryFirst", "Query", "type", "PersistentOperation", "pipe", "flatten", "map", "deserialize", "catchTag", "getHandlerByKey", "option", "provideService", "Schema", "optional", "InputKind", "default", "description", "inputs", "make", "id", "content", "source", "section", "handlebars", "registerHelper", "String", "template", "output", "variables", "trim", "processTemplate", "Effect", "fn", "OperationRegistry", "resolve", "input", "function", "result", "Operation", "fromEntries", "__dxlog_file", "protocol", "Union", "typename", "Annotation", "IconAnnotation", "set", "icon", "hue", "instructions", "tools", "map", "ToolId", "make", "tool", "blueprints", "seen", "has", "blueprint", "log", "key", "getByKey", "query", "updateBlueprints", "registryBlueprint", "update", "Effect", "registry", "fail", "NotFoundError", "context", "Database", "local", "resolve", "Context", "Effect", "Redacted", "CredentialsService", "Tag", "getCredential", "query", "gen", "credentials", "promise", "getApiKey", "credential", "apiKey", "Error", "service", "make", "make", "Context", "Effect", "Schema", "assertArgument", "log", "Context", "Effect", "Layer", "Schema", "Annotation", "Obj", "Type", "log", "__dxlog_file", "eventType", "isEphemeral", "TraceService", "writer", "payload", "key", "schema", "type", "data", "Unknown", "parentPid", "optional", "processName", "events", "Message", "MessageData", "version", "icon", "hue", "noopWriter", "writerLayerNoop", "write", "layerConsole", "console", "message", "event", "meta", "opts", "String", "outcome", "error", "__dxlog_file", "make", "create", "assertArgument", "ProcessTypeId", "opts", "ctx", "onInput", "Effect", "onAlarm", "void", "onChildEvent", "partial", "input", "output", "op", "services", "semaphore", "log", "name", "Trace", "write", "meta", "opHandler", "submitOutput", "succeed", "outcome", "catchAllDefect", "errorMessage", "defect", "Error", "message", "key", "error", "State", "isEphemeral", "Schema", "pidSet", "roots", "parent", "node", "siblings", "push", "childrenByParent", "set", "b", "String", "a", "localeCompare", "sort", "formatLabel", "idShort", "params", "inputCount", "outputCount", "parts", "lines", "isRoot", "branch", "isLast", "children", "get", "pid", "index", "walk", "nextPrefix", "length", "join", "make", "Schema", "Annotation", "JsonSchema", "Obj", "Ref", "Type", "Routine", "Struct", "name", "optional", "String", "description", "input", "JsonSchema", "pipe", "Annotation", "FormInputAnnotation", "set", "output", "instructions", "Template", "blueprints", "Array", "Ref", "Blueprint", "context", "Any", "Type", "object", "typename", "version", "LabelAnnotation", "IconAnnotation", "icon", "hue", "make", "params", "Obj", "toJsonSchema", "Void", "source", "make", "Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "Text", "Script", "Struct", "name", "String", "pipe", "optional", "description", "changed", "Boolean", "set", "source", "object", "typename", "version", "LabelAnnotation", "IconAnnotation", "icon", "hue", "props", "content", "empty", "make", "resolve", "succeed", "Context", "Effect", "Either", "Layer", "Option", "ServiceResolverTypeId", "ServiceResolver", "GenericTag", "resolve", "serviceFunctionEffect", "_", "resolveAll", "tags", "context", "gen", "services", "forEach", "tag", "pipe", "map", "service", "make", "mergeAll", "succeed", "getService", "tag1", "key", "fail", "ServiceNotAvailableError", "String", "resolveFn", "fromContext", "ctx", "getOption", "isNone", "value", "fromRequirements", "contextWith", "parentCtx", "available", "Set", "result", "empty", "has", "layerRequirements", "effect", "compose", "resolvers", "resolver", "single", "either", "isRight", "right", "make", "Schema", "SchemaAST", "Annotation", "Feed", "Obj", "QueryAST", "Ref", "Type", "OptionsAnnotationId", "SystemTypeAnnotation", "failedInvariant", "DXN", "Kinds", "kindLiteralAnnotations", "title", "EmailSpec", "Struct", "kind", "Literal", "annotations", "specEmail", "QueueSpec", "queue", "specQueue", "queueDxn", "specFeed", "feed", "getQueueDxn", "toString", "Error", "SubscriptionSpec", "query", "raw", "optional", "String", "ast", "Query", "options", "deep", "Boolean", "delay", "Number", "specSubscription", "undefined", "TimerSpec", "cron", "ExamplesAnnotationId", "specTimer", "WebhookSpec", "method", "port", "specWebhook", "opts", "Spec", "Union", "TriggerSchema", "function", "Unknown", "inputNodeId", "enabled", "spec", "concurrency", "default", "description", "input", "Record", "key", "value", "Any", "pipe", "object", "typename", "version", "IconAnnotation", "set", "icon", "hue", "Trigger", "props", "Schema", "DXN", "Obj", "Ref", "EmailEvent", "Struct", "from", "String", "to", "subject", "created", "body", "QueueEvent", "queue", "item", "Any", "cursor", "SubscriptionEvent", "type", "Unknown", "changedObjectId", "optional", "TimerEvent", "tick", "Number", "WebhookEvent", "url", "method", "Literal", "headers", "Record", "key", "value", "bodyText", "TriggerEvent", "Union"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/types/hyperformula.ts":{"bytes":1321,"imports":[{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true}],"format":"esm"},"src/types/types.ts":{"bytes":9120,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":547,"imports":[{"path":"src/types/hyperformula.ts","kind":"import-statement","original":"./hyperformula"},{"path":"src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/compute-node.ts":{"bytes":5714,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/functions/async-function.ts":{"bytes":18966,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true}],"format":"esm"},"src/functions/edge-function.ts":{"bytes":15830,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"src/functions/async-function.ts","kind":"import-statement","original":"./async-function"}],"format":"esm"},"src/functions/function-defs.ts":{"bytes":201438,"imports":[],"format":"esm"},"src/functions/index.ts":{"bytes":682,"imports":[{"path":"src/functions/async-function.ts","kind":"import-statement","original":"./async-function"},{"path":"src/functions/edge-function.ts","kind":"import-statement","original":"./edge-function"},{"path":"src/functions/function-defs.ts","kind":"import-statement","original":"./function-defs"}],"format":"esm"},"src/compute-graph.ts":{"bytes":28886,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"src/compute-node.ts","kind":"import-statement","original":"./compute-node"},{"path":"src/functions/index.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"src/compute-graph-registry.ts":{"bytes":10396,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"src/compute-graph.ts","kind":"import-statement","original":"./compute-graph"},{"path":"src/functions/index.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"src/index.ts":{"bytes":857,"imports":[{"path":"src/compute-graph.ts","kind":"import-statement","original":"./compute-graph"},{"path":"src/compute-graph-registry.ts","kind":"import-statement","original":"./compute-graph-registry"},{"path":"src/compute-node.ts","kind":"import-statement","original":"./compute-node"},{"path":"src/functions/index.ts","kind":"import-statement","original":"./functions"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/testing/test-runtime.ts":{"bytes":3963,"imports":[{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions-runtime/testing","kind":"import-statement","external":true}],"format":"esm"},"src/testing/test-builder.ts":{"bytes":6179,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/compute-graph-registry.ts","kind":"import-statement","original":"../compute-graph-registry"},{"path":"src/testing/test-runtime.ts","kind":"import-statement","original":"./test-runtime"}],"format":"esm"},"src/util.ts":{"bytes":868,"imports":[],"format":"esm"},"src/testing/test-plugin.ts":{"bytes":8844,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"src/functions/index.ts","kind":"import-statement","original":"../functions"},{"path":"src/util.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"src/testing/util.ts":{"bytes":1107,"imports":[{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true}],"format":"esm"},"src/testing/index.ts":{"bytes":747,"imports":[{"path":"src/testing/test-builder.ts","kind":"import-statement","original":"./test-builder"},{"path":"src/testing/test-plugin.ts","kind":"import-statement","original":"./test-plugin"},{"path":"src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"src/testing/test-runtime.ts","kind":"import-statement","original":"./test-runtime"}],"format":"esm"}},"outputs":{"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-KGBGT4NT.mjs","kind":"import-statement"}],"exports":["AsyncFunctionPlugin","ComputeGraph","ComputeGraphRegistry","ComputeNode","DetailedCellError","EDGE_FUNCTION_NAME","EdgeFunctionPlugin","EdgeFunctionPluginTranslations","ExportedCellChange","FunctionContext","RANGE_NOTATION","addressFromA1Notation","addressToA1Notation","cellEquals","columnLetter","createSheetName","defaultFunctionContextOptions","defaultFunctions","defaultOptions","defaultPlugins","inRange","isFormula","parseSheetName","rangeFromA1Notation","rangeToA1Notation"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":1101},"dist/lib/neutral/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10268},"dist/lib/neutral/testing/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-KGBGT4NT.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/ManagedRuntime","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions-runtime/testing","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true}],"exports":["TestBuilder","TestPlugin","TestPluginTranslations","createMockedComputeRuntimeProvider","getRegisteredFunctionNames","testFunctionPlugins"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/test-builder.ts":{"bytesInOutput":1489},"src/testing/test-runtime.ts":{"bytesInOutput":743},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/test-plugin.ts":{"bytesInOutput":1973},"src/util.ts":{"bytesInOutput":87},"src/testing/util.ts":{"bytesInOutput":197}},"bytes":4966},"dist/lib/neutral/chunk-KGBGT4NT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":137943},"dist/lib/neutral/chunk-KGBGT4NT.mjs":{"imports":[{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/vendor-hyperformula","kind":"import-statement","external":true}],"exports":["AsyncFunctionPlugin","ComputeGraph","ComputeGraphRegistry","ComputeNode","DetailedCellError","EDGE_FUNCTION_NAME","EdgeFunctionPlugin","EdgeFunctionPluginTranslations","ExportedCellChange","FunctionContext","RANGE_NOTATION","addressFromA1Notation","addressToA1Notation","cellEquals","columnLetter","createSheetName","defaultFunctionContextOptions","defaultFunctions","defaultOptions","defaultPlugins","inRange","isFormula","parseSheetName","rangeFromA1Notation","rangeToA1Notation"],"inputs":{"src/types/hyperformula.ts":{"bytesInOutput":83},"src/types/types.ts":{"bytesInOutput":2054},"src/types/index.ts":{"bytesInOutput":0},"src/compute-node.ts":{"bytesInOutput":1034},"src/functions/async-function.ts":{"bytesInOutput":4227},"src/functions/edge-function.ts":{"bytesInOutput":3810},"src/functions/function-defs.ts":{"bytesInOutput":68677},"src/functions/index.ts":{"bytesInOutput":0},"src/compute-graph.ts":{"bytesInOutput":6736},"src/compute-graph-registry.ts":{"bytesInOutput":2248}},"bytes":89674}}}
1
+ {"inputs":{"src/errors.ts":{"bytes":5517,"imports":[{"path":"@dxos/errors","kind":"import-statement","external":true}],"format":"esm"},"src/Operation.ts":{"bytes":39694,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Pipeable","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/OperationHandlerSet.ts":{"bytes":12137,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"src/OperationRegistry.ts":{"bytes":5029,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/Operation.ts","kind":"import-statement","original":"./Operation"},{"path":"src/OperationHandlerSet.ts","kind":"import-statement","original":"./OperationHandlerSet"}],"format":"esm"},"src/Template.ts":{"bytes":11037,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/Operation.ts","kind":"import-statement","original":"./Operation"},{"path":"src/OperationRegistry.ts","kind":"import-statement","original":"./OperationRegistry"}],"format":"esm"},"src/Blueprint.ts":{"bytes":21047,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/Template.ts","kind":"import-statement","original":"./Template"}],"format":"esm"},"src/Credential.ts":{"bytes":3982,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Redacted","kind":"import-statement","external":true}],"format":"esm"},"src/Trace.ts":{"bytes":18319,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/Process.ts":{"bytes":33502,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/OperationHandlerSet.ts","kind":"import-statement","original":"./OperationHandlerSet"},{"path":"src/Trace.ts","kind":"import-statement","original":"./Trace"}],"format":"esm"},"src/Routine.ts":{"bytes":7585,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/Blueprint.ts","kind":"import-statement","original":"./Blueprint"},{"path":"src/Template.ts","kind":"import-statement","original":"./Template"}],"format":"esm"},"src/Script.ts":{"bytes":4372,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/ServiceResolver.ts":{"bytes":15577,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Either","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"src/StorageService.ts":{"bytes":8193,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"effect/Pipeable","kind":"import-statement","external":true}],"format":"esm"},"src/Trigger.ts":{"bytes":20329,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"src/TriggerEvent.ts":{"bytes":5896,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":2716,"imports":[{"path":"src/Blueprint.ts","kind":"import-statement","original":"./Blueprint"},{"path":"src/Credential.ts","kind":"import-statement","original":"./Credential"},{"path":"src/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/Operation.ts","kind":"import-statement","original":"./Operation"},{"path":"src/OperationHandlerSet.ts","kind":"import-statement","original":"./OperationHandlerSet"},{"path":"src/OperationRegistry.ts","kind":"import-statement","original":"./OperationRegistry"},{"path":"src/Process.ts","kind":"import-statement","original":"./Process"},{"path":"src/Routine.ts","kind":"import-statement","original":"./Routine"},{"path":"src/Script.ts","kind":"import-statement","original":"./Script"},{"path":"src/ServiceResolver.ts","kind":"import-statement","original":"./ServiceResolver"},{"path":"src/StorageService.ts","kind":"import-statement","original":"./StorageService"},{"path":"src/Template.ts","kind":"import-statement","original":"./Template"},{"path":"src/Trace.ts","kind":"import-statement","original":"./Trace"},{"path":"src/Trigger.ts","kind":"import-statement","original":"./Trigger"},{"path":"src/TriggerEvent.ts","kind":"import-statement","original":"./TriggerEvent"}],"format":"esm"},"src/testing/definitions.ts":{"bytes":4211,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"src/Operation.ts","kind":"import-statement","original":"../Operation"}],"format":"esm"},"src/testing/fib.ts":{"bytes":1848,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"src/Operation.ts","kind":"import-statement","original":"../Operation"},{"path":"src/testing/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/testing/reply.ts":{"bytes":1503,"imports":[{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"src/Operation.ts","kind":"import-statement","original":"../Operation"},{"path":"src/testing/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/testing/sleep.ts":{"bytes":1306,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"src/Operation.ts","kind":"import-statement","original":"../Operation"},{"path":"src/testing/definitions.ts","kind":"import-statement","original":"./definitions"}],"format":"esm"},"src/testing/index.ts":{"bytes":1811,"imports":[{"path":"src/OperationHandlerSet.ts","kind":"import-statement","original":"../OperationHandlerSet"},{"path":"src/testing/definitions.ts","kind":"import-statement","original":"./definitions"},{"path":"src/testing/fib.ts","kind":"import-statement","original":"./fib"},{"path":"src/testing/reply.ts","kind":"import-statement","original":"./reply"},{"path":"src/testing/sleep.ts","kind":"import-statement","original":"./sleep"},{"path":"src/testing/fib.ts","kind":"dynamic-import","original":"./fib"},{"path":"src/testing/reply.ts","kind":"dynamic-import","original":"./reply"},{"path":"src/testing/sleep.ts","kind":"dynamic-import","original":"./sleep"}],"format":"esm"}},"outputs":{"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":73830},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DDEBBRCI.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-N462A6NO.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/ai","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"handlebars","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Redacted","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Either","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["Blueprint","Credential","FunctionError","FunctionNotFoundError","InvalidOperationInputError","InvalidOperationOutputError","InvokerNotInitializedError","NoHandlerError","Operation","OperationHandlerSet","OperationRegistry","Process","Routine","Script","ServiceNotAvailableError","ServiceResolver","StorageService","Template","Trace","Trigger","TriggerEvent","TriggerStateNotFoundError"],"entryPoint":"src/index.ts","inputs":{"src/Blueprint.ts":{"bytesInOutput":5284},"src/Template.ts":{"bytesInOutput":2579},"src/OperationRegistry.ts":{"bytesInOutput":963},"src/index.ts":{"bytesInOutput":0},"src/Credential.ts":{"bytesInOutput":847},"src/Process.ts":{"bytesInOutput":5214},"src/Trace.ts":{"bytesInOutput":4249},"src/Routine.ts":{"bytesInOutput":1847},"src/Script.ts":{"bytesInOutput":1084},"src/ServiceResolver.ts":{"bytesInOutput":2900},"src/Trigger.ts":{"bytesInOutput":4905},"src/TriggerEvent.ts":{"bytesInOutput":1364}},"bytes":32862},"dist/lib/neutral/StorageService.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/StorageService.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DDEBBRCI.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["StorageService","clear","deleteKey","get","key","list","set","withDefault"],"entryPoint":"src/StorageService.ts","inputs":{},"bytes":293},"dist/lib/neutral/chunk-DDEBBRCI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4690},"dist/lib/neutral/chunk-DDEBBRCI.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"effect/Pipeable","kind":"import-statement","external":true}],"exports":["StorageService","StorageService_exports","clear","deleteKey","get","key","list","set","withDefault"],"inputs":{"src/StorageService.ts":{"bytesInOutput":1455}},"bytes":1698},"dist/lib/neutral/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":729},"dist/lib/neutral/testing/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-N462A6NO.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-FEABF5XY.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-H6EHIVDN.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-4N4JAXCP.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-S24LL2D5.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/fib-HDHBZHPE.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/reply-XSQMXAPX.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/sleep-WHTJQ56P.mjs","kind":"dynamic-import"}],"exports":["ExampleHandlers","Fibonacci","FibonacciHandler","Reply","ReplyHandler","Sleep","SleepHandler"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":143}},"bytes":717},"dist/lib/neutral/chunk-N462A6NO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9298},"dist/lib/neutral/chunk-N462A6NO.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["FunctionError","FunctionNotFoundError","InvalidOperationInputError","InvalidOperationOutputError","InvokerNotInitializedError","NoHandlerError","OperationHandlerProvider","OperationHandlerSet_exports","ServiceNotAvailableError","TriggerStateNotFoundError","getHandler","getHandlerByKey","lazy"],"inputs":{"src/errors.ts":{"bytesInOutput":1431},"src/OperationHandlerSet.ts":{"bytesInOutput":2404}},"bytes":4299},"dist/lib/neutral/fib-HDHBZHPE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/fib-HDHBZHPE.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-FEABF5XY.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-S24LL2D5.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["default"],"entryPoint":"src/testing/fib.ts","inputs":{},"bytes":226},"dist/lib/neutral/chunk-FEABF5XY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":955},"dist/lib/neutral/chunk-FEABF5XY.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-S24LL2D5.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true}],"exports":["fib_default"],"inputs":{"src/testing/fib.ts":{"bytesInOutput":278}},"bytes":478},"dist/lib/neutral/reply-XSQMXAPX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/reply-XSQMXAPX.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-H6EHIVDN.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-S24LL2D5.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["default"],"entryPoint":"src/testing/reply.ts","inputs":{},"bytes":232},"dist/lib/neutral/chunk-H6EHIVDN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":750},"dist/lib/neutral/chunk-H6EHIVDN.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-S24LL2D5.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"effect/Console","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true}],"exports":["reply_default"],"inputs":{"src/testing/reply.ts":{"bytesInOutput":227}},"bytes":427},"dist/lib/neutral/sleep-WHTJQ56P.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/sleep-WHTJQ56P.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-4N4JAXCP.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-S24LL2D5.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["default"],"entryPoint":"src/testing/sleep.ts","inputs":{},"bytes":232},"dist/lib/neutral/chunk-4N4JAXCP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":660},"dist/lib/neutral/chunk-4N4JAXCP.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-S24LL2D5.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true}],"exports":["sleep_default"],"inputs":{"src/testing/sleep.ts":{"bytesInOutput":166}},"bytes":366},"dist/lib/neutral/chunk-S24LL2D5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2065},"dist/lib/neutral/chunk-S24LL2D5.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QPCDM7MF.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["Fibonacci","Reply","Sleep"],"inputs":{"src/testing/definitions.ts":{"bytesInOutput":957}},"bytes":1122},"dist/lib/neutral/chunk-QPCDM7MF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21762},"dist/lib/neutral/chunk-QPCDM7MF.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true},{"path":"effect/Pipeable","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["Operation_exports","PersistentOperation","deserialize","invoke","make","withHandler"],"inputs":{"src/Operation.ts":{"bytesInOutput":5951}},"bytes":6171},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
@@ -0,0 +1,10 @@
1
+ import {
2
+ reply_default
3
+ } from "./chunk-H6EHIVDN.mjs";
4
+ import "./chunk-S24LL2D5.mjs";
5
+ import "./chunk-QPCDM7MF.mjs";
6
+ import "./chunk-J5LGTIGS.mjs";
7
+ export {
8
+ reply_default as default
9
+ };
10
+ //# sourceMappingURL=reply-XSQMXAPX.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import {
2
+ sleep_default
3
+ } from "./chunk-4N4JAXCP.mjs";
4
+ import "./chunk-S24LL2D5.mjs";
5
+ import "./chunk-QPCDM7MF.mjs";
6
+ import "./chunk-J5LGTIGS.mjs";
7
+ export {
8
+ sleep_default as default
9
+ };
10
+ //# sourceMappingURL=sleep-WHTJQ56P.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,198 +1,32 @@
1
1
  import {
2
- AsyncFunctionPlugin,
3
- ComputeGraphRegistry
4
- } from "../chunk-KGBGT4NT.mjs";
5
-
6
- // src/testing/test-builder.ts
7
- import { Client } from "@dxos/client";
8
- import { Resource } from "@dxos/context";
9
- import { invariant } from "@dxos/invariant";
10
-
11
- // src/testing/test-runtime.ts
12
- import * as Layer from "effect/Layer";
13
- import * as ManagedRuntime from "effect/ManagedRuntime";
14
- import { AiService } from "@dxos/ai";
15
- import { Database, Feed } from "@dxos/echo";
16
- import { CredentialsService, QueueService } from "@dxos/functions";
17
- import { FunctionInvocationServiceLayerTest } from "@dxos/functions-runtime/testing";
18
- var createMockedComputeRuntimeProvider = ({ functions } = {}) => {
19
- return {
20
- getRuntime: (_spaceId) => ManagedRuntime.make(FunctionInvocationServiceLayerTest({
21
- functions
22
- }).pipe(Layer.provide(AiService.notAvailable), Layer.provide(CredentialsService.configuredLayer([])), Layer.provide(Database.notAvailable), Layer.provide(QueueService.notAvailable), Layer.provide(Feed.notAvailable)))
23
- };
24
- };
25
-
26
- // src/testing/test-builder.ts
27
- var __dxlog_file = "/__w/dxos/dxos/packages/core/compute/src/testing/test-builder.ts";
28
- var TestBuilder = class extends Resource {
29
- _options;
30
- _client;
31
- _registry;
32
- constructor(_options = {}) {
33
- super(), this._options = _options;
34
- }
35
- get ctx() {
36
- return this._ctx;
37
- }
38
- get client() {
39
- invariant(this._client, void 0, {
40
- F: __dxlog_file,
41
- L: 29,
42
- S: this,
43
- A: [
44
- "this._client",
45
- ""
46
- ]
47
- });
48
- return this._client;
49
- }
50
- get registry() {
51
- invariant(this._registry, void 0, {
52
- F: __dxlog_file,
53
- L: 34,
54
- S: this,
55
- A: [
56
- "this._registry",
57
- ""
58
- ]
59
- });
60
- return this._registry;
61
- }
62
- async _open() {
63
- const client = new Client(this._options);
64
- await client.initialize();
65
- await client.halo.createIdentity();
66
- this._client = client;
67
- this._ctx.onDispose(async () => {
68
- await client.destroy();
69
- this._client = void 0;
70
- });
71
- const registry = new ComputeGraphRegistry({
72
- ...this._options,
73
- // Provide a default runtime provider for tests if not supplied.
74
- computeRuntime: this._options.computeRuntime ?? createMockedComputeRuntimeProvider()
75
- });
76
- await registry.open();
77
- this._registry = registry;
78
- this._ctx.onDispose(async () => {
79
- await registry.close();
80
- this._registry = void 0;
81
- });
82
- }
83
- };
84
-
85
- // src/testing/test-plugin.ts
86
- import { getDeep } from "@dxos/util";
87
- import { FunctionArgumentType } from "@dxos/vendor-hyperformula";
88
-
89
- // src/util.ts
90
- var parseNumberString = (str) => {
91
- return parseFloat(str.replace(/[^\d.]/g, ""));
92
- };
93
-
94
- // src/testing/test-plugin.ts
95
- var TestPlugin = class extends AsyncFunctionPlugin {
96
- /**
97
- * Simple local function returns input value.
98
- */
99
- test(ast, state) {
100
- const handler = async (_value) => {
101
- return _value;
102
- };
103
- return this.runAsyncFunction(ast, state, handler);
104
- }
105
- /**
106
- * Simple local function returns random number.
107
- */
108
- random(ast, state) {
109
- const handler = async () => {
110
- return Math.random();
111
- };
112
- return this.runAsyncFunction(ast, state, handler);
113
- }
114
- /**
115
- * Async HTTP function.
116
- */
117
- crypto(ast, state) {
118
- const handler = async (_currency) => {
119
- const currency = (_currency || "USD").toUpperCase();
120
- const result = await fetch(`https://api.coindesk.com/v1/bpi/currentprice/${currency}.json`);
121
- const data = await result.json();
122
- const rate = getDeep(data, [
123
- "bpi",
124
- currency,
125
- "rate"
126
- ]);
127
- if (!rate) {
128
- return NaN;
129
- }
130
- return parseNumberString(rate);
131
- };
132
- return this.runAsyncFunction(ast, state, handler, {
133
- ttl: 1e4
134
- });
135
- }
136
- };
137
- TestPlugin.implementedFunctions = {
138
- TEST: {
139
- method: "test",
140
- parameters: [
141
- {
142
- argumentType: FunctionArgumentType.NUMBER,
143
- optionalArg: false
144
- }
145
- ],
146
- isVolatile: true
147
- },
148
- RANDOM: {
149
- method: "random",
150
- parameters: [],
151
- isVolatile: true
152
- },
153
- CRYPTO: {
154
- method: "crypto",
155
- parameters: [
156
- {
157
- argumentType: FunctionArgumentType.STRING,
158
- optionalArg: true
159
- }
160
- ],
161
- isVolatile: true
162
- }
163
- };
164
- var TestPluginTranslations = {
165
- enGB: {
166
- TEST: "Returns input value",
167
- RANDOM: "Random number",
168
- CRYPTO: "Crypto token value"
169
- },
170
- enUS: {
171
- TEST: "Returns input value",
172
- RANDOM: "Random number",
173
- CRYPTO: "Crypto token value"
174
- }
175
- };
176
- var testFunctionPlugins = [
177
- {
178
- plugin: TestPlugin,
179
- translations: TestPluginTranslations
180
- }
181
- ];
2
+ lazy
3
+ } from "../chunk-N462A6NO.mjs";
4
+ import {
5
+ fib_default
6
+ } from "../chunk-FEABF5XY.mjs";
7
+ import {
8
+ reply_default
9
+ } from "../chunk-H6EHIVDN.mjs";
10
+ import {
11
+ sleep_default
12
+ } from "../chunk-4N4JAXCP.mjs";
13
+ import {
14
+ Fibonacci,
15
+ Reply,
16
+ Sleep
17
+ } from "../chunk-S24LL2D5.mjs";
18
+ import "../chunk-QPCDM7MF.mjs";
19
+ import "../chunk-J5LGTIGS.mjs";
182
20
 
183
- // src/testing/util.ts
184
- import { HyperFormula } from "@dxos/vendor-hyperformula";
185
- var getRegisteredFunctionNames = () => {
186
- return HyperFormula.buildEmpty({
187
- licenseKey: "gpl-v3"
188
- }).getRegisteredFunctionNames();
189
- };
21
+ // src/testing/index.ts
22
+ var ExampleHandlers = lazy(() => import("../fib-HDHBZHPE.mjs"), () => import("../reply-XSQMXAPX.mjs"), () => import("../sleep-WHTJQ56P.mjs"));
190
23
  export {
191
- TestBuilder,
192
- TestPlugin,
193
- TestPluginTranslations,
194
- createMockedComputeRuntimeProvider,
195
- getRegisteredFunctionNames,
196
- testFunctionPlugins
24
+ ExampleHandlers,
25
+ Fibonacci,
26
+ fib_default as FibonacciHandler,
27
+ Reply,
28
+ reply_default as ReplyHandler,
29
+ Sleep,
30
+ sleep_default as SleepHandler
197
31
  };
198
32
  //# sourceMappingURL=index.mjs.map