@lostgradient/weft 0.12.0 → 0.14.0
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 +1 -1
- package/dist/cli/api.d.ts +2 -0
- package/dist/cli/api.js +3 -4
- package/dist/cli/generated/operation-catalog.snapshot.json +508 -12
- package/dist/cli/generated/operation-client.generated.d.ts +118 -10
- package/dist/cli/generated/operation-client.generated.js +74 -1
- package/dist/cli/help-text.d.ts +3 -3
- package/dist/cli/help-text.js +4 -4
- package/dist/cli/operation-catalog-snapshot.d.ts +12 -3
- package/dist/cli/operation-catalog-snapshot.js +14 -5
- package/dist/cli/operation-client-runtime.d.ts +29 -0
- package/dist/cli/schedule.js +1 -3
- package/dist/cli/serve-registrations.d.ts +3 -3
- package/dist/cli/serve-registrations.js +2 -2
- package/dist/cli/shutdown.d.ts +11 -0
- package/dist/cli/shutdown.js +25 -0
- package/dist/cli/validate.d.ts +1 -1
- package/dist/cli/version-check.d.ts +1 -1
- package/dist/cli/version-check.js +1 -1
- package/dist/cli-main.js +10 -29
- package/dist/client/client-storage.d.ts +24 -0
- package/dist/client/client-storage.js +14 -0
- package/dist/client/handle-delegation.d.ts +3 -3
- package/dist/client/handle-delegation.js +2 -2
- package/dist/client/http-client-requests.d.ts +5 -3
- package/dist/client/http-client-requests.js +20 -2
- package/dist/client/http-client-storage.d.ts +3 -0
- package/dist/client/http-client-storage.js +82 -0
- package/dist/client/http-client.d.ts +9 -6
- package/dist/client/http-client.js +13 -18
- package/dist/client/http-operations.d.ts +3 -1
- package/dist/client/http-operations.js +77 -1
- package/dist/client/http-request.d.ts +20 -14
- package/dist/client/http-request.js +21 -31
- package/dist/client/in-process-operations.d.ts +2 -2
- package/dist/client/in-process-operations.js +2 -2
- package/dist/client/index.d.ts +5 -1
- package/dist/client/index.js +13 -2
- package/dist/client/interface.d.ts +26 -26
- package/dist/client/local.d.ts +9 -6
- package/dist/client/local.js +9 -4
- package/dist/client/search-params.js +10 -6
- package/dist/client/start-body.d.ts +3 -1
- package/dist/client/start-body.js +9 -0
- package/dist/core/bulk-workflow-filter.d.ts +2 -1
- package/dist/core/bulk-workflow-filter.js +5 -1
- package/dist/core/context/parallel-operations.d.ts +0 -2
- package/dist/core/context/parallel-operations.js +0 -7
- package/dist/core/engine/async-activity-records.d.ts +12 -1
- package/dist/core/engine/async-activity-records.js +81 -2
- package/dist/core/engine/bulk-operations-purge.js +16 -1
- package/dist/core/engine/bulk-operations-shared.js +2 -0
- package/dist/core/engine/callback-checkpoint-persistence.d.ts +2 -0
- package/dist/core/engine/callback-checkpoint-persistence.js +6 -3
- package/dist/core/engine/callback-creators-schedule.d.ts +2 -1
- package/dist/core/engine/callback-creators-schedule.js +3 -3
- package/dist/core/engine/callback-creators.js +4 -22
- package/dist/core/engine/checkpoint-io.d.ts +1 -1
- package/dist/core/engine/checkpoint-reads.js +11 -1
- package/dist/core/engine/child-workflow.js +15 -6
- package/dist/core/engine/construction.js +3 -0
- package/dist/core/engine/disposal.js +2 -0
- package/dist/core/engine/engine-internal-types.d.ts +4 -1
- package/dist/core/engine/fenced-write.d.ts +5 -3
- package/dist/core/engine/finalizer-status.d.ts +10 -0
- package/dist/core/engine/finalizer-status.js +82 -0
- package/dist/core/engine/index.d.ts +26 -2
- package/dist/core/engine/index.js +71 -8
- package/dist/core/engine/internals.d.ts +3 -0
- package/dist/core/engine/lease-health.d.ts +64 -0
- package/dist/core/engine/lease-health.js +0 -0
- package/dist/core/engine/lease-manager.d.ts +4 -2
- package/dist/core/engine/lease-manager.js +32 -4
- package/dist/core/engine/lifecycle/recovered-services.js +0 -2
- package/dist/core/engine/lifecycle/shared.d.ts +11 -8
- package/dist/core/engine/lifecycle/start-batch.js +12 -0
- package/dist/core/engine/lifecycle/start.d.ts +1 -1
- package/dist/core/engine/lifecycle/start.js +34 -5
- package/dist/core/engine/operations-coordination.d.ts +1 -12
- package/dist/core/engine/operations-coordination.js +58 -11
- package/dist/core/engine/operations-speculate.d.ts +1 -1
- package/dist/core/engine/operations-speculate.js +19 -5
- package/dist/core/engine/parallel-dispatch.d.ts +1 -1
- package/dist/core/engine/parallel-dispatch.js +1 -1
- package/dist/core/engine/registration.js +14 -0
- package/dist/core/engine/review-list-entries.d.ts +1 -1
- package/dist/core/engine/review-list-entries.js +6 -30
- package/dist/core/engine/schedule-handle.d.ts +4 -4
- package/dist/core/engine/schedule-handle.js +2 -2
- package/dist/core/engine/schedule-overlap.d.ts +11 -0
- package/dist/core/engine/schedule-overlap.js +50 -0
- package/dist/core/engine/schedule-run.d.ts +11 -3
- package/dist/core/engine/schedule-run.js +27 -4
- package/dist/core/engine/schedule-timer.js +10 -1
- package/dist/core/engine/schedules.d.ts +5 -4
- package/dist/core/engine/schedules.js +62 -56
- package/dist/core/engine/state-utilities.js +1 -1
- package/dist/core/engine/storage-io.d.ts +12 -0
- package/dist/core/engine/storage-io.js +49 -10
- package/dist/core/engine/termination/finalizer-claim.d.ts +8 -6
- package/dist/core/engine/termination/finalizer-claim.js +2 -1
- package/dist/core/engine/termination/finalizer.js +10 -14
- package/dist/core/engine/timeline-coordinator-constants.d.ts +3 -0
- package/dist/core/engine/timeline-coordinator-constants.js +1 -0
- package/dist/core/engine/timeline-coordinator-detail.d.ts +13 -0
- package/dist/core/engine/timeline-coordinator-detail.js +76 -0
- package/dist/core/engine/validation/schedule-options.d.ts +8 -1
- package/dist/core/engine/validation/schedule-options.js +18 -0
- package/dist/core/engine/validation/schedule.d.ts +1 -1
- package/dist/core/engine/validation/schedule.js +27 -3
- package/dist/core/engine/validation.js +66 -2
- package/dist/core/engine/workflow-state-stream.d.ts +5 -1
- package/dist/core/engine/workflow-state-stream.js +37 -14
- package/dist/core/events/schedule-events.d.ts +3 -4
- package/dist/core/events/workflow-events.d.ts +2 -1
- package/dist/core/list-filter-validation.d.ts +3 -0
- package/dist/core/list-filter-validation.js +11 -0
- package/dist/core/registry-snapshot.d.ts +32 -0
- package/dist/core/registry-snapshot.js +28 -0
- package/dist/core/review/index.d.ts +91 -4
- package/dist/core/review/index.js +29 -0
- package/dist/core/types/activity.d.ts +52 -5
- package/dist/core/types/bulk.d.ts +1 -0
- package/dist/core/types/list-options.d.ts +6 -0
- package/dist/core/types/options.d.ts +6 -5
- package/dist/core/types/reviews.d.ts +2 -2
- package/dist/core/types/schedules.d.ts +45 -2
- package/dist/core/types/services-resolution.d.ts +5 -5
- package/dist/core/types/state.d.ts +64 -0
- package/dist/core/types/workflow-log.d.ts +3 -2
- package/dist/core/types/workflow-observability.d.ts +50 -0
- package/dist/core/types/workflow-observability.js +0 -0
- package/dist/core/types/workflow-registry.d.ts +7 -0
- package/dist/core/types.d.ts +1 -0
- package/dist/core/types.js +1 -0
- package/dist/diagnostics/validate.d.ts +9 -30
- package/dist/diagnostics/validate.js +83 -21
- package/dist/diagnostics/version-check.d.ts +2 -2
- package/dist/http.js +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/indexeddb.js +1 -1
- package/dist/server/access-policy-metadata.d.ts +92 -0
- package/dist/server/access-policy-metadata.js +78 -0
- package/dist/server/fault-to-http.d.ts +3 -7
- package/dist/server/fault-to-http.js +2 -34
- package/dist/server/handler/index.js +1 -1
- package/dist/server/handler/route-dispatch.d.ts +10 -3
- package/dist/server/handler/route-dispatch.js +19 -4
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/interactive-operations.js +2 -0
- package/dist/server/openapi-error-responses.js +41 -4
- package/dist/server/openapi.d.ts +3 -1
- package/dist/server/openapi.js +4 -0
- package/dist/server/openrpc-document-schema.d.ts +64 -0
- package/dist/server/openrpc-document-schema.js +6 -26
- package/dist/server/openrpc.d.ts +4 -0
- package/dist/server/openrpc.js +9 -33
- package/dist/server/operation-catalog/index.d.ts +1 -1
- package/dist/server/operation-catalog/raise-fault.d.ts +2 -1
- package/dist/server/operation-catalog/types.d.ts +2 -1
- package/dist/server/operation-fault.d.ts +22 -8
- package/dist/server/operation-fault.js +65 -13
- package/dist/server/operation-registry.d.ts +1 -1
- package/dist/server/operations/aggregate-workflows.d.ts +6 -0
- package/dist/server/operations/aggregate-workflows.js +3 -2
- package/dist/server/operations/async-activity.d.ts +14 -0
- package/dist/server/operations/async-activity.js +88 -4
- package/dist/server/operations/bulk-filter-helpers.d.ts +3 -0
- package/dist/server/operations/bulk-filter-helpers.js +27 -3
- package/dist/server/operations/bulk-mutate-workflow-tags.d.ts +6 -0
- package/dist/server/operations/bulk-signal-workflows.d.ts +6 -0
- package/dist/server/operations/get-stream-chunks.js +2 -7
- package/dist/server/operations/get-system-lease.d.ts +19 -0
- package/dist/server/operations/get-system-lease.js +48 -0
- package/dist/server/operations/get-workflow-observability.d.ts +24 -0
- package/dist/server/operations/get-workflow-observability.js +80 -0
- package/dist/server/operations/get-workflow-result.js +2 -2
- package/dist/server/operations/get-workflow.d.ts +2 -2
- package/dist/server/operations/list-filter-query-extractor.js +15 -0
- package/dist/server/operations/list-reviews.js +2 -19
- package/dist/server/operations/list-workflows.d.ts +6 -0
- package/dist/server/operations/list-workflows.js +12 -3
- package/dist/server/operations/operation-helpers.d.ts +9 -18
- package/dist/server/operations/operation-helpers.js +5 -23
- package/dist/server/operations/purge-workflows.d.ts +3 -0
- package/dist/server/operations/recover-all.js +1 -9
- package/dist/server/operations/single-workflow-control-operation.d.ts +2 -1
- package/dist/server/operations/single-workflow-tag-mutation.js +2 -2
- package/dist/server/operations/sse-stream.js +2 -7
- package/dist/server/operations/storage-capabilities.d.ts +34 -0
- package/dist/server/operations/storage-capabilities.js +38 -0
- package/dist/server/operations/storage.js +8 -17
- package/dist/server/operations/stream-workflow-sse.js +3 -9
- package/dist/server/operations/update-schedule.d.ts +8 -0
- package/dist/server/operations/update-schedule.js +70 -7
- package/dist/server/operations/workflow-events-sse.js +2 -2
- package/dist/server/rest-binding.d.ts +7 -6
- package/dist/server/rest-bindings.d.ts +2 -13
- package/dist/server/rest-bindings.js +19 -10
- package/dist/server/task-queue.d.ts +7 -5
- package/dist/storage/bounded-ndjson-response.d.ts +5 -0
- package/dist/storage/bounded-ndjson-response.js +33 -0
- package/dist/storage/capabilities.d.ts +1 -1
- package/dist/storage/cloudflare-value-codec.d.ts +5 -3
- package/dist/storage/cloudflare-value-codec.js +1 -1
- package/dist/storage/compressed-storage.js +1 -1
- package/dist/storage/http.js +5 -37
- package/dist/storage/index.d.ts +7 -1
- package/dist/storage/interface.d.ts +16 -4
- package/dist/storage/interface.js +1 -1
- package/dist/storage/key-prefixes.d.ts +1 -1
- package/dist/storage/key-prefixes.js +4 -0
- package/dist/storage/lmdb.js +1 -1
- package/dist/storage/memory.js +1 -1
- package/dist/storage/neon.d.ts +3 -16
- package/dist/storage/neon.js +4 -4
- package/dist/storage/postgres.js +4 -4
- package/dist/storage/resolve.js +1 -1
- package/dist/storage/scoped-storage.js +1 -1
- package/dist/storage/testing.js +1 -1
- package/dist/storage/turso.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/web-extension.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { type CatalogWeftClient, type WeftClientConnection } from '../operation-client-runtime.ts';
|
|
2
|
-
export declare const CATALOG_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.recover.all", "weft.retention.get", "weft.reviews.decision.submit", "weft.reviews.get", "weft.reviews.list", "weft.schedules.cancel", "weft.schedules.create", "weft.schedules.get", "weft.schedules.list", "weft.schedules.pause", "weft.schedules.resume", "weft.schedules.update", "weft.system.metrics", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.drain", "weft.workers.list", "weft.workers.resume", "weft.workflows.aggregate", "weft.workflows.attributes.get", "weft.workflows.attributes.set", "weft.workflows.bulk.cancel", "weft.workflows.bulk.delete", "weft.workflows.bulk.retryfailed", "weft.workflows.bulk.signal", "weft.workflows.bulk.tags", "weft.workflows.cancel", "weft.workflows.checkpoints.get", "weft.workflows.checkpoints.list", "weft.workflows.events.list", "weft.workflows.fork", "weft.workflows.get", "weft.workflows.list", "weft.workflows.purge", "weft.workflows.query", "weft.workflows.replay", "weft.workflows.result.get", "weft.workflows.resume", "weft.workflows.signal", "weft.workflows.start", "weft.workflows.startorsignal", "weft.workflows.streams.chunks", "weft.workflows.suspend", "weft.workflows.tags.add", "weft.workflows.tags.remove", "weft.workflows.timeline.get", "weft.workflows.timeout", "weft.workflows.update"];
|
|
2
|
+
export declare const CATALOG_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.recover.all", "weft.retention.get", "weft.reviews.decision.submit", "weft.reviews.get", "weft.reviews.list", "weft.schedules.cancel", "weft.schedules.create", "weft.schedules.get", "weft.schedules.list", "weft.schedules.pause", "weft.schedules.resume", "weft.schedules.update", "weft.storage.capabilities", "weft.system.lease", "weft.system.metrics", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.drain", "weft.workers.list", "weft.workers.resume", "weft.workflows.activities.pending.list", "weft.workflows.aggregate", "weft.workflows.attributes.get", "weft.workflows.attributes.set", "weft.workflows.bulk.cancel", "weft.workflows.bulk.delete", "weft.workflows.bulk.retryfailed", "weft.workflows.bulk.signal", "weft.workflows.bulk.tags", "weft.workflows.cancel", "weft.workflows.checkpoints.get", "weft.workflows.checkpoints.list", "weft.workflows.events.list", "weft.workflows.finalizer.get", "weft.workflows.fork", "weft.workflows.get", "weft.workflows.list", "weft.workflows.purge", "weft.workflows.query", "weft.workflows.replay", "weft.workflows.result.get", "weft.workflows.resume", "weft.workflows.scheduleprovenance.get", "weft.workflows.signal", "weft.workflows.start", "weft.workflows.startorsignal", "weft.workflows.streams.chunks", "weft.workflows.suspend", "weft.workflows.tags.add", "weft.workflows.tags.remove", "weft.workflows.timeline.get", "weft.workflows.timeout", "weft.workflows.update"];
|
|
3
3
|
export type CatalogOperationName = (typeof CATALOG_OPERATION_NAMES)[number];
|
|
4
|
-
|
|
4
|
+
export declare const CLIENT_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.recover.all", "weft.retention.get", "weft.reviews.decision.submit", "weft.reviews.get", "weft.reviews.list", "weft.schedules.cancel", "weft.schedules.create", "weft.schedules.get", "weft.schedules.list", "weft.schedules.pause", "weft.schedules.resume", "weft.schedules.update", "weft.storage.capabilities", "weft.system.lease", "weft.system.metrics", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.tasks.diagnostics.deadletters.clear", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.drain", "weft.workers.list", "weft.workers.resume", "weft.workflows.activities.pending.list", "weft.workflows.aggregate", "weft.workflows.attributes.get", "weft.workflows.attributes.set", "weft.workflows.bulk.cancel", "weft.workflows.bulk.delete", "weft.workflows.bulk.retryfailed", "weft.workflows.bulk.signal", "weft.workflows.bulk.tags", "weft.workflows.cancel", "weft.workflows.checkpoints.get", "weft.workflows.checkpoints.list", "weft.workflows.events.list", "weft.workflows.finalizer.get", "weft.workflows.fork", "weft.workflows.get", "weft.workflows.list", "weft.workflows.purge", "weft.workflows.query", "weft.workflows.replay", "weft.workflows.result.get", "weft.workflows.resume", "weft.workflows.scheduleprovenance.get", "weft.workflows.signal", "weft.workflows.start", "weft.workflows.startorsignal", "weft.workflows.streams.chunks", "weft.workflows.suspend", "weft.workflows.tags.add", "weft.workflows.tags.remove", "weft.workflows.timeline.get", "weft.workflows.timeout", "weft.workflows.update"];
|
|
5
|
+
export type ClientOperationName = (typeof CLIENT_OPERATION_NAMES)[number];
|
|
6
|
+
export declare const CLIENT_REST_OPERATION_BINDINGS: {
|
|
7
|
+
readonly 'weft.tasks.diagnostics.deadletters.clear': {
|
|
8
|
+
readonly method: "DELETE";
|
|
9
|
+
readonly path: "/tasks/diagnostics/dead-letter/:operationId";
|
|
10
|
+
readonly inputSources: {
|
|
11
|
+
readonly operationId: {
|
|
12
|
+
readonly kind: "path";
|
|
13
|
+
readonly pathParam: "operationId";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly success: {
|
|
17
|
+
readonly kind: "json";
|
|
18
|
+
readonly status: 200;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type SharedAttributesBulkConcurrenc_f62debcf = {
|
|
5
23
|
readonly attributes?: ReadonlyArray<SharedGtGteKey_896a0c41>;
|
|
6
24
|
readonly bulkConcurrency?: number;
|
|
7
25
|
readonly confirmationToken?: string;
|
|
@@ -12,13 +30,16 @@ type SharedAttributesBulkConcurrenc_73ecbca6 = {
|
|
|
12
30
|
readonly idPrefix?: string;
|
|
13
31
|
readonly limit?: number;
|
|
14
32
|
readonly offset?: number;
|
|
33
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
34
|
+
readonly parentWorkflowId?: string;
|
|
15
35
|
readonly requestId?: string;
|
|
36
|
+
readonly scheduleId?: string;
|
|
16
37
|
readonly status?: unknown;
|
|
17
38
|
readonly tags?: ReadonlyArray<string>;
|
|
18
39
|
readonly type?: string;
|
|
19
40
|
readonly updatedAt?: SharedGtGteLt_d9a61361;
|
|
20
41
|
};
|
|
21
|
-
type
|
|
42
|
+
type SharedAttributesCreatedAtExecu_2af7f9ff = {
|
|
22
43
|
readonly attributes?: ReadonlyArray<SharedGtGteKey_896a0c41>;
|
|
23
44
|
readonly createdAt?: SharedGtGteLt_d9a61361;
|
|
24
45
|
readonly executionDeadline?: SharedGtGteLt_d9a61361;
|
|
@@ -26,6 +47,9 @@ type SharedAttributesCreatedAtExecu_c9ba5dc6 = {
|
|
|
26
47
|
readonly idPrefix?: string;
|
|
27
48
|
readonly limit?: number;
|
|
28
49
|
readonly offset?: number;
|
|
50
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
51
|
+
readonly parentWorkflowId?: string;
|
|
52
|
+
readonly scheduleId?: string;
|
|
29
53
|
readonly status?: unknown;
|
|
30
54
|
readonly tags?: ReadonlyArray<string>;
|
|
31
55
|
readonly type?: string;
|
|
@@ -45,7 +69,7 @@ type SharedGtGteLt_d9a61361 = {
|
|
|
45
69
|
readonly lt?: number;
|
|
46
70
|
readonly lte?: number;
|
|
47
71
|
};
|
|
48
|
-
export type
|
|
72
|
+
export type ClientOperationTypes = {
|
|
49
73
|
'weft.activities.complete': {
|
|
50
74
|
readonly input: {
|
|
51
75
|
readonly result?: unknown;
|
|
@@ -171,12 +195,43 @@ export type CatalogOperationTypes = {
|
|
|
171
195
|
};
|
|
172
196
|
'weft.schedules.update': {
|
|
173
197
|
readonly input: {
|
|
198
|
+
readonly backfill?: unknown;
|
|
174
199
|
readonly cronExpression?: unknown;
|
|
200
|
+
readonly description?: unknown;
|
|
175
201
|
readonly every?: unknown;
|
|
202
|
+
readonly jitter?: unknown;
|
|
203
|
+
readonly overlap?: unknown;
|
|
176
204
|
readonly scheduleId: string;
|
|
177
205
|
};
|
|
178
206
|
readonly output: null;
|
|
179
|
-
readonly faults: 'Conflict' | 'NotFound';
|
|
207
|
+
readonly faults: 'Conflict' | 'InvalidParams' | 'NotFound';
|
|
208
|
+
};
|
|
209
|
+
'weft.storage.capabilities': {
|
|
210
|
+
readonly input: {};
|
|
211
|
+
readonly output: {
|
|
212
|
+
readonly atomicBatch: boolean;
|
|
213
|
+
readonly boundedRangeDelete: boolean;
|
|
214
|
+
readonly conditionalBatch: boolean;
|
|
215
|
+
readonly persistence: 'ephemeral' | 'local' | 'remote';
|
|
216
|
+
readonly readAfterWrite: 'linearizable' | 'session' | 'eventual';
|
|
217
|
+
readonly scanConsistency: 'snapshot' | 'best-effort';
|
|
218
|
+
};
|
|
219
|
+
readonly faults: never;
|
|
220
|
+
};
|
|
221
|
+
'weft.system.lease': {
|
|
222
|
+
readonly input: {};
|
|
223
|
+
readonly output: {
|
|
224
|
+
readonly expiresAt?: number;
|
|
225
|
+
readonly fencingEpoch?: number;
|
|
226
|
+
readonly heldSince?: number;
|
|
227
|
+
readonly holderId?: string;
|
|
228
|
+
readonly holdsLease: boolean;
|
|
229
|
+
readonly lastRenewedAt?: number;
|
|
230
|
+
readonly lossReason?: 'deposed' | 'renewal-unconfirmable';
|
|
231
|
+
readonly mode: 'none' | 'lease';
|
|
232
|
+
readonly status: 'disabled' | 'healthy' | 'no-lease' | 'contested';
|
|
233
|
+
};
|
|
234
|
+
readonly faults: never;
|
|
180
235
|
};
|
|
181
236
|
'weft.system.metrics': {
|
|
182
237
|
readonly input: {};
|
|
@@ -251,6 +306,15 @@ export type CatalogOperationTypes = {
|
|
|
251
306
|
};
|
|
252
307
|
readonly faults: never;
|
|
253
308
|
};
|
|
309
|
+
'weft.tasks.diagnostics.deadletters.clear': {
|
|
310
|
+
readonly input: {
|
|
311
|
+
readonly operationId: string;
|
|
312
|
+
};
|
|
313
|
+
readonly output: {
|
|
314
|
+
readonly ok: boolean;
|
|
315
|
+
};
|
|
316
|
+
readonly faults: never;
|
|
317
|
+
};
|
|
254
318
|
'weft.updates.result.get': {
|
|
255
319
|
readonly input: {
|
|
256
320
|
readonly updateId: string;
|
|
@@ -326,6 +390,25 @@ export type CatalogOperationTypes = {
|
|
|
326
390
|
readonly output: unknown;
|
|
327
391
|
readonly faults: 'NotFound';
|
|
328
392
|
};
|
|
393
|
+
'weft.workflows.activities.pending.list': {
|
|
394
|
+
readonly input: {
|
|
395
|
+
readonly cursor?: string;
|
|
396
|
+
readonly limit: number;
|
|
397
|
+
readonly workflowId: string;
|
|
398
|
+
};
|
|
399
|
+
readonly output: {
|
|
400
|
+
readonly items: ReadonlyArray<{
|
|
401
|
+
readonly activityName: string;
|
|
402
|
+
readonly attempt: number;
|
|
403
|
+
readonly createdAt: number;
|
|
404
|
+
readonly operationId: string;
|
|
405
|
+
readonly step: number;
|
|
406
|
+
readonly token: string;
|
|
407
|
+
}>;
|
|
408
|
+
readonly nextCursor?: string;
|
|
409
|
+
};
|
|
410
|
+
readonly faults: 'InvalidParams' | 'NotFound';
|
|
411
|
+
};
|
|
329
412
|
'weft.workflows.aggregate': {
|
|
330
413
|
readonly input: {
|
|
331
414
|
readonly attributes?: ReadonlyArray<{
|
|
@@ -342,6 +425,9 @@ export type CatalogOperationTypes = {
|
|
|
342
425
|
readonly groupBy: unknown;
|
|
343
426
|
readonly idPrefix?: string;
|
|
344
427
|
readonly limit?: number;
|
|
428
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
429
|
+
readonly parentWorkflowId?: string;
|
|
430
|
+
readonly scheduleId?: string;
|
|
345
431
|
readonly status?: unknown;
|
|
346
432
|
readonly tags?: ReadonlyArray<string>;
|
|
347
433
|
readonly type?: string;
|
|
@@ -375,17 +461,17 @@ export type CatalogOperationTypes = {
|
|
|
375
461
|
readonly faults: never;
|
|
376
462
|
};
|
|
377
463
|
'weft.workflows.bulk.cancel': {
|
|
378
|
-
readonly input:
|
|
464
|
+
readonly input: SharedAttributesBulkConcurrenc_f62debcf;
|
|
379
465
|
readonly output: unknown;
|
|
380
466
|
readonly faults: never;
|
|
381
467
|
};
|
|
382
468
|
'weft.workflows.bulk.delete': {
|
|
383
|
-
readonly input:
|
|
469
|
+
readonly input: SharedAttributesBulkConcurrenc_f62debcf;
|
|
384
470
|
readonly output: unknown;
|
|
385
471
|
readonly faults: 'Unprocessable';
|
|
386
472
|
};
|
|
387
473
|
'weft.workflows.bulk.retryfailed': {
|
|
388
|
-
readonly input:
|
|
474
|
+
readonly input: SharedAttributesBulkConcurrenc_f62debcf;
|
|
389
475
|
readonly output: unknown;
|
|
390
476
|
readonly faults: never;
|
|
391
477
|
};
|
|
@@ -402,8 +488,11 @@ export type CatalogOperationTypes = {
|
|
|
402
488
|
readonly limit?: number;
|
|
403
489
|
readonly name: string;
|
|
404
490
|
readonly offset?: number;
|
|
491
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
492
|
+
readonly parentWorkflowId?: string;
|
|
405
493
|
readonly payload?: unknown;
|
|
406
494
|
readonly requestId?: string;
|
|
495
|
+
readonly scheduleId?: string;
|
|
407
496
|
readonly status?: unknown;
|
|
408
497
|
readonly tags?: ReadonlyArray<string>;
|
|
409
498
|
readonly type?: string;
|
|
@@ -417,7 +506,7 @@ export type CatalogOperationTypes = {
|
|
|
417
506
|
readonly bulkConcurrency?: number;
|
|
418
507
|
readonly confirmationToken?: string;
|
|
419
508
|
readonly dryRun?: boolean;
|
|
420
|
-
readonly filter?:
|
|
509
|
+
readonly filter?: SharedAttributesCreatedAtExecu_2af7f9ff;
|
|
421
510
|
readonly operation: 'add' | 'remove';
|
|
422
511
|
readonly requestId?: string;
|
|
423
512
|
readonly tags: ReadonlyArray<string>;
|
|
@@ -454,6 +543,13 @@ export type CatalogOperationTypes = {
|
|
|
454
543
|
readonly output: unknown;
|
|
455
544
|
readonly faults: 'NotFound';
|
|
456
545
|
};
|
|
546
|
+
'weft.workflows.finalizer.get': {
|
|
547
|
+
readonly input: {
|
|
548
|
+
readonly workflowId: string;
|
|
549
|
+
};
|
|
550
|
+
readonly output: unknown;
|
|
551
|
+
readonly faults: never;
|
|
552
|
+
};
|
|
457
553
|
'weft.workflows.fork': {
|
|
458
554
|
readonly input: {
|
|
459
555
|
readonly fromStep?: unknown;
|
|
@@ -481,6 +577,9 @@ export type CatalogOperationTypes = {
|
|
|
481
577
|
readonly include?: unknown;
|
|
482
578
|
readonly limit?: number;
|
|
483
579
|
readonly offset?: number;
|
|
580
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
581
|
+
readonly parentWorkflowId?: string;
|
|
582
|
+
readonly scheduleId?: string;
|
|
484
583
|
readonly status?: unknown;
|
|
485
584
|
readonly tags?: ReadonlyArray<string>;
|
|
486
585
|
readonly type?: string;
|
|
@@ -490,7 +589,7 @@ export type CatalogOperationTypes = {
|
|
|
490
589
|
readonly faults: 'Unprocessable';
|
|
491
590
|
};
|
|
492
591
|
'weft.workflows.purge': {
|
|
493
|
-
readonly input:
|
|
592
|
+
readonly input: SharedAttributesCreatedAtExecu_2af7f9ff;
|
|
494
593
|
readonly output: unknown;
|
|
495
594
|
readonly faults: never;
|
|
496
595
|
};
|
|
@@ -527,6 +626,13 @@ export type CatalogOperationTypes = {
|
|
|
527
626
|
};
|
|
528
627
|
readonly faults: 'Conflict' | 'NotFound';
|
|
529
628
|
};
|
|
629
|
+
'weft.workflows.scheduleprovenance.get': {
|
|
630
|
+
readonly input: {
|
|
631
|
+
readonly workflowId: string;
|
|
632
|
+
};
|
|
633
|
+
readonly output: unknown;
|
|
634
|
+
readonly faults: never;
|
|
635
|
+
};
|
|
530
636
|
'weft.workflows.signal': {
|
|
531
637
|
readonly input: {
|
|
532
638
|
readonly payload?: unknown;
|
|
@@ -645,6 +751,8 @@ export type CatalogOperationTypes = {
|
|
|
645
751
|
readonly faults: 'Timeout' | 'Unprocessable';
|
|
646
752
|
};
|
|
647
753
|
};
|
|
754
|
+
export type CatalogOperationTypes = Pick<ClientOperationTypes, CatalogOperationName>;
|
|
648
755
|
export type WeftClient = CatalogWeftClient<CatalogOperationTypes>;
|
|
756
|
+
export type ClientOperations = CatalogWeftClient<ClientOperationTypes>;
|
|
649
757
|
export declare function createWeftClient(connection?: WeftClientConnection): WeftClient;
|
|
650
758
|
export {};
|
|
@@ -17,6 +17,8 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
17
17
|
"weft.schedules.pause",
|
|
18
18
|
"weft.schedules.resume",
|
|
19
19
|
"weft.schedules.update",
|
|
20
|
+
"weft.storage.capabilities",
|
|
21
|
+
"weft.system.lease",
|
|
20
22
|
"weft.system.metrics",
|
|
21
23
|
"weft.system.registry",
|
|
22
24
|
"weft.task.queues.list",
|
|
@@ -27,6 +29,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
27
29
|
"weft.workers.drain",
|
|
28
30
|
"weft.workers.list",
|
|
29
31
|
"weft.workers.resume",
|
|
32
|
+
"weft.workflows.activities.pending.list",
|
|
30
33
|
"weft.workflows.aggregate",
|
|
31
34
|
"weft.workflows.attributes.get",
|
|
32
35
|
"weft.workflows.attributes.set",
|
|
@@ -39,6 +42,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
39
42
|
"weft.workflows.checkpoints.get",
|
|
40
43
|
"weft.workflows.checkpoints.list",
|
|
41
44
|
"weft.workflows.events.list",
|
|
45
|
+
"weft.workflows.finalizer.get",
|
|
42
46
|
"weft.workflows.fork",
|
|
43
47
|
"weft.workflows.get",
|
|
44
48
|
"weft.workflows.list",
|
|
@@ -47,6 +51,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
47
51
|
"weft.workflows.replay",
|
|
48
52
|
"weft.workflows.result.get",
|
|
49
53
|
"weft.workflows.resume",
|
|
54
|
+
"weft.workflows.scheduleprovenance.get",
|
|
50
55
|
"weft.workflows.signal",
|
|
51
56
|
"weft.workflows.start",
|
|
52
57
|
"weft.workflows.startorsignal",
|
|
@@ -57,7 +62,75 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
57
62
|
"weft.workflows.timeline.get",
|
|
58
63
|
"weft.workflows.timeout",
|
|
59
64
|
"weft.workflows.update"
|
|
60
|
-
]
|
|
65
|
+
], CLIENT_OPERATION_NAMES = [
|
|
66
|
+
"weft.activities.complete",
|
|
67
|
+
"weft.activities.fail",
|
|
68
|
+
"weft.recover.all",
|
|
69
|
+
"weft.retention.get",
|
|
70
|
+
"weft.reviews.decision.submit",
|
|
71
|
+
"weft.reviews.get",
|
|
72
|
+
"weft.reviews.list",
|
|
73
|
+
"weft.schedules.cancel",
|
|
74
|
+
"weft.schedules.create",
|
|
75
|
+
"weft.schedules.get",
|
|
76
|
+
"weft.schedules.list",
|
|
77
|
+
"weft.schedules.pause",
|
|
78
|
+
"weft.schedules.resume",
|
|
79
|
+
"weft.schedules.update",
|
|
80
|
+
"weft.storage.capabilities",
|
|
81
|
+
"weft.system.lease",
|
|
82
|
+
"weft.system.metrics",
|
|
83
|
+
"weft.system.registry",
|
|
84
|
+
"weft.task.queues.list",
|
|
85
|
+
"weft.tasks.diagnostics",
|
|
86
|
+
"weft.tasks.diagnostics.deadletters.clear",
|
|
87
|
+
"weft.updates.result.get",
|
|
88
|
+
"weft.worker.deployments.drain",
|
|
89
|
+
"weft.worker.deployments.resume",
|
|
90
|
+
"weft.workers.drain",
|
|
91
|
+
"weft.workers.list",
|
|
92
|
+
"weft.workers.resume",
|
|
93
|
+
"weft.workflows.activities.pending.list",
|
|
94
|
+
"weft.workflows.aggregate",
|
|
95
|
+
"weft.workflows.attributes.get",
|
|
96
|
+
"weft.workflows.attributes.set",
|
|
97
|
+
"weft.workflows.bulk.cancel",
|
|
98
|
+
"weft.workflows.bulk.delete",
|
|
99
|
+
"weft.workflows.bulk.retryfailed",
|
|
100
|
+
"weft.workflows.bulk.signal",
|
|
101
|
+
"weft.workflows.bulk.tags",
|
|
102
|
+
"weft.workflows.cancel",
|
|
103
|
+
"weft.workflows.checkpoints.get",
|
|
104
|
+
"weft.workflows.checkpoints.list",
|
|
105
|
+
"weft.workflows.events.list",
|
|
106
|
+
"weft.workflows.finalizer.get",
|
|
107
|
+
"weft.workflows.fork",
|
|
108
|
+
"weft.workflows.get",
|
|
109
|
+
"weft.workflows.list",
|
|
110
|
+
"weft.workflows.purge",
|
|
111
|
+
"weft.workflows.query",
|
|
112
|
+
"weft.workflows.replay",
|
|
113
|
+
"weft.workflows.result.get",
|
|
114
|
+
"weft.workflows.resume",
|
|
115
|
+
"weft.workflows.scheduleprovenance.get",
|
|
116
|
+
"weft.workflows.signal",
|
|
117
|
+
"weft.workflows.start",
|
|
118
|
+
"weft.workflows.startorsignal",
|
|
119
|
+
"weft.workflows.streams.chunks",
|
|
120
|
+
"weft.workflows.suspend",
|
|
121
|
+
"weft.workflows.tags.add",
|
|
122
|
+
"weft.workflows.tags.remove",
|
|
123
|
+
"weft.workflows.timeline.get",
|
|
124
|
+
"weft.workflows.timeout",
|
|
125
|
+
"weft.workflows.update"
|
|
126
|
+
], CLIENT_REST_OPERATION_BINDINGS = {
|
|
127
|
+
"weft.tasks.diagnostics.deadletters.clear": {
|
|
128
|
+
method: "DELETE",
|
|
129
|
+
path: "/tasks/diagnostics/dead-letter/:operationId",
|
|
130
|
+
inputSources: { operationId: { kind: "path", pathParam: "operationId" } },
|
|
131
|
+
success: { kind: "json", status: 200 }
|
|
132
|
+
}
|
|
133
|
+
};
|
|
61
134
|
export function createWeftClient(connection = {}) {
|
|
62
135
|
return createCatalogWeftClient(CATALOG_OPERATION_NAMES, httpJsonRpcTransport(connection));
|
|
63
136
|
}
|
package/dist/cli/help-text.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare const HELP_TEXT = "\nweft - Bun-native durable execution engine\n\nUsage: weft [command] [options]\n\nCommands:\n serve Start the Weft server (default)\n doctor Run diagnostics on the Weft database\n conformance Run RemoteWorker protocol conformance checks\n schedule Manage recurring schedules\n timeline Inspect workflow timeline and replay history\n version:check Check workflow version compatibility\n validate Lint workflow
|
|
1
|
+
export declare const HELP_TEXT = "\nweft - Bun-native durable execution engine\n\nUsage: weft [command] [options]\n\nCommands:\n serve Start the Weft server (default)\n doctor Run diagnostics on the Weft database\n conformance Run RemoteWorker protocol conformance checks\n schedule Manage recurring schedules\n timeline Inspect workflow timeline and replay history\n version:check Check workflow version compatibility\n validate Lint workflow definitions for design-time anti-patterns\n codegen Generate TypeScript declarations from a registry snapshot\n api Inspect and invoke catalog operations on a running server\n server Inspect a running server's health and operation surface\n workflow List, inspect, start, signal, and cancel workflows on a server\n tail Stream a workflow's events as Server-Sent Events\n completions Generate or install shell completion scripts\n version Print the installed Weft version\n\nVersion (leading token only; a subcommand owns its own option line):\n weft version | weft --version | weft -v Print the installed Weft version\n\nServe Options:\n -p, --port <port> Server port (default: 7233)\n -d, --database <path> Database file path (default: ./weft.db)\n -s, --storage <backend> Storage backend: sqlite, lmdb, memory (default: sqlite)\n -w, --workflows <path> Path to workflow module to register on startup\n -h, --help Show this help message\n";
|
|
2
2
|
export declare const API_HELP_TEXT = "\nweft api - Inspect and invoke catalog operations on a running server\n\nUsage:\n weft api --list [options]\n weft api --describe <operation-name> [options]\n weft api <operation-name> [--input <json> | --input-file <path|->] [options]\n\nOptions:\n --server <url> Server URL (default: WEFT_ADDR, profile, run lockfile, or localhost)\n --token <token> Bearer token (default: WEFT_TOKEN)\n --profile <name> Profile from ~/.weft/config (default: WEFT_PROFILE or default_profile)\n --input <json> JSON object input for the operation\n --input-file <path> Read JSON object input from a file, or '-' for stdin\n --list List catalog operations\n --describe <name> Print one operation's schema and metadata\n --yes Confirm destructive operations without prompting\n -j, --json Emit machine-readable JSON output\n -h, --help Show this help message\n\nExit codes:\n 0 Success\n 1 Operation failed or destructive operation was not confirmed\n 2 Connection error\n 3 Usage or input validation error\n";
|
|
3
3
|
export declare const CONFORMANCE_HELP_TEXT = "\nweft conformance - Run RemoteWorker protocol conformance checks\n\nUsage: weft conformance [options] -- <worker-command> [args...]\n\nThe worker command receives:\n WEFT_WORKER_URL\n WEFT_WORKER_QUEUE\n WEFT_WORKER_ACTIVITIES\n WEFT_WORKER_PROTOCOL_VERSION\n\nOptions:\n --timeout <ms> Per-check timeout in milliseconds (default: 15000)\n -j, --json Output results as JSON\n -h, --help Show this help message\n";
|
|
4
4
|
export declare const DOCTOR_HELP_TEXT = "\nweft doctor - Run diagnostics on the Weft database\n\nUsage: weft doctor [options]\n\nOptions:\n -d, --database <path> Database file path (default: ./weft.db)\n -j, --json Output results as JSON\n -h, --help Show this help message\n";
|
|
5
5
|
export declare const VERSION_CHECK_HELP_TEXT = "\nweft version:check - Check workflow version compatibility\n\nUsage: weft version:check [options]\n\nOptions:\n -d, --database <path> Database file path (default: ./weft.db)\n -w, --workflows <path> Path to workflows module\n -j, --json Output results as JSON\n -h, --help Show this help message\n";
|
|
6
6
|
export declare const TIMELINE_HELP_TEXT = "\nweft timeline - Inspect workflow timeline and replay history\n\nUsage:\n weft timeline <workflowId> [options]\n weft timeline <workflowId> --diff <fromStep> <toStep> [options]\n\nOptions:\n -d, --database <path> Database file path (default: ./weft.db)\n --step <step> Show replay details for one checkpoint step\n --diff Diff two checkpoint steps (requires two positional step numbers)\n -h, --help Show this help message\n";
|
|
7
|
-
export declare const SCHEDULE_HELP_TEXT = "\nweft schedule - Manage recurring schedules\n\nUsage:\n weft schedule list [options]\n weft schedule create <workflowType> <cronExpression> [options]\n weft schedule create <workflowType> --every <duration> [options]\n weft schedule pause <scheduleId> [options]\n weft schedule resume <scheduleId> [options]\n weft schedule cancel <scheduleId> [options]\n\nProvide a cron expression positional OR an --every interval (e.g. \"30s\", \"1h\"),\nbut not both. Interval schedules fire one period after creation, then every\nperiod after that.\n\nOptions:\n -d, --database <path> Database file path (default: ./weft.db)\n -s, --storage <backend> Storage backend: sqlite, lmdb (default: sqlite)\n -w, --workflows <path> Path to workflow
|
|
8
|
-
export declare const VALIDATE_HELP_TEXT = "\nweft validate - Lint workflow
|
|
7
|
+
export declare const SCHEDULE_HELP_TEXT = "\nweft schedule - Manage recurring schedules\n\nUsage:\n weft schedule list [options]\n weft schedule create <workflowType> <cronExpression> [options]\n weft schedule create <workflowType> --every <duration> [options]\n weft schedule pause <scheduleId> [options]\n weft schedule resume <scheduleId> [options]\n weft schedule cancel <scheduleId> [options]\n\nProvide a cron expression positional OR an --every interval (e.g. \"30s\", \"1h\"),\nbut not both. Interval schedules fire one period after creation, then every\nperiod after that.\n\nOptions:\n -d, --database <path> Database file path (default: ./weft.db)\n -s, --storage <backend> Storage backend: sqlite, lmdb (default: sqlite)\n -w, --workflows <path> Path to workflow definitions module (required for create)\n --every <duration> Interval cadence for create (e.g. 30s, 5m, 1h); mutually exclusive with the cron positional\n --input <json> JSON input payload for create (default: null)\n --id <id> Custom schedule id for create\n --overlap <policy> Overlap policy: skip, queue, cancel-running, allow\n --backfill Run missed ticks on recovery\n --jitter <duration> Deterministic dispatch jitter for create (e.g. 30s, 5m)\n -j, --json Output results as JSON\n -h, --help Show this help message\n";
|
|
8
|
+
export declare const VALIDATE_HELP_TEXT = "\nweft validate - Lint workflow definitions for design-time anti-patterns\n\nUsage: weft validate <entry.ts>... [options]\n\nArguments:\n <entry.ts>... One or more TypeScript modules or glob patterns that\n resolve to workflow definitions and/or activity\n definitions.\n\nOptions:\n -j, --json Output results as JSON\n -h, --help Show this help message\n\nExit codes:\n 0 No errors (warnings may be present)\n 1 One or more errors detected\n 2 Entry file could not be loaded (takes precedence over validation errors)\n\nJSON output:\n { entries, valid, hasLoadErrors, hasValidationErrors }\n\nChecks performed:\n unbounded-retry Activity retry.maxAttempts is Infinity\n stateful-without-compensator Non-idempotent activity has no compensate fn\n";
|
|
9
9
|
export declare const SERVER_HELP_TEXT = "\nweft server - Inspect a running server's health and operation surface\n\nUsage:\n weft server health [options]\n weft server info [options]\n\nOptions:\n --server <url> Server URL (default: WEFT_ADDR, profile, run lockfile, or localhost)\n --token <token> Bearer token (default: WEFT_TOKEN)\n --profile <name> Profile from ~/.weft/config\n --wait (health) Poll until the server is reachable\n --wait-timeout <ms> (health) Maximum time to wait, in milliseconds (default: 30000)\n -j, --json Emit machine-readable JSON output\n -q, --quiet Suppress success/error text (use the exit code)\n -h, --help Show this help message\n\nExit codes:\n 0 Healthy\n 1 Unreachable / unhealthy\n 2 Connection error\n";
|
|
10
10
|
export declare const WORKFLOW_HELP_TEXT = "\nweft workflow - List, inspect, start, signal, and cancel workflows on a server\n\nUsage:\n weft workflow ls [--type <type>] [--status <status>] [--limit <n>] [options]\n weft workflow get <workflow-id> [options]\n weft workflow events <workflow-id> [options]\n weft workflow start <workflow-type> [--input <json> | --input-file <path|->] [--id <id>] [options]\n weft workflow cancel <workflow-id> [--yes] [--dry-run] [options]\n weft workflow signal <workflow-id> <signal-name> [--input <json> | --input-file <path|->] [options]\n\nOptions:\n --server <url> Server URL (default: WEFT_ADDR, profile, run lockfile, or localhost)\n --token <token> Bearer token (default: WEFT_TOKEN)\n --profile <name> Profile from ~/.weft/config\n --type <type> (ls) Filter by workflow type\n --status <status> (ls) Filter by workflow status\n --limit <n> (ls) Maximum number of rows\n --input <json> (start/signal) JSON input payload\n --input-file <path> (start/signal) Read JSON input from a file, or '-' for stdin\n --id <id> (start) Explicit workflow id\n -y, --yes (cancel) Confirm without prompting\n --dry-run (cancel) Print affected count without cancelling\n -j, --json Emit machine-readable output (NDJSON for lists)\n -q, --quiet Print ids only / suppress success text\n -h, --help Show this help message\n\nExit codes:\n 0 Success\n 1 Operation failed or destructive operation was not confirmed\n 2 Connection error\n 3 Usage or input error\n 4 Operation unavailable on this server (version skew)\n";
|
|
11
11
|
export declare const TAIL_HELP_TEXT = "\nweft tail - Stream a workflow's events as Server-Sent Events\n\nUsage:\n weft tail <workflow-id> [options]\n\nOptions:\n --server <url> Server URL (default: WEFT_ADDR, profile, run lockfile, or localhost)\n --token <token> Bearer token (default: WEFT_TOKEN)\n --profile <name> Profile from ~/.weft/config\n -j, --json Emit one JSON object per line (NDJSON)\n -q, --quiet Do not echo events to stdout\n -h, --help Show this help message\n\nPress Ctrl-C to stop tailing; the stream ends cleanly with exit code 0.\n";
|
package/dist/cli/help-text.js
CHANGED
|
@@ -10,7 +10,7 @@ Commands:
|
|
|
10
10
|
schedule Manage recurring schedules
|
|
11
11
|
timeline Inspect workflow timeline and replay history
|
|
12
12
|
version:check Check workflow version compatibility
|
|
13
|
-
validate Lint workflow
|
|
13
|
+
validate Lint workflow definitions for design-time anti-patterns
|
|
14
14
|
codegen Generate TypeScript declarations from a registry snapshot
|
|
15
15
|
api Inspect and invoke catalog operations on a running server
|
|
16
16
|
server Inspect a running server's health and operation surface
|
|
@@ -117,7 +117,7 @@ period after that.
|
|
|
117
117
|
Options:
|
|
118
118
|
-d, --database <path> Database file path (default: ./weft.db)
|
|
119
119
|
-s, --storage <backend> Storage backend: sqlite, lmdb (default: sqlite)
|
|
120
|
-
-w, --workflows <path> Path to workflow
|
|
120
|
+
-w, --workflows <path> Path to workflow definitions module (required for create)
|
|
121
121
|
--every <duration> Interval cadence for create (e.g. 30s, 5m, 1h); mutually exclusive with the cron positional
|
|
122
122
|
--input <json> JSON input payload for create (default: null)
|
|
123
123
|
--id <id> Custom schedule id for create
|
|
@@ -127,13 +127,13 @@ Options:
|
|
|
127
127
|
-j, --json Output results as JSON
|
|
128
128
|
-h, --help Show this help message
|
|
129
129
|
`, VALIDATE_HELP_TEXT = `
|
|
130
|
-
weft validate - Lint workflow
|
|
130
|
+
weft validate - Lint workflow definitions for design-time anti-patterns
|
|
131
131
|
|
|
132
132
|
Usage: weft validate <entry.ts>... [options]
|
|
133
133
|
|
|
134
134
|
Arguments:
|
|
135
135
|
<entry.ts>... One or more TypeScript modules or glob patterns that
|
|
136
|
-
resolve to workflow
|
|
136
|
+
resolve to workflow definitions and/or activity
|
|
137
137
|
definitions.
|
|
138
138
|
|
|
139
139
|
Options:
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { FaultCode } from '../core/fault-code.ts';
|
|
2
|
+
import type { ErasedOperation, OperationKind, TransportAvailability } from '../server/operation-catalog.ts';
|
|
3
|
+
import type { ParamSource, ResponseShape } from '../server/rest-binding.ts';
|
|
4
|
+
export type CatalogRestBindingSnapshot = {
|
|
5
|
+
readonly method: string;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly inputSources: Readonly<Record<string, ParamSource>>;
|
|
8
|
+
readonly success: ResponseShape;
|
|
9
|
+
};
|
|
3
10
|
export type CatalogAccessSnapshot = {
|
|
4
11
|
readonly kind: 'public';
|
|
5
12
|
} | {
|
|
@@ -36,11 +43,13 @@ export type CatalogOperationSnapshot = {
|
|
|
36
43
|
readonly inputSchema: Record<string, unknown>;
|
|
37
44
|
readonly outputSchema: Record<string, unknown>;
|
|
38
45
|
readonly eventSchema?: Record<string, unknown>;
|
|
46
|
+
/** Declarative REST route metadata for generated client transports. */
|
|
47
|
+
readonly rest?: CatalogRestBindingSnapshot;
|
|
39
48
|
};
|
|
40
49
|
export type CatalogSnapshot = {
|
|
41
50
|
readonly generatedBy: 'weft catalog snapshot';
|
|
42
51
|
readonly version: 1;
|
|
43
52
|
readonly operations: ReadonlyArray<CatalogOperationSnapshot>;
|
|
44
53
|
};
|
|
45
|
-
export declare function createCatalogSnapshot(): CatalogSnapshot;
|
|
54
|
+
export declare function createCatalogSnapshot(sourceOperations?: ReadonlyArray<ErasedOperation>): CatalogSnapshot;
|
|
46
55
|
export declare function stringifyCatalogSnapshot(snapshot: CatalogSnapshot): string;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { definitionSchemaToJsonSchema } from "../core/types/definition-schema-to-json.js";
|
|
2
2
|
import { compareStrings, normalizeJsonObject } from "../server/json-schema-utilities.js";
|
|
3
|
-
import { createLiveOperationRegistry } from "../server/rest-bindings.js";
|
|
4
|
-
export function createCatalogSnapshot() {
|
|
3
|
+
import { createLiveOperationRegistry, createLiveRestBindings } from "../server/rest-bindings.js";
|
|
4
|
+
export function createCatalogSnapshot(sourceOperations = createLiveOperationRegistry().list()) {
|
|
5
|
+
const restBindings = new Map(createLiveRestBindings().map((binding) => [binding.operationName, binding]));
|
|
5
6
|
return {
|
|
6
7
|
generatedBy: "weft catalog snapshot",
|
|
7
8
|
version: 1,
|
|
8
|
-
operations:
|
|
9
|
+
operations: sourceOperations.map((operation) => operationToSnapshot(operation, (operation.kind ?? "unary") === "unary" && operation.transports.http && !operation.transports.jsonRpcHttp && !operation.tags.includes("Storage") ? restBindings.get(operation.name) : void 0)).toSorted((left, right) => compareStrings(left.name, right.name))
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
export function stringifyCatalogSnapshot(snapshot) {
|
|
12
13
|
return `${JSON.stringify(snapshot, null, 2)}
|
|
13
14
|
`;
|
|
14
15
|
}
|
|
15
|
-
function operationToSnapshot(operation) {
|
|
16
|
+
function operationToSnapshot(operation, restBinding) {
|
|
16
17
|
const eventSchema = operation.eventSchema;
|
|
17
18
|
return {
|
|
18
19
|
name: operation.name,
|
|
@@ -27,7 +28,15 @@ function operationToSnapshot(operation) {
|
|
|
27
28
|
producibleFaults: [...operation.producibleFaults ?? []].toSorted(compareStrings),
|
|
28
29
|
inputSchema: normalizeJsonObject(definitionSchemaToJsonSchema(operation.inputSchema, "input")),
|
|
29
30
|
outputSchema: normalizeJsonObject(definitionSchemaToJsonSchema(operation.outputSchema, "output")),
|
|
30
|
-
...eventSchema === void 0 ? {} : { eventSchema: normalizeJsonObject(definitionSchemaToJsonSchema(eventSchema, "output")) }
|
|
31
|
+
...eventSchema === void 0 ? {} : { eventSchema: normalizeJsonObject(definitionSchemaToJsonSchema(eventSchema, "output")) },
|
|
32
|
+
...restBinding === void 0 ? {} : {
|
|
33
|
+
rest: {
|
|
34
|
+
method: restBinding.method,
|
|
35
|
+
path: restBinding.path,
|
|
36
|
+
inputSources: Object.fromEntries(Object.entries(restBinding.inputSources).filter((entry) => entry[1] !== void 0)),
|
|
37
|
+
success: { ...restBinding.success }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
};
|
|
32
41
|
}
|
|
33
42
|
function parameterizedAccessToSnapshot(hint) {
|
|
@@ -33,6 +33,35 @@ export type WeftClientConnection = ConnectionOptions;
|
|
|
33
33
|
* one generated surface instead of drifting apart.
|
|
34
34
|
*/
|
|
35
35
|
export type CatalogTransport = (operationName: string, input: unknown) => Promise<unknown>;
|
|
36
|
+
/** Generated metadata needed to map a typed client operation onto REST. */
|
|
37
|
+
export type ClientRestOperationBinding = {
|
|
38
|
+
readonly method: string;
|
|
39
|
+
readonly path: string;
|
|
40
|
+
readonly inputSources: Readonly<Record<string, {
|
|
41
|
+
readonly kind: 'path';
|
|
42
|
+
readonly pathParam: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'query';
|
|
45
|
+
readonly queryParam: string;
|
|
46
|
+
readonly repeating?: boolean;
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'header';
|
|
49
|
+
readonly headerName: string;
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: 'body';
|
|
52
|
+
readonly mediaType?: 'application/json';
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: 'body-field';
|
|
55
|
+
readonly bodyField: string;
|
|
56
|
+
}>>;
|
|
57
|
+
readonly success: {
|
|
58
|
+
readonly kind: 'json';
|
|
59
|
+
readonly status: number;
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'empty';
|
|
62
|
+
readonly status: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
36
65
|
/**
|
|
37
66
|
* Build a catalog client from a list of operation names and a transport. Each
|
|
38
67
|
* name becomes a method that forwards its input through the transport, so the
|
package/dist/cli/schedule.js
CHANGED
|
@@ -51,10 +51,8 @@ function parseScheduleInput(input) {
|
|
|
51
51
|
}
|
|
52
52
|
async function registerScheduleWorkflows(engine, workflowsPath, loadRegistrationsFromModule) {
|
|
53
53
|
const loaded = await loadRegistrationsFromModule(workflowsPath);
|
|
54
|
-
for (const
|
|
55
|
-
const definition = { ...registration, name: workflowType };
|
|
54
|
+
for (const definition of Object.values(loaded.registrations))
|
|
56
55
|
registerOnRuntimeEngine(runtimeWorkflowEngine(engine), definition);
|
|
57
|
-
}
|
|
58
56
|
}
|
|
59
57
|
async function executeScheduleCreate(options, engine, loadRegistrationsFromModule) {
|
|
60
58
|
const validationError = getScheduleCreateValidationError(options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ActivityDefinition } from '../core/activity.ts';
|
|
2
2
|
import type { Engine } from '../core/engine.ts';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WorkflowDefinition } from '../core/types.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Convert a plain-object `ActivityDefinition` into a callable function that
|
|
6
6
|
* satisfies the engine's `isActivityDefinition` check (which requires a
|
|
@@ -8,8 +8,8 @@ import type { WorkflowRegistration } from '../diagnostics/validate.ts';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function toActivityCallable(definition: ActivityDefinition): (...args: unknown[]) => unknown;
|
|
10
10
|
/**
|
|
11
|
-
* Register a map of workflow
|
|
11
|
+
* Register a map of workflow definitions and a list of activity definitions
|
|
12
12
|
* on an engine instance. Plain-object activities are normalized to callables
|
|
13
13
|
* before registration.
|
|
14
14
|
*/
|
|
15
|
-
export declare function registerModuleExports(engine: Engine, registrations: Record<string,
|
|
15
|
+
export declare function registerModuleExports(engine: Engine, registrations: Record<string, WorkflowDefinition>, activities: ActivityDefinition[]): void;
|
|
@@ -13,8 +13,8 @@ export function toActivityCallable(definition) {
|
|
|
13
13
|
}
|
|
14
14
|
export function registerModuleExports(engine, registrations, activities) {
|
|
15
15
|
const runtime = runtimeWorkflowEngine(engine);
|
|
16
|
-
for (const
|
|
17
|
-
registerOnRuntimeEngine(runtime,
|
|
16
|
+
for (const definition of Object.values(registrations))
|
|
17
|
+
registerOnRuntimeEngine(runtime, definition);
|
|
18
18
|
for (const activity of activities)
|
|
19
19
|
if (typeof activity === "function")
|
|
20
20
|
engine.register(activity);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const CLI_SHUTDOWN_SIGNALS: readonly ["SIGINT", "SIGTERM"];
|
|
2
|
+
export type CliShutdownSignal = (typeof CLI_SHUTDOWN_SIGNALS)[number];
|
|
3
|
+
export type CliShutdownDependencies = {
|
|
4
|
+
readonly stopServer: () => Promise<void>;
|
|
5
|
+
readonly removeRunLockfile: () => Promise<void>;
|
|
6
|
+
readonly disposeStorage: () => void;
|
|
7
|
+
readonly log: (message: string) => void;
|
|
8
|
+
readonly reportError: (message: string, error: unknown) => void;
|
|
9
|
+
readonly exit: (code: 0 | 1) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function createCliShutdownHandler(dependencies: CliShutdownDependencies): (signal: CliShutdownSignal) => Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const CLI_SHUTDOWN_SIGNALS = ["SIGINT", "SIGTERM"];
|
|
2
|
+
async function runCliShutdown(signal, dependencies) {
|
|
3
|
+
dependencies.log(`
|
|
4
|
+
Received ${signal}; shutting down...`);
|
|
5
|
+
try {
|
|
6
|
+
await dependencies.stopServer();
|
|
7
|
+
try {
|
|
8
|
+
await dependencies.removeRunLockfile();
|
|
9
|
+
} catch (error) {
|
|
10
|
+
dependencies.reportError("[weft] Failed to remove run lockfile:", error);
|
|
11
|
+
}
|
|
12
|
+
dependencies.disposeStorage();
|
|
13
|
+
dependencies.exit(0);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
dependencies.reportError("[weft] Shutdown error:", error);
|
|
16
|
+
dependencies.exit(1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function createCliShutdownHandler(dependencies) {
|
|
20
|
+
let shutdownPromise;
|
|
21
|
+
return (signal) => {
|
|
22
|
+
shutdownPromise ??= runCliShutdown(signal, dependencies);
|
|
23
|
+
return shutdownPromise;
|
|
24
|
+
};
|
|
25
|
+
}
|
package/dist/cli/validate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandOutput } from './types.ts';
|
|
2
|
-
/** Validates workflow
|
|
2
|
+
/** Validates workflow definition modules and reports load or design-time errors. */
|
|
3
3
|
export declare function executeValidate(options: {
|
|
4
4
|
entryPaths: string[];
|
|
5
5
|
json: boolean;
|