@exaudeus/workrail 3.39.0 → 3.40.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/dist/cli-worktrain.js +50 -26
- package/dist/console-ui/assets/{index-3oXZ_A9m.js → index-CXWCAonr.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/coordinators/pr-review.d.ts +6 -1
- package/dist/coordinators/pr-review.js +60 -5
- package/dist/daemon/workflow-runner.d.ts +3 -2
- package/dist/daemon/workflow-runner.js +6 -3
- package/dist/manifest.json +56 -40
- package/dist/mcp/output-schemas.d.ts +10 -10
- package/dist/mcp/tools.d.ts +12 -12
- package/dist/trigger/trigger-router.js +9 -2
- package/dist/types/workflow-source.d.ts +0 -1
- package/dist/types/workflow-source.js +3 -6
- package/dist/types/workflow.d.ts +1 -1
- package/dist/types/workflow.js +1 -2
- package/dist/v2/durable-core/domain/artifact-contract-validator.js +66 -0
- package/dist/v2/durable-core/schemas/artifacts/coordinator-signal.d.ts +25 -0
- package/dist/v2/durable-core/schemas/artifacts/coordinator-signal.js +31 -0
- package/dist/v2/durable-core/schemas/artifacts/index.d.ts +3 -1
- package/dist/v2/durable-core/schemas/artifacts/index.js +14 -1
- package/dist/v2/durable-core/schemas/artifacts/review-verdict.d.ts +41 -0
- package/dist/v2/durable-core/schemas/artifacts/review-verdict.js +30 -0
- package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +236 -236
- package/dist/v2/durable-core/schemas/session/events.d.ts +50 -50
- package/dist/v2/durable-core/schemas/session/gaps.d.ts +2 -2
- package/dist/v2/durable-core/schemas/session/manifest.d.ts +4 -4
- package/dist/v2/durable-core/schemas/session/outputs.d.ts +8 -8
- package/dist/v2/usecases/console-routes.js +178 -0
- package/docs/design/coordinator-artifact-protocol-design-candidates.md +155 -0
- package/docs/design/coordinator-artifact-protocol-design-review.md +103 -0
- package/docs/design/coordinator-artifact-protocol-implementation-plan.md +259 -0
- package/docs/ideas/backlog.md +158 -100
- package/package.json +1 -1
- package/workflows/mr-review-workflow.agentic.v2.json +5 -1
|
@@ -15,9 +15,9 @@ exports.createCustomDirectorySource = createCustomDirectorySource;
|
|
|
15
15
|
exports.createGitRepositorySource = createGitRepositorySource;
|
|
16
16
|
exports.createRemoteRegistrySource = createRemoteRegistrySource;
|
|
17
17
|
exports.createPluginSource = createPluginSource;
|
|
18
|
-
exports.assertNever = assertNever;
|
|
19
18
|
exports.getSourceDisplayName = getSourceDisplayName;
|
|
20
19
|
exports.getSourcePath = getSourcePath;
|
|
20
|
+
const assert_never_js_1 = require("../runtime/assert-never.js");
|
|
21
21
|
exports.WORKFLOW_SOURCE_KINDS = [
|
|
22
22
|
'bundled',
|
|
23
23
|
'user',
|
|
@@ -69,9 +69,6 @@ function createRemoteRegistrySource(registryUrl) {
|
|
|
69
69
|
function createPluginSource(pluginName, pluginVersion) {
|
|
70
70
|
return Object.freeze({ kind: 'plugin', pluginName, pluginVersion });
|
|
71
71
|
}
|
|
72
|
-
function assertNever(x) {
|
|
73
|
-
throw new Error(`Unexpected source kind: ${JSON.stringify(x)}`);
|
|
74
|
-
}
|
|
75
72
|
function getSourceDisplayName(source) {
|
|
76
73
|
switch (source.kind) {
|
|
77
74
|
case 'bundled':
|
|
@@ -89,7 +86,7 @@ function getSourceDisplayName(source) {
|
|
|
89
86
|
case 'plugin':
|
|
90
87
|
return source.pluginName;
|
|
91
88
|
default:
|
|
92
|
-
return assertNever(source);
|
|
89
|
+
return (0, assert_never_js_1.assertNever)(source);
|
|
93
90
|
}
|
|
94
91
|
}
|
|
95
92
|
function getSourcePath(source) {
|
|
@@ -105,7 +102,7 @@ function getSourcePath(source) {
|
|
|
105
102
|
case 'plugin':
|
|
106
103
|
return undefined;
|
|
107
104
|
default:
|
|
108
|
-
return assertNever(source);
|
|
105
|
+
return (0, assert_never_js_1.assertNever)(source);
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
function extractRepoName(url) {
|
package/dist/types/workflow.d.ts
CHANGED
|
@@ -28,4 +28,4 @@ export declare function isWorkflowDefinition(obj: unknown): obj is WorkflowDefin
|
|
|
28
28
|
export type { WorkflowDefinition, WorkflowStepDefinition, LoopStepDefinition, LoopConfigDefinition, FunctionDefinition, FunctionParameter, FunctionCall } from './workflow-definition';
|
|
29
29
|
export { isLoopStepDefinition, isWorkflowStepDefinition, hasWorkflowDefinitionShape } from './workflow-definition';
|
|
30
30
|
export type { WorkflowSource, WorkflowSourceKind, BundledSource, UserDirectorySource, ProjectDirectorySource, CustomDirectorySource, GitRepositorySource, RemoteRegistrySource, PluginSource } from './workflow-source';
|
|
31
|
-
export { WORKFLOW_SOURCE_KINDS, createBundledSource, createUserDirectorySource, createProjectDirectorySource, createCustomDirectorySource, createGitRepositorySource, createRemoteRegistrySource, createPluginSource, getSourceDisplayName, getSourcePath,
|
|
31
|
+
export { WORKFLOW_SOURCE_KINDS, createBundledSource, createUserDirectorySource, createProjectDirectorySource, createCustomDirectorySource, createGitRepositorySource, createRemoteRegistrySource, createPluginSource, getSourceDisplayName, getSourcePath, } from './workflow-source';
|
package/dist/types/workflow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getSourcePath = exports.getSourceDisplayName = exports.createPluginSource = exports.createRemoteRegistrySource = exports.createGitRepositorySource = exports.createCustomDirectorySource = exports.createProjectDirectorySource = exports.createUserDirectorySource = exports.createBundledSource = exports.WORKFLOW_SOURCE_KINDS = exports.hasWorkflowDefinitionShape = exports.isWorkflowStepDefinition = exports.isLoopStepDefinition = void 0;
|
|
4
4
|
exports.createWorkflow = createWorkflow;
|
|
5
5
|
exports.toWorkflowSummary = toWorkflowSummary;
|
|
6
6
|
exports.toWorkflowSourceInfo = toWorkflowSourceInfo;
|
|
@@ -102,4 +102,3 @@ Object.defineProperty(exports, "createRemoteRegistrySource", { enumerable: true,
|
|
|
102
102
|
Object.defineProperty(exports, "createPluginSource", { enumerable: true, get: function () { return workflow_source_2.createPluginSource; } });
|
|
103
103
|
Object.defineProperty(exports, "getSourceDisplayName", { enumerable: true, get: function () { return workflow_source_2.getSourceDisplayName; } });
|
|
104
104
|
Object.defineProperty(exports, "getSourcePath", { enumerable: true, get: function () { return workflow_source_2.getSourcePath; } });
|
|
105
|
-
Object.defineProperty(exports, "assertNever", { enumerable: true, get: function () { return workflow_source_2.assertNever; } });
|
|
@@ -21,6 +21,10 @@ function validateArtifactContract(artifacts, contract) {
|
|
|
21
21
|
switch (contractRef) {
|
|
22
22
|
case index_js_1.LOOP_CONTROL_CONTRACT_REF:
|
|
23
23
|
return validateLoopControlContract(artifacts, contractRef, required);
|
|
24
|
+
case index_js_1.COORDINATOR_SIGNAL_CONTRACT_REF:
|
|
25
|
+
return validateCoordinatorSignalContract(artifacts, contractRef, required);
|
|
26
|
+
case index_js_1.REVIEW_VERDICT_CONTRACT_REF:
|
|
27
|
+
return validateReviewVerdictContract(artifacts, contractRef, required);
|
|
24
28
|
default:
|
|
25
29
|
return {
|
|
26
30
|
valid: false,
|
|
@@ -63,6 +67,68 @@ function validateLoopControlContract(artifacts, contractRef, required) {
|
|
|
63
67
|
}
|
|
64
68
|
return { valid: true, artifact: parseResult.data };
|
|
65
69
|
}
|
|
70
|
+
function validateCoordinatorSignalContract(artifacts, contractRef, required) {
|
|
71
|
+
const signalArtifacts = artifacts.filter(index_js_1.isCoordinatorSignalArtifact);
|
|
72
|
+
if (signalArtifacts.length === 0) {
|
|
73
|
+
if (required) {
|
|
74
|
+
return {
|
|
75
|
+
valid: false,
|
|
76
|
+
error: {
|
|
77
|
+
code: 'MISSING_REQUIRED_ARTIFACT',
|
|
78
|
+
contractRef,
|
|
79
|
+
message: `Required artifact missing: ${contractRef}. Agent must provide an artifact with kind='wr.coordinator_signal'.`,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return { valid: true, artifact: null };
|
|
84
|
+
}
|
|
85
|
+
const artifact = signalArtifacts[0];
|
|
86
|
+
const parseResult = index_js_1.CoordinatorSignalArtifactV1Schema.safeParse(artifact);
|
|
87
|
+
if (!parseResult.success) {
|
|
88
|
+
const issues = parseResult.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`);
|
|
89
|
+
return {
|
|
90
|
+
valid: false,
|
|
91
|
+
error: {
|
|
92
|
+
code: 'INVALID_ARTIFACT_SCHEMA',
|
|
93
|
+
contractRef,
|
|
94
|
+
message: `Artifact schema validation failed for ${contractRef}`,
|
|
95
|
+
issues,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
return { valid: true, artifact: parseResult.data };
|
|
100
|
+
}
|
|
101
|
+
function validateReviewVerdictContract(artifacts, contractRef, required) {
|
|
102
|
+
const verdictArtifacts = artifacts.filter(index_js_1.isReviewVerdictArtifact);
|
|
103
|
+
if (verdictArtifacts.length === 0) {
|
|
104
|
+
if (required) {
|
|
105
|
+
return {
|
|
106
|
+
valid: false,
|
|
107
|
+
error: {
|
|
108
|
+
code: 'MISSING_REQUIRED_ARTIFACT',
|
|
109
|
+
contractRef,
|
|
110
|
+
message: `Required artifact missing: ${contractRef}. Agent must provide an artifact with kind='wr.review_verdict'.`,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return { valid: true, artifact: null };
|
|
115
|
+
}
|
|
116
|
+
const artifact = verdictArtifacts[0];
|
|
117
|
+
const parseResult = index_js_1.ReviewVerdictArtifactV1Schema.safeParse(artifact);
|
|
118
|
+
if (!parseResult.success) {
|
|
119
|
+
const issues = parseResult.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`);
|
|
120
|
+
return {
|
|
121
|
+
valid: false,
|
|
122
|
+
error: {
|
|
123
|
+
code: 'INVALID_ARTIFACT_SCHEMA',
|
|
124
|
+
contractRef,
|
|
125
|
+
message: `Artifact schema validation failed for ${contractRef}`,
|
|
126
|
+
issues,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return { valid: true, artifact: parseResult.data };
|
|
131
|
+
}
|
|
66
132
|
function requiresArtifactValidation(outputContract) {
|
|
67
133
|
if (!outputContract)
|
|
68
134
|
return false;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const COORDINATOR_SIGNAL_CONTRACT_REF: "wr.contracts.coordinator_signal";
|
|
3
|
+
export declare const CoordinatorSignalKindSchema: z.ZodEnum<["progress", "finding", "data_needed", "approval_needed", "blocked"]>;
|
|
4
|
+
export type CoordinatorSignalKind = z.infer<typeof CoordinatorSignalKindSchema>;
|
|
5
|
+
export declare const CoordinatorSignalArtifactV1Schema: z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"wr.coordinator_signal">;
|
|
7
|
+
signalKind: z.ZodEnum<["progress", "finding", "data_needed", "approval_needed", "blocked"]>;
|
|
8
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
9
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
kind: "wr.coordinator_signal";
|
|
12
|
+
signalKind: "blocked" | "progress" | "finding" | "data_needed" | "approval_needed";
|
|
13
|
+
payload: Record<string, unknown>;
|
|
14
|
+
sessionId?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
kind: "wr.coordinator_signal";
|
|
17
|
+
signalKind: "blocked" | "progress" | "finding" | "data_needed" | "approval_needed";
|
|
18
|
+
payload: Record<string, unknown>;
|
|
19
|
+
sessionId?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export type CoordinatorSignalArtifactV1 = z.infer<typeof CoordinatorSignalArtifactV1Schema>;
|
|
22
|
+
export declare function isCoordinatorSignalArtifact(artifact: unknown): artifact is {
|
|
23
|
+
readonly kind: 'wr.coordinator_signal';
|
|
24
|
+
};
|
|
25
|
+
export declare function parseCoordinatorSignalArtifact(artifact: unknown): CoordinatorSignalArtifactV1 | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoordinatorSignalArtifactV1Schema = exports.CoordinatorSignalKindSchema = exports.COORDINATOR_SIGNAL_CONTRACT_REF = void 0;
|
|
4
|
+
exports.isCoordinatorSignalArtifact = isCoordinatorSignalArtifact;
|
|
5
|
+
exports.parseCoordinatorSignalArtifact = parseCoordinatorSignalArtifact;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
exports.COORDINATOR_SIGNAL_CONTRACT_REF = 'wr.contracts.coordinator_signal';
|
|
8
|
+
exports.CoordinatorSignalKindSchema = zod_1.z.enum([
|
|
9
|
+
'progress',
|
|
10
|
+
'finding',
|
|
11
|
+
'data_needed',
|
|
12
|
+
'approval_needed',
|
|
13
|
+
'blocked',
|
|
14
|
+
]);
|
|
15
|
+
exports.CoordinatorSignalArtifactV1Schema = zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
kind: zod_1.z.literal('wr.coordinator_signal'),
|
|
18
|
+
signalKind: exports.CoordinatorSignalKindSchema,
|
|
19
|
+
payload: zod_1.z.record(zod_1.z.unknown()),
|
|
20
|
+
sessionId: zod_1.z.string().optional(),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
function isCoordinatorSignalArtifact(artifact) {
|
|
24
|
+
return (typeof artifact === 'object' &&
|
|
25
|
+
artifact !== null &&
|
|
26
|
+
artifact.kind === 'wr.coordinator_signal');
|
|
27
|
+
}
|
|
28
|
+
function parseCoordinatorSignalArtifact(artifact) {
|
|
29
|
+
const result = exports.CoordinatorSignalArtifactV1Schema.safeParse(artifact);
|
|
30
|
+
return result.success ? result.data : null;
|
|
31
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { ASSESSMENT_CONTRACT_REF, AssessmentArtifactV1Schema, AssessmentDimensionSubmissionSchema, isAssessmentArtifact, parseAssessmentArtifact, type AssessmentArtifactV1, type AssessmentDimensionSubmission, } from './assessment.js';
|
|
2
2
|
export { LOOP_CONTROL_CONTRACT_REF, LoopControlDecisionSchema, LoopControlMetadataV1Schema, LoopControlArtifactV1Schema, isLoopControlArtifact, parseLoopControlArtifact, findLoopControlArtifact, type LoopControlDecision, type LoopControlMetadataV1, type LoopControlArtifactV1, } from './loop-control.js';
|
|
3
|
-
export
|
|
3
|
+
export { COORDINATOR_SIGNAL_CONTRACT_REF, CoordinatorSignalKindSchema, CoordinatorSignalArtifactV1Schema, isCoordinatorSignalArtifact, parseCoordinatorSignalArtifact, type CoordinatorSignalKind, type CoordinatorSignalArtifactV1, } from './coordinator-signal.js';
|
|
4
|
+
export { REVIEW_VERDICT_CONTRACT_REF, ReviewVerdictArtifactV1Schema, isReviewVerdictArtifact, parseReviewVerdictArtifact, type ReviewVerdictArtifactV1, } from './review-verdict.js';
|
|
5
|
+
export declare const ARTIFACT_CONTRACT_REFS: readonly ["wr.contracts.assessment", "wr.contracts.loop_control", "wr.contracts.coordinator_signal", "wr.contracts.review_verdict"];
|
|
4
6
|
export type ArtifactContractRef = (typeof ARTIFACT_CONTRACT_REFS)[number];
|
|
5
7
|
export declare function isValidContractRef(ref: string): ref is ArtifactContractRef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ARTIFACT_CONTRACT_REFS = exports.findLoopControlArtifact = exports.parseLoopControlArtifact = exports.isLoopControlArtifact = exports.LoopControlArtifactV1Schema = exports.LoopControlMetadataV1Schema = exports.LoopControlDecisionSchema = exports.LOOP_CONTROL_CONTRACT_REF = exports.parseAssessmentArtifact = exports.isAssessmentArtifact = exports.AssessmentDimensionSubmissionSchema = exports.AssessmentArtifactV1Schema = exports.ASSESSMENT_CONTRACT_REF = void 0;
|
|
3
|
+
exports.ARTIFACT_CONTRACT_REFS = exports.parseReviewVerdictArtifact = exports.isReviewVerdictArtifact = exports.ReviewVerdictArtifactV1Schema = exports.REVIEW_VERDICT_CONTRACT_REF = exports.parseCoordinatorSignalArtifact = exports.isCoordinatorSignalArtifact = exports.CoordinatorSignalArtifactV1Schema = exports.CoordinatorSignalKindSchema = exports.COORDINATOR_SIGNAL_CONTRACT_REF = exports.findLoopControlArtifact = exports.parseLoopControlArtifact = exports.isLoopControlArtifact = exports.LoopControlArtifactV1Schema = exports.LoopControlMetadataV1Schema = exports.LoopControlDecisionSchema = exports.LOOP_CONTROL_CONTRACT_REF = exports.parseAssessmentArtifact = exports.isAssessmentArtifact = exports.AssessmentDimensionSubmissionSchema = exports.AssessmentArtifactV1Schema = exports.ASSESSMENT_CONTRACT_REF = void 0;
|
|
4
4
|
exports.isValidContractRef = isValidContractRef;
|
|
5
5
|
var assessment_js_1 = require("./assessment.js");
|
|
6
6
|
Object.defineProperty(exports, "ASSESSMENT_CONTRACT_REF", { enumerable: true, get: function () { return assessment_js_1.ASSESSMENT_CONTRACT_REF; } });
|
|
@@ -16,9 +16,22 @@ Object.defineProperty(exports, "LoopControlArtifactV1Schema", { enumerable: true
|
|
|
16
16
|
Object.defineProperty(exports, "isLoopControlArtifact", { enumerable: true, get: function () { return loop_control_js_1.isLoopControlArtifact; } });
|
|
17
17
|
Object.defineProperty(exports, "parseLoopControlArtifact", { enumerable: true, get: function () { return loop_control_js_1.parseLoopControlArtifact; } });
|
|
18
18
|
Object.defineProperty(exports, "findLoopControlArtifact", { enumerable: true, get: function () { return loop_control_js_1.findLoopControlArtifact; } });
|
|
19
|
+
var coordinator_signal_js_1 = require("./coordinator-signal.js");
|
|
20
|
+
Object.defineProperty(exports, "COORDINATOR_SIGNAL_CONTRACT_REF", { enumerable: true, get: function () { return coordinator_signal_js_1.COORDINATOR_SIGNAL_CONTRACT_REF; } });
|
|
21
|
+
Object.defineProperty(exports, "CoordinatorSignalKindSchema", { enumerable: true, get: function () { return coordinator_signal_js_1.CoordinatorSignalKindSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "CoordinatorSignalArtifactV1Schema", { enumerable: true, get: function () { return coordinator_signal_js_1.CoordinatorSignalArtifactV1Schema; } });
|
|
23
|
+
Object.defineProperty(exports, "isCoordinatorSignalArtifact", { enumerable: true, get: function () { return coordinator_signal_js_1.isCoordinatorSignalArtifact; } });
|
|
24
|
+
Object.defineProperty(exports, "parseCoordinatorSignalArtifact", { enumerable: true, get: function () { return coordinator_signal_js_1.parseCoordinatorSignalArtifact; } });
|
|
25
|
+
var review_verdict_js_1 = require("./review-verdict.js");
|
|
26
|
+
Object.defineProperty(exports, "REVIEW_VERDICT_CONTRACT_REF", { enumerable: true, get: function () { return review_verdict_js_1.REVIEW_VERDICT_CONTRACT_REF; } });
|
|
27
|
+
Object.defineProperty(exports, "ReviewVerdictArtifactV1Schema", { enumerable: true, get: function () { return review_verdict_js_1.ReviewVerdictArtifactV1Schema; } });
|
|
28
|
+
Object.defineProperty(exports, "isReviewVerdictArtifact", { enumerable: true, get: function () { return review_verdict_js_1.isReviewVerdictArtifact; } });
|
|
29
|
+
Object.defineProperty(exports, "parseReviewVerdictArtifact", { enumerable: true, get: function () { return review_verdict_js_1.parseReviewVerdictArtifact; } });
|
|
19
30
|
exports.ARTIFACT_CONTRACT_REFS = [
|
|
20
31
|
'wr.contracts.assessment',
|
|
21
32
|
'wr.contracts.loop_control',
|
|
33
|
+
'wr.contracts.coordinator_signal',
|
|
34
|
+
'wr.contracts.review_verdict',
|
|
22
35
|
];
|
|
23
36
|
function isValidContractRef(ref) {
|
|
24
37
|
return exports.ARTIFACT_CONTRACT_REFS.includes(ref);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const REVIEW_VERDICT_CONTRACT_REF: "wr.contracts.review_verdict";
|
|
3
|
+
export declare const ReviewVerdictArtifactV1Schema: z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<"wr.review_verdict">;
|
|
5
|
+
verdict: z.ZodEnum<["clean", "minor", "blocking"]>;
|
|
6
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
7
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
8
|
+
severity: z.ZodEnum<["critical", "major", "minor", "nit"]>;
|
|
9
|
+
summary: z.ZodString;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
summary: string;
|
|
12
|
+
severity: "minor" | "critical" | "major" | "nit";
|
|
13
|
+
}, {
|
|
14
|
+
summary: string;
|
|
15
|
+
severity: "minor" | "critical" | "major" | "nit";
|
|
16
|
+
}>, "many">;
|
|
17
|
+
summary: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
kind: "wr.review_verdict";
|
|
20
|
+
summary: string;
|
|
21
|
+
confidence: "high" | "medium" | "low";
|
|
22
|
+
verdict: "clean" | "minor" | "blocking";
|
|
23
|
+
findings: {
|
|
24
|
+
summary: string;
|
|
25
|
+
severity: "minor" | "critical" | "major" | "nit";
|
|
26
|
+
}[];
|
|
27
|
+
}, {
|
|
28
|
+
kind: "wr.review_verdict";
|
|
29
|
+
summary: string;
|
|
30
|
+
confidence: "high" | "medium" | "low";
|
|
31
|
+
verdict: "clean" | "minor" | "blocking";
|
|
32
|
+
findings: {
|
|
33
|
+
summary: string;
|
|
34
|
+
severity: "minor" | "critical" | "major" | "nit";
|
|
35
|
+
}[];
|
|
36
|
+
}>;
|
|
37
|
+
export type ReviewVerdictArtifactV1 = z.infer<typeof ReviewVerdictArtifactV1Schema>;
|
|
38
|
+
export declare function isReviewVerdictArtifact(artifact: unknown): artifact is {
|
|
39
|
+
readonly kind: 'wr.review_verdict';
|
|
40
|
+
};
|
|
41
|
+
export declare function parseReviewVerdictArtifact(artifact: unknown): ReviewVerdictArtifactV1 | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReviewVerdictArtifactV1Schema = exports.REVIEW_VERDICT_CONTRACT_REF = void 0;
|
|
4
|
+
exports.isReviewVerdictArtifact = isReviewVerdictArtifact;
|
|
5
|
+
exports.parseReviewVerdictArtifact = parseReviewVerdictArtifact;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
exports.REVIEW_VERDICT_CONTRACT_REF = 'wr.contracts.review_verdict';
|
|
8
|
+
exports.ReviewVerdictArtifactV1Schema = zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
kind: zod_1.z.literal('wr.review_verdict'),
|
|
11
|
+
verdict: zod_1.z.enum(['clean', 'minor', 'blocking']),
|
|
12
|
+
confidence: zod_1.z.enum(['high', 'medium', 'low']),
|
|
13
|
+
findings: zod_1.z.array(zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
severity: zod_1.z.enum(['critical', 'major', 'minor', 'nit']),
|
|
16
|
+
summary: zod_1.z.string().min(1),
|
|
17
|
+
})
|
|
18
|
+
.strict()),
|
|
19
|
+
summary: zod_1.z.string().min(1),
|
|
20
|
+
})
|
|
21
|
+
.strict();
|
|
22
|
+
function isReviewVerdictArtifact(artifact) {
|
|
23
|
+
return (typeof artifact === 'object' &&
|
|
24
|
+
artifact !== null &&
|
|
25
|
+
artifact.kind === 'wr.review_verdict');
|
|
26
|
+
}
|
|
27
|
+
function parseReviewVerdictArtifact(artifact) {
|
|
28
|
+
const result = exports.ReviewVerdictArtifactV1Schema.safeParse(artifact);
|
|
29
|
+
return result.success ? result.data : null;
|
|
30
|
+
}
|