@ai-dev-orchestrator/schemas 0.1.1
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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/artifacts/agreement-artifacts.d.ts +311 -0
- package/dist/artifacts/agreement-artifacts.js +48 -0
- package/dist/artifacts/artifact-dependency-graph.d.ts +775 -0
- package/dist/artifacts/artifact-dependency-graph.js +57 -0
- package/dist/artifacts/artifact-system.d.ts +657 -0
- package/dist/artifacts/artifact-system.js +124 -0
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +3 -0
- package/dist/config/configuration.d.ts +324 -0
- package/dist/config/configuration.js +93 -0
- package/dist/config/event-bus-config.d.ts +153 -0
- package/dist/config/event-bus-config.js +27 -0
- package/dist/config/event-payloads.d.ts +919 -0
- package/dist/config/event-payloads.js +304 -0
- package/dist/config/event-system.d.ts +3231 -0
- package/dist/config/event-system.js +428 -0
- package/dist/config/event-types.d.ts +62 -0
- package/dist/config/event-types.js +66 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.js +5 -0
- package/dist/dashboard/dashboard-api.d.ts +149 -0
- package/dist/dashboard/dashboard-api.js +80 -0
- package/dist/dashboard/dashboard-domain.d.ts +1076 -0
- package/dist/dashboard/dashboard-domain.js +305 -0
- package/dist/dashboard/index.d.ts +3 -0
- package/dist/dashboard/index.js +3 -0
- package/dist/dashboard/run-creation-params.d.ts +111 -0
- package/dist/dashboard/run-creation-params.js +14 -0
- package/dist/governance/governance.d.ts +1119 -0
- package/dist/governance/governance.js +111 -0
- package/dist/governance/index.d.ts +3 -0
- package/dist/governance/index.js +3 -0
- package/dist/governance/policy-engine.d.ts +634 -0
- package/dist/governance/policy-engine.js +214 -0
- package/dist/governance/review-resolution.d.ts +1053 -0
- package/dist/governance/review-resolution.js +67 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/observability/diagnostics.d.ts +185 -0
- package/dist/observability/diagnostics.js +63 -0
- package/dist/observability/index.d.ts +2 -0
- package/dist/observability/index.js +2 -0
- package/dist/observability/metrics.d.ts +187 -0
- package/dist/observability/metrics.js +67 -0
- package/dist/persistence/execution-analytics.d.ts +173 -0
- package/dist/persistence/execution-analytics.js +71 -0
- package/dist/persistence/index.d.ts +5 -0
- package/dist/persistence/index.js +5 -0
- package/dist/persistence/project-context.d.ts +164 -0
- package/dist/persistence/project-context.js +88 -0
- package/dist/persistence/repository-model.d.ts +27 -0
- package/dist/persistence/repository-model.js +16 -0
- package/dist/persistence/run-manifest.d.ts +422 -0
- package/dist/persistence/run-manifest.js +118 -0
- package/dist/persistence/state-persistence.d.ts +276 -0
- package/dist/persistence/state-persistence.js +83 -0
- package/dist/runner/built-in-runner-ids.d.ts +8 -0
- package/dist/runner/built-in-runner-ids.js +11 -0
- package/dist/runner/collaboration-model.d.ts +100 -0
- package/dist/runner/collaboration-model.js +19 -0
- package/dist/runner/confidence.d.ts +17 -0
- package/dist/runner/confidence.js +11 -0
- package/dist/runner/index.d.ts +8 -0
- package/dist/runner/index.js +8 -0
- package/dist/runner/permission-approval.d.ts +38 -0
- package/dist/runner/permission-approval.js +14 -0
- package/dist/runner/prompt-engine.d.ts +1467 -0
- package/dist/runner/prompt-engine.js +193 -0
- package/dist/runner/role-system.d.ts +458 -0
- package/dist/runner/role-system.js +94 -0
- package/dist/runner/runner-system.d.ts +1721 -0
- package/dist/runner/runner-system.js +268 -0
- package/dist/runner/task-brief.d.ts +18 -0
- package/dist/runner/task-brief.js +12 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/shared.d.ts +30 -0
- package/dist/shared/shared.js +27 -0
- package/dist/shared/string-enums.d.ts +59 -0
- package/dist/shared/string-enums.js +24 -0
- package/dist/shared/utils.d.ts +25 -0
- package/dist/shared/utils.js +22 -0
- package/dist/specification/canonical-specification.d.ts +475 -0
- package/dist/specification/canonical-specification.js +151 -0
- package/dist/specification/index.d.ts +3 -0
- package/dist/specification/index.js +3 -0
- package/dist/specification/intake.d.ts +419 -0
- package/dist/specification/intake.js +70 -0
- package/dist/specification/iteration-contracts.d.ts +421 -0
- package/dist/specification/iteration-contracts.js +61 -0
- package/dist/workflow/index.d.ts +4 -0
- package/dist/workflow/index.js +4 -0
- package/dist/workflow/workflow-dsl.d.ts +81 -0
- package/dist/workflow/workflow-dsl.js +38 -0
- package/dist/workflow/workflow-engine.d.ts +5788 -0
- package/dist/workflow/workflow-engine.js +414 -0
- package/dist/workflow/workflow-file.d.ts +331 -0
- package/dist/workflow/workflow-file.js +41 -0
- package/dist/workflow/workflow-journal.d.ts +520 -0
- package/dist/workflow/workflow-journal.js +151 -0
- package/package.json +39 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { artifactRefSchema } from '../artifacts/artifact-system';
|
|
3
|
+
import { runIdSchema } from '../shared/shared';
|
|
4
|
+
export const policyTokenUsageSchema = z.object({
|
|
5
|
+
inputTokens: z.number(),
|
|
6
|
+
outputTokens: z.number(),
|
|
7
|
+
totalTokens: z.number(),
|
|
8
|
+
});
|
|
9
|
+
export const humanApprovalSchema = z.object({
|
|
10
|
+
approvedBy: z.string(),
|
|
11
|
+
timestamp: z.string(),
|
|
12
|
+
conditions: z.string().optional(),
|
|
13
|
+
artifactRef: artifactRefSchema.optional(),
|
|
14
|
+
});
|
|
15
|
+
const ESCALATION_REASONS = [
|
|
16
|
+
'iteration_limit_exceeded',
|
|
17
|
+
'quality_gate_failed',
|
|
18
|
+
'unresolvable_conflict',
|
|
19
|
+
'human_requested',
|
|
20
|
+
'token_budget_exceeded',
|
|
21
|
+
'retry_limit_exceeded',
|
|
22
|
+
'confidence_too_low',
|
|
23
|
+
];
|
|
24
|
+
export const escalationReasonSchema = z.enum(ESCALATION_REASONS);
|
|
25
|
+
const ESCALATION_TRIGGERS = [
|
|
26
|
+
...ESCALATION_REASONS,
|
|
27
|
+
'provider_failure',
|
|
28
|
+
'timeout',
|
|
29
|
+
'unrecoverable_error',
|
|
30
|
+
];
|
|
31
|
+
export const escalationTriggerSchema = z.enum(ESCALATION_TRIGGERS);
|
|
32
|
+
export const findingSummarySchema = z.object({
|
|
33
|
+
id: z.string(),
|
|
34
|
+
severity: z.string(),
|
|
35
|
+
status: z.string(),
|
|
36
|
+
description: z.string(),
|
|
37
|
+
resolutionRef: artifactRefSchema.optional(),
|
|
38
|
+
});
|
|
39
|
+
export const iterationSummarySchema = z.object({
|
|
40
|
+
iteration: z.number(),
|
|
41
|
+
producerArtifact: artifactRefSchema,
|
|
42
|
+
reviewerArtifact: artifactRefSchema,
|
|
43
|
+
findingsProduced: z.number(),
|
|
44
|
+
findingsResolved: z.number(),
|
|
45
|
+
findingsRemaining: z.number(),
|
|
46
|
+
});
|
|
47
|
+
export const escalationContextSchema = z.object({
|
|
48
|
+
runId: runIdSchema,
|
|
49
|
+
stageId: z.string(),
|
|
50
|
+
reason: escalationReasonSchema,
|
|
51
|
+
iterationHistory: z.array(iterationSummarySchema).readonly(),
|
|
52
|
+
unresolvedFindings: z.array(findingSummarySchema).readonly(),
|
|
53
|
+
artifactRefs: z.array(artifactRefSchema).readonly(),
|
|
54
|
+
suggestedActions: z.array(z.string()).readonly(),
|
|
55
|
+
});
|
|
56
|
+
export const transitionAllowedSchema = z.object({
|
|
57
|
+
allowed: z.literal(true),
|
|
58
|
+
reason: z.string(),
|
|
59
|
+
});
|
|
60
|
+
export const transitionDeniedSchema = z.object({
|
|
61
|
+
allowed: z.literal(false),
|
|
62
|
+
reason: z.string(),
|
|
63
|
+
remediation: z.string(),
|
|
64
|
+
});
|
|
65
|
+
export const transitionEscalatedSchema = z.object({
|
|
66
|
+
escalate: z.literal(true),
|
|
67
|
+
reason: z.string(),
|
|
68
|
+
context: escalationContextSchema,
|
|
69
|
+
});
|
|
70
|
+
export const transitionDecisionSchema = z.union([
|
|
71
|
+
transitionAllowedSchema,
|
|
72
|
+
transitionDeniedSchema,
|
|
73
|
+
transitionEscalatedSchema,
|
|
74
|
+
]);
|
|
75
|
+
export const transitionRequestSchema = z.object({
|
|
76
|
+
runId: runIdSchema,
|
|
77
|
+
from: z.string(),
|
|
78
|
+
to: z.string(),
|
|
79
|
+
artifacts: z.array(artifactRefSchema).readonly(),
|
|
80
|
+
iterationCount: z.number().optional(),
|
|
81
|
+
findings: z.array(findingSummarySchema).readonly().optional(),
|
|
82
|
+
humanApproval: humanApprovalSchema.optional(),
|
|
83
|
+
tokenUsage: policyTokenUsageSchema.optional(),
|
|
84
|
+
});
|
|
85
|
+
export const agreementStatusSchema = z.object({
|
|
86
|
+
exists: z.boolean(),
|
|
87
|
+
valid: z.boolean(),
|
|
88
|
+
artifact: artifactRefSchema.optional(),
|
|
89
|
+
missingReason: z.string().optional(),
|
|
90
|
+
});
|
|
91
|
+
export const policyCheckOutcomeSchema = z.enum(['pass', 'fail', 'skip']);
|
|
92
|
+
export const policyEvaluationSchema = z.object({
|
|
93
|
+
policy: z.string(),
|
|
94
|
+
evaluated: z.boolean(),
|
|
95
|
+
result: policyCheckOutcomeSchema,
|
|
96
|
+
detail: z.string(),
|
|
97
|
+
escalationTrigger: escalationTriggerSchema.optional(),
|
|
98
|
+
});
|
|
99
|
+
export const governanceOutcomeSchema = z.enum(['allowed', 'denied', 'escalated']);
|
|
100
|
+
export const governanceDecisionSchema = z.object({
|
|
101
|
+
timestamp: z.string(),
|
|
102
|
+
runId: runIdSchema,
|
|
103
|
+
transitionRequested: z.object({
|
|
104
|
+
from: z.string(),
|
|
105
|
+
to: z.string(),
|
|
106
|
+
}),
|
|
107
|
+
policiesEvaluated: z.array(policyEvaluationSchema).readonly(),
|
|
108
|
+
outcome: governanceOutcomeSchema,
|
|
109
|
+
reason: z.string(),
|
|
110
|
+
artifactsInspected: z.array(artifactRefSchema).readonly(),
|
|
111
|
+
});
|