@lostgradient/weft 0.23.0 → 0.24.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 +72 -4
- package/dist/cli/codegen-emit-dedup.d.ts +81 -0
- package/dist/cli/codegen-emit-dedup.js +45 -0
- package/dist/cli/codegen-emit-registry.d.ts +90 -0
- package/dist/cli/codegen-emit-registry.js +50 -0
- package/dist/cli/codegen-emit.d.ts +26 -39
- package/dist/cli/codegen-emit.js +4 -27
- package/dist/cli/codegen-validate.d.ts +49 -0
- package/dist/cli/codegen-validate.js +186 -0
- package/dist/cli/codegen.js +6 -87
- package/dist/cli/generated/operation-catalog.snapshot.json +287 -3
- package/dist/cli/generated/operation-client.generated.d.ts +324 -10
- package/dist/cli/generated/operation-client.generated.js +12 -0
- package/dist/cli/output.js +1 -1
- package/dist/cli/storage-factory.js +2 -0
- package/dist/cli/workflow-commands.js +2 -0
- package/dist/cli-main.js +1 -1
- package/dist/core/application-payload-digest.d.ts +42 -0
- package/dist/core/application-payload-digest.js +76 -0
- package/dist/core/application-primitive-abort.d.ts +50 -0
- package/dist/core/application-primitive-abort.js +40 -0
- package/dist/core/application-primitive-attempt-registry.d.ts +74 -0
- package/dist/core/application-primitive-attempt-registry.js +73 -0
- package/dist/core/application-primitive-codec.d.ts +36 -0
- package/dist/core/application-primitive-codec.js +56 -0
- package/dist/core/application-primitive-commit.d.ts +67 -0
- package/dist/core/application-primitive-commit.js +66 -0
- package/dist/core/application-primitive-guards.d.ts +62 -0
- package/dist/core/application-primitive-guards.js +89 -0
- package/dist/core/application-primitive-payload.d.ts +29 -0
- package/dist/core/application-primitive-payload.js +65 -0
- package/dist/core/application-primitive-timing.d.ts +18 -0
- package/dist/core/application-primitive-timing.js +22 -0
- package/dist/core/atomic-state.js +2 -0
- package/dist/core/catalog/codec.d.ts +40 -0
- package/dist/core/catalog/codec.js +45 -0
- package/dist/core/catalog/errors.d.ts +104 -0
- package/dist/core/catalog/errors.js +41 -0
- package/dist/core/catalog/index.d.ts +25 -0
- package/dist/core/catalog/index.js +15 -0
- package/dist/core/catalog/reference-counts.d.ts +105 -0
- package/dist/core/catalog/reference-counts.js +28 -0
- package/dist/core/catalog/removal.d.ts +52 -0
- package/dist/core/catalog/removal.js +14 -0
- package/dist/core/catalog/storage-io.d.ts +78 -0
- package/dist/core/catalog/storage-io.js +106 -0
- package/dist/core/catalog/types.d.ts +108 -0
- package/dist/core/catalog/types.js +0 -0
- package/dist/core/catalog/workflow-catalog.d.ts +165 -0
- package/dist/core/catalog/workflow-catalog.js +198 -0
- package/dist/core/compare-codepoint.d.ts +13 -0
- package/dist/core/compare-codepoint.js +7 -0
- package/dist/core/compression.js +2 -0
- package/dist/core/context/attributes.d.ts +1 -1
- package/dist/core/context/durable-operations.d.ts +2 -2
- package/dist/core/context/index.js +5 -3
- package/dist/core/context/state-namespace.d.ts +1 -1
- package/dist/core/contract/build.d.ts +64 -0
- package/dist/core/contract/build.js +99 -0
- package/dist/core/contract/compatibility.d.ts +187 -0
- package/dist/core/contract/compatibility.js +37 -0
- package/dist/core/contract/failure.d.ts +64 -0
- package/dist/core/contract/failure.js +4 -0
- package/dist/core/contract/hash.d.ts +92 -0
- package/dist/core/contract/hash.js +34 -0
- package/dist/core/contract/index.d.ts +21 -0
- package/dist/core/contract/index.js +22 -0
- package/dist/core/contract/limits.d.ts +74 -0
- package/dist/core/contract/limits.js +1 -0
- package/dist/core/contract/manifest-parse-schema.d.ts +37 -0
- package/dist/core/contract/manifest-parse-schema.js +106 -0
- package/dist/core/contract/manifest-parse.d.ts +76 -0
- package/dist/core/contract/manifest-parse.js +189 -0
- package/dist/core/contract/manifest.d.ts +56 -0
- package/dist/core/contract/manifest.js +31 -0
- package/dist/core/contract/normalize.d.ts +97 -0
- package/dist/core/contract/normalize.js +127 -0
- package/dist/core/contract/revision.d.ts +29 -0
- package/dist/core/contract/revision.js +5 -0
- package/dist/core/contract/types.d.ts +274 -0
- package/dist/core/contract/types.js +1 -0
- package/dist/core/engine/catalog-activation.d.ts +40 -0
- package/dist/core/engine/catalog-activation.js +17 -0
- package/dist/core/engine/catalog-events.d.ts +36 -0
- package/dist/core/engine/catalog-events.js +15 -0
- package/dist/core/engine/catalog-readiness.d.ts +49 -0
- package/dist/core/engine/catalog-readiness.js +59 -0
- package/dist/core/engine/catalog-removal.d.ts +132 -0
- package/dist/core/engine/catalog-removal.js +70 -0
- package/dist/core/engine/construction.d.ts +1 -1
- package/dist/core/engine/construction.js +4 -2
- package/dist/core/engine/disposal.js +9 -0
- package/dist/core/engine/engine-workflows-namespace.d.ts +130 -0
- package/dist/core/engine/engine-workflows-namespace.js +49 -0
- package/dist/core/engine/finalizer-metadata.d.ts +22 -0
- package/dist/core/engine/finalizer-metadata.js +12 -0
- package/dist/core/engine/handle-result.js +2 -0
- package/dist/core/engine/index.d.ts +83 -0
- package/dist/core/engine/index.js +61 -0
- package/dist/core/engine/internals.d.ts +44 -1
- package/dist/core/engine/internals.js +6 -0
- package/dist/core/engine/lifecycle/start.js +3 -0
- package/dist/core/engine/registration.d.ts +76 -0
- package/dist/core/engine/registration.js +12 -6
- package/dist/core/engine/source-registration.d.ts +42 -0
- package/dist/core/engine/source-registration.js +36 -0
- package/dist/core/engine/source-resolution.d.ts +85 -0
- package/dist/core/engine/source-resolution.js +119 -0
- package/dist/core/engine/validation.js +2 -2
- package/dist/core/events/catalog-events.d.ts +117 -0
- package/dist/core/events/catalog-events.js +62 -0
- package/dist/core/events/event-map.d.ts +6 -0
- package/dist/core/events/index.d.ts +1 -0
- package/dist/core/events/index.js +1 -0
- package/dist/core/mailbox-admission.d.ts +26 -0
- package/dist/core/mailbox-admission.js +130 -0
- package/dist/core/mailbox-claims.d.ts +251 -0
- package/dist/core/mailbox-claims.js +0 -0
- package/dist/core/mailbox-codec.d.ts +32 -0
- package/dist/core/mailbox-codec.js +221 -0
- package/dist/core/mailbox-contract.d.ts +290 -0
- package/dist/core/mailbox-contract.js +0 -0
- package/dist/core/mailbox-delivery.d.ts +37 -0
- package/dist/core/mailbox-delivery.js +193 -0
- package/dist/core/mailbox-guards.d.ts +78 -0
- package/dist/core/mailbox-guards.js +58 -0
- package/dist/core/mailbox-index-codec.d.ts +41 -0
- package/dist/core/mailbox-index-codec.js +71 -0
- package/dist/core/mailbox-internals.d.ts +156 -0
- package/dist/core/mailbox-internals.js +154 -0
- package/dist/core/mailbox-maintenance.d.ts +29 -0
- package/dist/core/mailbox-maintenance.js +196 -0
- package/dist/core/mailbox-settlement.d.ts +69 -0
- package/dist/core/mailbox-settlement.js +206 -0
- package/dist/core/mailbox-storage.d.ts +117 -0
- package/dist/core/mailbox-storage.js +115 -0
- package/dist/core/mailbox-transition-helpers.d.ts +70 -0
- package/dist/core/mailbox-transition-helpers.js +43 -0
- package/dist/core/mailbox-transitions-recovery.d.ts +28 -0
- package/dist/core/mailbox-transitions-recovery.js +64 -0
- package/dist/core/mailbox-transitions.d.ts +138 -0
- package/dist/core/mailbox-transitions.js +180 -0
- package/dist/core/mailbox-types.d.ts +406 -0
- package/dist/core/mailbox-types.js +16 -0
- package/dist/core/mailbox-validation.d.ts +65 -0
- package/dist/core/mailbox-validation.js +73 -0
- package/dist/core/mailbox-waits.d.ts +50 -0
- package/dist/core/mailbox-waits.js +97 -0
- package/dist/core/mailbox.d.ts +163 -0
- package/dist/core/mailbox.js +211 -0
- package/dist/core/outbox-claims.d.ts +307 -0
- package/dist/core/outbox-claims.js +0 -0
- package/dist/core/outbox-codec.d.ts +24 -0
- package/dist/core/outbox-codec.js +257 -0
- package/dist/core/outbox-contract.d.ts +346 -0
- package/dist/core/outbox-contract.js +0 -0
- package/dist/core/outbox-delivery.d.ts +34 -0
- package/dist/core/outbox-delivery.js +149 -0
- package/dist/core/outbox-drain.d.ts +29 -0
- package/dist/core/outbox-drain.js +158 -0
- package/dist/core/outbox-enqueue.d.ts +24 -0
- package/dist/core/outbox-enqueue.js +115 -0
- package/dist/core/outbox-guards.d.ts +76 -0
- package/dist/core/outbox-guards.js +60 -0
- package/dist/core/outbox-index-codec.d.ts +33 -0
- package/dist/core/outbox-index-codec.js +71 -0
- package/dist/core/outbox-internals.d.ts +99 -0
- package/dist/core/outbox-internals.js +159 -0
- package/dist/core/outbox-listing.d.ts +12 -0
- package/dist/core/outbox-listing.js +38 -0
- package/dist/core/outbox-maintenance.d.ts +28 -0
- package/dist/core/outbox-maintenance.js +191 -0
- package/dist/core/outbox-operations.d.ts +18 -0
- package/dist/core/outbox-operations.js +46 -0
- package/dist/core/outbox-runner.d.ts +30 -0
- package/dist/core/outbox-runner.js +217 -0
- package/dist/core/outbox-settlement.d.ts +57 -0
- package/dist/core/outbox-settlement.js +183 -0
- package/dist/core/outbox-storage.d.ts +107 -0
- package/dist/core/outbox-storage.js +127 -0
- package/dist/core/outbox-transition-helpers.d.ts +83 -0
- package/dist/core/outbox-transition-helpers.js +63 -0
- package/dist/core/outbox-transitions-recovery.d.ts +30 -0
- package/dist/core/outbox-transitions-recovery.js +42 -0
- package/dist/core/outbox-transitions.d.ts +145 -0
- package/dist/core/outbox-transitions.js +236 -0
- package/dist/core/outbox-types.d.ts +400 -0
- package/dist/core/outbox-types.js +20 -0
- package/dist/core/outbox-validation.d.ts +101 -0
- package/dist/core/outbox-validation.js +127 -0
- package/dist/core/outbox-waits.d.ts +39 -0
- package/dist/core/outbox-waits.js +88 -0
- package/dist/core/outbox.d.ts +156 -0
- package/dist/core/outbox.js +234 -0
- package/dist/core/registry-limits.d.ts +49 -0
- package/dist/core/registry-limits.js +10 -0
- package/dist/core/registry-schema-conversion.d.ts +20 -0
- package/dist/core/registry-schema-conversion.js +22 -0
- package/dist/core/registry-snapshot.d.ts +91 -42
- package/dist/core/registry-snapshot.js +39 -77
- package/dist/core/registry-workflow-contract-draft.d.ts +32 -0
- package/dist/core/registry-workflow-contract-draft.js +28 -0
- package/dist/core/registry-workflow-manifest.d.ts +122 -0
- package/dist/core/registry-workflow-manifest.js +92 -0
- package/dist/core/source/errors.d.ts +55 -0
- package/dist/core/source/errors.js +13 -0
- package/dist/core/source/index.d.ts +19 -0
- package/dist/core/source/index.js +4 -0
- package/dist/core/source/resolvers.d.ts +45 -0
- package/dist/core/source/resolvers.js +9 -0
- package/dist/core/source/types.d.ts +211 -0
- package/dist/core/source/types.js +0 -0
- package/dist/core/source/validate.d.ts +91 -0
- package/dist/core/source/validate.js +62 -0
- package/dist/core/source/workflow-source.d.ts +43 -0
- package/dist/core/source/workflow-source.js +16 -0
- package/dist/core/types/workflow-registries.d.ts +7 -0
- package/dist/core/types/workflow-registry.d.ts +12 -0
- package/dist/core/versioning.js +2 -0
- package/dist/core/weft-error.d.ts +1 -1
- package/dist/core/weft-error.js +9 -1
- package/dist/http.js +2 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +50 -0
- package/dist/indexeddb.js +1 -1
- package/dist/json-schema.js +3 -3
- package/dist/mcp/resources.js +2 -0
- package/dist/runtime/portable.d.ts +9 -1
- package/dist/server/fault-to-json-rpc.js +3 -1
- package/dist/server/handler/auth-context-principal.js +4 -0
- package/dist/server/json-rpc-http.js +2 -0
- package/dist/server/json-rpc-websocket.js +6 -4
- package/dist/server/operation-catalog/index.d.ts +1 -1
- package/dist/server/operation-catalog/pipeline-helpers.js +2 -0
- package/dist/server/operation-catalog/types.d.ts +17 -0
- package/dist/server/operation-fault.d.ts +3 -0
- package/dist/server/operation-fault.js +3 -1
- package/dist/server/operations/activate-workflow-revision.d.ts +30 -0
- package/dist/server/operations/activate-workflow-revision.js +69 -0
- package/dist/server/operations/fleet-events-subscription.js +1 -1
- package/dist/server/operations/fork-workflow.js +1 -1
- package/dist/server/operations/get-active-workflow-revision.d.ts +32 -0
- package/dist/server/operations/get-active-workflow-revision.js +46 -0
- package/dist/server/operations/get-catalog-diagnostics.d.ts +85 -0
- package/dist/server/operations/get-catalog-diagnostics.js +57 -0
- package/dist/server/operations/get-registry.js +17 -4
- package/dist/server/operations/get-workflow-revision.d.ts +25 -0
- package/dist/server/operations/get-workflow-revision.js +50 -0
- package/dist/server/operations/install-workflow-revision.d.ts +27 -0
- package/dist/server/operations/install-workflow-revision.js +46 -0
- package/dist/server/operations/list-workflow-revisions.d.ts +20 -0
- package/dist/server/operations/list-workflow-revisions.js +40 -0
- package/dist/server/operations/start-or-signal-workflow.js +1 -1
- package/dist/server/operations/start-workflow.js +1 -1
- package/dist/server/operations/static-registrations.js +36 -0
- package/dist/server/operations/storage.js +2 -2
- package/dist/server/operations/submit-review-decision.js +1 -1
- package/dist/server/operations/workflow-catalog-operation-helpers.d.ts +59 -0
- package/dist/server/operations/workflow-catalog-operation-helpers.js +135 -0
- package/dist/server/runtime/websocket-upgrade.js +2 -0
- package/dist/storage/bun-sql.js +49 -6
- package/dist/storage/catalog-keys.d.ts +45 -0
- package/dist/storage/catalog-keys.js +6 -0
- package/dist/storage/compressed-storage.js +1 -1
- package/dist/storage/derived-operations.js +1 -1
- package/dist/storage/index.d.ts +26 -1
- package/dist/storage/interface.d.ts +26 -1
- package/dist/storage/interface.js +1 -1
- package/dist/storage/key-encoding.d.ts +15 -0
- package/dist/storage/key-encoding.js +3 -0
- package/dist/storage/key-prefixes.d.ts +1 -1
- package/dist/storage/key-prefixes.js +15 -0
- package/dist/storage/lmdb.d.ts +26 -1
- package/dist/storage/lmdb.js +1 -1
- package/dist/storage/mailbox-keys.d.ts +80 -0
- package/dist/storage/mailbox-keys.js +14 -0
- package/dist/storage/memory.js +1 -1
- package/dist/storage/neon.js +2 -2
- package/dist/storage/node-sqlite-loader.d.ts +1 -1
- package/dist/storage/node-sqlite-loader.js +2 -2
- package/dist/storage/node-sqlite.js +51 -8
- package/dist/storage/outbox-keys.d.ts +77 -0
- package/dist/storage/outbox-keys.js +14 -0
- package/dist/storage/postgres.js +2 -2
- package/dist/storage/resolve.js +1 -1
- package/dist/storage/scoped-storage.js +1 -1
- package/dist/storage/storage-configuration.d.ts +6 -0
- 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/dist/worker/manifest/registry-contract-builder.d.ts +21 -3
- package/dist/worker/manifest/registry-contract-builder.js +40 -31
- package/package.json +1 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
parseWorkflowRevisionManifest
|
|
4
|
+
} from "../core/contract/index.js";
|
|
5
|
+
import { MAX_CONTRACT_IDENTIFIER_BYTES } from "../core/contract/limits.js";
|
|
6
|
+
import { MAX_REGISTRY_WORKFLOW_COUNT } from "../core/registry-limits.js";
|
|
7
|
+
import { REGISTRY_VERSION } from "../core/registry-snapshot.js";
|
|
8
|
+
import { isRecord } from "../worker/manifest/is-record.js";
|
|
9
|
+
import { utf8ByteLength } from "../worker/manifest/utf8.js";
|
|
10
|
+
const jsonSchema = z.union([z.boolean(), z.record(z.string(), z.unknown())]), activityEntrySchema = z.object({
|
|
11
|
+
inputSchema: jsonSchema.optional(),
|
|
12
|
+
outputSchema: jsonSchema.optional(),
|
|
13
|
+
queue: z.string(),
|
|
14
|
+
description: z.string().optional()
|
|
15
|
+
}).passthrough(), objectValue = z.unknown().refine((value) => typeof value === "object" && value !== null && !Array.isArray(value), {
|
|
16
|
+
message: "expected an object"
|
|
17
|
+
}), registryEnvelopeSchema = z.object({
|
|
18
|
+
registryVersion: z.literal(REGISTRY_VERSION),
|
|
19
|
+
generatedAt: z.string(),
|
|
20
|
+
workflows: z.array(objectValue),
|
|
21
|
+
activeRevisions: objectValue,
|
|
22
|
+
activities: z.record(z.string(), activityEntrySchema)
|
|
23
|
+
}).passthrough();
|
|
24
|
+
function normalizeRootSchema(schema) {
|
|
25
|
+
if (schema === void 0)
|
|
26
|
+
return;
|
|
27
|
+
if (typeof schema === "boolean")
|
|
28
|
+
return {};
|
|
29
|
+
return schema;
|
|
30
|
+
}
|
|
31
|
+
function projectActivities(raw) {
|
|
32
|
+
const projected = Object.create(null);
|
|
33
|
+
for (const [name, entry] of Object.entries(raw)) {
|
|
34
|
+
const projection = { queue: entry.queue }, input = normalizeRootSchema(entry.inputSchema), output = normalizeRootSchema(entry.outputSchema);
|
|
35
|
+
if (input !== void 0)
|
|
36
|
+
projection.inputSchema = input;
|
|
37
|
+
if (output !== void 0)
|
|
38
|
+
projection.outputSchema = output;
|
|
39
|
+
if (entry.description !== void 0)
|
|
40
|
+
projection.description = entry.description;
|
|
41
|
+
projected[name] = projection;
|
|
42
|
+
}
|
|
43
|
+
return projected;
|
|
44
|
+
}
|
|
45
|
+
function formatZodError(error) {
|
|
46
|
+
return error.issues.map((issue) => {
|
|
47
|
+
return `${issue.path.length === 0 ? "<root>" : issue.path.join(".")}: ${issue.message}`;
|
|
48
|
+
}).join("; ");
|
|
49
|
+
}
|
|
50
|
+
function readActiveRevisions(value) {
|
|
51
|
+
if (!isRecord(value))
|
|
52
|
+
return {
|
|
53
|
+
ok: !1,
|
|
54
|
+
error: "codegen: invalid registry snapshot: activeRevisions must be an object"
|
|
55
|
+
};
|
|
56
|
+
let entryCount = 0;
|
|
57
|
+
for (const name in value) {
|
|
58
|
+
entryCount += 1;
|
|
59
|
+
if (entryCount > MAX_REGISTRY_WORKFLOW_COUNT)
|
|
60
|
+
return {
|
|
61
|
+
ok: !1,
|
|
62
|
+
error: `codegen: invalid registry snapshot: activeRevisions has more than ${MAX_REGISTRY_WORKFLOW_COUNT} entries`
|
|
63
|
+
};
|
|
64
|
+
if (utf8ByteLength(name) > MAX_CONTRACT_IDENTIFIER_BYTES)
|
|
65
|
+
return {
|
|
66
|
+
ok: !1,
|
|
67
|
+
error: `codegen: invalid registry snapshot: activeRevisions key ${JSON.stringify(name)} exceeds the maximum identifier length of ${MAX_CONTRACT_IDENTIFIER_BYTES} bytes`
|
|
68
|
+
};
|
|
69
|
+
const revision = value[name];
|
|
70
|
+
if (typeof revision !== "string")
|
|
71
|
+
return {
|
|
72
|
+
ok: !1,
|
|
73
|
+
error: `codegen: invalid registry snapshot: activeRevisions[${JSON.stringify(name)}] must be a string`
|
|
74
|
+
};
|
|
75
|
+
if (utf8ByteLength(revision) > MAX_CONTRACT_IDENTIFIER_BYTES)
|
|
76
|
+
return {
|
|
77
|
+
ok: !1,
|
|
78
|
+
error: `codegen: invalid registry snapshot: activeRevisions[${JSON.stringify(name)}] exceeds the maximum identifier length of ${MAX_CONTRACT_IDENTIFIER_BYTES} bytes`
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return { ok: !0, value };
|
|
82
|
+
}
|
|
83
|
+
async function parseAllManifests(workflowsRaw) {
|
|
84
|
+
const manifests = [];
|
|
85
|
+
for (const [index, raw] of workflowsRaw.entries()) {
|
|
86
|
+
const parsed = await parseWorkflowRevisionManifest(raw);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
const location = parsed.path === void 0 ? "" : ` at ${parsed.path}`;
|
|
89
|
+
return {
|
|
90
|
+
ok: !1,
|
|
91
|
+
error: `codegen: invalid registry snapshot: workflows[${index}] (${parsed.reason}${location}): ${parsed.message}`
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
manifests.push(parsed.manifest);
|
|
95
|
+
}
|
|
96
|
+
return { ok: !0, value: manifests };
|
|
97
|
+
}
|
|
98
|
+
function indexManifestsByIdentity(manifests) {
|
|
99
|
+
const byName = new Map;
|
|
100
|
+
for (const manifest of manifests) {
|
|
101
|
+
let byRevision = byName.get(manifest.name);
|
|
102
|
+
if (byRevision === void 0) {
|
|
103
|
+
byRevision = new Map;
|
|
104
|
+
byName.set(manifest.name, byRevision);
|
|
105
|
+
}
|
|
106
|
+
if (byRevision.has(manifest.revision))
|
|
107
|
+
return {
|
|
108
|
+
ok: !1,
|
|
109
|
+
error: `codegen: invalid registry snapshot: workflows contains more than one manifest for name ${JSON.stringify(manifest.name)}, revision ${JSON.stringify(manifest.revision)}`
|
|
110
|
+
};
|
|
111
|
+
byRevision.set(manifest.revision, manifest);
|
|
112
|
+
}
|
|
113
|
+
return { ok: !0, value: byName };
|
|
114
|
+
}
|
|
115
|
+
function toCodegenWorkflowEntry(manifest) {
|
|
116
|
+
const entry = {
|
|
117
|
+
revision: manifest.revision,
|
|
118
|
+
workflowVersion: manifest.workflowVersion
|
|
119
|
+
};
|
|
120
|
+
if (manifest.contract.inputSchema !== void 0)
|
|
121
|
+
entry.inputSchema = manifest.contract.inputSchema;
|
|
122
|
+
if (manifest.contract.outputSchema !== void 0)
|
|
123
|
+
entry.outputSchema = manifest.contract.outputSchema;
|
|
124
|
+
if (manifest.contract.description !== void 0)
|
|
125
|
+
entry.description = manifest.contract.description;
|
|
126
|
+
if (manifest.contract.tags !== void 0 && manifest.contract.tags.length > 0)
|
|
127
|
+
entry.tags = manifest.contract.tags;
|
|
128
|
+
return entry;
|
|
129
|
+
}
|
|
130
|
+
async function resolveActiveWorkflowEntries(workflowsRaw, activeRevisions) {
|
|
131
|
+
const parsed = await parseAllManifests(workflowsRaw);
|
|
132
|
+
if (!parsed.ok)
|
|
133
|
+
return parsed;
|
|
134
|
+
const indexed = indexManifestsByIdentity(parsed.value);
|
|
135
|
+
if (!indexed.ok)
|
|
136
|
+
return indexed;
|
|
137
|
+
const byName = indexed.value, projected = Object.create(null);
|
|
138
|
+
for (const [name, revision] of Object.entries(activeRevisions)) {
|
|
139
|
+
const manifest = byName.get(name)?.get(revision);
|
|
140
|
+
if (manifest === void 0)
|
|
141
|
+
continue;
|
|
142
|
+
projected[name] = toCodegenWorkflowEntry(manifest);
|
|
143
|
+
}
|
|
144
|
+
return { ok: !0, value: projected };
|
|
145
|
+
}
|
|
146
|
+
function checkRawWorkflowsCount(value) {
|
|
147
|
+
const rawWorkflows = value !== null && typeof value === "object" ? value.workflows : void 0;
|
|
148
|
+
if (Array.isArray(rawWorkflows) && rawWorkflows.length > MAX_REGISTRY_WORKFLOW_COUNT)
|
|
149
|
+
return {
|
|
150
|
+
ok: !1,
|
|
151
|
+
error: `codegen: invalid registry snapshot: workflows has ${rawWorkflows.length} entries, exceeding the maximum of ${MAX_REGISTRY_WORKFLOW_COUNT}`
|
|
152
|
+
};
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
export async function validateRegistrySnapshot(value) {
|
|
156
|
+
if (value !== null && typeof value === "object" && "registryVersion" in value) {
|
|
157
|
+
const { registryVersion: actual } = value;
|
|
158
|
+
if (actual !== REGISTRY_VERSION)
|
|
159
|
+
return {
|
|
160
|
+
ok: !1,
|
|
161
|
+
error: `codegen: registryVersion ${String(actual)} is not supported (expected ${REGISTRY_VERSION}); upgrade or regenerate the snapshot`
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const oversizedWorkflows = checkRawWorkflowsCount(value);
|
|
165
|
+
if (oversizedWorkflows !== void 0)
|
|
166
|
+
return oversizedWorkflows;
|
|
167
|
+
const parsed = registryEnvelopeSchema.safeParse(value);
|
|
168
|
+
if (!parsed.success)
|
|
169
|
+
return {
|
|
170
|
+
ok: !1,
|
|
171
|
+
error: `codegen: invalid registry snapshot: ${formatZodError(parsed.error)}`
|
|
172
|
+
};
|
|
173
|
+
const activeRevisions = readActiveRevisions(parsed.data.activeRevisions);
|
|
174
|
+
if (!activeRevisions.ok)
|
|
175
|
+
return activeRevisions;
|
|
176
|
+
const workflows = await resolveActiveWorkflowEntries(parsed.data.workflows, activeRevisions.value);
|
|
177
|
+
if (!workflows.ok)
|
|
178
|
+
return workflows;
|
|
179
|
+
return {
|
|
180
|
+
ok: !0,
|
|
181
|
+
value: {
|
|
182
|
+
workflows: workflows.value,
|
|
183
|
+
activities: projectActivities(parsed.data.activities)
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
package/dist/cli/codegen.js
CHANGED
|
@@ -1,37 +1,19 @@
|
|
|
1
1
|
import { promises as fs } from "node:fs";
|
|
2
2
|
import { basename, dirname } from "node:path";
|
|
3
|
-
import { z } from "zod";
|
|
4
3
|
import { ConnectionConfigurationError, resolveConnection } from "../connection.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
} from "../core/registry-snapshot.js";
|
|
8
|
-
import { CodegenEmitError, emitRegistryDeclaration } from "./codegen-emit.js";
|
|
9
|
-
const jsonSchema = z.union([z.boolean(), z.record(z.string(), z.unknown())]), workflowEntrySchema = z.object({
|
|
10
|
-
inputSchema: jsonSchema.optional(),
|
|
11
|
-
outputSchema: jsonSchema.optional(),
|
|
12
|
-
description: z.string().optional(),
|
|
13
|
-
tags: z.array(z.string()).optional()
|
|
14
|
-
}).passthrough(), activityEntrySchema = z.object({
|
|
15
|
-
inputSchema: jsonSchema.optional(),
|
|
16
|
-
outputSchema: jsonSchema.optional(),
|
|
17
|
-
queue: z.string(),
|
|
18
|
-
description: z.string().optional()
|
|
19
|
-
}).passthrough(), registrySnapshotSchema = z.object({
|
|
20
|
-
registryVersion: z.literal(REGISTRY_VERSION),
|
|
21
|
-
workflows: z.record(z.string(), workflowEntrySchema),
|
|
22
|
-
activities: z.record(z.string(), activityEntrySchema)
|
|
23
|
-
}).passthrough();
|
|
4
|
+
import { CodegenEmitError, emitRegistryDeclaration } from "./codegen-emit-registry.js";
|
|
5
|
+
import { validateRegistrySnapshot } from "./codegen-validate.js";
|
|
24
6
|
export async function executeCodegen(options) {
|
|
25
7
|
const snapshotResult = await loadSnapshot(options);
|
|
26
8
|
if (!snapshotResult.ok)
|
|
27
9
|
return formatFailure(snapshotResult.error, options);
|
|
28
|
-
const validation =
|
|
10
|
+
const validation = await validateRegistrySnapshot(snapshotResult.value);
|
|
29
11
|
if (!validation.ok)
|
|
30
12
|
return formatFailure(validation.error, options);
|
|
31
|
-
const
|
|
13
|
+
const { workflows, activities } = validation.value;
|
|
32
14
|
let content;
|
|
33
15
|
try {
|
|
34
|
-
content = emitRegistryDeclaration(
|
|
16
|
+
content = emitRegistryDeclaration(workflows);
|
|
35
17
|
} catch (error) {
|
|
36
18
|
if (error instanceof CodegenEmitError)
|
|
37
19
|
return formatFailure(`codegen: ${error.message}`, options);
|
|
@@ -41,7 +23,7 @@ export async function executeCodegen(options) {
|
|
|
41
23
|
const writeResult = await writeOutput(options.out, content);
|
|
42
24
|
if (!writeResult.ok)
|
|
43
25
|
return formatFailure(writeResult.error, options);
|
|
44
|
-
const workflowCount = Object.keys(
|
|
26
|
+
const workflowCount = Object.keys(workflows).length, activityCount = Object.keys(activities).length;
|
|
45
27
|
return formatSuccess(options, writeResult.action, workflowCount, activityCount);
|
|
46
28
|
}
|
|
47
29
|
function formatFailure(message, options) {
|
|
@@ -166,69 +148,6 @@ async function loadSnapshotFromServer(serverUrl, token, timeoutMs) {
|
|
|
166
148
|
}
|
|
167
149
|
return parseRegistryResponse(response, resolvedUrl);
|
|
168
150
|
}
|
|
169
|
-
function validateSnapshot(value) {
|
|
170
|
-
if (value !== null && typeof value === "object" && "registryVersion" in value) {
|
|
171
|
-
const { registryVersion: actual } = value;
|
|
172
|
-
if (actual !== REGISTRY_VERSION)
|
|
173
|
-
return {
|
|
174
|
-
ok: !1,
|
|
175
|
-
error: `codegen: registryVersion ${String(actual)} is not supported (expected ${REGISTRY_VERSION}); upgrade or regenerate the snapshot`
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
const parsed = registrySnapshotSchema.safeParse(value);
|
|
179
|
-
if (!parsed.success)
|
|
180
|
-
return {
|
|
181
|
-
ok: !1,
|
|
182
|
-
error: `codegen: invalid registry snapshot: ${formatZodError(parsed.error)}`
|
|
183
|
-
};
|
|
184
|
-
return { ok: !0, value: {
|
|
185
|
-
registryVersion: parsed.data.registryVersion,
|
|
186
|
-
workflows: projectWorkflows(parsed.data.workflows),
|
|
187
|
-
activities: projectActivities(parsed.data.activities)
|
|
188
|
-
} };
|
|
189
|
-
}
|
|
190
|
-
function normalizeRootSchema(schema) {
|
|
191
|
-
if (schema === void 0)
|
|
192
|
-
return;
|
|
193
|
-
if (typeof schema === "boolean")
|
|
194
|
-
return {};
|
|
195
|
-
return schema;
|
|
196
|
-
}
|
|
197
|
-
function projectWorkflows(raw) {
|
|
198
|
-
const projected = Object.create(null);
|
|
199
|
-
for (const [name, entry] of Object.entries(raw)) {
|
|
200
|
-
const projection = {}, input = normalizeRootSchema(entry.inputSchema), output = normalizeRootSchema(entry.outputSchema);
|
|
201
|
-
if (input !== void 0)
|
|
202
|
-
projection.inputSchema = input;
|
|
203
|
-
if (output !== void 0)
|
|
204
|
-
projection.outputSchema = output;
|
|
205
|
-
if (entry.description !== void 0)
|
|
206
|
-
projection.description = entry.description;
|
|
207
|
-
if (entry.tags !== void 0)
|
|
208
|
-
projection.tags = entry.tags;
|
|
209
|
-
projected[name] = projection;
|
|
210
|
-
}
|
|
211
|
-
return projected;
|
|
212
|
-
}
|
|
213
|
-
function projectActivities(raw) {
|
|
214
|
-
const projected = Object.create(null);
|
|
215
|
-
for (const [name, entry] of Object.entries(raw)) {
|
|
216
|
-
const projection = { queue: entry.queue }, input = normalizeRootSchema(entry.inputSchema), output = normalizeRootSchema(entry.outputSchema);
|
|
217
|
-
if (input !== void 0)
|
|
218
|
-
projection.inputSchema = input;
|
|
219
|
-
if (output !== void 0)
|
|
220
|
-
projection.outputSchema = output;
|
|
221
|
-
if (entry.description !== void 0)
|
|
222
|
-
projection.description = entry.description;
|
|
223
|
-
projected[name] = projection;
|
|
224
|
-
}
|
|
225
|
-
return projected;
|
|
226
|
-
}
|
|
227
|
-
function formatZodError(error) {
|
|
228
|
-
return error.issues.map((issue) => {
|
|
229
|
-
return `${issue.path.length === 0 ? "<root>" : issue.path.join(".")}: ${issue.message}`;
|
|
230
|
-
}).join("; ");
|
|
231
|
-
}
|
|
232
151
|
async function writeOutput(outPath, content) {
|
|
233
152
|
const parent = dirname(outPath);
|
|
234
153
|
try {
|
|
@@ -169,6 +169,115 @@
|
|
|
169
169
|
"type": "object"
|
|
170
170
|
}
|
|
171
171
|
},
|
|
172
|
+
{
|
|
173
|
+
"name": "weft.catalog.diagnostics",
|
|
174
|
+
"kind": "unary",
|
|
175
|
+
"summary": "Get bounded reference-count and removability diagnostics for one workflow revision",
|
|
176
|
+
"description": "Report whether a `(name, revision)` workflow catalog entry is installed, whether it is currently the active revision, its full reference-count breakdown, and whether it's currently removable. Never returns manifest or contract content.",
|
|
177
|
+
"tags": ["Observability"],
|
|
178
|
+
"destructive": false,
|
|
179
|
+
"access": {
|
|
180
|
+
"kind": "scoped",
|
|
181
|
+
"scopes": ["system:read"]
|
|
182
|
+
},
|
|
183
|
+
"transports": {
|
|
184
|
+
"http": true,
|
|
185
|
+
"jsonRpcHttp": true,
|
|
186
|
+
"jsonRpcWebSocket": true,
|
|
187
|
+
"jsonRpcStdio": true
|
|
188
|
+
},
|
|
189
|
+
"producibleFaults": [],
|
|
190
|
+
"inputSchema": {
|
|
191
|
+
"additionalProperties": false,
|
|
192
|
+
"properties": {
|
|
193
|
+
"name": {
|
|
194
|
+
"minLength": 1,
|
|
195
|
+
"type": "string"
|
|
196
|
+
},
|
|
197
|
+
"revision": {
|
|
198
|
+
"minLength": 1,
|
|
199
|
+
"type": "string"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"required": ["name", "revision"],
|
|
203
|
+
"type": "object"
|
|
204
|
+
},
|
|
205
|
+
"outputSchema": {
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"properties": {
|
|
208
|
+
"active": {
|
|
209
|
+
"type": "boolean"
|
|
210
|
+
},
|
|
211
|
+
"activeRevision": {
|
|
212
|
+
"type": "string"
|
|
213
|
+
},
|
|
214
|
+
"installed": {
|
|
215
|
+
"type": "boolean"
|
|
216
|
+
},
|
|
217
|
+
"name": {
|
|
218
|
+
"type": "string"
|
|
219
|
+
},
|
|
220
|
+
"references": {
|
|
221
|
+
"additionalProperties": false,
|
|
222
|
+
"properties": {
|
|
223
|
+
"activeExecutionRealms": {
|
|
224
|
+
"maximum": 9007199254740991,
|
|
225
|
+
"minimum": 0,
|
|
226
|
+
"type": "integer"
|
|
227
|
+
},
|
|
228
|
+
"inFlightStarts": {
|
|
229
|
+
"maximum": 9007199254740991,
|
|
230
|
+
"minimum": 0,
|
|
231
|
+
"type": "integer"
|
|
232
|
+
},
|
|
233
|
+
"nonTerminalRuns": {
|
|
234
|
+
"maximum": 9007199254740991,
|
|
235
|
+
"minimum": 0,
|
|
236
|
+
"type": "integer"
|
|
237
|
+
},
|
|
238
|
+
"pendingDispatches": {
|
|
239
|
+
"maximum": 9007199254740991,
|
|
240
|
+
"minimum": 0,
|
|
241
|
+
"type": "integer"
|
|
242
|
+
},
|
|
243
|
+
"pinnedSchedules": {
|
|
244
|
+
"maximum": 9007199254740991,
|
|
245
|
+
"minimum": 0,
|
|
246
|
+
"type": "integer"
|
|
247
|
+
},
|
|
248
|
+
"registeredDefinitions": {
|
|
249
|
+
"maximum": 9007199254740991,
|
|
250
|
+
"minimum": 0,
|
|
251
|
+
"type": "integer"
|
|
252
|
+
},
|
|
253
|
+
"retainedRecoveryRecords": {
|
|
254
|
+
"maximum": 9007199254740991,
|
|
255
|
+
"minimum": 0,
|
|
256
|
+
"type": "integer"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"required": [
|
|
260
|
+
"registeredDefinitions",
|
|
261
|
+
"inFlightStarts",
|
|
262
|
+
"nonTerminalRuns",
|
|
263
|
+
"pinnedSchedules",
|
|
264
|
+
"pendingDispatches",
|
|
265
|
+
"activeExecutionRealms",
|
|
266
|
+
"retainedRecoveryRecords"
|
|
267
|
+
],
|
|
268
|
+
"type": "object"
|
|
269
|
+
},
|
|
270
|
+
"removable": {
|
|
271
|
+
"type": "boolean"
|
|
272
|
+
},
|
|
273
|
+
"revision": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"required": ["name", "revision", "installed", "active", "references", "removable"],
|
|
278
|
+
"type": "object"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
172
281
|
{
|
|
173
282
|
"name": "weft.events.sse",
|
|
174
283
|
"kind": "stream",
|
|
@@ -1575,14 +1684,27 @@
|
|
|
1575
1684
|
"outputSchema": {
|
|
1576
1685
|
"additionalProperties": false,
|
|
1577
1686
|
"properties": {
|
|
1687
|
+
"activeRevisions": {},
|
|
1578
1688
|
"activities": {},
|
|
1689
|
+
"generatedAt": {
|
|
1690
|
+
"type": "string"
|
|
1691
|
+
},
|
|
1579
1692
|
"registryVersion": {
|
|
1580
|
-
"const":
|
|
1693
|
+
"const": 2,
|
|
1581
1694
|
"type": "number"
|
|
1582
1695
|
},
|
|
1583
|
-
"workflows": {
|
|
1696
|
+
"workflows": {
|
|
1697
|
+
"items": {},
|
|
1698
|
+
"type": "array"
|
|
1699
|
+
}
|
|
1584
1700
|
},
|
|
1585
|
-
"required": [
|
|
1701
|
+
"required": [
|
|
1702
|
+
"registryVersion",
|
|
1703
|
+
"generatedAt",
|
|
1704
|
+
"workflows",
|
|
1705
|
+
"activeRevisions",
|
|
1706
|
+
"activities"
|
|
1707
|
+
],
|
|
1586
1708
|
"type": "object"
|
|
1587
1709
|
}
|
|
1588
1710
|
},
|
|
@@ -4241,6 +4363,36 @@
|
|
|
4241
4363
|
]
|
|
4242
4364
|
}
|
|
4243
4365
|
},
|
|
4366
|
+
{
|
|
4367
|
+
"name": "weft.workflows.active.get",
|
|
4368
|
+
"kind": "unary",
|
|
4369
|
+
"summary": "Get the currently active revision pointer for a workflow",
|
|
4370
|
+
"description": "Read the current `{ revision, generation, activatedAt }` active pointer for `name`. Read-only, in-memory (matches `RegistrySnapshot.activeRevisions`' staleness contract exactly). Faults with NotFound when `name` has never been activated.",
|
|
4371
|
+
"tags": ["Workflow Catalog"],
|
|
4372
|
+
"destructive": false,
|
|
4373
|
+
"access": {
|
|
4374
|
+
"kind": "scoped",
|
|
4375
|
+
"scopes": ["workflows:read"]
|
|
4376
|
+
},
|
|
4377
|
+
"transports": {
|
|
4378
|
+
"http": true,
|
|
4379
|
+
"jsonRpcHttp": true,
|
|
4380
|
+
"jsonRpcWebSocket": true,
|
|
4381
|
+
"jsonRpcStdio": true
|
|
4382
|
+
},
|
|
4383
|
+
"producibleFaults": ["InvalidParams", "NotFound"],
|
|
4384
|
+
"inputSchema": {
|
|
4385
|
+
"additionalProperties": false,
|
|
4386
|
+
"properties": {
|
|
4387
|
+
"name": {
|
|
4388
|
+
"description": "Workflow name. Runtime validation requires a wire-safe identifier."
|
|
4389
|
+
}
|
|
4390
|
+
},
|
|
4391
|
+
"required": ["name"],
|
|
4392
|
+
"type": "object"
|
|
4393
|
+
},
|
|
4394
|
+
"outputSchema": {}
|
|
4395
|
+
},
|
|
4244
4396
|
{
|
|
4245
4397
|
"name": "weft.workflows.activities.pending.list",
|
|
4246
4398
|
"kind": "unary",
|
|
@@ -7466,6 +7618,138 @@
|
|
|
7466
7618
|
"type": "object"
|
|
7467
7619
|
}
|
|
7468
7620
|
},
|
|
7621
|
+
{
|
|
7622
|
+
"name": "weft.workflows.revisions.activate",
|
|
7623
|
+
"kind": "unary",
|
|
7624
|
+
"summary": "Activate an installed workflow revision",
|
|
7625
|
+
"description": "Activate an already-installed `(name, revision)` as the durably advertised active revision for `name`. Returns the structured result verbatim: `{ applied: true, pointer }` on success, or `{ applied: false, reason, ... }` on refusal — surfaced as a Conflict fault with `reason` one of `incompatible`, `stale-generation`, `expected-generation-required`, or `conflict`. Faults with NotFound when the revision was never installed. Never changes which in-process handler `engine.start()` dispatches to — see the workflow-versioning guide.",
|
|
7626
|
+
"tags": ["Workflow Catalog"],
|
|
7627
|
+
"destructive": true,
|
|
7628
|
+
"access": {
|
|
7629
|
+
"kind": "scoped",
|
|
7630
|
+
"scopes": ["workflows:admin"]
|
|
7631
|
+
},
|
|
7632
|
+
"transports": {
|
|
7633
|
+
"http": true,
|
|
7634
|
+
"jsonRpcHttp": true,
|
|
7635
|
+
"jsonRpcWebSocket": true,
|
|
7636
|
+
"jsonRpcStdio": true
|
|
7637
|
+
},
|
|
7638
|
+
"producibleFaults": ["Conflict", "InvalidParams", "NotFound"],
|
|
7639
|
+
"inputSchema": {
|
|
7640
|
+
"additionalProperties": false,
|
|
7641
|
+
"properties": {
|
|
7642
|
+
"expectedGeneration": {
|
|
7643
|
+
"description": "The durable generation this caller last observed. Required once the workflow has an active revision — omitting it there refuses with expected-generation-required."
|
|
7644
|
+
},
|
|
7645
|
+
"name": {
|
|
7646
|
+
"description": "Workflow name. Runtime validation requires a wire-safe identifier."
|
|
7647
|
+
},
|
|
7648
|
+
"policy": {
|
|
7649
|
+
"description": "Optional compatibility policy override."
|
|
7650
|
+
},
|
|
7651
|
+
"revision": {
|
|
7652
|
+
"description": "Installed revision to activate. Runtime validation requires a non-empty string."
|
|
7653
|
+
}
|
|
7654
|
+
},
|
|
7655
|
+
"required": ["name", "revision"],
|
|
7656
|
+
"type": "object"
|
|
7657
|
+
},
|
|
7658
|
+
"outputSchema": {}
|
|
7659
|
+
},
|
|
7660
|
+
{
|
|
7661
|
+
"name": "weft.workflows.revisions.get",
|
|
7662
|
+
"kind": "unary",
|
|
7663
|
+
"summary": "Get one installed workflow revision",
|
|
7664
|
+
"description": "Read one durably installed `(name, revision)` workflow catalog record. Read-only. Faults with NotFound when no such revision was installed.",
|
|
7665
|
+
"tags": ["Workflow Catalog"],
|
|
7666
|
+
"destructive": false,
|
|
7667
|
+
"access": {
|
|
7668
|
+
"kind": "scoped",
|
|
7669
|
+
"scopes": ["workflows:read"]
|
|
7670
|
+
},
|
|
7671
|
+
"transports": {
|
|
7672
|
+
"http": true,
|
|
7673
|
+
"jsonRpcHttp": true,
|
|
7674
|
+
"jsonRpcWebSocket": true,
|
|
7675
|
+
"jsonRpcStdio": true
|
|
7676
|
+
},
|
|
7677
|
+
"producibleFaults": ["InvalidParams", "NotFound"],
|
|
7678
|
+
"inputSchema": {
|
|
7679
|
+
"additionalProperties": false,
|
|
7680
|
+
"properties": {
|
|
7681
|
+
"name": {
|
|
7682
|
+
"description": "Workflow name. Runtime validation requires a wire-safe identifier."
|
|
7683
|
+
},
|
|
7684
|
+
"revision": {
|
|
7685
|
+
"description": "Installed revision. Runtime validation requires a non-empty string."
|
|
7686
|
+
}
|
|
7687
|
+
},
|
|
7688
|
+
"required": ["name", "revision"],
|
|
7689
|
+
"type": "object"
|
|
7690
|
+
},
|
|
7691
|
+
"outputSchema": {}
|
|
7692
|
+
},
|
|
7693
|
+
{
|
|
7694
|
+
"name": "weft.workflows.revisions.install",
|
|
7695
|
+
"kind": "unary",
|
|
7696
|
+
"summary": "Durably install a workflow revision manifest",
|
|
7697
|
+
"description": "Validate and durably install a `WorkflowRevisionManifest` for a workflow the engine already has an in-process definition for. Idempotent on a byte-identical reinstall of the same (name, revision). Faults with InvalidParams when the manifest fails validation or names a workflow with no in-process definition, and Conflict when (name, revision) is already installed with different contract content. Does not check `manifest.workflowVersion` against the in-process definition's own version — that mismatch is a normal activation-time `incompatible` refusal, not an install-time error. Never changes which in-process handler `engine.start()` dispatches to.",
|
|
7698
|
+
"tags": ["Workflow Catalog"],
|
|
7699
|
+
"destructive": false,
|
|
7700
|
+
"access": {
|
|
7701
|
+
"kind": "scoped",
|
|
7702
|
+
"scopes": ["workflows:admin"]
|
|
7703
|
+
},
|
|
7704
|
+
"transports": {
|
|
7705
|
+
"http": true,
|
|
7706
|
+
"jsonRpcHttp": true,
|
|
7707
|
+
"jsonRpcWebSocket": true,
|
|
7708
|
+
"jsonRpcStdio": true
|
|
7709
|
+
},
|
|
7710
|
+
"producibleFaults": ["Conflict", "InvalidParams"],
|
|
7711
|
+
"inputSchema": {
|
|
7712
|
+
"additionalProperties": false,
|
|
7713
|
+
"properties": {
|
|
7714
|
+
"manifest": {
|
|
7715
|
+
"description": "An untrusted WorkflowRevisionManifest, validated at invoke time."
|
|
7716
|
+
}
|
|
7717
|
+
},
|
|
7718
|
+
"required": ["manifest"],
|
|
7719
|
+
"type": "object"
|
|
7720
|
+
},
|
|
7721
|
+
"outputSchema": {}
|
|
7722
|
+
},
|
|
7723
|
+
{
|
|
7724
|
+
"name": "weft.workflows.revisions.list",
|
|
7725
|
+
"kind": "unary",
|
|
7726
|
+
"summary": "List every installed revision of a workflow",
|
|
7727
|
+
"description": "Read every durably installed revision of `name`, sorted deterministically by revision. Read-only. Returns an empty array for a name with no installed revisions, rather than a NotFound fault — an empty catalog is not an error.",
|
|
7728
|
+
"tags": ["Workflow Catalog"],
|
|
7729
|
+
"destructive": false,
|
|
7730
|
+
"access": {
|
|
7731
|
+
"kind": "scoped",
|
|
7732
|
+
"scopes": ["workflows:read"]
|
|
7733
|
+
},
|
|
7734
|
+
"transports": {
|
|
7735
|
+
"http": true,
|
|
7736
|
+
"jsonRpcHttp": true,
|
|
7737
|
+
"jsonRpcWebSocket": true,
|
|
7738
|
+
"jsonRpcStdio": true
|
|
7739
|
+
},
|
|
7740
|
+
"producibleFaults": ["InvalidParams"],
|
|
7741
|
+
"inputSchema": {
|
|
7742
|
+
"additionalProperties": false,
|
|
7743
|
+
"properties": {
|
|
7744
|
+
"name": {
|
|
7745
|
+
"description": "Workflow name. Runtime validation requires a wire-safe identifier."
|
|
7746
|
+
}
|
|
7747
|
+
},
|
|
7748
|
+
"required": ["name"],
|
|
7749
|
+
"type": "object"
|
|
7750
|
+
},
|
|
7751
|
+
"outputSchema": {}
|
|
7752
|
+
},
|
|
7469
7753
|
{
|
|
7470
7754
|
"name": "weft.workflows.scheduleprovenance.get",
|
|
7471
7755
|
"kind": "unary",
|