harnessed 4.16.3 → 4.19.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/cli.mjs +410 -110
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/manifests/optional/codegraph.yaml +8 -2
- package/messages/en.json +2 -0
- package/messages/zh-Hans.json +2 -0
- package/package.json +1 -1
- package/workflows/role-prompts.yaml +2 -0
- package/workflows/role-prompts.zh-Hans.yaml +2 -0
- package/workflows/task/code/SKILL.md +9 -2
- package/workflows/task/code/SKILL.zh-Hans.md +9 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync, mkdirSync, renameSync, writeFileSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
|
-
import { join,
|
|
4
|
+
import { join, resolve, dirname, sep, win32, relative } from 'path';
|
|
5
5
|
import { Type } from '@sinclair/typebox';
|
|
6
6
|
import { readFile, readdir, unlink, writeFile, stat, rm, cp, mkdir, rename, access, appendFile } from 'fs/promises';
|
|
7
7
|
import { Value } from '@sinclair/typebox/value';
|
|
@@ -38,7 +38,7 @@ var init_package = __esm({
|
|
|
38
38
|
"package.json"() {
|
|
39
39
|
package_default = {
|
|
40
40
|
name: "harnessed",
|
|
41
|
-
version: "4.
|
|
41
|
+
version: "4.19.0",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -570,9 +570,9 @@ async function writeStoreRaw(store) {
|
|
|
570
570
|
const errs = [...Value.Errors(WorkflowStoreV1, store)].map((e) => e.message).join("; ");
|
|
571
571
|
throw new Error(`workflow-store schema validation failed: ${errs}`);
|
|
572
572
|
}
|
|
573
|
-
const
|
|
574
|
-
await mkdir(dirname(
|
|
575
|
-
await writeFileAtomic(
|
|
573
|
+
const p7 = storePath();
|
|
574
|
+
await mkdir(dirname(p7), { recursive: true });
|
|
575
|
+
await writeFileAtomic(p7, JSON.stringify(store, null, 2));
|
|
576
576
|
}
|
|
577
577
|
async function listWorkflows() {
|
|
578
578
|
const store = await readStoreRaw();
|
|
@@ -786,9 +786,9 @@ function scanPhases(repoRoot, includeTasks) {
|
|
|
786
786
|
function scanTasks(dirPath) {
|
|
787
787
|
for (const fname of ["task_plan.md", "progress.md"]) {
|
|
788
788
|
try {
|
|
789
|
-
const
|
|
790
|
-
if (!existsSync(
|
|
791
|
-
const m = /^[ \t]*- \[ \]\s+(.+)$/m.exec(readFileSync(
|
|
789
|
+
const p7 = join(dirPath, fname);
|
|
790
|
+
if (!existsSync(p7)) continue;
|
|
791
|
+
const m = /^[ \t]*- \[ \]\s+(.+)$/m.exec(readFileSync(p7, "utf8"));
|
|
792
792
|
const task = m?.[1];
|
|
793
793
|
if (task) return { nextUnchecked: task.trim() };
|
|
794
794
|
} catch {
|
|
@@ -867,7 +867,7 @@ function deriveNext(snapshot) {
|
|
|
867
867
|
reason: `sub '${failed.sub}' failed ${failed.fail_count}x \u2014 resolve before advancing`
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
|
-
const firstIncomplete = snapshot.phases.find((
|
|
870
|
+
const firstIncomplete = snapshot.phases.find((p7) => !p7.complete);
|
|
871
871
|
if (firstIncomplete) {
|
|
872
872
|
const task = firstIncomplete.tasks?.nextUnchecked;
|
|
873
873
|
if (task) return { kind: "task", phase: firstIncomplete.phase, task };
|
|
@@ -903,7 +903,7 @@ function describeUnit(unit) {
|
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
function remainingPhases(snapshot) {
|
|
906
|
-
return snapshot.phases.filter((
|
|
906
|
+
return snapshot.phases.filter((p7) => !p7.complete).length;
|
|
907
907
|
}
|
|
908
908
|
function pluralPhases(n) {
|
|
909
909
|
return `${n} phase${n === 1 ? "" : "s"} remain`;
|
|
@@ -1555,8 +1555,8 @@ function checkSecurityViolations(doc, filename, lineCounter) {
|
|
|
1555
1555
|
["spec", "verify", "cmd"],
|
|
1556
1556
|
["spec", "uninstall", "cmd"]
|
|
1557
1557
|
];
|
|
1558
|
-
for (const
|
|
1559
|
-
const err2 = checkScalarCmd(doc, lineCounter,
|
|
1558
|
+
for (const p7 of cmdPaths) {
|
|
1559
|
+
const err2 = checkScalarCmd(doc, lineCounter, p7, filename);
|
|
1560
1560
|
if (err2) errors.push(err2);
|
|
1561
1561
|
}
|
|
1562
1562
|
const cleanupNode = doc.getIn(["spec", "uninstall", "cleanup_paths"], true);
|
|
@@ -1735,6 +1735,112 @@ var init_origin_check = __esm({
|
|
|
1735
1735
|
"src/cli/lib/origin-check.ts"() {
|
|
1736
1736
|
}
|
|
1737
1737
|
});
|
|
1738
|
+
|
|
1739
|
+
// messages/en.json
|
|
1740
|
+
var en_default;
|
|
1741
|
+
var init_en = __esm({
|
|
1742
|
+
"messages/en.json"() {
|
|
1743
|
+
en_default = {
|
|
1744
|
+
"setup.workflows_not_found": "error: workflows directory not found at {{path}}",
|
|
1745
|
+
"setup.nothing_to_install": "setup: no workflow directories with SKILL.md found \u2014 nothing to install",
|
|
1746
|
+
"setup.dry_run.header": "[dry-run] setup would install {{count}} workflow(s) to {{path}}:",
|
|
1747
|
+
"setup.dry_run.run_hint": " run without --dry-run to execute",
|
|
1748
|
+
"setup.copy_failed": " error: failed to copy {{name}}: {{message}}",
|
|
1749
|
+
"setup.step_a_complete": "Step A: {{count}} workflows installed to {{path}}",
|
|
1750
|
+
"setup.step_a_render.complete": " generated {{count}}/{{total}} command files",
|
|
1751
|
+
"setup.step_a_render.warnings_header": " [A.5] warnings \u2014 some capability cmds could not be fully resolved:",
|
|
1752
|
+
"setup.step_c.created": " [C] created {{path}} + enabled Agent Teams",
|
|
1753
|
+
"setup.step_c.already_enabled": " [C] Agent Teams already enabled ({{path}})",
|
|
1754
|
+
"setup.step_c.enabled_backup": " [C] enabled Agent Teams in {{path}} (backup saved \u2192 {{backupPath}})",
|
|
1755
|
+
"setup.step_c.skipped": " [C] Agent Teams enable skipped: {{message}}",
|
|
1756
|
+
"setup.step_d.created": " [D] created {{path}} + wrote env.HARNESSED_USER_LANG={{lang}}",
|
|
1757
|
+
"setup.step_d.already_set": " [D] env.HARNESSED_USER_LANG={{lang}} already set in {{path}} \u2014 respecting user override",
|
|
1758
|
+
"setup.step_d.enabled_backup": " [D] wrote env.HARNESSED_USER_LANG={{lang}} in {{path}} (backup saved \u2192 {{backupPath}})",
|
|
1759
|
+
"setup.step_d.skipped": " [D] User language write skipped: {{message}}",
|
|
1760
|
+
"setup.step_b_complete": "Upstream components: {{installed}} installed / {{already}} already-installed / {{skipped}} skipped / {{failed}} failed [{{seconds}}s]",
|
|
1761
|
+
"setup.complete": "setup complete \u2014 {{skills}} workflows + {{manifests}} base manifests configured",
|
|
1762
|
+
"setup.mcp_hint": "Run /mcp in Claude Code to verify MCP server connections.",
|
|
1763
|
+
"setup.mcp_hint_codex": "Run codex mcp list to verify MCP server connections.",
|
|
1764
|
+
"setup.bundled_summary": "\nharnessed workflows bundled at <packageRoot>/workflows/ (share-only, read-only)",
|
|
1765
|
+
"setup.bundled_location": "",
|
|
1766
|
+
"setup.doctor_hint": "\nRun harnessed doctor to verify your environment.",
|
|
1767
|
+
"agent_teams.missing_header": "\n\u26A0\uFE0F Agent Teams not enabled \u2014 parallelism upgrade path unavailable",
|
|
1768
|
+
"agent_teams.missing_fix": " fix: claude config set env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS 1",
|
|
1769
|
+
"agent_teams.missing_explanation": " harnessed task parallelism uses Subagent or Agent Teams (CC 2.1.133+)",
|
|
1770
|
+
"agent_teams.missing_nonblocking": " non-blocking \u2014 auto-degrades to subagent fan-out\n",
|
|
1771
|
+
"install.manifest_not_found": "error: manifest '{{name}}' not found",
|
|
1772
|
+
"install.manifest_not_found.fix": " fix: ensure manifests/tools/{{name}}.yaml, manifests/skill-packs/{{name}}.yaml, or manifests/optional/{{name}}.yaml exists",
|
|
1773
|
+
"install.audit_hint": " fix: run 'harnessed audit' to inspect manifest issues",
|
|
1774
|
+
"install.success": "installed {{name}}",
|
|
1775
|
+
"install.success_with_version": "installed {{name}}@{{version}}",
|
|
1776
|
+
"install.already_installed": "already-installed {{name}} (idempotent check hit; nothing to do)",
|
|
1777
|
+
"install.already_installed_with_version": "already-installed {{name}}@{{version}} (idempotent check hit; nothing to do)",
|
|
1778
|
+
"install.aborted": "aborted: {{reason}}",
|
|
1779
|
+
"uninstall.dry_run.preview": "[dry-run] would uninstall '{{name}}' via method '{{method}}'",
|
|
1780
|
+
"uninstall.dry_run.run_hint": " run without --dry-run to execute",
|
|
1781
|
+
"uninstall.confirm.prompt": "Uninstall '{{name}}'? This cannot be undone.",
|
|
1782
|
+
"uninstall.cancelled": "aborted: user cancelled",
|
|
1783
|
+
"uninstall.completed": "uninstalled {{name}}",
|
|
1784
|
+
"uninstall.unified.nothing": "nothing to do \u2014 no harnessed artifacts found",
|
|
1785
|
+
"uninstall.unified.header": "harnessed uninstall will remove the following:",
|
|
1786
|
+
"uninstall.unified.commands": " Commands: {{count}} harnessed-generated slash command file(s) in ~/.claude/commands/",
|
|
1787
|
+
"uninstall.unified.skills": " Skills: {{count}} workflow skill directory(ies) in ~/.claude/skills/",
|
|
1788
|
+
"uninstall.unified.settings": " Settings: harnessed env vars (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS, HARNESSED_USER_LANG) from ~/.claude/settings.json",
|
|
1789
|
+
"uninstall.unified.state_dir": " State directory: ~/.claude/harnessed/ (includes backups, audit log, state, lock)",
|
|
1790
|
+
"uninstall.unified.upstream_note": "\nUpstream components (npm packages, MCP servers, CC plugins, git-cloned repos, npx skills) are NOT affected.",
|
|
1791
|
+
"uninstall.unified.dry_run_hint": "\n(dry-run \u2014 re-run without --dry-run to actually remove)",
|
|
1792
|
+
"uninstall.unified.confirm": "Remove harnessed's own files? Upstream components (npm packages, MCP servers, CC plugins, etc.) will NOT be affected. This cannot be undone.",
|
|
1793
|
+
"uninstall.unified.removing": "removing harnessed files...",
|
|
1794
|
+
"uninstall.unified.removed_commands": " removed {{count}} command file(s)",
|
|
1795
|
+
"uninstall.unified.removed_skills": " removed {{count}} skill directory(ies)",
|
|
1796
|
+
"uninstall.unified.removed_settings": " removed harnessed env vars from ~/.claude/settings.json",
|
|
1797
|
+
"uninstall.unified.removed_state_dir": " removed ~/.claude/harnessed/",
|
|
1798
|
+
"uninstall.unified.partial_failure": "\n{{count}} item(s) could not be removed (permission denied or already gone):",
|
|
1799
|
+
"uninstall.unified.complete": "uninstall complete \u2014 harnessed's own files have been removed",
|
|
1800
|
+
"gc.invalid_duration": "error: invalid --older-than '{{value}}'",
|
|
1801
|
+
"gc.invalid_duration.fix": " fix: use format <N>{d|h|m|w} e.g. 30d / 24h / 60m / 4w",
|
|
1802
|
+
"gc.no_backups": "no backups found ({{root}} absent) \u2014 nothing to gc",
|
|
1803
|
+
"gc.no_old_snapshots": "no snapshots older than {{cutoff}} (kept {{keptCount}} most-recent)",
|
|
1804
|
+
"gc.summary_will_delete": "would delete {{count}} snapshot(s), ~{{sizeKb}} KB total:",
|
|
1805
|
+
"gc.summary_deleting": "deleting {{count}} snapshot(s), ~{{sizeKb}} KB total:",
|
|
1806
|
+
"gc.dry_run_rerun_hint": "\n(dry-run \u2014 re-run without --dry-run to actually delete)",
|
|
1807
|
+
"doctor.summary.fail": "\nsome checks failed (see fix hints above)",
|
|
1808
|
+
"doctor.summary.warn": "\nall checks ok (with warnings \u2014 see hints above)",
|
|
1809
|
+
"doctor.summary.pass": "\nall checks passed",
|
|
1810
|
+
"backup.no_backups": "no backups found ({{root}} absent)",
|
|
1811
|
+
"backup.no_backups_empty": "no backups found ({{root}} empty)",
|
|
1812
|
+
"backup.total_snapshots": "\n{{count}} snapshot(s) total",
|
|
1813
|
+
"rollback.metadata_unreadable": "error: cannot read {{path}}: {{message}}",
|
|
1814
|
+
"rollback.metadata_unreadable.fix": " fix: run 'harnessed backup list' to see available timestamps",
|
|
1815
|
+
"rollback.checksum_mismatch": "error: backup checksum mismatch for {{target}} (expected {{expected}}, got {{actual}})",
|
|
1816
|
+
"rollback.restored": "restored {{count}} file(s) from {{timestamp}}",
|
|
1817
|
+
"status.no_installs": "no installs recorded ({{path}} absent or empty)",
|
|
1818
|
+
"status.summary_installs": "\n{{count}} install(s) recorded",
|
|
1819
|
+
"status.lock_held": "\nlock: held (since {{since}}){{staleSuffix}}",
|
|
1820
|
+
"status.lock_held.stale_suffix": " \u2014 STALE",
|
|
1821
|
+
"status.lock_release_hint": " to release: wait for process to finish or delete {{path}}",
|
|
1822
|
+
"status.lock_free": "\nlock: free",
|
|
1823
|
+
"here.no_workflow": "no active workflow for this repo ({{path}} has no entry for cwd)",
|
|
1824
|
+
"here.no_workflow.hint": " to start: run a stage (e.g. `harnessed gates discuss`) or `harnessed run <workflow>`",
|
|
1825
|
+
"audit_log.no_records_file": "no audit records found ({{path}} does not exist)",
|
|
1826
|
+
"audit_log.no_records_empty": "no audit records found (audit.log is empty)",
|
|
1827
|
+
"audit_log.jq_missing": "\u2717 jq not found in PATH \u2014 run: harnessed doctor",
|
|
1828
|
+
"audit_log.tail_invalid": "\u2717 --tail must be a positive integer",
|
|
1829
|
+
"audit_log.head_invalid": "\u2717 --head must be a positive integer",
|
|
1830
|
+
"execute_task.require_task": "error: --task <text> is required",
|
|
1831
|
+
"execute_task.load_phases_failed": "error: failed to load workflows/{{workflow}}/phases.yaml \u2014 {{message}}",
|
|
1832
|
+
"execute_task.precommit_skipped": "\u26A0\uFE0F before-commit pre-flight skipped ({{message}}); subagent will biome-check at commit time.",
|
|
1833
|
+
"research.require_query": "error: --query <text> is required",
|
|
1834
|
+
"manifest_add.non_interactive_warn": "[ee-5-gate] WARN: --non-interactive skips 5-question prompt (D-03 dry-run-only). plan-phase hard reject still applies.",
|
|
1835
|
+
"manifest_add.dry_run_preview": "[manifest-add] dry-run preview for upstream: {{upstream}} \u2192 {{path}}",
|
|
1836
|
+
"manifest_add.empty_answer": "error: EE-5 gate requires non-empty answer",
|
|
1837
|
+
"manifest_add.gate_passed_wrote": "[manifest-add] EE-5 gate passed; wrote {{path}}",
|
|
1838
|
+
"manifest_add.gate_passed_dry_run": "[manifest-add] EE-5 gate passed (dry-run); would write {{path}}",
|
|
1839
|
+
"resume.fail": "\u2717 {{error}}",
|
|
1840
|
+
"resume.corrupt": "\u2717 {{error}}\n path: {{path}}"
|
|
1841
|
+
};
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1738
1844
|
function mapToSupported(raw) {
|
|
1739
1845
|
if (!raw) return "en";
|
|
1740
1846
|
if (/^zh([^a-z]|$)/i.test(raw)) return "zh-Hans";
|
|
@@ -1770,7 +1876,7 @@ function loadLocale(locale) {
|
|
|
1770
1876
|
const raw = readFileSync(path, "utf8");
|
|
1771
1877
|
cache[locale] = JSON.parse(raw);
|
|
1772
1878
|
} catch {
|
|
1773
|
-
cache[locale] = {};
|
|
1879
|
+
cache[locale] = locale === "en" ? en_default : {};
|
|
1774
1880
|
}
|
|
1775
1881
|
return cache[locale];
|
|
1776
1882
|
}
|
|
@@ -1800,6 +1906,7 @@ function t(key, params) {
|
|
|
1800
1906
|
var SUPPORTED, currentLocale, cache;
|
|
1801
1907
|
var init_i18n = __esm({
|
|
1802
1908
|
"src/i18n/index.ts"() {
|
|
1909
|
+
init_en();
|
|
1803
1910
|
SUPPORTED = /* @__PURE__ */ new Set(["en", "zh-Hans"]);
|
|
1804
1911
|
currentLocale = null;
|
|
1805
1912
|
cache = {};
|
|
@@ -2504,7 +2611,7 @@ function nameToYamlHintPath(name) {
|
|
|
2504
2611
|
function shouldOverwriteFile(content) {
|
|
2505
2612
|
return HARNESSED_MARKER_RX.test(content) || V3_4_3_SIGNATURE_SUB_RX.test(content) || V3_4_3_SIGNATURE_MASTER_RX.test(content);
|
|
2506
2613
|
}
|
|
2507
|
-
async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabilities, installedPlugins, installedUserSkills, writer, fileExists2 = existsSync, readFileSync14 = (
|
|
2614
|
+
async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabilities, installedPlugins, installedUserSkills, writer, fileExists2 = existsSync, readFileSync14 = (p7) => readFileSync(p7, "utf8")) {
|
|
2508
2615
|
const results = [];
|
|
2509
2616
|
const aggregatedWarnings = /* @__PURE__ */ new Set();
|
|
2510
2617
|
for (const name of slashNames) {
|
|
@@ -3461,10 +3568,10 @@ ${rp.checklist.map((c, i) => ` ${i + 1}. ${c}`).join("\n")}` : "";
|
|
|
3461
3568
|
}
|
|
3462
3569
|
function isRalphLoopOptIn(phase) {
|
|
3463
3570
|
if (!phase || typeof phase !== "object") return false;
|
|
3464
|
-
const
|
|
3465
|
-
if (
|
|
3466
|
-
if (
|
|
3467
|
-
const fb =
|
|
3571
|
+
const p7 = phase;
|
|
3572
|
+
if (p7.max_iterations !== void 0 && p7.max_iterations !== null) return true;
|
|
3573
|
+
if (p7.upstream === "ralph-loop") return true;
|
|
3574
|
+
const fb = p7.fallback;
|
|
3468
3575
|
if (fb?.max_iterations_exceeded !== void 0) return true;
|
|
3469
3576
|
return false;
|
|
3470
3577
|
}
|
|
@@ -3729,6 +3836,83 @@ This applies to: strategic-layer review skip / phase-layer clarification skip /
|
|
|
3729
3836
|
};
|
|
3730
3837
|
}
|
|
3731
3838
|
});
|
|
3839
|
+
function getPackageRoot() {
|
|
3840
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
3841
|
+
const thisDir = dirname(thisFile);
|
|
3842
|
+
if (thisDir.endsWith("dist") || thisDir.replace(/\\/g, "/").endsWith("/dist")) {
|
|
3843
|
+
return resolve(thisDir, "..");
|
|
3844
|
+
}
|
|
3845
|
+
return resolve(thisDir, "..", "..", "..");
|
|
3846
|
+
}
|
|
3847
|
+
var init_packagePath = __esm({
|
|
3848
|
+
"src/cli/lib/packagePath.ts"() {
|
|
3849
|
+
}
|
|
3850
|
+
});
|
|
3851
|
+
|
|
3852
|
+
// src/cli/lib/assetsRoot.ts
|
|
3853
|
+
var assetsRoot_exports = {};
|
|
3854
|
+
__export(assetsRoot_exports, {
|
|
3855
|
+
computeAssetsRoot: () => computeAssetsRoot,
|
|
3856
|
+
getAssetsRoot: () => getAssetsRoot,
|
|
3857
|
+
isCompiledModuleUrl: () => isCompiledModuleUrl
|
|
3858
|
+
});
|
|
3859
|
+
function isCompiledModuleUrl(url) {
|
|
3860
|
+
let s = url;
|
|
3861
|
+
try {
|
|
3862
|
+
s = decodeURIComponent(url);
|
|
3863
|
+
} catch {
|
|
3864
|
+
}
|
|
3865
|
+
const normalized = s.replace(/\\/g, "/").toLowerCase();
|
|
3866
|
+
return BUNFS_MARKERS.some((m) => normalized.includes(m));
|
|
3867
|
+
}
|
|
3868
|
+
function computeAssetsRoot(d) {
|
|
3869
|
+
const override = d.env.HARNESSED_ASSETS_OVERRIDE;
|
|
3870
|
+
if (override && override.trim().length > 0) {
|
|
3871
|
+
return { root: override.trim(), source: "override", compiledAssetsMissing: false };
|
|
3872
|
+
}
|
|
3873
|
+
if (isCompiledModuleUrl(d.moduleUrl)) {
|
|
3874
|
+
const root = join(d.stateRoot(), "assets", d.version);
|
|
3875
|
+
const present = d.exists(join(root, "workflows"));
|
|
3876
|
+
return { root, source: "compiled", compiledAssetsMissing: !present };
|
|
3877
|
+
}
|
|
3878
|
+
return { root: d.packageRoot, source: "package", compiledAssetsMissing: false };
|
|
3879
|
+
}
|
|
3880
|
+
function realDeps() {
|
|
3881
|
+
return {
|
|
3882
|
+
env: process.env,
|
|
3883
|
+
moduleUrl: import.meta.url,
|
|
3884
|
+
exists: (p7) => {
|
|
3885
|
+
try {
|
|
3886
|
+
return existsSync(p7);
|
|
3887
|
+
} catch {
|
|
3888
|
+
return false;
|
|
3889
|
+
}
|
|
3890
|
+
},
|
|
3891
|
+
stateRoot: () => detectPlatform().stateRoot,
|
|
3892
|
+
packageRoot: getPackageRoot(),
|
|
3893
|
+
version: package_default.version
|
|
3894
|
+
};
|
|
3895
|
+
}
|
|
3896
|
+
function getAssetsRoot() {
|
|
3897
|
+
const r = computeAssetsRoot(realDeps());
|
|
3898
|
+
if (r.source === "compiled" && r.compiledAssetsMissing && !warnedMissing) {
|
|
3899
|
+
warnedMissing = true;
|
|
3900
|
+
console.error(
|
|
3901
|
+
`warning: compiled harnessed binary but bundled assets are not unpacked at ${r.root} \u2014 asset-dependent commands (setup / run / prompt / install) will fail. Reinstall the binary, or use the npm distribution (npm i -g harnessed). (asset unpack pipeline lands in a later release \u2014 B1 seam)`
|
|
3902
|
+
);
|
|
3903
|
+
}
|
|
3904
|
+
return r.root;
|
|
3905
|
+
}
|
|
3906
|
+
var BUNFS_MARKERS, warnedMissing;
|
|
3907
|
+
var init_assetsRoot = __esm({
|
|
3908
|
+
"src/cli/lib/assetsRoot.ts"() {
|
|
3909
|
+
init_package();
|
|
3910
|
+
init_platform();
|
|
3911
|
+
init_packagePath();
|
|
3912
|
+
BUNFS_MARKERS = ["/$bunfs/", "/~bun/"];
|
|
3913
|
+
warnedMissing = false;
|
|
3914
|
+
}
|
|
3915
|
+
});
|
|
3732
3916
|
async function loadUserOverrides(packageRoot) {
|
|
3733
3917
|
const yamlPath = resolve(packageRoot, "workflows", "judgments", "user-overrides.yaml");
|
|
3734
3918
|
let raw;
|
|
@@ -3837,24 +4021,6 @@ var init_gateContext = __esm({
|
|
|
3837
4021
|
"src/cli/lib/gateContext.ts"() {
|
|
3838
4022
|
}
|
|
3839
4023
|
});
|
|
3840
|
-
|
|
3841
|
-
// src/cli/lib/packagePath.ts
|
|
3842
|
-
var packagePath_exports = {};
|
|
3843
|
-
__export(packagePath_exports, {
|
|
3844
|
-
getPackageRoot: () => getPackageRoot
|
|
3845
|
-
});
|
|
3846
|
-
function getPackageRoot() {
|
|
3847
|
-
const thisFile = fileURLToPath(import.meta.url);
|
|
3848
|
-
const thisDir = dirname(thisFile);
|
|
3849
|
-
if (thisDir.endsWith("dist") || thisDir.replace(/\\/g, "/").endsWith("/dist")) {
|
|
3850
|
-
return resolve(thisDir, "..");
|
|
3851
|
-
}
|
|
3852
|
-
return resolve(thisDir, "..", "..", "..");
|
|
3853
|
-
}
|
|
3854
|
-
var init_packagePath = __esm({
|
|
3855
|
-
"src/cli/lib/packagePath.ts"() {
|
|
3856
|
-
}
|
|
3857
|
-
});
|
|
3858
4024
|
function registerRun(program2) {
|
|
3859
4025
|
program2.command("run").description(
|
|
3860
4026
|
"Run a harnessed workflow via in-process SDK spawn (CI/headless mode \u2014 blocks, no Agent Teams, no clarification round-trip). Slash commands use CC-native spawn via gates/prompt/checkpoint instead."
|
|
@@ -3973,19 +4139,19 @@ async function listWorkflowNames(workflowsDir) {
|
|
|
3973
4139
|
const names = [];
|
|
3974
4140
|
const entries = await readdir(workflowsDir);
|
|
3975
4141
|
for (const e of entries.sort()) {
|
|
3976
|
-
const
|
|
3977
|
-
const s = await stat(
|
|
4142
|
+
const p7 = join(workflowsDir, e);
|
|
4143
|
+
const s = await stat(p7).catch(() => null);
|
|
3978
4144
|
if (!s?.isDirectory()) continue;
|
|
3979
|
-
if (await fileExists(join(
|
|
4145
|
+
if (await fileExists(join(p7, "workflow.yaml"))) {
|
|
3980
4146
|
names.push(e);
|
|
3981
4147
|
continue;
|
|
3982
4148
|
}
|
|
3983
|
-
if (await fileExists(join(
|
|
4149
|
+
if (await fileExists(join(p7, "auto", "workflow.yaml"))) {
|
|
3984
4150
|
names.push(e);
|
|
3985
|
-
const subs = await readdir(
|
|
4151
|
+
const subs = await readdir(p7).catch(() => []);
|
|
3986
4152
|
for (const sub of subs.sort()) {
|
|
3987
4153
|
if (sub === "auto") continue;
|
|
3988
|
-
if (await fileExists(join(
|
|
4154
|
+
if (await fileExists(join(p7, sub, "workflow.yaml"))) {
|
|
3989
4155
|
names.push(`${e}-${sub}`);
|
|
3990
4156
|
}
|
|
3991
4157
|
}
|
|
@@ -4049,10 +4215,10 @@ var init_run2 = __esm({
|
|
|
4049
4215
|
init_path_guard();
|
|
4050
4216
|
init_loadPhases();
|
|
4051
4217
|
init_run();
|
|
4218
|
+
init_assetsRoot();
|
|
4052
4219
|
init_extract_user_overrides();
|
|
4053
4220
|
init_gateContext();
|
|
4054
|
-
|
|
4055
|
-
PACKAGE_ROOT = getPackageRoot();
|
|
4221
|
+
PACKAGE_ROOT = getAssetsRoot();
|
|
4056
4222
|
WORKFLOWS_DIR = join(PACKAGE_ROOT, "workflows");
|
|
4057
4223
|
_autoChainCache = null;
|
|
4058
4224
|
_autoChainLoadFailed = false;
|
|
@@ -4202,10 +4368,10 @@ function learningsPath(repoRoot) {
|
|
|
4202
4368
|
return join(repoRoot, ".planning", "LEARNINGS.md");
|
|
4203
4369
|
}
|
|
4204
4370
|
async function appendLearning(repoRoot, entry) {
|
|
4205
|
-
const
|
|
4206
|
-
await mkdir(dirname(
|
|
4207
|
-
if (!existsSync(
|
|
4208
|
-
await appendFile(
|
|
4371
|
+
const p7 = learningsPath(repoRoot);
|
|
4372
|
+
await mkdir(dirname(p7), { recursive: true });
|
|
4373
|
+
if (!existsSync(p7)) await writeFile(p7, HEADER, "utf8");
|
|
4374
|
+
await appendFile(p7, entry, "utf8");
|
|
4209
4375
|
}
|
|
4210
4376
|
async function captureWorkflowLearnings(ledger, phase) {
|
|
4211
4377
|
const signals = extractLearnings(ledger);
|
|
@@ -4411,10 +4577,10 @@ var init_breakLoop = __esm({
|
|
|
4411
4577
|
LOOP_THRESHOLD = 3;
|
|
4412
4578
|
}
|
|
4413
4579
|
});
|
|
4414
|
-
function realProbe(
|
|
4580
|
+
function realProbe(p7) {
|
|
4415
4581
|
try {
|
|
4416
4582
|
if (typeof spawnSync !== "function") return null;
|
|
4417
|
-
const r = spawnSync(
|
|
4583
|
+
const r = spawnSync(p7, ["-c", "echo harnessed-bash-ok"], { encoding: "utf8", timeout: 5e3 });
|
|
4418
4584
|
if (!r || r.error) return null;
|
|
4419
4585
|
return r.status === 0;
|
|
4420
4586
|
} catch {
|
|
@@ -4431,9 +4597,9 @@ function realWhere(name) {
|
|
|
4431
4597
|
return [];
|
|
4432
4598
|
}
|
|
4433
4599
|
}
|
|
4434
|
-
function realExists(
|
|
4600
|
+
function realExists(p7) {
|
|
4435
4601
|
try {
|
|
4436
|
-
return existsSync(
|
|
4602
|
+
return existsSync(p7);
|
|
4437
4603
|
} catch {
|
|
4438
4604
|
return false;
|
|
4439
4605
|
}
|
|
@@ -4463,14 +4629,14 @@ function compute(d) {
|
|
|
4463
4629
|
const pathLines = d.where("bash");
|
|
4464
4630
|
const first = pathLines[0];
|
|
4465
4631
|
const wslOnPath = first && WSL_STUB_RE.test(first) ? first : void 0;
|
|
4466
|
-
const usable = (
|
|
4632
|
+
const usable = (p7) => !WSL_STUB_RE.test(p7) && d.probe(p7) !== false;
|
|
4467
4633
|
if (first && usable(first)) {
|
|
4468
4634
|
return { path: first, source: "path" };
|
|
4469
4635
|
}
|
|
4470
4636
|
const gitFirst = d.where("git")[0];
|
|
4471
4637
|
if (gitFirst && /git\.exe$/i.test(gitFirst)) {
|
|
4472
4638
|
const root = dirname8(dirname8(gitFirst));
|
|
4473
|
-
for (const cand of [
|
|
4639
|
+
for (const cand of [join18(root, "bin", "bash.exe"), join18(root, "usr", "bin", "bash.exe")]) {
|
|
4474
4640
|
if (d.exists(cand) && usable(cand)) return { path: cand, source: "git-derived", wslOnPath };
|
|
4475
4641
|
}
|
|
4476
4642
|
}
|
|
@@ -4478,13 +4644,13 @@ function compute(d) {
|
|
|
4478
4644
|
d.env.ProgramFiles,
|
|
4479
4645
|
d.env.ProgramW6432,
|
|
4480
4646
|
d.env["ProgramFiles(x86)"],
|
|
4481
|
-
d.env.LOCALAPPDATA ?
|
|
4647
|
+
d.env.LOCALAPPDATA ? join18(d.env.LOCALAPPDATA, "Programs") : void 0
|
|
4482
4648
|
];
|
|
4483
4649
|
for (const base of bases) {
|
|
4484
4650
|
if (!base) continue;
|
|
4485
4651
|
for (const cand of [
|
|
4486
|
-
|
|
4487
|
-
|
|
4652
|
+
join18(base, "Git", "bin", "bash.exe"),
|
|
4653
|
+
join18(base, "Git", "usr", "bin", "bash.exe")
|
|
4488
4654
|
]) {
|
|
4489
4655
|
if (d.exists(cand) && usable(cand))
|
|
4490
4656
|
return { path: cand, source: "standard-location", wslOnPath };
|
|
@@ -4497,10 +4663,10 @@ function compute(d) {
|
|
|
4497
4663
|
}
|
|
4498
4664
|
return { path: "bash", source: "path-fallback" };
|
|
4499
4665
|
}
|
|
4500
|
-
var dirname8,
|
|
4666
|
+
var dirname8, join18, WSL_STUB_RE, cache2;
|
|
4501
4667
|
var init_resolveBash = __esm({
|
|
4502
4668
|
"src/installers/lib/resolveBash.ts"() {
|
|
4503
|
-
({ dirname: dirname8, join:
|
|
4669
|
+
({ dirname: dirname8, join: join18 } = win32);
|
|
4504
4670
|
WSL_STUB_RE = /[\\/](windows[\\/](system32|sysnative|syswow64)|microsoft[\\/]windowsapps)[\\/]bash\.exe$/i;
|
|
4505
4671
|
cache2 = null;
|
|
4506
4672
|
}
|
|
@@ -4669,9 +4835,9 @@ function gstackSkillsDirInstalled(exists) {
|
|
|
4669
4835
|
return null;
|
|
4670
4836
|
}
|
|
4671
4837
|
function probeGstackPrefix(deps) {
|
|
4672
|
-
const exists = deps?.exists ?? ((
|
|
4838
|
+
const exists = deps?.exists ?? ((p7) => {
|
|
4673
4839
|
try {
|
|
4674
|
-
return existsSync(
|
|
4840
|
+
return existsSync(p7);
|
|
4675
4841
|
} catch {
|
|
4676
4842
|
return false;
|
|
4677
4843
|
}
|
|
@@ -5199,7 +5365,11 @@ function checkCodeGraph(cwd = process.cwd()) {
|
|
|
5199
5365
|
name: "codegraph",
|
|
5200
5366
|
status: "pass",
|
|
5201
5367
|
message: "CodeGraph not configured (optional semantic index \u2014 fewer tool-calls on code navigation)",
|
|
5202
|
-
|
|
5368
|
+
// v4.17.0 — BOTH enable steps: `npx @colbymchenry/codegraph` only wires the
|
|
5369
|
+
// MCP server into agents (upstream README step 2); the per-project index is
|
|
5370
|
+
// the separate `codegraph init` (step 3). The pre-4.17.0 hint stopped at
|
|
5371
|
+
// step 1, leaving `.codegraph/` absent and this check forever "not configured".
|
|
5372
|
+
fix: "npx @colbymchenry/codegraph to wire agents, then `codegraph init` in each project to build the index (MIT, 100% local; auto-sync keeps it fresh)"
|
|
5203
5373
|
};
|
|
5204
5374
|
}
|
|
5205
5375
|
var init_check_codegraph = __esm({
|
|
@@ -5750,13 +5920,13 @@ function evalClause(clause, home) {
|
|
|
5750
5920
|
const m = clause.match(CLAUSE_RE);
|
|
5751
5921
|
if (!m?.[1] || !m[2]) return null;
|
|
5752
5922
|
const flag = m[1];
|
|
5753
|
-
let
|
|
5754
|
-
if (UNSAFE_PATH_RE.test(
|
|
5755
|
-
if (
|
|
5756
|
-
else if (
|
|
5757
|
-
else if (
|
|
5923
|
+
let p7 = m[2];
|
|
5924
|
+
if (UNSAFE_PATH_RE.test(p7)) return null;
|
|
5925
|
+
if (p7 === "~") p7 = home;
|
|
5926
|
+
else if (p7.startsWith("~/")) p7 = `${home}/${p7.slice(2)}`;
|
|
5927
|
+
else if (p7.startsWith("~")) return null;
|
|
5758
5928
|
try {
|
|
5759
|
-
const st = statSync(
|
|
5929
|
+
const st = statSync(p7);
|
|
5760
5930
|
if (flag === "f") return st.isFile();
|
|
5761
5931
|
if (flag === "d") return st.isDirectory();
|
|
5762
5932
|
return true;
|
|
@@ -7306,7 +7476,7 @@ async function installBaseProfile(opts) {
|
|
|
7306
7476
|
const alreadyInstalled = [];
|
|
7307
7477
|
const skipped = [];
|
|
7308
7478
|
const failed = [];
|
|
7309
|
-
for (const path of await listBaseManifests(
|
|
7479
|
+
for (const path of await listBaseManifests(getAssetsRoot())) {
|
|
7310
7480
|
let yamlSrc;
|
|
7311
7481
|
try {
|
|
7312
7482
|
yamlSrc = await readFile(path, "utf8");
|
|
@@ -7360,7 +7530,7 @@ var init_install_base = __esm({
|
|
|
7360
7530
|
"src/cli/install-base.ts"() {
|
|
7361
7531
|
init_installers();
|
|
7362
7532
|
init_validate();
|
|
7363
|
-
|
|
7533
|
+
init_assetsRoot();
|
|
7364
7534
|
}
|
|
7365
7535
|
});
|
|
7366
7536
|
|
|
@@ -7649,6 +7819,127 @@ var init_l4_rescue = __esm({
|
|
|
7649
7819
|
}
|
|
7650
7820
|
});
|
|
7651
7821
|
|
|
7822
|
+
// src/cli/lib/optional-offer.ts
|
|
7823
|
+
var optional_offer_exports = {};
|
|
7824
|
+
__export(optional_offer_exports, {
|
|
7825
|
+
runOptionalOffer: () => runOptionalOffer
|
|
7826
|
+
});
|
|
7827
|
+
function truncateHint(desc) {
|
|
7828
|
+
return desc.length > 80 ? `${desc.slice(0, 80)}\u2026` : desc;
|
|
7829
|
+
}
|
|
7830
|
+
async function loadOptionalManifests(optionalDir) {
|
|
7831
|
+
let entries;
|
|
7832
|
+
try {
|
|
7833
|
+
entries = await readdir(optionalDir);
|
|
7834
|
+
} catch {
|
|
7835
|
+
return [];
|
|
7836
|
+
}
|
|
7837
|
+
const out = [];
|
|
7838
|
+
for (const f of entries.sort()) {
|
|
7839
|
+
if (!f.endsWith(".yaml")) continue;
|
|
7840
|
+
try {
|
|
7841
|
+
const v = validateManifestFile(await readFile(join(optionalDir, f), "utf8"), f);
|
|
7842
|
+
if (v.ok) out.push(v.manifest);
|
|
7843
|
+
} catch {
|
|
7844
|
+
}
|
|
7845
|
+
}
|
|
7846
|
+
return out;
|
|
7847
|
+
}
|
|
7848
|
+
async function runOptionalOffer(optionalDir, offerOpts) {
|
|
7849
|
+
const out = { installed: [], alreadyInstalled: [], skipped: [], failed: [] };
|
|
7850
|
+
const manifests = await loadOptionalManifests(optionalDir);
|
|
7851
|
+
if (manifests.length === 0) return out;
|
|
7852
|
+
const pending = [];
|
|
7853
|
+
for (const manifest of manifests) {
|
|
7854
|
+
const ctx = { manifest, opts: PROBE_OPTS, level: "L2", cwd: process.cwd() };
|
|
7855
|
+
let present = false;
|
|
7856
|
+
try {
|
|
7857
|
+
present = await isAlreadyInstalled(ctx);
|
|
7858
|
+
} catch {
|
|
7859
|
+
present = false;
|
|
7860
|
+
}
|
|
7861
|
+
if (present) out.alreadyInstalled.push(manifest.metadata.name);
|
|
7862
|
+
else pending.push(manifest);
|
|
7863
|
+
}
|
|
7864
|
+
if (pending.length === 0) return out;
|
|
7865
|
+
if (!offerOpts.interactive) {
|
|
7866
|
+
const names = pending.map((m) => m.metadata.name);
|
|
7867
|
+
console.log(
|
|
7868
|
+
`
|
|
7869
|
+
${names.length} optional component(s) available (opt-in, not part of base setup) \u2014 install with \`harnessed install <name>\`: ${names.join(", ")}`
|
|
7870
|
+
);
|
|
7871
|
+
out.skipped.push(...names);
|
|
7872
|
+
return out;
|
|
7873
|
+
}
|
|
7874
|
+
console.log(
|
|
7875
|
+
`
|
|
7876
|
+
${pending.length} optional component(s) available (opt-in \u2014 none selected by default):`
|
|
7877
|
+
);
|
|
7878
|
+
const ans = await p.multiselect({
|
|
7879
|
+
message: "Select optional components to install (space to toggle, enter to continue \u2014 empty = install nothing)",
|
|
7880
|
+
options: pending.map((m) => ({
|
|
7881
|
+
value: m.metadata.name,
|
|
7882
|
+
label: m.metadata.display_name ?? m.metadata.name,
|
|
7883
|
+
hint: truncateHint(m.metadata.description)
|
|
7884
|
+
})),
|
|
7885
|
+
initialValues: [],
|
|
7886
|
+
required: false
|
|
7887
|
+
});
|
|
7888
|
+
if (p.isCancel(ans)) {
|
|
7889
|
+
out.skipped.push(...pending.map((m) => m.metadata.name));
|
|
7890
|
+
return out;
|
|
7891
|
+
}
|
|
7892
|
+
const chosen = new Set(ans);
|
|
7893
|
+
for (const manifest of pending) {
|
|
7894
|
+
const name = manifest.metadata.name;
|
|
7895
|
+
if (!chosen.has(name)) {
|
|
7896
|
+
out.skipped.push(name);
|
|
7897
|
+
continue;
|
|
7898
|
+
}
|
|
7899
|
+
console.log(`
|
|
7900
|
+
${name}: $ ${manifest.spec.install.cmd}`);
|
|
7901
|
+
const opts = {
|
|
7902
|
+
...PROBE_OPTS,
|
|
7903
|
+
apply: true,
|
|
7904
|
+
// see IMPL NOTE header — this confirm IS the L4 opt-in for npm-cli globals.
|
|
7905
|
+
system: manifest.spec.install.method === "npm-cli"
|
|
7906
|
+
};
|
|
7907
|
+
const r = await runInstall(manifest, opts);
|
|
7908
|
+
if ("aborted" in r) {
|
|
7909
|
+
out.skipped.push(name);
|
|
7910
|
+
console.log(` \u21B7 skipped ${name} (${r.reason})`);
|
|
7911
|
+
} else if (r.ok) {
|
|
7912
|
+
out.installed.push(name);
|
|
7913
|
+
console.log(` \u2713 installed ${name}`);
|
|
7914
|
+
if (name === "codegraph") {
|
|
7915
|
+
console.log(" run `codegraph init` in each project to build its index");
|
|
7916
|
+
}
|
|
7917
|
+
} else {
|
|
7918
|
+
out.failed.push({ name, reason: r.error.message });
|
|
7919
|
+
console.error(` \u2717 failed ${name}: ${r.error.message}`);
|
|
7920
|
+
}
|
|
7921
|
+
}
|
|
7922
|
+
return out;
|
|
7923
|
+
}
|
|
7924
|
+
var PROBE_OPTS;
|
|
7925
|
+
var init_optional_offer = __esm({
|
|
7926
|
+
"src/cli/lib/optional-offer.ts"() {
|
|
7927
|
+
init_installers();
|
|
7928
|
+
init_idempotent();
|
|
7929
|
+
init_validate();
|
|
7930
|
+
PROBE_OPTS = {
|
|
7931
|
+
apply: false,
|
|
7932
|
+
dryRun: false,
|
|
7933
|
+
system: false,
|
|
7934
|
+
nonInteractive: true,
|
|
7935
|
+
fullDiff: false,
|
|
7936
|
+
color: "auto",
|
|
7937
|
+
updateInstalled: false,
|
|
7938
|
+
quiet: true
|
|
7939
|
+
};
|
|
7940
|
+
}
|
|
7941
|
+
});
|
|
7942
|
+
|
|
7652
7943
|
// src/cli/lib/auto-install.ts
|
|
7653
7944
|
var auto_install_exports = {};
|
|
7654
7945
|
__export(auto_install_exports, {
|
|
@@ -8130,15 +8421,15 @@ async function parsePlan(raw) {
|
|
|
8130
8421
|
} catch {
|
|
8131
8422
|
return null;
|
|
8132
8423
|
}
|
|
8133
|
-
const
|
|
8134
|
-
if (!Array.isArray(
|
|
8424
|
+
const p7 = parsed;
|
|
8425
|
+
if (!Array.isArray(p7.fire) && !Array.isArray(p7.skip)) return null;
|
|
8135
8426
|
const plan = {
|
|
8136
|
-
fire: Array.isArray(
|
|
8137
|
-
skip: Array.isArray(
|
|
8427
|
+
fire: Array.isArray(p7.fire) ? p7.fire : [],
|
|
8428
|
+
skip: Array.isArray(p7.skip) ? p7.skip : []
|
|
8138
8429
|
};
|
|
8139
|
-
if (typeof
|
|
8140
|
-
if (
|
|
8141
|
-
plan.parallelism =
|
|
8430
|
+
if (typeof p7.master === "string") plan.master = p7.master;
|
|
8431
|
+
if (p7.parallelism && typeof p7.parallelism === "object" && !Array.isArray(p7.parallelism)) {
|
|
8432
|
+
plan.parallelism = p7.parallelism;
|
|
8142
8433
|
}
|
|
8143
8434
|
return plan;
|
|
8144
8435
|
}
|
|
@@ -8183,8 +8474,8 @@ function registerCheckpoint(program2) {
|
|
|
8183
8474
|
if (action === "complete") {
|
|
8184
8475
|
const { checkArtifacts: checkArtifacts2 } = await Promise.resolve().then(() => (init_evidence(), evidence_exports));
|
|
8185
8476
|
const { mutateSubProgress: mutateSubProgress3 } = await Promise.resolve().then(() => (init_state(), state_exports));
|
|
8186
|
-
const {
|
|
8187
|
-
const result = await checkArtifacts2(sub,
|
|
8477
|
+
const { getAssetsRoot: getAssetsRoot2 } = await Promise.resolve().then(() => (init_assetsRoot(), assetsRoot_exports));
|
|
8478
|
+
const result = await checkArtifacts2(sub, getAssetsRoot2());
|
|
8188
8479
|
const { checkPlanningSync: checkPlanningSync2 } = await Promise.resolve().then(() => (init_evidence(), evidence_exports));
|
|
8189
8480
|
const syncResult = await checkPlanningSync2(process.cwd(), null);
|
|
8190
8481
|
const allMissing = [...result.missing, ...syncResult.missing];
|
|
@@ -8349,8 +8640,8 @@ function registerDoctor(program2) {
|
|
|
8349
8640
|
// src/cli/gates.ts
|
|
8350
8641
|
init_path_guard();
|
|
8351
8642
|
init_judgmentResolver();
|
|
8643
|
+
init_assetsRoot();
|
|
8352
8644
|
init_gateContext();
|
|
8353
|
-
init_packagePath();
|
|
8354
8645
|
var VALID_MASTERS = /* @__PURE__ */ new Set(["auto", "discuss", "plan", "task", "verify"]);
|
|
8355
8646
|
var STAGE_MASTERS = /* @__PURE__ */ new Set(["discuss", "plan", "task", "verify"]);
|
|
8356
8647
|
var PARALLELISM_GATE = "judgments.parallelism-gate.agent-teams-upgrade.fires";
|
|
@@ -8375,7 +8666,7 @@ function registerGates(program2) {
|
|
|
8375
8666
|
process.exit(1);
|
|
8376
8667
|
return;
|
|
8377
8668
|
}
|
|
8378
|
-
const packageRoot =
|
|
8669
|
+
const packageRoot = getAssetsRoot();
|
|
8379
8670
|
const yamlPath = resolveMasterYamlPath2(master, packageRoot);
|
|
8380
8671
|
let raw_yaml;
|
|
8381
8672
|
try {
|
|
@@ -8493,10 +8784,10 @@ async function dirSizeKb(dir) {
|
|
|
8493
8784
|
if (!cur) break;
|
|
8494
8785
|
const entries = await readdir(cur, { withFileTypes: true });
|
|
8495
8786
|
for (const e of entries) {
|
|
8496
|
-
const
|
|
8497
|
-
if (e.isDirectory()) stack.push(
|
|
8787
|
+
const p7 = join(cur, e.name);
|
|
8788
|
+
if (e.isDirectory()) stack.push(p7);
|
|
8498
8789
|
else if (e.isFile()) {
|
|
8499
|
-
const st = await stat(
|
|
8790
|
+
const st = await stat(p7);
|
|
8500
8791
|
total += st.size;
|
|
8501
8792
|
}
|
|
8502
8793
|
}
|
|
@@ -8569,7 +8860,7 @@ init_i18n();
|
|
|
8569
8860
|
init_installers();
|
|
8570
8861
|
init_path_guard();
|
|
8571
8862
|
init_validate();
|
|
8572
|
-
|
|
8863
|
+
init_assetsRoot();
|
|
8573
8864
|
function formatError(e) {
|
|
8574
8865
|
const head = `error: ${e.message}`;
|
|
8575
8866
|
const where = e.path && e.path !== "/" ? `
|
|
@@ -8587,14 +8878,14 @@ function registerInstall(program2) {
|
|
|
8587
8878
|
const resolvedName = resolveAlias2(name) ?? name;
|
|
8588
8879
|
checkPathSafe(resolvedName);
|
|
8589
8880
|
const candidatePaths = ["tools", "skill-packs", "optional"].map(
|
|
8590
|
-
(dir) => resolve(
|
|
8881
|
+
(dir) => resolve(getAssetsRoot(), `manifests/${dir}/${resolvedName}.yaml`)
|
|
8591
8882
|
);
|
|
8592
8883
|
let yamlSrc;
|
|
8593
8884
|
let chosenPath;
|
|
8594
|
-
for (const
|
|
8885
|
+
for (const p7 of candidatePaths) {
|
|
8595
8886
|
try {
|
|
8596
|
-
yamlSrc = await readFile(
|
|
8597
|
-
chosenPath =
|
|
8887
|
+
yamlSrc = await readFile(p7, "utf8");
|
|
8888
|
+
chosenPath = p7;
|
|
8598
8889
|
break;
|
|
8599
8890
|
} catch {
|
|
8600
8891
|
}
|
|
@@ -8636,8 +8927,10 @@ ${t("install.manifest_not_found.fix", { name: resolvedName })}`
|
|
|
8636
8927
|
}
|
|
8637
8928
|
if (result.ok) {
|
|
8638
8929
|
const version = v.manifest.spec.install.method === "npm-cli" && "npm_version" in v.manifest.spec.install ? v.manifest.spec.install.npm_version : "";
|
|
8930
|
+
const already = "alreadyInstalled" in result && result.alreadyInstalled === true;
|
|
8931
|
+
const keyBase = already ? "install.already_installed" : "install.success";
|
|
8639
8932
|
console.log(
|
|
8640
|
-
version ? t(
|
|
8933
|
+
version ? t(`${keyBase}_with_version`, { name: v.manifest.metadata.name, version }) : t(keyBase, { name: v.manifest.metadata.name })
|
|
8641
8934
|
);
|
|
8642
8935
|
process.exit(0);
|
|
8643
8936
|
}
|
|
@@ -8932,8 +9225,8 @@ function registerNext(program2) {
|
|
|
8932
9225
|
init_i18n();
|
|
8933
9226
|
init_localeYaml();
|
|
8934
9227
|
init_run();
|
|
9228
|
+
init_assetsRoot();
|
|
8935
9229
|
init_generateCommands();
|
|
8936
|
-
init_packagePath();
|
|
8937
9230
|
init_run2();
|
|
8938
9231
|
var DEFAULT_MAX_ITERATIONS = 20;
|
|
8939
9232
|
var DEFAULT_MODEL = "sonnet";
|
|
@@ -9050,7 +9343,7 @@ function registerPrompt(program2) {
|
|
|
9050
9343
|
program2.command("prompt").description(
|
|
9051
9344
|
"Print a spawn-ready prompt for a sub-workflow (role + checklist + protocols, no spawn)."
|
|
9052
9345
|
).argument("<sub>", "sub-workflow name (e.g. task-code, verify-paranoid)").option("--task <text>", "task description prepended as a ## Task section").option("--json", "emit JSON {prompt, max_iterations, model, specialist} instead of text").action(async (sub, raw) => {
|
|
9053
|
-
const packageRoot =
|
|
9346
|
+
const packageRoot = getAssetsRoot();
|
|
9054
9347
|
const workflowsDir = resolve(packageRoot, "workflows");
|
|
9055
9348
|
const rolePrompts = await loadRolePrompts(workflowsDir);
|
|
9056
9349
|
const def = buildAgentDef(sub, rolePrompts);
|
|
@@ -9136,9 +9429,9 @@ function registerReleasePreflight(program2) {
|
|
|
9136
9429
|
// src/cli/research.ts
|
|
9137
9430
|
init_i18n();
|
|
9138
9431
|
init_run();
|
|
9139
|
-
|
|
9432
|
+
init_assetsRoot();
|
|
9140
9433
|
init_run2();
|
|
9141
|
-
var PACKAGE_ROOT2 =
|
|
9434
|
+
var PACKAGE_ROOT2 = getAssetsRoot();
|
|
9142
9435
|
var WORKFLOWS_DIR2 = join(PACKAGE_ROOT2, "workflows");
|
|
9143
9436
|
function registerResearch(program2) {
|
|
9144
9437
|
program2.command("research").description(
|
|
@@ -9319,6 +9612,7 @@ init_run2();
|
|
|
9319
9612
|
// src/cli/setup.ts
|
|
9320
9613
|
init_i18n();
|
|
9321
9614
|
init_platform();
|
|
9615
|
+
init_assetsRoot();
|
|
9322
9616
|
|
|
9323
9617
|
// src/cli/lib/capabilityResolver.ts
|
|
9324
9618
|
init_platform();
|
|
@@ -9571,7 +9865,6 @@ async function enableUserLangInSettings(override) {
|
|
|
9571
9865
|
|
|
9572
9866
|
// src/cli/setup.ts
|
|
9573
9867
|
init_generateCommands();
|
|
9574
|
-
init_packagePath();
|
|
9575
9868
|
|
|
9576
9869
|
// src/cli/lib/renderSkillTemplates.ts
|
|
9577
9870
|
init_i18n();
|
|
@@ -10054,7 +10347,7 @@ function registerSetup(program2) {
|
|
|
10054
10347
|
await printSetupVersionBanner();
|
|
10055
10348
|
const dryRun = raw.dryRun === true;
|
|
10056
10349
|
if (raw.platform !== void 0) await applyPlatformOption(raw.platform);
|
|
10057
|
-
const pkgRoot =
|
|
10350
|
+
const pkgRoot = getAssetsRoot();
|
|
10058
10351
|
const workflowsDir = resolve(pkgRoot, "workflows");
|
|
10059
10352
|
const skillsBase = getSkillsDir();
|
|
10060
10353
|
await warnIfAgentTeamsMissing();
|
|
@@ -10132,7 +10425,7 @@ function registerSetup(program2) {
|
|
|
10132
10425
|
capabilitiesMap,
|
|
10133
10426
|
installedPlugins,
|
|
10134
10427
|
installedUserSkills,
|
|
10135
|
-
async (
|
|
10428
|
+
async (p7, c) => writeFile(p7, c, "utf8")
|
|
10136
10429
|
);
|
|
10137
10430
|
const writtenCount = cmdResult.results.filter((r) => r.written).length;
|
|
10138
10431
|
const skippedCount = cmdResult.results.filter((r) => !r.written && r.warning).length;
|
|
@@ -10169,12 +10462,12 @@ installing ${manifestPaths.length} upstream components (MCP serialized, rest par
|
|
|
10169
10462
|
if (!forceFirstPass && !dryRun && raw.nonInteractive !== true && b.alreadyInstalled.length > 0) {
|
|
10170
10463
|
const isTty = process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
10171
10464
|
if (isTty) {
|
|
10172
|
-
const { confirm: confirm5, isCancel:
|
|
10465
|
+
const { confirm: confirm5, isCancel: isCancel7 } = await import('@clack/prompts');
|
|
10173
10466
|
const ans = await confirm5({
|
|
10174
10467
|
message: `Update ${b.alreadyInstalled.length} already-installed plugin(s) listed above? (MCP servers excluded \u2014 they ignore force-update)`,
|
|
10175
10468
|
initialValue: false
|
|
10176
10469
|
});
|
|
10177
|
-
if (!
|
|
10470
|
+
if (!isCancel7(ans) && ans === true) {
|
|
10178
10471
|
console.log(`
|
|
10179
10472
|
force-updating ${b.alreadyInstalled.length} plugin(s)...`);
|
|
10180
10473
|
const b2 = await runStepBInstall(manifestPaths, {
|
|
@@ -10208,6 +10501,13 @@ Force-update pass complete: ${b2.installed.length} installed / ${b2.keptExisting
|
|
|
10208
10501
|
await runL4Rescue2(manifestPaths, b.skipped);
|
|
10209
10502
|
}
|
|
10210
10503
|
}
|
|
10504
|
+
if (!dryRun) {
|
|
10505
|
+
const optIsTty = process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
10506
|
+
const { runOptionalOffer: runOptionalOffer2 } = await Promise.resolve().then(() => (init_optional_offer(), optional_offer_exports));
|
|
10507
|
+
await runOptionalOffer2(resolve(pkgRoot, "manifests", "optional"), {
|
|
10508
|
+
interactive: optIsTty && raw.nonInteractive !== true
|
|
10509
|
+
});
|
|
10510
|
+
}
|
|
10211
10511
|
if (b.failed.length > 0) {
|
|
10212
10512
|
console.error(
|
|
10213
10513
|
`
|
|
@@ -10509,8 +10809,8 @@ async function runUninstall(manifest, opts) {
|
|
|
10509
10809
|
}
|
|
10510
10810
|
|
|
10511
10811
|
// src/cli/uninstall.ts
|
|
10812
|
+
init_assetsRoot();
|
|
10512
10813
|
init_generateCommands();
|
|
10513
|
-
init_packagePath();
|
|
10514
10814
|
async function discoverCommandFiles(commandsDir) {
|
|
10515
10815
|
const owned = [];
|
|
10516
10816
|
let entries;
|
|
@@ -10521,10 +10821,10 @@ async function discoverCommandFiles(commandsDir) {
|
|
|
10521
10821
|
}
|
|
10522
10822
|
for (const entry of entries) {
|
|
10523
10823
|
if (!entry.endsWith(".md")) continue;
|
|
10524
|
-
const
|
|
10824
|
+
const p7 = join(commandsDir, entry);
|
|
10525
10825
|
try {
|
|
10526
|
-
const content = await readFile(
|
|
10527
|
-
if (shouldOverwriteFile(content)) owned.push(
|
|
10826
|
+
const content = await readFile(p7, "utf8");
|
|
10827
|
+
if (shouldOverwriteFile(content)) owned.push(p7);
|
|
10528
10828
|
} catch {
|
|
10529
10829
|
}
|
|
10530
10830
|
}
|
|
@@ -10569,7 +10869,7 @@ async function runUnifiedUninstall(home, dryRun) {
|
|
|
10569
10869
|
const skillsDir = platform.skillsDir;
|
|
10570
10870
|
const settingsPath = platform.settingsPath;
|
|
10571
10871
|
const harnessedRoot = getHarnessedRoot();
|
|
10572
|
-
const pkgRoot =
|
|
10872
|
+
const pkgRoot = getAssetsRoot();
|
|
10573
10873
|
let workflowNames = [];
|
|
10574
10874
|
try {
|
|
10575
10875
|
const wfEntries = await readdir(resolve(pkgRoot, "workflows"));
|
|
@@ -10679,9 +10979,9 @@ function registerUninstall(program2) {
|
|
|
10679
10979
|
const { resolveAlias: resolveAlias2 } = await Promise.resolve().then(() => (init_aliases(), aliases_exports));
|
|
10680
10980
|
const resolvedName = resolveAlias2(name) ?? name;
|
|
10681
10981
|
checkPathSafe(resolvedName);
|
|
10682
|
-
const manifestPath = resolve(
|
|
10982
|
+
const manifestPath = resolve(getAssetsRoot(), `manifests/tools/${resolvedName}.yaml`);
|
|
10683
10983
|
const skillPackPath = resolve(
|
|
10684
|
-
|
|
10984
|
+
getAssetsRoot(),
|
|
10685
10985
|
`manifests/skill-packs/${resolvedName}.yaml`
|
|
10686
10986
|
);
|
|
10687
10987
|
let yamlSrc;
|
|
@@ -10740,15 +11040,15 @@ ${t("install.manifest_not_found.fix", { name: resolvedName })}`
|
|
|
10740
11040
|
// src/cli/update.ts
|
|
10741
11041
|
init_package();
|
|
10742
11042
|
init_harnessedRoot();
|
|
10743
|
-
|
|
11043
|
+
init_assetsRoot();
|
|
10744
11044
|
function npmExecutable2() {
|
|
10745
11045
|
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
10746
11046
|
}
|
|
10747
11047
|
function changelogTop() {
|
|
10748
11048
|
try {
|
|
10749
|
-
const
|
|
10750
|
-
if (!existsSync(
|
|
10751
|
-
const body = readFileSync(
|
|
11049
|
+
const p7 = join(getAssetsRoot(), "CHANGELOG.md");
|
|
11050
|
+
if (!existsSync(p7)) return null;
|
|
11051
|
+
const body = readFileSync(p7, "utf8");
|
|
10752
11052
|
const start = body.indexOf("\n## ");
|
|
10753
11053
|
if (start < 0) return null;
|
|
10754
11054
|
const rest = body.slice(start + 1);
|