@dxos/functions 0.8.1 → 0.8.2-main.10c050d
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.
- package/dist/lib/browser/bundler/index.mjs +0 -3
- package/dist/lib/browser/bundler/index.mjs.map +3 -3
- package/dist/lib/browser/edge/index.mjs +63 -7
- package/dist/lib/browser/edge/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +513 -100
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/bundler/index.cjs +0 -1
- package/dist/lib/node/bundler/index.cjs.map +3 -3
- package/dist/lib/node/edge/index.cjs +65 -5
- package/dist/lib/node/edge/index.cjs.map +4 -4
- package/dist/lib/node/index.cjs +519 -92
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/bundler/index.mjs +0 -1
- package/dist/lib/node-esm/bundler/index.mjs.map +3 -3
- package/dist/lib/node-esm/edge/index.mjs +64 -6
- package/dist/lib/node-esm/edge/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +513 -98
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/bundler/bundler.d.ts.map +1 -1
- package/dist/types/src/edge/functions.d.ts +3 -3
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/edge/index.d.ts.map +1 -1
- package/dist/types/src/executor/executor.d.ts +8 -0
- package/dist/types/src/executor/executor.d.ts.map +1 -0
- package/dist/types/src/executor/index.d.ts +2 -0
- package/dist/types/src/executor/index.d.ts.map +1 -0
- package/dist/types/src/handler.d.ts +23 -67
- package/dist/types/src/handler.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +5 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/schema.d.ts +57 -0
- package/dist/types/src/schema.d.ts.map +1 -0
- package/dist/types/src/services/ai.d.ts +9 -0
- package/dist/types/src/services/ai.d.ts.map +1 -0
- package/dist/types/src/services/credentials.d.ts +30 -0
- package/dist/types/src/services/credentials.d.ts.map +1 -0
- package/dist/types/src/services/database.d.ts +9 -0
- package/dist/types/src/services/database.d.ts.map +1 -0
- package/dist/types/src/services/index.d.ts +7 -0
- package/dist/types/src/services/index.d.ts.map +1 -0
- package/dist/types/src/services/queues.d.ts +10 -0
- package/dist/types/src/services/queues.d.ts.map +1 -0
- package/dist/types/src/services/service-container.d.ts +25 -0
- package/dist/types/src/services/service-container.d.ts.map +1 -0
- package/dist/types/src/services/tracing.d.ts +15 -0
- package/dist/types/src/services/tracing.d.ts.map +1 -0
- package/dist/types/src/trace.d.ts +149 -0
- package/dist/types/src/trace.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +407 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/src/{types/url.d.ts → url.d.ts} +6 -0
- package/dist/types/src/url.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -36
- package/src/bundler/bundler.ts +7 -1
- package/src/edge/functions.ts +7 -4
- package/src/edge/index.ts +4 -0
- package/src/executor/executor.ts +47 -0
- package/src/executor/index.ts +5 -0
- package/src/handler.ts +29 -125
- package/src/index.ts +8 -5
- package/src/schema.ts +52 -0
- package/src/services/ai.ts +15 -0
- package/src/services/credentials.ts +55 -0
- package/src/services/database.ts +14 -0
- package/src/services/index.ts +10 -0
- package/src/services/queues.ts +16 -0
- package/src/services/service-container.ts +58 -0
- package/src/services/tracing.ts +27 -0
- package/src/{types/trace.ts → trace.ts} +37 -35
- package/src/translations.ts +1 -1
- package/src/types.ts +211 -0
- package/src/{types/url.ts → url.ts} +5 -0
- package/dist/lib/browser/chunk-HI7YZO2K.mjs +0 -482
- package/dist/lib/browser/chunk-HI7YZO2K.mjs.map +0 -7
- package/dist/lib/browser/chunk-LT4LR4VU.mjs +0 -72
- package/dist/lib/browser/chunk-LT4LR4VU.mjs.map +0 -7
- package/dist/lib/browser/chunk-RVSG6WTL.mjs +0 -358
- package/dist/lib/browser/chunk-RVSG6WTL.mjs.map +0 -7
- package/dist/lib/browser/chunk-XRCXIG74.mjs +0 -12
- package/dist/lib/browser/chunk-XRCXIG74.mjs.map +0 -7
- package/dist/lib/browser/testing/index.mjs +0 -670
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -49
- package/dist/lib/browser/types/index.mjs.map +0 -7
- package/dist/lib/node/chunk-DSUGRAAL.cjs +0 -392
- package/dist/lib/node/chunk-DSUGRAAL.cjs.map +0 -7
- package/dist/lib/node/chunk-JEQ2X3Z6.cjs +0 -34
- package/dist/lib/node/chunk-JEQ2X3Z6.cjs.map +0 -7
- package/dist/lib/node/chunk-NXZNXVT3.cjs +0 -94
- package/dist/lib/node/chunk-NXZNXVT3.cjs.map +0 -7
- package/dist/lib/node/chunk-RXMCVAMJ.cjs +0 -496
- package/dist/lib/node/chunk-RXMCVAMJ.cjs.map +0 -7
- package/dist/lib/node/testing/index.cjs +0 -687
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -70
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs +0 -12
- package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HBD2FZXO.mjs +0 -358
- package/dist/lib/node-esm/chunk-HBD2FZXO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O2SXVYU5.mjs +0 -72
- package/dist/lib/node-esm/chunk-O2SXVYU5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SQSJO5HI.mjs +0 -482
- package/dist/lib/node-esm/chunk-SQSJO5HI.mjs.map +0 -7
- package/dist/lib/node-esm/testing/index.mjs +0 -670
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -49
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/browser/index.d.ts +0 -2
- package/dist/types/src/browser/index.d.ts.map +0 -1
- package/dist/types/src/function/function-registry.d.ts +0 -25
- package/dist/types/src/function/function-registry.d.ts.map +0 -1
- package/dist/types/src/function/function-registry.test.d.ts +0 -2
- package/dist/types/src/function/function-registry.test.d.ts.map +0 -1
- package/dist/types/src/function/index.d.ts +0 -2
- package/dist/types/src/function/index.d.ts.map +0 -1
- package/dist/types/src/runtime/dev-server.d.ts +0 -52
- package/dist/types/src/runtime/dev-server.d.ts.map +0 -1
- package/dist/types/src/runtime/dev-server.test.d.ts +0 -2
- package/dist/types/src/runtime/dev-server.test.d.ts.map +0 -1
- package/dist/types/src/runtime/index.d.ts +0 -3
- package/dist/types/src/runtime/index.d.ts.map +0 -1
- package/dist/types/src/runtime/scheduler.d.ts +0 -34
- package/dist/types/src/runtime/scheduler.d.ts.map +0 -1
- package/dist/types/src/runtime/scheduler.test.d.ts +0 -2
- package/dist/types/src/runtime/scheduler.test.d.ts.map +0 -1
- package/dist/types/src/testing/functions-integration.test.d.ts +0 -2
- package/dist/types/src/testing/functions-integration.test.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -5
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/manifest.d.ts +0 -3
- package/dist/types/src/testing/manifest.d.ts.map +0 -1
- package/dist/types/src/testing/plugin-init.d.ts +0 -6
- package/dist/types/src/testing/plugin-init.d.ts.map +0 -1
- package/dist/types/src/testing/setup.d.ts +0 -15
- package/dist/types/src/testing/setup.d.ts.map +0 -1
- package/dist/types/src/testing/test/handler.d.ts +0 -4
- package/dist/types/src/testing/test/handler.d.ts.map +0 -1
- package/dist/types/src/testing/test/index.d.ts +0 -3
- package/dist/types/src/testing/test/index.d.ts.map +0 -1
- package/dist/types/src/testing/types.d.ts +0 -10
- package/dist/types/src/testing/types.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -5
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/dist/types/src/trigger/index.d.ts +0 -3
- package/dist/types/src/trigger/index.d.ts.map +0 -1
- package/dist/types/src/trigger/trigger-registry.d.ts +0 -38
- package/dist/types/src/trigger/trigger-registry.d.ts.map +0 -1
- package/dist/types/src/trigger/trigger-registry.test.d.ts +0 -2
- package/dist/types/src/trigger/trigger-registry.test.d.ts.map +0 -1
- package/dist/types/src/trigger/type/index.d.ts +0 -3
- package/dist/types/src/trigger/type/index.d.ts.map +0 -1
- package/dist/types/src/trigger/type/subscription-trigger.d.ts +0 -4
- package/dist/types/src/trigger/type/subscription-trigger.d.ts.map +0 -1
- package/dist/types/src/trigger/type/timer-trigger.d.ts +0 -4
- package/dist/types/src/trigger/type/timer-trigger.d.ts.map +0 -1
- package/dist/types/src/trigger/type/webhook-trigger.d.ts +0 -4
- package/dist/types/src/trigger/type/webhook-trigger.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -5
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -53
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/trace.d.ts +0 -146
- package/dist/types/src/types/trace.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -265
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/dist/types/src/types/url.d.ts.map +0 -1
- package/dist/types/tools/schema.d.ts +0 -2
- package/dist/types/tools/schema.d.ts.map +0 -1
- package/schema/functions.json +0 -211
- package/src/browser/index.ts +0 -5
- package/src/function/function-registry.test.ts +0 -118
- package/src/function/function-registry.ts +0 -104
- package/src/function/index.ts +0 -5
- package/src/runtime/dev-server.test.ts +0 -79
- package/src/runtime/dev-server.ts +0 -240
- package/src/runtime/index.ts +0 -6
- package/src/runtime/scheduler.test.ts +0 -152
- package/src/runtime/scheduler.ts +0 -170
- package/src/testing/functions-integration.test.ts +0 -65
- package/src/testing/index.ts +0 -8
- package/src/testing/manifest.ts +0 -15
- package/src/testing/plugin-init.ts +0 -20
- package/src/testing/setup.ts +0 -109
- package/src/testing/test/handler.ts +0 -15
- package/src/testing/test/index.ts +0 -7
- package/src/testing/types.ts +0 -9
- package/src/testing/util.ts +0 -26
- package/src/trigger/index.ts +0 -6
- package/src/trigger/trigger-registry.test.ts +0 -278
- package/src/trigger/trigger-registry.ts +0 -218
- package/src/trigger/type/index.ts +0 -7
- package/src/trigger/type/subscription-trigger.ts +0 -84
- package/src/trigger/type/timer-trigger.ts +0 -48
- package/src/trigger/type/webhook-trigger.ts +0 -48
- package/src/types/index.ts +0 -8
- package/src/types/schema.ts +0 -46
- package/src/types/types.ts +0 -163
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/handler.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema as S } from 'effect';\nimport { type Effect } from 'effect';\n\nimport { type Client, PublicKey } from '@dxos/client';\nimport { type Space, type SpaceId } from '@dxos/client/echo';\nimport type { CoreDatabase, EchoDatabase, ReactiveEchoObject } from '@dxos/echo-db';\nimport { type HasId } from '@dxos/echo-schema';\nimport { type DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type QueryResult } from '@dxos/protocols';\nimport { isNonNullable } from '@dxos/util';\n\n// TODO(burdon): Model after http request. Ref Lambda/OpenFaaS.\n// https://docs.aws.amazon.com/lambda/latest/dg/typescript-handler.html\n// https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/#functions\n// https://www.npmjs.com/package/aws-lambda\n\n/**\n * Function handler.\n */\nexport type FunctionHandler<TData = {}, TMeta = {}, TOutput = any> = (params: {\n context: FunctionContext;\n event: FunctionEvent<TData, TMeta>;\n /**\n * @deprecated\n */\n response: FunctionResponse;\n}) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any>;\n\n/**\n * Function context.\n */\nexport interface FunctionContext {\n getSpace: (spaceId: SpaceId) => Promise<SpaceAPI>;\n\n /**\n * Space from which the function was invoked.\n */\n space: SpaceAPI | undefined;\n\n ai: FunctionContextAi;\n\n /**\n * @deprecated\n */\n // TODO(burdon): Limit access to individual space.\n client: Client;\n /**\n * @deprecated\n */\n // TODO(burdon): Replace with storage service abstraction.\n dataDir?: string;\n}\n\nexport interface FunctionContextAi {\n // TODO(dmaretskyi): Refer to cloudflare AI docs for more comprehensive typedefs.\n run(model: string, inputs: any, options?: any): Promise<any>;\n}\n\n/**\n * Event payload.\n */\n// TODO(dmaretskyi): Update type definitions to match the actual payload.\nexport type FunctionEvent<TData = {}, TMeta = {}> = {\n data: FunctionEventMeta<TMeta> & TData;\n};\n\n/**\n * Metadata from trigger.\n */\nexport type FunctionEventMeta<TMeta = {}> = {\n meta: TMeta;\n};\n\n/**\n * Function response.\n */\nexport type FunctionResponse = {\n status(code: number): FunctionResponse;\n};\n\n//\n// API.\n//\n\n// TODO(dmaretskyi): Temporary API to get the queues working.\n// TODO(dmaretskyi): To be replaced with integrating queues into echo.\nexport interface QueuesAPI {\n queryQueue(queue: DXN, options?: {}): Promise<QueryResult>;\n insertIntoQueue(queue: DXN, objects: HasId[]): Promise<void>;\n}\n\n/**\n * Space interface available to functions.\n */\nexport interface SpaceAPI {\n get id(): SpaceId;\n /**\n * @deprecated\n */\n get crud(): CoreDatabase;\n get db(): EchoDatabase;\n // TODO(dmaretskyi): Align with echo api --- queues.get(id).append(items);\n get queues(): QueuesAPI;\n}\n\n// TODO(wittjosiah): Fix this.\nconst __assertFunctionSpaceIsCompatibleWithTheClientSpace = () => {\n // const _: SpaceAPI = {} as Space;\n};\n\nexport type FunctionDefinition = {\n description?: string;\n inputSchema: S.Schema.AnyNoContext;\n outputSchema?: S.Schema.AnyNoContext;\n handler: FunctionHandler<any>;\n};\n\nexport type DefineFunctionParams<T, O = any> = {\n description?: string;\n inputSchema: S.Schema<T, any>;\n outputSchema?: S.Schema<O, any>;\n handler: FunctionHandler<T, any, O>;\n};\n\n// TODO(dmaretskyi): Bind input type to function handler.\nexport const defineFunction = <T, O>(params: DefineFunctionParams<T, O>): FunctionDefinition => {\n if (!S.isSchema(params.inputSchema)) {\n throw new Error('Input schema must be a valid schema');\n }\n if (typeof params.handler !== 'function') {\n throw new Error('Handler must be a function');\n }\n\n return {\n description: params.description,\n inputSchema: params.inputSchema,\n outputSchema: params.outputSchema ?? S.Any,\n handler: params.handler,\n };\n};\n\n//\n// Subscription utils.\n//\n\nexport type RawSubscriptionData = {\n spaceKey?: string;\n objects?: string[];\n};\n\nexport type SubscriptionData = {\n space?: Space;\n objects?: ReactiveEchoObject<any>[];\n};\n\n/**\n * Handler wrapper for subscription events; extracts space and objects.\n *\n * To test:\n * ```\n * curl -s -X POST -H \"Content-Type: application/json\" --data '{\"space\": \"0446...1cbb\"}' http://localhost:7100/dev/email-extractor\n * ```\n *\n * NOTE: Get space key from devtools or `dx space list --json`\n */\n// TODO(burdon): Evolve into plugin definition like Composer.\nexport const subscriptionHandler = <TMeta>(\n handler: FunctionHandler<SubscriptionData, TMeta>,\n types?: S.Schema.AnyNoContext[],\n): FunctionHandler<RawSubscriptionData, TMeta> => {\n return async ({ event: { data }, context, response, ...rest }) => {\n const { client } = context;\n const space = data.spaceKey ? client.spaces.get(PublicKey.from(data.spaceKey)) : undefined;\n if (!space) {\n log.error('Invalid space');\n return response.status(500);\n }\n\n registerTypes(space, types);\n const objects = space\n ? data.objects\n ?.map<ReactiveEchoObject<any> | undefined>((id) => space!.db.getObjectById(id))\n .filter(isNonNullable)\n : [];\n\n if (!!data.spaceKey && !space) {\n log.warn('invalid space', { data });\n } else {\n log.info('handler', { space: space?.key.truncate(), objects: objects?.length });\n }\n\n return handler({ event: { data: { ...data, space, objects } }, context, response, ...rest });\n };\n};\n\n// TODO(burdon): Evolve types as part of function metadata.\nconst registerTypes = (space: Space, types: S.Schema.AnyNoContext[] = []) => {\n const registry = space.db.graph.schemaRegistry;\n for (const type of types) {\n if (!registry.hasSchema(type)) {\n registry.addSchema([type]);\n }\n }\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["Schema", "
|
|
3
|
+
"sources": ["../../../src/handler.ts", "../../../src/schema.ts", "../../../src/trace.ts", "../../../src/types.ts", "../../../src/url.ts", "../../../src/services/ai.ts", "../../../src/services/database.ts", "../../../src/services/queues.ts", "../../../src/services/credentials.ts", "../../../src/services/tracing.ts", "../../../src/services/service-container.ts", "../../../src/executor/executor.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema, type Context, type Effect } from 'effect';\n\nimport { type AIServiceClient } from '@dxos/ai';\n// import { type Space } from '@dxos/client/echo';\nimport type { CoreDatabase, EchoDatabase } from '@dxos/echo-db';\nimport { type HasId } from '@dxos/echo-schema';\nimport { type SpaceId, type DXN } from '@dxos/keys';\nimport { type QueryResult } from '@dxos/protocols';\n\n// TODO(burdon): Model after http request. Ref Lambda/OpenFaaS.\n// https://docs.aws.amazon.com/lambda/latest/dg/typescript-handler.html\n// https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/#functions\n// https://www.npmjs.com/package/aws-lambda\n\n/**\n * Function handler.\n */\nexport type FunctionHandler<TData = {}, TOutput = any> = (params: {\n /**\n * Services and context available to the function.\n */\n context: FunctionContext;\n\n /**\n * Data passed as the input to the function.\n * Must match the function's input schema.\n * This will be the payload from the trigger or other data passed into the function in a workflow.\n */\n data: TData;\n}) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any>;\n\n/**\n * Function context.\n */\nexport interface FunctionContext {\n /**\n * Resolves a service available to the function.\n * @throws if the service is not available.\n */\n getService: <T extends Context.Tag<any, any>>(tag: T) => Context.Tag.Service<T>;\n\n getSpace: (spaceId: SpaceId) => Promise<SpaceAPI>;\n\n /**\n * Space from which the function was invoked.\n */\n space: SpaceAPI | undefined;\n\n ai: AIServiceClient;\n}\n\nexport interface FunctionContextAi {\n // TODO(dmaretskyi): Refer to cloudflare AI docs for more comprehensive typedefs.\n run(model: string, inputs: any, options?: any): Promise<any>;\n}\n\n//\n// API.\n//\n\n// TODO(dmaretskyi): Temporary API to get the queues working.\n// TODO(dmaretskyi): To be replaced with integrating queues into echo.\nexport interface QueuesAPI {\n queryQueue(queue: DXN, options?: {}): Promise<QueryResult>;\n insertIntoQueue(queue: DXN, objects: HasId[]): Promise<void>;\n}\n\n/**\n * Space interface available to functions.\n */\nexport interface SpaceAPI {\n get id(): SpaceId;\n /**\n * @deprecated\n */\n get crud(): CoreDatabase;\n get db(): EchoDatabase;\n // TODO(dmaretskyi): Align with echo api --- queues.get(id).append(items);\n get queues(): QueuesAPI;\n}\n\n// TODO(wittjosiah): Queues are incompatible.\nconst __assertFunctionSpaceIsCompatibleWithTheClientSpace = () => {\n // const _: SpaceAPI = {} as Space;\n};\n\nexport type FunctionDefinition<T = {}, O = any> = {\n description?: string;\n inputSchema: Schema.Schema<T, any>;\n outputSchema?: Schema.Schema<O, any>;\n handler: FunctionHandler<T, O>;\n};\n\n// TODO(dmaretskyi): Bind input type to function handler.\nexport const defineFunction = <T, O>(params: FunctionDefinition<T, O>): FunctionDefinition<T, O> => {\n if (!Schema.isSchema(params.inputSchema)) {\n throw new Error('Input schema must be a valid schema');\n }\n if (typeof params.handler !== 'function') {\n throw new Error('Handler must be a function');\n }\n\n return {\n description: params.description,\n inputSchema: params.inputSchema,\n outputSchema: params.outputSchema ?? Schema.Any,\n handler: params.handler,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { EchoObject, JsonSchemaType, LabelAnnotation, Ref, TypedObject } from '@dxos/echo-schema';\nimport { DataType } from '@dxos/schema';\n\n/**\n * Source script.\n */\nexport const ScriptType = Schema.Struct({\n name: Schema.optional(Schema.String),\n description: Schema.optional(Schema.String),\n // TODO(burdon): Change to hash of deployed content.\n // Whether source has changed since last deploy.\n changed: Schema.optional(Schema.Boolean),\n source: Ref(DataType.Text),\n}).pipe(\n EchoObject({\n typename: 'dxos.org/type/Script',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n);\n\nexport type ScriptType = Schema.Schema.Type<typeof ScriptType>;\n\n/**\n * Function deployment.\n */\nexport class FunctionType extends TypedObject({\n typename: 'dxos.org/type/Function',\n version: '0.1.0',\n})({\n // TODO(burdon): Rename to id/uri?\n name: Schema.NonEmptyString,\n version: Schema.String,\n\n description: Schema.optional(Schema.String),\n\n // Reference to a source script if it exists within ECHO.\n // TODO(burdon): Don't ref ScriptType directly (core).\n source: Schema.optional(Ref(ScriptType)),\n\n inputSchema: Schema.optional(JsonSchemaType),\n outputSchema: Schema.optional(JsonSchemaType),\n\n // Local binding to a function name.\n binding: Schema.optional(Schema.String),\n}) {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Queue } from '@dxos/echo-db';\nimport { EchoObject, Expando, ObjectId, Ref } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\n\nimport { FunctionTrigger, type FunctionTriggerType } from './types';\n\nexport enum InvocationOutcome {\n SUCCESS = 'success',\n FAILURE = 'failure',\n PENDING = 'pending',\n}\n\n// TODO(burdon): Convert to extensible discriminated union of EDGE events.\nexport enum InvocationTraceEventType {\n START = 'start',\n END = 'end',\n}\n\nexport const TraceEventException = Schema.Struct({\n timestampMs: Schema.Number,\n message: Schema.String,\n name: Schema.String,\n stack: Schema.optional(Schema.String),\n});\nexport type TraceEventException = Schema.Schema.Type<typeof TraceEventException>;\n\nexport const InvocationTraceStartEvent = Schema.Struct({\n /**\n * Queue message id.\n */\n id: ObjectId,\n type: Schema.Literal(InvocationTraceEventType.START),\n /**\n * Invocation id, the same for invocation start and end events.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n timestampMs: Schema.Number,\n /**\n * Data passed to function / workflow as an argument.\n */\n // TODO(burdon): Input schema?\n input: Schema.Object,\n /**\n * Queue for function/workflow invocation events.\n */\n invocationTraceQueue: Ref(Queue),\n /**\n * DXN of the invoked function/workflow.\n */\n invocationTarget: Ref(Expando),\n /**\n * Present for automatic invocations.\n */\n trigger: Schema.optional(Ref(FunctionTrigger)),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceStart', version: '0.1.0' }));\n\nexport type InvocationTraceStartEvent = Schema.Schema.Type<typeof InvocationTraceStartEvent>;\n\nexport const InvocationTraceEndEvent = Schema.Struct({\n /**\n * Trace event id.\n */\n id: ObjectId,\n type: Schema.Literal(InvocationTraceEventType.END),\n /**\n * Invocation id, will be the same for invocation start and end.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n // TODO(burdon): Remove ms suffix.\n timestampMs: Schema.Number,\n outcome: Schema.Enums(InvocationOutcome),\n exception: Schema.optional(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceEnd', version: '0.1.0' }));\n\nexport type InvocationTraceEndEvent = Schema.Schema.Type<typeof InvocationTraceEndEvent>;\n\nexport type InvocationTraceEvent = InvocationTraceStartEvent | InvocationTraceEndEvent;\n\nexport const TraceEventLog = Schema.Struct({\n timestampMs: Schema.Number,\n level: Schema.String,\n message: Schema.String,\n context: Schema.optional(Schema.Object),\n});\n\nexport const TraceEvent = Schema.Struct({\n id: ObjectId,\n // TODO(burdon): Need enum/numeric result (not string).\n outcome: Schema.String,\n truncated: Schema.Boolean,\n /**\n * Time when the event was persisted.\n */\n ingestionTimestampMs: Schema.Number,\n logs: Schema.Array(TraceEventLog),\n exceptions: Schema.Array(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/TraceEvent', version: '0.1.0' }));\n\nexport type TraceEvent = Schema.Schema.Type<typeof TraceEvent>;\n\n/**\n * Deprecated InvocationTrace event format.\n * @deprecated\n */\n// TODO(burdon): Remove.\nexport type InvocationSpan = {\n id: string;\n timestampMs: number;\n outcome: InvocationOutcome;\n input: object;\n durationMs: number;\n invocationTraceQueue: Ref<Queue>;\n invocationTarget: Ref<Expando>;\n trigger?: Ref<FunctionTriggerType>;\n exception?: TraceEventException;\n};\n\nexport const createInvocationSpans = (items?: InvocationTraceEvent[]): InvocationSpan[] => {\n if (!items) {\n return [];\n }\n\n const eventsByInvocationId = new Map<string, { start?: InvocationTraceStartEvent; end?: InvocationTraceEndEvent }>();\n for (const event of items) {\n if (!('invocationId' in event)) {\n // Skip legacy format entries.\n continue;\n }\n\n const invocationId = event.invocationId;\n const entry = eventsByInvocationId.get(invocationId) || { start: undefined, end: undefined };\n if (event.type === InvocationTraceEventType.START) {\n entry.start = event as InvocationTraceStartEvent;\n } else if (event.type === InvocationTraceEventType.END) {\n entry.end = event as InvocationTraceEndEvent;\n }\n\n eventsByInvocationId.set(invocationId, entry);\n }\n\n const now = Date.now();\n const result: InvocationSpan[] = [];\n\n // Create spans for each invocation\n for (const [invocationId, { start, end }] of eventsByInvocationId.entries()) {\n if (!start) {\n // No start event, can't create a meaningful span\n log.warn('found end event without matching start', { invocationId });\n continue;\n }\n\n const isInProgress = end === undefined;\n\n result.push({\n id: invocationId,\n timestampMs: start.timestampMs,\n durationMs: isInProgress ? now - start.timestampMs : end!.timestampMs - start.timestampMs,\n outcome: end?.outcome ?? InvocationOutcome.PENDING,\n exception: end?.exception,\n input: start.input,\n invocationTraceQueue: start.invocationTraceQueue,\n invocationTarget: start.invocationTarget,\n trigger: start.trigger,\n });\n }\n\n return result;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema, SchemaAST } from 'effect';\n\nimport { Expando, OptionsAnnotationId, TypedObject, Ref, RawObject } from '@dxos/echo-schema';\nimport { DXN } from '@dxos/keys';\n\nimport { FunctionType } from './schema';\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 enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n Email = 'email',\n Queue = 'queue',\n}\n\nconst kindLiteralAnnotations = { title: 'Kind' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Timer).annotations(kindLiteralAnnotations),\n cron: Schema.String.annotations({\n title: 'Cron',\n [SchemaAST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(Schema.mutable);\nexport type TimerTrigger = Schema.Schema.Type<typeof TimerTriggerSchema>;\n\nconst EmailTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Email).annotations(kindLiteralAnnotations),\n}).pipe(Schema.mutable);\nexport type EmailTrigger = Schema.Schema.Type<typeof EmailTriggerSchema>;\n\nconst QueueTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Queue).annotations(kindLiteralAnnotations),\n queue: DXN.Schema,\n}).pipe(Schema.mutable);\nexport type QueueTrigger = Schema.Schema.Type<typeof QueueTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.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}).pipe(Schema.mutable);\nexport type WebhookTrigger = Schema.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = Schema.Struct({\n type: Schema.optional(Schema.String.annotations({ title: 'Type' })),\n props: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n}).annotations({ title: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = Schema.Struct({\n kind: Schema.Literal(TriggerKind.Subscription).annotations(kindLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\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}).pipe(Schema.mutable);\nexport type SubscriptionTrigger = Schema.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = Schema.Union(\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n EmailTriggerSchema,\n QueueTriggerSchema,\n).annotations({\n title: 'Trigger',\n});\nexport type TriggerType = Schema.Schema.Type<typeof TriggerSchema>;\n\nexport type EventType =\n | EmailTriggerOutput\n | WebhookTriggerOutput\n | QueueTriggerOutput\n | SubscriptionTriggerOutput\n | TimerTriggerOutput;\n\n// TODO(burdon): Reuse trigger schema from @dxos/functions (TriggerType).\nexport const EmailTriggerOutput = Schema.mutable(\n Schema.Struct({\n from: Schema.String,\n to: Schema.String,\n subject: Schema.String,\n created: Schema.String,\n body: Schema.String,\n }),\n);\nexport type EmailTriggerOutput = Schema.Schema.Type<typeof EmailTriggerOutput>;\n\nexport const WebhookTriggerOutput = Schema.mutable(\n 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 }),\n);\nexport type WebhookTriggerOutput = Schema.Schema.Type<typeof WebhookTriggerOutput>;\n\nexport const QueueTriggerOutput = Schema.mutable(\n Schema.Struct({\n queue: DXN.Schema,\n item: Schema.Any,\n cursor: Schema.String,\n }),\n);\nexport type QueueTriggerOutput = Schema.Schema.Type<typeof QueueTriggerOutput>;\n\nexport const SubscriptionTriggerOutput = Schema.mutable(\n Schema.Struct({ type: Schema.String, changedObjectId: Schema.String }),\n);\nexport type SubscriptionTriggerOutput = Schema.Schema.Type<typeof SubscriptionTriggerOutput>;\n\nexport const TimerTriggerOutput = Schema.mutable(Schema.Struct({ tick: Schema.Number }));\nexport type TimerTriggerOutput = Schema.Schema.Type<typeof TimerTriggerOutput>;\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 */\nexport const FunctionTriggerSchema = 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(Expando).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 enabled: Schema.optional(Schema.Boolean.annotations({ title: 'Enabled' })),\n\n spec: Schema.optional(TriggerSchema),\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: '{{$.trigger.event}}',\n * instructions: 'Summarize and perform entity-extraction'\n * mailbox: { '/': 'dxn:echo:AAA:ZZZ' }\n * }\n */\n input: Schema.optional(Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.Any }))),\n});\n\nexport type FunctionTriggerType = Schema.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.2.0',\n})(FunctionTriggerSchema.fields) {}\n\n// TODO(wittjosiah): Remove?\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = Schema.Struct({\n functions: Schema.optional(Schema.mutable(Schema.Array(RawObject(FunctionType)))),\n triggers: Schema.optional(Schema.mutable(Schema.Array(RawObject(FunctionTrigger)))),\n});\nexport type FunctionManifest = Schema.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionType, FunctionTrigger];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ObjectMeta } from '@dxos/echo-schema';\nimport { type SpaceId } from '@dxos/keys';\n\n// TODO: use URL scheme for source?\nconst FUNCTIONS_META_KEY = 'dxos.org/service/function';\n\nexport const FUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';\n\nconst isSecure = (protocol: string) => {\n return protocol === 'https:' || protocol === 'wss:';\n};\n\nexport const getUserFunctionUrlInMetadata = (meta: ObjectMeta) => {\n return meta.keys.find((key) => key.source === FUNCTIONS_META_KEY)?.id;\n};\n\nexport const setUserFunctionUrlInMetadata = (meta: ObjectMeta, functionUrl: string) => {\n const key = meta.keys.find((key) => key.source === FUNCTIONS_META_KEY);\n if (key) {\n if (key.id !== functionUrl) {\n throw new Error('Metadata mismatch');\n }\n } else {\n meta.keys.push({ source: FUNCTIONS_META_KEY, id: functionUrl });\n }\n};\n\n/**\n * NOTE: functionId is backend ID, not ECHO object id.\n */\nexport const makeFunctionUrl = (fn: { functionId: string }) => `/${fn.functionId}`;\n\nexport const getInvocationUrl = (functionUrl: string, edgeUrl: string, options: InvocationOptions = {}) => {\n const baseUrl = new URL('functions/', edgeUrl);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = functionUrl.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n options.spaceId && url.searchParams.set('spaceId', options.spaceId);\n options.subjectId && url.searchParams.set('subjectId', options.subjectId);\n url.protocol = isSecure(url.protocol) ? 'https' : 'http';\n return url.toString();\n};\n\nexport type InvocationOptions = {\n spaceId?: SpaceId;\n subjectId?: string;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Context } from 'effect';\n\nimport type { AIServiceClient } from '@dxos/ai';\n\n// TODO(burdon): Move to @dxos/ai.\nexport class AiService extends Context.Tag('AiService')<\n AiService,\n {\n readonly client: AIServiceClient;\n }\n>() {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Context } from 'effect';\n\nimport type { EchoDatabase } from '@dxos/echo-db';\n\nexport class DatabaseService extends Context.Tag('DatabaseService')<\n DatabaseService,\n {\n readonly db: EchoDatabase;\n }\n>() {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Context } from 'effect';\n\nimport type { Queue, QueueFactory } from '@dxos/echo-db';\n\nexport class QueuesService extends Context.Tag('QueuesService')<\n QueuesService,\n {\n readonly contextQueue: Queue | undefined;\n\n readonly queues: QueueFactory;\n }\n>() {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Context } from 'effect';\n\ntype CredentialQuery = {\n service?: string;\n};\n\n// TODO(dmaretskyi): Unify with other apis.\n// packages/sdk/schema/src/common/access-token.ts\ntype ServiceCredential = {\n service: string;\n\n // TODO(dmaretskyi): Build out.\n apiKey?: string;\n};\n\nexport class CredentialsService extends Context.Tag('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\nexport class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {\n constructor(private readonly credentials: ServiceCredential[] = []) {}\n\n addCredentials(credentials: ServiceCredential[]): ConfiguredCredentialsService {\n this.credentials.push(...credentials);\n return this;\n }\n\n async queryCredentials(query: CredentialQuery): Promise<ServiceCredential[]> {\n return this.credentials.filter((credential) => credential.service === query.service);\n }\n\n async getCredential(query: CredentialQuery): Promise<ServiceCredential> {\n const credential = this.credentials.find((credential) => credential.service === query.service);\n if (!credential) {\n throw new Error(`Credential not found for service: ${query.service}`);\n }\n return credential;\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Context } from 'effect';\n\nimport type { AnyEchoObject } from '@dxos/echo-schema';\n\nexport class TracingService extends Context.Tag('TracingService')<\n TracingService,\n {\n /**\n * Write an event to the tracing queue.\n * @param event - The event to write. Must be an a typed object.\n */\n write(event: AnyEchoObject): void;\n }\n>() {\n static noop: Context.Tag.Service<TracingService> = { write: () => {} };\n\n static console: Context.Tag.Service<TracingService> = {\n write: (event) => {\n // eslint-disable-next-line no-console\n console.log(event);\n },\n };\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Context } from 'effect';\n\nimport { AiService } from './ai';\nimport { CredentialsService } from './credentials';\nimport { DatabaseService } from './database';\nimport { QueuesService } from './queues';\nimport { TracingService } from './tracing';\n\nexport interface Services {\n database: Context.Tag.Service<DatabaseService>;\n ai: Context.Tag.Service<AiService>;\n queues: Context.Tag.Service<QueuesService>;\n credentials: Context.Tag.Service<CredentialsService>;\n tracing: Context.Tag.Service<TracingService>;\n}\n\nconst SERVICE_MAPPING: Record<string, keyof Services> = {\n [DatabaseService.key]: 'database',\n [AiService.key]: 'ai',\n [QueuesService.key]: 'queues',\n [CredentialsService.key]: 'credentials',\n [TracingService.key]: 'tracing',\n};\n\nconst DEFAULT_SERVICES: Partial<Services> = {\n tracing: TracingService.noop,\n};\n\nexport class ServiceContainer {\n private _services: Partial<Services> = { ...DEFAULT_SERVICES };\n\n /**\n * Set services.\n * @param services - Services to set.\n * @returns The container instance.\n */\n setServices(services: Partial<Services>): this {\n this._services = { ...this._services, ...services };\n return this;\n }\n\n getService<T extends Context.Tag<any, any>>(tag: T): Context.Tag.Service<T> {\n const serviceKey = SERVICE_MAPPING[tag.key];\n const service = serviceKey != null ? this._services[serviceKey] : undefined;\n if (!service) {\n throw new Error(`Service not available: ${tag.key}`);\n }\n return service as Context.Tag.Service<T>;\n }\n\n clone(): ServiceContainer {\n return new ServiceContainer().setServices({ ...this._services });\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Effect, Schema } from 'effect';\n\nimport type { SpaceId } from '@dxos/client/echo';\n\nimport type { FunctionContext, FunctionDefinition } from '../handler';\nimport type { ServiceContainer } from '../services';\n\nexport class FunctionExecutor {\n constructor(private readonly _services: ServiceContainer) {}\n\n // TODO(dmaretskyi): Invocation context: queue, space, etc...\n async invoke<F extends FunctionDefinition<any, any>>(\n fnDef: F,\n input: F extends FunctionDefinition<infer I, infer _O> ? I : never,\n ): Promise<F extends FunctionDefinition<infer _I, infer O> ? O : never> {\n // Assert input matches schema\n const assertInput = fnDef.inputSchema.pipe(Schema.asserts);\n (assertInput as any)(input);\n\n const context: FunctionContext = {\n getService: this._services.getService.bind(this._services),\n getSpace: async (_spaceId: SpaceId) => {\n throw new Error('Not available. Use the database service instead.');\n },\n space: undefined,\n get ai(): never {\n throw new Error('Not available. Use the ai service instead.');\n },\n };\n\n const result = await fnDef.handler({ context, data: input });\n\n // Assert output matches schema\n const assertOutput = fnDef.outputSchema?.pipe(Schema.asserts);\n (assertOutput as any)(result);\n\n if (Effect.isEffect(result)) {\n return Effect.runPromise(result as any);\n }\n\n return result as any;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAyC;AA8F3C,IAAMC,iBAAiB,CAAOC,WAAAA;AACnC,MAAI,CAACC,OAAOC,SAASF,OAAOG,WAAW,GAAG;AACxC,UAAM,IAAIC,MAAM,qCAAA;EAClB;AACA,MAAI,OAAOJ,OAAOK,YAAY,YAAY;AACxC,UAAM,IAAID,MAAM,4BAAA;EAClB;AAEA,SAAO;IACLE,aAAaN,OAAOM;IACpBH,aAAaH,OAAOG;IACpBI,cAAcP,OAAOO,gBAAgBN,OAAOO;IAC5CH,SAASL,OAAOK;EAClB;AACF;;;AC5GA,SAASI,UAAAA,eAAc;AAEvB,SAASC,YAAYC,gBAAgBC,iBAAiBC,KAAKC,mBAAmB;AAC9E,SAASC,gBAAgB;AAKlB,IAAMC,aAAaC,QAAOC,OAAO;EACtCC,MAAMF,QAAOG,SAASH,QAAOI,MAAM;EACnCC,aAAaL,QAAOG,SAASH,QAAOI,MAAM;;;EAG1CE,SAASN,QAAOG,SAASH,QAAOO,OAAO;EACvCC,QAAQC,IAAIC,SAASC,IAAI;AAC3B,CAAA,EAAGC,KACDC,WAAW;EACTC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBC,IAAI;EAAC;CAA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AAA;MAClB;MACAC,OAAOC;MACP,IAAIC,KAAY;AACd,cAAM,IAAIH,MAAM,4CAAA;MAClB;IACF;AAEA,UAAMI,SAAS,MAAMhB,MAAMiB,QAAQ;MAAEV;MAASW,MAAMjB;IAAM,CAAA;AAG1D,UAAMkB,eAAenB,MAAMoB,cAAchB,KAAKC,QAAOC,OAAO;AAC3Da,iBAAqBH,MAAAA;AAEtB,QAAIK,OAAOC,SAASN,MAAAA,GAAS;AAC3B,aAAOK,OAAOE,WAAWP,MAAAA;IAC3B;AAEA,WAAOA;EACT;AACF;",
|
|
6
|
+
"names": ["Schema", "defineFunction", "params", "Schema", "isSchema", "inputSchema", "Error", "handler", "description", "outputSchema", "Any", "Schema", "EchoObject", "JsonSchemaType", "LabelAnnotation", "Ref", "TypedObject", "DataType", "ScriptType", "Schema", "Struct", "name", "optional", "String", "description", "changed", "Boolean", "source", "Ref", "DataType", "Text", "pipe", "EchoObject", "typename", "version", "LabelAnnotation", "set", "FunctionType", "TypedObject", "NonEmptyString", "inputSchema", "JsonSchemaType", "outputSchema", "binding", "Schema", "Queue", "EchoObject", "Expando", "ObjectId", "Ref", "log", "Schema", "SchemaAST", "Expando", "OptionsAnnotationId", "TypedObject", "Ref", "RawObject", "DXN", "TriggerKind", "kindLiteralAnnotations", "title", "TimerTriggerSchema", "Schema", "Struct", "kind", "Literal", "annotations", "cron", "String", "SchemaAST", "ExamplesAnnotationId", "pipe", "mutable", "EmailTriggerSchema", "QueueTriggerSchema", "queue", "DXN", "WebhookTriggerSchema", "method", "optional", "OptionsAnnotationId", "port", "Number", "QuerySchema", "type", "props", "Record", "key", "value", "Any", "SubscriptionTriggerSchema", "filter", "options", "deep", "Boolean", "delay", "TriggerSchema", "Union", "EmailTriggerOutput", "from", "to", "subject", "created", "body", "WebhookTriggerOutput", "url", "headers", "bodyText", "QueueTriggerOutput", "item", "cursor", "SubscriptionTriggerOutput", "changedObjectId", "TimerTriggerOutput", "tick", "FunctionTriggerSchema", "function", "Ref", "Expando", "inputNodeId", "enabled", "spec", "input", "FunctionTrigger", "TypedObject", "typename", "version", "fields", "FunctionManifestSchema", "functions", "Array", "RawObject", "FunctionType", "triggers", "FUNCTION_TYPES", "InvocationOutcome", "InvocationTraceEventType", "TraceEventException", "Schema", "Struct", "timestampMs", "Number", "message", "String", "name", "stack", "optional", "InvocationTraceStartEvent", "id", "ObjectId", "type", "Literal", "invocationId", "input", "Object", "invocationTraceQueue", "Ref", "Queue", "invocationTarget", "Expando", "trigger", "FunctionTrigger", "pipe", "EchoObject", "typename", "version", "InvocationTraceEndEvent", "outcome", "Enums", "exception", "TraceEventLog", "level", "context", "TraceEvent", "truncated", "Boolean", "ingestionTimestampMs", "logs", "Array", "exceptions", "createInvocationSpans", "items", "eventsByInvocationId", "Map", "event", "entry", "get", "start", "undefined", "end", "set", "now", "Date", "result", "entries", "log", "warn", "isInProgress", "push", "durationMs", "FUNCTIONS_META_KEY", "FUNCTIONS_PRESET_META_KEY", "isSecure", "protocol", "getUserFunctionUrlInMetadata", "meta", "keys", "find", "key", "source", "id", "setUserFunctionUrlInMetadata", "functionUrl", "Error", "push", "makeFunctionUrl", "fn", "functionId", "getInvocationUrl", "edgeUrl", "options", "baseUrl", "URL", "relativeUrl", "replace", "url", "toString", "spaceId", "searchParams", "set", "subjectId", "Context", "AiService", "Context", "Tag", "Context", "DatabaseService", "Context", "Tag", "Context", "QueuesService", "Context", "Tag", "Context", "CredentialsService", "Context", "Tag", "ConfiguredCredentialsService", "credentials", "addCredentials", "push", "queryCredentials", "query", "filter", "credential", "service", "getCredential", "find", "Error", "Context", "TracingService", "Context", "Tag", "noop", "write", "console", "event", "log", "SERVICE_MAPPING", "DatabaseService", "key", "AiService", "QueuesService", "CredentialsService", "TracingService", "DEFAULT_SERVICES", "tracing", "noop", "ServiceContainer", "_services", "setServices", "services", "getService", "tag", "serviceKey", "service", "undefined", "Error", "clone", "Effect", "Schema", "FunctionExecutor", "_services", "invoke", "fnDef", "input", "assertInput", "inputSchema", "pipe", "Schema", "asserts", "context", "getService", "bind", "getSpace", "_spaceId", "Error", "space", "undefined", "ai", "result", "handler", "data", "assertOutput", "outputSchema", "Effect", "isEffect", "runPromise"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30383,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":502,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":6587,"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/edge/index.ts":{"bytes":501,"imports":[{"path":"packages/core/functions/src/edge/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/core/functions/src/types/schema.ts":{"bytes":4797,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/types.ts":{"bytes":16679,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/trace.ts":{"bytes":16307,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/types/url.ts":{"bytes":5599,"imports":[],"format":"esm"},"packages/core/functions/src/types/index.ts":{"bytes":740,"imports":[{"path":"packages/core/functions/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/types/trace.ts","kind":"import-statement","original":"./trace"},{"path":"packages/core/functions/src/types/url.ts","kind":"import-statement","original":"./url"}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":13004,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","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":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/function/index.ts":{"bytes":529,"imports":[{"path":"packages/core/functions/src/function/function-registry.ts","kind":"import-statement","original":"./function-registry"}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":14030,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytes":10314,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytes":4673,"imports":[{"path":"cron-schedule","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/index.ts":{"bytes":751,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":28465,"imports":[{"path":"@dxos/async","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-schema","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":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":603,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":920,"imports":[{"path":"packages/core/functions/src/edge/index.ts","kind":"import-statement","original":"./edge"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":28958,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","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":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":21200,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","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-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":598,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"}],"format":"esm"},"packages/core/functions/src/testing/setup.ts":{"bytes":12707,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"../function"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"../runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"../trigger"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4310,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/node-esm/bundler/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14437},"packages/core/functions/dist/lib/node-esm/bundler/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Bundler","initializeBundler"],"entryPoint":"packages/core/functions/src/bundler/index.ts","inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytesInOutput":7125},"packages/core/functions/src/bundler/index.ts":{"bytesInOutput":0}},"bytes":7378},"packages/core/functions/dist/lib/node-esm/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/edge/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-O2SXVYU5.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{},"bytes":342},"packages/core/functions/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7894},"packages/core/functions/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-O2SXVYU5.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-SQSJO5HI.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-HBD2FZXO.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerRegistry","TriggerSchema","createInvocationSpans","createSubscriptionTrigger","createTimerTrigger","defineFunction","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","subscriptionHandler","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":2076}},"bytes":3682},"packages/core/functions/dist/lib/node-esm/chunk-O2SXVYU5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3277},"packages/core/functions/dist/lib/node-esm/chunk-O2SXVYU5.mjs":{"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":1654},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":1918},"packages/core/functions/dist/lib/node-esm/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32290},"packages/core/functions/dist/lib/node-esm/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-SQSJO5HI.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-HBD2FZXO.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","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":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","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-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"exports":["TestType","createFunctionRuntime","createInitializedClients","inviteMember","startFunctionsHost","testFunctionManifest","triggerWebhook"],"entryPoint":"packages/core/functions/src/testing/index.ts","inputs":{"packages/core/functions/src/testing/setup.ts":{"bytesInOutput":2775},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7860},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":5364},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1067},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":18237},"packages/core/functions/dist/lib/node-esm/chunk-SQSJO5HI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27170},"packages/core/functions/dist/lib/node-esm/chunk-SQSJO5HI.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-HBD2FZXO.mjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","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/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron-schedule","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","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-schema","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}],"exports":["FunctionRegistry","TriggerRegistry","createSubscriptionTrigger","createTimerTrigger"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":3046},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2007},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":1086},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":7538},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":14241},"packages/core/functions/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-HBD2FZXO.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","createInvocationSpans","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"entryPoint":"packages/core/functions/src/types/index.ts","inputs":{},"bytes":1134},"packages/core/functions/dist/lib/node-esm/chunk-HBD2FZXO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22238},"packages/core/functions/dist/lib/node-esm/chunk-HBD2FZXO.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","createInvocationSpans","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"inputs":{"packages/core/functions/src/types/schema.ts":{"bytesInOutput":1084},"packages/core/functions/src/types/index.ts":{"bytesInOutput":0},"packages/core/functions/src/types/types.ts":{"bytesInOutput":3699},"packages/core/functions/src/types/trace.ts":{"bytesInOutput":4133},"packages/core/functions/src/types/url.ts":{"bytesInOutput":1138}},"bytes":10851},"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs":{"imports":[],"exports":["__require"],"inputs":{},"bytes":526}}}
|
|
1
|
+
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30207,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":470,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":6609,"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/edge/index.ts":{"bytes":877,"imports":[{"path":"packages/core/functions/src/edge/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":6306,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/schema.ts":{"bytes":5008,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types.ts":{"bytes":21482,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/functions/src/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"},"packages/core/functions/src/trace.ts":{"bytes":16661,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/url.ts":{"bytes":6002,"imports":[],"format":"esm"},"packages/core/functions/src/services/ai.ts":{"bytes":1000,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/services/database.ts":{"bytes":951,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/services/queues.ts":{"bytes":1013,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/services/credentials.ts":{"bytes":4258,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/services/tracing.ts":{"bytes":1894,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/services/service-container.ts":{"bytes":5446,"imports":[{"path":"packages/core/functions/src/services/ai.ts","kind":"import-statement","original":"./ai"},{"path":"packages/core/functions/src/services/credentials.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/functions/src/services/database.ts","kind":"import-statement","original":"./database"},{"path":"packages/core/functions/src/services/queues.ts","kind":"import-statement","original":"./queues"},{"path":"packages/core/functions/src/services/tracing.ts","kind":"import-statement","original":"./tracing"}],"format":"esm"},"packages/core/functions/src/services/index.ts":{"bytes":927,"imports":[{"path":"packages/core/functions/src/services/ai.ts","kind":"import-statement","original":"./ai"},{"path":"packages/core/functions/src/services/database.ts","kind":"import-statement","original":"./database"},{"path":"packages/core/functions/src/services/queues.ts","kind":"import-statement","original":"./queues"},{"path":"packages/core/functions/src/services/service-container.ts","kind":"import-statement","original":"./service-container"},{"path":"packages/core/functions/src/services/credentials.ts","kind":"import-statement","original":"./credentials"},{"path":"packages/core/functions/src/services/tracing.ts","kind":"import-statement","original":"./tracing"}],"format":"esm"},"packages/core/functions/src/executor/executor.ts":{"bytes":4794,"imports":[{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/executor/index.ts":{"bytes":472,"imports":[{"path":"packages/core/functions/src/executor/executor.ts","kind":"import-statement","original":"./executor"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":1022,"imports":[{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/core/functions/src/trace.ts","kind":"import-statement","original":"./trace"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/url.ts","kind":"import-statement","original":"./url"},{"path":"packages/core/functions/src/services/index.ts","kind":"import-statement","original":"./services"},{"path":"packages/core/functions/src/executor/index.ts","kind":"import-statement","original":"./executor"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/node-esm/bundler/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14574},"packages/core/functions/dist/lib/node-esm/bundler/index.mjs":{"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Bundler","initializeBundler"],"entryPoint":"packages/core/functions/src/bundler/index.ts","inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytesInOutput":7125},"packages/core/functions/src/bundler/index.ts":{"bytesInOutput":0}},"bytes":7346},"packages/core/functions/dist/lib/node-esm/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3363},"packages/core/functions/dist/lib/node-esm/edge/index.mjs":{"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":1692},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":1946},"packages/core/functions/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":39163},"packages/core/functions/dist/lib/node-esm/index.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"exports":["AiService","ConfiguredCredentialsService","CredentialsService","DatabaseService","EmailTriggerOutput","FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionExecutor","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","QueueTriggerOutput","QueuesService","ScriptType","ServiceContainer","SubscriptionTriggerOutput","TimerTriggerOutput","TraceEvent","TraceEventException","TraceEventLog","TracingService","TriggerKind","TriggerSchema","WebhookTriggerOutput","createInvocationSpans","defineFunction","getInvocationUrl","getUserFunctionUrlInMetadata","makeFunctionUrl","setUserFunctionUrlInMetadata"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/handler.ts":{"bytesInOutput":453},"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/schema.ts":{"bytesInOutput":1212},"packages/core/functions/src/trace.ts":{"bytesInOutput":4282},"packages/core/functions/src/types.ts":{"bytesInOutput":4749},"packages/core/functions/src/url.ts":{"bytesInOutput":1189},"packages/core/functions/src/services/ai.ts":{"bytesInOutput":96},"packages/core/functions/src/services/index.ts":{"bytesInOutput":0},"packages/core/functions/src/services/database.ts":{"bytesInOutput":121},"packages/core/functions/src/services/queues.ts":{"bytesInOutput":117},"packages/core/functions/src/services/credentials.ts":{"bytesInOutput":737},"packages/core/functions/src/services/tracing.ts":{"bytesInOutput":293},"packages/core/functions/src/services/service-container.ts":{"bytesInOutput":967},"packages/core/functions/src/executor/executor.ts":{"bytesInOutput":949},"packages/core/functions/src/executor/index.ts":{"bytesInOutput":0}},"bytes":16688}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../../src/bundler/bundler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAqB,KAAK,WAAW,EAAe,MAAM,cAAc,CAAC;AAMhF,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,E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MAAM,CAAA;CAAE,kBAInE,CAAC;AAEF;;GAEG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,cAAc;IAE/C,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAwFpE,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE;IA2B7C,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG;QACtC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;KAChB,EAAE;CAaJ"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type DID } from 'iso-did/types';
|
|
2
2
|
import { type Client } from '@dxos/client';
|
|
3
|
-
import type { PublicKey
|
|
3
|
+
import type { PublicKey } from '@dxos/keys';
|
|
4
4
|
import { type UploadFunctionResponseBody } from '@dxos/protocols';
|
|
5
5
|
export type UploadWorkerArgs = {
|
|
6
6
|
client: Client;
|
|
7
|
-
spaceId: SpaceId;
|
|
8
7
|
source: string;
|
|
9
8
|
version: string;
|
|
10
9
|
name?: string;
|
|
11
10
|
functionId?: string;
|
|
11
|
+
ownerPublicKey: PublicKey;
|
|
12
12
|
};
|
|
13
|
-
export declare const uploadWorkerFunction: ({ client,
|
|
13
|
+
export declare const uploadWorkerFunction: ({ client, version, source, name, functionId, ownerPublicKey, }: UploadWorkerArgs) => Promise<UploadFunctionResponseBody>;
|
|
14
14
|
export declare const incrementSemverPatch: (version: string) => string;
|
|
15
15
|
export declare const publicKeyToDid: (key: PublicKey) => DID;
|
|
16
16
|
//# sourceMappingURL=functions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../src/edge/functions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../src/edge/functions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,gEAOxC,gBAAgB,KAAG,OAAO,CAAC,0BAA0B,CAqBvD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,MAKtD,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,KAAK,SAAS,KAAG,GAE/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/edge/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/edge/index.ts"],"names":[],"mappings":"AAQA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FunctionDefinition } from '../handler';
|
|
2
|
+
import type { ServiceContainer } from '../services';
|
|
3
|
+
export declare class FunctionExecutor {
|
|
4
|
+
private readonly _services;
|
|
5
|
+
constructor(_services: ServiceContainer);
|
|
6
|
+
invoke<F extends FunctionDefinition<any, any>>(fnDef: F, input: F extends FunctionDefinition<infer I, infer _O> ? I : never): Promise<F extends FunctionDefinition<infer _I, infer O> ? O : never>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/executor/executor.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,gBAAgB;IAGlD,MAAM,CAAC,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,EACjD,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,CAAC,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,GACjE,OAAO,CAAC,CAAC,SAAS,kBAAkB,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CA4BxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/executor/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
|
|
@@ -1,62 +1,43 @@
|
|
|
1
|
-
import { Schema
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
import { type Space, type SpaceId } from '@dxos/client/echo';
|
|
5
|
-
import type { CoreDatabase, EchoDatabase, ReactiveEchoObject } from '@dxos/echo-db';
|
|
1
|
+
import { Schema, type Context, type Effect } from 'effect';
|
|
2
|
+
import { type AIServiceClient } from '@dxos/ai';
|
|
3
|
+
import type { CoreDatabase, EchoDatabase } from '@dxos/echo-db';
|
|
6
4
|
import { type HasId } from '@dxos/echo-schema';
|
|
7
|
-
import { type DXN } from '@dxos/keys';
|
|
5
|
+
import { type SpaceId, type DXN } from '@dxos/keys';
|
|
8
6
|
import { type QueryResult } from '@dxos/protocols';
|
|
9
7
|
/**
|
|
10
8
|
* Function handler.
|
|
11
9
|
*/
|
|
12
|
-
export type FunctionHandler<TData = {},
|
|
10
|
+
export type FunctionHandler<TData = {}, TOutput = any> = (params: {
|
|
11
|
+
/**
|
|
12
|
+
* Services and context available to the function.
|
|
13
|
+
*/
|
|
13
14
|
context: FunctionContext;
|
|
14
|
-
event: FunctionEvent<TData, TMeta>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Data passed as the input to the function.
|
|
17
|
+
* Must match the function's input schema.
|
|
18
|
+
* This will be the payload from the trigger or other data passed into the function in a workflow.
|
|
17
19
|
*/
|
|
18
|
-
|
|
20
|
+
data: TData;
|
|
19
21
|
}) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any>;
|
|
20
22
|
/**
|
|
21
23
|
* Function context.
|
|
22
24
|
*/
|
|
23
25
|
export interface FunctionContext {
|
|
26
|
+
/**
|
|
27
|
+
* Resolves a service available to the function.
|
|
28
|
+
* @throws if the service is not available.
|
|
29
|
+
*/
|
|
30
|
+
getService: <T extends Context.Tag<any, any>>(tag: T) => Context.Tag.Service<T>;
|
|
24
31
|
getSpace: (spaceId: SpaceId) => Promise<SpaceAPI>;
|
|
25
32
|
/**
|
|
26
33
|
* Space from which the function was invoked.
|
|
27
34
|
*/
|
|
28
35
|
space: SpaceAPI | undefined;
|
|
29
|
-
ai:
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated
|
|
32
|
-
*/
|
|
33
|
-
client: Client;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
37
|
-
dataDir?: string;
|
|
36
|
+
ai: AIServiceClient;
|
|
38
37
|
}
|
|
39
38
|
export interface FunctionContextAi {
|
|
40
39
|
run(model: string, inputs: any, options?: any): Promise<any>;
|
|
41
40
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Event payload.
|
|
44
|
-
*/
|
|
45
|
-
export type FunctionEvent<TData = {}, TMeta = {}> = {
|
|
46
|
-
data: FunctionEventMeta<TMeta> & TData;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Metadata from trigger.
|
|
50
|
-
*/
|
|
51
|
-
export type FunctionEventMeta<TMeta = {}> = {
|
|
52
|
-
meta: TMeta;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Function response.
|
|
56
|
-
*/
|
|
57
|
-
export type FunctionResponse = {
|
|
58
|
-
status(code: number): FunctionResponse;
|
|
59
|
-
};
|
|
60
41
|
export interface QueuesAPI {
|
|
61
42
|
queryQueue(queue: DXN, options?: {}): Promise<QueryResult>;
|
|
62
43
|
insertIntoQueue(queue: DXN, objects: HasId[]): Promise<void>;
|
|
@@ -73,36 +54,11 @@ export interface SpaceAPI {
|
|
|
73
54
|
get db(): EchoDatabase;
|
|
74
55
|
get queues(): QueuesAPI;
|
|
75
56
|
}
|
|
76
|
-
export type FunctionDefinition = {
|
|
57
|
+
export type FunctionDefinition<T = {}, O = any> = {
|
|
77
58
|
description?: string;
|
|
78
|
-
inputSchema:
|
|
79
|
-
outputSchema?:
|
|
80
|
-
handler: FunctionHandler<
|
|
59
|
+
inputSchema: Schema.Schema<T, any>;
|
|
60
|
+
outputSchema?: Schema.Schema<O, any>;
|
|
61
|
+
handler: FunctionHandler<T, O>;
|
|
81
62
|
};
|
|
82
|
-
export
|
|
83
|
-
description?: string;
|
|
84
|
-
inputSchema: S.Schema<T, any>;
|
|
85
|
-
outputSchema?: S.Schema<O, any>;
|
|
86
|
-
handler: FunctionHandler<T, any, O>;
|
|
87
|
-
};
|
|
88
|
-
export declare const defineFunction: <T, O>(params: DefineFunctionParams<T, O>) => FunctionDefinition;
|
|
89
|
-
export type RawSubscriptionData = {
|
|
90
|
-
spaceKey?: string;
|
|
91
|
-
objects?: string[];
|
|
92
|
-
};
|
|
93
|
-
export type SubscriptionData = {
|
|
94
|
-
space?: Space;
|
|
95
|
-
objects?: ReactiveEchoObject<any>[];
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Handler wrapper for subscription events; extracts space and objects.
|
|
99
|
-
*
|
|
100
|
-
* To test:
|
|
101
|
-
* ```
|
|
102
|
-
* curl -s -X POST -H "Content-Type: application/json" --data '{"space": "0446...1cbb"}' http://localhost:7100/dev/email-extractor
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
* NOTE: Get space key from devtools or `dx space list --json`
|
|
106
|
-
*/
|
|
107
|
-
export declare const subscriptionHandler: <TMeta>(handler: FunctionHandler<SubscriptionData, TMeta>, types?: S.Schema.AnyNoContext[]) => FunctionHandler<RawSubscriptionData, TMeta>;
|
|
63
|
+
export declare const defineFunction: <T, O>(params: FunctionDefinition<T, O>) => FunctionDefinition<T, O>;
|
|
108
64
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE3D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,OAAO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IACvB,IAAI,EAAE,IAAI,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,IAAI,IAAI,YAAY,CAAC;IACzB,IAAI,EAAE,IAAI,YAAY,CAAC;IAEvB,IAAI,MAAM,IAAI,SAAS,CAAC;CACzB;AAOD,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAChC,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAc9F,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export * from './edge';
|
|
2
|
-
export * from './function';
|
|
3
1
|
export * from './handler';
|
|
4
|
-
export * from './
|
|
2
|
+
export * from './schema';
|
|
3
|
+
export * from './trace';
|
|
5
4
|
export * from './types';
|
|
5
|
+
export * from './url';
|
|
6
|
+
export * from './services';
|
|
7
|
+
export * from './executor';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { JsonSchemaType, Ref } from '@dxos/echo-schema';
|
|
3
|
+
/**
|
|
4
|
+
* Source script.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ScriptType: import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
|
|
7
|
+
name: Schema.optional<typeof Schema.String>;
|
|
8
|
+
description: Schema.optional<typeof Schema.String>;
|
|
9
|
+
changed: Schema.optional<typeof Schema.Boolean>;
|
|
10
|
+
source: import("@dxos/echo-schema").Ref$<{
|
|
11
|
+
readonly id: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}>;
|
|
14
|
+
}>, {}>;
|
|
15
|
+
export type ScriptType = Schema.Schema.Type<typeof ScriptType>;
|
|
16
|
+
declare const FunctionType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
17
|
+
name: typeof Schema.NonEmptyString;
|
|
18
|
+
version: typeof Schema.String;
|
|
19
|
+
description: Schema.optional<typeof Schema.String>;
|
|
20
|
+
source: Schema.optional<import("@dxos/echo-schema").Ref$<{
|
|
21
|
+
readonly id: string;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
changed?: boolean | undefined;
|
|
25
|
+
source: Ref<{
|
|
26
|
+
readonly id: string;
|
|
27
|
+
content: string;
|
|
28
|
+
}>;
|
|
29
|
+
}>>;
|
|
30
|
+
inputSchema: Schema.optional<Schema.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
31
|
+
outputSchema: Schema.optional<Schema.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
32
|
+
binding: Schema.optional<typeof Schema.String>;
|
|
33
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<{
|
|
34
|
+
name: typeof Schema.NonEmptyString;
|
|
35
|
+
version: typeof Schema.String;
|
|
36
|
+
description: Schema.optional<typeof Schema.String>;
|
|
37
|
+
source: Schema.optional<import("@dxos/echo-schema").Ref$<{
|
|
38
|
+
readonly id: string;
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
description?: string | undefined;
|
|
41
|
+
changed?: boolean | undefined;
|
|
42
|
+
source: Ref<{
|
|
43
|
+
readonly id: string;
|
|
44
|
+
content: string;
|
|
45
|
+
}>;
|
|
46
|
+
}>>;
|
|
47
|
+
inputSchema: Schema.optional<Schema.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
48
|
+
outputSchema: Schema.optional<Schema.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
49
|
+
binding: Schema.optional<typeof Schema.String>;
|
|
50
|
+
}>>;
|
|
51
|
+
/**
|
|
52
|
+
* Function deployment.
|
|
53
|
+
*/
|
|
54
|
+
export declare class FunctionType extends FunctionType_base {
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAc,cAAc,EAAmB,GAAG,EAAe,MAAM,mBAAmB,CAAC;AAGlG;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;OAatB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/D;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAmBhC;CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import type { AIServiceClient } from '@dxos/ai';
|
|
3
|
+
declare const AiService_base: Context.TagClass<AiService, "AiService", {
|
|
4
|
+
readonly client: AIServiceClient;
|
|
5
|
+
}>;
|
|
6
|
+
export declare class AiService extends AiService_base {
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../../../src/services/ai.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;;qBAM3B,eAAe;;AAHpC,qBAAa,SAAU,SAAQ,cAK5B;CAAG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
type CredentialQuery = {
|
|
3
|
+
service?: string;
|
|
4
|
+
};
|
|
5
|
+
type ServiceCredential = {
|
|
6
|
+
service: string;
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const CredentialsService_base: Context.TagClass<CredentialsService, "CredentialsService", {
|
|
10
|
+
/**
|
|
11
|
+
* Query all.
|
|
12
|
+
*/
|
|
13
|
+
queryCredentials: (query: CredentialQuery) => Promise<ServiceCredential[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a single credential.
|
|
16
|
+
* @throws {Error} If no credential is found.
|
|
17
|
+
*/
|
|
18
|
+
getCredential: (query: CredentialQuery) => Promise<ServiceCredential>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare class CredentialsService extends CredentialsService_base {
|
|
21
|
+
}
|
|
22
|
+
export declare class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {
|
|
23
|
+
private readonly credentials;
|
|
24
|
+
constructor(credentials?: ServiceCredential[]);
|
|
25
|
+
addCredentials(credentials: ServiceCredential[]): ConfiguredCredentialsService;
|
|
26
|
+
queryCredentials(query: CredentialQuery): Promise<ServiceCredential[]>;
|
|
27
|
+
getCredential(query: CredentialQuery): Promise<ServiceCredential>;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAGhB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;;IAKE;;OAEG;sBACe,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAE1E;;;OAGG;mBACY,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,iBAAiB,CAAC;;AAZzE,qBAAa,kBAAmB,SAAQ,uBAcrC;CAAG;AAEN,qBAAa,4BAA6B,YAAW,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAC9E,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,GAAE,iBAAiB,EAAO;IAElE,cAAc,CAAC,WAAW,EAAE,iBAAiB,EAAE,GAAG,4BAA4B;IAKxE,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAItE,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAOxE"}
|