@dxos/compute 0.8.4-main.a4bbb77 → 0.8.4-main.abd8ff62ef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -1
- package/dist/lib/neutral/StorageService.mjs +22 -0
- package/dist/lib/neutral/chunk-4N4JAXCP.mjs +17 -0
- package/dist/lib/neutral/chunk-4N4JAXCP.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DDEBBRCI.mjs +62 -0
- package/dist/lib/neutral/chunk-DDEBBRCI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FEABF5XY.mjs +25 -0
- package/dist/lib/neutral/chunk-FEABF5XY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-H6EHIVDN.mjs +21 -0
- package/dist/lib/neutral/chunk-H6EHIVDN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-N462A6NO.mjs +138 -0
- package/dist/lib/neutral/chunk-N462A6NO.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QPCDM7MF.mjs +179 -0
- package/dist/lib/neutral/chunk-QPCDM7MF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-S24LL2D5.mjs +52 -0
- package/dist/lib/neutral/chunk-S24LL2D5.mjs.map +7 -0
- package/dist/lib/neutral/fib-HDHBZHPE.mjs +10 -0
- package/dist/lib/neutral/fib-HDHBZHPE.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1034 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/reply-XSQMXAPX.mjs +10 -0
- package/dist/lib/neutral/reply-XSQMXAPX.mjs.map +7 -0
- package/dist/lib/neutral/sleep-WHTJQ56P.mjs +10 -0
- package/dist/lib/neutral/sleep-WHTJQ56P.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +32 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/types/src/Blueprint.d.ts +148 -0
- package/dist/types/src/Blueprint.d.ts.map +1 -0
- package/dist/types/src/Credential.d.ts +27 -0
- package/dist/types/src/Credential.d.ts.map +1 -0
- package/dist/types/src/Operation.d.ts +303 -0
- package/dist/types/src/Operation.d.ts.map +1 -0
- package/dist/types/src/OperationHandlerSet.d.ts +60 -0
- package/dist/types/src/OperationHandlerSet.d.ts.map +1 -0
- package/dist/types/src/OperationRegistry.d.ts +23 -0
- package/dist/types/src/OperationRegistry.d.ts.map +1 -0
- package/dist/types/src/Process.d.ts +247 -0
- package/dist/types/src/Process.d.ts.map +1 -0
- package/dist/types/src/Routine.d.ts +61 -0
- package/dist/types/src/Routine.d.ts.map +1 -0
- package/dist/types/src/Script.d.ts +22 -0
- package/dist/types/src/Script.d.ts.map +1 -0
- package/dist/types/src/ServiceResolver.d.ts +74 -0
- package/dist/types/src/ServiceResolver.d.ts.map +1 -0
- package/dist/types/src/StorageService.d.ts +58 -0
- package/dist/types/src/StorageService.d.ts.map +1 -0
- package/dist/types/src/Template.d.ts +56 -0
- package/dist/types/src/Template.d.ts.map +1 -0
- package/dist/types/src/Trace.d.ts +174 -0
- package/dist/types/src/Trace.d.ts.map +1 -0
- package/dist/types/src/Trigger.d.ts +150 -0
- package/dist/types/src/Trigger.d.ts.map +1 -0
- package/dist/types/src/TriggerEvent.d.ts +75 -0
- package/dist/types/src/TriggerEvent.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +239 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +15 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing/definitions.d.ts +11 -0
- package/dist/types/src/testing/definitions.d.ts.map +1 -0
- package/dist/types/src/testing/fib.d.ts +8 -0
- package/dist/types/src/testing/fib.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +6 -3
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/reply.d.ts +4 -0
- package/dist/types/src/testing/reply.d.ts.map +1 -0
- package/dist/types/src/testing/sleep.d.ts +6 -0
- package/dist/types/src/testing/sleep.d.ts.map +1 -0
- package/dist/types/src/umbrella.test.d.ts +2 -0
- package/dist/types/src/umbrella.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -39
- package/src/Blueprint.ts +221 -0
- package/src/Credential.ts +51 -0
- package/src/Operation.ts +513 -0
- package/src/OperationHandlerSet.ts +132 -0
- package/src/OperationRegistry.ts +48 -0
- package/src/Process.ts +490 -0
- package/src/Routine.ts +84 -0
- package/src/Script.ts +38 -0
- package/src/ServiceResolver.ts +174 -0
- package/src/StorageService.ts +99 -0
- package/src/Template.ts +105 -0
- package/src/Trace.ts +231 -0
- package/src/Trigger.ts +207 -0
- package/src/TriggerEvent.ts +62 -0
- package/src/errors.ts +50 -0
- package/src/index.ts +16 -33
- package/src/testing/definitions.ts +49 -0
- package/src/testing/fib.ts +22 -0
- package/src/testing/index.ts +13 -4
- package/src/testing/reply.ts +18 -0
- package/src/testing/sleep.ts +16 -0
- package/src/umbrella.test.ts +51 -0
- package/dist/lib/browser/chunk-XQYPCRZP.mjs +0 -3140
- package/dist/lib/browser/chunk-XQYPCRZP.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -55
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/testing/index.mjs +0 -186
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2XWWSGAU.mjs +0 -3142
- package/dist/lib/node-esm/chunk-2XWWSGAU.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -56
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.mjs +0 -187
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/compute-graph-registry.d.ts +0 -32
- package/dist/types/src/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/compute-graph.d.ts +0 -64
- package/dist/types/src/compute-graph.d.ts.map +0 -1
- package/dist/types/src/compute-graph.test.d.ts +0 -2
- package/dist/types/src/compute-graph.test.d.ts.map +0 -1
- package/dist/types/src/compute-node.d.ts +0 -24
- package/dist/types/src/compute-node.d.ts.map +0 -1
- package/dist/types/src/functions/async-function.d.ts +0 -66
- package/dist/types/src/functions/async-function.d.ts.map +0 -1
- package/dist/types/src/functions/edge-function.d.ts +0 -20
- package/dist/types/src/functions/edge-function.d.ts.map +0 -1
- package/dist/types/src/functions/function-defs.d.ts +0 -11
- package/dist/types/src/functions/function-defs.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/hyperformula.test.d.ts +0 -2
- package/dist/types/src/hyperformula.test.d.ts.map +0 -1
- package/dist/types/src/testing/test-builder.d.ts +0 -15
- package/dist/types/src/testing/test-builder.d.ts.map +0 -1
- package/dist/types/src/testing/test-plugin.d.ts +0 -35
- package/dist/types/src/testing/test-plugin.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -2
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/dist/types/src/types/hyperformula.d.ts +0 -8
- package/dist/types/src/types/hyperformula.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -3
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -20
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/dist/types/src/types/types.test.d.ts +0 -2
- package/dist/types/src/types/types.test.d.ts.map +0 -1
- package/dist/types/src/util.d.ts +0 -2
- package/dist/types/src/util.d.ts.map +0 -1
- package/src/compute-graph-registry.ts +0 -88
- package/src/compute-graph.test.ts +0 -88
- package/src/compute-graph.ts +0 -258
- package/src/compute-node.ts +0 -59
- package/src/functions/async-function.ts +0 -183
- package/src/functions/edge-function.ts +0 -111
- package/src/functions/function-defs.ts +0 -2427
- package/src/functions/index.ts +0 -7
- package/src/hyperformula.test.ts +0 -14
- package/src/testing/test-builder.ts +0 -54
- package/src/testing/test-plugin.ts +0 -98
- package/src/testing/util.ts +0 -9
- package/src/types/hyperformula.ts +0 -19
- package/src/types/index.ts +0 -6
- package/src/types/types.test.ts +0 -91
- package/src/types/types.ts +0 -80
- package/src/util.ts +0 -8
- /package/dist/lib/{browser/index.mjs.map → neutral/StorageService.mjs.map} +0 -0
- /package/dist/lib/{node-esm/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import * as Pipeable from 'effect/Pipeable';
|
|
5
|
+
import * as Schema$ from 'effect/Schema';
|
|
6
|
+
import type * as Types from 'effect/Types';
|
|
7
|
+
import { Obj, Type, type DXN, type Key } from '@dxos/echo';
|
|
8
|
+
import type { NoHandlerError } from './errors';
|
|
9
|
+
import type { Operation } from './index';
|
|
10
|
+
/**
|
|
11
|
+
* Schema type that accepts any Encoded form but requires no Context.
|
|
12
|
+
* This allows ECHO object schemas where Type !== Encoded due to [KindId] symbol.
|
|
13
|
+
*/
|
|
14
|
+
type Schema<T> = Schema$.Schema<T, any, never>;
|
|
15
|
+
export declare const DefinitionTypeId: '~@dxos/operation/OperationDefinition';
|
|
16
|
+
export type DefinitionTypeId = typeof DefinitionTypeId;
|
|
17
|
+
/**
|
|
18
|
+
* Serializable definition of an Operation.
|
|
19
|
+
* Contains schema and metadata, but no runtime logic.
|
|
20
|
+
*/
|
|
21
|
+
export interface Definition<I, O, S = any> extends Pipeable.Pipeable, Definition.Variance<I, O, S> {
|
|
22
|
+
/**
|
|
23
|
+
* Input schema for the operation.
|
|
24
|
+
*/
|
|
25
|
+
readonly input: Schema<I>;
|
|
26
|
+
/**
|
|
27
|
+
* Output schema for the operation.
|
|
28
|
+
*/
|
|
29
|
+
readonly output: Schema<O>;
|
|
30
|
+
readonly meta: {
|
|
31
|
+
readonly key: string;
|
|
32
|
+
readonly name?: string;
|
|
33
|
+
readonly version?: string;
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Deployment ID for remote invocation.
|
|
37
|
+
* Assigned by the EDGE function service when deployed.
|
|
38
|
+
*/
|
|
39
|
+
readonly deployedId?: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Execution mode for the operation.
|
|
43
|
+
* - 'sync': Operation completes synchronously (fast, UI-blocking acceptable).
|
|
44
|
+
* - 'async': Operation may take time (should not block UI).
|
|
45
|
+
*/
|
|
46
|
+
readonly executionMode: 'sync' | 'async';
|
|
47
|
+
/**
|
|
48
|
+
* ECHO types the operation uses.
|
|
49
|
+
* Ensures types are available when the operation is executed remotely.
|
|
50
|
+
*/
|
|
51
|
+
readonly types: readonly Type.AnyEntity[];
|
|
52
|
+
/**
|
|
53
|
+
* Effect services required by this operation.
|
|
54
|
+
* These services will be automatically provided to the handler at invocation time.
|
|
55
|
+
*/
|
|
56
|
+
readonly services: readonly Context.Tag<any, any>[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Namespace for OperationDefinition helper types.
|
|
60
|
+
*/
|
|
61
|
+
export declare namespace Definition {
|
|
62
|
+
interface Variance<I, O, S> {
|
|
63
|
+
[DefinitionTypeId]: {
|
|
64
|
+
readonly _Input: Types.Contravariant<I>;
|
|
65
|
+
readonly _Output: Types.Covariant<O>;
|
|
66
|
+
readonly _Services: Types.Covariant<S>;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Any operation definition, regardless of input/output types.
|
|
71
|
+
*/
|
|
72
|
+
type Any = Definition<any, any, any>;
|
|
73
|
+
/**
|
|
74
|
+
* Extract the input type from an operation definition.
|
|
75
|
+
*/
|
|
76
|
+
type Input<T extends Any> = T extends Variance<infer I, infer _O, infer _S> ? I : never;
|
|
77
|
+
/**
|
|
78
|
+
* Extract the output type from an operation definition.
|
|
79
|
+
*/
|
|
80
|
+
type Output<T extends Any> = T extends Variance<infer _I, infer O, infer _S> ? O : never;
|
|
81
|
+
/**
|
|
82
|
+
* Extract the service identifier types from an operation's services array.
|
|
83
|
+
* Returns `never` if the operation has no services declared.
|
|
84
|
+
*/
|
|
85
|
+
type Services<T extends Any> = T extends Variance<infer _I, infer _O, infer S> ? S : never;
|
|
86
|
+
type HandlerType<T extends Any> = T extends Variance<infer I, infer O, infer S> ? Handler<I, O, any, S> : never;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Runtime handler for an Operation.
|
|
90
|
+
*/
|
|
91
|
+
export type Handler<I, O, E = Error, R = never> = (input: I) => Effect.Effect<O, E, R>;
|
|
92
|
+
export type WithHandler<T extends Definition.Any> = T & {
|
|
93
|
+
handler: Definition.HandlerType<T>;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Checks if a value is an operation definition.
|
|
97
|
+
*/
|
|
98
|
+
export declare const isOperationDefinition: (value: unknown) => value is Definition.Any;
|
|
99
|
+
/**
|
|
100
|
+
* Checks if a value is an operation with a handler.
|
|
101
|
+
*/
|
|
102
|
+
export declare const isOperationWithHandler: (value: unknown) => value is WithHandler<Definition.Any>;
|
|
103
|
+
/**a
|
|
104
|
+
* Props for creating an Operation definition.
|
|
105
|
+
* Derived from OperationDefinition with executionMode made optional (defaults to 'async').
|
|
106
|
+
*/
|
|
107
|
+
export type Props<I, O> = Omit<Definition<I, O>, DefinitionTypeId | 'pipe' | 'executionMode' | 'types' | 'services'> & {
|
|
108
|
+
readonly executionMode?: 'sync' | 'async';
|
|
109
|
+
readonly types?: Definition<I, O>['types'];
|
|
110
|
+
readonly services?: Definition<I, O>['services'];
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Creates a new Operation definition.
|
|
114
|
+
* Applies default executionMode of 'async' if not specified.
|
|
115
|
+
* The returned type preserves the literal types of props (including services).
|
|
116
|
+
*/
|
|
117
|
+
export declare const make: <const P extends Types.NoExcessProperties<Props<any, any>, P>>(props: P) => Definition<Schema$.Schema.Type<P['input']>, Schema$.Schema.Type<P['output']>, Context.Tag.Identifier<NonNullable<P['services']>[number]>>;
|
|
118
|
+
/**
|
|
119
|
+
* Attaches a handler to an Operation definition.
|
|
120
|
+
* The handler may use any services declared in the operation, plus Operation.Service (always available).
|
|
121
|
+
* Dual API: can be called directly or used in a pipe.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* const MyOp = Operation.make({
|
|
126
|
+
* input: Schema.Void,
|
|
127
|
+
* output: Schema.Void,
|
|
128
|
+
* meta: { key: 'my-op' },
|
|
129
|
+
* services: [DatabaseService],
|
|
130
|
+
* });
|
|
131
|
+
*
|
|
132
|
+
* // Direct call - handler can use DatabaseService
|
|
133
|
+
* const op = Operation.withHandler(MyOp, (input) =>
|
|
134
|
+
* Effect.gen(function* () {
|
|
135
|
+
* const db = yield* DatabaseService;
|
|
136
|
+
* return {};
|
|
137
|
+
* }),
|
|
138
|
+
* );
|
|
139
|
+
*
|
|
140
|
+
* // Piped call
|
|
141
|
+
* const op = MyOp.pipe(Operation.withHandler((input) => Effect.succeed({})));
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare const withHandler: {
|
|
145
|
+
<Def extends Definition<any, any>, E = never>(handler: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>): (op: Def) => WithHandler<Def>;
|
|
146
|
+
<Def extends Definition<any, any>, E = never>(op: Def, handler: Handler<Definition.Input<Def>, Definition.Output<Def>, E, Definition.Services<Def> | Service>): WithHandler<Def>;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Helper to make the handler type opaque.
|
|
150
|
+
* Workaround for TypeScript's inability to infer the handler type from the operation definition:
|
|
151
|
+
* ```
|
|
152
|
+
* error TS2742: The inferred type of 'default' cannot be named without a reference.
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* Most of the time the exact handler type is not needed.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const MyOp = Operation.make({
|
|
160
|
+
* input: Schema.Void,
|
|
161
|
+
* output: Schema.Void,
|
|
162
|
+
* meta: { key: 'my-op' },
|
|
163
|
+
* services: [DatabaseService],
|
|
164
|
+
* });
|
|
165
|
+
*
|
|
166
|
+
* export default MyOp.pipe(
|
|
167
|
+
* Operation.withHandler(
|
|
168
|
+
* Effect.fn(function* (input) {
|
|
169
|
+
* return { result: 'ok' };
|
|
170
|
+
* }),
|
|
171
|
+
* ),
|
|
172
|
+
* Operation.opaqueHandler,
|
|
173
|
+
* );
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
export declare const opaqueHandler: <T extends Operation.Definition.Any>(handler: Operation.WithHandler<T>) => Operation.WithHandler<Operation.Definition.Any>;
|
|
177
|
+
/**
|
|
178
|
+
* Local invocation of an operation.
|
|
179
|
+
*/
|
|
180
|
+
export type Invoke = <I, O, E>(op: Definition<I, O>, input: I) => Effect.Effect<O, E>;
|
|
181
|
+
/**
|
|
182
|
+
* Remote invocation of an operation.
|
|
183
|
+
*/
|
|
184
|
+
export type InvokeRemote = <I, O, E>(op: Definition<I, O>, input: I, options?: {
|
|
185
|
+
timeout?: number;
|
|
186
|
+
}) => Effect.Effect<O, E>;
|
|
187
|
+
/**
|
|
188
|
+
* Database record of an operation.
|
|
189
|
+
*/
|
|
190
|
+
export declare const PersistentOperation: Type.Obj<{
|
|
191
|
+
readonly key?: string | undefined;
|
|
192
|
+
readonly name: string;
|
|
193
|
+
readonly version: string;
|
|
194
|
+
readonly description?: string | undefined;
|
|
195
|
+
readonly updated?: string | undefined;
|
|
196
|
+
readonly source?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown> | undefined;
|
|
197
|
+
readonly inputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
198
|
+
readonly outputSchema?: import("@dxos/echo/internal").JsonSchemaType | undefined;
|
|
199
|
+
readonly services?: readonly string[] | undefined;
|
|
200
|
+
readonly binding?: string | undefined;
|
|
201
|
+
}, Schema$.Struct.Fields>;
|
|
202
|
+
export interface PersistentOperation extends Schema$.Schema.Type<typeof PersistentOperation> {
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Serialize an operation definition to a persistent operation record.
|
|
206
|
+
*/
|
|
207
|
+
export declare const serialize: (operation: Definition.Any) => PersistentOperation;
|
|
208
|
+
/**
|
|
209
|
+
* Deserialize a persistent operation record to an operation definition.
|
|
210
|
+
*/
|
|
211
|
+
export declare const deserialize: (record: PersistentOperation) => Definition.Any;
|
|
212
|
+
/**
|
|
213
|
+
* Update properties on the target operation record from the source operation record.
|
|
214
|
+
*/
|
|
215
|
+
export declare const setFrom: (target: PersistentOperation, source: PersistentOperation) => void;
|
|
216
|
+
/**
|
|
217
|
+
* Options for operation invocation.
|
|
218
|
+
*/
|
|
219
|
+
export interface InvokeOptions {
|
|
220
|
+
/**
|
|
221
|
+
* Space ID to provide database context for the handler.
|
|
222
|
+
*/
|
|
223
|
+
spaceId?: Key.SpaceId;
|
|
224
|
+
/**
|
|
225
|
+
* DXN string of the conversation feed (queue).
|
|
226
|
+
* Passed to the process environment so nested operations can resolve AiContextService and related services.
|
|
227
|
+
*/
|
|
228
|
+
conversation?: DXN.String;
|
|
229
|
+
/**
|
|
230
|
+
* Optional process-runtime tracing metadata (consumed by `@dxos/functions-runtime` when wired).
|
|
231
|
+
*/
|
|
232
|
+
tracing?: unknown;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Operation service interface - provides unified access to operation invocation and scheduling.
|
|
236
|
+
* This service is automatically provided to operation handlers.
|
|
237
|
+
*/
|
|
238
|
+
export interface OperationService {
|
|
239
|
+
/**
|
|
240
|
+
* Invoke an operation as an Effect.
|
|
241
|
+
* Returns an Effect that resolves to the operation output.
|
|
242
|
+
*/
|
|
243
|
+
invoke: <I, O>(op: Operation.Definition<I, O>, ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]) => Effect.Effect<O, NoHandlerError>;
|
|
244
|
+
/**
|
|
245
|
+
* Schedule an operation to run as a followup.
|
|
246
|
+
* The followup is tracked and won't be cancelled when the parent operation completes.
|
|
247
|
+
* Returns an Effect that completes immediately after scheduling.
|
|
248
|
+
*/
|
|
249
|
+
schedule: <I, O>(op: Operation.Definition<I, O>, ...args: void extends I ? [input?: I] : [input: I]) => Effect.Effect<void>;
|
|
250
|
+
/**
|
|
251
|
+
* Invoke an operation and return a Promise.
|
|
252
|
+
* Useful for async contexts where Effect is not available.
|
|
253
|
+
*/
|
|
254
|
+
invokePromise: <I, O>(op: Operation.Definition<I, O>, ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]) => Promise<{
|
|
255
|
+
data?: O;
|
|
256
|
+
error?: Error;
|
|
257
|
+
}>;
|
|
258
|
+
}
|
|
259
|
+
declare const Service_base: Context.TagClass<Service, "@dxos/operation/Service", OperationService>;
|
|
260
|
+
/**
|
|
261
|
+
* Context tag for the Operation service.
|
|
262
|
+
* Operation handlers can yield this to invoke other operations or schedule followups.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts
|
|
266
|
+
* const handler = (input) => Effect.gen(function* () {
|
|
267
|
+
* // Schedule a followup (fire and forget)
|
|
268
|
+
* yield* Operation.schedule(AnalyticsOperation, { event: 'completed' });
|
|
269
|
+
*
|
|
270
|
+
* // Invoke another operation
|
|
271
|
+
* return yield* Operation.invoke(OtherOperation, { data: input.data });
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
export declare class Service extends Service_base {
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Invoke an operation as an Effect.
|
|
279
|
+
* Yields the Operation.Service internally.
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* ```ts
|
|
283
|
+
* yield* Operation.invoke(MyOperation, { data: 'test' });
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
export declare const invoke: <I, O>(op: Operation.Definition<I, O>, ...args: void extends I ? [input?: I, options?: InvokeOptions] : [input: I, options?: InvokeOptions]) => Effect.Effect<O, NoHandlerError, Service>;
|
|
287
|
+
/**
|
|
288
|
+
* Schedule an operation to run as a followup.
|
|
289
|
+
* Yields the Operation.Service internally.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```ts
|
|
293
|
+
* yield* Operation.schedule(AnalyticsOperation, { event: 'completed' });
|
|
294
|
+
* yield* Operation.schedule(VoidOperation); // input optional when void
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
export declare const schedule: <I, O>(op: Operation.Definition<I, O>, ...args: void extends I ? [input?: I] : [input: I]) => Effect.Effect<void, never, Service>;
|
|
298
|
+
/**
|
|
299
|
+
* Provides additional invocation options to all invocations.
|
|
300
|
+
*/
|
|
301
|
+
export declare const withInvocationOptions: (options: InvokeOptions) => Layer.Layer<Service, never, Service>;
|
|
302
|
+
export {};
|
|
303
|
+
//# sourceMappingURL=Operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../../src/Operation.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,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAA0B,GAAG,EAAO,IAAI,EAAE,KAAK,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAEx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AAC,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,KACnG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAGxC,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,MACvB,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,WACrB,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,KACjD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CACyE,CAAC;AAE/G;;GAEG;AACH,eAAO,MAAM,qBAAqB,YAAa,aAAa,KAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAa/F,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import { NoHandlerError } from './errors';
|
|
5
|
+
import type * as Operation from './Operation';
|
|
6
|
+
export declare const TypeId: '~@dxos/operation/OperationHandlerSet';
|
|
7
|
+
export type TypeId = typeof TypeId;
|
|
8
|
+
export interface OperationHandlerSet {
|
|
9
|
+
[TypeId]: TypeId;
|
|
10
|
+
readonly handlers: Effect.Effect<Operation.WithHandler<Operation.Definition.Any>[]>;
|
|
11
|
+
getHandlers(): Promise<Operation.WithHandler<Operation.Definition.Any>[]>;
|
|
12
|
+
}
|
|
13
|
+
export declare const isOperationHandlerSet: (value: unknown) => value is OperationHandlerSet;
|
|
14
|
+
export declare const empty: OperationHandlerSet;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new operation handler set from a list of handlers.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const set = OperationHandlerSet.make(
|
|
21
|
+
* Operation.withHandler(Operation.make({ input: Schema.Void, output: Schema.Void }), (input) => Effect.succeed({})),
|
|
22
|
+
* Operation.withHandler(Operation.make({ input: Schema.Void, output: Schema.Void }), (input) => Effect.succeed({})),
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const make: (...handlers: Operation.WithHandler<Operation.Definition.Any>[]) => OperationHandlerSet;
|
|
27
|
+
export declare const async: (getHandlers: () => Promise<Operation.WithHandler<Operation.Definition.Any>[]>) => OperationHandlerSet;
|
|
28
|
+
/**
|
|
29
|
+
* Merges multiple operation handler sets into a single set.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export declare const merge: (...sets: OperationHandlerSet[]) => OperationHandlerSet;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new operation handler set from a list of lazy-loaded modules.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const set = OperationHandlerSet.lazy(
|
|
39
|
+
* () => import('./my-handler'),
|
|
40
|
+
* () => import('./my-other-handler'),
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const lazy: (...modules: (() => Promise<{
|
|
45
|
+
default: Operation.WithHandler<Operation.Definition.Any>;
|
|
46
|
+
}>)[]) => OperationHandlerSet;
|
|
47
|
+
/**
|
|
48
|
+
* Gets a handler for an operation by definition.
|
|
49
|
+
*/
|
|
50
|
+
export declare const getHandler: <const Op extends Operation.Definition.Any>(set: OperationHandlerSet, definition: Op) => Effect.Effect<Operation.WithHandler<Op>, NoHandlerError>;
|
|
51
|
+
/**
|
|
52
|
+
* Gets a handler for an operation by key.
|
|
53
|
+
*/
|
|
54
|
+
export declare const getHandlerByKey: (set: OperationHandlerSet, key: string) => Effect.Effect<Operation.WithHandler<Operation.Definition.Any>, NoHandlerError>;
|
|
55
|
+
declare const OperationHandlerProvider_base: Context.TagClass<OperationHandlerProvider, "@dxos/operation/OperationHandlerProvider", OperationHandlerSet>;
|
|
56
|
+
export declare class OperationHandlerProvider extends OperationHandlerProvider_base {
|
|
57
|
+
}
|
|
58
|
+
export declare const provide: (handlers: OperationHandlerSet) => Layer.Layer<OperationHandlerProvider, never, never>;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=OperationHandlerSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationHandlerSet.d.ts","sourceRoot":"","sources":["../../../src/OperationHandlerSet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAE9C,eAAO,MAAM,MAAM,EAAG,sCAA+C,CAAC;AACtE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,MAAM,WAAW,mBAAmB;IAClC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEpF,WAAW,IAAI,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;CAC3E;AAED,eAAO,MAAM,qBAAqB,UAAW,OAAO,KAAG,KAAK,IAAI,mBAE/D,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,mBAInB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,gBAAiB,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAG,mBAErF,CAAC;AAEF,eAAO,MAAM,KAAK,gBACH,MAAM,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,KAC5E,mBAcF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,mBAAmB,EAAE,KAAG,mBAGtD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,eACH,CAAC,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CAAC,EAAE,KAC1F,mBAEF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,CAAC,EAAE,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,OAC7D,mBAAmB,cACZ,EAAE,KACb,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,cAAc,CAQtD,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,eAAe,QACrB,mBAAmB,OACnB,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,cAAc,CAQ5E,CAAC;;AAEL,qBAAa,wBAAyB,SAAQ,6BAG3C;CAAG;AAEN,eAAO,MAAM,OAAO,aAAc,mBAAmB,KAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,EAAE,KAAK,CACvD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import * as Option from 'effect/Option';
|
|
5
|
+
import { Database } from '@dxos/echo';
|
|
6
|
+
import * as Operation from './Operation';
|
|
7
|
+
import * as OperationHandlerSet from './OperationHandlerSet';
|
|
8
|
+
export interface OperationRegistry {
|
|
9
|
+
/**
|
|
10
|
+
* Resolve an operation by key.
|
|
11
|
+
*/
|
|
12
|
+
resolve(key: string): Effect.Effect<Option.Option<Operation.Definition.Any>>;
|
|
13
|
+
}
|
|
14
|
+
declare const Service_base: Context.TagClass<Service, "@dxos/operation/OperationRegistry", OperationRegistry>;
|
|
15
|
+
export declare class Service extends Service_base {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolve an operation by key.
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolve: (key: string) => Effect.Effect<Option.Option<Operation.Definition.Any>, never, Service>;
|
|
21
|
+
export declare const layer: Layer.Layer<Service, never, Database.Service | OperationHandlerSet.OperationHandlerProvider>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=OperationRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationRegistry.d.ts","sourceRoot":"","sources":["../../../src/OperationRegistry.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,EAAE,QAAQ,EAAS,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,mBAAmB,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9E;;AAED,qBAAa,OAAQ,SAAQ,YAA8E;CAAG;AAE9G;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,CACvC,CAAC;AAEtE,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,GAAG,mBAAmB,CAAC,wBAAwB,CAkB5G,CAAC"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import type { Atom } from '@effect-atom/atom';
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import type * as Exit from 'effect/Exit';
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
import * as Scope from 'effect/Scope';
|
|
8
|
+
import type * as Types from 'effect/Types';
|
|
9
|
+
import type { ObjectId } from '@dxos/protocols';
|
|
10
|
+
import * as Operation from './Operation';
|
|
11
|
+
import * as OperationHandlerSet from './OperationHandlerSet';
|
|
12
|
+
import * as Trace from './Trace';
|
|
13
|
+
/** Opaque process id (arbitrary string). */
|
|
14
|
+
export declare const ID: Schema.brand<typeof Schema.String, "ProcessId">;
|
|
15
|
+
export type ID = Schema.Schema.Type<typeof ID>;
|
|
16
|
+
/**
|
|
17
|
+
* A running process callbacks.
|
|
18
|
+
*
|
|
19
|
+
* Process lifecycle: Initial -> Running <-> Suspended -> Terminated.
|
|
20
|
+
*
|
|
21
|
+
* - onSpawn -> called once when the process is spawned.
|
|
22
|
+
* - onInput -> called for every input submitted to the process.
|
|
23
|
+
* - onAlarm -> called for processes scheduling alarms.
|
|
24
|
+
* - onChildEvent -> called when child process produces output or exits.
|
|
25
|
+
*/
|
|
26
|
+
export interface Callbacks<I, O, R> {
|
|
27
|
+
/**
|
|
28
|
+
* Called when the process is spawned.
|
|
29
|
+
* Not called for processes that are resumed from a previously suspended state.
|
|
30
|
+
*
|
|
31
|
+
* @returns A signal indicating to the runtime whether the process is finished, or should be resumed later.
|
|
32
|
+
* @throws Throwing in the handler will terminate the process with an error.
|
|
33
|
+
*
|
|
34
|
+
* Note: This function should aim to complete in under 5 seconds to avoid exceeding limits in serverless environments.
|
|
35
|
+
*/
|
|
36
|
+
onSpawn(): Effect.Effect<void, never, R | BaseServices>;
|
|
37
|
+
/**
|
|
38
|
+
* Called when there's input available to process.
|
|
39
|
+
*
|
|
40
|
+
* The function can be called in parallel.
|
|
41
|
+
*
|
|
42
|
+
* @returns A signal indicating to the runtime whether the process is finished, or should be resumed later.
|
|
43
|
+
* @throws Throwing in the handler will terminate the process with an error.
|
|
44
|
+
*
|
|
45
|
+
* Note: This function should aim to complete in under 5 seconds to avoid exceeding limits in serverless environments.
|
|
46
|
+
*/
|
|
47
|
+
onInput(input: I): Effect.Effect<void, never, R | BaseServices>;
|
|
48
|
+
/**
|
|
49
|
+
* Called when the process's alarm is triggered.
|
|
50
|
+
*
|
|
51
|
+
* @throws Throwing in the handler will terminate the process with an error.
|
|
52
|
+
*/
|
|
53
|
+
onAlarm(): Effect.Effect<void, never, R | BaseServices>;
|
|
54
|
+
/**
|
|
55
|
+
* Called when the process's child process produces output or exits.
|
|
56
|
+
*
|
|
57
|
+
* This allows the parent process to hibernate while a long-running child process is running.
|
|
58
|
+
*/
|
|
59
|
+
onChildEvent(event: ChildEvent<unknown>): Effect.Effect<void, never, R | BaseServices>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Services that are always available to all processes.
|
|
63
|
+
*/
|
|
64
|
+
export type BaseServices = Trace.TraceService;
|
|
65
|
+
export type ChildEvent<T> = {
|
|
66
|
+
readonly _tag: 'output';
|
|
67
|
+
readonly pid: ID;
|
|
68
|
+
readonly data: T;
|
|
69
|
+
} | {
|
|
70
|
+
readonly _tag: 'exited';
|
|
71
|
+
readonly pid: ID;
|
|
72
|
+
readonly result: Exit.Exit<void>;
|
|
73
|
+
};
|
|
74
|
+
export interface ProcessContext<I, O> {
|
|
75
|
+
readonly id: ID;
|
|
76
|
+
/**
|
|
77
|
+
* Parameters assigned during process creation.
|
|
78
|
+
*/
|
|
79
|
+
readonly params: Params;
|
|
80
|
+
/**
|
|
81
|
+
* Complete this process with sucessful result.
|
|
82
|
+
* No additional events will be pushed to the process.
|
|
83
|
+
*/
|
|
84
|
+
succeed(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Complete this process with an error.
|
|
87
|
+
* No additional events will be pushed to the process.
|
|
88
|
+
*/
|
|
89
|
+
fail(error: Error): void;
|
|
90
|
+
/**
|
|
91
|
+
* Submit output of the process.
|
|
92
|
+
*/
|
|
93
|
+
submitOutput(output: O): void;
|
|
94
|
+
/**
|
|
95
|
+
* Set an alarm for the process to be woken up later.
|
|
96
|
+
*
|
|
97
|
+
* @param timeout - Optional timeout in milliseconds. If not provided, the process is woken up as soon as possible.
|
|
98
|
+
*/
|
|
99
|
+
setAlarm(timeout?: number): void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Generic parameters for a all processes.
|
|
103
|
+
*/
|
|
104
|
+
export interface Params {
|
|
105
|
+
/**
|
|
106
|
+
* Process name for debugging purposes.
|
|
107
|
+
*/
|
|
108
|
+
readonly name: string | null;
|
|
109
|
+
/**
|
|
110
|
+
* Target object that this process is assigned to.
|
|
111
|
+
*/
|
|
112
|
+
readonly target: ObjectId | null;
|
|
113
|
+
}
|
|
114
|
+
export declare const ProcessTypeId: '~@dxos/functions/Process';
|
|
115
|
+
export type ProcessTypeId = typeof ProcessTypeId;
|
|
116
|
+
/**
|
|
117
|
+
* A process (factory).
|
|
118
|
+
* Can be instantiated mutlitple times to produce new runtime instance with separate state and callbacks.
|
|
119
|
+
* `create` is used to instantiate a new process.
|
|
120
|
+
* Can store runtime state in scope of `create` function.
|
|
121
|
+
*/
|
|
122
|
+
export interface Process<I, O, R> extends Process.Variance<I, O, R> {
|
|
123
|
+
/**
|
|
124
|
+
* Unique identifier for the executable in the reverse DNS format.
|
|
125
|
+
*/
|
|
126
|
+
readonly key: string;
|
|
127
|
+
/**
|
|
128
|
+
* Human-readable label from {@link MakeExecutableOpts.name} when provided.
|
|
129
|
+
*/
|
|
130
|
+
readonly name?: string;
|
|
131
|
+
readonly services: readonly Context.Tag<any, any>[];
|
|
132
|
+
/**
|
|
133
|
+
* Create a new instance of the process.
|
|
134
|
+
*/
|
|
135
|
+
create(ctx: ProcessContext<I, O>): Effect.Effect<Callbacks<I, O, R>, never, R | BaseServices | Scope.Scope>;
|
|
136
|
+
}
|
|
137
|
+
export declare const isProcess: (executable: unknown) => executable is Process.Any;
|
|
138
|
+
export declare namespace Process {
|
|
139
|
+
interface Variance<I, O, R> {
|
|
140
|
+
readonly [ProcessTypeId]: {
|
|
141
|
+
readonly _Input: Types.Contravariant<I>;
|
|
142
|
+
readonly _Output: Types.Covariant<O>;
|
|
143
|
+
readonly _Requirements: Types.Covariant<R>;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
type Any = Process<any, any, never>;
|
|
147
|
+
}
|
|
148
|
+
export interface MakeProcessOpts {
|
|
149
|
+
/**
|
|
150
|
+
* Unique identifier for the process in the reverse DNS format.
|
|
151
|
+
*/
|
|
152
|
+
readonly key: string;
|
|
153
|
+
readonly input: Schema.Schema.AnyNoContext;
|
|
154
|
+
readonly output: Schema.Schema.AnyNoContext;
|
|
155
|
+
readonly services: readonly Context.Tag<any, any>[];
|
|
156
|
+
}
|
|
157
|
+
export declare const make: <const Opts extends Types.NoExcessProperties<MakeProcessOpts, Opts>>(opts: Opts, create: (ctx: ProcessContext<Schema.Schema.Type<Opts['input']>, Schema.Schema.Type<Opts['output']>>) => Effect.Effect<Partial<Callbacks<Schema.Schema.Type<Opts['input']>, Schema.Schema.Type<Opts['output']>, Context.Tag.Identifier<NonNullable<Opts['services']>[number]>>>, never, Context.Tag.Identifier<NonNullable<Opts['services']>[number]> | BaseServices | Scope.Scope>) => Process<Schema.Schema.Type<Opts['input']>, Schema.Schema.Type<Opts['output']>, Context.Tag.Identifier<NonNullable<Opts['services']>[number]>>;
|
|
158
|
+
export declare const fromOperation: <const Op extends Operation.Definition.Any>(op: Op, handler: OperationHandlerSet.OperationHandlerSet) => Process<Operation.Definition.Input<Op>, Operation.Definition.Output<Op>, Operation.Definition.Services<Op>>;
|
|
159
|
+
/**
|
|
160
|
+
* Runtime state of a process.
|
|
161
|
+
*/
|
|
162
|
+
export declare enum State {
|
|
163
|
+
RUNNING = "RUNNING",
|
|
164
|
+
HYBERNATING = "HYBERNATING",
|
|
165
|
+
IDLE = "IDLE",
|
|
166
|
+
TERMINATING = "TERMINATING",
|
|
167
|
+
TERMINATED = "TERMINATED",
|
|
168
|
+
SUCCEEDED = "SUCCEEDED",
|
|
169
|
+
FAILED = "FAILED"
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Read-only view of a process tree
|
|
173
|
+
*/
|
|
174
|
+
export interface Monitor {
|
|
175
|
+
/**
|
|
176
|
+
* Get the current state of the process tree.
|
|
177
|
+
*/
|
|
178
|
+
processTree: Effect.Effect<readonly Info[]>;
|
|
179
|
+
/**
|
|
180
|
+
* Atom for the process tree.
|
|
181
|
+
*/
|
|
182
|
+
processTreeAtom: Atom.Atom<readonly Info[]>;
|
|
183
|
+
}
|
|
184
|
+
declare const ProcessMonitorService_base: Context.TagClass<ProcessMonitorService, "@dxos/functions/ProcessMonitorService", Monitor>;
|
|
185
|
+
export declare class ProcessMonitorService extends ProcessMonitorService_base {
|
|
186
|
+
}
|
|
187
|
+
export interface Info {
|
|
188
|
+
readonly pid: ID;
|
|
189
|
+
readonly parentPid: ID | null;
|
|
190
|
+
/**
|
|
191
|
+
* Key of the process.
|
|
192
|
+
*
|
|
193
|
+
* NOTE: There might be multiple running processes with the same key.
|
|
194
|
+
*/
|
|
195
|
+
readonly key: string;
|
|
196
|
+
/**
|
|
197
|
+
* Parameters of the process.
|
|
198
|
+
*/
|
|
199
|
+
readonly params: Params;
|
|
200
|
+
/**
|
|
201
|
+
* State of the process.
|
|
202
|
+
*/
|
|
203
|
+
readonly state: State;
|
|
204
|
+
/**
|
|
205
|
+
* Error of the process.
|
|
206
|
+
* Only for process in FAILED state.
|
|
207
|
+
*/
|
|
208
|
+
readonly error: string | null;
|
|
209
|
+
/**
|
|
210
|
+
* UNIX timestamp in milliseconds.
|
|
211
|
+
*/
|
|
212
|
+
readonly startedAt: number;
|
|
213
|
+
/**
|
|
214
|
+
* UNIX timestamp in milliseconds.
|
|
215
|
+
*/
|
|
216
|
+
readonly completedAt: Option.Option<number>;
|
|
217
|
+
readonly metrics: {
|
|
218
|
+
/**
|
|
219
|
+
* Total wall time of all handler invocations of the process in milliseconds.
|
|
220
|
+
*/
|
|
221
|
+
readonly wallTime: number;
|
|
222
|
+
/**
|
|
223
|
+
* Total number of inputs submitted to the process.
|
|
224
|
+
*/
|
|
225
|
+
readonly inputCount: number;
|
|
226
|
+
/**
|
|
227
|
+
* Total number of outputs submitted to the process.
|
|
228
|
+
*/
|
|
229
|
+
readonly outputCount: number;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* New process is spawned.
|
|
234
|
+
*/
|
|
235
|
+
export declare const SpawnedEvent: Trace.EventType<void>;
|
|
236
|
+
/**
|
|
237
|
+
* Process has reached a terminal state.
|
|
238
|
+
*/
|
|
239
|
+
export declare const ExitedEvent: Trace.EventType<{
|
|
240
|
+
readonly outcome: "failed" | "succeeded" | "terminated";
|
|
241
|
+
}>;
|
|
242
|
+
/**
|
|
243
|
+
* Renders spawned processes as a forest: top-level rows use "- ", nested rows use ├── / └── / │.
|
|
244
|
+
*/
|
|
245
|
+
export declare const prettyProcessTree: (tree: readonly Info[]) => string;
|
|
246
|
+
export {};
|
|
247
|
+
//# sourceMappingURL=Process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Process.d.ts","sourceRoot":"","sources":["../../../src/Process.ts"],"names":[],"mappings":"AAMA,OA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