@dxos/functions 0.8.4-main.ef1bc66f44 → 0.8.4-main.f466a3d56e

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.
Files changed (79) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +5 -7
  3. package/dist/lib/neutral/index.mjs +295 -922
  4. package/dist/lib/neutral/index.mjs.map +4 -4
  5. package/dist/lib/neutral/meta.json +1 -1
  6. package/dist/types/src/index.d.ts +0 -2
  7. package/dist/types/src/index.d.ts.map +1 -1
  8. package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -1
  9. package/dist/types/src/protocol/functions-ai-http-client.test.d.ts +2 -0
  10. package/dist/types/src/protocol/functions-ai-http-client.test.d.ts.map +1 -0
  11. package/dist/types/src/protocol/protocol.d.ts +19 -2
  12. package/dist/types/src/protocol/protocol.d.ts.map +1 -1
  13. package/dist/types/src/sdk.d.ts +5 -109
  14. package/dist/types/src/sdk.d.ts.map +1 -1
  15. package/dist/types/src/services/credentials.d.ts +15 -38
  16. package/dist/types/src/services/credentials.d.ts.map +1 -1
  17. package/dist/types/src/services/function-invocation-service.d.ts +8 -6
  18. package/dist/types/src/services/function-invocation-service.d.ts.map +1 -1
  19. package/dist/types/src/services/index.d.ts +1 -4
  20. package/dist/types/src/services/index.d.ts.map +1 -1
  21. package/dist/types/src/services/queues.d.ts +1 -46
  22. package/dist/types/src/services/queues.d.ts.map +1 -1
  23. package/dist/types/src/services/tracing.d.ts +1 -84
  24. package/dist/types/src/services/tracing.d.ts.map +1 -1
  25. package/dist/types/src/types/index.d.ts +0 -4
  26. package/dist/types/src/types/index.d.ts.map +1 -1
  27. package/dist/types/src/types/url.d.ts +3 -3
  28. package/dist/types/src/types/url.d.ts.map +1 -1
  29. package/dist/types/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +18 -17
  31. package/src/index.ts +0 -2
  32. package/src/protocol/functions-ai-http-client.test.ts +105 -0
  33. package/src/protocol/functions-ai-http-client.ts +75 -1
  34. package/src/protocol/protocol.test.ts +9 -10
  35. package/src/protocol/protocol.ts +252 -59
  36. package/src/sdk.ts +12 -270
  37. package/src/services/credentials.ts +76 -120
  38. package/src/services/function-invocation-service.ts +9 -10
  39. package/src/services/index.ts +1 -4
  40. package/src/services/queues.ts +1 -78
  41. package/src/services/tracing.ts +0 -159
  42. package/src/types/index.ts +0 -4
  43. package/src/types/url.ts +3 -3
  44. package/dist/types/src/errors.d.ts +0 -121
  45. package/dist/types/src/errors.d.ts.map +0 -1
  46. package/dist/types/src/example/fib.d.ts +0 -7
  47. package/dist/types/src/example/fib.d.ts.map +0 -1
  48. package/dist/types/src/example/forex-effect.d.ts +0 -3
  49. package/dist/types/src/example/forex-effect.d.ts.map +0 -1
  50. package/dist/types/src/example/index.d.ts +0 -12
  51. package/dist/types/src/example/index.d.ts.map +0 -1
  52. package/dist/types/src/example/reply.d.ts +0 -3
  53. package/dist/types/src/example/reply.d.ts.map +0 -1
  54. package/dist/types/src/example/sleep.d.ts +0 -5
  55. package/dist/types/src/example/sleep.d.ts.map +0 -1
  56. package/dist/types/src/operation-compatibility.test.d.ts +0 -2
  57. package/dist/types/src/operation-compatibility.test.d.ts.map +0 -1
  58. package/dist/types/src/services/event-logger.d.ts +0 -81
  59. package/dist/types/src/services/event-logger.d.ts.map +0 -1
  60. package/dist/types/src/types/Function.d.ts +0 -52
  61. package/dist/types/src/types/Function.d.ts.map +0 -1
  62. package/dist/types/src/types/Script.d.ts +0 -21
  63. package/dist/types/src/types/Script.d.ts.map +0 -1
  64. package/dist/types/src/types/Trigger.d.ts +0 -121
  65. package/dist/types/src/types/Trigger.d.ts.map +0 -1
  66. package/dist/types/src/types/TriggerEvent.d.ts +0 -74
  67. package/dist/types/src/types/TriggerEvent.d.ts.map +0 -1
  68. package/src/errors.ts +0 -21
  69. package/src/example/fib.ts +0 -32
  70. package/src/example/forex-effect.ts +0 -40
  71. package/src/example/index.ts +0 -13
  72. package/src/example/reply.ts +0 -21
  73. package/src/example/sleep.ts +0 -24
  74. package/src/operation-compatibility.test.ts +0 -185
  75. package/src/services/event-logger.ts +0 -127
  76. package/src/types/Function.ts +0 -82
  77. package/src/types/Script.ts +0 -34
  78. package/src/types/Trigger.ts +0 -143
  79. package/src/types/TriggerEvent.ts +0 -62
@@ -2,165 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import * as Context from 'effect/Context';
6
- import * as Effect from 'effect/Effect';
7
- import * as Layer from 'effect/Layer';
8
-
9
- import { AgentStatus } from '@dxos/ai';
10
- import { type DXN, Obj } from '@dxos/echo';
11
- import { ObjectId } from '@dxos/keys';
12
- import { Message } from '@dxos/types';
13
-
14
- import type { Trigger } from '../types';
15
-
16
- /**
17
- * Provides a way for compute primitives (functions, workflows, tools)
18
- * to emit an execution trace as a series of structured ECHO objects.
19
- */
20
- export class TracingService extends Context.Tag('@dxos/functions/TracingService')<
21
- TracingService,
22
- {
23
- /**
24
- * Gets the parent message ID.
25
- */
26
- getTraceContext: () => TracingService.TraceContext;
27
-
28
- /**
29
- * Write an event to the tracing queue.
30
- * @param event - The event to write. Must be an a typed object.
31
- */
32
- write: (event: Obj.Unknown, traceContext: TracingService.TraceContext) => void;
33
-
34
- traceInvocationStart({
35
- payload,
36
- target,
37
- }: {
38
- payload: TracingService.FunctionInvocationPayload;
39
- target?: DXN;
40
- }): Effect.Effect<TracingService.InvocationTraceData>;
41
-
42
- traceInvocationEnd({
43
- trace,
44
- exception,
45
- }: {
46
- trace: TracingService.InvocationTraceData;
47
- exception?: any;
48
- }): Effect.Effect<void>;
49
- }
50
- >() {
51
- static noop: Context.Tag.Service<TracingService> = {
52
- getTraceContext: () => ({}),
53
- write: () => {},
54
- traceInvocationStart: () =>
55
- Effect.sync(() => ({ invocationId: ObjectId.random(), invocationTraceQueue: undefined })),
56
- traceInvocationEnd: () => Effect.sync(() => {}),
57
- };
58
-
59
- static layerNoop: Layer.Layer<TracingService> = Layer.succeed(TracingService, TracingService.noop);
60
-
61
- /**
62
- * Creates a TracingService layer that emits events to the parent tracing service.
63
- */
64
- static layerSubframe = (mapContext: (currentContext: TracingService.TraceContext) => TracingService.TraceContext) =>
65
- Layer.effect(
66
- TracingService,
67
- Effect.gen(function* () {
68
- const tracing = yield* TracingService;
69
- const context = mapContext(tracing.getTraceContext());
70
- return {
71
- write: (event, context) => tracing.write(event, context),
72
- getTraceContext: () => context,
73
- traceInvocationStart: () => Effect.die('Tracing invocation inside another invocation is not supported.'),
74
- traceInvocationEnd: () => Effect.die('Tracing invocation inside another invocation is not supported.'),
75
- };
76
- }),
77
- );
78
-
79
- /**
80
- * Create sublayer to trace an invocation.
81
- * @param data
82
- * @returns
83
- */
84
- static layerInvocation = (data: TracingService.InvocationTraceData) =>
85
- TracingService.layerSubframe((context) => ({
86
- ...context,
87
- currentInvocation: data,
88
- }));
89
-
90
- /**
91
- * Emit the current human-readable execution status.
92
- */
93
- static emitStatus: (
94
- data: Omit<Obj.MakeProps<typeof AgentStatus>, 'created'>,
95
- ) => Effect.Effect<void, never, TracingService> = Effect.fnUntraced(function* (data) {
96
- const tracing = yield* TracingService;
97
- tracing.write(
98
- Obj.make(AgentStatus, {
99
- parentMessage: tracing.getTraceContext().parentMessage,
100
- toolCallId: tracing.getTraceContext().toolCallId,
101
- created: new Date().toISOString(),
102
- ...data,
103
- }),
104
- tracing.getTraceContext(),
105
- );
106
- });
107
-
108
- static emitConverationMessage: (
109
- data: Obj.MakeProps<typeof Message.Message>,
110
- ) => Effect.Effect<void, never, TracingService> = Effect.fnUntraced(function* (data) {
111
- const tracing = yield* TracingService;
112
- tracing.write(
113
- Obj.make(Message.Message, {
114
- parentMessage: tracing.getTraceContext().parentMessage,
115
- ...data,
116
- properties: {
117
- [MESSAGE_PROPERTY_TOOL_CALL_ID]: tracing.getTraceContext().toolCallId,
118
- ...data.properties,
119
- },
120
- }),
121
- tracing.getTraceContext(),
122
- );
123
- });
124
- }
125
-
126
- export namespace TracingService {
127
- export interface TraceContext {
128
- currentInvocation?: InvocationTraceData;
129
-
130
- /**
131
- * If this thread sprung from a tool call, this is the ID of the message containing the tool call.
132
- */
133
- parentMessage?: ObjectId;
134
-
135
- /**
136
- * If the current thread is a byproduct of a tool call, this is the ID of the tool call.
137
- */
138
- toolCallId?: string;
139
-
140
- debugInfo?: unknown;
141
- }
142
-
143
- /**
144
- * Trace data for a function/trigger invocation.
145
- */
146
- export interface InvocationTraceData {
147
- invocationId: ObjectId;
148
- invocationTraceQueue?: DXN.String;
149
- }
150
-
151
- /**
152
- * Payload for a function/trigger invocation.
153
- */
154
- export interface FunctionInvocationPayload {
155
- data?: any;
156
- inputNodeId?: string;
157
- trigger?: {
158
- id: string;
159
- kind: Trigger.Kind;
160
- };
161
- }
162
- }
163
-
164
5
  /**
165
6
  * Goes into {@link Message['properties']}
166
7
  */
@@ -2,8 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * as Function from './Function';
6
- export * as Script from './Script';
7
- export * as Trigger from './Trigger';
8
- export * as TriggerEvent from './TriggerEvent';
9
5
  export * from './url';
package/src/types/url.ts CHANGED
@@ -5,9 +5,9 @@
5
5
  import { type Obj } from '@dxos/echo';
6
6
 
7
7
  // TODO: use URL scheme for source?
8
- export const FUNCTIONS_META_KEY = 'dxos.org/service/function';
8
+ export const FUNCTIONS_META_KEY = 'org.dxos.service.function';
9
9
 
10
- export const FUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';
10
+ export const FUNCTIONS_PRESET_META_KEY = 'org.dxos.service.function-preset';
11
11
 
12
12
  /**
13
13
  * NOTE: functionId is backend ID, not ECHO object id.
@@ -18,7 +18,7 @@ export const getUserFunctionIdInMetadata = (meta: Obj.ReadonlyMeta) => {
18
18
 
19
19
  /**
20
20
  * NOTE: functionId is backend ID, not ECHO object id.
21
- * Must be called inside Obj.changeMeta() since it mutates the meta.
21
+ * Must be called inside Obj.update() since it mutates the meta.
22
22
  */
23
23
  export const setUserFunctionIdInMetadata = (meta: Obj.Meta, functionId: string) => {
24
24
  const key = meta.keys.find((key) => key.source === FUNCTIONS_META_KEY);
@@ -1,121 +0,0 @@
1
- import { BaseError, type BaseErrorOptions } from '@dxos/errors';
2
- declare const ServiceNotAvailableError_base: {
3
- new (options?: BaseErrorOptions): {
4
- name: "ServiceNotAvailable";
5
- context: Record<string, unknown>;
6
- readonly message: string;
7
- readonly _tag: "ServiceNotAvailable";
8
- stack?: string;
9
- cause?: unknown;
10
- };
11
- name: "ServiceNotAvailable";
12
- is(error: unknown): error is BaseError;
13
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
14
- ifTypeDiffers?: boolean;
15
- }): (error: unknown) => {
16
- name: "ServiceNotAvailable";
17
- context: Record<string, unknown>;
18
- readonly message: string;
19
- readonly _tag: "ServiceNotAvailable";
20
- stack?: string;
21
- cause?: unknown;
22
- };
23
- extend<Name extends string = string>(name: Name, message?: string): any;
24
- isError(error: unknown): error is Error;
25
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
26
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
27
- stackTraceLimit: number;
28
- };
29
- export declare class ServiceNotAvailableError extends ServiceNotAvailableError_base {
30
- constructor(service: string, options?: Omit<BaseErrorOptions, 'context'>);
31
- }
32
- declare const FunctionNotFoundError_base: {
33
- new (options?: BaseErrorOptions): {
34
- name: "FunctionNotFound";
35
- context: Record<string, unknown>;
36
- readonly message: string;
37
- readonly _tag: "FunctionNotFound";
38
- stack?: string;
39
- cause?: unknown;
40
- };
41
- name: "FunctionNotFound";
42
- is(error: unknown): error is BaseError;
43
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
44
- ifTypeDiffers?: boolean;
45
- }): (error: unknown) => {
46
- name: "FunctionNotFound";
47
- context: Record<string, unknown>;
48
- readonly message: string;
49
- readonly _tag: "FunctionNotFound";
50
- stack?: string;
51
- cause?: unknown;
52
- };
53
- extend<Name extends string = string>(name: Name, message?: string): any;
54
- isError(error: unknown): error is Error;
55
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
56
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
57
- stackTraceLimit: number;
58
- };
59
- export declare class FunctionNotFoundError extends FunctionNotFoundError_base {
60
- constructor(functionKey: string, options?: Omit<BaseErrorOptions, 'context'>);
61
- }
62
- declare const FunctionError_base: {
63
- new (options?: BaseErrorOptions): {
64
- name: "FunctionError";
65
- context: Record<string, unknown>;
66
- readonly message: string;
67
- readonly _tag: "FunctionError";
68
- stack?: string;
69
- cause?: unknown;
70
- };
71
- name: "FunctionError";
72
- is(error: unknown): error is BaseError;
73
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
74
- ifTypeDiffers?: boolean;
75
- }): (error: unknown) => {
76
- name: "FunctionError";
77
- context: Record<string, unknown>;
78
- readonly message: string;
79
- readonly _tag: "FunctionError";
80
- stack?: string;
81
- cause?: unknown;
82
- };
83
- extend<Name extends string = string>(name: Name, message?: string): any;
84
- isError(error: unknown): error is Error;
85
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
86
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
87
- stackTraceLimit: number;
88
- };
89
- export declare class FunctionError extends FunctionError_base {
90
- }
91
- declare const TriggerStateNotFoundError_base: {
92
- new (options?: BaseErrorOptions): {
93
- name: "TriggerStateNotFound";
94
- context: Record<string, unknown>;
95
- readonly message: string;
96
- readonly _tag: "TriggerStateNotFound";
97
- stack?: string;
98
- cause?: unknown;
99
- };
100
- name: "TriggerStateNotFound";
101
- is(error: unknown): error is BaseError;
102
- wrap(options?: Omit<BaseErrorOptions, "cause"> & {
103
- ifTypeDiffers?: boolean;
104
- }): (error: unknown) => {
105
- name: "TriggerStateNotFound";
106
- context: Record<string, unknown>;
107
- readonly message: string;
108
- readonly _tag: "TriggerStateNotFound";
109
- stack?: string;
110
- cause?: unknown;
111
- };
112
- extend<Name extends string = string>(name: Name, message?: string): any;
113
- isError(error: unknown): error is Error;
114
- captureStackTrace(targetObject: object, constructorOpt?: Function): void;
115
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
116
- stackTraceLimit: number;
117
- };
118
- export declare class TriggerStateNotFoundError extends TriggerStateNotFoundError_base {
119
- }
120
- export {};
121
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
1
- declare const _default: import("..").FunctionDefinition<{
2
- readonly iterations?: number | undefined;
3
- }, {
4
- readonly result: string;
5
- }, import("..").FunctionServices>;
6
- export default _default;
7
- //# sourceMappingURL=fib.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fib.d.ts","sourceRoot":"","sources":["../../../../src/example/fib.ts"],"names":[],"mappings":";;;;;AASA,wBAsBG"}
@@ -1,3 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
3
- //# sourceMappingURL=forex-effect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forex-effect.d.ts","sourceRoot":"","sources":["../../../../src/example/forex-effect.ts"],"names":[],"mappings":";AAeA,wBAwBG"}
@@ -1,12 +0,0 @@
1
- export declare namespace Example {
2
- const fib: import("..").FunctionDefinition<{
3
- readonly iterations?: number | undefined;
4
- }, {
5
- readonly result: string;
6
- }, import("..").FunctionServices>;
7
- const reply: import("..").FunctionDefinition<any, any, import("..").FunctionServices>;
8
- const sleep: import("..").FunctionDefinition<{
9
- readonly duration?: number | undefined;
10
- }, void, import("..").FunctionServices>;
11
- }
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/example/index.ts"],"names":[],"mappings":"AAQA,yBAAiB,OAAO,CAAC;IAChB,MAAM,GAAG;;;;qCAAO,CAAC;IACjB,MAAM,KAAK,0EAAS,CAAC;IACrB,MAAM,KAAK;;2CAAS,CAAC;CAC7B"}
@@ -1,3 +0,0 @@
1
- declare const _default: import("..").FunctionDefinition<any, any, import("..").FunctionServices>;
2
- export default _default;
3
- //# sourceMappingURL=reply.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../../src/example/reply.ts"],"names":[],"mappings":";AAUA,wBAUG"}
@@ -1,5 +0,0 @@
1
- declare const _default: import("..").FunctionDefinition<{
2
- readonly duration?: number | undefined;
3
- }, void, import("..").FunctionServices>;
4
- export default _default;
5
- //# sourceMappingURL=sleep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../../../src/example/sleep.ts"],"names":[],"mappings":";;;AASA,wBAcG"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=operation-compatibility.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operation-compatibility.test.d.ts","sourceRoot":"","sources":["../../../src/operation-compatibility.test.ts"],"names":[],"mappings":""}
@@ -1,81 +0,0 @@
1
- import * as Context from 'effect/Context';
2
- import * as Effect from 'effect/Effect';
3
- import * as Layer from 'effect/Layer';
4
- import * as Schema from 'effect/Schema';
5
- import { Type } from '@dxos/echo';
6
- import { LogLevel } from '@dxos/log';
7
- import { TracingService } from './tracing';
8
- export declare const ComputeEventPayload: Schema.Union<[Schema.Struct<{
9
- type: Schema.Literal<["begin-compute"]>;
10
- nodeId: typeof Schema.String;
11
- /**
12
- * Names of the inputs begin computed.
13
- */
14
- inputs: Schema.Array$<typeof Schema.String>;
15
- }>, Schema.Struct<{
16
- type: Schema.Literal<["end-compute"]>;
17
- nodeId: typeof Schema.String;
18
- /**
19
- * Names of the outputs computed.
20
- */
21
- outputs: Schema.Array$<typeof Schema.String>;
22
- }>, Schema.Struct<{
23
- type: Schema.Literal<["compute-input"]>;
24
- nodeId: typeof Schema.String;
25
- property: typeof Schema.String;
26
- value: typeof Schema.Any;
27
- }>, Schema.Struct<{
28
- type: Schema.Literal<["compute-output"]>;
29
- nodeId: typeof Schema.String;
30
- property: typeof Schema.String;
31
- value: typeof Schema.Any;
32
- }>, Schema.Struct<{
33
- type: Schema.Literal<["custom"]>;
34
- nodeId: typeof Schema.String;
35
- event: typeof Schema.Any;
36
- }>]>;
37
- export type ComputeEventPayload = Schema.Schema.Type<typeof ComputeEventPayload>;
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 value: any;
49
- readonly type: "compute-input";
50
- readonly nodeId: string;
51
- readonly property: string;
52
- } | {
53
- readonly value: any;
54
- readonly type: "compute-output";
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>;
63
- declare const ComputeEventLogger_base: Context.TagClass<ComputeEventLogger, "@dxos/functions/ComputeEventLogger", {
64
- readonly log: (event: ComputeEventPayload) => void;
65
- readonly nodeId: string | undefined;
66
- }>;
67
- /**
68
- * Logs event for the compute workflows.
69
- */
70
- export declare class ComputeEventLogger extends ComputeEventLogger_base {
71
- static noop: Context.Tag.Service<ComputeEventLogger>;
72
- /**
73
- * Implements ComputeEventLogger using TracingService.
74
- */
75
- static layerFromTracing: Layer.Layer<ComputeEventLogger, never, TracingService>;
76
- }
77
- export declare const logCustomEvent: (data: any) => Effect.Effect<void, never, ComputeEventLogger>;
78
- export declare const createDefectLogger: <A, E, R>() => ((self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>);
79
- export declare const createEventLogger: (level: LogLevel, message?: string) => Context.Tag.Service<ComputeEventLogger>;
80
- export {};
81
- //# sourceMappingURL=event-logger.d.ts.map
@@ -1 +0,0 @@
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,52 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- import { Obj, Type } from '@dxos/echo';
3
- /**
4
- * Function deployment.
5
- */
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;
11
- }>;
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>;
25
- export interface Function extends Schema.Schema.Type<typeof Function> {
26
- }
27
- export declare const make: (props: Obj.MakeProps<typeof Function>) => Obj.Obj<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
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;
32
- }>;
33
- readonly description?: string | undefined;
34
- readonly name?: string | undefined;
35
- readonly changed?: boolean | undefined;
36
- }> | undefined;
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;
45
- }>;
46
- /**
47
- * Copies properties from source to target.
48
- * @param target - Target object to copy properties to.
49
- * @param source - Source object to copy properties from.
50
- */
51
- export declare const setFrom: (target: Function, source: Function) => void;
52
- //# sourceMappingURL=Function.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,21 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- import { Obj, Type } from '@dxos/echo';
3
- /**
4
- * Source script.
5
- */
6
- export declare const Script: Type.Obj<{
7
- readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
8
- readonly content: string;
9
- }>;
10
- readonly description?: string | undefined;
11
- readonly name?: string | undefined;
12
- readonly changed?: boolean | undefined;
13
- }, Schema.Struct.Fields>;
14
- export interface Script extends Schema.Schema.Type<typeof Script> {
15
- }
16
- type Props = Omit<Obj.MakeProps<typeof Script>, 'source'> & {
17
- source?: string;
18
- };
19
- export declare const make: ({ source, ...props }?: Props) => Script;
20
- export {};
21
- //# sourceMappingURL=Script.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../../src/types/Script.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAc,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;wBAalB,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC;CAAG;AAEpE,KAAK,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,IAAI,GAAI,uBAA2B,KAAU,KAAG,MACQ,CAAC"}