@claudexor/cli 3.23.2 → 3.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-management.d.ts +17 -0
- package/dist/account-management.d.ts.map +1 -0
- package/dist/account-management.js +35 -0
- package/dist/account-management.js.map +1 -0
- package/dist/account-observations.d.ts +7 -3
- package/dist/account-observations.d.ts.map +1 -1
- package/dist/account-observations.js +16 -4
- package/dist/account-observations.js.map +1 -1
- package/dist/account-reset-command.d.ts +3 -0
- package/dist/account-reset-command.d.ts.map +1 -0
- package/dist/account-reset-command.js +32 -0
- package/dist/account-reset-command.js.map +1 -0
- package/dist/account-reset-services.d.ts +341 -0
- package/dist/account-reset-services.d.ts.map +1 -0
- package/dist/account-reset-services.js +183 -0
- package/dist/account-reset-services.js.map +1 -0
- package/dist/account-resource-query.d.ts +18 -0
- package/dist/account-resource-query.d.ts.map +1 -0
- package/dist/account-resource-query.js +62 -0
- package/dist/account-resource-query.js.map +1 -0
- package/dist/accounts-services.d.ts +1 -0
- package/dist/accounts-services.d.ts.map +1 -1
- package/dist/accounts-services.js +4 -2
- package/dist/accounts-services.js.map +1 -1
- package/dist/claude-account-resources.d.ts +5 -0
- package/dist/claude-account-resources.d.ts.map +1 -0
- package/dist/claude-account-resources.js +134 -0
- package/dist/claude-account-resources.js.map +1 -0
- package/dist/claude-oauth-codec.d.ts +4 -0
- package/dist/claude-oauth-codec.d.ts.map +1 -0
- package/dist/claude-oauth-codec.js +71 -0
- package/dist/claude-oauth-codec.js.map +1 -0
- package/dist/claude-oauth-credential.d.ts +6 -0
- package/dist/claude-oauth-credential.d.ts.map +1 -1
- package/dist/claude-oauth-credential.js +18 -0
- package/dist/claude-oauth-credential.js.map +1 -1
- package/dist/claude-oauth-fetch.d.ts +1 -1
- package/dist/claude-oauth-fetch.d.ts.map +1 -1
- package/dist/claude-oauth-fetch.js +3 -2
- package/dist/claude-oauth-fetch.js.map +1 -1
- package/dist/claude-oauth-usage.d.ts +5 -4
- package/dist/claude-oauth-usage.d.ts.map +1 -1
- package/dist/claude-oauth-usage.js +47 -75
- package/dist/claude-oauth-usage.js.map +1 -1
- package/dist/claude-resource-source.d.ts +18 -0
- package/dist/claude-resource-source.d.ts.map +1 -0
- package/dist/claude-resource-source.js +108 -0
- package/dist/claude-resource-source.js.map +1 -0
- package/dist/claude-resource-transport.d.ts +12 -0
- package/dist/claude-resource-transport.d.ts.map +1 -0
- package/dist/claude-resource-transport.js +47 -0
- package/dist/claude-resource-transport.js.map +1 -0
- package/dist/claudexord.d.ts.map +1 -1
- package/dist/claudexord.js +10 -4
- package/dist/claudexord.js.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/codex-quota-source.d.ts +7 -2
- package/dist/codex-quota-source.d.ts.map +1 -1
- package/dist/codex-quota-source.js +72 -12
- package/dist/codex-quota-source.js.map +1 -1
- package/dist/command-flags.d.ts.map +1 -1
- package/dist/command-flags.js +7 -0
- package/dist/command-flags.js.map +1 -1
- package/dist/control-services.d.ts +264 -118
- package/dist/control-services.d.ts.map +1 -1
- package/dist/harness-command-specs.d.ts.map +1 -1
- package/dist/harness-command-specs.js +11 -4
- package/dist/harness-command-specs.js.map +1 -1
- package/dist/harness-command.d.ts.map +1 -1
- package/dist/harness-command.js +5 -0
- package/dist/harness-command.js.map +1 -1
- package/dist/harness-install-proof.d.ts +9 -0
- package/dist/harness-install-proof.d.ts.map +1 -1
- package/dist/harness-install-proof.js +60 -8
- package/dist/harness-install-proof.js.map +1 -1
- package/dist/harness-install-recipes.d.ts +24 -1
- package/dist/harness-install-recipes.d.ts.map +1 -1
- package/dist/harness-install-recipes.js +54 -2
- package/dist/harness-install-recipes.js.map +1 -1
- package/dist/harness-install-runtime.d.ts +29 -0
- package/dist/harness-install-runtime.d.ts.map +1 -0
- package/dist/harness-install-runtime.js +51 -0
- package/dist/harness-install-runtime.js.map +1 -0
- package/dist/harness-installer.d.ts +19 -65
- package/dist/harness-installer.d.ts.map +1 -1
- package/dist/harness-installer.js +46 -48
- package/dist/harness-installer.js.map +1 -1
- package/dist/harness-maintenance-service.d.ts +473 -0
- package/dist/harness-maintenance-service.d.ts.map +1 -0
- package/dist/harness-maintenance-service.js +429 -0
- package/dist/harness-maintenance-service.js.map +1 -0
- package/dist/harness-maintenance.d.ts +62 -0
- package/dist/harness-maintenance.d.ts.map +1 -0
- package/dist/harness-maintenance.js +353 -0
- package/dist/harness-maintenance.js.map +1 -0
- package/dist/mcp-runner.d.ts.map +1 -1
- package/dist/mcp-runner.js +5 -0
- package/dist/mcp-runner.js.map +1 -1
- package/dist/model-services.d.ts +9 -1
- package/dist/model-services.d.ts.map +1 -1
- package/dist/model-services.js +39 -10
- package/dist/model-services.js.map +1 -1
- package/dist/ops-command-specs.d.ts.map +1 -1
- package/dist/ops-command-specs.js +11 -2
- package/dist/ops-command-specs.js.map +1 -1
- package/dist/quota-command.d.ts.map +1 -1
- package/dist/quota-command.js +38 -2
- package/dist/quota-command.js.map +1 -1
- package/dist/quota-refreshers.d.ts +3 -1
- package/dist/quota-refreshers.d.ts.map +1 -1
- package/dist/quota-refreshers.js +6 -2
- package/dist/quota-refreshers.js.map +1 -1
- package/dist/quota-services.d.ts +234 -2
- package/dist/quota-services.d.ts.map +1 -1
- package/dist/quota-services.js +49 -4
- package/dist/quota-services.js.map +1 -1
- package/package.json +25 -25
|
@@ -5,6 +5,41 @@ const VERSION_PROBE_MAX_BYTES = 1024 * 1024;
|
|
|
5
5
|
const VERSION_PROBE_TIMEOUT_MS = 10_000;
|
|
6
6
|
const SCRIPT_VENDOR_VERSION_MAX_CHARS = 256;
|
|
7
7
|
const SEMVER_TOKEN = /(?:^|[^0-9A-Za-z.+-])(\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?)(?=$|[^0-9A-Za-z.+-])/g;
|
|
8
|
+
/** One exact registry version (no ranges, tags or `v` prefix). */
|
|
9
|
+
export const EXACT_VENDOR_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
10
|
+
/** SemVer precedence of two exact versions: negative when `a` is older. Build
|
|
11
|
+
* metadata is ignored; a prerelease precedes its release. */
|
|
12
|
+
export function compareVendorVersions(a, b) {
|
|
13
|
+
const split = (value) => {
|
|
14
|
+
const [core = "", pre] = value.split("+", 1)[0].split(/-(.*)/s, 2);
|
|
15
|
+
return { core: core.split(".").map(Number), pre: pre ? pre.split(".") : [] };
|
|
16
|
+
};
|
|
17
|
+
const left = split(a);
|
|
18
|
+
const right = split(b);
|
|
19
|
+
for (let index = 0; index < 3; index += 1) {
|
|
20
|
+
const delta = (left.core[index] ?? 0) - (right.core[index] ?? 0);
|
|
21
|
+
if (delta !== 0)
|
|
22
|
+
return delta;
|
|
23
|
+
}
|
|
24
|
+
if (!left.pre.length || !right.pre.length)
|
|
25
|
+
return right.pre.length - left.pre.length;
|
|
26
|
+
for (let index = 0; index < Math.max(left.pre.length, right.pre.length); index += 1) {
|
|
27
|
+
const l = left.pre[index];
|
|
28
|
+
const r = right.pre[index];
|
|
29
|
+
if (l === undefined || r === undefined)
|
|
30
|
+
return l === undefined ? -1 : 1;
|
|
31
|
+
if (l === r)
|
|
32
|
+
continue;
|
|
33
|
+
const ln = /^\d+$/.test(l);
|
|
34
|
+
const rn = /^\d+$/.test(r);
|
|
35
|
+
if (ln && rn)
|
|
36
|
+
return Number(l) - Number(r);
|
|
37
|
+
if (ln !== rn)
|
|
38
|
+
return ln ? -1 : 1;
|
|
39
|
+
return l < r ? -1 : 1;
|
|
40
|
+
}
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
8
43
|
function isStrictlyContained(root, candidate) {
|
|
9
44
|
const remainder = relative(root, candidate);
|
|
10
45
|
return (remainder !== "" &&
|
|
@@ -17,7 +52,7 @@ function outputText(value) {
|
|
|
17
52
|
return value;
|
|
18
53
|
return Buffer.isBuffer(value) ? value.toString("utf8") : "";
|
|
19
54
|
}
|
|
20
|
-
function exactSemverTokens(value) {
|
|
55
|
+
export function exactSemverTokens(value) {
|
|
21
56
|
return [...value.matchAll(SEMVER_TOKEN)].map((match) => match[1] ?? "");
|
|
22
57
|
}
|
|
23
58
|
function proveVersion(installedBinary, runtime, expectedVersion, launcher = installedBinary) {
|
|
@@ -64,15 +99,15 @@ function proveVersion(installedBinary, runtime, expectedVersion, launcher = inst
|
|
|
64
99
|
proof: { installedBinary: absoluteBinary, installedVersion: reportedVersion },
|
|
65
100
|
};
|
|
66
101
|
}
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
const packageRoot = join(npmGlobalPackagesDir(
|
|
102
|
+
/** The package manifest a managed npm prefix holds for one exact package,
|
|
103
|
+
* read through the same containment rules the proof uses. */
|
|
104
|
+
function readManagedNpmPackage(vendorRoot, npmPackage, platform) {
|
|
105
|
+
const packageRoot = join(npmGlobalPackagesDir(vendorRoot, platform), ...npmPackage.split("/"));
|
|
71
106
|
let canonicalRoot;
|
|
72
107
|
let canonicalPackageRoot;
|
|
73
108
|
let canonicalPackageJson;
|
|
74
109
|
try {
|
|
75
|
-
canonicalRoot = realpathSync(
|
|
110
|
+
canonicalRoot = realpathSync(vendorRoot);
|
|
76
111
|
canonicalPackageRoot = realpathSync(packageRoot);
|
|
77
112
|
canonicalPackageJson = realpathSync(join(packageRoot, "package.json"));
|
|
78
113
|
}
|
|
@@ -85,14 +120,31 @@ export function proveInstalledNpm(spec, runtime) {
|
|
|
85
120
|
if (!isStrictlyContained(canonicalPackageRoot, canonicalPackageJson)) {
|
|
86
121
|
return { ok: false, reason: "the npm package manifest escapes the exact package root" };
|
|
87
122
|
}
|
|
88
|
-
let packageVersion = null;
|
|
89
123
|
try {
|
|
90
124
|
const parsed = JSON.parse(readFileSync(canonicalPackageJson, "utf8"));
|
|
91
|
-
|
|
125
|
+
return {
|
|
126
|
+
ok: true,
|
|
127
|
+
canonicalRoot,
|
|
128
|
+
version: typeof parsed.version === "string" ? parsed.version : null,
|
|
129
|
+
};
|
|
92
130
|
}
|
|
93
131
|
catch {
|
|
94
132
|
return { ok: false, reason: "the exact npm package manifest is unreadable" };
|
|
95
133
|
}
|
|
134
|
+
}
|
|
135
|
+
/** The managed copy's declared package version, or null when there is none.
|
|
136
|
+
* A declaration only: `proveInstalledNpm` is what proves it runs. */
|
|
137
|
+
export function managedNpmPackageVersion(vendorRoot, npmPackage, platform) {
|
|
138
|
+
const read = readManagedNpmPackage(vendorRoot, npmPackage, platform);
|
|
139
|
+
return read.ok ? read.version : null;
|
|
140
|
+
}
|
|
141
|
+
/** Prove an exact npm package and its target-owned launcher, then execute the
|
|
142
|
+
* absolute launcher for a matching version receipt. */
|
|
143
|
+
export function proveInstalledNpm(spec, runtime) {
|
|
144
|
+
const manifest = readManagedNpmPackage(spec.vendorRoot, spec.npmPackage, runtime.platform);
|
|
145
|
+
if (!manifest.ok)
|
|
146
|
+
return manifest;
|
|
147
|
+
const { canonicalRoot, version: packageVersion } = manifest;
|
|
96
148
|
if (packageVersion !== spec.expectedVersion) {
|
|
97
149
|
return {
|
|
98
150
|
ok: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-install-proof.js","sourceRoot":"","sources":["../src/harness-install-proof.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AA4BzB,MAAM,uBAAuB,GAAG,IAAI,GAA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C,cAAc,EACtB,OAAO,CAAC,QAAQ,CACjB,CAAC;IACF,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,UAAU,wCAAwC,EAAE,CAAC;IAChG,CAAC;IACD,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;QACtD,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACrE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,UAAU,wCAAwC,EAAE,CAAC;QAC1F,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,UAAU,yCAAyC,EAAE,CAAC;IAC3F,CAAC;IACD,OAAO,YAAY,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -61,6 +61,26 @@ type ScriptInstaller = (typeof SCRIPT_INSTALLERS)[keyof typeof SCRIPT_INSTALLERS
|
|
|
61
61
|
/** Membership is asked of the TABLE, never re-typed: a third script vendor is
|
|
62
62
|
* one row, and cannot be added to the table yet fall through here. */
|
|
63
63
|
export declare function scriptInstaller(harness: InstallableHarness): ScriptInstaller | null;
|
|
64
|
+
/** The explicit binary override each adapter honours verbatim. A set override
|
|
65
|
+
* means the harness runs THAT program, so maintaining the managed copy would
|
|
66
|
+
* change nothing the harness executes. */
|
|
67
|
+
export declare const HARNESS_BINARY_OVERRIDE_ENV: Record<InstallableHarness, string>;
|
|
68
|
+
export declare function selectedHarnessCommand(harness: InstallableHarness, env: NodeJS.ProcessEnv, resolve: (bin: string) => string | null): string;
|
|
69
|
+
/** How an installed vendor CLI can be maintained. `managed_npm` installs one
|
|
70
|
+
* exact registry version in place; `vendor_updater` runs the vendor's own
|
|
71
|
+
* `update` on the launcher that updater rewrites (it resolves latest itself,
|
|
72
|
+
* so no exact/previous/baseline target exists); `vendor_script` has none. */
|
|
73
|
+
export type HarnessMaintenanceMechanism = "managed_npm" | "vendor_updater" | "vendor_script";
|
|
74
|
+
export type HarnessMaintenanceTargetKind = "latest" | "version" | "previous" | "baseline";
|
|
75
|
+
export interface HarnessMaintenanceRecipe {
|
|
76
|
+
mechanism: HarnessMaintenanceMechanism;
|
|
77
|
+
/** Targets the mechanism can install. Empty = inspection only. */
|
|
78
|
+
targets: readonly HarnessMaintenanceTargetKind[];
|
|
79
|
+
/** vendor_updater: the launchers the vendor's updater rewrites under the
|
|
80
|
+
* installation HOME. A copied or version-pinned launcher is NOT among them. */
|
|
81
|
+
launchers: (home: string) => string[];
|
|
82
|
+
}
|
|
83
|
+
export declare function harnessMaintenanceRecipe(harness: InstallableHarness, platform?: NodeJS.Platform): HarnessMaintenanceRecipe;
|
|
64
84
|
export interface HarnessInstallerDisclosure {
|
|
65
85
|
harness: InstallableHarness;
|
|
66
86
|
/** Which prefix this disclosure describes; echoed into every receipt. */
|
|
@@ -76,6 +96,9 @@ export interface HarnessInstallerDisclosure {
|
|
|
76
96
|
* exact vendor version was exercised by this release's freshness gates. */
|
|
77
97
|
verification: HarnessInstallVerification;
|
|
78
98
|
}
|
|
79
|
-
export declare function harnessInstallerDisclosure(harness: InstallableHarness, target?: HarnessInstallTarget, platform?: NodeJS.Platform, _arch?: string
|
|
99
|
+
export declare function harnessInstallerDisclosure(harness: InstallableHarness, target?: HarnessInstallTarget, platform?: NodeJS.Platform, _arch?: string,
|
|
100
|
+
/** Explicit exact maintenance target; omitted installs the release pin. The
|
|
101
|
+
* pin stays reported as `pinnedVersion` either way. */
|
|
102
|
+
version?: string): HarnessInstallerDisclosure;
|
|
80
103
|
export {};
|
|
81
104
|
//# sourceMappingURL=harness-install-recipes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-install-recipes.d.ts","sourceRoot":"","sources":["../src/harness-install-recipes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harness-install-recipes.d.ts","sourceRoot":"","sources":["../src/harness-install-recipes.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAE/E;AAED;;yDAEyD;AACzD,eAAO,MAAM,uBAAuB,YAAI,OAAO,EAAE,QAAQ,CAAU,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,oBAAoB,CAEnF;AAED,uEAAuE;AACvE,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,oBAAoB,EACpB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAOpD,CAAC;AAEF;;;;;;aAMa;AACb,MAAM,MAAM,0BAA0B,GAClC,kBAAkB,GAClB,oBAAoB,GACpB,gBAAgB;AAClB;;qDAEqD;GACnD,qBAAqB,CAAC;AAE1B,eAAO,MAAM,QAAQ,EAAE,OAAO,CAC5B,MAAM,CACJ,kBAAkB,EAClB;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,sBAAsB,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC,0BAA0B,EAAE,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D;mFAC+E;IAC/E,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;CACvC;AASD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,wBAAwB,CAiB1B;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,yEAAyE;IACzE,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB;;gBAEY;IACZ,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;+EAE2E;IAC3E,YAAY,EAAE,0BAA0B,CAAC;CAC1C;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,GAAE,oBAA+B,EACvC,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,KAAK,GAAE,MAAqB;AAC5B;uDACuD;AACvD,OAAO,CAAC,EAAE,MAAM,GACf,0BAA0B,CAyC5B"}
|
|
@@ -11,6 +11,7 @@ import { CLAUDE_VENDOR_CLI_VERSION } from "@claudexor/harness-claude";
|
|
|
11
11
|
import { CODEX_VENDOR_CLI_VERSION } from "@claudexor/harness-codex";
|
|
12
12
|
import { OPENCODE_VENDOR_CLI_VERSION } from "@claudexor/harness-opencode";
|
|
13
13
|
import { copilot } from "@claudexor/harness-acp";
|
|
14
|
+
import { resolveCursorBin } from "@claudexor/harness-cursor";
|
|
14
15
|
import { managedNodeRoot } from "@claudexor/core";
|
|
15
16
|
import { INSTALLABLE_HARNESSES } from "./harness-command-specs.js";
|
|
16
17
|
export function isInstallableHarness(value) {
|
|
@@ -100,7 +101,58 @@ export function scriptInstaller(harness) {
|
|
|
100
101
|
? SCRIPT_INSTALLERS[harness]
|
|
101
102
|
: null;
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
+
/** The explicit binary override each adapter honours verbatim. A set override
|
|
105
|
+
* means the harness runs THAT program, so maintaining the managed copy would
|
|
106
|
+
* change nothing the harness executes. */
|
|
107
|
+
export const HARNESS_BINARY_OVERRIDE_ENV = {
|
|
108
|
+
agy: "CLAUDEXOR_AGY_BIN",
|
|
109
|
+
claude: "CLAUDEXOR_CLAUDE_BIN",
|
|
110
|
+
codex: "CLAUDEXOR_CODEX_BIN",
|
|
111
|
+
copilot: copilot.binaryEnv,
|
|
112
|
+
cursor: "CLAUDEXOR_CURSOR_BIN",
|
|
113
|
+
opencode: "CLAUDEXOR_OPENCODE_BIN",
|
|
114
|
+
};
|
|
115
|
+
/** The command name (or override) the harness adapter itself spawns: Cursor
|
|
116
|
+
* owns its alias choice (`cursor-agent`, else an `agent` inside a Cursor
|
|
117
|
+
* install), every other harness its recipe launcher, an override verbatim. */
|
|
118
|
+
const ADAPTER_COMMAND = { cursor: resolveCursorBin };
|
|
119
|
+
export function selectedHarnessCommand(harness, env, resolve) {
|
|
120
|
+
const override = env[HARNESS_BINARY_OVERRIDE_ENV[harness]]?.trim();
|
|
121
|
+
if (override)
|
|
122
|
+
return override;
|
|
123
|
+
const adapterOwned = ADAPTER_COMMAND[harness];
|
|
124
|
+
if (adapterOwned)
|
|
125
|
+
return adapterOwned(env, resolve);
|
|
126
|
+
return NPM_PINS[harness]?.binaryNames[0] ?? scriptInstaller(harness)?.binaryName ?? harness;
|
|
127
|
+
}
|
|
128
|
+
/** Verified 2026-10-09 (vendor help/source): `agy update` and Cursor's
|
|
129
|
+
* `update` rewrite these POSIX launchers; Windows is not a verified route. */
|
|
130
|
+
const VENDOR_UPDATER_LAUNCHERS = {
|
|
131
|
+
agy: ["agy"],
|
|
132
|
+
cursor: ["cursor-agent", "agent"],
|
|
133
|
+
};
|
|
134
|
+
export function harnessMaintenanceRecipe(harness, platform = process.platform) {
|
|
135
|
+
if (NPM_PINS[harness]) {
|
|
136
|
+
return {
|
|
137
|
+
mechanism: "managed_npm",
|
|
138
|
+
targets: ["latest", "version", "previous", "baseline"],
|
|
139
|
+
launchers: () => [],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const names = VENDOR_UPDATER_LAUNCHERS[harness];
|
|
143
|
+
if (!names || platform === "win32") {
|
|
144
|
+
return { mechanism: "vendor_script", targets: [], launchers: () => [] };
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
mechanism: "vendor_updater",
|
|
148
|
+
targets: ["latest"],
|
|
149
|
+
launchers: (home) => names.map((name) => join(home, ".local", "bin", name)),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export function harnessInstallerDisclosure(harness, target = "remote", platform = process.platform, _arch = process.arch,
|
|
153
|
+
/** Explicit exact maintenance target; omitted installs the release pin. The
|
|
154
|
+
* pin stays reported as `pinnedVersion` either way. */
|
|
155
|
+
version) {
|
|
104
156
|
const layout = TARGET_LAYOUTS[target];
|
|
105
157
|
const pin = NPM_PINS[harness];
|
|
106
158
|
const windows = platform === "win32";
|
|
@@ -111,7 +163,7 @@ export function harnessInstallerDisclosure(harness, target = "remote", platform
|
|
|
111
163
|
return {
|
|
112
164
|
harness,
|
|
113
165
|
target,
|
|
114
|
-
command: `npm install --global --prefix ${layout.displayRoot} ${pin.npmPackage}@${pin.version}`,
|
|
166
|
+
command: `npm install --global --prefix ${layout.displayRoot} ${pin.npmPackage}@${version ?? pin.version}`,
|
|
115
167
|
installLocation,
|
|
116
168
|
pinnedVersion: pin.version,
|
|
117
169
|
verification: pin.verification,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-install-recipes.js","sourceRoot":"","sources":["../src/harness-install-recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAA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EAAE,CAAC,OAAO,CAAC;QACtB,OAAO,EAAE,wBAAwB;QACjC,YAAY,EAAE,kBAAkB;KACjC;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,aAAa;QACzB,WAAW,EAAE,CAAC,UAAU,CAAC;QACzB,OAAO,EAAE,2BAA2B;QACpC,YAAY,EAAE,oBAAoB;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAC/D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,2CAA2C,CAAC;AAC3E,wEAAwE;AACxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,4CAA4C,CAAC;AAEpF;;2EAE2E;AAC3E,MAAM,iBAAiB,GAUnB;IACF,GAAG,EAAE;QACH,UAAU,EAAE,KAAK;QACjB,GAAG,EAAE,eAAe;QACpB,yEAAyE;QACzE,mEAAmE;QACnE,UAAU,EAAE,uBAAuB;QACnC,eAAe,EAAE,8DAA8D;QAC/E,OAAO,EACL,wKAAwK;KAC3K;IACD,MAAM,EAAE;QACN,oEAAoE;QACpE,UAAU,EAAE,cAAc;QAC1B,GAAG,EAAE,kBAAkB;QACvB,eAAe,EAAE,oEAAoE;QACrF,OAAO,EACL,mKAAmK;KACtK;CACF,CAAC;AAIF;sEACsE;AACtE,MAAM,UAAU,eAAe,CAAC,OAA2B;IACzD,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC;QAC9C,CAAC,CAAC,iBAAiB,CAAC,OAAyC,CAAC;QAC9D,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAkBD,MAAM,UAAU,0BAA0B,CACxC,OAA2B,EAC3B,MAAM,GAAyB,QAAQ,EACvC,QAAQ,GAAoB,OAAO,CAAC,QAAQ,EAC5C,KAAK,GAAW,OAAO,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"harness-install-recipes.js","sourceRoot":"","sources":["../src/harness-install-recipes.ts"],"names":[],"mappings":"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C,OAAO,EAAE;YAC1G,eAAe;YACf,aAAa,EAAE,GAAG,CAAC,OAAO;YAC1B,YAAY,EAAE,GAAG,CAAC,YAAY;SAC/B,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC;6DACyD;IACzD,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,gDAAgD,CAAC,CAAC;IACjG,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IACrE,MAAM,IAAI,GAAG,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;IACzE,MAAM,MAAM,GACV,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC,SAAS,CAAC;IACxF,OAAO;QACL,OAAO;QACP,MAAM;QACN,OAAO,EACL,gDAAgD,GAAG,GAAG;YACtD,6BAA6B,IAAI,OAAO,MAAM,qBAAqB,IAAI,EAAE;QAC3E,0EAA0E;QAC1E,6DAA6D;QAC7D,eAAe,EACb,OAAO,IAAI,MAAM,CAAC,UAAU;YAC1B,CAAC,CAAC,0EAA0E;YAC5E,CAAC,CAAC,MAAM,CAAC,eAAe;QAC5B,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,gBAAgB;KAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The process context every harness install/maintenance step runs in: the
|
|
3
|
+
* HOME-anchored prefix, the runner Node and its embedded npm, and the clean
|
|
4
|
+
* vendor-child environment. One producer for the installer, the post-install
|
|
5
|
+
* proof and maintenance inspection, so they can never disagree about which
|
|
6
|
+
* prefix or PATH they read.
|
|
7
|
+
*/
|
|
8
|
+
import { spawnSync } from "node:child_process";
|
|
9
|
+
import type { InstallProofRuntime } from "./harness-install-proof.js";
|
|
10
|
+
import type { HarnessInstallTarget } from "./harness-install-recipes.js";
|
|
11
|
+
export interface InstallerRuntimeOptions {
|
|
12
|
+
home?: string;
|
|
13
|
+
nodePath?: string;
|
|
14
|
+
/** Explicit install layout. Omitted preserves the historical remote target. */
|
|
15
|
+
target?: HarnessInstallTarget;
|
|
16
|
+
spawn?: typeof spawnSync;
|
|
17
|
+
platform?: NodeJS.Platform;
|
|
18
|
+
/** The runner Node's architecture (npm selects the platform package by it). */
|
|
19
|
+
arch?: string;
|
|
20
|
+
/** Test/integration source before the clean allowlist and target-aware PATH
|
|
21
|
+
* normalization are applied. Provider credentials are still scrubbed. */
|
|
22
|
+
sourceEnv?: NodeJS.ProcessEnv;
|
|
23
|
+
}
|
|
24
|
+
export interface InstallerRuntime extends InstallProofRuntime {
|
|
25
|
+
home: string;
|
|
26
|
+
target: HarnessInstallTarget;
|
|
27
|
+
}
|
|
28
|
+
export declare function installerRuntime(options?: InstallerRuntimeOptions): InstallerRuntime;
|
|
29
|
+
//# sourceMappingURL=harness-install-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-install-runtime.d.ts","sourceRoot":"","sources":["../src/harness-install-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;6EACyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAsCxF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The process context every harness install/maintenance step runs in: the
|
|
3
|
+
* HOME-anchored prefix, the runner Node and its embedded npm, and the clean
|
|
4
|
+
* vendor-child environment. One producer for the installer, the post-install
|
|
5
|
+
* proof and maintenance inspection, so they can never disagree about which
|
|
6
|
+
* prefix or PATH they read.
|
|
7
|
+
*/
|
|
8
|
+
import { spawnSync } from "node:child_process";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
import { resolve } from "node:path";
|
|
11
|
+
import { composeBaseEnv, pickAllowlistedEnv, WINDOWS_RUNTIME_ENV_KEYS } from "@claudexor/core";
|
|
12
|
+
export function installerRuntime(options = {}) {
|
|
13
|
+
// Anchored on the SAME `HOME` the harness PATH producer reads, so the prefix
|
|
14
|
+
// this installs into is the prefix doctor/login/run resolve — on Windows
|
|
15
|
+
// `homedir()` follows USERPROFILE and would silently diverge from a scoped
|
|
16
|
+
// HOME.
|
|
17
|
+
const home = resolve(options.home ?? ((options.sourceEnv ?? process.env).HOME || homedir()));
|
|
18
|
+
const target = options.target ?? "remote";
|
|
19
|
+
const platform = options.platform ?? process.platform;
|
|
20
|
+
const runnerNodePath = resolve(options.nodePath ?? process.execPath);
|
|
21
|
+
// Vendor-controlled npm/curl/shell children receive the shared minimal
|
|
22
|
+
// runtime env, never the parent process's provider credentials.
|
|
23
|
+
const resolutionSource = {
|
|
24
|
+
...(options.sourceEnv ?? process.env),
|
|
25
|
+
HOME: home,
|
|
26
|
+
// Local resolution must not read the SSH-runtime vendor prefix; the remote
|
|
27
|
+
// flow keeps whatever its own runtime already exported.
|
|
28
|
+
...(target === "local" ? { CLAUDEXOR_REMOTE_RUNTIME: "0" } : {}),
|
|
29
|
+
};
|
|
30
|
+
const environment = {
|
|
31
|
+
...composeBaseEnv("clean", resolutionSource, runnerNodePath, platform),
|
|
32
|
+
// npm and the vendor image cannot start on Windows without the process
|
|
33
|
+
// environment the OS itself resolves against (the login/setup lanes
|
|
34
|
+
// forward the same named set).
|
|
35
|
+
...(platform === "win32"
|
|
36
|
+
? pickAllowlistedEnv(resolutionSource, WINDOWS_RUNTIME_ENV_KEYS, platform)
|
|
37
|
+
: {}),
|
|
38
|
+
HOME: home,
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
home,
|
|
42
|
+
target,
|
|
43
|
+
runnerNodePath,
|
|
44
|
+
platform,
|
|
45
|
+
arch: options.arch ?? process.arch,
|
|
46
|
+
resolutionSource,
|
|
47
|
+
environment,
|
|
48
|
+
spawn: options.spawn ?? spawnSync,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=harness-install-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-install-runtime.js","sourceRoot":"","sources":["../src/harness-install-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAuB/F,MAAM,UAAU,gBAAgB,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AgB;QAChB,WAAW;QACX,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,SAAS;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -1,58 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `claudexor harness install` — the disclosed, pinned vendor installer
|
|
3
|
-
* (issue #89; restored from the PR #82 cut with the security objections
|
|
4
|
-
* fixed). The historical/default `remote` target remains the SSH-host flow;
|
|
5
|
-
* an explicit `local` target installs into the managed toolchain root that
|
|
6
|
-
* local harness resolution already owns.
|
|
7
|
-
*
|
|
8
|
-
* Contract:
|
|
9
|
-
* - npm-distributed harnesses (claude/codex/opencode) install ONE exact
|
|
10
|
-
* version — the per-package vendor-version SSOT — never `@latest`. npm
|
|
11
|
-
* verifies the registry integrity checksum for an exact version, so the
|
|
12
|
-
* pin is a real guarantee. For claude/codex that SSOT is the value the
|
|
13
|
-
* model/effort freshness gates verified; the opencode pin is a
|
|
14
|
-
* deterministic install target, NOT a verification claim (no recorded
|
|
15
|
-
* fixture yet — see packages/harness-opencode vendor-cli-version.ts).
|
|
16
|
-
* - cursor and agy have no npm artifact and CANNOT be pinned. Instead of
|
|
17
|
-
* pretending, the HUMAN is the verifier: the complete vendor script is
|
|
18
|
-
* downloaded first (never piped to a shell), its size and sha256 are
|
|
19
|
-
* printed, and it runs in the visible PTY the operator is watching — the
|
|
20
|
-
* same principle as interactive SSH auth.
|
|
21
|
-
* - NOTHING executes without authorization: the exact command and install
|
|
22
|
-
* destination print first, and execution needs a TTY confirmation or an
|
|
23
|
-
* explicit `--yes` (the macOS flow confirms against this module's own
|
|
24
|
-
* `--dry-run --json` disclosure before passing `--yes`). For a host
|
|
25
|
-
* integration, `--target local --yes` IS that authorization, granted by the
|
|
26
|
-
* owner action that invoked it; there is no second confirmation hidden
|
|
27
|
-
* inside the producer, and the unattended script path never claims the
|
|
28
|
-
* human-observed verification the watched remote path earns.
|
|
29
|
-
* - concurrent installs into one prefix are serialized by a cross-process
|
|
30
|
-
* lease. A lease whose owner died is NOT reclaimed automatically: it fails
|
|
31
|
-
* closed with a typed `install_lock_stale` and the exact cleanup path.
|
|
32
|
-
* - failures are typed and loud; a failed download, a non-zero installer exit,
|
|
33
|
-
* or a failed post-install binary/version proof never reads as success, and
|
|
34
|
-
* the temp download dir is removed on every path.
|
|
35
|
-
* - the post-install PROOF is what the local target has instead of a witness.
|
|
36
|
-
* A watched remote install keeps the historical exit-code contract, because
|
|
37
|
-
* the operator is looking at the terminal; an unattended local install must
|
|
38
|
-
* earn its `ok:true`, so exit zero without a resolvable launcher and a
|
|
39
|
-
* matching `--version` is a typed failure, and `installedBinary` /
|
|
40
|
-
* `installedVersion` are present on every local success.
|
|
41
|
-
* - on Windows the local target installs only where the pinned npm package
|
|
42
|
-
* yields a verified package-native image (codex): npm's own `.cmd` shim is
|
|
43
|
-
* never the launcher, the embedded Node's `node_modules/npm/bin/npm-cli.js`
|
|
44
|
-
* runs the install, and the proof executes the image the shared harness
|
|
45
|
-
* PATH resolves; other vendors refuse typed before any side effect.
|
|
46
|
-
* - `--json` keeps stdout pure: exactly ONE JSON object. In json mode every
|
|
47
|
-
* human progress line goes to stderr and child processes (npm/curl/the
|
|
48
|
-
* vendor script) run with their stdout routed onto stderr, so vendor
|
|
49
|
-
* output stays visible without corrupting the machine envelope.
|
|
50
|
-
*/
|
|
51
|
-
import { spawnSync } from "node:child_process";
|
|
52
1
|
import { existsSync, mkdirSync } from "node:fs";
|
|
53
2
|
import { type ParsedArgs } from "./args.js";
|
|
54
|
-
import { type
|
|
55
|
-
|
|
3
|
+
import { type InstallerRuntimeOptions } from "./harness-install-runtime.js";
|
|
4
|
+
import { type InstallableHarness } from "./harness-install-recipes.js";
|
|
5
|
+
export { AGY_INSTALL_URL, AGY_INSTALL_URL_WINDOWS, CURSOR_INSTALL_URL, HARNESS_INSTALL_TARGETS, harnessInstallerDisclosure, isHarnessInstallTarget, isInstallableHarness, type InstallableHarness, } from "./harness-install-recipes.js";
|
|
56
6
|
export interface HarnessInstallRunResult {
|
|
57
7
|
exitCode: number;
|
|
58
8
|
/** Set when the installer refused loudly WITHOUT running the vendor
|
|
@@ -68,30 +18,34 @@ export interface HarnessInstallRunResult {
|
|
|
68
18
|
/** Present on every SUCCESS: the exact npm pin, or the script vendor's own
|
|
69
19
|
* trimmed `--version` line. */
|
|
70
20
|
installedVersion?: string;
|
|
21
|
+
/** Explicit-version installs only: the managed package version declared
|
|
22
|
+
* before the first mutation (null when there was none). */
|
|
23
|
+
previousVersion?: string | null;
|
|
71
24
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
25
|
+
/** A local Windows install is supported exactly where the pinned npm package
|
|
26
|
+
* has declared Windows support for this architecture. Post-install proof uses
|
|
27
|
+
* its standard npm entrypoint, whether native or Node. Other recipes keep
|
|
28
|
+
* their existing platform boundary; the remote target is unaffected. */
|
|
29
|
+
export declare function localPlatformRefusal(harness: InstallableHarness, platform: NodeJS.Platform, arch: string): HarnessInstallRunResult | null;
|
|
30
|
+
export declare function runHarnessInstaller(harness: InstallableHarness, options?: InstallerRuntimeOptions & {
|
|
78
31
|
mkdir?: typeof mkdirSync;
|
|
79
32
|
exists?: typeof existsSync;
|
|
80
33
|
/** Production installs serialize cross-process. Tests may disable only this
|
|
81
34
|
* wrapper while preserving the install recipe under test. */
|
|
82
35
|
lock?: boolean;
|
|
83
36
|
lockTimeoutMs?: number;
|
|
84
|
-
platform?: NodeJS.Platform;
|
|
85
|
-
/** The runner Node's architecture (npm selects the platform package by it). */
|
|
86
|
-
arch?: string;
|
|
87
|
-
/** Test/integration source before the clean allowlist and target-aware PATH
|
|
88
|
-
* normalization are applied. Provider credentials are still scrubbed. */
|
|
89
|
-
sourceEnv?: NodeJS.ProcessEnv;
|
|
90
37
|
/** `--json` stdout purity: route human progress lines AND child stdout
|
|
91
38
|
* to stderr, so stdout carries exactly one JSON object (the caller's
|
|
92
39
|
* final envelope). Human mode keeps everything on stdout as before. */
|
|
93
40
|
json?: boolean;
|
|
41
|
+
/** Explicit exact maintenance target (local npm recipes only). Omitted is
|
|
42
|
+
* the ensure path: install the release pin unless the managed copy already
|
|
43
|
+
* runs it or a NEWER runnable version, which is never downgraded. */
|
|
44
|
+
version?: string;
|
|
94
45
|
}): HarnessInstallRunResult;
|
|
46
|
+
/** Blocking y/N read on the controlling TTY (fd 0). Anything but an explicit
|
|
47
|
+
* yes declines — closing stdin or an unreadable terminal never installs. */
|
|
48
|
+
export declare function confirmOnTty(question: string): boolean;
|
|
95
49
|
export declare function harnessInstallCommand(args: ParsedArgs, json: boolean,
|
|
96
50
|
/** Test seam: forwarded to `runHarnessInstaller` (spawn/home/... fakes). */
|
|
97
51
|
runnerOptions?: Omit<NonNullable<Parameters<typeof runHarnessInstaller>[1]>, "json" | "target">): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-installer.d.ts","sourceRoot":"","sources":["../src/harness-installer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harness-installer.d.ts","sourceRoot":"","sources":["../src/harness-installer.ts"],"names":[],"mappings":"AAmDA,OAAO,EAAE,UAAU,EAAE,SAAS,EAA+C,MAAM,SAAS,CAAC;AAI7F,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAiB/D,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE9F,OAAO,EAQL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,kBAAkB,GACxB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB;+EAC2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,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