@tasker-systems/tasker 0.1.3 → 0.1.5
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 +47 -86
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.js +374 -295
- package/dist/events/index.js.map +1 -1
- package/dist/ffi/index.d.ts +323 -242
- package/dist/ffi/index.js +66 -1896
- package/dist/ffi/index.js.map +1 -1
- package/dist/{index-CTl8lGpU.d.ts → index-Bvdub2HH.d.ts} +77 -36
- package/dist/index.d.ts +75 -141
- package/dist/index.js +622 -2491
- package/dist/index.js.map +1 -1
- package/package.json +14 -7
- package/{native/libtasker_ts-darwin-arm64.dylib → tasker_ts.darwin-arm64.node} +0 -0
- package/{native/libtasker_ts-linux-x64.so → tasker_ts.linux-x64-gnu.node} +0 -0
- package/dist/koffi-3HFAASOB.node +0 -0
- package/dist/koffi-AHHUCM3C.node +0 -0
- package/dist/koffi-AVDVVSXH.node +0 -0
- package/dist/koffi-BMO5K7B3.node +0 -0
- package/dist/koffi-G4D35B2D.node +0 -0
- package/dist/koffi-GG4SDSYA.node +0 -0
- package/dist/koffi-GOENU54R.node +0 -0
- package/dist/koffi-IDX6JEDH.node +0 -0
- package/dist/koffi-KFZAXWPQ.node +0 -0
- package/dist/koffi-LOH6WKRQ.node +0 -0
- package/dist/koffi-LUY2JHJP.node +0 -0
- package/dist/koffi-OMHWL3D6.node +0 -0
- package/dist/koffi-QKY2KSXW.node +0 -0
- package/dist/koffi-ROB3FRHA.node +0 -0
- package/dist/koffi-SE4ZI36U.node +0 -0
- package/dist/koffi-X3YT67KE.node +0 -0
- package/dist/koffi-X7JMBSZH.node +0 -0
- package/dist/koffi-YNQDUF3Q.node +0 -0
- package/dist/runtime-interface-D940vUzy.d.ts +0 -694
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import { S as StepHandlerResult, a as StepHandler, B as BatchWorkerConfig, b as StepContext, E as ExecutableHandler, c as StepHandlerClass, T as TaskerEventEmitter, d as EventPoller, e as StepExecutionSubscriber, f as EventSystem } from './index-CTl8lGpU.js';
|
|
6
|
-
export { y as ErrorCallback, I as ErrorType, n as EventName, o as EventNames, z as EventPollerConfig, F as EventSystemConfig, G as EventSystemStats, A as MetricsCallback, p as MetricsEventName, q as MetricsEventNames, M as MetricsPayload, P as PollerCyclePayload, r as PollerEventName, s as PollerEventNames, C as PollerState, g as StepCompletionSentPayload, L as StepContextParams, D as StepEventCallback, t as StepEventName, u as StepEventNames, h as StepExecutionCompletedPayload, i as StepExecutionFailedPayload, j as StepExecutionReceivedPayload, k as StepExecutionStartedPayload, H as StepExecutionSubscriberConfig, N as StepHandlerResultParams, l as TaskerEventMap, W as WorkerErrorPayload, v as WorkerEventName, w as WorkerEventNames, m as WorkerEventPayload, x as createEventPoller, J as isStandardErrorType, K as isTypicallyRetryable } from './index-CTl8lGpU.js';
|
|
1
|
+
import { NapiModule, FfiLayer, FfiDomainEvent, FfiLayerConfig } from './ffi/index.js';
|
|
2
|
+
export { BootstrapConfig as FfiBootstrapConfig, BootstrapResult as FfiBootstrapResult, FfiDispatchMetrics, LogFields as FfiLogFields, FfiStepEvent, StopResult as FfiStopResult, WorkerStatus as FfiWorkerStatus, NapiBackoffHint, NapiCheckpointYieldData, NapiClientResult, NapiDependencyResult, NapiDispatchMetrics, NapiDomainEvent, NapiDomainEventMetadata, NapiListTasksParams, NapiOrchestrationMetadata, NapiStepDefinition, NapiStepEvent, NapiStepExecutionError, NapiStepExecutionMetadata, NapiStepExecutionResult, NapiTaskInfo, NapiTaskRequest, NapiWorkflowStep, StepExecutionResult } from './ffi/index.js';
|
|
3
|
+
import { S as StepHandlerResult, a as StepHandler, B as BatchWorkerConfig, b as StepContext, E as ExecutableHandler, c as StepHandlerClass, T as TaskerEventEmitter, d as EventPoller, e as StepExecutionSubscriber, f as EventSystem } from './index-Bvdub2HH.js';
|
|
4
|
+
export { y as ErrorCallback, I as ErrorType, n as EventName, o as EventNames, z as EventPollerConfig, F as EventSystemConfig, G as EventSystemStats, A as MetricsCallback, p as MetricsEventName, q as MetricsEventNames, M as MetricsPayload, P as PollerCyclePayload, r as PollerEventName, s as PollerEventNames, C as PollerState, g as StepCompletionSentPayload, L as StepContextParams, D as StepEventCallback, t as StepEventName, u as StepEventNames, h as StepExecutionCompletedPayload, i as StepExecutionFailedPayload, j as StepExecutionReceivedPayload, k as StepExecutionStartedPayload, H as StepExecutionSubscriberConfig, N as StepHandlerResultParams, l as TaskerEventMap, W as WorkerErrorPayload, v as WorkerEventName, w as WorkerEventNames, m as WorkerEventPayload, x as createEventPoller, J as isStandardErrorType, K as isTypicallyRetryable } from './index-Bvdub2HH.js';
|
|
7
5
|
import { Logger } from 'pino';
|
|
8
6
|
import 'eventemitter3';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Bootstrap configuration and result types.
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* TAS-290: With napi-rs, FFI types are already camelCase, so conversion
|
|
12
|
+
* functions are simplified (mostly pass-through).
|
|
15
13
|
*/
|
|
16
14
|
|
|
17
15
|
/**
|
|
@@ -33,8 +31,6 @@ interface BootstrapConfig {
|
|
|
33
31
|
}
|
|
34
32
|
/**
|
|
35
33
|
* Result from worker bootstrap.
|
|
36
|
-
*
|
|
37
|
-
* Contains information about the bootstrapped worker instance.
|
|
38
34
|
*/
|
|
39
35
|
interface BootstrapResult {
|
|
40
36
|
/** Whether bootstrap was successful. */
|
|
@@ -50,8 +46,6 @@ interface BootstrapResult {
|
|
|
50
46
|
}
|
|
51
47
|
/**
|
|
52
48
|
* Current worker status.
|
|
53
|
-
*
|
|
54
|
-
* Contains detailed information about the worker's state and resources.
|
|
55
49
|
*/
|
|
56
50
|
interface WorkerStatus {
|
|
57
51
|
/** Whether the status query succeeded. */
|
|
@@ -99,8 +93,9 @@ interface StopResult {
|
|
|
99
93
|
*
|
|
100
94
|
* Matches Python's bootstrap.py and Ruby's bootstrap.rb (TAS-92 aligned).
|
|
101
95
|
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
96
|
+
* TAS-290: Uses NapiModule directly instead of TaskerRuntime abstraction.
|
|
97
|
+
* All functions require an explicit module parameter. Use FfiLayer to load
|
|
98
|
+
* the module before calling these functions.
|
|
104
99
|
*/
|
|
105
100
|
|
|
106
101
|
/**
|
|
@@ -113,7 +108,7 @@ interface StopResult {
|
|
|
113
108
|
* - Subscribing to domain events
|
|
114
109
|
*
|
|
115
110
|
* @param config - Optional bootstrap configuration
|
|
116
|
-
* @param
|
|
111
|
+
* @param module - The loaded napi-rs module (required)
|
|
117
112
|
* @returns BootstrapResult with worker details and status
|
|
118
113
|
* @throws Error if bootstrap fails critically
|
|
119
114
|
*
|
|
@@ -121,41 +116,41 @@ interface StopResult {
|
|
|
121
116
|
* ```typescript
|
|
122
117
|
* const ffiLayer = new FfiLayer();
|
|
123
118
|
* await ffiLayer.load();
|
|
124
|
-
* const result = await bootstrapWorker({ namespace: 'payments' }, ffiLayer.
|
|
119
|
+
* const result = await bootstrapWorker({ namespace: 'payments' }, ffiLayer.getModule());
|
|
125
120
|
* console.log(`Worker ${result.workerId} started`);
|
|
126
121
|
* ```
|
|
127
122
|
*/
|
|
128
|
-
declare function bootstrapWorker(config: BootstrapConfig | undefined,
|
|
123
|
+
declare function bootstrapWorker(config: BootstrapConfig | undefined, module: NapiModule): Promise<BootstrapResult>;
|
|
129
124
|
/**
|
|
130
125
|
* Stop the worker system gracefully.
|
|
131
126
|
*
|
|
132
127
|
* This function stops the worker system and releases all resources.
|
|
133
128
|
* Safe to call even if the worker is not running.
|
|
134
129
|
*
|
|
135
|
-
* @param
|
|
130
|
+
* @param module - The loaded napi-rs module (optional - returns success if not loaded)
|
|
136
131
|
* @returns StopResult indicating the outcome
|
|
137
132
|
*
|
|
138
133
|
* @example
|
|
139
134
|
* ```typescript
|
|
140
|
-
* const result = stopWorker(
|
|
135
|
+
* const result = stopWorker(module);
|
|
141
136
|
* if (result.success) {
|
|
142
137
|
* console.log('Worker stopped successfully');
|
|
143
138
|
* }
|
|
144
139
|
* ```
|
|
145
140
|
*/
|
|
146
|
-
declare function stopWorker(
|
|
141
|
+
declare function stopWorker(module?: NapiModule): StopResult;
|
|
147
142
|
/**
|
|
148
143
|
* Get the current worker system status.
|
|
149
144
|
*
|
|
150
145
|
* Returns detailed information about the worker's current state,
|
|
151
146
|
* including resource usage and operational status.
|
|
152
147
|
*
|
|
153
|
-
* @param
|
|
148
|
+
* @param module - The loaded napi-rs module (optional - returns stopped if not loaded)
|
|
154
149
|
* @returns WorkerStatus with current state and metrics
|
|
155
150
|
*
|
|
156
151
|
* @example
|
|
157
152
|
* ```typescript
|
|
158
|
-
* const status = getWorkerStatus(
|
|
153
|
+
* const status = getWorkerStatus(module);
|
|
159
154
|
* if (status.running) {
|
|
160
155
|
* console.log(`Pool size: ${status.databasePoolSize}`);
|
|
161
156
|
* } else {
|
|
@@ -163,7 +158,7 @@ declare function stopWorker(runtime?: TaskerRuntime): StopResult;
|
|
|
163
158
|
* }
|
|
164
159
|
* ```
|
|
165
160
|
*/
|
|
166
|
-
declare function getWorkerStatus(
|
|
161
|
+
declare function getWorkerStatus(module?: NapiModule): WorkerStatus;
|
|
167
162
|
/**
|
|
168
163
|
* Initiate graceful shutdown of the worker system.
|
|
169
164
|
*
|
|
@@ -171,69 +166,66 @@ declare function getWorkerStatus(runtime?: TaskerRuntime): WorkerStatus;
|
|
|
171
166
|
* in-flight operations to complete before fully stopping.
|
|
172
167
|
* Call stopWorker() after this to fully stop the worker.
|
|
173
168
|
*
|
|
174
|
-
* @param
|
|
169
|
+
* @param module - The loaded napi-rs module (optional - returns success if not loaded)
|
|
175
170
|
* @returns StopResult indicating the transition status
|
|
176
171
|
*
|
|
177
172
|
* @example
|
|
178
173
|
* ```typescript
|
|
179
174
|
* // Start graceful shutdown
|
|
180
|
-
* transitionToGracefulShutdown(
|
|
175
|
+
* transitionToGracefulShutdown(module);
|
|
181
176
|
*
|
|
182
177
|
* // Wait for in-flight operations...
|
|
183
178
|
* await new Promise(resolve => setTimeout(resolve, 5000));
|
|
184
179
|
*
|
|
185
180
|
* // Fully stop
|
|
186
|
-
* stopWorker(
|
|
181
|
+
* stopWorker(module);
|
|
187
182
|
* ```
|
|
188
183
|
*/
|
|
189
|
-
declare function transitionToGracefulShutdown(
|
|
184
|
+
declare function transitionToGracefulShutdown(module?: NapiModule): StopResult;
|
|
190
185
|
/**
|
|
191
186
|
* Check if the worker system is currently running.
|
|
192
187
|
*
|
|
193
188
|
* Lightweight check that doesn't query the full status.
|
|
194
189
|
*
|
|
195
|
-
* @param
|
|
190
|
+
* @param module - The loaded napi-rs module (optional - returns false if not loaded)
|
|
196
191
|
* @returns True if the worker is running
|
|
197
192
|
*
|
|
198
193
|
* @example
|
|
199
194
|
* ```typescript
|
|
200
|
-
* if (!isWorkerRunning(
|
|
201
|
-
* await bootstrapWorker(config,
|
|
195
|
+
* if (!isWorkerRunning(module)) {
|
|
196
|
+
* await bootstrapWorker(config, module);
|
|
202
197
|
* }
|
|
203
198
|
* ```
|
|
204
199
|
*/
|
|
205
|
-
declare function isWorkerRunning(
|
|
200
|
+
declare function isWorkerRunning(module?: NapiModule): boolean;
|
|
206
201
|
/**
|
|
207
202
|
* Get version information for the worker system.
|
|
208
203
|
*
|
|
209
|
-
* @param
|
|
204
|
+
* @param module - The loaded napi-rs module (optional)
|
|
210
205
|
* @returns Version string from the Rust library
|
|
211
206
|
*/
|
|
212
|
-
declare function getVersion(
|
|
207
|
+
declare function getVersion(module?: NapiModule): string;
|
|
213
208
|
/**
|
|
214
209
|
* Get detailed Rust library version.
|
|
215
210
|
*
|
|
216
|
-
* @param
|
|
211
|
+
* @param module - The loaded napi-rs module (optional)
|
|
217
212
|
* @returns Detailed version information
|
|
218
213
|
*/
|
|
219
|
-
declare function getRustVersion(
|
|
214
|
+
declare function getRustVersion(module?: NapiModule): string;
|
|
220
215
|
/**
|
|
221
216
|
* Perform a health check on the FFI module.
|
|
222
217
|
*
|
|
223
|
-
* @param
|
|
218
|
+
* @param module - The loaded napi-rs module (optional - returns false if not loaded)
|
|
224
219
|
* @returns True if the FFI module is functional
|
|
225
220
|
*/
|
|
226
|
-
declare function healthCheck(
|
|
221
|
+
declare function healthCheck(module?: NapiModule): boolean;
|
|
227
222
|
|
|
228
223
|
/**
|
|
229
224
|
* High-level client wrapper for orchestration API operations.
|
|
230
225
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* This module provides a `TaskerClient` class with typed methods, sensible
|
|
236
|
-
* defaults, and proper error handling.
|
|
226
|
+
* TAS-290: With napi-rs, requests are passed as typed objects directly —
|
|
227
|
+
* no JSON.stringify() at the boundary. This eliminates TAS-283 trailing
|
|
228
|
+
* input bugs.
|
|
237
229
|
*
|
|
238
230
|
* @example
|
|
239
231
|
* ```typescript
|
|
@@ -244,7 +236,7 @@ declare function healthCheck(runtime?: TaskerRuntime): boolean;
|
|
|
244
236
|
* const client = new TaskerClient(ffiLayer);
|
|
245
237
|
*
|
|
246
238
|
* const task = client.createTask({ name: 'process_order', namespace: 'ecommerce' });
|
|
247
|
-
* console.log(task.
|
|
239
|
+
* console.log(task.taskUuid);
|
|
248
240
|
* ```
|
|
249
241
|
*
|
|
250
242
|
* @packageDocumentation
|
|
@@ -273,13 +265,13 @@ interface CreateTaskOptions {
|
|
|
273
265
|
/** Optional tags */
|
|
274
266
|
tags?: string[];
|
|
275
267
|
/** Optional priority */
|
|
276
|
-
priority?: number
|
|
268
|
+
priority?: number;
|
|
277
269
|
/** Optional correlation ID (auto-generated if not provided) */
|
|
278
270
|
correlationId?: string;
|
|
279
271
|
/** Optional parent correlation ID */
|
|
280
|
-
parentCorrelationId?: string
|
|
272
|
+
parentCorrelationId?: string;
|
|
281
273
|
/** Optional idempotency key */
|
|
282
|
-
idempotencyKey?: string
|
|
274
|
+
idempotencyKey?: string;
|
|
283
275
|
}
|
|
284
276
|
/**
|
|
285
277
|
* Options for listing tasks.
|
|
@@ -315,26 +307,26 @@ declare class TaskerClient {
|
|
|
315
307
|
* Create a task via the orchestration API.
|
|
316
308
|
*
|
|
317
309
|
* @param options - Task creation options (only `name` is required)
|
|
318
|
-
* @returns Typed task response
|
|
310
|
+
* @returns Typed task response data
|
|
319
311
|
* @throws TaskerClientError if the operation fails
|
|
320
312
|
*/
|
|
321
|
-
createTask(options: CreateTaskOptions):
|
|
313
|
+
createTask(options: CreateTaskOptions): unknown;
|
|
322
314
|
/**
|
|
323
315
|
* Get a task by UUID.
|
|
324
316
|
*
|
|
325
317
|
* @param taskUuid - The task UUID
|
|
326
|
-
* @returns Typed task response
|
|
318
|
+
* @returns Typed task response data
|
|
327
319
|
* @throws TaskerClientError if the operation fails
|
|
328
320
|
*/
|
|
329
|
-
getTask(taskUuid: string):
|
|
321
|
+
getTask(taskUuid: string): unknown;
|
|
330
322
|
/**
|
|
331
323
|
* List tasks with optional filtering and pagination.
|
|
332
324
|
*
|
|
333
325
|
* @param options - Filtering and pagination options
|
|
334
|
-
* @returns Typed task list response
|
|
326
|
+
* @returns Typed task list response data
|
|
335
327
|
* @throws TaskerClientError if the operation fails
|
|
336
328
|
*/
|
|
337
|
-
listTasks(options?: ListTasksOptions):
|
|
329
|
+
listTasks(options?: ListTasksOptions): unknown;
|
|
338
330
|
/**
|
|
339
331
|
* Cancel a task by UUID.
|
|
340
332
|
*
|
|
@@ -346,43 +338,43 @@ declare class TaskerClient {
|
|
|
346
338
|
* List workflow steps for a task.
|
|
347
339
|
*
|
|
348
340
|
* @param taskUuid - The task UUID
|
|
349
|
-
* @returns Array of
|
|
341
|
+
* @returns Array of step data
|
|
350
342
|
* @throws TaskerClientError if the operation fails
|
|
351
343
|
*/
|
|
352
|
-
listTaskSteps(taskUuid: string):
|
|
344
|
+
listTaskSteps(taskUuid: string): unknown;
|
|
353
345
|
/**
|
|
354
346
|
* Get a specific workflow step.
|
|
355
347
|
*
|
|
356
348
|
* @param taskUuid - The task UUID
|
|
357
349
|
* @param stepUuid - The step UUID
|
|
358
|
-
* @returns Typed step response
|
|
350
|
+
* @returns Typed step response data
|
|
359
351
|
* @throws TaskerClientError if the operation fails
|
|
360
352
|
*/
|
|
361
|
-
getStep(taskUuid: string, stepUuid: string):
|
|
353
|
+
getStep(taskUuid: string, stepUuid: string): unknown;
|
|
362
354
|
/**
|
|
363
355
|
* Get audit history for a workflow step.
|
|
364
356
|
*
|
|
365
357
|
* @param taskUuid - The task UUID
|
|
366
358
|
* @param stepUuid - The step UUID
|
|
367
|
-
* @returns Array of
|
|
359
|
+
* @returns Array of audit history entries
|
|
368
360
|
* @throws TaskerClientError if the operation fails
|
|
369
361
|
*/
|
|
370
|
-
getStepAuditHistory(taskUuid: string, stepUuid: string):
|
|
362
|
+
getStepAuditHistory(taskUuid: string, stepUuid: string): unknown;
|
|
371
363
|
/**
|
|
372
364
|
* Check orchestration API health.
|
|
373
365
|
*
|
|
374
|
-
* @returns Typed health response
|
|
366
|
+
* @returns Typed health response data
|
|
375
367
|
* @throws TaskerClientError if the operation fails
|
|
376
368
|
*/
|
|
377
|
-
healthCheck():
|
|
369
|
+
healthCheck(): unknown;
|
|
378
370
|
/**
|
|
379
|
-
* Unwrap a
|
|
371
|
+
* Unwrap a NapiClientResult envelope, throwing on error.
|
|
380
372
|
*/
|
|
381
373
|
private unwrap;
|
|
382
374
|
/**
|
|
383
|
-
* Get the
|
|
375
|
+
* Get the napi-rs module from the layer.
|
|
384
376
|
*/
|
|
385
|
-
private
|
|
377
|
+
private getModule;
|
|
386
378
|
}
|
|
387
379
|
|
|
388
380
|
/**
|
|
@@ -2635,7 +2627,7 @@ declare function ffiEventToDomainEvent(ffiEvent: FfiDomainEvent): DomainEvent;
|
|
|
2635
2627
|
* poller.start();
|
|
2636
2628
|
* ```
|
|
2637
2629
|
*/
|
|
2638
|
-
declare function createFfiPollAdapter(
|
|
2630
|
+
declare function createFfiPollAdapter(module: NapiModule): () => DomainEvent | null;
|
|
2639
2631
|
|
|
2640
2632
|
/**
|
|
2641
2633
|
* TAS-93: Handler definition type for resolver chain.
|
|
@@ -2661,7 +2653,19 @@ declare function createFfiPollAdapter(runtime: TaskerRuntime): () => DomainEvent
|
|
|
2661
2653
|
* }
|
|
2662
2654
|
* ```
|
|
2663
2655
|
*/
|
|
2664
|
-
|
|
2656
|
+
/**
|
|
2657
|
+
* Handler definition DTO from napi-rs (flattened from step definition).
|
|
2658
|
+
*
|
|
2659
|
+
* TAS-290: With napi-rs, handler fields are flattened into NapiStepDefinition
|
|
2660
|
+
* (handlerCallable, handlerMethod, handlerResolver, handlerInitialization).
|
|
2661
|
+
* This interface provides a compatible shape for fromDto().
|
|
2662
|
+
*/
|
|
2663
|
+
interface HandlerDefinitionDto {
|
|
2664
|
+
callable?: string;
|
|
2665
|
+
method?: string | null;
|
|
2666
|
+
resolver?: string | null;
|
|
2667
|
+
initialization?: Record<string, unknown>;
|
|
2668
|
+
}
|
|
2665
2669
|
/**
|
|
2666
2670
|
* Handler definition with resolution metadata.
|
|
2667
2671
|
*/
|
|
@@ -3756,98 +3760,26 @@ interface LogFields {
|
|
|
3756
3760
|
}
|
|
3757
3761
|
/**
|
|
3758
3762
|
* Log an ERROR level message with structured fields.
|
|
3759
|
-
*
|
|
3760
|
-
* Use this for unrecoverable failures that require intervention.
|
|
3761
|
-
*
|
|
3762
|
-
* @param message - The log message
|
|
3763
|
-
* @param fields - Optional structured fields for context
|
|
3764
|
-
*
|
|
3765
|
-
* @example
|
|
3766
|
-
* logError('Database connection failed', {
|
|
3767
|
-
* component: 'database',
|
|
3768
|
-
* operation: 'connect',
|
|
3769
|
-
* error_message: 'Connection timeout',
|
|
3770
|
-
* });
|
|
3771
3763
|
*/
|
|
3772
3764
|
declare function logError(message: string, fields?: LogFields): void;
|
|
3773
3765
|
/**
|
|
3774
3766
|
* Log a WARN level message with structured fields.
|
|
3775
|
-
*
|
|
3776
|
-
* Use this for degraded operation or retryable failures.
|
|
3777
|
-
*
|
|
3778
|
-
* @param message - The log message
|
|
3779
|
-
* @param fields - Optional structured fields for context
|
|
3780
|
-
*
|
|
3781
|
-
* @example
|
|
3782
|
-
* logWarn('Retry attempt 3 of 5', {
|
|
3783
|
-
* component: 'handler',
|
|
3784
|
-
* operation: 'retry',
|
|
3785
|
-
* attempt: 3,
|
|
3786
|
-
* });
|
|
3787
3767
|
*/
|
|
3788
3768
|
declare function logWarn(message: string, fields?: LogFields): void;
|
|
3789
3769
|
/**
|
|
3790
3770
|
* Log an INFO level message with structured fields.
|
|
3791
|
-
*
|
|
3792
|
-
* Use this for lifecycle events and state transitions.
|
|
3793
|
-
*
|
|
3794
|
-
* @param message - The log message
|
|
3795
|
-
* @param fields - Optional structured fields for context
|
|
3796
|
-
*
|
|
3797
|
-
* @example
|
|
3798
|
-
* logInfo('Task processing started', {
|
|
3799
|
-
* component: 'handler',
|
|
3800
|
-
* operation: 'process_payment',
|
|
3801
|
-
* correlation_id: 'abc-123',
|
|
3802
|
-
* task_uuid: 'task-456',
|
|
3803
|
-
* });
|
|
3804
3771
|
*/
|
|
3805
3772
|
declare function logInfo(message: string, fields?: LogFields): void;
|
|
3806
3773
|
/**
|
|
3807
3774
|
* Log a DEBUG level message with structured fields.
|
|
3808
|
-
*
|
|
3809
|
-
* Use this for detailed diagnostic information during development.
|
|
3810
|
-
*
|
|
3811
|
-
* @param message - The log message
|
|
3812
|
-
* @param fields - Optional structured fields for context
|
|
3813
|
-
*
|
|
3814
|
-
* @example
|
|
3815
|
-
* logDebug('Parsed request payload', {
|
|
3816
|
-
* component: 'handler',
|
|
3817
|
-
* payload_size: 1024,
|
|
3818
|
-
* content_type: 'application/json',
|
|
3819
|
-
* });
|
|
3820
3775
|
*/
|
|
3821
3776
|
declare function logDebug(message: string, fields?: LogFields): void;
|
|
3822
3777
|
/**
|
|
3823
3778
|
* Log a TRACE level message with structured fields.
|
|
3824
|
-
*
|
|
3825
|
-
* Use this for very verbose logging, like function entry/exit.
|
|
3826
|
-
* This level is typically disabled in production.
|
|
3827
|
-
*
|
|
3828
|
-
* @param message - The log message
|
|
3829
|
-
* @param fields - Optional structured fields for context
|
|
3830
|
-
*
|
|
3831
|
-
* @example
|
|
3832
|
-
* logTrace('Entering process_step', {
|
|
3833
|
-
* component: 'handler',
|
|
3834
|
-
* step_uuid: 'step-789',
|
|
3835
|
-
* });
|
|
3836
3779
|
*/
|
|
3837
3780
|
declare function logTrace(message: string, fields?: LogFields): void;
|
|
3838
3781
|
/**
|
|
3839
3782
|
* Create a logger with preset fields.
|
|
3840
|
-
*
|
|
3841
|
-
* Useful for creating component-specific loggers that automatically
|
|
3842
|
-
* include common fields in every log message.
|
|
3843
|
-
*
|
|
3844
|
-
* @param defaultFields - Fields to include in every log message
|
|
3845
|
-
* @returns Logger object with log methods
|
|
3846
|
-
*
|
|
3847
|
-
* @example
|
|
3848
|
-
* const logger = createLogger({ component: 'payment_handler' });
|
|
3849
|
-
* logger.info('Processing payment', { amount: 100 });
|
|
3850
|
-
* // Logs: { component: 'payment_handler', amount: 100 }
|
|
3851
3783
|
*/
|
|
3852
3784
|
declare function createLogger(defaultFields: LogFields): {
|
|
3853
3785
|
error: (message: string, fields?: LogFields) => void;
|
|
@@ -4030,8 +3962,8 @@ interface ServerStatus {
|
|
|
4030
3962
|
* Used by WorkerServer to manage lifecycle of all components.
|
|
4031
3963
|
*/
|
|
4032
3964
|
interface ServerComponents {
|
|
4033
|
-
/** FFI
|
|
4034
|
-
|
|
3965
|
+
/** napi-rs FFI module instance */
|
|
3966
|
+
module: NapiModule;
|
|
4035
3967
|
/** Event emitter for step events */
|
|
4036
3968
|
emitter: TaskerEventEmitter;
|
|
4037
3969
|
/** Handler registry */
|
|
@@ -4054,6 +3986,8 @@ interface ServerComponents {
|
|
|
4054
3986
|
* - Event processing (via EventSystem)
|
|
4055
3987
|
* - Graceful shutdown
|
|
4056
3988
|
*
|
|
3989
|
+
* TAS-290: Uses NapiModule directly instead of TaskerRuntime.
|
|
3990
|
+
*
|
|
4057
3991
|
* Design principles:
|
|
4058
3992
|
* - Explicit construction: No singleton pattern - caller creates and manages
|
|
4059
3993
|
* - Clear ownership: Owns FfiLayer, HandlerSystem, EventSystem
|
|
@@ -4170,4 +4104,4 @@ declare class WorkerServer {
|
|
|
4170
4104
|
private cleanupOnError;
|
|
4171
4105
|
}
|
|
4172
4106
|
|
|
4173
|
-
export { type APICapable, APIMixin, ApiHandler, ApiResponse, BasePublisher, type BaseResolver, BaseSubscriber, type BatchAggregationResult, type BatchAnalyzerOutcome, type BatchMetadata, type BatchProcessingOutcome, type BatchWorkerContext, type BatchWorkerOutcome, type Batchable, BatchableMixin, type BootstrapConfig, type BootstrapResult, ClassLookupResolver,
|
|
4107
|
+
export { type APICapable, APIMixin, ApiHandler, ApiResponse, BasePublisher, type BaseResolver, BaseSubscriber, type BatchAggregationResult, type BatchAnalyzerOutcome, type BatchMetadata, type BatchProcessingOutcome, type BatchWorkerContext, type BatchWorkerOutcome, type Batchable, BatchableMixin, type BootstrapConfig, type BootstrapResult, ClassLookupResolver, type CreateBatchesOutcome, type CreateTaskOptions, type CursorConfig, type DecisionCapable, DecisionHandler, DecisionMixin, type DecisionPointOutcome, DecisionType, DefaultPublisher, type DomainEvent, type DomainEventCallback, type DomainEventErrorCallback, type DomainEventMetadata, type DomainEventPollerConfig, DuplicatePublisherError, type EventDeclaration, EventPoller, EventSystem, ExecutableHandler, ExplicitMappingResolver, type FailureStrategy, FfiDomainEvent, FfiLayer, FfiLayerConfig, type HandlerDefinition, type HandlerEntry, type HandlerFactory, HandlerRegistry, type HandlerSpec, HandlerSystem, InProcessDomainEventPoller, type ListTasksOptions, type LogFields, MethodDispatchError, MethodDispatchWrapper, NapiModule, type NoBatchesOutcome, NoResolverMatchError, type PollerStats, type PublishContext, PublisherNotFoundError, PublisherRegistry, PublisherValidationError, RegistryFrozenError, RegistryResolver, type RegistryResolverStatic, ResolutionError, ResolverChain, type ResolverConfig, ResolverNotFoundError, type RustBatchWorkerInputs, type RustCursorConfig, type ServerComponents, type HealthCheckResult as ServerHealthCheckResult, type ServerState, type ServerStatus, ShutdownController, type ShutdownHandler, StepContext, type StepEventContext, StepExecutionSubscriber, StepHandler, StepHandlerClass, StepHandlerResult, type StepResult, type StopResult, type SubscriberClass, SubscriberRegistry, type SubscriberStats, TaskerClient, TaskerClientError, TaskerEventEmitter, WorkerServer, type WorkerServerConfig, type WorkerStatus, aggregateBatchResults, applyAPI, applyBatchable, applyDecision, bootstrapWorker, createBatchWorkerContext, createBatches, createDomainEvent, createFfiPollAdapter, createLogger, createStepEventContext, effectiveMethod, ffiEventToDomainEvent, fromCallable, fromDto, getRustVersion, getVersion, getWorkerStatus, hasResolverHint, healthCheck, isCreateBatches, isNoBatches, isWorkerRunning, logDebug, logError, logInfo, logTrace, logWarn, noBatches, normalizeToDefinition, stopWorker, transitionToGracefulShutdown, usesMethodDispatch };
|