issue-flow 0.9.0 → 0.11.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/{analyze-VSWAEVN3.js → analyze-7B5TORNK.js} +13 -8
- package/dist/analyze-7B5TORNK.js.map +1 -0
- package/dist/apply-WUJHDD7A.js +788 -0
- package/dist/apply-WUJHDD7A.js.map +1 -0
- package/dist/{chunk-NB6WKTBL.js → chunk-3BOHTH4V.js} +2 -2
- package/dist/chunk-3D4A4B46.js +2 -0
- package/dist/chunk-47VIN33V.js +983 -0
- package/dist/chunk-47VIN33V.js.map +1 -0
- package/dist/{chunk-DP43WJY4.js → chunk-6N7LZZ5U.js} +19 -13
- package/dist/chunk-6N7LZZ5U.js.map +1 -0
- package/dist/{chunk-KXAG24DD.js → chunk-AAY6KM7N.js} +6 -3
- package/dist/chunk-AAY6KM7N.js.map +1 -0
- package/dist/{chunk-VNKSMWDN.js → chunk-GANSDJV7.js} +4 -4
- package/dist/{chunk-57MH6RYJ.js → chunk-HC2MT7BX.js} +249 -181
- package/dist/chunk-HC2MT7BX.js.map +1 -0
- package/dist/chunk-HQYXVIH6.js +110 -0
- package/dist/chunk-HQYXVIH6.js.map +1 -0
- package/dist/{chunk-66ZGYXTH.js → chunk-JW7WLSZ6.js} +15 -11
- package/dist/chunk-JW7WLSZ6.js.map +1 -0
- package/dist/{chunk-M37YZYDO.js → chunk-LVKQ2AKT.js} +3 -3
- package/dist/{chunk-TLSIK656.js → chunk-MKD2D7WE.js} +12 -8
- package/dist/chunk-MKD2D7WE.js.map +1 -0
- package/dist/{chunk-WHEU55ZP.js → chunk-MSPUB635.js} +15 -11
- package/dist/chunk-MSPUB635.js.map +1 -0
- package/dist/chunk-OBLVLIUS.js +285 -0
- package/dist/chunk-OBLVLIUS.js.map +1 -0
- package/dist/{chunk-JGKPSWOA.js → chunk-PL6CNMVS.js} +2 -2
- package/dist/chunk-RKTEV6EG.js +246 -0
- package/dist/chunk-RKTEV6EG.js.map +1 -0
- package/dist/{chunk-TJMZWRS6.js → chunk-UBIQXCVE.js} +15 -11
- package/dist/chunk-UBIQXCVE.js.map +1 -0
- package/dist/{chunk-X7XBF5TS.js → chunk-VCKX262Z.js} +12 -8
- package/dist/chunk-VCKX262Z.js.map +1 -0
- package/dist/{chunk-MTJQOOMG.js → chunk-VQ5VN7DF.js} +123 -4
- package/dist/chunk-VQ5VN7DF.js.map +1 -0
- package/dist/cli.js +32 -21
- package/dist/cli.js.map +1 -1
- package/dist/{config-J5DW6HSY.js → config-4THHOXNN.js} +7 -3
- package/dist/execute-5OEKLM5X.js +15 -0
- package/dist/{generate-ERDPOTKX.js → generate-6RA2MFJB.js} +99 -12
- package/dist/generate-6RA2MFJB.js.map +1 -0
- package/dist/init-PRMOTQ7N.js +9 -0
- package/dist/plan-KENR6MJ3.js +17 -0
- package/dist/policy-XQW5NUIE.js +117 -0
- package/dist/policy-XQW5NUIE.js.map +1 -0
- package/dist/pr-KDGKG4BP.js +21 -0
- package/dist/pr-review-CAMAB7KO.js +17 -0
- package/dist/prd-V3MWDIHK.js +17 -0
- package/dist/review-7LN47SAN.js +15 -0
- package/dist/review-7LN47SAN.js.map +1 -0
- package/dist/{run-BRBFHVUO.js → run-H75MD5BQ.js} +26 -25
- package/dist/{run-BRBFHVUO.js.map → run-H75MD5BQ.js.map} +1 -1
- package/dist/{web-WQISLO66.js → web-ANQQTTRD.js} +5 -5
- package/package.json +1 -1
- package/prompts/analyze.md +24 -0
- package/prompts/execute.md +29 -1
- package/prompts/generate.md +61 -7
- package/prompts/plan.md +24 -1
- package/prompts/pr-review.md +65 -4
- package/prompts/pr.md +37 -3
- package/prompts/prd.md +17 -0
- package/prompts/review.md +40 -0
- package/dist/analyze-VSWAEVN3.js.map +0 -1
- package/dist/chunk-57MH6RYJ.js.map +0 -1
- package/dist/chunk-66ZGYXTH.js.map +0 -1
- package/dist/chunk-DP43WJY4.js.map +0 -1
- package/dist/chunk-DTNM3LTO.js +0 -101
- package/dist/chunk-DTNM3LTO.js.map +0 -1
- package/dist/chunk-KXAG24DD.js.map +0 -1
- package/dist/chunk-M72ZEPWD.js +0 -135
- package/dist/chunk-M72ZEPWD.js.map +0 -1
- package/dist/chunk-MTJQOOMG.js.map +0 -1
- package/dist/chunk-SLHZPB3C.js +0 -50
- package/dist/chunk-SLHZPB3C.js.map +0 -1
- package/dist/chunk-TJMZWRS6.js.map +0 -1
- package/dist/chunk-TLSIK656.js.map +0 -1
- package/dist/chunk-WHEU55ZP.js.map +0 -1
- package/dist/chunk-X7XBF5TS.js.map +0 -1
- package/dist/execute-Z2DKGVLR.js +0 -14
- package/dist/generate-ERDPOTKX.js.map +0 -1
- package/dist/init-UY6ZCIFT.js +0 -9
- package/dist/plan-REMAMCX4.js +0 -16
- package/dist/pr-KERP52TI.js +0 -20
- package/dist/pr-review-IU4N3TEK.js +0 -16
- package/dist/prd-SHVQW6RM.js +0 -16
- package/dist/review-L5F77QAC.js +0 -14
- /package/dist/{chunk-NB6WKTBL.js.map → chunk-3BOHTH4V.js.map} +0 -0
- /package/dist/{config-J5DW6HSY.js.map → chunk-3D4A4B46.js.map} +0 -0
- /package/dist/{chunk-VNKSMWDN.js.map → chunk-GANSDJV7.js.map} +0 -0
- /package/dist/{chunk-M37YZYDO.js.map → chunk-LVKQ2AKT.js.map} +0 -0
- /package/dist/{chunk-JGKPSWOA.js.map → chunk-PL6CNMVS.js.map} +0 -0
- /package/dist/{execute-Z2DKGVLR.js.map → config-4THHOXNN.js.map} +0 -0
- /package/dist/{init-UY6ZCIFT.js.map → execute-5OEKLM5X.js.map} +0 -0
- /package/dist/{plan-REMAMCX4.js.map → init-PRMOTQ7N.js.map} +0 -0
- /package/dist/{pr-KERP52TI.js.map → plan-KENR6MJ3.js.map} +0 -0
- /package/dist/{pr-review-IU4N3TEK.js.map → pr-KDGKG4BP.js.map} +0 -0
- /package/dist/{prd-SHVQW6RM.js.map → pr-review-CAMAB7KO.js.map} +0 -0
- /package/dist/{review-L5F77QAC.js.map → prd-V3MWDIHK.js.map} +0 -0
- /package/dist/{web-WQISLO66.js.map → web-ANQQTTRD.js.map} +0 -0
- /package/web/{CLAUDE.md → AGENTS.md} +0 -0
|
@@ -1,16 +1,82 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// src/schemas.ts
|
|
3
|
+
// src/policy/schemas.ts
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var policyDiscoveryConfigSchema = z.object({
|
|
6
|
+
issueTemplates: z.boolean().default(true),
|
|
7
|
+
pullRequestTemplate: z.boolean().default(true),
|
|
8
|
+
docs: z.boolean().default(true),
|
|
9
|
+
codeowners: z.boolean().default(true),
|
|
10
|
+
labels: z.boolean().default(true),
|
|
11
|
+
issueTypes: z.boolean().default(true)
|
|
12
|
+
});
|
|
13
|
+
var policyIssuesDeclarationSchema = z.object({
|
|
14
|
+
titleConvention: z.string().min(1).optional(),
|
|
15
|
+
/**
|
|
16
|
+
* Whether Issue Flow may create a label the repository does not have.
|
|
17
|
+
*
|
|
18
|
+
* `.optional()` rather than `.default(false)`: the resolved declarations must
|
|
19
|
+
* stay "only what was written", or the group would always look declared and
|
|
20
|
+
* `sources` would report a provenance nobody asked for. The effective default
|
|
21
|
+
* — false — lives at the call site.
|
|
22
|
+
*
|
|
23
|
+
* That default is a deliberate change of behaviour: creating taxonomy without
|
|
24
|
+
* asking is the defect this exists to stop. A repository that wants the old
|
|
25
|
+
* behaviour opts back into it.
|
|
26
|
+
*/
|
|
27
|
+
allowLabelCreation: z.boolean().optional()
|
|
28
|
+
});
|
|
29
|
+
var policyPullRequestsDeclarationSchema = z.object({
|
|
30
|
+
baseBranch: z.string().min(1).optional(),
|
|
31
|
+
titleConvention: z.string().min(1).optional()
|
|
32
|
+
});
|
|
33
|
+
var policyGitDeclarationSchema = z.object({
|
|
34
|
+
branchConvention: z.string().min(1).optional(),
|
|
35
|
+
commitConvention: z.string().min(1).optional()
|
|
36
|
+
});
|
|
37
|
+
var policyConfigSchema = z.object({
|
|
38
|
+
enabled: z.boolean().default(true),
|
|
39
|
+
/**
|
|
40
|
+
* Token budget for the `__REPO_POLICY__` projection. Sections above it are
|
|
41
|
+
* replaced whole by a pointer rather than truncated — see
|
|
42
|
+
* `policy/placeholders.ts`.
|
|
43
|
+
*/
|
|
44
|
+
contextBudget: z.number().int().positive().default(1500),
|
|
45
|
+
discovery: policyDiscoveryConfigSchema.prefault({}),
|
|
46
|
+
issues: policyIssuesDeclarationSchema.prefault({}),
|
|
47
|
+
pullRequests: policyPullRequestsDeclarationSchema.prefault({}),
|
|
48
|
+
git: policyGitDeclarationSchema.prefault({})
|
|
49
|
+
});
|
|
50
|
+
var policyConfigInputSchema = z.object({
|
|
51
|
+
enabled: z.boolean().optional(),
|
|
52
|
+
contextBudget: z.number().int().positive().optional(),
|
|
53
|
+
// Spelled out rather than `policyDiscoveryConfigSchema.partial()`: in zod 4
|
|
54
|
+
// a `.default()` survives `.partial()`, so every toggle would come back
|
|
55
|
+
// materialized and the input layer would stop meaning "what the user wrote".
|
|
56
|
+
discovery: z.object({
|
|
57
|
+
issueTemplates: z.boolean().optional(),
|
|
58
|
+
pullRequestTemplate: z.boolean().optional(),
|
|
59
|
+
docs: z.boolean().optional(),
|
|
60
|
+
codeowners: z.boolean().optional(),
|
|
61
|
+
labels: z.boolean().optional(),
|
|
62
|
+
issueTypes: z.boolean().optional()
|
|
63
|
+
}).optional(),
|
|
64
|
+
issues: z.object({ titleConvention: z.string().nullish(), allowLabelCreation: z.boolean().optional() }).optional(),
|
|
65
|
+
pullRequests: z.object({ baseBranch: z.string().nullish(), titleConvention: z.string().nullish() }).optional(),
|
|
66
|
+
git: z.object({ branchConvention: z.string().nullish(), commitConvention: z.string().nullish() }).optional()
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// src/schemas.ts
|
|
70
|
+
import { z as z2 } from "zod";
|
|
71
|
+
var claudeUsageSchema = z2.object({
|
|
72
|
+
inputTokens: z2.number().optional(),
|
|
73
|
+
outputTokens: z2.number().optional(),
|
|
74
|
+
cacheReadTokens: z2.number().optional(),
|
|
75
|
+
cacheCreationTokens: z2.number().optional(),
|
|
76
|
+
costUsd: z2.number().optional()
|
|
11
77
|
});
|
|
12
|
-
var userStoryStatusSchema =
|
|
13
|
-
var storyStageSchema =
|
|
78
|
+
var userStoryStatusSchema = z2.enum(["backlog", "in_progress", "in_review", "done"]);
|
|
79
|
+
var storyStageSchema = z2.enum([
|
|
14
80
|
"pending",
|
|
15
81
|
"executing",
|
|
16
82
|
"awaiting_review",
|
|
@@ -19,195 +85,195 @@ var storyStageSchema = z.enum([
|
|
|
19
85
|
"done",
|
|
20
86
|
"failed"
|
|
21
87
|
]);
|
|
22
|
-
var userStorySchema =
|
|
23
|
-
id:
|
|
24
|
-
title:
|
|
25
|
-
description:
|
|
26
|
-
acceptanceCriteria:
|
|
27
|
-
priority:
|
|
28
|
-
passes:
|
|
29
|
-
notes:
|
|
88
|
+
var userStorySchema = z2.object({
|
|
89
|
+
id: z2.string(),
|
|
90
|
+
title: z2.string(),
|
|
91
|
+
description: z2.string(),
|
|
92
|
+
acceptanceCriteria: z2.array(z2.string()),
|
|
93
|
+
priority: z2.number().int().positive(),
|
|
94
|
+
passes: z2.boolean(),
|
|
95
|
+
notes: z2.string(),
|
|
30
96
|
...claudeUsageSchema.shape,
|
|
31
|
-
durationSeconds:
|
|
97
|
+
durationSeconds: z2.number().optional(),
|
|
32
98
|
status: userStoryStatusSchema.optional(),
|
|
33
|
-
dependencies:
|
|
99
|
+
dependencies: z2.array(z2.string()).optional(),
|
|
34
100
|
stage: storyStageSchema.optional(),
|
|
35
|
-
stageSince:
|
|
36
|
-
stageDetail:
|
|
101
|
+
stageSince: z2.string().optional(),
|
|
102
|
+
stageDetail: z2.string().optional()
|
|
37
103
|
});
|
|
38
|
-
var pipelineStateSchema =
|
|
39
|
-
analyzeCompleted:
|
|
40
|
-
prdCompleted:
|
|
41
|
-
jsonCompleted:
|
|
42
|
-
executionCompleted:
|
|
43
|
-
reviewCompleted:
|
|
44
|
-
prCreated:
|
|
45
|
-
prReviewCompleted:
|
|
104
|
+
var pipelineStateSchema = z2.object({
|
|
105
|
+
analyzeCompleted: z2.boolean().optional(),
|
|
106
|
+
prdCompleted: z2.boolean(),
|
|
107
|
+
jsonCompleted: z2.boolean(),
|
|
108
|
+
executionCompleted: z2.boolean(),
|
|
109
|
+
reviewCompleted: z2.boolean(),
|
|
110
|
+
prCreated: z2.boolean(),
|
|
111
|
+
prReviewCompleted: z2.boolean().optional()
|
|
46
112
|
});
|
|
47
|
-
var pullRequestRefSchema =
|
|
48
|
-
number:
|
|
49
|
-
url:
|
|
50
|
-
headBranch:
|
|
51
|
-
createdAt:
|
|
113
|
+
var pullRequestRefSchema = z2.object({
|
|
114
|
+
number: z2.number().int().positive(),
|
|
115
|
+
url: z2.string(),
|
|
116
|
+
headBranch: z2.string(),
|
|
117
|
+
createdAt: z2.string()
|
|
52
118
|
});
|
|
53
|
-
var prReviewRecommendationSchema =
|
|
119
|
+
var prReviewRecommendationSchema = z2.enum([
|
|
54
120
|
"APPROVE",
|
|
55
121
|
"APPROVE_WITH_SUGGESTIONS",
|
|
56
122
|
"REQUEST_CHANGES"
|
|
57
123
|
]);
|
|
58
|
-
var prReviewStateSchema =
|
|
59
|
-
enabled:
|
|
60
|
-
pullRequestNumber:
|
|
61
|
-
rounds:
|
|
124
|
+
var prReviewStateSchema = z2.object({
|
|
125
|
+
enabled: z2.boolean().default(false),
|
|
126
|
+
pullRequestNumber: z2.number().int().positive().optional(),
|
|
127
|
+
rounds: z2.number().int().min(0).default(0),
|
|
62
128
|
lastRecommendation: prReviewRecommendationSchema.optional(),
|
|
63
|
-
lastReviewedAt:
|
|
129
|
+
lastReviewedAt: z2.string().optional()
|
|
64
130
|
});
|
|
65
|
-
var lastErrorSchema =
|
|
66
|
-
category:
|
|
67
|
-
message:
|
|
68
|
-
at:
|
|
131
|
+
var lastErrorSchema = z2.object({
|
|
132
|
+
category: z2.string(),
|
|
133
|
+
message: z2.string(),
|
|
134
|
+
at: z2.string()
|
|
69
135
|
});
|
|
70
|
-
var issueMetadataSchema =
|
|
71
|
-
schemaVersion:
|
|
72
|
-
id:
|
|
73
|
-
number:
|
|
74
|
-
source:
|
|
75
|
-
title:
|
|
76
|
-
labels:
|
|
77
|
-
state:
|
|
78
|
-
createdAt:
|
|
79
|
-
updatedAt:
|
|
80
|
-
contentHash:
|
|
81
|
-
remote:
|
|
82
|
-
provider:
|
|
83
|
-
ref:
|
|
84
|
-
syncedAt:
|
|
85
|
-
syncedContentHash:
|
|
136
|
+
var issueMetadataSchema = z2.object({
|
|
137
|
+
schemaVersion: z2.literal(1),
|
|
138
|
+
id: z2.string().min(1),
|
|
139
|
+
number: z2.number().int().positive().nullable(),
|
|
140
|
+
source: z2.enum(["github", "local"]),
|
|
141
|
+
title: z2.string(),
|
|
142
|
+
labels: z2.array(z2.string()),
|
|
143
|
+
state: z2.enum(["open", "closed"]),
|
|
144
|
+
createdAt: z2.string(),
|
|
145
|
+
updatedAt: z2.string(),
|
|
146
|
+
contentHash: z2.string(),
|
|
147
|
+
remote: z2.object({
|
|
148
|
+
provider: z2.enum(["github", "local"]),
|
|
149
|
+
ref: z2.string(),
|
|
150
|
+
syncedAt: z2.string(),
|
|
151
|
+
syncedContentHash: z2.string()
|
|
86
152
|
}).optional()
|
|
87
153
|
});
|
|
88
|
-
var taskPlanSchema =
|
|
89
|
-
project:
|
|
90
|
-
issueNumber:
|
|
91
|
-
issueUrl:
|
|
92
|
-
branchName:
|
|
93
|
-
noBranch:
|
|
94
|
-
description:
|
|
95
|
-
issueStatus:
|
|
96
|
-
completedAt:
|
|
97
|
-
lastAttemptAt:
|
|
154
|
+
var taskPlanSchema = z2.object({
|
|
155
|
+
project: z2.string(),
|
|
156
|
+
issueNumber: z2.union([z2.number().int().positive(), z2.string().min(1)]),
|
|
157
|
+
issueUrl: z2.string().optional().default(""),
|
|
158
|
+
branchName: z2.string(),
|
|
159
|
+
noBranch: z2.boolean().optional().default(false),
|
|
160
|
+
description: z2.string(),
|
|
161
|
+
issueStatus: z2.enum(["pending", "in_progress", "completed"]),
|
|
162
|
+
completedAt: z2.string().nullable(),
|
|
163
|
+
lastAttemptAt: z2.string().nullable(),
|
|
98
164
|
lastError: lastErrorSchema.nullable(),
|
|
99
|
-
correctionCycle:
|
|
100
|
-
maxCorrectionCycles:
|
|
165
|
+
correctionCycle: z2.number().int().min(0),
|
|
166
|
+
maxCorrectionCycles: z2.number().int().min(0),
|
|
101
167
|
/**
|
|
102
168
|
* Findings from the most recent failed review, verbatim. Non-null means the
|
|
103
169
|
* issue has a pending correction even if every userStories[].passes is
|
|
104
170
|
* already true — the execute phase must address these before the field is
|
|
105
171
|
* cleared back to null. See core/engine.ts's early-return guards.
|
|
106
172
|
*/
|
|
107
|
-
lastReviewFindings:
|
|
173
|
+
lastReviewFindings: z2.string().nullable().optional().default(null),
|
|
108
174
|
pipeline: pipelineStateSchema,
|
|
109
175
|
pullRequest: pullRequestRefSchema.optional(),
|
|
110
176
|
prReview: prReviewStateSchema.optional(),
|
|
111
|
-
userStories:
|
|
177
|
+
userStories: z2.array(userStorySchema)
|
|
112
178
|
});
|
|
113
|
-
var headlessResultSchema =
|
|
114
|
-
success:
|
|
115
|
-
result:
|
|
179
|
+
var headlessResultSchema = z2.object({
|
|
180
|
+
success: z2.boolean(),
|
|
181
|
+
result: z2.string(),
|
|
116
182
|
cost: claudeUsageSchema.nullable(),
|
|
117
|
-
error:
|
|
183
|
+
error: z2.string().nullable()
|
|
118
184
|
});
|
|
119
|
-
var sessionLogEntrySchema =
|
|
120
|
-
at:
|
|
121
|
-
level:
|
|
122
|
-
message:
|
|
185
|
+
var sessionLogEntrySchema = z2.object({
|
|
186
|
+
at: z2.string(),
|
|
187
|
+
level: z2.enum(["info", "warn", "error"]),
|
|
188
|
+
message: z2.string()
|
|
123
189
|
});
|
|
124
190
|
var sessionUsageShape = {
|
|
125
|
-
inputTokens:
|
|
126
|
-
outputTokens:
|
|
127
|
-
cacheReadTokens:
|
|
128
|
-
cacheCreationTokens:
|
|
129
|
-
costUsd:
|
|
191
|
+
inputTokens: z2.number().nullable().default(null),
|
|
192
|
+
outputTokens: z2.number().nullable().default(null),
|
|
193
|
+
cacheReadTokens: z2.number().nullable().default(null),
|
|
194
|
+
cacheCreationTokens: z2.number().nullable().default(null),
|
|
195
|
+
costUsd: z2.number().nullable().default(null)
|
|
130
196
|
};
|
|
131
|
-
var sessionPhaseSchema =
|
|
132
|
-
name:
|
|
133
|
-
status:
|
|
134
|
-
startedAt:
|
|
135
|
-
endedAt:
|
|
136
|
-
durationSeconds:
|
|
137
|
-
error:
|
|
197
|
+
var sessionPhaseSchema = z2.object({
|
|
198
|
+
name: z2.string(),
|
|
199
|
+
status: z2.enum(["pending", "running", "completed", "failed"]),
|
|
200
|
+
startedAt: z2.string().nullable(),
|
|
201
|
+
endedAt: z2.string().nullable(),
|
|
202
|
+
durationSeconds: z2.number().nullable(),
|
|
203
|
+
error: z2.string().nullable(),
|
|
138
204
|
...sessionUsageShape
|
|
139
205
|
});
|
|
140
|
-
var sessionStorySchema =
|
|
141
|
-
id:
|
|
142
|
-
title:
|
|
143
|
-
priority:
|
|
144
|
-
passes:
|
|
145
|
-
completedAt:
|
|
206
|
+
var sessionStorySchema = z2.object({
|
|
207
|
+
id: z2.string(),
|
|
208
|
+
title: z2.string(),
|
|
209
|
+
priority: z2.number(),
|
|
210
|
+
passes: z2.boolean(),
|
|
211
|
+
completedAt: z2.string().nullable(),
|
|
146
212
|
// Also introduced with the metrics, hence the same tolerant default.
|
|
147
|
-
durationSeconds:
|
|
213
|
+
durationSeconds: z2.number().nullable().default(null),
|
|
148
214
|
// Snapshot fields are always present on output and defaulted on input, so a
|
|
149
215
|
// session.json written before they existed still parses. This is the mirror
|
|
150
216
|
// image of userStorySchema, where the same two fields are plainly optional.
|
|
151
217
|
status: userStoryStatusSchema.default("backlog"),
|
|
152
|
-
dependencies:
|
|
218
|
+
dependencies: z2.array(z2.string()).default([]),
|
|
153
219
|
// Published for the panel's story detail view. Same tolerant default as the
|
|
154
220
|
// fields above: absent (older session.json) and empty resolve to the same
|
|
155
221
|
// value, so the client never has to tell them apart.
|
|
156
|
-
description:
|
|
157
|
-
acceptanceCriteria:
|
|
222
|
+
description: z2.string().default(""),
|
|
223
|
+
acceptanceCriteria: z2.array(z2.string()).default([]),
|
|
158
224
|
// Additive like the rest of this schema: a session.json written before
|
|
159
225
|
// `stage` existed parses into 'pending'/null, the same values a fresh
|
|
160
226
|
// snapshot starts a story at.
|
|
161
227
|
stage: storyStageSchema.default("pending"),
|
|
162
|
-
stageSince:
|
|
163
|
-
stageDetail:
|
|
228
|
+
stageSince: z2.string().nullable().default(null),
|
|
229
|
+
stageDetail: z2.string().nullable().default(null),
|
|
164
230
|
...sessionUsageShape
|
|
165
231
|
});
|
|
166
|
-
var sessionSnapshotSchema =
|
|
167
|
-
schemaVersion:
|
|
168
|
-
sessionId:
|
|
169
|
-
readOnly:
|
|
170
|
-
capabilities:
|
|
171
|
-
issue:
|
|
172
|
-
number:
|
|
173
|
-
url:
|
|
232
|
+
var sessionSnapshotSchema = z2.object({
|
|
233
|
+
schemaVersion: z2.literal(1),
|
|
234
|
+
sessionId: z2.string().nullable(),
|
|
235
|
+
readOnly: z2.literal(true),
|
|
236
|
+
capabilities: z2.array(z2.string()),
|
|
237
|
+
issue: z2.object({
|
|
238
|
+
number: z2.number().nullable(),
|
|
239
|
+
url: z2.string().nullable(),
|
|
174
240
|
// Additive: a session.json written before the Issue section was enriched
|
|
175
241
|
// parses into the same "not reported" values createInitialSnapshot() uses.
|
|
176
|
-
title:
|
|
177
|
-
description:
|
|
178
|
-
labels:
|
|
179
|
-
state:
|
|
242
|
+
title: z2.string().nullable().default(null),
|
|
243
|
+
description: z2.string().nullable().default(null),
|
|
244
|
+
labels: z2.array(z2.string()).default([]),
|
|
245
|
+
state: z2.string().nullable().default(null)
|
|
180
246
|
}),
|
|
181
|
-
status:
|
|
182
|
-
startedAt:
|
|
183
|
-
updatedAt:
|
|
184
|
-
endedAt:
|
|
185
|
-
elapsedSeconds:
|
|
186
|
-
estimatedRemainingSeconds:
|
|
187
|
-
progress:
|
|
188
|
-
percent:
|
|
189
|
-
phasesCompleted:
|
|
190
|
-
phasesTotal:
|
|
191
|
-
storiesCompleted:
|
|
192
|
-
storiesTotal:
|
|
247
|
+
status: z2.enum(["idle", "running", "completed", "failed"]),
|
|
248
|
+
startedAt: z2.string().nullable(),
|
|
249
|
+
updatedAt: z2.string().nullable(),
|
|
250
|
+
endedAt: z2.string().nullable(),
|
|
251
|
+
elapsedSeconds: z2.number().nullable(),
|
|
252
|
+
estimatedRemainingSeconds: z2.number().nullable(),
|
|
253
|
+
progress: z2.object({
|
|
254
|
+
percent: z2.number(),
|
|
255
|
+
phasesCompleted: z2.number(),
|
|
256
|
+
phasesTotal: z2.number(),
|
|
257
|
+
storiesCompleted: z2.number(),
|
|
258
|
+
storiesTotal: z2.number()
|
|
193
259
|
}),
|
|
194
|
-
currentPhase:
|
|
195
|
-
currentActivity:
|
|
196
|
-
story:
|
|
197
|
-
tool:
|
|
198
|
-
detail:
|
|
199
|
-
since:
|
|
260
|
+
currentPhase: z2.string().nullable(),
|
|
261
|
+
currentActivity: z2.object({
|
|
262
|
+
story: z2.string().nullable(),
|
|
263
|
+
tool: z2.string().nullable(),
|
|
264
|
+
detail: z2.string().nullable(),
|
|
265
|
+
since: z2.string()
|
|
200
266
|
}).nullable(),
|
|
201
|
-
phases:
|
|
202
|
-
stories:
|
|
267
|
+
phases: z2.array(sessionPhaseSchema),
|
|
268
|
+
stories: z2.array(sessionStorySchema),
|
|
203
269
|
// The whole aggregate is additive: a snapshot from before it existed parses
|
|
204
270
|
// into the same "nothing reported" object the reducer starts from.
|
|
205
|
-
metrics:
|
|
206
|
-
totalInputTokens:
|
|
207
|
-
totalOutputTokens:
|
|
208
|
-
totalCacheReadTokens:
|
|
209
|
-
totalCacheCreationTokens:
|
|
210
|
-
totalCostUsd:
|
|
271
|
+
metrics: z2.object({
|
|
272
|
+
totalInputTokens: z2.number().nullable().default(null),
|
|
273
|
+
totalOutputTokens: z2.number().nullable().default(null),
|
|
274
|
+
totalCacheReadTokens: z2.number().nullable().default(null),
|
|
275
|
+
totalCacheCreationTokens: z2.number().nullable().default(null),
|
|
276
|
+
totalCostUsd: z2.number().nullable().default(null)
|
|
211
277
|
}).default({
|
|
212
278
|
totalInputTokens: null,
|
|
213
279
|
totalOutputTokens: null,
|
|
@@ -215,51 +281,51 @@ var sessionSnapshotSchema = z.object({
|
|
|
215
281
|
totalCacheCreationTokens: null,
|
|
216
282
|
totalCostUsd: null
|
|
217
283
|
}),
|
|
218
|
-
execution:
|
|
219
|
-
iteration:
|
|
220
|
-
retries:
|
|
221
|
-
correctionCycle:
|
|
222
|
-
maxCorrectionCycles:
|
|
284
|
+
execution: z2.object({
|
|
285
|
+
iteration: z2.number(),
|
|
286
|
+
retries: z2.number(),
|
|
287
|
+
correctionCycle: z2.number(),
|
|
288
|
+
maxCorrectionCycles: z2.number().nullable()
|
|
223
289
|
}),
|
|
224
|
-
git:
|
|
225
|
-
branch:
|
|
226
|
-
baseBranch:
|
|
227
|
-
commits:
|
|
290
|
+
git: z2.object({
|
|
291
|
+
branch: z2.string().nullable(),
|
|
292
|
+
baseBranch: z2.string().nullable(),
|
|
293
|
+
commits: z2.array(z2.object({ hash: z2.string(), subject: z2.string() }))
|
|
228
294
|
}),
|
|
229
295
|
// Additive like the metrics aggregate: a session.json written before the
|
|
230
296
|
// repository section existed parses into the same all-null object
|
|
231
297
|
// createInitialSnapshot() starts from.
|
|
232
|
-
repository:
|
|
233
|
-
name:
|
|
234
|
-
remoteUrl:
|
|
235
|
-
branch:
|
|
236
|
-
headCommit:
|
|
237
|
-
root:
|
|
298
|
+
repository: z2.object({
|
|
299
|
+
name: z2.string().nullable().default(null),
|
|
300
|
+
remoteUrl: z2.string().nullable().default(null),
|
|
301
|
+
branch: z2.string().nullable().default(null),
|
|
302
|
+
headCommit: z2.string().nullable().default(null),
|
|
303
|
+
root: z2.string().nullable().default(null)
|
|
238
304
|
}).default({ name: null, remoteUrl: null, branch: null, headCommit: null, root: null }),
|
|
239
|
-
pullRequests:
|
|
240
|
-
logs:
|
|
241
|
-
errors:
|
|
242
|
-
warnings:
|
|
243
|
-
lastError:
|
|
244
|
-
nextSteps:
|
|
245
|
-
environment:
|
|
305
|
+
pullRequests: z2.array(z2.object({ number: z2.number(), url: z2.string(), title: z2.string() })),
|
|
306
|
+
logs: z2.array(sessionLogEntrySchema),
|
|
307
|
+
errors: z2.array(sessionLogEntrySchema),
|
|
308
|
+
warnings: z2.array(sessionLogEntrySchema),
|
|
309
|
+
lastError: z2.object({ message: z2.string(), at: z2.string() }).nullable(),
|
|
310
|
+
nextSteps: z2.array(z2.string()),
|
|
311
|
+
environment: z2.object({ node: z2.string(), platform: z2.string() }).nullable()
|
|
246
312
|
});
|
|
247
|
-
var webConfigSchema =
|
|
248
|
-
enabled:
|
|
249
|
-
port:
|
|
250
|
-
host:
|
|
251
|
-
refreshSeconds:
|
|
252
|
-
logLimit:
|
|
253
|
-
includeLogs:
|
|
313
|
+
var webConfigSchema = z2.object({
|
|
314
|
+
enabled: z2.boolean().default(false),
|
|
315
|
+
port: z2.number().int().min(1).max(65535).default(3737),
|
|
316
|
+
host: z2.string().min(1).default("0.0.0.0"),
|
|
317
|
+
refreshSeconds: z2.number().positive().default(5),
|
|
318
|
+
logLimit: z2.number().int().positive().default(200),
|
|
319
|
+
includeLogs: z2.boolean().default(true)
|
|
254
320
|
});
|
|
255
|
-
var issuesConfigSchema =
|
|
256
|
-
defaultGenerateTarget:
|
|
257
|
-
preferredProvider:
|
|
258
|
-
conflictPolicy:
|
|
259
|
-
requireConfirmation:
|
|
321
|
+
var issuesConfigSchema = z2.object({
|
|
322
|
+
defaultGenerateTarget: z2.enum(["github", "local", "both"]).default("github"),
|
|
323
|
+
preferredProvider: z2.enum(["github", "local"]).default("github"),
|
|
324
|
+
conflictPolicy: z2.enum(["ask", "prefer-local", "prefer-github"]).default("ask"),
|
|
325
|
+
requireConfirmation: z2.boolean().default(true)
|
|
260
326
|
});
|
|
261
|
-
var prReviewConfigSchema =
|
|
262
|
-
publisher:
|
|
327
|
+
var prReviewConfigSchema = z2.object({
|
|
328
|
+
publisher: z2.enum(["local"]).default("local")
|
|
263
329
|
});
|
|
264
330
|
|
|
265
331
|
// src/core/session-state.ts
|
|
@@ -1259,6 +1325,8 @@ var ElapsedTimer = class {
|
|
|
1259
1325
|
};
|
|
1260
1326
|
|
|
1261
1327
|
export {
|
|
1328
|
+
policyConfigSchema,
|
|
1329
|
+
policyConfigInputSchema,
|
|
1262
1330
|
pullRequestRefSchema,
|
|
1263
1331
|
issueMetadataSchema,
|
|
1264
1332
|
taskPlanSchema,
|
|
@@ -1312,4 +1380,4 @@ export {
|
|
|
1312
1380
|
formatDuration,
|
|
1313
1381
|
ElapsedTimer
|
|
1314
1382
|
};
|
|
1315
|
-
//# sourceMappingURL=chunk-
|
|
1383
|
+
//# sourceMappingURL=chunk-HC2MT7BX.js.map
|