@staff0rd/assist 0.446.0 → 0.448.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.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.446.0",
9
+ version: "0.448.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -9039,11 +9039,34 @@ function getNestedValue(obj, path71) {
9039
9039
  return current;
9040
9040
  }
9041
9041
 
9042
+ // src/commands/config/readRawConfigLayers.ts
9043
+ function readRawConfigLayers(cwd) {
9044
+ const global = loadRawYaml(getGlobalConfigPath());
9045
+ return {
9046
+ project: loadRawYaml(getConfigPathFrom(cwd)),
9047
+ global,
9048
+ repoOverride: global.repos ? resolveRepoOverride(global, getCurrentOrigin(cwd)) : {}
9049
+ };
9050
+ }
9051
+
9052
+ // src/commands/config/resolveConfigSource.ts
9053
+ function resolveConfigSource(key, layers) {
9054
+ if (getNestedValue(layers.project, key) !== void 0) return "project";
9055
+ if (getNestedValue(layers.repoOverride, key) !== void 0) return "global";
9056
+ if (getNestedValue(layers.global, key) !== void 0) return "global";
9057
+ return "default";
9058
+ }
9059
+
9042
9060
  // src/commands/config/readConfigEntries.ts
9043
9061
  var KEYS_STRIPPED_FROM_MERGED_CONFIG = /* @__PURE__ */ new Set(["repos"]);
9044
9062
  function readConfigEntries(cwd) {
9045
9063
  const config = loadConfigFrom(cwd);
9046
- return describeConfigLeaves(assistConfigSchema).filter((leaf) => !KEYS_STRIPPED_FROM_MERGED_CONFIG.has(leaf.key)).map((leaf) => ({ ...leaf, value: getNestedValue(config, leaf.key) }));
9064
+ const layers = readRawConfigLayers(cwd);
9065
+ return describeConfigLeaves(assistConfigSchema).filter((leaf) => !KEYS_STRIPPED_FROM_MERGED_CONFIG.has(leaf.key)).map((leaf) => ({
9066
+ ...leaf,
9067
+ value: getNestedValue(config, leaf.key),
9068
+ source: resolveConfigSource(leaf.key, layers)
9069
+ }));
9047
9070
  }
9048
9071
 
9049
9072
  // src/commands/sessions/web/getConfig.ts
@@ -11234,6 +11257,11 @@ async function insertSubtask(orm, itemId2, title, description) {
11234
11257
  });
11235
11258
  }
11236
11259
 
11260
+ // src/commands/backlog/serializeManualChecks.ts
11261
+ function serializeManualChecks(manualCheck) {
11262
+ return manualCheck && manualCheck.length > 0 ? JSON.stringify(manualCheck) : null;
11263
+ }
11264
+
11237
11265
  // src/commands/backlog/createItemWithDefaults.ts
11238
11266
  async function createItemWithDefaults(fields) {
11239
11267
  const orm = await getDb();
@@ -11249,8 +11277,22 @@ async function createItemWithDefaults(fields) {
11249
11277
  },
11250
11278
  getOrigin()
11251
11279
  );
11252
- if (fields.type === "bug")
11280
+ const phases = fields.phases ?? [];
11281
+ if (phases.length > 0) {
11282
+ for (const [idx, phase] of phases.entries()) {
11283
+ await insertPhaseAt(
11284
+ orm,
11285
+ id,
11286
+ idx,
11287
+ phase.name,
11288
+ phase.tasks,
11289
+ serializeManualChecks(phase.manualChecks),
11290
+ void 0
11291
+ );
11292
+ }
11293
+ } else if (fields.type === "bug") {
11253
11294
  await insertPhaseAt(orm, id, 0, "Fix", ["Fix the bug"], null, void 0);
11295
+ }
11254
11296
  for (const subtask of loadConfig().subtasks ?? []) {
11255
11297
  await insertSubtask(orm, id, subtask.title, subtask.description);
11256
11298
  }
@@ -11379,11 +11421,6 @@ async function resolveInsertPosition(orm, itemId2, position) {
11379
11421
  return pos - 1;
11380
11422
  }
11381
11423
 
11382
- // src/commands/backlog/serializeManualChecks.ts
11383
- function serializeManualChecks(manualCheck) {
11384
- return manualCheck && manualCheck.length > 0 ? JSON.stringify(manualCheck) : null;
11385
- }
11386
-
11387
11424
  // src/commands/backlog/addPhase.ts
11388
11425
  async function addPhase(id, name, options2) {
11389
11426
  if (!ensureRemoteOrigin()) return;
@@ -11551,11 +11588,17 @@ import chalk78 from "chalk";
11551
11588
 
11552
11589
  // src/commands/backlog/propose/proposedItemSchema.ts
11553
11590
  import { z as z5 } from "zod";
11591
+ var proposedPhaseSchema = z5.strictObject({
11592
+ name: z5.string().trim().min(1, "phase name is required"),
11593
+ tasks: z5.array(z5.string().trim().min(1)).min(1, "a phase needs at least one task"),
11594
+ manualChecks: z5.array(z5.string().trim().min(1)).default([])
11595
+ });
11554
11596
  var proposedItemSchema = z5.strictObject({
11555
11597
  name: z5.string().trim().min(1, "name is required"),
11556
11598
  type: z5.enum(["story", "bug"]),
11557
11599
  description: z5.string().optional(),
11558
- acceptanceCriteria: z5.array(z5.string().trim().min(1)).default([])
11600
+ acceptanceCriteria: z5.array(z5.string().trim().min(1)).default([]),
11601
+ phases: z5.array(proposedPhaseSchema).default([])
11559
11602
  });
11560
11603
 
11561
11604
  // src/commands/backlog/propose/readProposedItem.ts
@@ -11594,6 +11637,18 @@ ${issues}`);
11594
11637
  }
11595
11638
 
11596
11639
  // src/commands/backlog/propose/renderProposedItem.ts
11640
+ function renderPhase(phase, i) {
11641
+ const parts = [
11642
+ `### Phase ${i + 1}: ${phase.name}`,
11643
+ phase.tasks.map((task) => `- ${task}`).join("\n")
11644
+ ];
11645
+ if (phase.manualChecks.length > 0)
11646
+ parts.push(
11647
+ "**Manual checks:**",
11648
+ phase.manualChecks.map((check2) => `- ${check2}`).join("\n")
11649
+ );
11650
+ return parts.join("\n\n");
11651
+ }
11597
11652
  function renderProposedItem(item) {
11598
11653
  const sections = [`**Type:** ${item.type}`];
11599
11654
  if (item.description) sections.push("## Description", item.description);
@@ -11602,6 +11657,8 @@ function renderProposedItem(item) {
11602
11657
  "## Acceptance Criteria",
11603
11658
  item.acceptanceCriteria.map((ac, i) => `${i + 1}. ${ac}`).join("\n")
11604
11659
  );
11660
+ if (item.phases.length > 0)
11661
+ sections.push("## Plan", ...item.phases.map(renderPhase));
11605
11662
  return sections.join("\n\n");
11606
11663
  }
11607
11664
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.446.0",
3
+ "version": "0.448.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {