@dxos/functions 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0
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/README.md +4 -6
- package/dist/lib/neutral/Trace.mjs +38 -0
- package/dist/lib/neutral/Trace.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5T7GOX2V.mjs +149 -0
- package/dist/lib/neutral/chunk-5T7GOX2V.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IVDUS56O.mjs +49 -0
- package/dist/lib/neutral/chunk-IVDUS56O.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/fib-N45KAC7C.mjs +23 -0
- package/dist/lib/neutral/fib-N45KAC7C.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1266 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/reply-EUEPKNJF.mjs +19 -0
- package/dist/lib/neutral/reply-EUEPKNJF.mjs.map +7 -0
- package/dist/lib/neutral/sleep-PUK3D4FF.mjs +15 -0
- package/dist/lib/neutral/sleep-PUK3D4FF.mjs.map +7 -0
- package/dist/types/src/Trace.d.ts +155 -0
- package/dist/types/src/Trace.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +24 -32
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/example/definitions.d.ts +11 -0
- package/dist/types/src/example/definitions.d.ts.map +1 -0
- package/dist/types/src/example/fib.d.ts +3 -2
- package/dist/types/src/example/fib.d.ts.map +1 -1
- package/dist/types/src/example/index.d.ts +3 -11
- package/dist/types/src/example/index.d.ts.map +1 -1
- package/dist/types/src/example/reply.d.ts +2 -1
- package/dist/types/src/example/reply.d.ts.map +1 -1
- package/dist/types/src/example/sleep.d.ts +3 -2
- package/dist/types/src/example/sleep.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/process/Process.d.ts +247 -0
- package/dist/types/src/process/Process.d.ts.map +1 -0
- package/dist/types/src/process/ServiceResolver.d.ts +74 -0
- package/dist/types/src/process/ServiceResolver.d.ts.map +1 -0
- package/dist/types/src/process/StorageService.d.ts +58 -0
- package/dist/types/src/process/StorageService.d.ts.map +1 -0
- package/dist/types/src/protocol/functions-ai-http-client.d.ts +12 -0
- package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -0
- package/dist/types/src/protocol/protocol.d.ts +2 -2
- package/dist/types/src/protocol/protocol.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts +4 -79
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/services/credentials.d.ts +6 -4
- package/dist/types/src/services/credentials.d.ts.map +1 -1
- package/dist/types/src/services/event-logger.d.ts +25 -31
- package/dist/types/src/services/event-logger.d.ts.map +1 -1
- package/dist/types/src/services/function-invocation-service.d.ts +9 -3
- package/dist/types/src/services/function-invocation-service.d.ts.map +1 -1
- package/dist/types/src/services/index.d.ts +0 -1
- package/dist/types/src/services/index.d.ts.map +1 -1
- package/dist/types/src/services/queues.d.ts +8 -5
- package/dist/types/src/services/queues.d.ts.map +1 -1
- package/dist/types/src/services/tracing.d.ts +61 -4
- package/dist/types/src/services/tracing.d.ts.map +1 -1
- package/dist/types/src/types/Script.d.ts +10 -16
- package/dist/types/src/types/Script.d.ts.map +1 -1
- package/dist/types/src/types/Trigger.d.ts +57 -76
- package/dist/types/src/types/Trigger.d.ts.map +1 -1
- package/dist/types/src/types/TriggerEvent.d.ts +44 -13
- package/dist/types/src/types/TriggerEvent.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/url.d.ts +6 -5
- package/dist/types/src/types/url.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -17
- package/src/Trace.ts +202 -0
- package/src/errors.ts +5 -5
- package/src/example/definitions.ts +49 -0
- package/src/example/fib.ts +15 -24
- package/src/example/forex-effect.ts +1 -1
- package/src/example/index.ts +7 -8
- package/src/example/reply.ts +11 -13
- package/src/example/sleep.ts +9 -16
- package/src/index.ts +4 -0
- package/src/process/Process.ts +486 -0
- package/src/process/ServiceResolver.ts +174 -0
- package/src/process/StorageService.ts +99 -0
- package/src/protocol/functions-ai-http-client.ts +67 -0
- package/src/protocol/protocol.test.ts +0 -1
- package/src/protocol/protocol.ts +206 -84
- package/src/sdk.ts +7 -194
- package/src/services/credentials.ts +31 -15
- package/src/services/event-logger.ts +2 -2
- package/src/services/function-invocation-service.ts +19 -3
- package/src/services/index.ts +0 -2
- package/src/services/queues.ts +15 -8
- package/src/services/tracing.ts +97 -5
- package/src/types/Script.ts +14 -9
- package/src/types/Trigger.ts +33 -18
- package/src/types/TriggerEvent.ts +29 -29
- package/src/types/index.ts +0 -1
- package/src/types/url.ts +6 -5
- package/dist/lib/browser/index.mjs +0 -927
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/index.mjs +0 -928
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/src/types/Function.d.ts +0 -58
- package/dist/types/src/types/Function.d.ts.map +0 -1
- package/src/types/Function.ts +0 -62
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageService.d.ts","sourceRoot":"","sources":["../../../../src/process/StorageService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC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,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;CACtD;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,GACrB,CAAC,EAAE,YAAY,MAAM,OAAO,CAAC,CAAC,CAAC,MAC/B,KAAK,GAAG,CAAC,CAAC,CAAC,KAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAUjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as HttpClient from '@effect/platform/HttpClient';
|
|
2
|
+
import * as Layer from 'effect/Layer';
|
|
3
|
+
import { type EdgeFunctionEnv } from '@dxos/protocols';
|
|
4
|
+
/**
|
|
5
|
+
* Copy pasted from https://github.com/Effect-TS/effect/blob/main/packages/platform/src/internal/fetchHttpClient.ts
|
|
6
|
+
*/
|
|
7
|
+
export declare const requestInitTagKey = "@effect/platform/FetchHttpClient/FetchOptions";
|
|
8
|
+
export declare class FunctionsAiHttpClient {
|
|
9
|
+
static make: (service: EdgeFunctionEnv.FunctionsAiService) => HttpClient.HttpClient;
|
|
10
|
+
static layer: (service: EdgeFunctionEnv.FunctionsAiService) => Layer.Layer<HttpClient.HttpClient, never, never>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=functions-ai-http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions-ai-http-client.d.ts","sourceRoot":"","sources":["../../../../src/protocol/functions-ai-http-client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAK1D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,KAAK,eAAe,EAAc,MAAM,iBAAiB,CAAC;AACnE;;GAEG;AACH,eAAO,MAAM,iBAAiB,kDAAkD,CAAC;AAEjF,qBAAa,qBAAqB;IAChC,MAAM,CAAC,IAAI,GAAI,SAAS,eAAe,CAAC,kBAAkB,2BAyCrD;IAEL,MAAM,CAAC,KAAK,GAAI,SAAS,eAAe,CAAC,kBAAkB,sDACiB;CAC7E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Operation } from '@dxos/operation';
|
|
1
2
|
import { type FunctionProtocol } from '@dxos/protocols';
|
|
2
|
-
import { FunctionDefinition } from '../sdk';
|
|
3
3
|
/**
|
|
4
4
|
* Wraps a function handler made with `defineFunction` to a protocol that the functions-runtime expects.
|
|
5
5
|
*/
|
|
6
|
-
export declare const wrapFunctionHandler: (func:
|
|
6
|
+
export declare const wrapFunctionHandler: (func: Operation.WithHandler<Operation.Definition.Any>) => FunctionProtocol.Func;
|
|
7
7
|
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../src/protocol/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../src/protocol/protocol.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAQxD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,KAAG,gBAAgB,CAAC,IAwE5G,CAAC"}
|
package/dist/types/src/sdk.d.ts
CHANGED
|
@@ -1,89 +1,14 @@
|
|
|
1
|
-
import type * as Context from 'effect/Context';
|
|
2
|
-
import * as Effect from 'effect/Effect';
|
|
3
|
-
import * as Schema from 'effect/Schema';
|
|
4
1
|
import { type AiService } from '@dxos/ai';
|
|
5
|
-
import { type
|
|
2
|
+
import { type Database, type Feed } from '@dxos/echo';
|
|
3
|
+
import { type Trace } from '@dxos/functions';
|
|
6
4
|
import { type CredentialsService, type FunctionInvocationService, type QueueService, type TracingService } from './services';
|
|
7
|
-
import { Function } from './types';
|
|
8
5
|
/**
|
|
9
6
|
* Services that are provided at the function call site by the caller.
|
|
10
7
|
*/
|
|
11
8
|
export type InvocationServices = TracingService;
|
|
12
9
|
/**
|
|
13
10
|
* Services that are available to invoked functions.
|
|
11
|
+
* @deprecated
|
|
14
12
|
*/
|
|
15
|
-
export type FunctionServices = InvocationServices | AiService.AiService | CredentialsService |
|
|
16
|
-
/**
|
|
17
|
-
* Function handler.
|
|
18
|
-
*/
|
|
19
|
-
export type FunctionHandler<TData = {}, TOutput = any, S extends FunctionServices = FunctionServices> = (params: {
|
|
20
|
-
/**
|
|
21
|
-
* Context available to the function.
|
|
22
|
-
*/
|
|
23
|
-
context: FunctionContext;
|
|
24
|
-
/**
|
|
25
|
-
* Data passed as the input to the function.
|
|
26
|
-
* Must match the function's input schema.
|
|
27
|
-
* This will be the payload from the trigger or other data passed into the function in a workflow.
|
|
28
|
-
*/
|
|
29
|
-
data: TData;
|
|
30
|
-
}) => TOutput | Promise<TOutput> | Effect.Effect<TOutput, any, S>;
|
|
31
|
-
/**
|
|
32
|
-
* Function context.
|
|
33
|
-
*/
|
|
34
|
-
export interface FunctionContext {
|
|
35
|
-
}
|
|
36
|
-
declare const typeId: unique symbol;
|
|
37
|
-
export type FunctionDefinition<T = any, O = any, S extends FunctionServices = FunctionServices> = {
|
|
38
|
-
[typeId]: true;
|
|
39
|
-
key: string;
|
|
40
|
-
name: string;
|
|
41
|
-
description?: string;
|
|
42
|
-
inputSchema: Schema.Schema<T, any>;
|
|
43
|
-
outputSchema?: Schema.Schema<O, any>;
|
|
44
|
-
/**
|
|
45
|
-
* Keys of the required services.
|
|
46
|
-
*/
|
|
47
|
-
services: readonly string[];
|
|
48
|
-
handler: FunctionHandler<T, O, S>;
|
|
49
|
-
meta?: {
|
|
50
|
-
/**
|
|
51
|
-
* Tools that are projected from functions have this annotation.
|
|
52
|
-
*
|
|
53
|
-
* deployedFunctionId:
|
|
54
|
-
* - Backend deployment ID assigned by the EDGE function service (typically a UUID).
|
|
55
|
-
* - Used for remote invocation via `FunctionInvocationService` → `RemoteFunctionExecutionService`.
|
|
56
|
-
* - Persisted on the corresponding ECHO `Function.Function` object's metadata under the
|
|
57
|
-
* `FUNCTIONS_META_KEY` and retrieved with `getUserFunctionIdInMetadata`.
|
|
58
|
-
*/
|
|
59
|
-
deployedFunctionId?: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export declare namespace FunctionDefinition {
|
|
63
|
-
type Any = FunctionDefinition<any, any, any>;
|
|
64
|
-
type Input<T extends Any> = T extends FunctionDefinition<infer I, infer _O, infer _S> ? I : never;
|
|
65
|
-
type Output<T extends Any> = T extends FunctionDefinition<infer _I, infer O, infer _S> ? O : never;
|
|
66
|
-
type Services<T extends Any> = T extends FunctionDefinition<infer _I, infer _O, infer S> ? S : never;
|
|
67
|
-
}
|
|
68
|
-
export type FunctionProps<T, O> = {
|
|
69
|
-
key: string;
|
|
70
|
-
name: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
inputSchema: Schema.Schema<T, any>;
|
|
73
|
-
outputSchema?: Schema.Schema<O, any>;
|
|
74
|
-
services?: readonly Context.Tag<any, any>[];
|
|
75
|
-
handler: FunctionHandler<T, O, FunctionServices>;
|
|
76
|
-
};
|
|
77
|
-
export declare const defineFunction: {
|
|
78
|
-
<I, O>(params: FunctionProps<I, O>): FunctionDefinition<I, O, FunctionServices>;
|
|
79
|
-
};
|
|
80
|
-
export declare const FunctionDefinition: {
|
|
81
|
-
make: <I, O>(params: FunctionProps<I, O>) => FunctionDefinition<I, O, FunctionServices>;
|
|
82
|
-
isFunction: (value: unknown) => value is FunctionDefinition.Any;
|
|
83
|
-
serialize: (functionDef: FunctionDefinition.Any) => Function.Function;
|
|
84
|
-
deserialize: (functionObj: Function.Function) => FunctionDefinition.Any;
|
|
85
|
-
};
|
|
86
|
-
export declare const serializeFunction: (functionDef: FunctionDefinition.Any) => Function.Function;
|
|
87
|
-
export declare const deserializeFunction: (functionObj: Function.Function) => FunctionDefinition<unknown, unknown>;
|
|
88
|
-
export {};
|
|
13
|
+
export type FunctionServices = InvocationServices | AiService.AiService | CredentialsService | Database.Service | QueueService | Feed.FeedService | Trace.TraceService | FunctionInvocationService;
|
|
89
14
|
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAOpB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,kBAAkB,GAClB,SAAS,CAAC,SAAS,GACnB,kBAAkB,GAClB,QAAQ,CAAC,OAAO,GAEhB,YAAY,GACZ,IAAI,CAAC,WAAW,GAChB,KAAK,CAAC,YAAY,GAClB,yBAAyB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import * as Context from 'effect/Context';
|
|
|
4
4
|
import * as Effect from 'effect/Effect';
|
|
5
5
|
import * as Layer from 'effect/Layer';
|
|
6
6
|
import * as Redacted from 'effect/Redacted';
|
|
7
|
-
import {
|
|
7
|
+
import { Database } from '@dxos/echo';
|
|
8
8
|
export type CredentialQuery = {
|
|
9
9
|
service?: string;
|
|
10
10
|
};
|
|
@@ -31,7 +31,9 @@ export declare class CredentialsService extends CredentialsService_base {
|
|
|
31
31
|
service: string;
|
|
32
32
|
apiKey: Config.Config<Redacted.Redacted<string>>;
|
|
33
33
|
}[]) => Layer.Layer<CredentialsService, import("effect/ConfigError").ConfigError, never>;
|
|
34
|
-
static layerFromDatabase: (
|
|
34
|
+
static layerFromDatabase: ({ caching }?: {
|
|
35
|
+
caching?: boolean;
|
|
36
|
+
}) => Layer.Layer<CredentialsService, never, Database.Service>;
|
|
35
37
|
}
|
|
36
38
|
export declare class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {
|
|
37
39
|
private readonly credentials;
|
|
@@ -41,8 +43,8 @@ export declare class ConfiguredCredentialsService implements Context.Tag.Service
|
|
|
41
43
|
getCredential(query: CredentialQuery): Promise<ServiceCredential>;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
|
-
* Maps the request to include the
|
|
46
|
+
* Maps the request to include the given token in the Authorization header.
|
|
45
47
|
*/
|
|
46
|
-
export declare const withAuthorization: (
|
|
48
|
+
export declare const withAuthorization: (token: string, kind?: "Bearer" | "Basic") => <E, R>(self: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, R>;
|
|
47
49
|
export {};
|
|
48
50
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,6BAA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E,OAAO,CAAC,EAAE,OAAO,CAAA;KAAO,8DA0CvE;CACL;AAED,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;CAQxE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,EAAE,OAAO,QAAQ,GAAG,OAAO,uFAItE,CAAC"}
|
|
@@ -35,37 +35,31 @@ export declare const ComputeEventPayload: Schema.Union<[Schema.Struct<{
|
|
|
35
35
|
event: typeof Schema.Any;
|
|
36
36
|
}>]>;
|
|
37
37
|
export type ComputeEventPayload = Schema.Schema.Type<typeof ComputeEventPayload>;
|
|
38
|
-
export declare const ComputeEvent: Type.
|
|
39
|
-
payload:
|
|
40
|
-
type:
|
|
41
|
-
nodeId:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}>, Schema.Struct<{
|
|
64
|
-
type: Schema.Literal<["custom"]>;
|
|
65
|
-
nodeId: typeof Schema.String;
|
|
66
|
-
event: typeof Schema.Any;
|
|
67
|
-
}>]>;
|
|
68
|
-
}>>;
|
|
38
|
+
export declare const ComputeEvent: Type.Obj<{
|
|
39
|
+
readonly payload: {
|
|
40
|
+
readonly type: "begin-compute";
|
|
41
|
+
readonly nodeId: string;
|
|
42
|
+
readonly inputs: readonly string[];
|
|
43
|
+
} | {
|
|
44
|
+
readonly type: "end-compute";
|
|
45
|
+
readonly nodeId: string;
|
|
46
|
+
readonly outputs: readonly string[];
|
|
47
|
+
} | {
|
|
48
|
+
readonly type: "compute-input";
|
|
49
|
+
readonly value: any;
|
|
50
|
+
readonly property: string;
|
|
51
|
+
readonly nodeId: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: "compute-output";
|
|
54
|
+
readonly value: any;
|
|
55
|
+
readonly property: string;
|
|
56
|
+
readonly nodeId: string;
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "custom";
|
|
59
|
+
readonly nodeId: string;
|
|
60
|
+
readonly event: any;
|
|
61
|
+
};
|
|
62
|
+
}, Schema.Struct.Fields>;
|
|
69
63
|
declare const ComputeEventLogger_base: Context.TagClass<ComputeEventLogger, "@dxos/functions/ComputeEventLogger", {
|
|
70
64
|
readonly log: (event: ComputeEventPayload) => void;
|
|
71
65
|
readonly nodeId: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../../../src/services/event-logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAO,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,eAAO,MAAM,mBAAmB;;;IAI5B;;OAEG;;;;;IAMH;;OAEG;;;;;;;;;;;;;;;;IAoBN,CAAC;AACF,MAAM,MAAM,mBAAm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AK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAMrG,CAAC;AAEJ,eAAO,MAAM,iBAAiB,GAC5B,OAAO,QAAQ,EACf,UAAS,MAAgB,KACxB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAiBxC,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import * as Context from 'effect/Context';
|
|
2
2
|
import * as Effect from 'effect/Effect';
|
|
3
|
-
import
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import { Operation } from '@dxos/operation';
|
|
5
|
+
import type { FunctionNotFoundError } from '../errors';
|
|
6
|
+
import { type InvocationServices } from '../sdk';
|
|
4
7
|
declare const FunctionInvocationService_base: Context.TagClass<FunctionInvocationService, "@dxos/functions/FunctionInvocationService", {
|
|
5
|
-
invokeFunction<I, O>(functionDef:
|
|
8
|
+
invokeFunction<I, O>(functionDef: Operation.Definition<I, O, any>, input: I): Effect.Effect<O, never, InvocationServices>;
|
|
9
|
+
resolveFunction(key: string): Effect.Effect<Operation.Definition.Any, FunctionNotFoundError>;
|
|
6
10
|
}>;
|
|
7
11
|
export declare class FunctionInvocationService extends FunctionInvocationService_base {
|
|
8
|
-
static
|
|
12
|
+
static layerNotAvailable: Layer.Layer<FunctionInvocationService, never, never>;
|
|
13
|
+
static invokeFunction: <I, O>(functionDef: Operation.Definition<I, O, any>, input: I) => Effect.Effect<O, never, FunctionInvocationService | InvocationServices>;
|
|
14
|
+
static resolveFunction: (key: string) => Effect.Effect<Operation.Definition.Any, FunctionNotFoundError, FunctionInvocationService>;
|
|
9
15
|
}
|
|
10
16
|
export {};
|
|
11
17
|
//# sourceMappingURL=function-invocation-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-invocation-service.d.ts","sourceRoot":"","sources":["../../../../src/services/function-invocation-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"function-invocation-service.d.ts","sourceRoot":"","sources":["../../../../src/services/function-invocation-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;;mBAK9B,CAAC,EAAE,CAAC,eACJ,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SACrC,CAAC,GACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC;yBAEzB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,CAAC;;AARhG,qBAAa,yBAA0B,SAAQ,8BAU5C;IACD,MAAM,CAAC,iBAAiB,uDAGrB;IAEH,MAAM,CAAC,cAAc,GAAI,CAAC,EAAE,CAAC,EAC3B,aAAa,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAC5C,OAAO,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,GAAG,kBAAkB,CAAC,CACyC;IAEnH,MAAM,CAAC,eAAe,GACpB,KAAK,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACS;CACtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrF,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as Context from 'effect/Context';
|
|
2
2
|
import * as Effect from 'effect/Effect';
|
|
3
3
|
import * as Layer from 'effect/Layer';
|
|
4
|
-
import
|
|
5
|
-
import type
|
|
4
|
+
import { type Entity } from '@dxos/echo';
|
|
5
|
+
import { type Queue, type QueueAPI, type QueueFactory } from '@dxos/echo-db';
|
|
6
6
|
import type { DXN, QueueSubspaceTag } from '@dxos/keys';
|
|
7
7
|
declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions/QueueService", {
|
|
8
8
|
/**
|
|
@@ -17,6 +17,7 @@ declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions
|
|
|
17
17
|
}>;
|
|
18
18
|
/**
|
|
19
19
|
* Gives access to all queues.
|
|
20
|
+
* @deprecated Use Feed.FeedService instead.
|
|
20
21
|
*/
|
|
21
22
|
export declare class QueueService extends QueueService_base {
|
|
22
23
|
static notAvailable: Layer.Layer<QueueService, never, never>;
|
|
@@ -25,23 +26,25 @@ export declare class QueueService extends QueueService_base {
|
|
|
25
26
|
/**
|
|
26
27
|
* Gets a queue by its DXN.
|
|
27
28
|
*/
|
|
28
|
-
static getQueue: <T extends
|
|
29
|
+
static getQueue: <T extends Entity.Unknown = Entity.Unknown>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
29
30
|
/**
|
|
30
31
|
* Creates a new queue.
|
|
31
32
|
*/
|
|
32
|
-
static createQueue: <T extends
|
|
33
|
+
static createQueue: <T extends Entity.Unknown = Entity.Unknown>(options?: {
|
|
33
34
|
subspaceTag?: QueueSubspaceTag;
|
|
34
35
|
}) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
35
|
-
static append: <T extends
|
|
36
|
+
static append: <T extends Entity.Unknown = Entity.Unknown>(queue: Queue<T>, objects: T[]) => Effect.Effect<void>;
|
|
36
37
|
}
|
|
37
38
|
declare const ContextQueueService_base: Context.TagClass<ContextQueueService, "@dxos/functions/ContextQueueService", {
|
|
38
39
|
readonly queue: Queue;
|
|
39
40
|
}>;
|
|
40
41
|
/**
|
|
41
42
|
* Gives access to a specific queue passed as a context.
|
|
43
|
+
* @deprecated Use Feed.FeedService instead.
|
|
42
44
|
*/
|
|
43
45
|
export declare class ContextQueueService extends ContextQueueService_base {
|
|
44
46
|
static layer: (queue: Queue) => Layer.Layer<ContextQueueService, never, never>;
|
|
45
47
|
}
|
|
48
|
+
export declare const feedServiceFromQueueServiceLayer: Layer.Layer<import("@dxos/echo/Feed").FeedService, never, QueueService>;
|
|
46
49
|
export {};
|
|
47
50
|
//# sourceMappingURL=queues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,
|
|
1
|
+
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAA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AAI,CAAC,CACjE;CAC/C;;oBASmB,KAAK;;AAPzB;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,wBAKtC;IACD,MAAM,CAAC,KAAK,GAAI,OAAO,KAAK,oDAAmD;CAChF;AAED,eAAO,MAAM,gCAAgC,yEAK5C,CAAC"}
|
|
@@ -2,9 +2,10 @@ import * as Context from 'effect/Context';
|
|
|
2
2
|
import * as Effect from 'effect/Effect';
|
|
3
3
|
import * as Layer from 'effect/Layer';
|
|
4
4
|
import { AgentStatus } from '@dxos/ai';
|
|
5
|
-
import { Obj } from '@dxos/echo';
|
|
6
|
-
import
|
|
5
|
+
import { type DXN, Obj, Ref } from '@dxos/echo';
|
|
6
|
+
import { ObjectId } from '@dxos/keys';
|
|
7
7
|
import { Message } from '@dxos/types';
|
|
8
|
+
import type { Trigger } from '../types';
|
|
8
9
|
declare const TracingService_base: Context.TagClass<TracingService, "@dxos/functions/TracingService", {
|
|
9
10
|
/**
|
|
10
11
|
* Gets the parent message ID.
|
|
@@ -14,11 +15,24 @@ declare const TracingService_base: Context.TagClass<TracingService, "@dxos/funct
|
|
|
14
15
|
* Write an event to the tracing queue.
|
|
15
16
|
* @param event - The event to write. Must be an a typed object.
|
|
16
17
|
*/
|
|
17
|
-
write: (event: Obj.
|
|
18
|
+
write: (event: Obj.Unknown, traceContext: TracingService.TraceContext) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Write an ephemeral event.
|
|
21
|
+
*/
|
|
22
|
+
ephemeral: (event: Obj.Unknown, traceContext: TracingService.TraceContext) => void;
|
|
23
|
+
traceInvocationStart({ payload, target, }: {
|
|
24
|
+
payload: TracingService.FunctionInvocationPayload;
|
|
25
|
+
target?: DXN;
|
|
26
|
+
}): Effect.Effect<TracingService.InvocationTraceData>;
|
|
27
|
+
traceInvocationEnd({ trace, exception, }: {
|
|
28
|
+
trace: TracingService.InvocationTraceData;
|
|
29
|
+
exception?: any;
|
|
30
|
+
}): Effect.Effect<void>;
|
|
18
31
|
}>;
|
|
19
32
|
/**
|
|
20
33
|
* Provides a way for compute primitives (functions, workflows, tools)
|
|
21
34
|
* to emit an execution trace as a series of structured ECHO objects.
|
|
35
|
+
* @deprecated Use Trace.TraceService instead.
|
|
22
36
|
*/
|
|
23
37
|
export declare class TracingService extends TracingService_base {
|
|
24
38
|
static noop: Context.Tag.Service<TracingService>;
|
|
@@ -27,14 +41,22 @@ export declare class TracingService extends TracingService_base {
|
|
|
27
41
|
* Creates a TracingService layer that emits events to the parent tracing service.
|
|
28
42
|
*/
|
|
29
43
|
static layerSubframe: (mapContext: (currentContext: TracingService.TraceContext) => TracingService.TraceContext) => Layer.Layer<TracingService, never, TracingService>;
|
|
44
|
+
/**
|
|
45
|
+
* Create sublayer to trace an invocation.
|
|
46
|
+
* @param data
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
static layerInvocation: (data: TracingService.InvocationTraceData) => Layer.Layer<TracingService, never, TracingService>;
|
|
30
50
|
/**
|
|
31
51
|
* Emit the current human-readable execution status.
|
|
32
52
|
*/
|
|
33
53
|
static emitStatus: (data: Omit<Obj.MakeProps<typeof AgentStatus>, 'created'>) => Effect.Effect<void, never, TracingService>;
|
|
34
|
-
static emitConverationMessage: (data: Obj.MakeProps<typeof Message.Message>) => Effect.Effect<void, never, TracingService>;
|
|
54
|
+
static emitConverationMessage: (data: Obj.MakeProps<typeof Message.Message> | Message.Message) => Effect.Effect<void, never, TracingService>;
|
|
55
|
+
static emitEphemeralMessage: (data: Message.Message) => Effect.Effect<void, never, TracingService>;
|
|
35
56
|
}
|
|
36
57
|
export declare namespace TracingService {
|
|
37
58
|
interface TraceContext {
|
|
59
|
+
currentInvocation?: InvocationTraceData;
|
|
38
60
|
/**
|
|
39
61
|
* If this thread sprung from a tool call, this is the ID of the message containing the tool call.
|
|
40
62
|
*/
|
|
@@ -45,6 +67,41 @@ export declare namespace TracingService {
|
|
|
45
67
|
toolCallId?: string;
|
|
46
68
|
debugInfo?: unknown;
|
|
47
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Trace data for a function/trigger invocation.
|
|
72
|
+
*/
|
|
73
|
+
interface InvocationTraceData {
|
|
74
|
+
invocationId: ObjectId;
|
|
75
|
+
invocationTraceQueue?: DXN.String;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Payload for a function/trigger invocation.
|
|
79
|
+
*/
|
|
80
|
+
interface FunctionInvocationPayload {
|
|
81
|
+
data?: any;
|
|
82
|
+
inputNodeId?: string;
|
|
83
|
+
trigger?: {
|
|
84
|
+
id: string;
|
|
85
|
+
kind: Trigger.Kind;
|
|
86
|
+
};
|
|
87
|
+
chat?: Ref.Ref<Obj.Unknown>;
|
|
88
|
+
process?: {
|
|
89
|
+
pid: string;
|
|
90
|
+
parentPid?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Key of the executable.
|
|
93
|
+
*/
|
|
94
|
+
key: string;
|
|
95
|
+
/**
|
|
96
|
+
* Process name.
|
|
97
|
+
*/
|
|
98
|
+
name?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Target object that the process is assigned to.
|
|
101
|
+
*/
|
|
102
|
+
target?: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
48
105
|
}
|
|
49
106
|
/**
|
|
50
107
|
* Goes into {@link Message['properties']}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,O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AAI,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,CAAC,EAAE;YACR,GAAG,EAAE,MAAM,CAAC;YACZ,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB;;eAEG;YACH,GAAG,EAAE,MAAM,CAAC;YAEZ;;eAEG;YACH,IAAI,CAAC,EAAE,MAAM,CAAC;YAEd;;eAEG;YACH,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;CACF;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
|
|
@@ -3,26 +3,20 @@ import { Obj, Type } from '@dxos/echo';
|
|
|
3
3
|
/**
|
|
4
4
|
* Source script.
|
|
5
5
|
*/
|
|
6
|
-
export declare const Script: Type.
|
|
7
|
-
name
|
|
8
|
-
description
|
|
9
|
-
changed
|
|
10
|
-
source:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
6
|
+
export declare const Script: Type.Obj<{
|
|
7
|
+
readonly name?: string | undefined;
|
|
8
|
+
readonly description?: string | undefined;
|
|
9
|
+
readonly changed?: boolean | undefined;
|
|
10
|
+
readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
11
|
+
readonly name?: string | undefined;
|
|
12
|
+
readonly content: string;
|
|
13
|
+
}>;
|
|
14
|
+
}, Schema.Struct.Fields>;
|
|
14
15
|
export interface Script extends Schema.Schema.Type<typeof Script> {
|
|
15
16
|
}
|
|
16
17
|
type Props = Omit<Obj.MakeProps<typeof Script>, 'source'> & {
|
|
17
18
|
source?: string;
|
|
18
19
|
};
|
|
19
|
-
export declare const make: ({ source, ...props }?: Props) =>
|
|
20
|
-
description?: string | undefined;
|
|
21
|
-
source: import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
22
|
-
content: string;
|
|
23
|
-
}>;
|
|
24
|
-
name?: string | undefined;
|
|
25
|
-
changed?: boolean | undefined;
|
|
26
|
-
}>;
|
|
20
|
+
export declare const make: ({ source, ...props }?: Props) => Script;
|
|
27
21
|
export {};
|
|
28
22
|
//# sourceMappingURL=Script.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../../src/types/Script.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,
|
|
1
|
+
{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../../src/types/Script.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAc,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;wBAiBlB,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC;CAAG;AAEpE,KAAK,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,IAAI,GAAI,uBAA2B,KAAU,KAAG,MACqB,CAAC"}
|