@rness/cli 0.21.0 → 0.22.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.
@@ -17,6 +17,8 @@ import {
17
17
  approvalUrl,
18
18
  assembleContext,
19
19
  banner,
20
+ boardPushCommand,
21
+ boardRunCommand,
20
22
  boardUrl,
21
23
  bold,
22
24
  canOpenBrowser,
@@ -75,9 +77,6 @@ import {
75
77
  publish,
76
78
  pullFastForward,
77
79
  pulseCreateCommand,
78
- pulseMarkCommand,
79
- pulseRunCommand,
80
- pulseSyncCommand,
81
80
  readAuth,
82
81
  readBoards,
83
82
  readOrNull,
@@ -103,7 +102,7 @@ import {
103
102
  workspaceName,
104
103
  writeFileAtomic,
105
104
  writeManifest
106
- } from "./chunk-D3D2WCGW.js";
105
+ } from "./chunk-XCO5ZT2H.js";
107
106
 
108
107
  // src/core/transport.ts
109
108
  import { spawn } from "child_process";
@@ -1522,7 +1521,7 @@ async function syncCommand(opts, deps = {}) {
1522
1521
  if (!check && opts.scope === void 0) {
1523
1522
  const boards = await migrateBoards(ws.rnessDir, manifest);
1524
1523
  if (boards.changed) {
1525
- manifest.projects = boards.projects;
1524
+ manifest.boards = boards.boards;
1526
1525
  await writeManifest(ws.rnessDir, manifest);
1527
1526
  for (const [rel, text] of boards.readmes)
1528
1527
  await writeFileAtomic(join6(ws.rnessDir, ...rel.split("/")), text);
@@ -2527,7 +2526,7 @@ async function createBlank(input) {
2527
2526
  provider: null,
2528
2527
  org: null,
2529
2528
  agents,
2530
- projects: null,
2529
+ boards: null,
2531
2530
  repos: {},
2532
2531
  scopes: {}
2533
2532
  },
@@ -3039,7 +3038,7 @@ async function createCommand(opts, deps = {}) {
3039
3038
  provider: chosenProvider,
3040
3039
  org,
3041
3040
  agents: null,
3042
- projects: null,
3041
+ boards: null,
3043
3042
  repos: {},
3044
3043
  scopes: {}
3045
3044
  };
@@ -3728,9 +3727,19 @@ async function checkBoards(rnessDir, manifest) {
3728
3727
  const problems = (manifest.refused ?? []).map((r) => r.reason);
3729
3728
  const holders = /* @__PURE__ */ new Map();
3730
3729
  const all = [];
3731
- for (const [name, entry] of Object.entries(manifest.projects ?? {})) {
3730
+ const isCollection2 = async (dir) => !NEVER.has(dir) && (contractOf(dir) !== void 0 || await isDirectory(join16(rnessDir, dir)));
3731
+ for (const [name, entry] of Object.entries(manifest.boards ?? {})) {
3732
3732
  if (typeof entry === "number") continue;
3733
- const at = `projects.${name}`;
3733
+ const at = `boards.${name}`;
3734
+ if (typeof entry === "string") {
3735
+ if (name === PULSE) all.push(name);
3736
+ else if (!await isCollection2(name))
3737
+ problems.push(
3738
+ `"${at}" names no collection of .rness: a collection's board is named after its directory`
3739
+ );
3740
+ else holders.set(name, name);
3741
+ continue;
3742
+ }
3734
3743
  if (entry.collections === "all") all.push(name);
3735
3744
  else
3736
3745
  for (const collection of Object.keys(entry.collections)) {
@@ -3768,7 +3777,7 @@ async function checkBoards(rnessDir, manifest) {
3768
3777
  }
3769
3778
  if (all.length > 1)
3770
3779
  problems.push(
3771
- `${all.map((n) => `"projects.${n}"`).join(" and ")} each take every collection ("all"): a collection is on one board at most`
3780
+ `${all.map((n) => `"boards.${n}"`).join(" and ")} each take every collection ("all"): a collection is on one board at most`
3772
3781
  );
3773
3782
  return problems;
3774
3783
  }
@@ -4440,7 +4449,7 @@ function noteTool(cwd, githubApi) {
4440
4449
  additionalProperties: false
4441
4450
  },
4442
4451
  call: (args) => guard(async () => {
4443
- const { postNote } = await import("./note-RBG7OXVI.js");
4452
+ const { postNote } = await import("./note-XSJ7ASXM.js");
4444
4453
  const given = (key) => {
4445
4454
  const value = args[key];
4446
4455
  return typeof value === "string" ? value : void 0;
@@ -4499,7 +4508,7 @@ function statusLine(scope, inProgress, notes) {
4499
4508
  }
4500
4509
  async function boardsOf(manifest, rnessDir) {
4501
4510
  const boards = [];
4502
- for (const [name, entry] of Object.entries(manifest.projects ?? {}))
4511
+ for (const [name, entry] of Object.entries(manifest.boards ?? {}))
4503
4512
  try {
4504
4513
  boards.push({
4505
4514
  name,
@@ -4516,8 +4525,9 @@ var SHIPPED_COLORS = presetTemplate(currentPreset("agent-pulse"), {
4516
4525
  collection: PULSE
4517
4526
  })["colors"];
4518
4527
  function pulseOf(org, boards) {
4519
- const main = boards.find((b) => b.declaration.collections === "all") ?? boards[0];
4520
- return org === null || main === void 0 ? null : boardUrl(org, main.declaration.number);
4528
+ const created = boards.filter((b) => b.declaration.number !== null);
4529
+ const main = created.find((b) => b.declaration.collections === "all") ?? created[0];
4530
+ return org === null || main?.declaration.number == null ? null : boardUrl(org, main.declaration.number);
4521
4531
  }
4522
4532
  function snapshotTabs(tabs, org, boards) {
4523
4533
  return tabs.map((tab) => {
@@ -4529,7 +4539,7 @@ function snapshotTabs(tabs, org, boards) {
4529
4539
  rows: tab.rows.map((row) => ({
4530
4540
  ...row,
4531
4541
  color: row.status === null ? "red" : optionColor(colors, "status", row.status) ?? "gray",
4532
- link: org === null || holder === void 0 ? null : itemUrl(org, holder.declaration.number, row.path)
4542
+ link: org === null || holder?.declaration.number == null ? null : itemUrl(org, holder.declaration.number, row.path)
4533
4543
  }))
4534
4544
  };
4535
4545
  });
@@ -4593,7 +4603,7 @@ async function runDetached(ws, input, io, event, rest) {
4593
4603
  if (boards.length === 0) return;
4594
4604
  const args = await rest(session, boards);
4595
4605
  if (args !== null)
4596
- (io.spawn ?? detached)(["pulse", "run", event, ...args], ws.root);
4606
+ (io.spawn ?? detached)(["board", "run", event, ...args], ws.root);
4597
4607
  } catch {
4598
4608
  }
4599
4609
  }
@@ -4615,7 +4625,7 @@ async function journalStart(ws, manifest, scope, cwd, input) {
4615
4625
  const which = plans.length === 1 ? plans.join("") : `${plans.join(" or ")} (pass --plan)`;
4616
4626
  return [
4617
4627
  [
4618
- `Journal: post a note with \`rness pulse note\` (or ${tool}) when you choose an approach, deviate from plan ${which}, are blocked, and when done.`,
4628
+ `Journal: post a note with \`rness note\` (or ${tool}) when you choose an approach, deviate from plan ${which}, are blocked, and when done.`,
4619
4629
  `At most ${a.limit}: decisions and their reasons, not steps.`,
4620
4630
  ...a.to === "repo" ? [
4621
4631
  "The first note prints the issue to reference; the pull request that completes this plan here carries `Closes <issue>`, an earlier one `Refs <issue>`."
@@ -4672,7 +4682,7 @@ async function sessionStart(input, io) {
4672
4682
  notes = [message2(e)];
4673
4683
  }
4674
4684
  const failure = await takeFailure();
4675
- if (failure !== null) notes.push(`pulse not updated \u2014 ${failure}`);
4685
+ if (failure !== null) notes.push(`board not updated \u2014 ${failure}`);
4676
4686
  notes.push(...await takeNotices());
4677
4687
  const warnings = noteLines(notes);
4678
4688
  const compact = input["source"] === "compact";
@@ -5286,6 +5296,44 @@ async function writtenFilesCommand(opts) {
5286
5296
  }
5287
5297
 
5288
5298
  // src/cli.ts
5299
+ function formerly(was, now) {
5300
+ process.stderr.write(`${was} is now ${now}
5301
+ `);
5302
+ }
5303
+ function noteCommandOf(parent, state, former) {
5304
+ parent.command("note [text]").description(
5305
+ "A note on the plan in progress: an approach, a deviation, a blocker, done (the text, or stdin)"
5306
+ ).option("--plan <path>", "the plan, when several are in progress").option("--kind <kind>", "approach, deviation, blocker or done").option(
5307
+ "--session <session>",
5308
+ "the session, when CLAUDE_CODE_SESSION_ID is not set"
5309
+ ).addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(
5310
+ async (text, opts) => {
5311
+ if (former !== void 0) formerly(former, "rness note");
5312
+ const { noteCommand } = await import("./note-XSJ7ASXM.js");
5313
+ state.code = await noteCommand({
5314
+ ...opts,
5315
+ ...text === void 0 ? {} : { text }
5316
+ });
5317
+ }
5318
+ );
5319
+ }
5320
+ function runCommand(parent, state, former) {
5321
+ parent.command("run <event>", { hidden: true }).requiredOption("--session <id>").option(
5322
+ "--path <path>",
5323
+ "the document edited (repeatable)",
5324
+ (value, previous = []) => [...previous, value]
5325
+ ).option("--scope <scope>", "the session's scope; absent, the root's").option("--clone <name>", "the clone the session worked in").addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(
5326
+ async (event, opts) => {
5327
+ if (former !== void 0) formerly(former, "rness board run");
5328
+ const { path, ...rest } = opts;
5329
+ state.code = await boardRunCommand({
5330
+ ...rest,
5331
+ event,
5332
+ paths: path ?? []
5333
+ });
5334
+ }
5335
+ );
5336
+ }
5289
5337
  function buildProgram(state) {
5290
5338
  const program = new Command().name("rness").description("Configuration-plane CLI for rness workspaces").version(VERSION, "-v, --version", "print the version").exitOverride().showHelpAfterError().configureOutput({
5291
5339
  writeOut: (s) => {
@@ -5342,60 +5390,29 @@ function buildProgram(state) {
5342
5390
  ).option("-y, --yes", "do not ask for confirmation").addOption(new Option("--cwd <dir>").hideHelp()).action(async (opts) => {
5343
5391
  state.code = await syncCommand(opts);
5344
5392
  });
5345
- const pulse = program.command("pulse").description("Show the agent's work on the organization's board");
5346
- pulse.command("create").description(
5347
- "Create the organization's Agent Pulse board, or a collection's own project, and sync"
5348
- ).argument(
5349
- "[collection]",
5350
- "a directory of .rness/ whose documents get a project of their own"
5351
- ).option("-y, --yes", "do not ask for confirmation").addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(async (collection, opts) => {
5352
- state.code = await pulseCreateCommand(
5353
- collection === void 0 ? opts : { ...opts, collection }
5354
- );
5393
+ const board = program.command("board").description(
5394
+ "The boards of rness.json: the documents of .rness/ on the provider"
5395
+ );
5396
+ board.command("push").description(
5397
+ "Create the boards rness.json declares and the provider lacks, then bring every board up to date with .rness/"
5398
+ ).option("-y, --yes", "create the boards not created yet without asking").addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(async (opts) => {
5399
+ state.code = await boardPushCommand(opts);
5355
5400
  });
5356
- pulse.command("sync").description(
5357
- "Bring every declared project up to date with the documents of .rness/"
5358
- ).addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(async (opts) => {
5359
- state.code = await pulseSyncCommand(opts);
5401
+ runCommand(board, state);
5402
+ noteCommandOf(program, state);
5403
+ const pulse = program.command("pulse", { hidden: true });
5404
+ pulse.command("create").argument("[collection]").option("-y, --yes").addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(async (collection, opts) => {
5405
+ state.code = await pulseCreateCommand(collection, opts);
5406
+ });
5407
+ pulse.command("sync").addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(async (opts) => {
5408
+ formerly("rness pulse sync", "rness board push");
5409
+ state.code = await boardPushCommand(opts);
5410
+ });
5411
+ noteCommandOf(pulse, state, "rness pulse note");
5412
+ runCommand(pulse, state, "rness pulse run");
5413
+ pulse.command("mark").allowUnknownOption().allowExcessArguments().action(() => {
5414
+ state.code = 0;
5360
5415
  });
5361
- pulse.command("mark", { hidden: true }).requiredOption("--session <id>").option(
5362
- "--path <path>",
5363
- "a document of .rness/ (repeatable)",
5364
- (value, previous = []) => [...previous, value]
5365
- ).option("--end", "clear the marks of the session, then sync").addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(
5366
- async (opts) => {
5367
- const { path, ...rest } = opts;
5368
- state.code = await pulseMarkCommand({ ...rest, paths: path ?? [] });
5369
- }
5370
- );
5371
- pulse.command("note [text]").description(
5372
- "a note on the plan in progress: an approach, a deviation, a blocker, done (the text, or stdin)"
5373
- ).option("--plan <path>", "the plan, when several are in progress").option("--kind <kind>", "approach, deviation, blocker or done").option(
5374
- "--session <session>",
5375
- "the session, when CLAUDE_CODE_SESSION_ID is not set"
5376
- ).addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(
5377
- async (text, opts) => {
5378
- const { pulseNoteCommand } = await import("./note-RBG7OXVI.js");
5379
- state.code = await pulseNoteCommand({
5380
- ...opts,
5381
- ...text === void 0 ? {} : { text }
5382
- });
5383
- }
5384
- );
5385
- pulse.command("run <event>", { hidden: true }).requiredOption("--session <id>").option(
5386
- "--path <path>",
5387
- "the document edited (repeatable)",
5388
- (value, previous = []) => [...previous, value]
5389
- ).option("--scope <scope>", "the session's scope; absent, the root's").option("--clone <name>", "the clone the session worked in").addOption(new Option("--github-api <base>").hideHelp()).addOption(new Option("--cwd <dir>").hideHelp()).action(
5390
- async (event, opts) => {
5391
- const { path, ...rest } = opts;
5392
- state.code = await pulseRunCommand({
5393
- ...rest,
5394
- event,
5395
- paths: path ?? []
5396
- });
5397
- }
5398
- );
5399
5416
  program.command("mcp").description(
5400
5417
  "Serve the workspace context to agents over MCP (stdio; read-only but for rness_note, when a board keeps a journal)"
5401
5418
  ).addOption(new Option("--cwd <dir>").hideHelp()).action(async (opts) => {
@@ -5579,4 +5596,4 @@ export {
5579
5596
  OWN_COMMANDS,
5580
5597
  catchUp
5581
5598
  };
5582
- //# sourceMappingURL=chunk-T5PINUCP.js.map
5599
+ //# sourceMappingURL=chunk-S4NARIQP.js.map