@noir-ai/cli 1.10.0 → 1.10.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/dist/tui/index.js CHANGED
@@ -617,13 +617,13 @@ async function daemonRestart(opts) {
617
617
 
618
618
  // src/commands/handoff.ts
619
619
  import { mkdirSync, writeFileSync } from "fs";
620
- import { join as join2 } from "path";
620
+ import { join } from "path";
621
621
  import {
622
622
  defaultHandoffBlock,
623
623
  hostLaunchDirective,
624
624
  resolveAdapter
625
625
  } from "@noir-ai/adapters";
626
- import { loadProjectInfo as loadProjectInfo5, NOIR_DIR } from "@noir-ai/core";
626
+ import { loadProjectInfo as loadProjectInfo5, NOIR_DIR, resolveArtifactPath } from "@noir-ai/core";
627
627
 
628
628
  // src/commands/status.ts
629
629
  import { loadProjectInfo as loadProjectInfo3, NOIR_VERSION as NOIR_VERSION2 } from "@noir-ai/core";
@@ -792,9 +792,7 @@ async function status(opts) {
792
792
  // src/commands/task.ts
793
793
  import { spawnSync } from "child_process";
794
794
  import { createHash } from "crypto";
795
- import { readdirSync } from "fs";
796
- import { join } from "path";
797
- import { loadProjectInfo as loadProjectInfo4 } from "@noir-ai/core";
795
+ import { loadProjectInfo as loadProjectInfo4, nextArtifactSequence } from "@noir-ai/core";
798
796
  import {
799
797
  PHASES,
800
798
  TASK_CLASSES,
@@ -821,15 +819,8 @@ function writeDoneArtifacts(opts, taskId) {
821
819
  const project = loadProjectInfo4(process.cwd());
822
820
  const conflict = { conflictPolicy: "preserve", interactive: false };
823
821
  writeChangelogStub(project.root, `- ${taskId}: completed (verify gate passed)`, conflict);
824
- const decisionsDir = join(project.root, ".noir", "decisions");
825
- let nextN = 1;
826
- try {
827
- const files = readdirSync(decisionsDir);
828
- const nums = files.map((f) => Number.parseInt(f.replace(/\D.*$/, ""), 10)).filter((n) => Number.isFinite(n) && n > 0);
829
- if (nums.length > 0) nextN = Math.max(...nums) + 1;
830
- } catch {
831
- }
832
- writeDecisionStub(project.root, nextN, taskId, conflict);
822
+ const nextN = nextArtifactSequence(project.root, "adr");
823
+ writeDecisionStub(project.root, nextN, taskId, void 0, conflict);
833
824
  } catch {
834
825
  tip("document-phase artifacts could not be written (use --no-artifacts to skip)", opts);
835
826
  }
@@ -1399,7 +1390,7 @@ function resolveDirective(root, p) {
1399
1390
  }
1400
1391
  function handoffFilePath(root, taskId, projectId) {
1401
1392
  const id = typeof taskId === "string" && taskId.length > 0 ? taskId : projectId;
1402
- return join2(root, NOIR_DIR, "handoff", `${id}.md`);
1393
+ return resolveArtifactPath(root, "handoff", { taskId: id });
1403
1394
  }
1404
1395
  async function extractSeeds(opts, probe, query) {
1405
1396
  if (!probe.running) return { context: null, memory: null };
@@ -1465,7 +1456,7 @@ async function handoff(opts) {
1465
1456
  const md = renderMarkdown(full);
1466
1457
  if (opts.write === true) {
1467
1458
  const path = handoffFilePath(project.root, task?.taskId, project.id);
1468
- mkdirSync(join2(project.root, NOIR_DIR, "handoff"), { recursive: true });
1459
+ mkdirSync(join(project.root, NOIR_DIR, "handoff"), { recursive: true });
1469
1460
  writeFileSync(path, md, "utf8");
1470
1461
  info(`handoff written to ${path}`, opts);
1471
1462
  return;
@@ -3075,10 +3066,10 @@ function createProgram() {
3075
3066
  function buildHandoffOptions(g) {
3076
3067
  return { ...toCliOptions(g), ...g.write === true ? { write: true } : {} };
3077
3068
  }
3078
- program2.command("handoff").description("emit a ready-to-paste host handoff prompt").option("--write", "persist to .noir/handoff/<id>.md (gitignored)").action(async (...args) => {
3069
+ program2.command("handoff").description("emit a ready-to-paste host handoff prompt").option("--write", "persist to .noir/handoff/HO-<NNNN>-<id>.md (gitignored)").action(async (...args) => {
3079
3070
  await handoff(buildHandoffOptions(trailingCmd(args).optsWithGlobals()));
3080
3071
  });
3081
- program2.command("wrap").description("session-end alias for `noir handoff`").option("--write", "persist to .noir/handoff/<id>.md (gitignored)").action(async (...args) => {
3072
+ program2.command("wrap").description("session-end alias for `noir handoff`").option("--write", "persist to .noir/handoff/HO-<NNNN>-<id>.md (gitignored)").action(async (...args) => {
3082
3073
  await handoff(buildHandoffOptions(trailingCmd(args).optsWithGlobals()));
3083
3074
  });
3084
3075
  program2.command("release").description("guided release orchestrator over the patch-release flow").argument("[version]", "target version, e.g. 1.10.0").option("--channel <channel>", "beta (default) | stable").option("--dry-run", "print the checklist without executing any steps").action(async (...args) => {
@@ -4142,16 +4133,16 @@ function Help() {
4142
4133
  // src/tui/palette/history.ts
4143
4134
  import { existsSync, mkdirSync as mkdirSync2, readFileSync } from "fs";
4144
4135
  import { homedir } from "os";
4145
- import { join as join3 } from "path";
4136
+ import { join as join2 } from "path";
4146
4137
  import { atomicWriteFile } from "@noir-ai/core";
4147
4138
  var MAX_ENTRIES = 50;
4148
4139
  var TUI_HISTORY_DISABLE_ENV = "NOIR_DISABLE_TUI_HISTORY";
4149
4140
  var testHome = null;
4150
4141
  function homeDir() {
4151
- return testHome ?? join3(homedir(), ".noir");
4142
+ return testHome ?? join2(homedir(), ".noir");
4152
4143
  }
4153
4144
  function historyFile(projectId) {
4154
- return join3(homeDir(), projectId, "tui-history.json");
4145
+ return join2(homeDir(), projectId, "tui-history.json");
4155
4146
  }
4156
4147
  function isHistoryEnabled() {
4157
4148
  const v = process.env[TUI_HISTORY_DISABLE_ENV];
@@ -4186,7 +4177,7 @@ function recordRecent(projectId, argv) {
4186
4177
  const current = loadRecent(projectId).filter((e) => e.id !== entry.id);
4187
4178
  const next = [entry, ...current].slice(0, MAX_ENTRIES);
4188
4179
  try {
4189
- const dir = join3(homeDir(), projectId);
4180
+ const dir = join2(homeDir(), projectId);
4190
4181
  mkdirSync2(dir, { recursive: true });
4191
4182
  atomicWriteFile(historyFile(projectId), `${JSON.stringify(next, null, 2)}
4192
4183
  `);