@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,173 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const distributionSummarySchema: z.ZodObject<{
|
|
3
|
+
p50: z.ZodNumber;
|
|
4
|
+
p75: z.ZodNumber;
|
|
5
|
+
p90: z.ZodNumber;
|
|
6
|
+
max: z.ZodNumber;
|
|
7
|
+
ema: z.ZodNumber;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type DistributionSummary = z.infer<typeof distributionSummarySchema>;
|
|
10
|
+
export declare const errorFrequencySchema: z.ZodObject<{
|
|
11
|
+
type: z.ZodEnum<{
|
|
12
|
+
timeout: "timeout";
|
|
13
|
+
agent_error: "agent_error";
|
|
14
|
+
invalid_output: "invalid_output";
|
|
15
|
+
schema_violation: "schema_violation";
|
|
16
|
+
ownership_violation: "ownership_violation";
|
|
17
|
+
cancelled: "cancelled";
|
|
18
|
+
}>;
|
|
19
|
+
frequency: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type ErrorFrequency = z.infer<typeof errorFrequencySchema>;
|
|
22
|
+
export declare const executionProfileSchema: z.ZodObject<{
|
|
23
|
+
roleId: z.ZodString;
|
|
24
|
+
model: z.ZodString;
|
|
25
|
+
sampleSize: z.ZodNumber;
|
|
26
|
+
lastUpdated: z.ZodString;
|
|
27
|
+
tokenUsage: z.ZodObject<{
|
|
28
|
+
inputTokens: z.ZodObject<{
|
|
29
|
+
p50: z.ZodNumber;
|
|
30
|
+
p75: z.ZodNumber;
|
|
31
|
+
p90: z.ZodNumber;
|
|
32
|
+
max: z.ZodNumber;
|
|
33
|
+
ema: z.ZodNumber;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
outputTokens: z.ZodObject<{
|
|
36
|
+
p50: z.ZodNumber;
|
|
37
|
+
p75: z.ZodNumber;
|
|
38
|
+
p90: z.ZodNumber;
|
|
39
|
+
max: z.ZodNumber;
|
|
40
|
+
ema: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
reliability: z.ZodObject<{
|
|
44
|
+
successRate: z.ZodNumber;
|
|
45
|
+
failureRate: z.ZodNumber;
|
|
46
|
+
avgRetries: z.ZodNumber;
|
|
47
|
+
retryableFailureRate: z.ZodNumber;
|
|
48
|
+
commonErrorTypes: z.ZodArray<z.ZodObject<{
|
|
49
|
+
type: z.ZodEnum<{
|
|
50
|
+
timeout: "timeout";
|
|
51
|
+
agent_error: "agent_error";
|
|
52
|
+
invalid_output: "invalid_output";
|
|
53
|
+
schema_violation: "schema_violation";
|
|
54
|
+
ownership_violation: "ownership_violation";
|
|
55
|
+
cancelled: "cancelled";
|
|
56
|
+
}>;
|
|
57
|
+
frequency: z.ZodNumber;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
timing: z.ZodObject<{
|
|
61
|
+
durationMs: z.ZodObject<{
|
|
62
|
+
p50: z.ZodNumber;
|
|
63
|
+
p75: z.ZodNumber;
|
|
64
|
+
p90: z.ZodNumber;
|
|
65
|
+
max: z.ZodNumber;
|
|
66
|
+
ema: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
confidence: z.ZodObject<{
|
|
70
|
+
avgConfidence: z.ZodNumber;
|
|
71
|
+
escalationRate: z.ZodNumber;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export type ExecutionProfile = z.infer<typeof executionProfileSchema>;
|
|
75
|
+
export declare const workerOutcomeRecordSchema: z.ZodObject<{
|
|
76
|
+
roleId: z.ZodString;
|
|
77
|
+
model: z.ZodString;
|
|
78
|
+
inputTokens: z.ZodNumber;
|
|
79
|
+
outputTokens: z.ZodNumber;
|
|
80
|
+
durationMs: z.ZodNumber;
|
|
81
|
+
retryCount: z.ZodNumber;
|
|
82
|
+
status: z.ZodEnum<{
|
|
83
|
+
success: "success";
|
|
84
|
+
failure: "failure";
|
|
85
|
+
}>;
|
|
86
|
+
errorType: z.ZodNullable<z.ZodEnum<{
|
|
87
|
+
timeout: "timeout";
|
|
88
|
+
agent_error: "agent_error";
|
|
89
|
+
invalid_output: "invalid_output";
|
|
90
|
+
schema_violation: "schema_violation";
|
|
91
|
+
ownership_violation: "ownership_violation";
|
|
92
|
+
cancelled: "cancelled";
|
|
93
|
+
}>>;
|
|
94
|
+
confidenceScore: z.ZodNullable<z.ZodNumber>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export type WorkerOutcomeRecord = z.infer<typeof workerOutcomeRecordSchema>;
|
|
97
|
+
export declare const executionProfileStoreSchema: z.ZodObject<{
|
|
98
|
+
profiles: z.ZodArray<z.ZodObject<{
|
|
99
|
+
roleId: z.ZodString;
|
|
100
|
+
model: z.ZodString;
|
|
101
|
+
sampleSize: z.ZodNumber;
|
|
102
|
+
lastUpdated: z.ZodString;
|
|
103
|
+
tokenUsage: z.ZodObject<{
|
|
104
|
+
inputTokens: z.ZodObject<{
|
|
105
|
+
p50: z.ZodNumber;
|
|
106
|
+
p75: z.ZodNumber;
|
|
107
|
+
p90: z.ZodNumber;
|
|
108
|
+
max: z.ZodNumber;
|
|
109
|
+
ema: z.ZodNumber;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
outputTokens: z.ZodObject<{
|
|
112
|
+
p50: z.ZodNumber;
|
|
113
|
+
p75: z.ZodNumber;
|
|
114
|
+
p90: z.ZodNumber;
|
|
115
|
+
max: z.ZodNumber;
|
|
116
|
+
ema: z.ZodNumber;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
reliability: z.ZodObject<{
|
|
120
|
+
successRate: z.ZodNumber;
|
|
121
|
+
failureRate: z.ZodNumber;
|
|
122
|
+
avgRetries: z.ZodNumber;
|
|
123
|
+
retryableFailureRate: z.ZodNumber;
|
|
124
|
+
commonErrorTypes: z.ZodArray<z.ZodObject<{
|
|
125
|
+
type: z.ZodEnum<{
|
|
126
|
+
timeout: "timeout";
|
|
127
|
+
agent_error: "agent_error";
|
|
128
|
+
invalid_output: "invalid_output";
|
|
129
|
+
schema_violation: "schema_violation";
|
|
130
|
+
ownership_violation: "ownership_violation";
|
|
131
|
+
cancelled: "cancelled";
|
|
132
|
+
}>;
|
|
133
|
+
frequency: z.ZodNumber;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
timing: z.ZodObject<{
|
|
137
|
+
durationMs: z.ZodObject<{
|
|
138
|
+
p50: z.ZodNumber;
|
|
139
|
+
p75: z.ZodNumber;
|
|
140
|
+
p90: z.ZodNumber;
|
|
141
|
+
max: z.ZodNumber;
|
|
142
|
+
ema: z.ZodNumber;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
confidence: z.ZodObject<{
|
|
146
|
+
avgConfidence: z.ZodNumber;
|
|
147
|
+
escalationRate: z.ZodNumber;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
lastUpdated: z.ZodString;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
export type ExecutionProfileStore = z.infer<typeof executionProfileStoreSchema>;
|
|
153
|
+
export declare const staticConfigBaselineSchema: z.ZodObject<{
|
|
154
|
+
maxOutputTokens: z.ZodNumber;
|
|
155
|
+
maxRetries: z.ZodNumber;
|
|
156
|
+
timeoutMs: z.ZodNumber;
|
|
157
|
+
modelMaxTokens: z.ZodNumber;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export type StaticConfigBaseline = z.infer<typeof staticConfigBaselineSchema>;
|
|
160
|
+
export declare const adaptiveConfigSchema: z.ZodObject<{
|
|
161
|
+
recommendedMaxOutputTokens: z.ZodNullable<z.ZodNumber>;
|
|
162
|
+
recommendedMaxRetries: z.ZodNullable<z.ZodNumber>;
|
|
163
|
+
recommendedTimeoutMs: z.ZodNullable<z.ZodNumber>;
|
|
164
|
+
modelEscalation: z.ZodObject<{
|
|
165
|
+
recommended: z.ZodBoolean;
|
|
166
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
basis: z.ZodObject<{
|
|
169
|
+
sampleSize: z.ZodNumber;
|
|
170
|
+
profileAge: z.ZodString;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
export type AdaptiveConfig = z.infer<typeof adaptiveConfigSchema>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { workerErrorTypeSchema } from '../runner/runner-system';
|
|
3
|
+
export const distributionSummarySchema = z.object({
|
|
4
|
+
p50: z.number(),
|
|
5
|
+
p75: z.number(),
|
|
6
|
+
p90: z.number(),
|
|
7
|
+
max: z.number(),
|
|
8
|
+
ema: z.number(),
|
|
9
|
+
});
|
|
10
|
+
export const errorFrequencySchema = z.object({
|
|
11
|
+
type: workerErrorTypeSchema,
|
|
12
|
+
frequency: z.number().min(0).max(1),
|
|
13
|
+
});
|
|
14
|
+
export const executionProfileSchema = z.object({
|
|
15
|
+
roleId: z.string(),
|
|
16
|
+
model: z.string(),
|
|
17
|
+
sampleSize: z.number().int().nonnegative(),
|
|
18
|
+
lastUpdated: z.string(),
|
|
19
|
+
tokenUsage: z.object({
|
|
20
|
+
inputTokens: distributionSummarySchema,
|
|
21
|
+
outputTokens: distributionSummarySchema,
|
|
22
|
+
}),
|
|
23
|
+
reliability: z.object({
|
|
24
|
+
successRate: z.number().min(0).max(1),
|
|
25
|
+
failureRate: z.number().min(0).max(1),
|
|
26
|
+
avgRetries: z.number().nonnegative(),
|
|
27
|
+
retryableFailureRate: z.number().min(0).max(1),
|
|
28
|
+
commonErrorTypes: z.array(errorFrequencySchema),
|
|
29
|
+
}),
|
|
30
|
+
timing: z.object({
|
|
31
|
+
durationMs: distributionSummarySchema,
|
|
32
|
+
}),
|
|
33
|
+
confidence: z.object({
|
|
34
|
+
avgConfidence: z.number().min(0).max(1),
|
|
35
|
+
escalationRate: z.number().min(0).max(1),
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
export const workerOutcomeRecordSchema = z.object({
|
|
39
|
+
roleId: z.string(),
|
|
40
|
+
model: z.string(),
|
|
41
|
+
inputTokens: z.number().nonnegative(),
|
|
42
|
+
outputTokens: z.number().nonnegative(),
|
|
43
|
+
durationMs: z.number().nonnegative(),
|
|
44
|
+
retryCount: z.number().int().nonnegative(),
|
|
45
|
+
status: z.enum(['success', 'failure']),
|
|
46
|
+
errorType: workerErrorTypeSchema.nullable(),
|
|
47
|
+
confidenceScore: z.number().min(0).max(1).nullable(),
|
|
48
|
+
});
|
|
49
|
+
export const executionProfileStoreSchema = z.object({
|
|
50
|
+
profiles: z.array(executionProfileSchema),
|
|
51
|
+
lastUpdated: z.string(),
|
|
52
|
+
});
|
|
53
|
+
export const staticConfigBaselineSchema = z.object({
|
|
54
|
+
maxOutputTokens: z.number(),
|
|
55
|
+
maxRetries: z.number(),
|
|
56
|
+
timeoutMs: z.number(),
|
|
57
|
+
modelMaxTokens: z.number(),
|
|
58
|
+
});
|
|
59
|
+
export const adaptiveConfigSchema = z.object({
|
|
60
|
+
recommendedMaxOutputTokens: z.number().nullable(),
|
|
61
|
+
recommendedMaxRetries: z.number().nullable(),
|
|
62
|
+
recommendedTimeoutMs: z.number().nullable(),
|
|
63
|
+
modelEscalation: z.object({
|
|
64
|
+
recommended: z.boolean(),
|
|
65
|
+
reason: z.string().nullable(),
|
|
66
|
+
}),
|
|
67
|
+
basis: z.object({
|
|
68
|
+
sampleSize: z.number(),
|
|
69
|
+
profileAge: z.string(),
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const contextCategorySchema: z.ZodEnum<{
|
|
3
|
+
codebase: "codebase";
|
|
4
|
+
run_history: "run_history";
|
|
5
|
+
preferences: "preferences";
|
|
6
|
+
analytics: "analytics";
|
|
7
|
+
}>;
|
|
8
|
+
export type ContextCategory = z.infer<typeof contextCategorySchema>;
|
|
9
|
+
export declare const moduleInfoSchema: z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
purpose: z.ZodString;
|
|
12
|
+
keyAbstractions: z.ZodArray<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type ModuleInfo = z.infer<typeof moduleInfoSchema>;
|
|
15
|
+
export declare const patternInfoSchema: z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
description: z.ZodString;
|
|
18
|
+
discoveredInRun: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type PatternInfo = z.infer<typeof patternInfoSchema>;
|
|
21
|
+
export declare const conventionInfoSchema: z.ZodObject<{
|
|
22
|
+
rule: z.ZodString;
|
|
23
|
+
evidence: z.ZodString;
|
|
24
|
+
discoveredInRun: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type ConventionInfo = z.infer<typeof conventionInfoSchema>;
|
|
27
|
+
export declare const codebaseContextSchema: z.ZodObject<{
|
|
28
|
+
projectName: z.ZodString;
|
|
29
|
+
lastUpdated: z.ZodString;
|
|
30
|
+
lastRunId: z.ZodString;
|
|
31
|
+
architecture: z.ZodObject<{
|
|
32
|
+
summary: z.ZodString;
|
|
33
|
+
modules: z.ZodArray<z.ZodObject<{
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
purpose: z.ZodString;
|
|
36
|
+
keyAbstractions: z.ZodArray<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
patterns: z.ZodArray<z.ZodObject<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
description: z.ZodString;
|
|
41
|
+
discoveredInRun: z.ZodString;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
conventions: z.ZodArray<z.ZodObject<{
|
|
45
|
+
rule: z.ZodString;
|
|
46
|
+
evidence: z.ZodString;
|
|
47
|
+
discoveredInRun: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type CodebaseContext = z.infer<typeof codebaseContextSchema>;
|
|
51
|
+
export declare const runHistoryEntrySchema: z.ZodObject<{
|
|
52
|
+
runId: z.ZodString;
|
|
53
|
+
timestamp: z.ZodString;
|
|
54
|
+
workflowVariant: z.ZodString;
|
|
55
|
+
taskSummary: z.ZodString;
|
|
56
|
+
outcome: z.ZodEnum<{
|
|
57
|
+
escalated: "escalated";
|
|
58
|
+
completed: "completed";
|
|
59
|
+
failed: "failed";
|
|
60
|
+
aborted: "aborted";
|
|
61
|
+
}>;
|
|
62
|
+
compressed: z.ZodBoolean;
|
|
63
|
+
keyFindings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
confidenceScore: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
modelUsed: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type RunHistoryEntry = z.infer<typeof runHistoryEntrySchema>;
|
|
68
|
+
export declare const runHistorySchema: z.ZodObject<{
|
|
69
|
+
lastUpdated: z.ZodString;
|
|
70
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
71
|
+
runId: z.ZodString;
|
|
72
|
+
timestamp: z.ZodString;
|
|
73
|
+
workflowVariant: z.ZodString;
|
|
74
|
+
taskSummary: z.ZodString;
|
|
75
|
+
outcome: z.ZodEnum<{
|
|
76
|
+
escalated: "escalated";
|
|
77
|
+
completed: "completed";
|
|
78
|
+
failed: "failed";
|
|
79
|
+
aborted: "aborted";
|
|
80
|
+
}>;
|
|
81
|
+
compressed: z.ZodBoolean;
|
|
82
|
+
keyFindings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
confidenceScore: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
modelUsed: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export type RunHistory = z.infer<typeof runHistorySchema>;
|
|
88
|
+
export declare const modelCalibrationEntrySchema: z.ZodObject<{
|
|
89
|
+
roleId: z.ZodString;
|
|
90
|
+
model: z.ZodString;
|
|
91
|
+
successRate: z.ZodNumber;
|
|
92
|
+
avgConfidence: z.ZodNumber;
|
|
93
|
+
escalationRate: z.ZodNumber;
|
|
94
|
+
sampleSize: z.ZodNumber;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export type ModelCalibrationEntry = z.infer<typeof modelCalibrationEntrySchema>;
|
|
97
|
+
export declare const failurePatternSchema: z.ZodObject<{
|
|
98
|
+
pattern: z.ZodString;
|
|
99
|
+
frequency: z.ZodNumber;
|
|
100
|
+
lastSeen: z.ZodString;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export type FailurePattern = z.infer<typeof failurePatternSchema>;
|
|
103
|
+
export declare const projectPreferenceSchema: z.ZodObject<{
|
|
104
|
+
key: z.ZodString;
|
|
105
|
+
value: z.ZodString;
|
|
106
|
+
discoveredInRun: z.ZodString;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type ProjectPreference = z.infer<typeof projectPreferenceSchema>;
|
|
109
|
+
export declare const learnedPreferencesSchema: z.ZodObject<{
|
|
110
|
+
lastUpdated: z.ZodString;
|
|
111
|
+
modelCalibration: z.ZodArray<z.ZodObject<{
|
|
112
|
+
roleId: z.ZodString;
|
|
113
|
+
model: z.ZodString;
|
|
114
|
+
successRate: z.ZodNumber;
|
|
115
|
+
avgConfidence: z.ZodNumber;
|
|
116
|
+
escalationRate: z.ZodNumber;
|
|
117
|
+
sampleSize: z.ZodNumber;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
failurePatterns: z.ZodArray<z.ZodObject<{
|
|
120
|
+
pattern: z.ZodString;
|
|
121
|
+
frequency: z.ZodNumber;
|
|
122
|
+
lastSeen: z.ZodString;
|
|
123
|
+
}, z.core.$strip>>;
|
|
124
|
+
projectPreferences: z.ZodArray<z.ZodObject<{
|
|
125
|
+
key: z.ZodString;
|
|
126
|
+
value: z.ZodString;
|
|
127
|
+
discoveredInRun: z.ZodString;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
export type LearnedPreferences = z.infer<typeof learnedPreferencesSchema>;
|
|
131
|
+
export declare const contextDocumentSchema: z.ZodObject<{
|
|
132
|
+
category: z.ZodEnum<{
|
|
133
|
+
codebase: "codebase";
|
|
134
|
+
run_history: "run_history";
|
|
135
|
+
preferences: "preferences";
|
|
136
|
+
analytics: "analytics";
|
|
137
|
+
}>;
|
|
138
|
+
content: z.ZodUnknown;
|
|
139
|
+
lastUpdated: z.ZodString;
|
|
140
|
+
lastRunId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
export type ContextDocument = z.infer<typeof contextDocumentSchema>;
|
|
143
|
+
export declare const contextQuerySchema: z.ZodObject<{
|
|
144
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
145
|
+
codebase: "codebase";
|
|
146
|
+
run_history: "run_history";
|
|
147
|
+
preferences: "preferences";
|
|
148
|
+
analytics: "analytics";
|
|
149
|
+
}>>>;
|
|
150
|
+
role: z.ZodOptional<z.ZodString>;
|
|
151
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
export type ContextQuery = z.infer<typeof contextQuerySchema>;
|
|
154
|
+
export declare const contextFragmentSchema: z.ZodObject<{
|
|
155
|
+
category: z.ZodEnum<{
|
|
156
|
+
codebase: "codebase";
|
|
157
|
+
run_history: "run_history";
|
|
158
|
+
preferences: "preferences";
|
|
159
|
+
analytics: "analytics";
|
|
160
|
+
}>;
|
|
161
|
+
content: z.ZodString;
|
|
162
|
+
relevanceScore: z.ZodNumber;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
export type ContextFragment = z.infer<typeof contextFragmentSchema>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export const contextCategorySchema = z.enum([
|
|
3
|
+
'codebase',
|
|
4
|
+
'run_history',
|
|
5
|
+
'preferences',
|
|
6
|
+
'analytics',
|
|
7
|
+
]);
|
|
8
|
+
export const moduleInfoSchema = z.object({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
purpose: z.string(),
|
|
11
|
+
keyAbstractions: z.array(z.string()),
|
|
12
|
+
});
|
|
13
|
+
export const patternInfoSchema = z.object({
|
|
14
|
+
name: z.string(),
|
|
15
|
+
description: z.string(),
|
|
16
|
+
discoveredInRun: z.string(),
|
|
17
|
+
});
|
|
18
|
+
export const conventionInfoSchema = z.object({
|
|
19
|
+
rule: z.string(),
|
|
20
|
+
evidence: z.string(),
|
|
21
|
+
discoveredInRun: z.string(),
|
|
22
|
+
});
|
|
23
|
+
export const codebaseContextSchema = z.object({
|
|
24
|
+
projectName: z.string(),
|
|
25
|
+
lastUpdated: z.string(),
|
|
26
|
+
lastRunId: z.string(),
|
|
27
|
+
architecture: z.object({
|
|
28
|
+
summary: z.string(),
|
|
29
|
+
modules: z.array(moduleInfoSchema),
|
|
30
|
+
patterns: z.array(patternInfoSchema),
|
|
31
|
+
}),
|
|
32
|
+
conventions: z.array(conventionInfoSchema),
|
|
33
|
+
});
|
|
34
|
+
export const runHistoryEntrySchema = z.object({
|
|
35
|
+
runId: z.string(),
|
|
36
|
+
timestamp: z.string(),
|
|
37
|
+
workflowVariant: z.string(),
|
|
38
|
+
taskSummary: z.string(),
|
|
39
|
+
outcome: z.enum(['completed', 'failed', 'aborted', 'escalated']),
|
|
40
|
+
compressed: z.boolean(),
|
|
41
|
+
keyFindings: z.array(z.string()).optional(),
|
|
42
|
+
confidenceScore: z.number().min(0).max(1).optional(),
|
|
43
|
+
modelUsed: z.string().optional(),
|
|
44
|
+
});
|
|
45
|
+
export const runHistorySchema = z.object({
|
|
46
|
+
lastUpdated: z.string(),
|
|
47
|
+
runs: z.array(runHistoryEntrySchema),
|
|
48
|
+
});
|
|
49
|
+
export const modelCalibrationEntrySchema = z.object({
|
|
50
|
+
roleId: z.string(),
|
|
51
|
+
model: z.string(),
|
|
52
|
+
successRate: z.number().min(0).max(1),
|
|
53
|
+
avgConfidence: z.number().min(0).max(1),
|
|
54
|
+
escalationRate: z.number().min(0).max(1),
|
|
55
|
+
sampleSize: z.number().int().nonnegative(),
|
|
56
|
+
});
|
|
57
|
+
export const failurePatternSchema = z.object({
|
|
58
|
+
pattern: z.string(),
|
|
59
|
+
frequency: z.number().int().nonnegative(),
|
|
60
|
+
lastSeen: z.string(),
|
|
61
|
+
});
|
|
62
|
+
export const projectPreferenceSchema = z.object({
|
|
63
|
+
key: z.string(),
|
|
64
|
+
value: z.string(),
|
|
65
|
+
discoveredInRun: z.string(),
|
|
66
|
+
});
|
|
67
|
+
export const learnedPreferencesSchema = z.object({
|
|
68
|
+
lastUpdated: z.string(),
|
|
69
|
+
modelCalibration: z.array(modelCalibrationEntrySchema),
|
|
70
|
+
failurePatterns: z.array(failurePatternSchema),
|
|
71
|
+
projectPreferences: z.array(projectPreferenceSchema),
|
|
72
|
+
});
|
|
73
|
+
export const contextDocumentSchema = z.object({
|
|
74
|
+
category: contextCategorySchema,
|
|
75
|
+
content: z.unknown(),
|
|
76
|
+
lastUpdated: z.string(),
|
|
77
|
+
lastRunId: z.string().optional(),
|
|
78
|
+
});
|
|
79
|
+
export const contextQuerySchema = z.object({
|
|
80
|
+
categories: z.array(contextCategorySchema).optional(),
|
|
81
|
+
role: z.string().optional(),
|
|
82
|
+
maxTokens: z.number().optional(),
|
|
83
|
+
});
|
|
84
|
+
export const contextFragmentSchema = z.object({
|
|
85
|
+
category: contextCategorySchema,
|
|
86
|
+
content: z.string(),
|
|
87
|
+
relevanceScore: z.number().min(0).max(1),
|
|
88
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const discoveredRunStatusSchema: z.ZodEnum<{
|
|
3
|
+
completed: "completed";
|
|
4
|
+
aborted: "aborted";
|
|
5
|
+
active: "active";
|
|
6
|
+
}>;
|
|
7
|
+
export type DiscoveredRunStatus = z.infer<typeof discoveredRunStatusSchema>;
|
|
8
|
+
export declare const discoveryResultSchema: z.ZodObject<{
|
|
9
|
+
found: z.ZodBoolean;
|
|
10
|
+
repoRoot: z.ZodOptional<z.ZodString>;
|
|
11
|
+
aiConfigDir: z.ZodOptional<z.ZodString>;
|
|
12
|
+
gitRoot: z.ZodOptional<z.ZodString>;
|
|
13
|
+
errors: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type DiscoveryResult = z.infer<typeof discoveryResultSchema>;
|
|
16
|
+
export declare const runDirectoryInfoSchema: z.ZodObject<{
|
|
17
|
+
runId: z.ZodString;
|
|
18
|
+
path: z.ZodString;
|
|
19
|
+
createdAt: z.ZodString;
|
|
20
|
+
sizeBytes: z.ZodNumber;
|
|
21
|
+
status: z.ZodEnum<{
|
|
22
|
+
completed: "completed";
|
|
23
|
+
aborted: "aborted";
|
|
24
|
+
active: "active";
|
|
25
|
+
}>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type RunDirectoryInfo = z.infer<typeof runDirectoryInfoSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export const discoveredRunStatusSchema = z.enum(['active', 'completed', 'aborted']);
|
|
3
|
+
export const discoveryResultSchema = z.object({
|
|
4
|
+
found: z.boolean(),
|
|
5
|
+
repoRoot: z.string().optional(),
|
|
6
|
+
aiConfigDir: z.string().optional(),
|
|
7
|
+
gitRoot: z.string().optional(),
|
|
8
|
+
errors: z.array(z.string()).readonly().optional(),
|
|
9
|
+
});
|
|
10
|
+
export const runDirectoryInfoSchema = z.object({
|
|
11
|
+
runId: z.string(),
|
|
12
|
+
path: z.string(),
|
|
13
|
+
createdAt: z.string(),
|
|
14
|
+
sizeBytes: z.number(),
|
|
15
|
+
status: discoveredRunStatusSchema,
|
|
16
|
+
});
|