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.
Files changed (100) hide show
  1. package/dist/{analyze-VSWAEVN3.js → analyze-7B5TORNK.js} +13 -8
  2. package/dist/analyze-7B5TORNK.js.map +1 -0
  3. package/dist/apply-WUJHDD7A.js +788 -0
  4. package/dist/apply-WUJHDD7A.js.map +1 -0
  5. package/dist/{chunk-NB6WKTBL.js → chunk-3BOHTH4V.js} +2 -2
  6. package/dist/chunk-3D4A4B46.js +2 -0
  7. package/dist/chunk-47VIN33V.js +983 -0
  8. package/dist/chunk-47VIN33V.js.map +1 -0
  9. package/dist/{chunk-DP43WJY4.js → chunk-6N7LZZ5U.js} +19 -13
  10. package/dist/chunk-6N7LZZ5U.js.map +1 -0
  11. package/dist/{chunk-KXAG24DD.js → chunk-AAY6KM7N.js} +6 -3
  12. package/dist/chunk-AAY6KM7N.js.map +1 -0
  13. package/dist/{chunk-VNKSMWDN.js → chunk-GANSDJV7.js} +4 -4
  14. package/dist/{chunk-57MH6RYJ.js → chunk-HC2MT7BX.js} +249 -181
  15. package/dist/chunk-HC2MT7BX.js.map +1 -0
  16. package/dist/chunk-HQYXVIH6.js +110 -0
  17. package/dist/chunk-HQYXVIH6.js.map +1 -0
  18. package/dist/{chunk-66ZGYXTH.js → chunk-JW7WLSZ6.js} +15 -11
  19. package/dist/chunk-JW7WLSZ6.js.map +1 -0
  20. package/dist/{chunk-M37YZYDO.js → chunk-LVKQ2AKT.js} +3 -3
  21. package/dist/{chunk-TLSIK656.js → chunk-MKD2D7WE.js} +12 -8
  22. package/dist/chunk-MKD2D7WE.js.map +1 -0
  23. package/dist/{chunk-WHEU55ZP.js → chunk-MSPUB635.js} +15 -11
  24. package/dist/chunk-MSPUB635.js.map +1 -0
  25. package/dist/chunk-OBLVLIUS.js +285 -0
  26. package/dist/chunk-OBLVLIUS.js.map +1 -0
  27. package/dist/{chunk-JGKPSWOA.js → chunk-PL6CNMVS.js} +2 -2
  28. package/dist/chunk-RKTEV6EG.js +246 -0
  29. package/dist/chunk-RKTEV6EG.js.map +1 -0
  30. package/dist/{chunk-TJMZWRS6.js → chunk-UBIQXCVE.js} +15 -11
  31. package/dist/chunk-UBIQXCVE.js.map +1 -0
  32. package/dist/{chunk-X7XBF5TS.js → chunk-VCKX262Z.js} +12 -8
  33. package/dist/chunk-VCKX262Z.js.map +1 -0
  34. package/dist/{chunk-MTJQOOMG.js → chunk-VQ5VN7DF.js} +123 -4
  35. package/dist/chunk-VQ5VN7DF.js.map +1 -0
  36. package/dist/cli.js +32 -21
  37. package/dist/cli.js.map +1 -1
  38. package/dist/{config-J5DW6HSY.js → config-4THHOXNN.js} +7 -3
  39. package/dist/execute-5OEKLM5X.js +15 -0
  40. package/dist/{generate-ERDPOTKX.js → generate-6RA2MFJB.js} +99 -12
  41. package/dist/generate-6RA2MFJB.js.map +1 -0
  42. package/dist/init-PRMOTQ7N.js +9 -0
  43. package/dist/plan-KENR6MJ3.js +17 -0
  44. package/dist/policy-XQW5NUIE.js +117 -0
  45. package/dist/policy-XQW5NUIE.js.map +1 -0
  46. package/dist/pr-KDGKG4BP.js +21 -0
  47. package/dist/pr-review-CAMAB7KO.js +17 -0
  48. package/dist/prd-V3MWDIHK.js +17 -0
  49. package/dist/review-7LN47SAN.js +15 -0
  50. package/dist/review-7LN47SAN.js.map +1 -0
  51. package/dist/{run-BRBFHVUO.js → run-H75MD5BQ.js} +26 -25
  52. package/dist/{run-BRBFHVUO.js.map → run-H75MD5BQ.js.map} +1 -1
  53. package/dist/{web-WQISLO66.js → web-ANQQTTRD.js} +5 -5
  54. package/package.json +1 -1
  55. package/prompts/analyze.md +24 -0
  56. package/prompts/execute.md +29 -1
  57. package/prompts/generate.md +61 -7
  58. package/prompts/plan.md +24 -1
  59. package/prompts/pr-review.md +65 -4
  60. package/prompts/pr.md +37 -3
  61. package/prompts/prd.md +17 -0
  62. package/prompts/review.md +40 -0
  63. package/dist/analyze-VSWAEVN3.js.map +0 -1
  64. package/dist/chunk-57MH6RYJ.js.map +0 -1
  65. package/dist/chunk-66ZGYXTH.js.map +0 -1
  66. package/dist/chunk-DP43WJY4.js.map +0 -1
  67. package/dist/chunk-DTNM3LTO.js +0 -101
  68. package/dist/chunk-DTNM3LTO.js.map +0 -1
  69. package/dist/chunk-KXAG24DD.js.map +0 -1
  70. package/dist/chunk-M72ZEPWD.js +0 -135
  71. package/dist/chunk-M72ZEPWD.js.map +0 -1
  72. package/dist/chunk-MTJQOOMG.js.map +0 -1
  73. package/dist/chunk-SLHZPB3C.js +0 -50
  74. package/dist/chunk-SLHZPB3C.js.map +0 -1
  75. package/dist/chunk-TJMZWRS6.js.map +0 -1
  76. package/dist/chunk-TLSIK656.js.map +0 -1
  77. package/dist/chunk-WHEU55ZP.js.map +0 -1
  78. package/dist/chunk-X7XBF5TS.js.map +0 -1
  79. package/dist/execute-Z2DKGVLR.js +0 -14
  80. package/dist/generate-ERDPOTKX.js.map +0 -1
  81. package/dist/init-UY6ZCIFT.js +0 -9
  82. package/dist/plan-REMAMCX4.js +0 -16
  83. package/dist/pr-KERP52TI.js +0 -20
  84. package/dist/pr-review-IU4N3TEK.js +0 -16
  85. package/dist/prd-SHVQW6RM.js +0 -16
  86. package/dist/review-L5F77QAC.js +0 -14
  87. /package/dist/{chunk-NB6WKTBL.js.map → chunk-3BOHTH4V.js.map} +0 -0
  88. /package/dist/{config-J5DW6HSY.js.map → chunk-3D4A4B46.js.map} +0 -0
  89. /package/dist/{chunk-VNKSMWDN.js.map → chunk-GANSDJV7.js.map} +0 -0
  90. /package/dist/{chunk-M37YZYDO.js.map → chunk-LVKQ2AKT.js.map} +0 -0
  91. /package/dist/{chunk-JGKPSWOA.js.map → chunk-PL6CNMVS.js.map} +0 -0
  92. /package/dist/{execute-Z2DKGVLR.js.map → config-4THHOXNN.js.map} +0 -0
  93. /package/dist/{init-UY6ZCIFT.js.map → execute-5OEKLM5X.js.map} +0 -0
  94. /package/dist/{plan-REMAMCX4.js.map → init-PRMOTQ7N.js.map} +0 -0
  95. /package/dist/{pr-KERP52TI.js.map → plan-KENR6MJ3.js.map} +0 -0
  96. /package/dist/{pr-review-IU4N3TEK.js.map → pr-KDGKG4BP.js.map} +0 -0
  97. /package/dist/{prd-SHVQW6RM.js.map → pr-review-CAMAB7KO.js.map} +0 -0
  98. /package/dist/{review-L5F77QAC.js.map → prd-V3MWDIHK.js.map} +0 -0
  99. /package/dist/{web-WQISLO66.js.map → web-ANQQTTRD.js.map} +0 -0
  100. /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 claudeUsageSchema = z.object({
6
- inputTokens: z.number().optional(),
7
- outputTokens: z.number().optional(),
8
- cacheReadTokens: z.number().optional(),
9
- cacheCreationTokens: z.number().optional(),
10
- costUsd: z.number().optional()
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 = z.enum(["backlog", "in_progress", "in_review", "done"]);
13
- var storyStageSchema = z.enum([
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 = z.object({
23
- id: z.string(),
24
- title: z.string(),
25
- description: z.string(),
26
- acceptanceCriteria: z.array(z.string()),
27
- priority: z.number().int().positive(),
28
- passes: z.boolean(),
29
- notes: z.string(),
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: z.number().optional(),
97
+ durationSeconds: z2.number().optional(),
32
98
  status: userStoryStatusSchema.optional(),
33
- dependencies: z.array(z.string()).optional(),
99
+ dependencies: z2.array(z2.string()).optional(),
34
100
  stage: storyStageSchema.optional(),
35
- stageSince: z.string().optional(),
36
- stageDetail: z.string().optional()
101
+ stageSince: z2.string().optional(),
102
+ stageDetail: z2.string().optional()
37
103
  });
38
- var pipelineStateSchema = z.object({
39
- analyzeCompleted: z.boolean().optional(),
40
- prdCompleted: z.boolean(),
41
- jsonCompleted: z.boolean(),
42
- executionCompleted: z.boolean(),
43
- reviewCompleted: z.boolean(),
44
- prCreated: z.boolean(),
45
- prReviewCompleted: z.boolean().optional()
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 = z.object({
48
- number: z.number().int().positive(),
49
- url: z.string(),
50
- headBranch: z.string(),
51
- createdAt: z.string()
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 = z.enum([
119
+ var prReviewRecommendationSchema = z2.enum([
54
120
  "APPROVE",
55
121
  "APPROVE_WITH_SUGGESTIONS",
56
122
  "REQUEST_CHANGES"
57
123
  ]);
58
- var prReviewStateSchema = z.object({
59
- enabled: z.boolean().default(false),
60
- pullRequestNumber: z.number().int().positive().optional(),
61
- rounds: z.number().int().min(0).default(0),
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: z.string().optional()
129
+ lastReviewedAt: z2.string().optional()
64
130
  });
65
- var lastErrorSchema = z.object({
66
- category: z.string(),
67
- message: z.string(),
68
- at: z.string()
131
+ var lastErrorSchema = z2.object({
132
+ category: z2.string(),
133
+ message: z2.string(),
134
+ at: z2.string()
69
135
  });
70
- var issueMetadataSchema = z.object({
71
- schemaVersion: z.literal(1),
72
- id: z.string().min(1),
73
- number: z.number().int().positive().nullable(),
74
- source: z.enum(["github", "local"]),
75
- title: z.string(),
76
- labels: z.array(z.string()),
77
- state: z.enum(["open", "closed"]),
78
- createdAt: z.string(),
79
- updatedAt: z.string(),
80
- contentHash: z.string(),
81
- remote: z.object({
82
- provider: z.enum(["github", "local"]),
83
- ref: z.string(),
84
- syncedAt: z.string(),
85
- syncedContentHash: z.string()
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 = z.object({
89
- project: z.string(),
90
- issueNumber: z.union([z.number().int().positive(), z.string().min(1)]),
91
- issueUrl: z.string().optional().default(""),
92
- branchName: z.string(),
93
- noBranch: z.boolean().optional().default(false),
94
- description: z.string(),
95
- issueStatus: z.enum(["pending", "in_progress", "completed"]),
96
- completedAt: z.string().nullable(),
97
- lastAttemptAt: z.string().nullable(),
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: z.number().int().min(0),
100
- maxCorrectionCycles: z.number().int().min(0),
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: z.string().nullable().optional().default(null),
173
+ lastReviewFindings: z2.string().nullable().optional().default(null),
108
174
  pipeline: pipelineStateSchema,
109
175
  pullRequest: pullRequestRefSchema.optional(),
110
176
  prReview: prReviewStateSchema.optional(),
111
- userStories: z.array(userStorySchema)
177
+ userStories: z2.array(userStorySchema)
112
178
  });
113
- var headlessResultSchema = z.object({
114
- success: z.boolean(),
115
- result: z.string(),
179
+ var headlessResultSchema = z2.object({
180
+ success: z2.boolean(),
181
+ result: z2.string(),
116
182
  cost: claudeUsageSchema.nullable(),
117
- error: z.string().nullable()
183
+ error: z2.string().nullable()
118
184
  });
119
- var sessionLogEntrySchema = z.object({
120
- at: z.string(),
121
- level: z.enum(["info", "warn", "error"]),
122
- message: z.string()
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: z.number().nullable().default(null),
126
- outputTokens: z.number().nullable().default(null),
127
- cacheReadTokens: z.number().nullable().default(null),
128
- cacheCreationTokens: z.number().nullable().default(null),
129
- costUsd: z.number().nullable().default(null)
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 = z.object({
132
- name: z.string(),
133
- status: z.enum(["pending", "running", "completed", "failed"]),
134
- startedAt: z.string().nullable(),
135
- endedAt: z.string().nullable(),
136
- durationSeconds: z.number().nullable(),
137
- error: z.string().nullable(),
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 = z.object({
141
- id: z.string(),
142
- title: z.string(),
143
- priority: z.number(),
144
- passes: z.boolean(),
145
- completedAt: z.string().nullable(),
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: z.number().nullable().default(null),
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: z.array(z.string()).default([]),
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: z.string().default(""),
157
- acceptanceCriteria: z.array(z.string()).default([]),
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: z.string().nullable().default(null),
163
- stageDetail: z.string().nullable().default(null),
228
+ stageSince: z2.string().nullable().default(null),
229
+ stageDetail: z2.string().nullable().default(null),
164
230
  ...sessionUsageShape
165
231
  });
166
- var sessionSnapshotSchema = z.object({
167
- schemaVersion: z.literal(1),
168
- sessionId: z.string().nullable(),
169
- readOnly: z.literal(true),
170
- capabilities: z.array(z.string()),
171
- issue: z.object({
172
- number: z.number().nullable(),
173
- url: z.string().nullable(),
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: z.string().nullable().default(null),
177
- description: z.string().nullable().default(null),
178
- labels: z.array(z.string()).default([]),
179
- state: z.string().nullable().default(null)
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: z.enum(["idle", "running", "completed", "failed"]),
182
- startedAt: z.string().nullable(),
183
- updatedAt: z.string().nullable(),
184
- endedAt: z.string().nullable(),
185
- elapsedSeconds: z.number().nullable(),
186
- estimatedRemainingSeconds: z.number().nullable(),
187
- progress: z.object({
188
- percent: z.number(),
189
- phasesCompleted: z.number(),
190
- phasesTotal: z.number(),
191
- storiesCompleted: z.number(),
192
- storiesTotal: z.number()
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: z.string().nullable(),
195
- currentActivity: z.object({
196
- story: z.string().nullable(),
197
- tool: z.string().nullable(),
198
- detail: z.string().nullable(),
199
- since: z.string()
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: z.array(sessionPhaseSchema),
202
- stories: z.array(sessionStorySchema),
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: z.object({
206
- totalInputTokens: z.number().nullable().default(null),
207
- totalOutputTokens: z.number().nullable().default(null),
208
- totalCacheReadTokens: z.number().nullable().default(null),
209
- totalCacheCreationTokens: z.number().nullable().default(null),
210
- totalCostUsd: z.number().nullable().default(null)
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: z.object({
219
- iteration: z.number(),
220
- retries: z.number(),
221
- correctionCycle: z.number(),
222
- maxCorrectionCycles: z.number().nullable()
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: z.object({
225
- branch: z.string().nullable(),
226
- baseBranch: z.string().nullable(),
227
- commits: z.array(z.object({ hash: z.string(), subject: z.string() }))
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: z.object({
233
- name: z.string().nullable().default(null),
234
- remoteUrl: z.string().nullable().default(null),
235
- branch: z.string().nullable().default(null),
236
- headCommit: z.string().nullable().default(null),
237
- root: z.string().nullable().default(null)
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: z.array(z.object({ number: z.number(), url: z.string(), title: z.string() })),
240
- logs: z.array(sessionLogEntrySchema),
241
- errors: z.array(sessionLogEntrySchema),
242
- warnings: z.array(sessionLogEntrySchema),
243
- lastError: z.object({ message: z.string(), at: z.string() }).nullable(),
244
- nextSteps: z.array(z.string()),
245
- environment: z.object({ node: z.string(), platform: z.string() }).nullable()
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 = z.object({
248
- enabled: z.boolean().default(false),
249
- port: z.number().int().min(1).max(65535).default(3737),
250
- host: z.string().min(1).default("0.0.0.0"),
251
- refreshSeconds: z.number().positive().default(5),
252
- logLimit: z.number().int().positive().default(200),
253
- includeLogs: z.boolean().default(true)
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 = z.object({
256
- defaultGenerateTarget: z.enum(["github", "local", "both"]).default("github"),
257
- preferredProvider: z.enum(["github", "local"]).default("github"),
258
- conflictPolicy: z.enum(["ask", "prefer-local", "prefer-github"]).default("ask"),
259
- requireConfirmation: z.boolean().default(true)
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 = z.object({
262
- publisher: z.enum(["local"]).default("local")
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-57MH6RYJ.js.map
1383
+ //# sourceMappingURL=chunk-HC2MT7BX.js.map