halfcycle 0.5.2 → 0.6.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/index.d.ts CHANGED
@@ -20,4 +20,5 @@ export { runBootstrapScan, scanLayers, mergeWithRecords, HALFCYCLE_STATE_FORMAT
20
20
  export type { HalfcycleStateFile, ScannedLayerEntry, ScannedLayerValue } from './scan.js';
21
21
  export * from './setup/index.js';
22
22
  export * from './build-record/index.js';
23
+ export { readyRowsFromFiles } from './ready.js';
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrG,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAyBhE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnG,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI1F,cAAc,kBAAkB,CAAC;AAKjC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrG,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAyBhE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnG,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI1F,cAAc,kBAAkB,CAAC;AAKjC,cAAc,yBAAyB,CAAC;AAKxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -298,9 +298,13 @@ var HOOK_REMEDY = `Run ${SIGN_IN_COMMAND} in the project folder to sign in.`;
298
298
 
299
299
  // ../core/dist/task-plan.js
300
300
  import { z as z2 } from "zod";
301
+ var TASK_PLAN_FILE = "docs/build-records/task-plan.json";
302
+ var TASK_LIST_FILE = "docs/build-records/build-tasks.json";
301
303
  var TASK_PLAN_TASKS_MAX = 500;
302
304
  var TASK_PLAN_ID_MAX = 64;
303
305
  var TASK_PLAN_BUILDS_NONE = "none";
306
+ var TASK_PLAN_CRITERIA_NONE = "none";
307
+ var TASK_PLAN_SPECS_NONE = "none";
304
308
  var TASK_PLAN_KINDS = ["build", "review", "spec", "walk", "check"];
305
309
  var CONTROL_CHARACTER = /[\u0000-\u001f\u007f-\u009f]/;
306
310
  var planText = z2.string().refine((text) => !CONTROL_CHARACTER.test(text), { message: "holds a control character" });
@@ -317,7 +321,9 @@ var taskPlanTaskSchema = z2.object({
317
321
  }).strict().optional(),
318
322
  wholeProject: z2.literal(true).optional(),
319
323
  ships: z2.enum(["deploy", "release"]).optional(),
320
- builds: z2.union([z2.literal(TASK_PLAN_BUILDS_NONE), z2.array(planText)]).optional()
324
+ builds: z2.union([z2.literal(TASK_PLAN_BUILDS_NONE), z2.array(planText)]).optional(),
325
+ criteria: z2.union([z2.literal(TASK_PLAN_CRITERIA_NONE), z2.array(planText)]).optional(),
326
+ whyOutsidePlan: planText.optional()
321
327
  }).strict().superRefine((task, ctx) => {
322
328
  if (task.reviews !== void 0 && task.kind !== "review") {
323
329
  ctx.addIssue({
@@ -343,6 +349,7 @@ var taskPlanTaskSchema = z2.object({
343
349
  });
344
350
  var taskPlanSchema = z2.object({
345
351
  phase: z2.string().min(1).refine((text) => !CONTROL_CHARACTER.test(text), { message: "holds a control character" }),
352
+ specs: z2.union([z2.literal(TASK_PLAN_SPECS_NONE), z2.array(planText)]).optional(),
346
353
  tasks: z2.array(taskPlanTaskSchema).max(TASK_PLAN_TASKS_MAX)
347
354
  }).strict();
348
355
  var taskListRowSchema = z2.object({
@@ -451,6 +458,37 @@ var AGENT_PROFILES = {
451
458
  };
452
459
  var ALL_HOOK_COMMANDS = new Set(AGENT_IDS.flatMap((id) => [...AGENT_PROFILES[id].commands]));
453
460
 
461
+ // ../core/dist/worker-report.js
462
+ var WORKER_REPORT_STATUSES = Object.freeze([
463
+ "done",
464
+ "needs-human-verification",
465
+ "blocked-on-human",
466
+ "failed"
467
+ ]);
468
+ var WORKER_REPORT_RULE_FIELDS = Object.freeze({
469
+ W1: "Worker report",
470
+ W2: "Status",
471
+ W3: "Head",
472
+ W4: "Head",
473
+ W5: "Verification",
474
+ W6: "Verification",
475
+ W7: "Verification",
476
+ W8: "Unverified"
477
+ });
478
+ var WORKER_REPORT_LINES = Object.freeze({
479
+ noBlock: () => 'There is no "## Worker report" block in this report.',
480
+ statusMissing: (statuses) => `The report has no Status line. Use one of: ${statuses.join(", ")}.`,
481
+ statusUnknown: (found, statuses) => `The report's Status is "${found}". Use one of: ${statuses.join(", ")}.`,
482
+ headMissing: () => "The report has no Head line. Give the full commit id the report is about.",
483
+ headMalformed: (found) => `The report's Head is "${found}", which is not a full commit id.`,
484
+ headDiffers: (found, head) => `The report is about commit ${found}, but the work's head is ${head}. Ask for a report on the current head.`,
485
+ noVerification: () => "The report does not say what was run. List each check under Verification with its exit code.",
486
+ noExitCode: (entry) => `"${entry}" under Verification does not give an exit code.`,
487
+ nonZeroOnDone: (entry) => `"${entry}" exited with a code other than 0, so the work is not done.`,
488
+ noUnverified: () => 'The report has no Unverified line. Say what was not checked, or "nothing".',
489
+ clear: () => "The report is complete and names the commit it is about."
490
+ });
491
+
454
492
  // ../events/dist/result.js
455
493
  import { z as z3 } from "zod";
456
494
  var firedGuardSchema = z3.object({
@@ -3160,16 +3198,43 @@ var ownerWaitDeclarationSchema = z23.object({
3160
3198
  var ownerWaitDeclarationsSchema = z23.object({ declarations: z23.array(ownerWaitDeclarationSchema) }).strict();
3161
3199
  var OWNER_WAIT_TOO_MANY = `This project already has ${String(OWNER_WAIT_ADDITIONS_MAX)} things added to what waits for the owner. Ask the owner to take one off on their settings page in the console first; it cannot be done by typing in chat.`;
3162
3200
 
3163
- // ../events/dist/autonomy.js
3201
+ // ../events/dist/owner-wait-answer.js
3164
3202
  import { z as z24 } from "zod";
3203
+ var ownerWaitShortIdSchema = z24.string().regex(/^[0-9a-f]{8}$/);
3204
+ var OWNER_WAIT_ANSWER_ACTS = ["approve", "decline"];
3205
+ var ownerWaitAnswerActSchema = z24.enum(OWNER_WAIT_ANSWER_ACTS);
3206
+ var ownerWaitChatRequestSchema = z24.discriminatedUnion("act", [
3207
+ z24.object({ act: z24.literal("approve"), wait: ownerWaitShortIdSchema }).strict(),
3208
+ z24.object({ act: z24.literal("decline"), wait: ownerWaitShortIdSchema, note: scopeNoteWireSchema }).strict()
3209
+ ]);
3210
+ function bareOutcome(outcome) {
3211
+ return z24.object({ outcome: z24.literal(outcome) }).strict();
3212
+ }
3213
+ var ownerWaitChatResultSchema = z24.discriminatedUnion("outcome", [
3214
+ z24.object({
3215
+ outcome: z24.literal("recorded"),
3216
+ act: ownerWaitAnswerActSchema,
3217
+ question: z24.string().min(1)
3218
+ }).strict(),
3219
+ z24.object({ outcome: z24.literal("refused"), problems: z24.array(systemDescriptionProblemSchema).min(1) }).strict(),
3220
+ bareOutcome("not-owner"),
3221
+ bareOutcome("no-owner"),
3222
+ bareOutcome("not-found"),
3223
+ bareOutcome("ambiguous"),
3224
+ bareOutcome("not-offered"),
3225
+ bareOutcome("unavailable")
3226
+ ]);
3227
+
3228
+ // ../events/dist/autonomy.js
3229
+ import { z as z25 } from "zod";
3165
3230
  var AUTONOMY_CHANGED_IN = ["console", "chat"];
3166
- var autonomyChangedInSchema = z24.enum(AUTONOMY_CHANGED_IN);
3167
- var autonomySettingsSchema = z24.object({
3168
- on: z24.boolean(),
3231
+ var autonomyChangedInSchema = z25.enum(AUTONOMY_CHANGED_IN);
3232
+ var autonomySettingsSchema = z25.object({
3233
+ on: z25.boolean(),
3169
3234
  // whether builds run on their own
3170
- mayPublish: z24.boolean(),
3235
+ mayPublish: z25.boolean(),
3171
3236
  // whether builds may publish or release without waiting
3172
- maySpend: z24.boolean(),
3237
+ maySpend: z25.boolean(),
3173
3238
  // whether builds may spend money or sign up without waiting
3174
3239
  changedAt: utcIso8601.nullable(),
3175
3240
  // when the setting last changed; null if never
@@ -3179,37 +3244,37 @@ var autonomySettingsSchema = z24.object({
3179
3244
  message: "says when and where it changed, or neither",
3180
3245
  path: ["changedIn"]
3181
3246
  });
3182
- var autonomyChangeRequestSchema = z24.object({
3183
- on: z24.boolean(),
3247
+ var autonomyChangeRequestSchema = z25.object({
3248
+ on: z25.boolean(),
3184
3249
  // the switch
3185
- mayPublish: z24.boolean(),
3250
+ mayPublish: z25.boolean(),
3186
3251
  // the publish box
3187
- maySpend: z24.boolean()
3252
+ maySpend: z25.boolean()
3188
3253
  // the spend box
3189
3254
  }).strict();
3190
3255
  var AUTONOMY_CHAT_ACTS = ["on", "off"];
3191
- var autonomyChatActSchema = z24.enum(AUTONOMY_CHAT_ACTS);
3192
- var autonomyChatRequestSchema = z24.object({
3256
+ var autonomyChatActSchema = z25.enum(AUTONOMY_CHAT_ACTS);
3257
+ var autonomyChatRequestSchema = z25.object({
3193
3258
  act: autonomyChatActSchema
3194
3259
  // what the owner typed
3195
3260
  }).strict();
3196
- var autonomyChatResultSchema = z24.discriminatedUnion("outcome", [
3197
- z24.object({
3198
- outcome: z24.literal("recorded"),
3199
- on: z24.boolean()
3261
+ var autonomyChatResultSchema = z25.discriminatedUnion("outcome", [
3262
+ z25.object({
3263
+ outcome: z25.literal("recorded"),
3264
+ on: z25.boolean()
3200
3265
  // whether builds now run on their own
3201
3266
  }).strict(),
3202
- z24.object({ outcome: z24.literal("not-owner") }).strict(),
3203
- z24.object({ outcome: z24.literal("no-owner") }).strict(),
3204
- z24.object({ outcome: z24.literal("not-offered") }).strict(),
3205
- z24.object({ outcome: z24.literal("unavailable") }).strict()
3267
+ z25.object({ outcome: z25.literal("not-owner") }).strict(),
3268
+ z25.object({ outcome: z25.literal("no-owner") }).strict(),
3269
+ z25.object({ outcome: z25.literal("not-offered") }).strict(),
3270
+ z25.object({ outcome: z25.literal("unavailable") }).strict()
3206
3271
  ]);
3207
- var autonomyStateSchema = z24.object({
3208
- on: z24.boolean(),
3272
+ var autonomyStateSchema = z25.object({
3273
+ on: z25.boolean(),
3209
3274
  // whether builds run on their own
3210
- mayPublish: z24.boolean(),
3275
+ mayPublish: z25.boolean(),
3211
3276
  // whether builds may publish or release without waiting
3212
- maySpend: z24.boolean()
3277
+ maySpend: z25.boolean()
3213
3278
  // whether builds may spend money or sign up without waiting
3214
3279
  }).strict();
3215
3280
  var autonomyStateFileSchema = autonomyStateSchema.extend({
@@ -3218,8 +3283,8 @@ var autonomyStateFileSchema = autonomyStateSchema.extend({
3218
3283
  }).strict();
3219
3284
  var AUTONOMY_STATE_FILE_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
3220
3285
  var AUTONOMY_ACTIVITY_KINDS = ["went-ahead", "waiting", "approved", "closed", "waiting-on-owner"];
3221
- var autonomyActivityKindSchema = z24.enum(AUTONOMY_ACTIVITY_KINDS);
3222
- var autonomyActivityRowSchema = z24.object({
3286
+ var autonomyActivityKindSchema = z25.enum(AUTONOMY_ACTIVITY_KINDS);
3287
+ var autonomyActivityRowSchema = z25.object({
3223
3288
  kind: autonomyActivityKindSchema,
3224
3289
  // what happened
3225
3290
  phase: scopePhaseSchema,
@@ -3232,6 +3297,8 @@ var autonomyActivityRowSchema = z24.object({
3232
3297
  // whether the agent says it can be undone
3233
3298
  how: statementText(STATEMENT_MAX).optional(),
3234
3299
  // how to undo it, when it can be
3300
+ wait: ownerWaitShortIdSchema.optional(),
3301
+ // the short id the owner types to answer a waiting decision
3235
3302
  at: utcIso8601
3236
3303
  // when it happened
3237
3304
  }).strict().superRefine((row, ctx) => {
@@ -3258,6 +3325,9 @@ var autonomyActivityRowSchema = z24.object({
3258
3325
  });
3259
3326
  }
3260
3327
  }
3328
+ if (row.kind !== "waiting" && row.wait !== void 0) {
3329
+ ctx.addIssue({ code: "custom", message: "only a waiting decision is answered by typing", path: ["wait"] });
3330
+ }
3261
3331
  if (row.kind === "waiting" && (row.undoable !== void 0 || row.how !== void 0)) {
3262
3332
  ctx.addIssue({ code: "custom", message: "a waiting decision has not been made yet", path: ["undoable"] });
3263
3333
  }
@@ -3265,11 +3335,11 @@ var autonomyActivityRowSchema = z24.object({
3265
3335
  ctx.addIssue({ code: "custom", message: "says how to undo it exactly when it can be undone", path: ["how"] });
3266
3336
  }
3267
3337
  });
3268
- var autonomyActivitySchema = z24.object({
3269
- rows: z24.array(autonomyActivityRowSchema)
3338
+ var autonomyActivitySchema = z25.object({
3339
+ rows: z25.array(autonomyActivityRowSchema)
3270
3340
  // newest first
3271
3341
  }).strict();
3272
- var savedIdSchema = z24.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "must be lower-case letters, digits and single hyphens");
3342
+ var savedIdSchema = z25.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "must be lower-case letters, digits and single hyphens");
3273
3343
  var SAVED_REF_PREFIX = "refs/halfcycle/saved/";
3274
3344
  function savedRefOf(id) {
3275
3345
  return `${SAVED_REF_PREFIX}${id}`;
@@ -3290,33 +3360,33 @@ function isGitFolderSegment(segment) {
3290
3360
  return t === ".git" || /^git~\d+$/.test(t);
3291
3361
  }
3292
3362
  var SAVED_PATH_KEPT_IN = ["commit", "copy"];
3293
- var savedPathSchema = z24.object({
3294
- path: z24.string().max(4096).refine(isProjectRelativePath, { message: "must be a path inside the project" }),
3363
+ var savedPathSchema = z25.object({
3364
+ path: z25.string().max(4096).refine(isProjectRelativePath, { message: "must be a path inside the project" }),
3295
3365
  // the file, relative to the project
3296
- keptIn: z24.enum(SAVED_PATH_KEPT_IN)
3366
+ keptIn: z25.enum(SAVED_PATH_KEPT_IN)
3297
3367
  // in the save's commit, or copied beside this file
3298
3368
  }).strict();
3299
- var savedCommitSchema = z24.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/, "must be a full commit hash");
3300
- var savedBranchSchema = z24.object({
3301
- name: z24.string().min(1).max(255).refine((n) => !hasControlCharacter(n) && !n.startsWith("-") && !n.includes("..") && n !== "HEAD", {
3369
+ var savedCommitSchema = z25.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/, "must be a full commit hash");
3370
+ var savedBranchSchema = z25.object({
3371
+ name: z25.string().min(1).max(255).refine((n) => !hasControlCharacter(n) && !n.startsWith("-") && !n.includes("..") && n !== "HEAD", {
3302
3372
  message: "must be a branch name"
3303
3373
  }),
3304
3374
  // the branch's name
3305
3375
  commit: savedCommitSchema
3306
3376
  // the commit it pointed at
3307
3377
  }).strict();
3308
- var savedSchema = z24.object({
3378
+ var savedSchema = z25.object({
3309
3379
  id: savedIdSchema,
3310
3380
  // what restore is typed with
3311
3381
  savedAt: utcIso8601,
3312
3382
  // when the copy was made
3313
- ref: z24.string().min(1),
3383
+ ref: z25.string().min(1),
3314
3384
  // where the saved commit is kept
3315
- what: z24.string().min(1).max(2e3),
3385
+ what: z25.string().min(1).max(2e3),
3316
3386
  // what the action would have changed, in words
3317
- paths: z24.array(savedPathSchema),
3387
+ paths: z25.array(savedPathSchema),
3318
3388
  // every saved file
3319
- branches: z24.array(savedBranchSchema)
3389
+ branches: z25.array(savedBranchSchema)
3320
3390
  // every saved line of work
3321
3391
  }).strict().refine((s) => s.ref === savedRefOf(s.id), { message: "must be the ref of this save", path: ["ref"] });
3322
3392
  function autonomyC8(agent, question, chose) {
@@ -5318,12 +5388,12 @@ function findNotShared(targetRepo, manifest, collidedPaths) {
5318
5388
  if (ignored === null)
5319
5389
  return null;
5320
5390
  const sorted = [...ignored].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
5321
- const named = sorted.find((entry) => entry.path === SETTINGS_REL) ?? sorted[0];
5391
+ const named2 = sorted.find((entry) => entry.path === SETTINGS_REL) ?? sorted[0];
5322
5392
  return {
5323
- path: named.path,
5324
- pattern: named.pattern,
5325
- source: named.source,
5326
- line: named.line,
5393
+ path: named2.path,
5394
+ pattern: named2.pattern,
5395
+ source: named2.source,
5396
+ line: named2.line,
5327
5397
  others: sorted.length - 1
5328
5398
  };
5329
5399
  }
@@ -8074,10 +8144,10 @@ function leftForYouLines(left, p) {
8074
8144
  return lines;
8075
8145
  }
8076
8146
  function shownBy(steps) {
8077
- const named = steps.filter((s) => s.name !== void 0).length;
8078
- if (named === 0)
8147
+ const named2 = steps.filter((s) => s.name !== void 0).length;
8148
+ if (named2 === 0)
8079
8149
  return "Each is shown by the method's own label for it:";
8080
- if (named === steps.length)
8150
+ if (named2 === steps.length)
8081
8151
  return "Each is shown by the method's own name for it:";
8082
8152
  return "Each is shown by the method's own name for it, or by its label where the record holds no name:";
8083
8153
  }
@@ -8620,6 +8690,64 @@ async function obtainBuildRecord(credential, repoRoot, phase, io = NODE_RECORD_P
8620
8690
  function refetchCommand(phase) {
8621
8691
  return `${HALFCYCLE_COMMAND} build-record ${quoteForShell(phase)}`;
8622
8692
  }
8693
+
8694
+ // dist/check-tasks.js
8695
+ var CHECK_TASKS_USAGE = `${HALFCYCLE_COMMAND} check-tasks <phase> [--with-task-list] [--repo <root>]`;
8696
+ var MISSING_PLAN_LINE = `there is no ${TASK_PLAN_FILE} in this project yet. Run the task-graph step to write it, then run this again.`;
8697
+ var SPEC_FOLDER = LAYER_ARTEFACT_PATHS.l4[0];
8698
+
8699
+ // dist/ready.js
8700
+ var READY_USAGE = `${HALFCYCLE_COMMAND} ready <phase> [--cap <n>] [--repo <root>]`;
8701
+ var STATES_TEXT = buildTaskStateSchema.options.join(", ");
8702
+ var READY_LINES = {
8703
+ start: (id, title) => `Ready to start: ${named(id, title)}`,
8704
+ pastCap: (id, title) => `Ready, but past the number allowed now: ${named(id, title)}`,
8705
+ person: (id, title) => `Waiting on a person: ${named(id, title)}`,
8706
+ noCap: () => "No number was given, so every task that can start is listed.",
8707
+ nothing: () => "Nothing can start now.",
8708
+ noTaskList: () => `There is no task list at ${TASK_LIST_FILE}, so which tasks are done is not known. Write the task list for this phase, then run this again.`,
8709
+ otherPhase: (phase) => `The task list in ${TASK_LIST_FILE} is not for "${phase}", so which tasks are done is not known. Write the task list for this phase, then run this again.`,
8710
+ noState: (id) => `"${id}" in ${TASK_LIST_FILE} does not give its state as one of: ${STATES_TEXT}.`
8711
+ };
8712
+ function named(id, title) {
8713
+ return title === void 0 ? id : `${id}, ${title}`;
8714
+ }
8715
+ var PROGRESS = {
8716
+ pending: "pending",
8717
+ completed: "completed",
8718
+ "in-flight": "other",
8719
+ failed: "other",
8720
+ blocked: "other"
8721
+ };
8722
+ function readyRowsFromFiles(plan, taskList) {
8723
+ const listed = /* @__PURE__ */ new Map();
8724
+ for (const entry of taskList.tasks) {
8725
+ if (!listed.has(entry.id))
8726
+ listed.set(entry.id, entry);
8727
+ }
8728
+ const rows = [];
8729
+ const lines = [];
8730
+ plan.tasks.forEach((task, place) => {
8731
+ const entry = listed.get(task.id);
8732
+ const state = buildTaskStateSchema.safeParse(entry?.state);
8733
+ if (entry === void 0 || !state.success) {
8734
+ lines.push(READY_LINES.noState(task.id));
8735
+ return;
8736
+ }
8737
+ const title = typeof entry.title === "string" && entry.title !== "" ? entry.title : void 0;
8738
+ const minutes = typeof entry.budgetMinutes === "number" ? entry.budgetMinutes : void 0;
8739
+ rows.push({
8740
+ id: task.id,
8741
+ dependsOn: task.dependsOn,
8742
+ progress: PROGRESS[state.data],
8743
+ person: task.heldBy === "person" || entry.agent === HUMAN_AGENT,
8744
+ ...minutes === void 0 ? {} : { minutes },
8745
+ tieRank: place,
8746
+ title
8747
+ });
8748
+ });
8749
+ return lines.length > 0 ? { ok: false, lines } : { ok: true, rows };
8750
+ }
8623
8751
  export {
8624
8752
  BUILD_RECORD_DIR,
8625
8753
  CreateEngagementRefused,
@@ -8655,6 +8783,7 @@ export {
8655
8783
  readBundlePin,
8656
8784
  readRemote,
8657
8785
  readRootCommit,
8786
+ readyRowsFromFiles,
8658
8787
  refetchCommand,
8659
8788
  renderAnchor,
8660
8789
  renderBuildRecordV2Markdown,