@dxos/functions 0.8.4-main.c85a9c8dae → 0.8.4-main.cb12b3f963
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/index.mjs +155 -920
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -1
- 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 +5 -112
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/services/credentials.d.ts +15 -38
- package/dist/types/src/services/credentials.d.ts.map +1 -1
- package/dist/types/src/services/function-invocation-service.d.ts +5 -6
- package/dist/types/src/services/function-invocation-service.d.ts.map +1 -1
- package/dist/types/src/services/index.d.ts +1 -4
- package/dist/types/src/services/index.d.ts.map +1 -1
- package/dist/types/src/services/queues.d.ts +1 -46
- package/dist/types/src/services/queues.d.ts.map +1 -1
- package/dist/types/src/services/tracing.d.ts +1 -84
- package/dist/types/src/services/tracing.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -4
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/url.d.ts +3 -3
- package/dist/types/src/types/url.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -16
- package/src/index.ts +0 -2
- package/src/protocol/protocol.test.ts +9 -10
- package/src/protocol/protocol.ts +68 -34
- package/src/sdk.ts +10 -278
- package/src/services/credentials.ts +75 -118
- package/src/services/function-invocation-service.ts +6 -10
- package/src/services/index.ts +1 -4
- package/src/services/queues.ts +1 -78
- package/src/services/tracing.ts +0 -159
- package/src/types/index.ts +0 -4
- package/src/types/url.ts +3 -3
- package/dist/types/src/errors.d.ts +0 -121
- package/dist/types/src/errors.d.ts.map +0 -1
- package/dist/types/src/example/fib.d.ts +0 -7
- package/dist/types/src/example/fib.d.ts.map +0 -1
- package/dist/types/src/example/forex-effect.d.ts +0 -3
- package/dist/types/src/example/forex-effect.d.ts.map +0 -1
- package/dist/types/src/example/index.d.ts +0 -12
- package/dist/types/src/example/index.d.ts.map +0 -1
- package/dist/types/src/example/reply.d.ts +0 -3
- package/dist/types/src/example/reply.d.ts.map +0 -1
- package/dist/types/src/example/sleep.d.ts +0 -5
- package/dist/types/src/example/sleep.d.ts.map +0 -1
- package/dist/types/src/operation-compatibility.test.d.ts +0 -2
- package/dist/types/src/operation-compatibility.test.d.ts.map +0 -1
- package/dist/types/src/services/event-logger.d.ts +0 -81
- package/dist/types/src/services/event-logger.d.ts.map +0 -1
- package/dist/types/src/types/Function.d.ts +0 -52
- package/dist/types/src/types/Function.d.ts.map +0 -1
- package/dist/types/src/types/Script.d.ts +0 -21
- package/dist/types/src/types/Script.d.ts.map +0 -1
- package/dist/types/src/types/Trigger.d.ts +0 -122
- package/dist/types/src/types/Trigger.d.ts.map +0 -1
- package/dist/types/src/types/TriggerEvent.d.ts +0 -75
- package/dist/types/src/types/TriggerEvent.d.ts.map +0 -1
- package/src/errors.ts +0 -21
- package/src/example/fib.ts +0 -32
- package/src/example/forex-effect.ts +0 -40
- package/src/example/index.ts +0 -13
- package/src/example/reply.ts +0 -21
- package/src/example/sleep.ts +0 -24
- package/src/operation-compatibility.test.ts +0 -185
- package/src/services/event-logger.ts +0 -127
- package/src/types/Function.ts +0 -83
- package/src/types/Script.ts +0 -34
- package/src/types/Trigger.ts +0 -153
- package/src/types/TriggerEvent.ts +0 -62
|
@@ -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,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAO/E;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,CAAC,SAAS,GACnB,UAAU,CAAC,kBAAkB,GAC7B,QAAQ,CAAC,OAAO,GAEhB,YAAY,GACZ,IAAI,CAAC,WAAW,GAChB,KAAK,CAAC,YAAY,GAClB,yBAAyB,GACzB,SAAS,CAAC,OAAO,CAAC"}
|
|
@@ -1,50 +1,27 @@
|
|
|
1
1
|
import * as HttpClient from '@effect/platform/HttpClient';
|
|
2
2
|
import type * as Config from 'effect/Config';
|
|
3
3
|
import * as Context from 'effect/Context';
|
|
4
|
-
import * as Effect from 'effect/Effect';
|
|
5
4
|
import * as Layer from 'effect/Layer';
|
|
6
5
|
import * as Redacted from 'effect/Redacted';
|
|
6
|
+
import { Credential } from '@dxos/compute';
|
|
7
7
|
import { Database } from '@dxos/echo';
|
|
8
|
-
export
|
|
9
|
-
service?: string;
|
|
10
|
-
};
|
|
11
|
-
export type ServiceCredential = {
|
|
12
|
-
service: string;
|
|
13
|
-
apiKey?: string;
|
|
14
|
-
};
|
|
15
|
-
declare const CredentialsService_base: Context.TagClass<CredentialsService, "@dxos/functions/CredentialsService", {
|
|
16
|
-
/**
|
|
17
|
-
* Query all.
|
|
18
|
-
*/
|
|
19
|
-
queryCredentials: (query: CredentialQuery) => Promise<ServiceCredential[]>;
|
|
20
|
-
/**
|
|
21
|
-
* Get a single credential.
|
|
22
|
-
* @throws {Error} If no credential is found.
|
|
23
|
-
*/
|
|
24
|
-
getCredential: (query: CredentialQuery) => Promise<ServiceCredential>;
|
|
25
|
-
}>;
|
|
26
|
-
export declare class CredentialsService extends CredentialsService_base {
|
|
27
|
-
static getCredential: (query: CredentialQuery) => Effect.Effect<ServiceCredential, never, CredentialsService>;
|
|
28
|
-
static getApiKey: (query: CredentialQuery) => Effect.Effect<Redacted.Redacted<string>, never, CredentialsService>;
|
|
29
|
-
static configuredLayer: (credentials: ServiceCredential[]) => Layer.Layer<CredentialsService, never, never>;
|
|
30
|
-
static layerConfig: (credentials: {
|
|
31
|
-
service: string;
|
|
32
|
-
apiKey: Config.Config<Redacted.Redacted<string>>;
|
|
33
|
-
}[]) => Layer.Layer<CredentialsService, import("effect/ConfigError").ConfigError, never>;
|
|
34
|
-
static layerFromDatabase: ({ caching }?: {
|
|
35
|
-
caching?: boolean;
|
|
36
|
-
}) => Layer.Layer<CredentialsService, never, Database.Service>;
|
|
37
|
-
}
|
|
38
|
-
export declare class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {
|
|
8
|
+
export declare class ConfiguredCredentialsService implements Context.Tag.Service<Credential.CredentialsService> {
|
|
39
9
|
private readonly credentials;
|
|
40
|
-
constructor(credentials?: ServiceCredential[]);
|
|
41
|
-
addCredentials(credentials: ServiceCredential[]): ConfiguredCredentialsService;
|
|
42
|
-
queryCredentials(query: CredentialQuery): Promise<ServiceCredential[]>;
|
|
43
|
-
getCredential(query: CredentialQuery): Promise<ServiceCredential>;
|
|
10
|
+
constructor(credentials?: Credential.ServiceCredential[]);
|
|
11
|
+
addCredentials(credentials: Credential.ServiceCredential[]): ConfiguredCredentialsService;
|
|
12
|
+
queryCredentials(query: Credential.CredentialQuery): Promise<Credential.ServiceCredential[]>;
|
|
13
|
+
getCredential(query: Credential.CredentialQuery): Promise<Credential.ServiceCredential>;
|
|
44
14
|
}
|
|
45
15
|
/**
|
|
46
16
|
* Maps the request to include the given token in the Authorization header.
|
|
47
17
|
*/
|
|
48
|
-
export declare const withAuthorization: (token: string, kind?:
|
|
49
|
-
export
|
|
18
|
+
export declare const withAuthorization: (token: string, kind?: 'Bearer' | 'Basic') => <E, R>(self: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, R>;
|
|
19
|
+
export declare const configuredCredentialsLayer: (credentials: Credential.ServiceCredential[]) => Layer.Layer<Credential.CredentialsService, never, never>;
|
|
20
|
+
export declare const credentialsLayerConfig: (credentials: {
|
|
21
|
+
service: string;
|
|
22
|
+
apiKey: Config.Config<Redacted.Redacted<string>>;
|
|
23
|
+
}[]) => Layer.Layer<Credential.CredentialsService, import("effect/ConfigError").ConfigError, never>;
|
|
24
|
+
export declare const credentialsLayerFromDatabase: ({ caching }?: {
|
|
25
|
+
caching?: boolean;
|
|
26
|
+
}) => Layer.Layer<Credential.CredentialsService, never, Database.Service>;
|
|
50
27
|
//# 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;
|
|
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;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,qBAAa,4BAA6B,YAAW,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IACzF,OAAO,CAAC,QAAQ,CAAC,WAAW;IAAxC,YAA6B,WAAW,GAAE,UAAU,CAAC,iBAAiB,EAAO,EAAI;IAEjF,cAAc,CAAC,WAAW,EAAE,UAAU,CAAC,iBAAiB,EAAE,GAAG,4BAA4B,CAGxF;IAEK,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAEjG;IAEK,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAO5F;CACF;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,UAAW,MAAM,SAAS,QAAQ,GAAG,OAAO,uFAItE,CAAC;AAEL,eAAO,MAAM,0BAA0B,gBAAiB,UAAU,CAAC,iBAAiB,EAAE,6DACO,CAAC;AAE9F,eAAO,MAAM,sBAAsB,gBACpB;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;CAClD,EAAE,gGAgBF,CAAC;AAEJ,eAAO,MAAM,4BAA4B,iBAAyB;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,wEA0CpF,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
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 type
|
|
5
|
-
import { type FunctionDefinition, type InvocationServices } from '../sdk';
|
|
4
|
+
import { type FunctionNotFoundError, Operation } from '@dxos/compute';
|
|
6
5
|
declare const FunctionInvocationService_base: Context.TagClass<FunctionInvocationService, "@dxos/functions/FunctionInvocationService", {
|
|
7
|
-
invokeFunction<I, O>(functionDef:
|
|
8
|
-
resolveFunction(key: string): Effect.Effect<
|
|
6
|
+
invokeFunction<I, O>(functionDef: Operation.Definition<I, O, any>, input: I): Effect.Effect<O>;
|
|
7
|
+
resolveFunction(key: string): Effect.Effect<Operation.Definition.Any, FunctionNotFoundError>;
|
|
9
8
|
}>;
|
|
10
9
|
export declare class FunctionInvocationService extends FunctionInvocationService_base {
|
|
11
10
|
static layerNotAvailable: Layer.Layer<FunctionInvocationService, never, never>;
|
|
12
|
-
static invokeFunction: <I, O>(functionDef:
|
|
13
|
-
static resolveFunction: (key: string) => Effect.Effect<
|
|
11
|
+
static invokeFunction: <I, O>(functionDef: Operation.Definition<I, O, any>, input: I) => Effect.Effect<O, never, FunctionInvocationService>;
|
|
12
|
+
static resolveFunction: (key: string) => Effect.Effect<Operation.Definition.Any, FunctionNotFoundError, FunctionInvocationService>;
|
|
14
13
|
}
|
|
15
14
|
export {};
|
|
16
15
|
//# 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;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,
|
|
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,KAAK,qBAAqB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;mBAKnD,CAAC,EAAE,CAAC,eAAe,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;yBAEzE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,CAAC;;AALhG,qBAAa,yBAA0B,SAAQ,8BAO5C;IACD,MAAM,CAAC,iBAAiB,uDAGrB;IAEH,MAAM,CAAC,cAAc,GAAI,CAAC,EAAE,CAAC,eACd,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SACrC,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAC8D;IAEnH,MAAM,CAAC,eAAe,QACf,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACS;CACtG"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export * from './credentials';
|
|
2
|
-
export { ConfiguredCredentialsService, type ServiceCredential } from './credentials';
|
|
3
|
-
export * from './event-logger';
|
|
4
|
-
export { createEventLogger, createDefectLogger } from './event-logger';
|
|
5
2
|
export * from './function-invocation-service';
|
|
6
3
|
export * from './queues';
|
|
7
|
-
export
|
|
4
|
+
export { MESSAGE_PROPERTY_TOOL_CALL_ID } from './tracing';
|
|
8
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,47 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Effect from 'effect/Effect';
|
|
3
|
-
import * as Layer from 'effect/Layer';
|
|
4
|
-
import type { Entity } from '@dxos/echo';
|
|
5
|
-
import type { Queue, QueueAPI, QueueFactory } from '@dxos/echo-db';
|
|
6
|
-
import type { DXN, QueueSubspaceTag } from '@dxos/keys';
|
|
7
|
-
declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions/QueueService", {
|
|
8
|
-
/**
|
|
9
|
-
* API to access the queues.
|
|
10
|
-
*/
|
|
11
|
-
readonly queues: QueueAPI;
|
|
12
|
-
/**
|
|
13
|
-
* The queue that is used to store the context of the current research.
|
|
14
|
-
* @deprecated Use `ContextQueueService` instead.
|
|
15
|
-
*/
|
|
16
|
-
readonly queue: Queue | undefined;
|
|
17
|
-
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Gives access to all queues.
|
|
20
|
-
*/
|
|
21
|
-
export declare class QueueService extends QueueService_base {
|
|
22
|
-
static notAvailable: Layer.Layer<QueueService, never, never>;
|
|
23
|
-
static make: (queues: QueueFactory, queue?: Queue) => Context.Tag.Service<QueueService>;
|
|
24
|
-
static layer: (queues: QueueFactory, queue?: Queue) => Layer.Layer<QueueService>;
|
|
25
|
-
/**
|
|
26
|
-
* Gets a queue by its DXN.
|
|
27
|
-
*/
|
|
28
|
-
static getQueue: <T extends Entity.Unknown = Entity.Unknown>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
29
|
-
/**
|
|
30
|
-
* Creates a new queue.
|
|
31
|
-
*/
|
|
32
|
-
static createQueue: <T extends Entity.Unknown = Entity.Unknown>(options?: {
|
|
33
|
-
subspaceTag?: QueueSubspaceTag;
|
|
34
|
-
}) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
35
|
-
static append: <T extends Entity.Unknown = Entity.Unknown>(queue: Queue<T>, objects: T[]) => Effect.Effect<void>;
|
|
36
|
-
}
|
|
37
|
-
declare const ContextQueueService_base: Context.TagClass<ContextQueueService, "@dxos/functions/ContextQueueService", {
|
|
38
|
-
readonly queue: Queue;
|
|
39
|
-
}>;
|
|
40
|
-
/**
|
|
41
|
-
* Gives access to a specific queue passed as a context.
|
|
42
|
-
*/
|
|
43
|
-
export declare class ContextQueueService extends ContextQueueService_base {
|
|
44
|
-
static layer: (queue: Queue) => Layer.Layer<ContextQueueService, never, never>;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
1
|
+
export { ContextQueueService, QueueService, feedServiceFromQueueServiceLayer } from '@dxos/echo-db';
|
|
47
2
|
//# sourceMappingURL=queues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,88 +1,5 @@
|
|
|
1
|
-
import * as Context from 'effect/Context';
|
|
2
|
-
import * as Effect from 'effect/Effect';
|
|
3
|
-
import * as Layer from 'effect/Layer';
|
|
4
|
-
import { AgentStatus } from '@dxos/ai';
|
|
5
|
-
import { type DXN, Obj } from '@dxos/echo';
|
|
6
|
-
import { ObjectId } from '@dxos/keys';
|
|
7
|
-
import { Message } from '@dxos/types';
|
|
8
|
-
import type { Trigger } from '../types';
|
|
9
|
-
declare const TracingService_base: Context.TagClass<TracingService, "@dxos/functions/TracingService", {
|
|
10
|
-
/**
|
|
11
|
-
* Gets the parent message ID.
|
|
12
|
-
*/
|
|
13
|
-
getTraceContext: () => TracingService.TraceContext;
|
|
14
|
-
/**
|
|
15
|
-
* Write an event to the tracing queue.
|
|
16
|
-
* @param event - The event to write. Must be an a typed object.
|
|
17
|
-
*/
|
|
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>;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Provides a way for compute primitives (functions, workflows, tools)
|
|
30
|
-
* to emit an execution trace as a series of structured ECHO objects.
|
|
31
|
-
*/
|
|
32
|
-
export declare class TracingService extends TracingService_base {
|
|
33
|
-
static noop: Context.Tag.Service<TracingService>;
|
|
34
|
-
static layerNoop: Layer.Layer<TracingService>;
|
|
35
|
-
/**
|
|
36
|
-
* Creates a TracingService layer that emits events to the parent tracing service.
|
|
37
|
-
*/
|
|
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>;
|
|
45
|
-
/**
|
|
46
|
-
* Emit the current human-readable execution status.
|
|
47
|
-
*/
|
|
48
|
-
static emitStatus: (data: Omit<Obj.MakeProps<typeof AgentStatus>, 'created'>) => Effect.Effect<void, never, TracingService>;
|
|
49
|
-
static emitConverationMessage: (data: Obj.MakeProps<typeof Message.Message>) => Effect.Effect<void, never, TracingService>;
|
|
50
|
-
}
|
|
51
|
-
export declare namespace TracingService {
|
|
52
|
-
interface TraceContext {
|
|
53
|
-
currentInvocation?: InvocationTraceData;
|
|
54
|
-
/**
|
|
55
|
-
* If this thread sprung from a tool call, this is the ID of the message containing the tool call.
|
|
56
|
-
*/
|
|
57
|
-
parentMessage?: ObjectId;
|
|
58
|
-
/**
|
|
59
|
-
* If the current thread is a byproduct of a tool call, this is the ID of the tool call.
|
|
60
|
-
*/
|
|
61
|
-
toolCallId?: string;
|
|
62
|
-
debugInfo?: unknown;
|
|
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
|
-
}
|
|
82
|
-
}
|
|
83
1
|
/**
|
|
84
2
|
* Goes into {@link Message['properties']}
|
|
85
3
|
*/
|
|
86
|
-
export declare const MESSAGE_PROPERTY_TOOL_CALL_ID:
|
|
87
|
-
export {};
|
|
4
|
+
export declare const MESSAGE_PROPERTY_TOOL_CALL_ID: 'toolCallId';
|
|
88
5
|
//# sourceMappingURL=tracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type Obj } from '@dxos/echo';
|
|
2
|
-
export declare const FUNCTIONS_META_KEY = "dxos.
|
|
3
|
-
export declare const FUNCTIONS_PRESET_META_KEY = "dxos.
|
|
2
|
+
export declare const FUNCTIONS_META_KEY = "org.dxos.service.function";
|
|
3
|
+
export declare const FUNCTIONS_PRESET_META_KEY = "org.dxos.service.function-preset";
|
|
4
4
|
/**
|
|
5
5
|
* NOTE: functionId is backend ID, not ECHO object id.
|
|
6
6
|
*/
|
|
7
7
|
export declare const getUserFunctionIdInMetadata: (meta: Obj.ReadonlyMeta) => string | undefined;
|
|
8
8
|
/**
|
|
9
9
|
* NOTE: functionId is backend ID, not ECHO object id.
|
|
10
|
-
* Must be called inside Obj.
|
|
10
|
+
* Must be called inside Obj.update() since it mutates the meta.
|
|
11
11
|
*/
|
|
12
12
|
export declare const setUserFunctionIdInMetadata: (meta: Obj.Meta, functionId: string) => void;
|
|
13
13
|
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/types/url.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAGtC,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/types/url.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAGtC,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,2BAA2B,SAAU,GAAG,CAAC,YAAY,uBAEjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,SAAU,GAAG,CAAC,IAAI,cAAc,MAAM,SAS7E,CAAC"}
|