@fusebase/harness-lead 0.3.4 → 0.3.6
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/CHANGELOG.md +9 -0
- package/dist/lead.mjs +92 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.6 — 2026-12-04
|
|
4
|
+
|
|
5
|
+
- The `AGENTS.md` block that `install` and `update` write is prettier-clean (blank line after the begin marker and before the list). A repository that runs `prettier --check` over Markdown, such as nx-frontend, failed its format check on the 0.3.x block.
|
|
6
|
+
|
|
7
|
+
## 0.3.5 — 2026-12-04
|
|
8
|
+
|
|
9
|
+
- `lead commands [--json]`: the /lead commands with their argument and options (mode auto/approve/readonly, watch start/stop/interval, delegate check, qa milestone, activity analyze) as data, for interfaces that offer them in a menu. A test keeps it equal to `references/help.md`. Allowed in readonly mode.
|
|
10
|
+
- `lead suggest [--json]`: the command a person would most likely type next, from the next step of `status` (`/lead init`, `/lead plan`, `/lead task T-003`, `/lead qa T-005` …), with up to four other options as buttons. Interfaces offer it as a suggestion in the field; nothing runs by itself. Read-only.
|
|
11
|
+
|
|
3
12
|
## 0.3.4 — 2026-12-04
|
|
4
13
|
|
|
5
14
|
- `lead mode readonly`: lead reads and reports and changes nothing in the project. The CLI refuses every command that writes (exit 3, an allow-list, so a new command is refused until listed): task and board changes, `scaffold`, `spec`, `install`/`update`, `adopt --write`, `waves --write`, `sync-plan` without `--preview`, `watch` start/stop/ack/probe shadow. Reads, previews, `watch probe report|--dry`, the switches (`enable`, `mode`, `use`) and the local notes (`improve`, `activity`) still work. The session-start hook and the skill tell the agent to stay read-only. Editing files by the agent's own tools is held by those instructions, not by the CLI.
|
package/dist/lead.mjs
CHANGED
|
@@ -7536,7 +7536,7 @@ function validateMockupSwarm(root, workDir, input) {
|
|
|
7536
7536
|
|
|
7537
7537
|
// src/templates.gen.ts
|
|
7538
7538
|
var TEMPLATES = {
|
|
7539
|
-
"AGENTS.block.md": "<!-- lead:begin -->\n## lead (optional)\n\nThis repo can be worked with lead, a dev-loop kit. It is opt-in: ignore this section unless the person runs `/lead` (Claude Code) or `$lead` (Codex) or asks to use lead.\n\nWhen lead is used:\n- Plans and tasks live in `work/` (or `<project>/work/`); settings in `.lead/config.yml`; repo rules for lead in `.lead/local.md` and `.lead/local/`.\n- A lead task is done only when `node .lead/lead.mjs finish` succeeded.\n- Do not edit lead's own files (`.lead/lead.mjs`, `.agents/skills/lead*`, `.claude/skills/lead*`); an update replaces them.\n- A delegated service lives only in its skill (`\u2026/lead/delegates/<id>/` or `.lead/delegates/<id>/`). How it works, handoff, and check stay there; do not copy them into other lead files.\n- A Cursor `/goal` is not started by lead. When a goal is active here, follow the `lead-goal` skill: a short heartbeat every reply, and append events with `node .lead/lead.mjs activity` into `.lead/activity/` (for later harness analysis).\n<!-- lead:end -->\n",
|
|
7539
|
+
"AGENTS.block.md": "<!-- lead:begin -->\n\n## lead (optional)\n\nThis repo can be worked with lead, a dev-loop kit. It is opt-in: ignore this section unless the person runs `/lead` (Claude Code) or `$lead` (Codex) or asks to use lead.\n\nWhen lead is used:\n\n- Plans and tasks live in `work/` (or `<project>/work/`); settings in `.lead/config.yml`; repo rules for lead in `.lead/local.md` and `.lead/local/`.\n- A lead task is done only when `node .lead/lead.mjs finish` succeeded.\n- Do not edit lead's own files (`.lead/lead.mjs`, `.agents/skills/lead*`, `.claude/skills/lead*`); an update replaces them.\n- A delegated service lives only in its skill (`\u2026/lead/delegates/<id>/` or `.lead/delegates/<id>/`). How it works, handoff, and check stay there; do not copy them into other lead files.\n- A Cursor `/goal` is not started by lead. When a goal is active here, follow the `lead-goal` skill: a short heartbeat every reply, and append events with `node .lead/lead.mjs activity` into `.lead/activity/` (for later harness analysis).\n<!-- lead:end -->\n",
|
|
7540
7540
|
"config.yml": 'version: 1\n# planning: adopted # existing product with an established One Pager and tracker\n# Commands that verify a task. {name} is the project name in a monorepo.\nchecks: {}\nlimits:\n wip: 3 # tasks in progress at once\n rounds: 5 # do-and-check rounds before asking a human\n reviews: 3 # independent reviews before asking a human\n minutes: 60 # wall time on one task before stopping to report\n# projects: # uncomment for a repo with several projects\n# glob: apps/*\n# create: pnpm new {name}\n# work_dir: "{path}/work"\nshared_paths: []\n# worktree_setup: pnpm install --offline --frozen-lockfile # run once in each new task worktree\nreview: task\n# qa: # browser QA in reviews and /lead qa\n# run: pnpm dev {name}\n# url: http://localhost:5173\n# ready: Local:\n# can_show: deployed # one-pager "Can show now" needs `deployed:` on the task, not just a merge\n# sync: # /lead sync to FuseBase and Jira\n# fusebase: {org: <org id>, workspace: <workspace id>, parent_folder: <folder id>}\n# jira: {site: <site>.atlassian.net, project: <KEY>, epic: <KEY-1>}\n# links:\n# repo: https://gitlab.example.com/group/repo # web address; file links and merge requests\n# branch: main\n# app: https://dev.example.com/app # running instance, shown in the one-pager and issues\n',
|
|
7541
7541
|
"how.md": 'HOW TO WORK WITH LEAD\n\n /lead say what you want in plain words; lead shows the state and the next step\n /lead how this page /lead help all commands\n /lead enable lead is off by default for each person; this turns on its hooks for you\n\nTHE FLOW YOU (a person)\n 1 plan research or reverse \u2192 flows \u2192 mockups \u25C0\u2500\u2500 confirm the spec (flows, mockups, acceptance)\n \u2192 acceptance \u2192 architecture \u2192 tasks\n 2 build per task: worktree \u2192 code \u2192 checks\n \u2192 independent review with browser QA \u25C0\u2500\u2500 answer questions in "Needs you"\n \u2192 finish (waits for you) \u25C0\u2500\u2500 review and merge the branch\n 3 accept milestone QA in the browser \u25C0\u2500\u2500 decide "good enough": close the milestone,\n move the rest to the next one\n 4 share /lead sync \u2192 FuseBase notes, Jira \u25C0\u2500\u2500 one yes for note updates (if you have access)\n\nSTAGES\n Each bar starts when the previous stage ends. The dates are a reading order, not a plan.\n\n```mermaid\ngantt\n title Project stages\n dateFormat YYYY-MM-DD\n axisFormat %b %d\n\n section Plan\n Research :p1, 2026-01-01, 7d\n Flows :p2, after p1, 7d\n Mockups :p3, after p2, 7d\n Acceptance :p4, after p3, 7d\n Architecture :p5, after p4, 7d\n Tasks :p6, after p5, 7d\n\n section Build\n Build :b1, after p6, 7d\n Review :b2, after b1, 7d\n\n section Accept\n Milestone QA :c1, after b2, 7d\n\n section Share\n Sync :s1, after c1, 7d\n```\n\nWHERE THINGS ARE\n work/one-pager.md for the business: milestones, what can be shown, risks\n work/board.md for the team: ready, in progress, in review, needs you, waves\n work/spec.md the product, assembled from work/spec/ (do not edit spec.md itself)\n work/tasks/ one file per task: criteria, checks, review, questions\n .lead/config.yml checks, projects, sync, QA .lead/local* your rules (kept on update)\n\nRULES THAT MATTER\n \xB7 A task is done only when finish succeeded: checks recorded on the final code, every\n criterion pass, an independent review. "It works" in chat is not done.\n \xB7 A confirmed spec section changes only after you reopen it.\n \xB7 Work stopped midway (limit, computer off)? Run /lead: it offers to continue.\n \xB7 Keep work/ and .lead/config.yml in git: they are the shared state.\n',
|
|
7542
7542
|
"local-README.md": "# Project rules for lead skills\n\nFiles here are yours: `lead update` never changes them. Each adds rules on top of one lead skill reference:\n\n- `plan.md` \u2014 planning, spec stages, mockups\n- `task.md` \u2014 doing a task\n- `review.md` / `qa.md` \u2014 review and browser QA\n- `sync.md` \u2014 FuseBase / Jira sync\n- `reverse.md` \u2014 studying a running product\n\nGeneral rules for this repo go to `.lead/local.md`. Do not edit lead's own files (`.lead/lead.mjs`, `.agents/skills/lead*`, `.claude/skills/lead*`): an update replaces them.\n",
|
|
@@ -7549,7 +7549,7 @@ var TEMPLATES = {
|
|
|
7549
7549
|
"workspace-crew.md": "---\nname: crew-lead\ndescription: Run the lead workflow. Use only when the user invokes /crew-lead or $crew-lead.\n---\n<!-- evercrew:workspace-entry -->\nFollow the adjacent `../lead/SKILL.md` entry point as if the user invoked lead. Pass through the request and its arguments.\n",
|
|
7550
7550
|
"workspace-entry.md": "---\nname: lead\ndescription: Run lead for this project or show the workspace overview. Use when the user types /lead or $lead, asks to use lead, or asks for an overview of all workspace projects.\n---\n<!-- evercrew:workspace-entry -->\nIf the session context already names the lead launcher and kit, use them and skip the next two steps. Otherwise find the nearest `.lead/lead.mjs` from the directory this conversation started in. Preserve that starting directory as `--cwd` on the first call. Run `node <launcher> kit-path`, then read `skills/lead/SKILL.md` from the returned kit directory and follow it. References are relative to that kit directory. Keep the same session ID throughout this conversation. The launcher and kit path are local setup, not product state.\n",
|
|
7551
7551
|
"workspace-goal.md": "---\nname: lead-goal\ndescription: Record lead activity and keep the heartbeat for an active Cursor goal.\n---\n<!-- evercrew:workspace-entry -->\nRun `node .lead/lead.mjs kit-path` from the lead workspace or target checkout, then read `skills/lead-goal/SKILL.md` from the returned kit directory. Use the same repository scope and session ID as lead.\n",
|
|
7552
|
-
"workspace-launcher.mjs": "#!/usr/bin/env node\n// evercrew:workspace-entry\n// Portable entry point. The runtime belongs to the workspace or to the user's npm cache.\nimport { spawnSync } from 'node:child_process';\nimport { existsSync, mkdirSync, realpathSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst args = process.argv.slice(2);\nconst here = dirname(dirname(fileURLToPath(import.meta.url)));\nconst hook = args[0] === 'stop-check' || args[0] === 'session-start';\nconst cwdFlag = args.indexOf('--cwd');\nconst cwd = cwdFlag >= 0 && args[cwdFlag + 1] ? resolve(args[cwdFlag + 1]) : process.cwd();\nconst cli = (kit) => join(kit, 'dist/lead.mjs');\n\nfunction workspaceKit(start) {\n let dir = realpathSync(start);\n while (true) {\n if (existsSync(join(dir, '.lead/workspace.yml'))) {\n const kit = join(dir, '.lead/workspace-kit');\n if (existsSync(cli(kit))) return kit;\n if (hook) return;\n throw new Error(`The lead workspace at ${dir} has no runtime. Deploy its kit first.`);\n }\n if (dirname(dir) === dir) return;\n dir = dirname(dir);\n }\n}\n\nfunction run(bin, argv, diagnosticsOnly = false) {\n const result = spawnSync(bin, argv, { stdio: diagnosticsOnly ? ['inherit', 2, 2] : 'inherit', env: bin === 'npm' ? { ...process.env, 'npm_config_@fusebase:registry': 'https://registry.npmjs.org/' } : process.env });\n if (result.error) throw result.error;\n return result.status ?? 1;\n}\n\nfunction main() {\n const shared = workspaceKit(cwd) ?? workspaceKit(here);\n const installed = join(here, 'node_modules/@fusebase/harness-lead');\n const cache = join(process.env.XDG_CACHE_HOME || join(homedir(), '.cache'), 'harness-lead', 'standalone');\n const cached = join(cache, 'node_modules/@fusebase/harness-lead');\n let kit = shared ?? (existsSync(cli(cached)) ? cached : installed);\n if (!shared && (args[0] === 'update' || !existsSync(cli(kit)))) {\n if (hook) return 0;\n if (args[0] === 'update' && args.length > 1) throw new Error('Standalone launcher update refreshes the user cache. Run the chosen kit directly for an explicit source.');\n mkdirSync(cache, { recursive: true });\n const status = run('npm', ['install', '--prefix', cache, '--no-save', '--no-package-lock', '--ignore-scripts', '--no-audit', '--no-fund',\n args[0] === 'update' ? '@fusebase/harness-lead@latest' : '@fusebase/harness-lead@0.3.
|
|
7552
|
+
"workspace-launcher.mjs": "#!/usr/bin/env node\n// evercrew:workspace-entry\n// Portable entry point. The runtime belongs to the workspace or to the user's npm cache.\nimport { spawnSync } from 'node:child_process';\nimport { existsSync, mkdirSync, realpathSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst args = process.argv.slice(2);\nconst here = dirname(dirname(fileURLToPath(import.meta.url)));\nconst hook = args[0] === 'stop-check' || args[0] === 'session-start';\nconst cwdFlag = args.indexOf('--cwd');\nconst cwd = cwdFlag >= 0 && args[cwdFlag + 1] ? resolve(args[cwdFlag + 1]) : process.cwd();\nconst cli = (kit) => join(kit, 'dist/lead.mjs');\n\nfunction workspaceKit(start) {\n let dir = realpathSync(start);\n while (true) {\n if (existsSync(join(dir, '.lead/workspace.yml'))) {\n const kit = join(dir, '.lead/workspace-kit');\n if (existsSync(cli(kit))) return kit;\n if (hook) return;\n throw new Error(`The lead workspace at ${dir} has no runtime. Deploy its kit first.`);\n }\n if (dirname(dir) === dir) return;\n dir = dirname(dir);\n }\n}\n\nfunction run(bin, argv, diagnosticsOnly = false) {\n const result = spawnSync(bin, argv, { stdio: diagnosticsOnly ? ['inherit', 2, 2] : 'inherit', env: bin === 'npm' ? { ...process.env, 'npm_config_@fusebase:registry': 'https://registry.npmjs.org/' } : process.env });\n if (result.error) throw result.error;\n return result.status ?? 1;\n}\n\nfunction main() {\n const shared = workspaceKit(cwd) ?? workspaceKit(here);\n const installed = join(here, 'node_modules/@fusebase/harness-lead');\n const cache = join(process.env.XDG_CACHE_HOME || join(homedir(), '.cache'), 'harness-lead', 'standalone');\n const cached = join(cache, 'node_modules/@fusebase/harness-lead');\n let kit = shared ?? (existsSync(cli(cached)) ? cached : installed);\n if (!shared && (args[0] === 'update' || !existsSync(cli(kit)))) {\n if (hook) return 0;\n if (args[0] === 'update' && args.length > 1) throw new Error('Standalone launcher update refreshes the user cache. Run the chosen kit directly for an explicit source.');\n mkdirSync(cache, { recursive: true });\n const status = run('npm', ['install', '--prefix', cache, '--no-save', '--no-package-lock', '--ignore-scripts', '--no-audit', '--no-fund',\n args[0] === 'update' ? '@fusebase/harness-lead@latest' : '@fusebase/harness-lead@0.3.6'], true);\n if (status || !existsSync(cli(cached))) return status || 1;\n kit = cached;\n if (args[0] === 'update') return run(process.execPath, [cli(kit), 'version']);\n }\n if (args[0] === 'kit-path') {\n console.log(realpathSync(kit));\n return 0;\n }\n return run(process.execPath, [cli(kit), ...args]);\n}\n\ntry { process.exitCode = main(); }\ncatch (error) {\n if (!hook) console.error(`lead: ${error.message}`);\n process.exitCode = hook ? 0 : 1;\n}\n",
|
|
7553
7553
|
"backlog-index.md": '# <Project> Backlog\n\n[One Pager](one-pager.md)\n\n## Reviewed backlog\n\n<!-- evercrew:view kind="proposals" -->\n<!-- /evercrew:view -->\n\n## Needs triage\n\n<!-- For each candidate, link the task note and record what needs clarification. -->\n\n## Triage decisions\n\n<!-- Link source evidence and explain why an item was linked, completed, deferred or superseded. -->\n\n## History\n\n<!-- Link the complete source reconciliation, including repeated entries. -->\n',
|
|
7554
7554
|
"one-pager.md": '---\nmilestones:\n - id: mvp\n title: MVP\n shows: ""\n status: current\n---\n# <Project> \u2014 One Pager\n\n## Status now\n\n<!-- 3\u20134 sentences, written by a human. -->\n\n**What to show.**\n\n**What landed.**\n\n**Evidence.** <!-- Add the date, source revision, checks and open verification. -->\n\n<!-- evercrew:view kind="stats" -->\n<!-- /evercrew:view -->\n\n## Needs attention\n\n<!-- Decisions and immediate checks. Link the evidence and name the owner when known. -->\n\n## Product bet\n\n<!-- One sentence. -->\n\n## Research\n\nConclusions only. The long note is [the research](spec/01-research.md).\n\n<!-- Paste ### Conclusions from spec/01-research.md. Do not paste the rest. -->\n\n## Readiness\n\n<!-- evercrew:view kind="readiness" -->\n<!-- /evercrew:view -->\n\n## Roadmap\n\n<!-- evercrew:view kind="order" -->\n<!-- /evercrew:view -->\n\n## Next 3 steps\n\n<!-- evercrew:view kind="next-steps" -->\n<!-- /evercrew:view -->\n\n## Inbox triage\n\nTick an item when the team agrees to take it into the plan. Review higher priorities first, then use list order within each priority.\n\n<!-- Example: add real rows and remove this comment.\n:::checklist[Take into the plan]\n::check[:badge[Feature request]{tone="info"} :badge[High]{tone="danger"} Task summary \xB7 [Task note](tasks/T-001-example.md)]{done="false"}\n:::\n-->\n\n## Next versions (do not promise on a demo)\n\n## Reference\n\n- [Execution board](board.md)\n- [Backlog and triage decisions](backlog.md)\n<!-- Link history, architecture and QA evidence once available. -->\n',
|
|
7555
7555
|
"task-note.md": "# <Task summary>\n\n## Links\n\n<!-- Fill the links or document permitted exceptions before publishing. -->\n\n- [Epic](https://example.invalid/epic)\n- [Jira Story](https://example.invalid/story)\n- [Proposal](https://example.invalid/proposal)\n- [Mockup](https://example.invalid/mockup)\n- [One Pager](https://example.invalid/one-pager)\n\n## Goal\n\n<!-- Describe the user need and intended outcome. -->\n\n## User flow\n\n<!-- Add a Mermaid diagram covering the requested path. -->\n\n## Technical design\n\n<!-- Describe changes, interfaces, and relevant constraints. -->\n\n## Decisions\n\n<!-- Record agreed decisions and tradeoffs. -->\n\n## Acceptance criteria\n\n<!-- State observable checks and expected results. -->\n\n## Out of scope\n\n<!-- Name exclusions or say whether there are none. -->\n"
|
|
@@ -8297,7 +8297,7 @@ function ensureCodexHooks(root) {
|
|
|
8297
8297
|
}
|
|
8298
8298
|
|
|
8299
8299
|
// src/install.ts
|
|
8300
|
-
var VERSION = true ? "0.3.
|
|
8300
|
+
var VERSION = true ? "0.3.6" : "dev";
|
|
8301
8301
|
var LOCK_PATH = ".lead/kit.lock";
|
|
8302
8302
|
var SKILLS = ["lead", "crew-lead", "lead-goal"];
|
|
8303
8303
|
var SKILL_DIRS = [".agents/skills", ".claude/skills"];
|
|
@@ -9266,6 +9266,76 @@ function writeEntrypoints(root) {
|
|
|
9266
9266
|
}
|
|
9267
9267
|
}
|
|
9268
9268
|
|
|
9269
|
+
// src/commands.ts
|
|
9270
|
+
var COMMANDS = [
|
|
9271
|
+
{ name: "", summary: "state and next step \u2014 answer in plain words" },
|
|
9272
|
+
{ name: "status", summary: "state, plus a live check of every delegated task" },
|
|
9273
|
+
{ name: "", arg: "<url>", summary: "a teams.microsoft.com/l/message, Discord, or Slack message URL only" },
|
|
9274
|
+
{ name: "init", summary: "set up lead in this repo" },
|
|
9275
|
+
{ name: "plan", summary: "spec by stages (research or reverse \u2192 flows \u2192 mockups \u2192 acceptance) \u2192 architecture \u2192 tasks" },
|
|
9276
|
+
{ name: "reverse", arg: "<x>", summary: "study a running product in Docker and write how it works" },
|
|
9277
|
+
{ name: "task", arg: "[id]", summary: "work on a task (checks and independent review included)" },
|
|
9278
|
+
{ name: "qa", arg: "<id>", summary: "independent re-check of a task (browser QA when configured)", options: [{ name: "milestone", summary: "QA of the whole milestone" }] },
|
|
9279
|
+
{ name: "sync", summary: "mirror work/ to FuseBase notes and Jira (when configured)" },
|
|
9280
|
+
{ name: "delegate", summary: "hand a task to a service, or check one already handed off", options: [{ name: "check", summary: "check the tasks already handed off" }] },
|
|
9281
|
+
{
|
|
9282
|
+
name: "watch",
|
|
9283
|
+
summary: "clock for delegated tasks: start, stop, interval 15m|30m|1h",
|
|
9284
|
+
options: [
|
|
9285
|
+
{ name: "start", summary: "start the clock" },
|
|
9286
|
+
{ name: "stop", summary: "stop the clock" },
|
|
9287
|
+
{ name: "interval 15m", summary: "check every 15 minutes" },
|
|
9288
|
+
{ name: "interval 30m", summary: "check every 30 minutes" },
|
|
9289
|
+
{ name: "interval 1h", summary: "check every hour" }
|
|
9290
|
+
]
|
|
9291
|
+
},
|
|
9292
|
+
{ name: "how", summary: "how to work with lead: the scheme and where you are needed" },
|
|
9293
|
+
{ name: "improve", summary: "notes this project collected: where lead stopped, asked, or could have avoided it" },
|
|
9294
|
+
{ name: "activity", summary: "agent run log (.lead/activity/*.jsonl); `activity analyze` summarises waits and tasks", options: [{ name: "analyze", summary: "summarise waits and tasks" }] },
|
|
9295
|
+
{ name: "score", summary: "sample past runs, apply rubrics, or review recurring findings (references/score.md)" },
|
|
9296
|
+
{ name: "help", summary: "this list" },
|
|
9297
|
+
{
|
|
9298
|
+
name: "mode",
|
|
9299
|
+
summary: "auto, approve or readonly: whether a step inside the plan runs, waits, or nothing is changed (local, not in git)",
|
|
9300
|
+
options: [
|
|
9301
|
+
{ name: "auto", summary: "carry out the procedure and say what was done" },
|
|
9302
|
+
{ name: "approve", summary: "ask before each step" },
|
|
9303
|
+
{ name: "readonly", summary: "read and report, change nothing" }
|
|
9304
|
+
]
|
|
9305
|
+
},
|
|
9306
|
+
{ name: "enable", summary: "turn lead on for you in this repo (off by default; local, not in git)" },
|
|
9307
|
+
{ name: "disable", summary: "turn it off again" }
|
|
9308
|
+
];
|
|
9309
|
+
function suggest(next) {
|
|
9310
|
+
const task = (id2) => `/lead task ${id2}`;
|
|
9311
|
+
const each = (ids, label) => ids.slice(0, 4).map((id2) => ({ command: task(id2), label: label(id2) }));
|
|
9312
|
+
const one = (command) => ({ command, reason: next.reason, options: [] });
|
|
9313
|
+
switch (next.kind) {
|
|
9314
|
+
case "init":
|
|
9315
|
+
return one("/lead init");
|
|
9316
|
+
case "plan":
|
|
9317
|
+
case "milestone_done":
|
|
9318
|
+
return one("/lead plan");
|
|
9319
|
+
case "confirm_spec":
|
|
9320
|
+
return { ...one("/lead plan"), options: [{ command: "/lead plan", label: "Confirm the spec" }] };
|
|
9321
|
+
case "continue_task":
|
|
9322
|
+
return one(task(next.task));
|
|
9323
|
+
case "resume":
|
|
9324
|
+
return { command: task(next.tasks[0]), reason: next.reason, options: each(next.tasks, (id2) => `Continue ${id2}`) };
|
|
9325
|
+
case "answer":
|
|
9326
|
+
return { command: task(next.tasks[0]), reason: next.reason, options: each(next.tasks, (id2) => `Answer ${id2}`) };
|
|
9327
|
+
case "task":
|
|
9328
|
+
return { command: task(next.tasks[0]), reason: next.reason, options: each(next.tasks, (id2) => `Start ${id2}`) };
|
|
9329
|
+
case "review":
|
|
9330
|
+
return { command: `/lead qa ${next.tasks[0]}`, reason: next.reason, options: [...next.tasks.slice(0, 3).map((id2) => ({ command: `/lead qa ${id2}`, label: `Re-check ${id2}` })), { command: "/lead status", label: "Status of merges" }] };
|
|
9331
|
+
case "choose_project":
|
|
9332
|
+
case "mark_merged":
|
|
9333
|
+
case "adopted_project":
|
|
9334
|
+
case "fix":
|
|
9335
|
+
return one("/lead");
|
|
9336
|
+
}
|
|
9337
|
+
}
|
|
9338
|
+
|
|
9269
9339
|
// src/cli.ts
|
|
9270
9340
|
import { execFileSync as execFileSync6, spawnSync as spawnSync4 } from "node:child_process";
|
|
9271
9341
|
import { existsSync as existsSync31, mkdtempSync as mkdtempSync3, rmSync as rmSync6 } from "node:fs";
|
|
@@ -9300,6 +9370,8 @@ var READS = /* @__PURE__ */ new Set([
|
|
|
9300
9370
|
"--help",
|
|
9301
9371
|
"version",
|
|
9302
9372
|
"how",
|
|
9373
|
+
"commands",
|
|
9374
|
+
"suggest",
|
|
9303
9375
|
"status",
|
|
9304
9376
|
"check",
|
|
9305
9377
|
"projects",
|
|
@@ -11686,6 +11758,8 @@ Usage: node .lead/lead.mjs <command> [options]
|
|
|
11686
11758
|
install <repo> [--keep-modified] copy kit files into a repo (run from the kit)
|
|
11687
11759
|
update [--from GIT_URL|PATH] [--force] fetch the latest npm package and update kit files
|
|
11688
11760
|
how how to work with lead: the scheme, where a person is needed
|
|
11761
|
+
commands [--json] the /lead commands with their options, for an interface menu
|
|
11762
|
+
suggest [--json] the command a person would most likely type next, and other options
|
|
11689
11763
|
enable | disable | enabled turn lead's hooks on or off for you in this repo (local, not in git)
|
|
11690
11764
|
mode [auto|approve|clear] how lead treats a step inside the plan (local, not in git)
|
|
11691
11765
|
adopt --input FILE --id ID --home REPO [--flag KEY] [--write] [--force] [--json]
|
|
@@ -11753,7 +11827,7 @@ function main(argv, out = (s) => console.log(s)) {
|
|
|
11753
11827
|
const session = hookInput.session_id ?? str2(flags.session) ?? process.env.LEAD_SESSION;
|
|
11754
11828
|
let scope;
|
|
11755
11829
|
let sharedKit;
|
|
11756
|
-
if (cmd && !["help", "--help", "version", "how", "install"].includes(cmd)) {
|
|
11830
|
+
if (cmd && !["help", "--help", "version", "how", "install", "commands"].includes(cmd)) {
|
|
11757
11831
|
try {
|
|
11758
11832
|
const runningKit = kitRoot();
|
|
11759
11833
|
const deployed = basename3(runningKit) === "workspace-kit" && basename3(dirname6(runningKit)) === ".lead";
|
|
@@ -11868,6 +11942,16 @@ ${entry.source}:${entry.line}
|
|
|
11868
11942
|
case "version":
|
|
11869
11943
|
out(VERSION);
|
|
11870
11944
|
return 0;
|
|
11945
|
+
case "suggest": {
|
|
11946
|
+
const gctx = loadContext(cwd, project);
|
|
11947
|
+
const g = suggest(status(gctx, { session, isMerged: gitMergedChecker(gctx.root) }).next);
|
|
11948
|
+
if (flags.json) out(JSON.stringify(g, null, 2));
|
|
11949
|
+
else {
|
|
11950
|
+
out(`${g.command} \u2014 ${g.reason}`);
|
|
11951
|
+
for (const o of g.options) out(` ${o.command} ${o.label}`);
|
|
11952
|
+
}
|
|
11953
|
+
return 0;
|
|
11954
|
+
}
|
|
11871
11955
|
case "status": {
|
|
11872
11956
|
const sctx = loadContext(cwd, project);
|
|
11873
11957
|
const s = status(sctx, { session, isMerged: gitMergedChecker(sctx.root) });
|
|
@@ -12358,6 +12442,10 @@ start the builder with: ${r.launch}`);
|
|
|
12358
12442
|
case "how":
|
|
12359
12443
|
out(TEMPLATES["how.md"].trim());
|
|
12360
12444
|
return 0;
|
|
12445
|
+
case "commands":
|
|
12446
|
+
if (flags.json) out(JSON.stringify({ version: VERSION, prefix: "/lead", commands: COMMANDS }, null, 2));
|
|
12447
|
+
else for (const c of COMMANDS) out(`/lead${c.name ? ` ${c.name}` : ""}${c.arg ? ` ${c.arg}` : ""} \u2014 ${c.summary}${c.options ? ` (${c.options.map((o) => o.name).join(", ")})` : ""}`);
|
|
12448
|
+
return 0;
|
|
12361
12449
|
case "adopt": {
|
|
12362
12450
|
const root = repoRoot(cwd);
|
|
12363
12451
|
const input = typeof flags.input === "string" ? flags.input : "";
|
package/package.json
CHANGED