@punks/cli 2.5.4 → 2.6.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/README.md CHANGED
@@ -46,10 +46,12 @@ bun run baseline:build
46
46
 
47
47
  `hi scaffold setup` scans the target repo from `cwd` or `-i`, resolves the active scaffold baseline, writes scaffold output into the scan root or `-o`, copies the selected baseline skills, resolves pack-owned lint assets into `.devpunks/specs/lint/`, and ensures required global tool prerequisites for those skills. Use `--yes` in non-interactive harnesses to accept the resolved default pack selection without prompts.
48
48
 
49
- Before refreshing generated skills, setup/update may take a blind evidence snapshot of repo skill homes under `.devpunks/pre-existing-skills`. Commands do not classify skill overlaps or keep `-local` collision copies; follow-up agents reconcile exact name/id overlaps from `.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`, and `.opencode/skills`, archive replaced evidence under `.devpunks/replaced-skills/<skill-id>/...`, preserve non-overlaps through mirrors, and use `hi report` for baseline-worthy local knowledge.
49
+ Before refreshing generated skills, setup/update may take a blind evidence snapshot of repo skill homes under `.devpunks/pre-existing-skills`. Commands do not classify skill overlaps or keep `-local` collision copies. After setup, follow-up agents reconcile the skill homes, archive replaced evidence under `.devpunks/replaced-skills/<skill-id>/...`, preserve non-overlaps through mirrors, and use `hi report` for baseline-worthy local knowledge. After update, `$hi-cli` limits reconciliation to skill IDs added, removed, renamed, or reported as locally edited; same-ID content refreshes inspect only affected skills and active mirrors.
50
50
 
51
51
  `hi update --yes` applies managed scaffold updates without prompting. It is the non-interactive alias for the apply behavior of `--write`.
52
52
 
53
+ Post-update follow-through starts from the current summary and changed paths, not from existing `.devpunks/` artifacts. A clean run stops. Prompt, subagent, lint, hook, tool, source-guide, wiki, and pack work runs only for changed categories. Auto-accepted default/detected packs do not rerun setup. Write modes finish with targeted validation and one `hi check --json`; a bounded execution worker runs the command without delegating it again.
54
+
53
55
  `hi tools ensure` / `hint tools ensure` checks required external tools and repairs missing installable tools. In a scaffolded repo it reads tool IDs from `.devpunks/settings.json`; outside a scaffolded repo it validates the default Harness toolchain. Install contracts come from the trusted stable baseline, with bundled fallback, not from repo-owned metadata. This command is not read-only. It may install or repair missing tools. When `agent-browser` is present and a supported Chrome, Chromium, or Brave executable already exists, validation, setup, and update should not force a Chrome download.
54
56
 
55
57
  `hi -v` / `hint -v` is equivalent to `hi --version` / `hint --version`.
@@ -76,6 +78,8 @@ If `skills` is not installed as a global command yet:
76
78
  npx skills add https://github.com/wearedevpunks/skills/tree/main/skills/agnostic/cli/hi-cli --skill hi-cli --global --yes
77
79
  ```
78
80
 
81
+ Use `hi operator status`, `install`, `update`, or `migrate` to manage this independently installed operator skill. `hi skills rename` remains a deprecated alias for `hi operator migrate`. Operator mutations require the agent to reload or reactivate `$hi-cli`; their post-command flow does not inspect `.devpunks` artifacts or run scaffold follow-through. `hi upgrade` updates only the CLI executable.
82
+
79
83
  The lint scaffold is intentionally agent-facing rather than repo-mutating:
80
84
 
81
85
  - selected lint assets are emitted under `.devpunks/specs/lint/`
@@ -1,5 +1,27 @@
1
1
  # Baseline Changelog
2
2
 
3
+ ## baseline/stable/2026.07.13-runtime-product-validation - 2026-07-13
4
+
5
+ ### Changed
6
+
7
+ - Sync shared skills from `wearedevpunks/skills@d79eb2d`.
8
+ - Add `create-plan` task metadata for required runtime validation, target, evidence, and cleanup across process or infrastructure boundaries.
9
+ - Add the disclosed `implement-spec` runtime-product-validation reference and route its contract through sequential and parallel workers.
10
+ - Require public-entrypoint results plus correlated durable evidence, provenance-scoped cleanup, and exact blockers that leave affected tasks and acceptance criteria blocked.
11
+
12
+ ## baseline/stable/2026.07.13-hi-ensure-settings - 2026-07-13
13
+
14
+ ### Added
15
+
16
+ - Release the stable scaffold baseline with `hi ensure`, independently configurable backlog, asset, and repository providers, and an authoritative backlog project URL in `.devpunks/settings.json`.
17
+ - Sync `write-backlog` from `wearedevpunks/skills@add6bb4`, requiring the configured provider and project URL before provider materialization.
18
+
19
+ ## baseline/stable/2026.07.13-codex-multi-agent-config - 2026-07-13
20
+
21
+ ### Fixed
22
+
23
+ - Release the stable scaffold baseline for Codex `multi_agent_v2` compatibility by omitting legacy `agents.max_threads` from generated `.codex/config.toml` while retaining `agents.max_depth` and Harness hooks.
24
+
3
25
  ## baseline/stable/2026.07.10-manual-delivery-phase - 2026-07-10
4
26
 
5
27
  ### Fixed
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.6.1 - 2026-07-13
4
+
5
+ Pending npm publish: `@punks/cli@2.6.1`.
6
+
7
+ ### Added
8
+
9
+ - Add `hi operator status`, `hi operator install`, `hi operator update`, and `hi operator migrate` for explicit operator-skill management.
10
+
11
+ ### Changed
12
+
13
+ - Deprecate `hi skills rename` while retaining it as an alias for `hi operator migrate`.
14
+
15
+ ### Fixed
16
+
17
+ - Route change-sensitive `hi update` post-command handling correctly and refresh only targeted `hi-cli` installations without invoking Skills CLI update-all behavior.
18
+
19
+ ## baseline/stable/2026.07.13-runtime-product-validation - 2026-07-13
20
+
21
+ ### Changed
22
+
23
+ - Release a baseline-only shared-skill update that makes real supported-runtime evidence an explicit planning and implementation completion contract ([#70](https://github.com/wearedevpunks/harness-intelligence/issues/70)).
24
+
25
+ ## 2.6.0 - 2026-07-13
26
+
27
+ Pending npm publish: `@punks/cli@2.6.0`.
28
+
29
+ ### Added
30
+
31
+ - Add `hi ensure` to reconfigure backlog, asset, repository, and backlog project URL settings without rerunning scaffold initialization; scaffolded `write-backlog` now requires that configured destination before provider work.
32
+
33
+ ### Fixed
34
+
35
+ - Stop generated `.codex/config.toml` files from setting legacy `agents.max_threads`, which conflicts with Codex `multi_agent_v2`; retain `agents.max_depth` and generated hooks ([#71](https://github.com/wearedevpunks/harness-intelligence/issues/71)).
36
+
37
+ ## baseline/stable/2026.07.13-codex-multi-agent-config - 2026-07-13
38
+
39
+ ### Fixed
40
+
41
+ - Release the stable scaffold baseline for Codex `multi_agent_v2` compatibility by omitting legacy `agents.max_threads` from generated `.codex/config.toml` while retaining `agents.max_depth` and Harness hooks.
42
+
3
43
  ## 2.5.4 - 2026-07-10
4
44
 
5
45
  Pending npm publish: `@punks/cli@2.5.4`.
@@ -61,7 +61,6 @@ const claudeFormatCommand =
61
61
  function buildCodexAgentConfig({ hasFormatHook, hasUpdateCheckHook }) {
62
62
  const lines = [
63
63
  "[agents]",
64
- "max_threads = 6",
65
64
  "max_depth = 1",
66
65
  "",
67
66
  "[features]",
package/dist/index.js CHANGED
@@ -51355,7 +51355,7 @@ var embeddedAssets = [];
51355
51355
 
51356
51356
  // package.json
51357
51357
  var name = "@punks/cli";
51358
- var version = "2.5.4";
51358
+ var version = "2.6.1";
51359
51359
  // src/content/data.ts
51360
51360
  var findFirst8 = (candidates) => candidates.find((candidate) => existsSync(candidate));
51361
51361
  var executableSignature = () => {
@@ -54438,6 +54438,19 @@ var repositoryManagers = new Set(Object.keys(repositoryManagerTools));
54438
54438
  var backlogProviders = new Set(["azure-devops", "github", "linear", "monday"]);
54439
54439
  var assetProviders = new Set([...backlogProviders, ...repositoryManagers]);
54440
54440
  var requiredToolsForRepositoryManager = (repositoryManager) => repositoryManagerTools[repositoryManager];
54441
+ var reconcileRepositoryManagerTools = ({
54442
+ previousRepositoryManager,
54443
+ requiredTools,
54444
+ repositoryManager
54445
+ }) => {
54446
+ const previousManagerTools = new Set(requiredToolsForRepositoryManager(previousRepositoryManager));
54447
+ return [
54448
+ ...new Set([
54449
+ ...requiredTools.filter((tool) => !previousManagerTools.has(tool)),
54450
+ ...requiredToolsForRepositoryManager(repositoryManager)
54451
+ ])
54452
+ ].toSorted();
54453
+ };
54441
54454
  var isRepositoryManager = (value6) => typeof value6 === "string" && repositoryManagers.has(value6);
54442
54455
  var isBacklogProvider = (value6) => typeof value6 === "string" && backlogProviders.has(value6);
54443
54456
  var isAssetProvider = (value6) => typeof value6 === "string" && assetProviders.has(value6);
@@ -54452,6 +54465,7 @@ var normalizeRepoSettings = (value6) => {
54452
54465
  return {
54453
54466
  backlogProvider: record2.backlogProvider,
54454
54467
  assetProviderSlug: record2.assetProviderSlug,
54468
+ ...typeof record2.backlogProjectUrl === "string" ? { backlogProjectUrl: record2.backlogProjectUrl } : {},
54455
54469
  ...typeof record2.baselineVersion === "string" ? { baselineVersion: record2.baselineVersion } : {},
54456
54470
  ...typeof record2.cliVersion === "string" ? { cliVersion: record2.cliVersion } : {},
54457
54471
  repositoryManager: record2.repositoryManager,
@@ -54469,13 +54483,12 @@ var readRepoSettings = (rootDirectory) => {
54469
54483
  return null;
54470
54484
  return normalizeRepoSettings(JSON.parse(readFileSync4(settingsPath, "utf8")));
54471
54485
  };
54472
- var writeRepoSettings = (rootDirectory, settings, baseline = bundledBaseline) => {
54486
+ var writeRepoSettings = (rootDirectory, settings, baseline = bundledBaseline, options9 = {}) => {
54473
54487
  const settingsPath = path6.join(rootDirectory, repoSettingsFile);
54474
54488
  mkdirSync3(path6.dirname(settingsPath), { recursive: true });
54475
54489
  writeFileSync3(settingsPath, `${JSON.stringify({
54476
54490
  ...settings,
54477
- baselineVersion: baseline.summary.version,
54478
- cliVersion: version
54491
+ ...options9.stampVersions !== false ? { baselineVersion: baseline.summary.version, cliVersion: version } : {}
54479
54492
  }, null, 2)}
54480
54493
  `);
54481
54494
  return repoSettingsFile;
@@ -55077,7 +55090,7 @@ var listSkills = (scope5) => {
55077
55090
  var hiCliSkillName = "hi-cli";
55078
55091
  var legacyDpCliSkillName = "dp-cli";
55079
55092
  var hiCliSkillSource = "https://github.com/wearedevpunks/skills/tree/main/skills/agnostic/cli/hi-cli";
55080
- var skillUpdateCommand = (scope5) => scope5 === "global" ? ["skills", "update", hiCliSkillName, "--global", "--yes"] : ["skills", "update", hiCliSkillName, "--project", "--yes"];
55093
+ var skillUpdateCommand = (scope5) => scope5 === "global" ? ["skills", "add", hiCliSkillSource, "--skill", hiCliSkillName, "--global", "--yes"] : ["skills", "add", hiCliSkillSource, "--skill", hiCliSkillName, "--yes"];
55081
55094
  var skillInstallCommand = () => [
55082
55095
  "skills",
55083
55096
  "add",
@@ -55125,19 +55138,29 @@ var checkHiCliSkillPresence = () => {
55125
55138
  legacyGlobal: globalSkills.some((skill) => skill.name === legacyDpCliSkillName)
55126
55139
  };
55127
55140
  };
55128
- var renameHiCliSkill = () => {
55129
- const presence = checkHiCliSkillPresence();
55141
+ var emptySkillMutation = (presence) => ({
55142
+ ...presence,
55143
+ installedGlobal: false,
55144
+ updatedProject: false,
55145
+ updatedGlobal: false,
55146
+ removedLegacyProject: false,
55147
+ removedLegacyGlobal: false
55148
+ });
55149
+ var manageHiCliSkill = (action, dependencies = {
55150
+ checkPresence: checkHiCliSkillPresence,
55151
+ installGlobal: installHiCliSkillGlobal,
55152
+ update: updateHiCliSkill,
55153
+ removeLegacy: removeLegacyDpCliSkill
55154
+ }) => {
55155
+ const presence = dependencies.checkPresence();
55130
55156
  if (!presence.skillsCliAvailable) {
55131
- return {
55132
- ...presence,
55133
- installedGlobal: false,
55134
- updatedProject: false,
55135
- updatedGlobal: false,
55136
- removedLegacyProject: false,
55137
- removedLegacyGlobal: false
55138
- };
55157
+ return emptySkillMutation(presence);
55158
+ }
55159
+ if (action === "status") {
55160
+ return emptySkillMutation(presence);
55139
55161
  }
55140
- const installedGlobal = presence.detected ? false : installHiCliSkillGlobal();
55162
+ const shouldInstall = (action === "install" || action === "migrate") && !presence.detected;
55163
+ const installedGlobal = shouldInstall ? dependencies.installGlobal() : false;
55141
55164
  const hasHiCli = presence.detected || installedGlobal;
55142
55165
  if (!hasHiCli) {
55143
55166
  return {
@@ -55162,12 +55185,13 @@ var renameHiCliSkill = () => {
55162
55185
  legacyProject: presence.legacyProject,
55163
55186
  legacyGlobal: presence.legacyGlobal,
55164
55187
  installedGlobal,
55165
- updatedProject: presence.project ? updateHiCliSkill("project") : false,
55166
- updatedGlobal: presence.global ? updateHiCliSkill("global") : false,
55167
- removedLegacyProject: presence.legacyProject ? removeLegacyDpCliSkill("project") : false,
55168
- removedLegacyGlobal: presence.legacyGlobal ? removeLegacyDpCliSkill("global") : false
55188
+ updatedProject: (action === "update" || action === "migrate") && presence.project ? dependencies.update("project") : false,
55189
+ updatedGlobal: (action === "update" || action === "migrate") && presence.global ? dependencies.update("global") : false,
55190
+ removedLegacyProject: action === "migrate" && presence.legacyProject ? dependencies.removeLegacy("project") : false,
55191
+ removedLegacyGlobal: action === "migrate" && presence.legacyGlobal ? dependencies.removeLegacy("global") : false
55169
55192
  };
55170
55193
  };
55194
+ var renameHiCliSkill = () => manageHiCliSkill("migrate");
55171
55195
 
55172
55196
  // src/scaffold/prompt.ts
55173
55197
  import { createInterface as createInterface2 } from "node:readline/promises";
@@ -56442,6 +56466,8 @@ var renderCommandGuide = () => [
56442
56466
  " └ manage external Harness tool requirements",
56443
56467
  " › hi check",
56444
56468
  " └ check CLI executable and scaffold drift without writing",
56469
+ " › hi ensure",
56470
+ " └ reconfigure backlog, asset, repository, and backlog project URL settings",
56445
56471
  " › hi update",
56446
56472
  " └ refresh managed scaffold assets from `.devpunks/scaffold-manifest.json`",
56447
56473
  " › hi upgrade",
@@ -56450,18 +56476,19 @@ var renderCommandGuide = () => [
56450
56476
  "usage:",
56451
56477
  " • agents should activate `$hi-cli` before acting on `.devpunks` output",
56452
56478
  " • start with `hi scaffold` to inspect the lifecycle",
56453
- " • use `hi scaffold init` to choose the backlog provider and start docs onboarding/wiki output",
56479
+ " • use `hi scaffold init` to choose repository settings and start docs onboarding/wiki output",
56480
+ " • `hi ensure` updates `.devpunks/settings.json` without running scaffold init",
56454
56481
  " • reconcile the seeded wiki into the real repo layout before writing durable docs",
56455
56482
  " • use `hi scaffold setup` for repo-aware pack detection after repo boilerplate is ready",
56456
56483
  " • use `hi check` before work to catch CLI or scaffold baseline drift",
56457
56484
  " • use `hi update` after setup to pull newer scaffolded skills/prompts/manifests/hooks",
56458
56485
  " • use `hi skills rename` to migrate old dp-cli operator skill installs",
56459
- " • use `hi tools ensure` to check and repair required external tools",
56486
+ " • `hi tools ensure` checks and repairs required external tools",
56460
56487
  " • use `hi report` when reusable Harness friction should open GitHub-backed triage",
56461
56488
  " • accepted reports return a GitHub issue URL; missing server GitHub credentials fail the command",
56462
56489
  "",
56463
56490
  "operator notes:",
56464
- " • init copies docs-onboarding, requirements/backlog/spec skills, backlog-provider pin, and the initial wiki structure",
56491
+ " • init copies docs-onboarding, requirements/backlog/spec skills, repository settings, and the initial wiki structure",
56465
56492
  " • `setup` remains the repo-aware pack-driven scaffold flow",
56466
56493
  " • each command prints an operator-facing next-step prompt"
56467
56494
  ].join(`
@@ -60036,6 +60063,63 @@ When the generated init output matches the repo, the next CLI step is:
60036
60063
  ];
60037
60064
  var stageScaffoldById = Object.fromEntries(stageScaffoldCatalog.map((stage) => [stage.id, stage]));
60038
60065
 
60066
+ // src/scaffold/settings-selection.ts
60067
+ var providerChoices = [
60068
+ { title: "GitHub Projects and Issues", value: "github" },
60069
+ { title: "Linear", value: "linear" },
60070
+ { title: "Azure DevOps", value: "azure-devops" },
60071
+ { title: "monday.com", value: "monday" }
60072
+ ];
60073
+ var assetChoices = [
60074
+ ...providerChoices,
60075
+ { title: "GitLab", value: "gitlab" },
60076
+ { title: "Bitbucket", value: "bitbucket" }
60077
+ ];
60078
+ var repositoryChoices = [
60079
+ { title: "GitHub", value: "github" },
60080
+ { title: "GitLab", value: "gitlab" },
60081
+ { title: "Azure DevOps", value: "azure-devops" },
60082
+ { title: "Bitbucket", value: "bitbucket" }
60083
+ ];
60084
+ var validProjectUrl = (input2) => {
60085
+ const value6 = input2.trim();
60086
+ try {
60087
+ const url2 = new URL(value6);
60088
+ return url2.protocol === "http:" || url2.protocol === "https:" ? value6 : null;
60089
+ } catch {
60090
+ return null;
60091
+ }
60092
+ };
60093
+ var selectRepoSettings = ({
60094
+ prompt: prompt4,
60095
+ defaults,
60096
+ retryCommand
60097
+ }) => gen2(function* selectSettings() {
60098
+ const backlogProvider = yield* prompt4.singleSelect({
60099
+ choices: providerChoices,
60100
+ defaultValue: defaults?.backlogProvider ?? "github",
60101
+ message: "Select backlog provider"
60102
+ });
60103
+ const assetProviderSlug = yield* prompt4.singleSelect({
60104
+ choices: assetChoices,
60105
+ defaultValue: defaults?.assetProviderSlug ?? backlogProvider,
60106
+ message: "Select asset provider"
60107
+ });
60108
+ const repositoryManager = yield* prompt4.singleSelect({
60109
+ choices: repositoryChoices,
60110
+ defaultValue: defaults?.repositoryManager ?? "github",
60111
+ message: "Select repository manager"
60112
+ });
60113
+ const input2 = yield* prompt4.readLine(`Backlog project URL${defaults?.backlogProjectUrl ? ` [${defaults.backlogProjectUrl}]` : ""}: `);
60114
+ const backlogProjectUrl = validProjectUrl(input2 || defaults?.backlogProjectUrl || "");
60115
+ if (backlogProjectUrl === null) {
60116
+ return yield* fail9(new CliPromptError({
60117
+ message: `Backlog project URL must be an absolute HTTP(S) URL. Rerun \`${retryCommand}\`.`
60118
+ }));
60119
+ }
60120
+ return { assetProviderSlug, backlogProjectUrl, backlogProvider, repositoryManager };
60121
+ });
60122
+
60039
60123
  // src/scaffold/stage.ts
60040
60124
  var backlogProviderLabels2 = {
60041
60125
  "azure-devops": "Azure DevOps",
@@ -60084,68 +60168,12 @@ var baselineWithDefaultSkills = (baseline) => {
60084
60168
  const availableSkillIds = new Set(baseline.skills.map((skill) => skill.id));
60085
60169
  return defaultSkills.every((skillId) => availableSkillIds.has(skillId)) ? baseline : bundledBaseline;
60086
60170
  };
60087
- var promptBacklogProvider = ({
60088
- prompt: prompt4
60089
- }) => exports_Effect.gen(function* () {
60090
- const answer = yield* prompt4.singleSelect({
60091
- message: "Select backlog provider",
60092
- defaultValue: "github",
60093
- choices: [
60094
- {
60095
- title: "GitHub Projects and Issues",
60096
- value: "github",
60097
- description: "default"
60098
- },
60099
- {
60100
- title: "Linear",
60101
- value: "linear"
60102
- },
60103
- {
60104
- title: "Azure DevOps",
60105
- value: "azure-devops"
60106
- },
60107
- {
60108
- title: "monday.com",
60109
- value: "monday"
60110
- }
60111
- ]
60112
- });
60113
- return answer;
60114
- });
60115
60171
  var renderBacklogProviderMarkdown = (provider) => `# Backlog Provider
60116
60172
 
60117
60173
  Selected backlog provider: ${backlogProviderLabels2[provider]} (\`${provider}\`).
60118
60174
 
60119
60175
  Keep this provider pinned unless the user explicitly changes it. When requirements are ready for backlog writing, use \`write-backlog\` with the matching provider payload guidance.
60120
60176
  `;
60121
- var promptRepositoryManager = ({
60122
- prompt: prompt4
60123
- }) => exports_Effect.gen(function* () {
60124
- const answer = yield* prompt4.singleSelect({
60125
- message: "Select repository manager",
60126
- defaultValue: "github",
60127
- choices: [
60128
- {
60129
- title: "GitHub",
60130
- value: "github",
60131
- description: "default"
60132
- },
60133
- {
60134
- title: "GitLab",
60135
- value: "gitlab"
60136
- },
60137
- {
60138
- title: "Azure DevOps",
60139
- value: "azure-devops"
60140
- },
60141
- {
60142
- title: "Bitbucket",
60143
- value: "bitbucket"
60144
- }
60145
- ]
60146
- });
60147
- return answer;
60148
- });
60149
60177
  var promptWikiFramework = ({
60150
60178
  prompt: prompt4
60151
60179
  }) => exports_Effect.gen(function* () {
@@ -60567,9 +60595,9 @@ var runStageScaffold = ({
60567
60595
  baseline = bundledBaseline
60568
60596
  }) => exports_Effect.gen(function* () {
60569
60597
  const stage = stageScaffoldById[commandId];
60570
- const backlogProvider = yield* promptBacklogProvider({ prompt: prompt4 });
60598
+ const settings = yield* selectRepoSettings({ prompt: prompt4, retryCommand: "hi scaffold init" });
60599
+ const { backlogProvider, assetProviderSlug, backlogProjectUrl, repositoryManager } = settings;
60571
60600
  const wikiFramework = yield* promptWikiFramework({ prompt: prompt4 });
60572
- const repositoryManager = yield* promptRepositoryManager({ prompt: prompt4 });
60573
60601
  const detection = yield* detectRepository(outputDirectory).pipe(exports_Effect.catchAll(() => exports_Effect.succeed(emptyDetection(outputDirectory))));
60574
60602
  const scaffoldBaseline = baselineWithDefaultSkills(baseline);
60575
60603
  const finalPacks = defaultPackIdsForBaseline(scaffoldBaseline);
@@ -60599,7 +60627,8 @@ var runStageScaffold = ({
60599
60627
  });
60600
60628
  writeRepoSettings(outputDirectory, {
60601
60629
  backlogProvider,
60602
- assetProviderSlug: backlogProvider,
60630
+ assetProviderSlug,
60631
+ backlogProjectUrl,
60603
60632
  repositoryManager,
60604
60633
  requiredTools: [
60605
60634
  ...new Set([
@@ -60697,6 +60726,8 @@ var runStageScaffold = ({
60697
60726
  skillFiles,
60698
60727
  wikiFiles,
60699
60728
  backlogProvider,
60729
+ assetProviderSlug,
60730
+ backlogProjectUrl,
60700
60731
  repositoryManager,
60701
60732
  wikiFramework
60702
60733
  };
@@ -61653,6 +61684,140 @@ var checkCommand = exports_Command.make("check", {
61653
61684
  message: error4.message
61654
61685
  })))))).pipe(exports_Command.withDescription("Check managed scaffold, baseline, and CLI drift without writing files."));
61655
61686
 
61687
+ // src/cli/ensure-command.ts
61688
+ var runEnsure = ({
61689
+ rootDirectory,
61690
+ prompt: prompt4
61691
+ }) => gen2(function* ensureSettings() {
61692
+ const current = readRepoSettings(rootDirectory);
61693
+ if (current === null) {
61694
+ return yield* fail9(new CliPromptError({
61695
+ message: `${repoSettingsFile} was not found. Run \`hi scaffold init\` first.`
61696
+ }));
61697
+ }
61698
+ const selected = yield* selectRepoSettings({
61699
+ defaults: current,
61700
+ prompt: prompt4,
61701
+ retryCommand: "hi ensure"
61702
+ });
61703
+ writeRepoSettings(rootDirectory, {
61704
+ ...current,
61705
+ ...selected,
61706
+ requiredTools: reconcileRepositoryManagerTools({
61707
+ previousRepositoryManager: current.repositoryManager,
61708
+ repositoryManager: selected.repositoryManager,
61709
+ requiredTools: current.requiredTools
61710
+ })
61711
+ }, undefined, { stampVersions: false });
61712
+ });
61713
+ var ensureCommand = exports_Command.make("ensure", {}, () => scoped2(gen2(function* runEnsureCommand() {
61714
+ const prompt4 = yield* PromptLive;
61715
+ yield* runEnsure({ prompt: prompt4, rootDirectory: process.cwd() });
61716
+ }))).pipe(exports_Command.withDescription("Reconfigure backlog, asset, repository, and backlog project URL settings only."));
61717
+
61718
+ // src/cli/operator-command.ts
61719
+ var formatHiCli = (action, scope5, result) => {
61720
+ const detected = result[scope5];
61721
+ if (action === "status")
61722
+ return detected ? "installed" : "not installed";
61723
+ if (action === "install") {
61724
+ if (scope5 === "global" && result.installedGlobal)
61725
+ return "installed";
61726
+ return detected ? "already installed" : "not installed";
61727
+ }
61728
+ const updated = scope5 === "project" ? result.updatedProject : result.updatedGlobal;
61729
+ if (!detected) {
61730
+ return scope5 === "global" && result.installedGlobal ? "installed" : "not installed";
61731
+ }
61732
+ return updated ? "updated" : "update failed";
61733
+ };
61734
+ var formatLegacy = (action, scope5, result) => {
61735
+ const detected = scope5 === "project" ? result.legacyProject : result.legacyGlobal;
61736
+ if (!detected)
61737
+ return "not installed";
61738
+ if (action !== "migrate")
61739
+ return "installed";
61740
+ const removed = scope5 === "project" ? result.removedLegacyProject : result.removedLegacyGlobal;
61741
+ return removed ? "removed" : "remove failed";
61742
+ };
61743
+ var formatOperatorResult = (action, result) => renderCommandSection(`Operator skill ${action}`, [
61744
+ `hi-cli global: ${formatHiCli(action, "global", result)}`,
61745
+ `hi-cli project: ${formatHiCli(action, "project", result)}`,
61746
+ `dp-cli global: ${formatLegacy(action, "global", result)}`,
61747
+ `dp-cli project: ${formatLegacy(action, "project", result)}`
61748
+ ].join(`
61749
+ `));
61750
+ var hasOperatorFailure = (action, result) => {
61751
+ if (!result.skillsCliAvailable)
61752
+ return true;
61753
+ if (action === "status")
61754
+ return false;
61755
+ if (action === "install")
61756
+ return !result.detected && !result.installedGlobal;
61757
+ if (!result.detected && !result.installedGlobal)
61758
+ return true;
61759
+ if (result.project && !result.updatedProject)
61760
+ return true;
61761
+ if (result.global && !result.installedGlobal && !result.updatedGlobal)
61762
+ return true;
61763
+ if (action === "migrate" && result.legacyProject && !result.removedLegacyProject)
61764
+ return true;
61765
+ if (action === "migrate" && result.legacyGlobal && !result.removedLegacyGlobal)
61766
+ return true;
61767
+ return false;
61768
+ };
61769
+ var failedCommands = (action, result) => {
61770
+ const commands = [];
61771
+ if (!result.detected && !result.installedGlobal && (action === "install" || action === "migrate")) {
61772
+ commands.push(skillInstallCommand());
61773
+ }
61774
+ if (result.project && !result.updatedProject && (action === "update" || action === "migrate")) {
61775
+ commands.push(skillUpdateCommand("project"));
61776
+ }
61777
+ if (result.global && !result.installedGlobal && !result.updatedGlobal && (action === "update" || action === "migrate")) {
61778
+ commands.push(skillUpdateCommand("global"));
61779
+ }
61780
+ if (action === "migrate" && result.legacyProject && !result.removedLegacyProject) {
61781
+ commands.push(legacySkillRemoveCommand("project"));
61782
+ }
61783
+ if (action === "migrate" && result.legacyGlobal && !result.removedLegacyGlobal) {
61784
+ commands.push(legacySkillRemoveCommand("global"));
61785
+ }
61786
+ return commands;
61787
+ };
61788
+ var makeOperatorAction = (action) => exports_Command.make(action, {}, () => exports_Effect.sync(() => {
61789
+ const result = manageHiCliSkill(action);
61790
+ console.log(formatOperatorResult(action, result));
61791
+ if (!result.skillsCliAvailable) {
61792
+ console.error(renderCommandSection("Operator skill command failed", "`skills` was not found on PATH. Install the Skills CLI, then retry."));
61793
+ process.exitCode = 1;
61794
+ return;
61795
+ }
61796
+ if (hasOperatorFailure(action, result)) {
61797
+ const commands = failedCommands(action, result);
61798
+ if (commands.length > 0) {
61799
+ console.error(renderCommandSection("Failed Skills CLI commands", commands.map((command) => command.join(" ")).join(`
61800
+ `)));
61801
+ }
61802
+ process.exitCode = 1;
61803
+ return;
61804
+ }
61805
+ if (action !== "status") {
61806
+ console.log(renderHint("Reload $hi-cli to use the updated operator workflow."));
61807
+ }
61808
+ }));
61809
+ var statusCommand = makeOperatorAction("status").pipe(exports_Command.withDescription("Show hi-cli and legacy dp-cli installation status."));
61810
+ var installCommand = makeOperatorAction("install").pipe(exports_Command.withDescription("Install the hi-cli operator skill globally when absent."));
61811
+ var updateCommand = makeOperatorAction("update").pipe(exports_Command.withDescription("Update every detected hi-cli operator skill installation."));
61812
+ var migrateCommand = makeOperatorAction("migrate").pipe(exports_Command.withDescription("Install/update hi-cli and remove legacy dp-cli installations."));
61813
+ var operatorCommand = exports_Command.make("operator", {}, () => exports_Effect.sync(() => {
61814
+ console.log(renderCommandSection("Operator skill", `commands:
61815
+ › hi operator status
61816
+ › hi operator install
61817
+ › hi operator update
61818
+ › hi operator migrate`));
61819
+ })).pipe(exports_Command.withDescription("Manage the Harness operator skill."), exports_Command.withSubcommands([statusCommand, installCommand, updateCommand, migrateCommand]));
61820
+
61656
61821
  // src/cli/report-command.ts
61657
61822
  var messageOption = exports_Options.optional(exports_Options.text("message").pipe(exports_Options.withDescription("Raw report text for Harness triage.")));
61658
61823
  var titleOption = exports_Options.optional(exports_Options.text("title").pipe(exports_Options.withDescription("Deprecated: optional title hint. The API generates the final title.")));
@@ -62245,6 +62410,7 @@ var scaffoldCommand = exports_Command.make("scaffold", {}, () => exports_Effect.
62245
62410
  ]));
62246
62411
 
62247
62412
  // src/cli/skills-command.ts
62413
+ var skillsRenameDeprecationHint = "`hi skills rename` is deprecated. Use `hi operator migrate`.";
62248
62414
  var formatHiCliGlobal = (result) => {
62249
62415
  if (result.installedGlobal)
62250
62416
  return "installed";
@@ -62257,7 +62423,7 @@ var formatHiCliProject = (result) => {
62257
62423
  return "not installed";
62258
62424
  return result.updatedProject ? "updated" : "update failed";
62259
62425
  };
62260
- var formatLegacy = (detected, removed) => {
62426
+ var formatLegacy2 = (detected, removed) => {
62261
62427
  if (!detected)
62262
62428
  return "not installed";
62263
62429
  return removed ? "removed" : "remove failed";
@@ -62265,8 +62431,8 @@ var formatLegacy = (detected, removed) => {
62265
62431
  var formatSkillRenameResult = (result) => renderCommandSection("CLI skill rename", [
62266
62432
  `hi-cli global: ${formatHiCliGlobal(result)}`,
62267
62433
  `hi-cli project: ${formatHiCliProject(result)}`,
62268
- `dp-cli global: ${formatLegacy(result.legacyGlobal, result.removedLegacyGlobal)}`,
62269
- `dp-cli project: ${formatLegacy(result.legacyProject, result.removedLegacyProject)}`
62434
+ `dp-cli global: ${formatLegacy2(result.legacyGlobal, result.removedLegacyGlobal)}`,
62435
+ `dp-cli project: ${formatLegacy2(result.legacyProject, result.removedLegacyProject)}`
62270
62436
  ].join(`
62271
62437
  `));
62272
62438
  var hasSkillRenameFailure = (result) => {
@@ -62283,6 +62449,7 @@ var hasSkillRenameFailure = (result) => {
62283
62449
  return false;
62284
62450
  };
62285
62451
  var renameSkillCommand = exports_Command.make("rename", {}, () => exports_Effect.sync(() => {
62452
+ console.log(renderHint(skillsRenameDeprecationHint));
62286
62453
  const result = renameHiCliSkill();
62287
62454
  console.log(formatSkillRenameResult(result));
62288
62455
  if (!result.skillsCliAvailable) {
@@ -62295,11 +62462,10 @@ var renameSkillCommand = exports_Command.make("rename", {}, () => exports_Effect
62295
62462
  return;
62296
62463
  }
62297
62464
  console.log(renderHint("hi-cli is active and legacy dp-cli installs were removed."));
62298
- })).pipe(exports_Command.withDescription("Install/update the hi-cli skill and remove legacy dp-cli installs."));
62465
+ })).pipe(exports_Command.withDescription("Deprecated alias for `hi operator migrate`."));
62299
62466
  var skillsCommand = exports_Command.make("skills", {}, () => exports_Effect.sync(() => {
62300
- console.log(renderCommandSection("Skills", `commands:
62301
- › hi skills rename`));
62302
- })).pipe(exports_Command.withDescription("Manage Harness operator skills."), exports_Command.withSubcommands([renameSkillCommand]));
62467
+ console.log(renderCommandSection("Skills (deprecated)", "commands:\n › hi skills rename use `hi operator migrate`"));
62468
+ })).pipe(exports_Command.withDescription("Deprecated operator-skill compatibility commands."), exports_Command.withSubcommands([renameSkillCommand]));
62303
62469
 
62304
62470
  // src/cli/tools-command.ts
62305
62471
  import path17 from "node:path";
@@ -62386,7 +62552,7 @@ var yesOption2 = exports_Options.boolean("yes").pipe(exports_Options.withDescrip
62386
62552
  var jsonOption4 = exports_Options.boolean("json").pipe(exports_Options.withDescription("Print the machine-readable update payload to stdout."));
62387
62553
  var baselineOption4 = exports_Options.optional(exports_Options.choice("baseline", ["stable", "bundled"]).pipe(exports_Options.withDescription("Scaffold baseline to use. Defaults to latest stable remote baseline with bundled fallback.")));
62388
62554
  var refreshBaselineOption4 = exports_Options.boolean("refresh-baseline").pipe(exports_Options.withDescription("Refetch the stable baseline instead of reusing the local cache."));
62389
- var updateCommand = exports_Command.make("update", {
62555
+ var updateCommand2 = exports_Command.make("update", {
62390
62556
  input: inputOption4,
62391
62557
  check: checkOption,
62392
62558
  write: writeOption,
@@ -62482,15 +62648,19 @@ var startupCheckIntervalMs = Number.parseInt(process.env.HI_STARTUP_CHECK_INTERV
62482
62648
  var startupCheckCacheFile = path19.join(homedir3(), ".cache", "hi", "startup-check.json");
62483
62649
  var rootCommands = [
62484
62650
  checkCommand,
62651
+ ensureCommand,
62652
+ operatorCommand,
62485
62653
  reportCommand,
62486
62654
  scaffoldCommand,
62487
62655
  skillsCommand,
62488
62656
  toolsCommand,
62489
- updateCommand,
62657
+ updateCommand2,
62490
62658
  upgradeCommand
62491
62659
  ];
62492
62660
  var rootCommandNames = [
62493
62661
  "check",
62662
+ "ensure",
62663
+ "operator",
62494
62664
  "report",
62495
62665
  "scaffold",
62496
62666
  "skills",