@dxos/functions 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
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/index.mjs +273 -74
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +273 -74
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/errors.d.ts +24 -32
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/operation-compatibility.test.d.ts +2 -0
- package/dist/types/src/operation-compatibility.test.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.map +1 -1
- package/dist/types/src/sdk.d.ts +18 -4
- 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 +5 -0
- 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/tracing.d.ts +37 -3
- package/dist/types/src/services/tracing.d.ts.map +1 -1
- package/dist/types/src/types/Function.d.ts +33 -44
- package/dist/types/src/types/Function.d.ts.map +1 -1
- package/dist/types/src/types/Script.d.ts +8 -15
- package/dist/types/src/types/Script.d.ts.map +1 -1
- package/dist/types/src/types/Trigger.d.ts +37 -57
- package/dist/types/src/types/Trigger.d.ts.map +1 -1
- package/dist/types/src/types/TriggerEvent.d.ts +33 -2
- package/dist/types/src/types/TriggerEvent.d.ts.map +1 -1
- package/dist/types/src/types/url.d.ts +4 -3
- package/dist/types/src/types/url.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -16
- package/src/errors.ts +4 -4
- package/src/operation-compatibility.test.ts +185 -0
- package/src/protocol/functions-ai-http-client.ts +67 -0
- package/src/protocol/protocol.ts +118 -12
- package/src/sdk.ts +55 -6
- package/src/services/credentials.ts +31 -15
- package/src/services/event-logger.ts +2 -2
- package/src/services/function-invocation-service.ts +14 -0
- package/src/services/index.ts +0 -2
- package/src/services/tracing.ts +63 -4
- package/src/types/Function.ts +12 -10
- package/src/types/Script.ts +3 -2
- package/src/types/Trigger.ts +9 -6
- package/src/types/TriggerEvent.ts +9 -3
- package/src/types/url.ts +4 -3
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { BaseError, type BaseErrorOptions } from '@dxos/errors';
|
|
2
2
|
declare const ServiceNotAvailableError_base: {
|
|
3
3
|
new (options?: BaseErrorOptions): {
|
|
4
|
-
|
|
4
|
+
name: "ServiceNotAvailable";
|
|
5
5
|
context: Record<string, unknown>;
|
|
6
|
-
readonly name: "SERVICE_NOT_AVAILABLE";
|
|
7
6
|
readonly message: string;
|
|
8
|
-
readonly _tag: "
|
|
7
|
+
readonly _tag: "ServiceNotAvailable";
|
|
9
8
|
stack?: string;
|
|
10
9
|
cause?: unknown;
|
|
11
10
|
};
|
|
12
|
-
|
|
11
|
+
name: "ServiceNotAvailable";
|
|
13
12
|
is(error: unknown): error is BaseError;
|
|
14
13
|
wrap(options?: Omit<BaseErrorOptions, "cause"> & {
|
|
15
14
|
ifTypeDiffers?: boolean;
|
|
16
15
|
}): (error: unknown) => {
|
|
17
|
-
|
|
16
|
+
name: "ServiceNotAvailable";
|
|
18
17
|
context: Record<string, unknown>;
|
|
19
|
-
readonly name: "SERVICE_NOT_AVAILABLE";
|
|
20
18
|
readonly message: string;
|
|
21
|
-
readonly _tag: "
|
|
19
|
+
readonly _tag: "ServiceNotAvailable";
|
|
22
20
|
stack?: string;
|
|
23
21
|
cause?: unknown;
|
|
24
22
|
};
|
|
25
|
-
extend<
|
|
23
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
26
24
|
isError(error: unknown): error is Error;
|
|
27
25
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
28
26
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
@@ -33,28 +31,26 @@ export declare class ServiceNotAvailableError extends ServiceNotAvailableError_b
|
|
|
33
31
|
}
|
|
34
32
|
declare const FunctionNotFoundError_base: {
|
|
35
33
|
new (options?: BaseErrorOptions): {
|
|
36
|
-
|
|
34
|
+
name: "FunctionNotFound";
|
|
37
35
|
context: Record<string, unknown>;
|
|
38
|
-
readonly name: "FUNCTION_NOT_FOUND";
|
|
39
36
|
readonly message: string;
|
|
40
|
-
readonly _tag: "
|
|
37
|
+
readonly _tag: "FunctionNotFound";
|
|
41
38
|
stack?: string;
|
|
42
39
|
cause?: unknown;
|
|
43
40
|
};
|
|
44
|
-
|
|
41
|
+
name: "FunctionNotFound";
|
|
45
42
|
is(error: unknown): error is BaseError;
|
|
46
43
|
wrap(options?: Omit<BaseErrorOptions, "cause"> & {
|
|
47
44
|
ifTypeDiffers?: boolean;
|
|
48
45
|
}): (error: unknown) => {
|
|
49
|
-
|
|
46
|
+
name: "FunctionNotFound";
|
|
50
47
|
context: Record<string, unknown>;
|
|
51
|
-
readonly name: "FUNCTION_NOT_FOUND";
|
|
52
48
|
readonly message: string;
|
|
53
|
-
readonly _tag: "
|
|
49
|
+
readonly _tag: "FunctionNotFound";
|
|
54
50
|
stack?: string;
|
|
55
51
|
cause?: unknown;
|
|
56
52
|
};
|
|
57
|
-
extend<
|
|
53
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
58
54
|
isError(error: unknown): error is Error;
|
|
59
55
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
60
56
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
@@ -65,28 +61,26 @@ export declare class FunctionNotFoundError extends FunctionNotFoundError_base {
|
|
|
65
61
|
}
|
|
66
62
|
declare const FunctionError_base: {
|
|
67
63
|
new (options?: BaseErrorOptions): {
|
|
68
|
-
|
|
64
|
+
name: "FunctionError";
|
|
69
65
|
context: Record<string, unknown>;
|
|
70
|
-
readonly name: "FUNCTION_ERROR";
|
|
71
66
|
readonly message: string;
|
|
72
|
-
readonly _tag: "
|
|
67
|
+
readonly _tag: "FunctionError";
|
|
73
68
|
stack?: string;
|
|
74
69
|
cause?: unknown;
|
|
75
70
|
};
|
|
76
|
-
|
|
71
|
+
name: "FunctionError";
|
|
77
72
|
is(error: unknown): error is BaseError;
|
|
78
73
|
wrap(options?: Omit<BaseErrorOptions, "cause"> & {
|
|
79
74
|
ifTypeDiffers?: boolean;
|
|
80
75
|
}): (error: unknown) => {
|
|
81
|
-
|
|
76
|
+
name: "FunctionError";
|
|
82
77
|
context: Record<string, unknown>;
|
|
83
|
-
readonly name: "FUNCTION_ERROR";
|
|
84
78
|
readonly message: string;
|
|
85
|
-
readonly _tag: "
|
|
79
|
+
readonly _tag: "FunctionError";
|
|
86
80
|
stack?: string;
|
|
87
81
|
cause?: unknown;
|
|
88
82
|
};
|
|
89
|
-
extend<
|
|
83
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
90
84
|
isError(error: unknown): error is Error;
|
|
91
85
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
92
86
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
@@ -96,28 +90,26 @@ export declare class FunctionError extends FunctionError_base {
|
|
|
96
90
|
}
|
|
97
91
|
declare const TriggerStateNotFoundError_base: {
|
|
98
92
|
new (options?: BaseErrorOptions): {
|
|
99
|
-
|
|
93
|
+
name: "TriggerStateNotFound";
|
|
100
94
|
context: Record<string, unknown>;
|
|
101
|
-
readonly name: "TRIGGER_STATE_NOT_FOUND";
|
|
102
95
|
readonly message: string;
|
|
103
|
-
readonly _tag: "
|
|
96
|
+
readonly _tag: "TriggerStateNotFound";
|
|
104
97
|
stack?: string;
|
|
105
98
|
cause?: unknown;
|
|
106
99
|
};
|
|
107
|
-
|
|
100
|
+
name: "TriggerStateNotFound";
|
|
108
101
|
is(error: unknown): error is BaseError;
|
|
109
102
|
wrap(options?: Omit<BaseErrorOptions, "cause"> & {
|
|
110
103
|
ifTypeDiffers?: boolean;
|
|
111
104
|
}): (error: unknown) => {
|
|
112
|
-
|
|
105
|
+
name: "TriggerStateNotFound";
|
|
113
106
|
context: Record<string, unknown>;
|
|
114
|
-
readonly name: "TRIGGER_STATE_NOT_FOUND";
|
|
115
107
|
readonly message: string;
|
|
116
|
-
readonly _tag: "
|
|
108
|
+
readonly _tag: "TriggerStateNotFound";
|
|
117
109
|
stack?: string;
|
|
118
110
|
cause?: unknown;
|
|
119
111
|
};
|
|
120
|
-
extend<
|
|
112
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
121
113
|
isError(error: unknown): error is Error;
|
|
122
114
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
123
115
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;qBAiB4O,CAAC;;;;;;;;;;;;;;;AAf7S,qBAAa,wBAAyB,SAAQ,6BAAgE;gBAChG,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;CAGzE;;;;;;;;;;;;;qBAW2S,CAAC;;;;;;;;;;;;;;;AAT7S,qBAAa,qBAAsB,SAAQ,0BAA0D;gBACvF,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC;CAG7E;;;;;;;;;;;;;qBAK2S,CAAC;;;;;;;;;;;;;;;AAH7S,qBAAa,aAAc,SAAQ,kBAA8D;CAAG;;;;;;;;;;;;;qBAGwM,CAAC;;;;;;;;;;;;;;;AAD7S,qBAAa,yBAA0B,SAAQ,8BAAmE;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-compatibility.test.d.ts","sourceRoot":"","sources":["../../../src/operation-compatibility.test.ts"],"names":[],"mappings":""}
|
|
@@ -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 +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,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAyB,MAAM,QAAQ,CAAC;AAKnE;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,kBAAkB,KAAG,gBAAgB,CAAC,IAwE/E,CAAC"}
|
package/dist/types/src/sdk.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import * as Effect from 'effect/Effect';
|
|
|
3
3
|
import * as Schema from 'effect/Schema';
|
|
4
4
|
import { type AiService } from '@dxos/ai';
|
|
5
5
|
import { Type } from '@dxos/echo';
|
|
6
|
-
import { type
|
|
6
|
+
import { type Database } from '@dxos/echo';
|
|
7
|
+
import { Operation } from '@dxos/operation';
|
|
7
8
|
import { type CredentialsService, type FunctionInvocationService, type QueueService, type TracingService } from './services';
|
|
8
9
|
import { Function } from './types';
|
|
9
10
|
/**
|
|
@@ -13,7 +14,7 @@ export type InvocationServices = TracingService;
|
|
|
13
14
|
/**
|
|
14
15
|
* Services that are available to invoked functions.
|
|
15
16
|
*/
|
|
16
|
-
export type FunctionServices = InvocationServices | AiService.AiService | CredentialsService |
|
|
17
|
+
export type FunctionServices = InvocationServices | AiService.AiService | CredentialsService | Database.Service | QueueService | FunctionInvocationService;
|
|
17
18
|
/**
|
|
18
19
|
* Function handler.
|
|
19
20
|
*/
|
|
@@ -46,7 +47,7 @@ export type FunctionDefinition<T = any, O = any, S extends FunctionServices = Fu
|
|
|
46
47
|
* List of types the function uses.
|
|
47
48
|
* This is used to ensure that the types are available when the function is executed.
|
|
48
49
|
*/
|
|
49
|
-
types: readonly Type.
|
|
50
|
+
types: readonly Type.Entity.Any[];
|
|
50
51
|
/**
|
|
51
52
|
* Keys of the required services.
|
|
52
53
|
*/
|
|
@@ -81,18 +82,31 @@ export type FunctionProps<T, O> = {
|
|
|
81
82
|
* List of types the function uses.
|
|
82
83
|
* This is used to ensure that the types are available when the function is executed.
|
|
83
84
|
*/
|
|
84
|
-
types?: readonly Type.
|
|
85
|
+
types?: readonly Type.Entity.Any[];
|
|
85
86
|
services?: readonly Context.Tag<any, any>[];
|
|
86
87
|
handler: FunctionHandler<T, O, FunctionServices>;
|
|
87
88
|
};
|
|
88
89
|
export declare const defineFunction: {
|
|
89
90
|
<I, O>(params: FunctionProps<I, O>): FunctionDefinition<I, O, FunctionServices>;
|
|
90
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* Converts a FunctionDefinition to an OperationDefinition with handler.
|
|
94
|
+
* The function handler is adapted to the OperationHandler format.
|
|
95
|
+
*
|
|
96
|
+
* Note: FunctionDefinition stores service keys as strings, not Tag types,
|
|
97
|
+
* so we can't use Operation.withHandler's type inference here.
|
|
98
|
+
*/
|
|
99
|
+
export declare const toOperation: <T, O, S extends FunctionServices = FunctionServices>(functionDef: FunctionDefinition<T, O, S>) => Operation.Definition<T, O> & {
|
|
100
|
+
handler: Operation.Handler<T, O, any, S>;
|
|
101
|
+
};
|
|
91
102
|
export declare const FunctionDefinition: {
|
|
92
103
|
make: <I, O>(params: FunctionProps<I, O>) => FunctionDefinition<I, O, FunctionServices>;
|
|
93
104
|
isFunction: (value: unknown) => value is FunctionDefinition.Any;
|
|
94
105
|
serialize: (functionDef: FunctionDefinition.Any) => Function.Function;
|
|
95
106
|
deserialize: (functionObj: Function.Function) => FunctionDefinition.Any;
|
|
107
|
+
toOperation: <T, O, S extends FunctionServices = FunctionServices>(functionDef: FunctionDefinition<T, O, S>) => Operation.Definition<T, O> & {
|
|
108
|
+
handler: Operation.Handler<T, O, any, S>;
|
|
109
|
+
};
|
|
96
110
|
};
|
|
97
111
|
export declare const serializeFunction: (functionDef: FunctionDefinition.Any) => Function.Function;
|
|
98
112
|
export declare const deserializeFunction: (functionObj: Function.Function) => FunctionDefinition<unknown, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,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AAE,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;KAAE;CAqD3E,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,aAAa,kBAAkB,CAAC,GAAG,KAAG,QAAQ,CAAC,QAchF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,aAAa,QAAQ,CAAC,QAAQ,KAAG,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAiBvG,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,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,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,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,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|
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
|
-
nodeId:
|
|
56
|
-
property:
|
|
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 nodeId: string;
|
|
51
|
+
readonly property: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: "compute-output";
|
|
54
|
+
readonly value: any;
|
|
55
|
+
readonly nodeId: string;
|
|
56
|
+
readonly property: 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,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjF,eAAO,MAAM,YAAY
|
|
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,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;wBAEyD,CAAC;;kBAOjE,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"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as Context from 'effect/Context';
|
|
2
2
|
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import type { FunctionNotFoundError } from '../errors';
|
|
3
5
|
import { type FunctionDefinition, type InvocationServices } from '../sdk';
|
|
4
6
|
declare const FunctionInvocationService_base: Context.TagClass<FunctionInvocationService, "@dxos/functions/FunctionInvocationService", {
|
|
5
7
|
invokeFunction<I, O>(functionDef: FunctionDefinition<I, O, any>, input: I): Effect.Effect<O, never, InvocationServices>;
|
|
8
|
+
resolveFunction(key: string): Effect.Effect<FunctionDefinition.Any, FunctionNotFoundError>;
|
|
6
9
|
}>;
|
|
7
10
|
export declare class FunctionInvocationService extends FunctionInvocationService_base {
|
|
11
|
+
static layerNotAvailable: Layer.Layer<FunctionInvocationService, never, never>;
|
|
8
12
|
static invokeFunction: <I, O>(functionDef: FunctionDefinition<I, O, any>, input: I) => Effect.Effect<O, never, FunctionInvocationService | InvocationServices>;
|
|
13
|
+
static resolveFunction: (key: string) => Effect.Effect<FunctionDefinition.Any, FunctionNotFoundError, FunctionInvocationService>;
|
|
9
14
|
}
|
|
10
15
|
export {};
|
|
11
16
|
//# 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,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;;mBAKvD,CAAC,EAAE,CAAC,eACJ,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SACnC,CAAC,GACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC;yBAEzB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,qBAAqB,CAAC;;AAR9F,qBAAa,yBAA0B,SAAQ,8BAU5C;IACD,MAAM,CAAC,iBAAiB,uDAGrB;IAEH,MAAM,CAAC,cAAc,GAAI,CAAC,EAAE,CAAC,EAC3B,aAAa,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAC1C,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,kBAAkB,CAAC,GAAG,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACW;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"}
|
|
@@ -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 } 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,7 +15,15 @@ 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
|
+
traceInvocationStart({ payload, target, }: {
|
|
20
|
+
payload: TracingService.FunctionInvocationPayload;
|
|
21
|
+
target?: DXN;
|
|
22
|
+
}): Effect.Effect<TracingService.InvocationTraceData>;
|
|
23
|
+
traceInvocationEnd({ trace, exception, }: {
|
|
24
|
+
trace: TracingService.InvocationTraceData;
|
|
25
|
+
exception?: any;
|
|
26
|
+
}): Effect.Effect<void>;
|
|
18
27
|
}>;
|
|
19
28
|
/**
|
|
20
29
|
* Provides a way for compute primitives (functions, workflows, tools)
|
|
@@ -27,6 +36,12 @@ export declare class TracingService extends TracingService_base {
|
|
|
27
36
|
* Creates a TracingService layer that emits events to the parent tracing service.
|
|
28
37
|
*/
|
|
29
38
|
static layerSubframe: (mapContext: (currentContext: TracingService.TraceContext) => TracingService.TraceContext) => Layer.Layer<TracingService, never, TracingService>;
|
|
39
|
+
/**
|
|
40
|
+
* Create sublayer to trace an invocation.
|
|
41
|
+
* @param data
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
static layerInvocation: (data: TracingService.InvocationTraceData) => Layer.Layer<TracingService, never, TracingService>;
|
|
30
45
|
/**
|
|
31
46
|
* Emit the current human-readable execution status.
|
|
32
47
|
*/
|
|
@@ -35,6 +50,7 @@ export declare class TracingService extends TracingService_base {
|
|
|
35
50
|
}
|
|
36
51
|
export declare namespace TracingService {
|
|
37
52
|
interface TraceContext {
|
|
53
|
+
currentInvocation?: InvocationTraceData;
|
|
38
54
|
/**
|
|
39
55
|
* If this thread sprung from a tool call, this is the ID of the message containing the tool call.
|
|
40
56
|
*/
|
|
@@ -45,6 +61,24 @@ export declare namespace TracingService {
|
|
|
45
61
|
toolCallId?: string;
|
|
46
62
|
debugInfo?: unknown;
|
|
47
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Trace data for a function/trigger invocation.
|
|
66
|
+
*/
|
|
67
|
+
interface InvocationTraceData {
|
|
68
|
+
invocationId: ObjectId;
|
|
69
|
+
invocationTraceQueue?: DXN.String;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Payload for a function/trigger invocation.
|
|
73
|
+
*/
|
|
74
|
+
interface FunctionInvocationPayload {
|
|
75
|
+
data?: any;
|
|
76
|
+
inputNodeId?: string;
|
|
77
|
+
trigger?: {
|
|
78
|
+
id: string;
|
|
79
|
+
kind: Trigger.Kind;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
48
82
|
}
|
|
49
83
|
/**
|
|
50
84
|
* 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,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;AACv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E,KAAK,EAAE,cAAc,CAAC,CAW5C;IAEH,MAAM,CAAC,sBAAsB,EAAE,CAC7B,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,KACxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAa5C;CACJ;AAED,yBAAiB,cAAc,CAAC;IAC9B,UAAiB,YAAY;QAC3B,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;QAExC;;WAEG;QACH,aAAa,CAAC,EAAE,QAAQ,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB;IAED;;OAEG;IACH,UAAiB,mBAAmB;QAClC,YAAY,EAAE,QAAQ,CAAC;QACvB,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;KACnC;IAED;;OAEG;IACH,UAAiB,yBAAyB;QACxC,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE;YACR,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC;SACpB,CAAC;KACH;CACF;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
|
|
@@ -3,56 +3,45 @@ import { Obj, Type } from '@dxos/echo';
|
|
|
3
3
|
/**
|
|
4
4
|
* Function deployment.
|
|
5
5
|
*/
|
|
6
|
-
export declare const Function: Type.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
key: Schema.optional<typeof Schema.String>;
|
|
12
|
-
name: typeof Schema.NonEmptyString;
|
|
13
|
-
version: typeof Schema.String;
|
|
14
|
-
description: Schema.optional<typeof Schema.String>;
|
|
15
|
-
/**
|
|
16
|
-
* ISO date string of the last deployment.
|
|
17
|
-
*/
|
|
18
|
-
updated: Schema.optional<typeof Schema.String>;
|
|
19
|
-
source: Schema.optional<import("@dxos/echo/internal").RefSchema<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
20
|
-
description?: string | undefined;
|
|
21
|
-
source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
22
|
-
content: string;
|
|
6
|
+
export declare const Function: Type.Obj<{
|
|
7
|
+
readonly version: string;
|
|
8
|
+
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
9
|
+
readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
10
|
+
readonly content: string;
|
|
23
11
|
}>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
readonly description?: string | undefined;
|
|
13
|
+
readonly name?: string | undefined;
|
|
14
|
+
readonly changed?: boolean | undefined;
|
|
15
|
+
}> | undefined;
|
|
16
|
+
readonly description?: string | undefined;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly key?: string | undefined;
|
|
19
|
+
readonly updated?: string | undefined;
|
|
20
|
+
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
21
|
+
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
22
|
+
readonly services?: readonly string[] | undefined;
|
|
23
|
+
readonly binding?: string | undefined;
|
|
24
|
+
}, Schema.Struct.Fields>;
|
|
36
25
|
export interface Function extends Schema.Schema.Type<typeof Function> {
|
|
37
26
|
}
|
|
38
27
|
export declare const make: (props: Obj.MakeProps<typeof Function>) => Obj.Obj<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
44
|
-
content: string;
|
|
28
|
+
readonly version: string;
|
|
29
|
+
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
30
|
+
readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
31
|
+
readonly content: string;
|
|
45
32
|
}>;
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
readonly description?: string | undefined;
|
|
34
|
+
readonly name?: string | undefined;
|
|
35
|
+
readonly changed?: boolean | undefined;
|
|
48
36
|
}> | undefined;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
readonly description?: string | undefined;
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly key?: string | undefined;
|
|
40
|
+
readonly updated?: string | undefined;
|
|
41
|
+
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
42
|
+
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
43
|
+
readonly services?: readonly string[] | undefined;
|
|
44
|
+
readonly binding?: string | undefined;
|
|
56
45
|
}>;
|
|
57
46
|
/**
|
|
58
47
|
* Copies properties from source to target.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Function.d.ts","sourceRoot":"","sources":["../../../../src/types/Function.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAA0B,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAK/D;;GAEG;AACH,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"Function.d.ts","sourceRoot":"","sources":["../../../../src/types/Function.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAA0B,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAK/D;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;wBA4CpB,CAAC;AAEF,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE,eAAO,MAAM,IAAI,GAAI,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,QAAQ,CAAC;;;;;;;;;;;;;;;;;;EAA8B,CAAC;AAEzF;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,QAAQ,EAAE,QAAQ,QAAQ,SAYzD,CAAC"}
|