@dxos/functions 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8
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 +54 -38
- package/dist/lib/browser/bundler/index.mjs.map +3 -3
- package/dist/lib/browser/chunk-7NQ77AIQ.mjs +618 -0
- package/dist/lib/browser/chunk-7NQ77AIQ.mjs.map +7 -0
- package/dist/lib/browser/edge/index.mjs +20 -8
- package/dist/lib/browser/edge/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +141 -77
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +68 -5
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/bundler/index.mjs +54 -38
- package/dist/lib/node-esm/bundler/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-KCGC6QQT.mjs +620 -0
- package/dist/lib/node-esm/chunk-KCGC6QQT.mjs.map +7 -0
- package/dist/lib/node-esm/edge/index.mjs +20 -8
- package/dist/lib/node-esm/edge/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +141 -77
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +68 -5
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/bundler/bundler.d.ts +11 -12
- package/dist/types/src/bundler/bundler.d.ts.map +1 -1
- package/dist/types/src/edge/functions.d.ts +3 -2
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +10 -8
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/examples/fib.d.ts +7 -0
- package/dist/types/src/examples/fib.d.ts.map +1 -0
- package/dist/types/src/examples/reply.d.ts +3 -0
- package/dist/types/src/examples/reply.d.ts.map +1 -0
- package/dist/types/src/examples/sleep.d.ts +5 -0
- package/dist/types/src/examples/sleep.d.ts.map +1 -0
- package/dist/types/src/executor/executor.d.ts +4 -1
- package/dist/types/src/executor/executor.d.ts.map +1 -1
- package/dist/types/src/handler.d.ts +10 -7
- package/dist/types/src/handler.d.ts.map +1 -1
- package/dist/types/src/schema.d.ts +7 -2
- package/dist/types/src/schema.d.ts.map +1 -1
- package/dist/types/src/services/credentials.d.ts +15 -3
- package/dist/types/src/services/credentials.d.ts.map +1 -1
- package/dist/types/src/services/database.d.ts +74 -6
- package/dist/types/src/services/database.d.ts.map +1 -1
- package/dist/types/src/services/event-logger.d.ts +1 -1
- package/dist/types/src/services/event-logger.d.ts.map +1 -1
- package/dist/types/src/services/local-function-execution.d.ts +2 -1
- package/dist/types/src/services/local-function-execution.d.ts.map +1 -1
- package/dist/types/src/services/queues.d.ts +18 -5
- package/dist/types/src/services/queues.d.ts.map +1 -1
- package/dist/types/src/services/remote-function-execution-service.d.ts.map +1 -1
- package/dist/types/src/services/service-container.d.ts +1 -1
- package/dist/types/src/services/service-container.d.ts.map +1 -1
- package/dist/types/src/services/service-registry.d.ts.map +1 -1
- package/dist/types/src/services/tracing.d.ts +33 -3
- package/dist/types/src/services/tracing.d.ts.map +1 -1
- package/dist/types/src/testing/layer.d.ts +6 -2
- package/dist/types/src/testing/layer.d.ts.map +1 -1
- package/dist/types/src/testing/logger.d.ts.map +1 -1
- package/dist/types/src/testing/persist-database.test.d.ts +2 -0
- package/dist/types/src/testing/persist-database.test.d.ts.map +1 -0
- package/dist/types/src/testing/services.d.ts +1 -1
- package/dist/types/src/testing/services.d.ts.map +1 -1
- package/dist/types/src/trace.d.ts +34 -8
- package/dist/types/src/trace.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +141 -224
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/url.d.ts +10 -6
- package/dist/types/src/url.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +40 -39
- package/src/bundler/bundler.test.ts +8 -9
- package/src/bundler/bundler.ts +32 -33
- package/src/edge/functions.ts +8 -5
- package/src/examples/fib.ts +30 -0
- package/src/examples/reply.ts +18 -0
- package/src/examples/sleep.ts +22 -0
- package/src/executor/executor.ts +9 -9
- package/src/handler.ts +12 -10
- package/src/schema.ts +11 -0
- package/src/services/credentials.ts +78 -5
- package/src/services/database.ts +114 -18
- package/src/services/event-logger.ts +2 -2
- package/src/services/local-function-execution.ts +20 -13
- package/src/services/queues.ts +29 -10
- package/src/services/remote-function-execution-service.ts +2 -22
- package/src/services/service-container.ts +4 -3
- package/src/services/service-registry.ts +1 -1
- package/src/services/tracing.ts +95 -5
- package/src/testing/layer.ts +69 -3
- package/src/testing/logger.ts +1 -1
- package/src/testing/persist-database.test.ts +87 -0
- package/src/testing/services.ts +2 -1
- package/src/trace.ts +5 -7
- package/src/types.ts +17 -25
- package/src/url.ts +13 -10
- package/dist/lib/browser/chunk-6PTFLPCO.mjs +0 -462
- package/dist/lib/browser/chunk-6PTFLPCO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NYJ2TSXO.mjs +0 -464
- package/dist/lib/node-esm/chunk-NYJ2TSXO.mjs.map +0 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseError } from '@dxos/errors';
|
|
2
2
|
declare const ServiceNotAvailableError_base: {
|
|
3
3
|
new (message: string, options?: import("@dxos/errors").BaseErrorOptions): {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
#code: "SERVICE_NOT_AVAILABLE";
|
|
5
|
+
#context: Record<string, unknown>;
|
|
6
6
|
readonly name: "SERVICE_NOT_AVAILABLE";
|
|
7
7
|
readonly code: "SERVICE_NOT_AVAILABLE";
|
|
8
8
|
readonly _tag: "SERVICE_NOT_AVAILABLE";
|
|
@@ -14,8 +14,8 @@ declare const ServiceNotAvailableError_base: {
|
|
|
14
14
|
code: "SERVICE_NOT_AVAILABLE";
|
|
15
15
|
is(error: unknown): error is BaseError;
|
|
16
16
|
wrap(message: string, options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
#code: "SERVICE_NOT_AVAILABLE";
|
|
18
|
+
#context: Record<string, unknown>;
|
|
19
19
|
readonly name: "SERVICE_NOT_AVAILABLE";
|
|
20
20
|
readonly code: "SERVICE_NOT_AVAILABLE";
|
|
21
21
|
readonly _tag: "SERVICE_NOT_AVAILABLE";
|
|
@@ -25,6 +25,7 @@ declare const ServiceNotAvailableError_base: {
|
|
|
25
25
|
cause?: unknown;
|
|
26
26
|
};
|
|
27
27
|
extend<Code extends string>(code: Code): any;
|
|
28
|
+
isError(error: unknown): error is Error;
|
|
28
29
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
29
30
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
30
31
|
stackTraceLimit: number;
|
|
@@ -34,8 +35,8 @@ export declare class ServiceNotAvailableError extends ServiceNotAvailableError_b
|
|
|
34
35
|
}
|
|
35
36
|
declare const FunctionError_base: {
|
|
36
37
|
new (message: string, options?: import("@dxos/errors").BaseErrorOptions): {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
#code: "FUNCTION_ERROR";
|
|
39
|
+
#context: Record<string, unknown>;
|
|
39
40
|
readonly name: "FUNCTION_ERROR";
|
|
40
41
|
readonly code: "FUNCTION_ERROR";
|
|
41
42
|
readonly _tag: "FUNCTION_ERROR";
|
|
@@ -47,8 +48,8 @@ declare const FunctionError_base: {
|
|
|
47
48
|
code: "FUNCTION_ERROR";
|
|
48
49
|
is(error: unknown): error is BaseError;
|
|
49
50
|
wrap(message: string, options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
#code: "FUNCTION_ERROR";
|
|
52
|
+
#context: Record<string, unknown>;
|
|
52
53
|
readonly name: "FUNCTION_ERROR";
|
|
53
54
|
readonly code: "FUNCTION_ERROR";
|
|
54
55
|
readonly _tag: "FUNCTION_ERROR";
|
|
@@ -58,6 +59,7 @@ declare const FunctionError_base: {
|
|
|
58
59
|
cause?: unknown;
|
|
59
60
|
};
|
|
60
61
|
extend<Code extends string>(code: Code): any;
|
|
62
|
+
isError(error: unknown): error is Error;
|
|
61
63
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
62
64
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
63
65
|
stackTraceLimit: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,qBAAa,wBAAyB,SAAQ,6BAAyC;gBACzE,WAAW,EAAE,MAAM;CAGhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,qBAAa,aAAc,SAAQ,kBAAkC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fib.d.ts","sourceRoot":"","sources":["../../../../src/examples/fib.ts"],"names":[],"mappings":";;;;;AAQA,wBAqBG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../../src/examples/reply.ts"],"names":[],"mappings":";AAQA,wBASG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../../../src/examples/sleep.ts"],"names":[],"mappings":";;;AAQA,wBAaG"}
|
|
@@ -3,6 +3,9 @@ import type { ServiceContainer } from '../services';
|
|
|
3
3
|
export declare class FunctionExecutor {
|
|
4
4
|
private readonly _services;
|
|
5
5
|
constructor(_services: ServiceContainer);
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Invoke function.
|
|
8
|
+
*/
|
|
9
|
+
invoke<F extends FunctionDefinition<any, any>>(functionDef: F, input: F extends FunctionDefinition<infer I, infer _O> ? I : never): Promise<F extends FunctionDefinition<infer _I, infer O> ? O : never>;
|
|
7
10
|
}
|
|
8
11
|
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/executor/executor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,aAAa,CAAC;AAE9D,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,gBAAgB;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/executor/executor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,aAAa,CAAC;AAE9D,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,gBAAgB;IAExD;;OAEG;IAEG,MAAM,CAAC,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,EACjD,WAAW,EAAE,CAAC,EACd,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;CA+BxE"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
import type { EchoDatabase } from '@dxos/echo-db';
|
|
1
|
+
import { type Context, type Effect, Schema } from 'effect';
|
|
2
|
+
import { type EchoDatabase } from '@dxos/echo-db';
|
|
4
3
|
import { type HasId } from '@dxos/echo-schema';
|
|
5
|
-
import { type
|
|
4
|
+
import { type DXN, type SpaceId } from '@dxos/keys';
|
|
6
5
|
import { type QueryResult } from '@dxos/protocols';
|
|
7
|
-
import type
|
|
6
|
+
import { type Services } from './services';
|
|
8
7
|
/**
|
|
9
8
|
* Function handler.
|
|
10
9
|
*/
|
|
@@ -28,7 +27,6 @@ export interface FunctionContext {
|
|
|
28
27
|
* Space from which the function was invoked.
|
|
29
28
|
*/
|
|
30
29
|
space: SpaceAPI | undefined;
|
|
31
|
-
ai: AiServiceClient;
|
|
32
30
|
/**
|
|
33
31
|
* Resolves a service available to the function.
|
|
34
32
|
* @throws if the service is not available.
|
|
@@ -51,7 +49,7 @@ export interface SpaceAPI {
|
|
|
51
49
|
get db(): EchoDatabase;
|
|
52
50
|
get queues(): QueuesAPI;
|
|
53
51
|
}
|
|
54
|
-
export type FunctionDefinition<T =
|
|
52
|
+
export type FunctionDefinition<T = any, O = any> = {
|
|
55
53
|
name: string;
|
|
56
54
|
description?: string;
|
|
57
55
|
inputSchema: Schema.Schema<T, any>;
|
|
@@ -59,4 +57,9 @@ export type FunctionDefinition<T = {}, O = any> = {
|
|
|
59
57
|
handler: FunctionHandler<T, O>;
|
|
60
58
|
};
|
|
61
59
|
export declare const defineFunction: <T, O>({ name, description, inputSchema, outputSchema, handler, }: FunctionDefinition<T, O>) => FunctionDefinition<T, O>;
|
|
60
|
+
export declare namespace FunctionDefinition {
|
|
61
|
+
type Any = FunctionDefinition<any, any>;
|
|
62
|
+
type Input<T extends FunctionDefinition> = T extends FunctionDefinition<infer I, any> ? I : never;
|
|
63
|
+
type Output<T extends FunctionDefinition> = T extends FunctionDefinition<any, infer O> ? O : never;
|
|
64
|
+
}
|
|
62
65
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE3D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,KAAK,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE;IAChE;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IAEzB;;;;OAIG;IACH,IAAI,EAAE,KAAK,CAAC;CACb,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAE5B;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;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AAE,GAAG,CAAC,CAAC;IAC/C,KAAY,KAAK,CAAC,CAAC,SAAS,kBAAkB,IAAI,CAAC,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACzG,KAAY,MAAM,CAAC,CAAC,SAAS,kBAAkB,IAAI,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CAC3G"}
|
|
@@ -18,16 +18,21 @@ export interface ScriptType extends Schema.Schema.Type<typeof ScriptType> {
|
|
|
18
18
|
* Function deployment.
|
|
19
19
|
*/
|
|
20
20
|
export declare const FunctionType: Type.obj<Schema.Struct<{
|
|
21
|
+
/**
|
|
22
|
+
* Global registry ID.
|
|
23
|
+
* NOTE: The `key` property refers to the original registry entry.
|
|
24
|
+
*/
|
|
25
|
+
key: Schema.optional<typeof Schema.String>;
|
|
21
26
|
name: typeof Schema.NonEmptyString;
|
|
22
27
|
version: typeof Schema.String;
|
|
23
28
|
description: Schema.optional<typeof Schema.String>;
|
|
24
29
|
source: Schema.optional<import("@dxos/echo-schema").Ref$<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
25
30
|
description?: string | undefined;
|
|
26
|
-
name?: string | undefined;
|
|
27
|
-
changed?: boolean | undefined;
|
|
28
31
|
source: Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
29
32
|
content: string;
|
|
30
33
|
}>;
|
|
34
|
+
name?: string | undefined;
|
|
35
|
+
changed?: boolean | undefined;
|
|
31
36
|
}>>;
|
|
32
37
|
inputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
33
38
|
outputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
@@ -1 +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,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAmC,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGzE;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;GAatB,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC;CAAG;AAE5E;;GAEG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAmC,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGzE;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;GAatB,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC;CAAG;AAE5E;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB;;;OAGG;;;;;;;;;;;;;;;;GA6BJ,CAAC;AACF,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC;CAAG"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type
|
|
1
|
+
import { HttpClient } from '@effect/platform';
|
|
2
|
+
import { type Config, Context, Effect, Layer, Redacted } from 'effect';
|
|
3
|
+
import { DatabaseService } from './database';
|
|
4
|
+
export type CredentialQuery = {
|
|
3
5
|
service?: string;
|
|
4
6
|
};
|
|
5
7
|
export type ServiceCredential = {
|
|
@@ -18,8 +20,14 @@ declare const CredentialsService_base: Context.TagClass<CredentialsService, "@dx
|
|
|
18
20
|
getCredential: (query: CredentialQuery) => Promise<ServiceCredential>;
|
|
19
21
|
}>;
|
|
20
22
|
export declare class CredentialsService extends CredentialsService_base {
|
|
21
|
-
static configuredLayer: (credentials: ServiceCredential[]) => Layer.Layer<CredentialsService, never, never>;
|
|
22
23
|
static getCredential: (query: CredentialQuery) => Effect.Effect<ServiceCredential, never, CredentialsService>;
|
|
24
|
+
static getApiKey: (query: CredentialQuery) => Effect.Effect<Redacted.Redacted<string>, never, CredentialsService>;
|
|
25
|
+
static configuredLayer: (credentials: ServiceCredential[]) => Layer.Layer<CredentialsService, never, never>;
|
|
26
|
+
static layerConfig: (credentials: {
|
|
27
|
+
service: string;
|
|
28
|
+
apiKey: Config.Config<Redacted.Redacted<string>>;
|
|
29
|
+
}[]) => Layer.Layer<CredentialsService, import("effect/ConfigError").ConfigError, never>;
|
|
30
|
+
static layerFromDatabase: () => Layer.Layer<CredentialsService, never, DatabaseService>;
|
|
23
31
|
}
|
|
24
32
|
export declare class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {
|
|
25
33
|
private readonly credentials;
|
|
@@ -28,5 +36,9 @@ export declare class ConfiguredCredentialsService implements Context.Tag.Service
|
|
|
28
36
|
queryCredentials(query: CredentialQuery): Promise<ServiceCredential[]>;
|
|
29
37
|
getCredential(query: CredentialQuery): Promise<ServiceCredential>;
|
|
30
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Maps the request to include the API key from the credential.
|
|
41
|
+
*/
|
|
42
|
+
export declare const withAuthorization: (query: CredentialQuery, kind?: "Bearer" | "Basic") => <E, R>(self: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, CredentialsService | R>;
|
|
31
43
|
export {};
|
|
32
44
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE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BAAiB,gEA2BpB;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;CAOxE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,eAAe,EAAE,OAAO,QAAQ,GAAG,OAAO,4GAOhF,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Context, Effect, Layer } from 'effect';
|
|
2
|
-
import type
|
|
3
|
-
import type { EchoDatabase, OneShotQueryResult, QueryResult } from '@dxos/echo-db';
|
|
1
|
+
import { Context, Effect, Layer, Option, type Schema } from 'effect';
|
|
2
|
+
import { type Filter, type Live, Obj, type Query, type Ref, type Relation, type Type } from '@dxos/echo';
|
|
3
|
+
import type { EchoDatabase, FlushOptions, OneShotQueryResult, QueryResult, SchemaRegistryQuery } from '@dxos/echo-db';
|
|
4
|
+
import type { SchemaRegistryPreparedQuery } from '@dxos/echo-db';
|
|
5
|
+
import type { EchoSchema } from '@dxos/echo-schema';
|
|
6
|
+
import { BaseError } from '@dxos/errors';
|
|
4
7
|
import type { DXN } from '@dxos/keys';
|
|
5
8
|
declare const DatabaseService_base: Context.TagClass<DatabaseService, "@dxos/functions/DatabaseService", {
|
|
6
9
|
readonly db: EchoDatabase;
|
|
@@ -8,9 +11,38 @@ declare const DatabaseService_base: Context.TagClass<DatabaseService, "@dxos/fun
|
|
|
8
11
|
export declare class DatabaseService extends DatabaseService_base {
|
|
9
12
|
static notAvailable: Layer.Layer<DatabaseService, never, never>;
|
|
10
13
|
static make: (db: EchoDatabase) => Context.Tag.Service<DatabaseService>;
|
|
11
|
-
static
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
static layer: (db: EchoDatabase) => Layer.Layer<DatabaseService>;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves an object by its DXN.
|
|
17
|
+
*/
|
|
18
|
+
static resolve: {
|
|
19
|
+
(dxn: DXN): Effect.Effect<Obj.Any | Relation.Any, never, DatabaseService>;
|
|
20
|
+
<S extends Type.Obj.Any | Type.Relation.Any>(dxn: DXN, schema: S): Effect.Effect<Schema.Schema.Type<S>, ObjectNotFoundError, DatabaseService>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Loads an object reference.
|
|
24
|
+
*/
|
|
25
|
+
static load: <T>(ref: Ref.Ref<T>) => Effect.Effect<T, ObjectNotFoundError, never>;
|
|
26
|
+
/**
|
|
27
|
+
* Loads an object reference option.
|
|
28
|
+
*/
|
|
29
|
+
static loadOption: <T>(ref: Ref.Ref<T>) => Effect.Effect<Option.Option<T>, never, never>;
|
|
30
|
+
/**
|
|
31
|
+
* @link EchoDatabase.add
|
|
32
|
+
*/
|
|
33
|
+
static add: <T extends Obj.Any | Relation.Any>(obj: T) => Effect.Effect<T, never, DatabaseService>;
|
|
34
|
+
/**
|
|
35
|
+
* @link EchoDatabase.remove
|
|
36
|
+
*/
|
|
37
|
+
static remove: <T extends Obj.Any | Relation.Any>(obj: T) => Effect.Effect<void, never, DatabaseService>;
|
|
38
|
+
/**
|
|
39
|
+
* @link EchoDatabase.flush
|
|
40
|
+
*/
|
|
41
|
+
static flush: (opts?: FlushOptions) => Effect.Effect<void, never, DatabaseService>;
|
|
42
|
+
/**
|
|
43
|
+
* @link EchoDatabase.getObjectById
|
|
44
|
+
*/
|
|
45
|
+
static getObjectById: <T extends Obj.Any | Relation.Any>(id: string) => Effect.Effect<Live<T> | undefined, never, DatabaseService>;
|
|
14
46
|
/**
|
|
15
47
|
* Creates a `QueryResult` object that can be subscribed to.
|
|
16
48
|
*/
|
|
@@ -25,6 +57,42 @@ export declare class DatabaseService extends DatabaseService_base {
|
|
|
25
57
|
<Q extends Query.Any>(query: Q): Effect.Effect<OneShotQueryResult<Live<Query.Type<Q>>>, never, DatabaseService>;
|
|
26
58
|
<F extends Filter.Any>(filter: F): Effect.Effect<OneShotQueryResult<Live<Filter.Type<F>>>, never, DatabaseService>;
|
|
27
59
|
};
|
|
60
|
+
static schemaQuery: <Q extends SchemaRegistryQuery>(query: Q) => Effect.Effect<SchemaRegistryPreparedQuery<EchoSchema>, never, DatabaseService>;
|
|
61
|
+
static runSchemaQuery: <Q extends SchemaRegistryQuery>(query: Q) => Effect.Effect<EchoSchema[], never, DatabaseService>;
|
|
62
|
+
}
|
|
63
|
+
declare const ObjectNotFoundError_base: {
|
|
64
|
+
new (message: string, options?: import("@dxos/errors").BaseErrorOptions): {
|
|
65
|
+
#code: "OBJECT_NOT_FOUND";
|
|
66
|
+
#context: Record<string, unknown>;
|
|
67
|
+
readonly name: "OBJECT_NOT_FOUND";
|
|
68
|
+
readonly code: "OBJECT_NOT_FOUND";
|
|
69
|
+
readonly _tag: "OBJECT_NOT_FOUND";
|
|
70
|
+
readonly context: Record<string, unknown>;
|
|
71
|
+
message: string;
|
|
72
|
+
stack?: string;
|
|
73
|
+
cause?: unknown;
|
|
74
|
+
};
|
|
75
|
+
code: "OBJECT_NOT_FOUND";
|
|
76
|
+
is(error: unknown): error is BaseError;
|
|
77
|
+
wrap(message: string, options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
|
|
78
|
+
#code: "OBJECT_NOT_FOUND";
|
|
79
|
+
#context: Record<string, unknown>;
|
|
80
|
+
readonly name: "OBJECT_NOT_FOUND";
|
|
81
|
+
readonly code: "OBJECT_NOT_FOUND";
|
|
82
|
+
readonly _tag: "OBJECT_NOT_FOUND";
|
|
83
|
+
readonly context: Record<string, unknown>;
|
|
84
|
+
message: string;
|
|
85
|
+
stack?: string;
|
|
86
|
+
cause?: unknown;
|
|
87
|
+
};
|
|
88
|
+
extend<Code extends string>(code: Code): any;
|
|
89
|
+
isError(error: unknown): error is Error;
|
|
90
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
91
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
92
|
+
stackTraceLimit: number;
|
|
93
|
+
};
|
|
94
|
+
declare class ObjectNotFoundError extends ObjectNotFoundError_base {
|
|
95
|
+
constructor(context?: Record<string, unknown>);
|
|
28
96
|
}
|
|
29
97
|
export {};
|
|
30
98
|
//# sourceMappingURL=database.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../../src/services/database.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../../src/services/database.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACzG,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CA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AAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;QAChH,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;KACpH,CAGG;IAEJ,MAAM,CAAC,WAAW,GAAI,CAAC,SAAS,mBAAmB,EACjD,OAAO,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAI7E;IAEJ,MAAM,CAAC,cAAc,GAAI,CAAC,SAAS,mBAAmB,EACpD,OAAO,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,eAAe,CAAC,CAGlD;CACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGD,cAAM,mBAAoB,SAAQ,wBAAoC;gBACxD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAG9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../../../src/services/event-logger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../../../src/services/event-logger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExD,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;;;;;;;;;;;;;;;;;;;;;;IA4B/B,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;GAEsD,CAAC;;kBAO9D,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI;qBAAmB,MAAM,GAAG,SAAS;;AAL3F;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,uBAGrC;IACD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAGlD;IAEF;;OAEG;IACH,MAAM,CAAC,gBAAgB,yDAWrB;CACH;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,GAAG,mDAWpC,CAAC;AAEL,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,OAAK,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,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"}
|
|
@@ -2,10 +2,11 @@ import { Context, Effect, Layer } from 'effect';
|
|
|
2
2
|
import type { FunctionDefinition } from '../handler';
|
|
3
3
|
import type { Services } from './service-container';
|
|
4
4
|
declare const LocalFunctionExecutionService_base: Context.TagClass<LocalFunctionExecutionService, "@dxos/functions/LocalFunctionExecutionService", {
|
|
5
|
-
invokeFunction(
|
|
5
|
+
invokeFunction(functionDef: FunctionDefinition<any, any>, input: unknown): Effect.Effect<unknown, never, Services>;
|
|
6
6
|
}>;
|
|
7
7
|
export declare class LocalFunctionExecutionService extends LocalFunctionExecutionService_base {
|
|
8
8
|
static layer: Layer.Layer<LocalFunctionExecutionService, never, never>;
|
|
9
|
+
static invokeFunction: <F extends FunctionDefinition.Any>(functionDef: F, input: FunctionDefinition.Input<F>) => Effect.Effect<FunctionDefinition.Output<F>, never, Services | LocalFunctionExecutionService>;
|
|
9
10
|
}
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=local-function-execution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-function-execution.d.ts","sourceRoot":"","sources":["../../../../src/services/local-function-execution.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAU,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"local-function-execution.d.ts","sourceRoot":"","sources":["../../../../src/services/local-function-execution.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAU,MAAM,QAAQ,CAAC;AAKxD,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;;gCAOpB,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;;AALtH,qBAAa,6BAA8B,SAAQ,kCAOhD;IACD,MAAM,CAAC,KAAK,2DAET;IAEH,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,kBAAkB,CAAC,GAAG,EACtD,WAAW,EAAE,CAAC,EACd,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,KAC/B,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAG,6BAA6B,CAAC,CACH;CAC/F"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Context, Layer } from 'effect';
|
|
1
|
+
import { Context, Effect, Layer } from 'effect';
|
|
2
|
+
import type { Obj, Relation } from '@dxos/echo';
|
|
2
3
|
import type { Queue, QueueAPI, QueueFactory } from '@dxos/echo-db';
|
|
4
|
+
import type { DXN, QueueSubspaceTag } from '@dxos/keys';
|
|
3
5
|
declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions/QueueService", {
|
|
4
6
|
/**
|
|
5
7
|
* API to access the queues.
|
|
@@ -9,23 +11,34 @@ declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions
|
|
|
9
11
|
* The queue that is used to store the context of the current research.
|
|
10
12
|
* @deprecated Use `ContextQueueService` instead.
|
|
11
13
|
*/
|
|
12
|
-
readonly
|
|
14
|
+
readonly queue: Queue | undefined;
|
|
13
15
|
}>;
|
|
14
16
|
/**
|
|
15
17
|
* Gives access to all queues.
|
|
16
18
|
*/
|
|
17
19
|
export declare class QueueService extends QueueService_base {
|
|
18
20
|
static notAvailable: Layer.Layer<QueueService, never, never>;
|
|
19
|
-
static make: (queues: QueueFactory,
|
|
20
|
-
static
|
|
21
|
+
static make: (queues: QueueFactory, queue?: Queue) => Context.Tag.Service<QueueService>;
|
|
22
|
+
static layer: (queues: QueueFactory, queue?: Queue) => Layer.Layer<QueueService>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets a queue by its DXN.
|
|
25
|
+
*/
|
|
26
|
+
static getQueue: <T extends Obj.Any | Relation.Any = Obj.Any | Relation.Any>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new queue.
|
|
29
|
+
*/
|
|
30
|
+
static createQueue: <T extends Obj.Any | Relation.Any = Obj.Any | Relation.Any>(options?: {
|
|
31
|
+
subspaceTag?: QueueSubspaceTag;
|
|
32
|
+
}) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
21
33
|
}
|
|
22
34
|
declare const ContextQueueService_base: Context.TagClass<ContextQueueService, "@dxos/functions/ContextQueueService", {
|
|
23
|
-
readonly
|
|
35
|
+
readonly queue: Queue;
|
|
24
36
|
}>;
|
|
25
37
|
/**
|
|
26
38
|
* Gives access to a specific queue passed as a context.
|
|
27
39
|
*/
|
|
28
40
|
export declare class ContextQueueService extends ContextQueueService_base {
|
|
41
|
+
static layer: (queue: Queue) => Layer.Layer<ContextQueueService, never, never>;
|
|
29
42
|
}
|
|
30
43
|
export {};
|
|
31
44
|
//# sourceMappingURL=queues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;;IAQpD;;OAEG;qBACc,QAAQ;IAEzB;;;OAGG;oBACa,KAAK,GAAG,SAAS;;AAfrC;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAc/B;IACD,MAAM,CAAC,YAAY,0CAUhB;IAEH,MAAM,CAAC,IAAI,GAAI,QAAQ,YAAY,EAAE,QAAQ,KAAK,KAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAKpF;IAEF,MAAM,CAAC,KAAK,GAAI,QAAQ,YAAY,EAAE,QAAQ,KAAK,KAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CACf;IAEhE;;OAEG;IACH,MAAM,CAAC,QAAQ,GAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,EAC1E,KAAK,GAAG,KACP,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAsE;IAErH;;OAEG;IACH,MAAM,CAAC,WAAW,GAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,UAAU;QACzF,WAAW,CAAC,EAAE,gBAAgB,CAAC;KAChC,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAC2B;CAC5E;;oBAQmB,KAAK;;AANzB;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,wBAKtC;IACD,MAAM,CAAC,KAAK,GAAI,OAAO,KAAK,oDAAmD;CAChF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-function-execution-service.d.ts","sourceRoot":"","sources":["../../../../src/services/remote-function-execution-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"remote-function-execution-service.d.ts","sourceRoot":"","sources":["../../../../src/services/remote-function-execution-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;;qCAUL,MAAM,SAAS,GAAG,YAAY,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;;AANzF;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,mCAKjD;IACD,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,8BAA8B,CAAC;IAiBzG,MAAM,CAAC,IAAI,QAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAMnE;IAEF,MAAM,CAAC,SAAS,4DAAwF;CACzG"}
|
|
@@ -10,7 +10,7 @@ import { TracingService } from './tracing';
|
|
|
10
10
|
* List of all services.
|
|
11
11
|
*/
|
|
12
12
|
declare const SERVICES: {
|
|
13
|
-
readonly ai: typeof AiService;
|
|
13
|
+
readonly ai: typeof AiService.AiService;
|
|
14
14
|
readonly credentials: typeof CredentialsService;
|
|
15
15
|
readonly database: typeof DatabaseService;
|
|
16
16
|
readonly eventLogger: typeof ComputeEventLogger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-container.d.ts","sourceRoot":"","sources":["../../../../src/services/service-container.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAgC,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAI3C;;GAEG;AACH,QAAA,MAAM,QAAQ;;;;;;;;CAQyD,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;KAC5B,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,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,qCAAqC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAI3C;;GAEG;AACH,QAAA,MAAM,QAAQ;;;;;;;;CAQyD,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;KAC5B,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK;CACnG,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACxE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAMhE,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAA4B,CAAC;AAM7E;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAmD;IAEpE;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI;IAKnD,UAAU,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IAU7C,KAAK,IAAI,gBAAgB;IAKzB,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;CAsBrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-registry.d.ts","sourceRoot":"","sources":["../../../../src/services/service-registry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"service-registry.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AAM,CAAC,CAAC,GAAG,eAAe,CAC7F,CAAC;KACH,CAAoH;IAErH,MAAM,CAAC,YAAY,EAAE;QACnB,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAC/D,GAAG,IAAI,EAAE,IAAI,GACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACT,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAChB,CAAC,EACD,CAAC,EACD,OAAO,CAAC,CAAC,EAAE;aAAG,CAAC,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAAE,CAAC,MAAM,CAAC,CAAC,GAAG,eAAe,CAC7F,CAAC;KACH,CAGG;CACL"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from 'effect';
|
|
2
2
|
import { AgentStatus } from '@dxos/ai';
|
|
3
3
|
import { Obj } from '@dxos/echo';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Queue } from '@dxos/echo-db';
|
|
5
|
+
import type { ObjectId } from '@dxos/echo-schema';
|
|
6
|
+
import { DataType } from '@dxos/schema';
|
|
5
7
|
declare const TracingService_base: Context.TagClass<TracingService, "@dxos/functions/TracingService", {
|
|
8
|
+
/**
|
|
9
|
+
* Gets the parent message ID.
|
|
10
|
+
*/
|
|
11
|
+
getTraceContext: () => TracingService.TraceContext;
|
|
6
12
|
/**
|
|
7
13
|
* Write an event to the tracing queue.
|
|
8
14
|
* @param event - The event to write. Must be an a typed object.
|
|
9
15
|
*/
|
|
10
|
-
write(event:
|
|
16
|
+
write: (event: Obj.Any) => void;
|
|
11
17
|
}>;
|
|
12
18
|
/**
|
|
13
19
|
* Provides a way for compute primitives (functions, workflows, tools)
|
|
@@ -17,10 +23,34 @@ export declare class TracingService extends TracingService_base {
|
|
|
17
23
|
static noop: Context.Tag.Service<TracingService>;
|
|
18
24
|
static layerNoop: Layer.Layer<TracingService, never, never>;
|
|
19
25
|
static console: Context.Tag.Service<TracingService>;
|
|
26
|
+
static layerConsole: Layer.Layer<TracingService, never, never>;
|
|
27
|
+
static layerLogInfo: () => Layer.Layer<TracingService, never, never>;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a TracingService layer that emits events to the parent tracing service.
|
|
30
|
+
*/
|
|
31
|
+
static layerSubframe: (mapContext: (currentContext: TracingService.TraceContext) => TracingService.TraceContext) => Layer.Layer<TracingService, never, TracingService>;
|
|
32
|
+
static layerQueue: (queue: Queue) => Layer.Layer<TracingService, never, never>;
|
|
20
33
|
/**
|
|
21
34
|
* Emit the current human-readable execution status.
|
|
22
35
|
*/
|
|
23
|
-
static emitStatus: (data: Obj.MakeProps<typeof AgentStatus>) => Effect.Effect<
|
|
36
|
+
static emitStatus: (data: Obj.MakeProps<typeof AgentStatus>) => Effect.Effect<void, never, TracingService>;
|
|
37
|
+
static emitConverationMessage: (data: Obj.MakeProps<typeof DataType.Message>) => Effect.Effect<void, never, TracingService>;
|
|
24
38
|
}
|
|
39
|
+
export declare namespace TracingService {
|
|
40
|
+
interface TraceContext {
|
|
41
|
+
/**
|
|
42
|
+
* If this thread sprung from a tool call, this is the ID of the message containing the tool call.
|
|
43
|
+
*/
|
|
44
|
+
parentMessage?: ObjectId;
|
|
45
|
+
/**
|
|
46
|
+
* If the current thread is a byproduct of a tool call, this is the ID of the tool call.
|
|
47
|
+
*/
|
|
48
|
+
toolCallId?: string;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Goes into {@link DataType.Message['properties']}
|
|
53
|
+
*/
|
|
54
|
+
export declare const MESSAGE_PROPERTY_TOOL_CALL_ID: "toolCallId";
|
|
25
55
|
export {};
|
|
26
56
|
//# sourceMappingURL=tracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;;IASpC;;OAEG;qBACc,MAAM,cAAc,CAAC,YAAY;IAElD;;;OAGG;WACI,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,KAAK,IAAI;;AAhBnC;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAcjC;IACD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAoD;IAEpG,MAAM,CAAC,SAAS,4CAAsD;IAEtE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAMjD;IAEF,MAAM,CAAC,YAAY,4CAAyD;IAE5E,MAAM,CAAC,YAAY,kDAQd;IAEL;;OAEG;IACH,MAAM,CAAC,aAAa,GAAI,YAAY,CAAC,cAAc,EAAE,cAAc,CAAC,YAAY,KAAK,cAAc,CAAC,YAAY,wDAW5G;IAEJ,MAAM,CAAC,UAAU,GAAI,OAAO,KAAK,+CAU7B;IAEJ;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,WAAW,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAUrG;IAEL,MAAM,CAAC,sBAAsB,EAAE,CAC7B,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,KACzC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAY5C;CACJ;AAED,yBAAiB,cAAc,CAAC;IAC9B,UAAiB,YAAY;QAC3B;;WAEG;QACH,aAAa,CAAC,EAAE,QAAQ,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;CACF;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Layer } from 'effect';
|
|
2
1
|
import type { Schema } from 'effect';
|
|
2
|
+
import { Layer } from 'effect';
|
|
3
3
|
import type { EchoHostIndexingConfig } from '@dxos/echo-pipeline';
|
|
4
4
|
import { DatabaseService, QueueService } from '../services';
|
|
5
|
+
export declare const testStoragePath: ({ name }: {
|
|
6
|
+
name?: string;
|
|
7
|
+
}) => string;
|
|
5
8
|
export type TestDatabaseOptions = {
|
|
6
9
|
indexing?: Partial<EchoHostIndexingConfig>;
|
|
7
10
|
types?: Schema.Schema.AnyNoContext[];
|
|
11
|
+
storagePath?: string;
|
|
8
12
|
};
|
|
9
|
-
export declare const TestDatabaseLayer: ({ indexing, types }?: TestDatabaseOptions) => Layer.Layer<DatabaseService | QueueService, never, never>;
|
|
13
|
+
export declare const TestDatabaseLayer: ({ indexing, types, storagePath }?: TestDatabaseOptions) => Layer.Layer<DatabaseService | QueueService, never, never>;
|
|
10
14
|
//# sourceMappingURL=layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../../../src/testing/layer.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../../../src/testing/layer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAmB,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIhD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAOlE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI5D,eAAO,MAAM,eAAe,GAAI,UAAuC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,WAEvF,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,mCAAkC,mBAAwB,8DAkEzF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/testing/logger.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/testing/logger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,QAAQ,CAAC;AAI9C,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,aAAa,CAAC;AAEzE,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAG9D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-database.test.d.ts","sourceRoot":"","sources":["../../../../src/testing/persist-database.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Context } from 'effect';
|
|
2
2
|
import type { Space } from '@dxos/client/echo';
|
|
3
3
|
import type { EchoDatabase, QueueFactory } from '@dxos/echo-db';
|
|
4
|
-
import { type
|
|
4
|
+
import { type ComputeEventLogger, type CredentialsService, ServiceContainer, type ServiceCredential, type TracingService } from '../services';
|
|
5
5
|
export type OneOf<T> = {
|
|
6
6
|
[K in keyof T]: {
|
|
7
7
|
[P in K]: T[P];
|