@claudexor/cli 3.1.1 → 3.2.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/about-command.d.ts.map +1 -1
- package/dist/accounts-projection.d.ts +8 -1
- package/dist/accounts-projection.d.ts.map +1 -1
- package/dist/accounts-projection.js +33 -20
- package/dist/accounts-projection.js.map +1 -1
- package/dist/accounts-services.d.ts +206 -0
- package/dist/accounts-services.d.ts.map +1 -0
- package/dist/accounts-services.js +71 -0
- package/dist/accounts-services.js.map +1 -0
- package/dist/acp-surface-runner.d.ts +39 -0
- package/dist/acp-surface-runner.d.ts.map +1 -1
- package/dist/acp-surface-runner.js +104 -30
- package/dist/acp-surface-runner.js.map +1 -1
- package/dist/attachment-upload.d.ts +5 -0
- package/dist/attachment-upload.d.ts.map +1 -0
- package/dist/attachment-upload.js +64 -0
- package/dist/attachment-upload.js.map +1 -0
- package/dist/belt-bridge.d.ts +2 -0
- package/dist/belt-bridge.d.ts.map +1 -0
- package/dist/belt-bridge.js +31 -0
- package/dist/belt-bridge.js.map +1 -0
- package/dist/bridge-serve.d.ts +1 -9
- package/dist/bridge-serve.d.ts.map +1 -1
- package/dist/bridge-serve.js +5 -22
- package/dist/bridge-serve.js.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +8 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/choice-input.d.ts +7 -0
- package/dist/choice-input.d.ts.map +1 -0
- package/dist/choice-input.js +17 -0
- package/dist/choice-input.js.map +1 -0
- package/dist/claude-oauth-usage.js.map +1 -1
- package/dist/claudexord-entry.d.ts +11 -0
- package/dist/claudexord-entry.d.ts.map +1 -0
- package/dist/claudexord-entry.js +42 -0
- package/dist/claudexord-entry.js.map +1 -0
- package/dist/claudexord.d.ts +2 -17
- package/dist/claudexord.d.ts.map +1 -1
- package/dist/claudexord.js +60 -93
- package/dist/claudexord.js.map +1 -1
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +21 -11
- package/dist/cli-error.js.map +1 -1
- package/dist/cli.js +149 -170
- package/dist/cli.js.map +1 -1
- package/dist/codex-device-login.js.map +1 -1
- package/dist/codex-quota-source.js.map +1 -1
- package/dist/command-flags.d.ts +16 -1
- package/dist/command-flags.d.ts.map +1 -1
- package/dist/command-flags.js +41 -19
- package/dist/command-flags.js.map +1 -1
- package/dist/command-registry.d.ts +21 -8
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +59 -116
- package/dist/command-registry.js.map +1 -1
- package/dist/command-scope.d.ts +13 -0
- package/dist/command-scope.d.ts.map +1 -0
- package/dist/command-scope.js +61 -0
- package/dist/command-scope.js.map +1 -0
- package/dist/control-services.d.ts +1622 -982
- package/dist/control-services.d.ts.map +1 -1
- package/dist/control-services.js +39 -68
- package/dist/control-services.js.map +1 -1
- package/dist/credential-commands.d.ts.map +1 -1
- package/dist/credential-commands.js +13 -3
- package/dist/credential-commands.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-outcome.d.ts +3 -5
- package/dist/daemon-outcome.d.ts.map +1 -1
- package/dist/daemon-outcome.js +7 -19
- package/dist/daemon-outcome.js.map +1 -1
- package/dist/daemon-run.d.ts +26 -29
- package/dist/daemon-run.d.ts.map +1 -1
- package/dist/daemon-run.js +89 -97
- package/dist/daemon-run.js.map +1 -1
- package/dist/daemon-runtime-shutdown.d.ts +7 -0
- package/dist/daemon-runtime-shutdown.d.ts.map +1 -1
- package/dist/daemon-runtime-shutdown.js +29 -0
- package/dist/daemon-runtime-shutdown.js.map +1 -1
- package/dist/delegation-belt-descriptor.d.ts +20 -36
- package/dist/delegation-belt-descriptor.d.ts.map +1 -1
- package/dist/delegation-belt-descriptor.js +48 -51
- package/dist/delegation-belt-descriptor.js.map +1 -1
- package/dist/delegation-capability.d.ts +4 -0
- package/dist/delegation-capability.d.ts.map +1 -0
- package/dist/delegation-capability.js +29 -0
- package/dist/delegation-capability.js.map +1 -0
- package/dist/delegation-daemon-binding.d.ts +8 -0
- package/dist/delegation-daemon-binding.d.ts.map +1 -0
- package/dist/delegation-daemon-binding.js +18 -0
- package/dist/delegation-daemon-binding.js.map +1 -0
- package/dist/delegation-output.d.ts +18 -0
- package/dist/delegation-output.d.ts.map +1 -0
- package/dist/delegation-output.js +47 -0
- package/dist/delegation-output.js.map +1 -0
- package/dist/harness-command.d.ts +13 -0
- package/dist/harness-command.d.ts.map +1 -0
- package/dist/harness-command.js +35 -0
- package/dist/harness-command.js.map +1 -0
- package/dist/harness-installer.d.ts +79 -0
- package/dist/harness-installer.d.ts.map +1 -0
- package/dist/harness-installer.js +256 -0
- package/dist/harness-installer.js.map +1 -0
- package/dist/interaction-prompt.d.ts +19 -0
- package/dist/interaction-prompt.d.ts.map +1 -0
- package/dist/interaction-prompt.js +114 -0
- package/dist/interaction-prompt.js.map +1 -0
- package/dist/live.d.ts +2 -6
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +92 -75
- package/dist/live.js.map +1 -1
- package/dist/mcp-daemon-unavailable.d.ts +6 -0
- package/dist/mcp-daemon-unavailable.d.ts.map +1 -0
- package/dist/mcp-daemon-unavailable.js +16 -0
- package/dist/mcp-daemon-unavailable.js.map +1 -0
- package/dist/mcp-run-projections.d.ts +42 -0
- package/dist/mcp-run-projections.d.ts.map +1 -0
- package/dist/mcp-run-projections.js +74 -0
- package/dist/mcp-run-projections.js.map +1 -0
- package/dist/mcp-runner.d.ts +19 -1
- package/dist/mcp-runner.d.ts.map +1 -1
- package/dist/mcp-runner.js +121 -115
- package/dist/mcp-runner.js.map +1 -1
- package/dist/native-login.js.map +1 -1
- package/dist/ops-command-specs.d.ts +64 -0
- package/dist/ops-command-specs.d.ts.map +1 -0
- package/dist/ops-command-specs.js +146 -0
- package/dist/ops-command-specs.js.map +1 -0
- package/dist/ops-commands.d.ts.map +1 -1
- package/dist/ops-commands.js +23 -5
- package/dist/ops-commands.js.map +1 -1
- package/dist/orphan-reaper.js.map +1 -1
- package/dist/output-mode.d.ts +11 -0
- package/dist/output-mode.d.ts.map +1 -0
- package/dist/output-mode.js +28 -0
- package/dist/output-mode.js.map +1 -0
- package/dist/plan-question-loop.d.ts.map +1 -1
- package/dist/plan-question-loop.js +16 -13
- package/dist/plan-question-loop.js.map +1 -1
- package/dist/plugins.js +1 -1
- package/dist/plugins.js.map +1 -1
- package/dist/primary-output.d.ts +9 -4
- package/dist/primary-output.d.ts.map +1 -1
- package/dist/primary-output.js +50 -2
- package/dist/primary-output.js.map +1 -1
- package/dist/quota-subject-universe.d.ts +6 -0
- package/dist/quota-subject-universe.d.ts.map +1 -0
- package/dist/quota-subject-universe.js +31 -0
- package/dist/quota-subject-universe.js.map +1 -0
- package/dist/registry.js.map +1 -1
- package/dist/release-command.d.ts +1 -1
- package/dist/release-command.js +2 -2
- package/dist/remote-command-specs.d.ts +45 -0
- package/dist/remote-command-specs.d.ts.map +1 -0
- package/dist/remote-command-specs.js +29 -0
- package/dist/remote-command-specs.js.map +1 -0
- package/dist/remote-command.d.ts +11 -0
- package/dist/remote-command.d.ts.map +1 -0
- package/dist/remote-command.js +262 -0
- package/dist/remote-command.js.map +1 -0
- package/dist/remote-filesystem.d.ts +33 -0
- package/dist/remote-filesystem.d.ts.map +1 -0
- package/dist/remote-filesystem.js +280 -0
- package/dist/remote-filesystem.js.map +1 -0
- package/dist/repo-asset-authority.js.map +1 -1
- package/dist/request-preflight.d.ts +11 -2
- package/dist/request-preflight.d.ts.map +1 -1
- package/dist/request-preflight.js +36 -13
- package/dist/request-preflight.js.map +1 -1
- package/dist/retry-command-specs.d.ts.map +1 -1
- package/dist/retry-command-specs.js +2 -0
- package/dist/retry-command-specs.js.map +1 -1
- package/dist/run-applicability.d.ts +74 -0
- package/dist/run-applicability.d.ts.map +1 -0
- package/dist/run-applicability.js +72 -0
- package/dist/run-applicability.js.map +1 -0
- package/dist/run-detail-projections.d.ts +39 -0
- package/dist/run-detail-projections.d.ts.map +1 -0
- package/dist/run-detail-projections.js +64 -0
- package/dist/run-detail-projections.js.map +1 -0
- package/dist/run-detail-response.d.ts +7 -0
- package/dist/run-detail-response.d.ts.map +1 -0
- package/dist/run-detail-response.js +23 -0
- package/dist/run-detail-response.js.map +1 -0
- package/dist/run-facts-projection.d.ts +22 -0
- package/dist/run-facts-projection.d.ts.map +1 -0
- package/dist/run-facts-projection.js +86 -0
- package/dist/run-facts-projection.js.map +1 -0
- package/dist/runtime-replacement-stop.d.ts +25 -0
- package/dist/runtime-replacement-stop.d.ts.map +1 -0
- package/dist/runtime-replacement-stop.js +145 -0
- package/dist/runtime-replacement-stop.js.map +1 -0
- package/dist/settings-command.d.ts +1 -0
- package/dist/settings-command.d.ts.map +1 -1
- package/dist/settings-command.js +27 -21
- package/dist/settings-command.js.map +1 -1
- package/dist/settings-service.d.ts +7 -7
- package/dist/settings-service.d.ts.map +1 -1
- package/dist/settings-service.js +3 -3
- package/dist/settings-service.js.map +1 -1
- package/dist/setup-client-pty.d.ts +14 -0
- package/dist/setup-client-pty.d.ts.map +1 -0
- package/dist/setup-client-pty.js +61 -0
- package/dist/setup-client-pty.js.map +1 -0
- package/dist/setup-device-code-disclosure.d.ts +15 -0
- package/dist/setup-device-code-disclosure.d.ts.map +1 -0
- package/dist/setup-device-code-disclosure.js +52 -0
- package/dist/setup-device-code-disclosure.js.map +1 -0
- package/dist/setup-job-reducer.d.ts.map +1 -1
- package/dist/setup-job-reducer.js +1 -0
- package/dist/setup-job-reducer.js.map +1 -1
- package/dist/setup-job-store.d.ts +275 -75
- package/dist/setup-job-store.d.ts.map +1 -1
- package/dist/setup-job-store.js.map +1 -1
- package/dist/setup-job-support.js.map +1 -1
- package/dist/setup-jobs.d.ts +517 -137
- package/dist/setup-jobs.d.ts.map +1 -1
- package/dist/setup-jobs.js +68 -118
- package/dist/setup-jobs.js.map +1 -1
- package/dist/setup-lifecycle-binding.d.ts +7 -0
- package/dist/setup-lifecycle-binding.d.ts.map +1 -1
- package/dist/setup-lifecycle-binding.js +6 -0
- package/dist/setup-lifecycle-binding.js.map +1 -1
- package/dist/setup-login-child-lifecycle.d.ts +13 -0
- package/dist/setup-login-child-lifecycle.d.ts.map +1 -0
- package/dist/setup-login-child-lifecycle.js +45 -0
- package/dist/setup-login-child-lifecycle.js.map +1 -0
- package/dist/setup-login-inline.d.ts +11 -12
- package/dist/setup-login-inline.d.ts.map +1 -1
- package/dist/setup-login-inline.js +26 -15
- package/dist/setup-login-inline.js.map +1 -1
- package/dist/setup-login-permit.d.ts +10 -0
- package/dist/setup-login-permit.d.ts.map +1 -0
- package/dist/setup-login-permit.js +52 -0
- package/dist/setup-login-permit.js.map +1 -0
- package/dist/setup-login-protocol.d.ts.map +1 -1
- package/dist/setup-login-protocol.js +9 -2
- package/dist/setup-login-protocol.js.map +1 -1
- package/dist/setup-login-runner.d.ts +1 -0
- package/dist/setup-login-runner.d.ts.map +1 -1
- package/dist/setup-login-runner.js +20 -31
- package/dist/setup-login-runner.js.map +1 -1
- package/dist/setup-supervisor.d.ts.map +1 -1
- package/dist/setup-supervisor.js.map +1 -1
- package/dist/terminal-run-output.d.ts +12 -0
- package/dist/terminal-run-output.d.ts.map +1 -0
- package/dist/terminal-run-output.js +33 -0
- package/dist/terminal-run-output.js.map +1 -0
- package/dist/thread-delivery.d.ts.map +1 -1
- package/dist/thread-delivery.js +4 -3
- package/dist/thread-delivery.js.map +1 -1
- package/dist/thread-execution-workspace.d.ts +15 -0
- package/dist/thread-execution-workspace.d.ts.map +1 -1
- package/dist/thread-execution-workspace.js +39 -5
- package/dist/thread-execution-workspace.js.map +1 -1
- package/dist/thread-turn-services.d.ts +104 -0
- package/dist/thread-turn-services.d.ts.map +1 -0
- package/dist/thread-turn-services.js +27 -0
- package/dist/thread-turn-services.js.map +1 -0
- package/package.json +23 -23
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import {
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { resolve } from "node:path";
|
|
4
3
|
import { DEFAULT_MAX_SUBRUNS, delegationEnv } from "@claudexor/mcp-server";
|
|
5
4
|
import { defaultSocketPath } from "@claudexor/daemon";
|
|
6
5
|
import { DelegationBeltUnavailableError } from "@claudexor/core";
|
|
@@ -24,75 +23,58 @@ export function beltDaemonDiscoveryEnv() {
|
|
|
24
23
|
return {
|
|
25
24
|
CLAUDEXOR_CONFIG_DIR: userConfigDir(),
|
|
26
25
|
CLAUDEXOR_DAEMON_SOCK: defaultSocketPath(),
|
|
26
|
+
// The belt intentionally points at the parent daemon's non-default root
|
|
27
|
+
// from inside a scoped HOME. Mark that override as deliberate so an
|
|
28
|
+
// inherited matching host-plugin version cannot misclassify it as stale
|
|
29
|
+
// plugin_artifact_skew before MCP initialize.
|
|
30
|
+
CLAUDEXOR_ROOT_MODE: "explicit",
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* `claudexord.
|
|
34
|
-
*
|
|
35
|
-
* single-file macOS app bundle the daemon is `claudexord.bundle.cjs` in
|
|
36
|
-
* `Contents/Resources` with NO sibling `cli.js` — so BOTH candidates can be
|
|
37
|
-
* absent, and the fallback must not be trusted blindly.
|
|
34
|
+
* Resolve the exact entry that started THIS daemon. `runClaudexordEntry()`
|
|
35
|
+
* dispatches `mcp serve-belt` before daemon initialization, so the same path
|
|
36
|
+
* works for direct dev/npm `claudexord.js`, the npm bin wrapper, and the
|
|
37
|
+
* packaged single-file `claudexord.bundle.cjs`. There is no adjacent-file
|
|
38
|
+
* guess and no second CLI copy in the app closure.
|
|
38
39
|
*/
|
|
39
|
-
export function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!out.includes(own))
|
|
45
|
-
out.push(own);
|
|
46
|
-
return out;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Absolute path to the CLI entry (`cli.js`) that hosts `mcp serve-belt`, or
|
|
50
|
-
* `undefined` when NO candidate exists on disk. EVERY candidate — including the
|
|
51
|
-
* module-relative fallback — is existence-validated: a descriptor that points
|
|
52
|
-
* at a missing `cli.js` spawns `node <missing> mcp serve-belt`, which
|
|
53
|
-
* MODULE_NOT_FOUNDs inside the harness; the belt reports `failed`, the harness
|
|
54
|
-
* silently answers from its own native subagent, and the run terminalizes a
|
|
55
|
-
* false success (QA-024). Returning `undefined` lets the descriptor builder
|
|
56
|
-
* refuse TYPED at preflight instead of emitting a dead descriptor.
|
|
57
|
-
*
|
|
58
|
-
* This mirrors the browser launcher's resolution: prefer the entry adjacent to
|
|
59
|
-
* the launching process (survives symlinked / wrapped launches), then fall back
|
|
60
|
-
* to this module's own directory — but never return an unchecked path.
|
|
61
|
-
*/
|
|
62
|
-
export function resolveCliEntry(argv1 = process.argv[1]) {
|
|
63
|
-
return beltCliEntryCandidates(argv1).find((candidate) => existsSync(candidate));
|
|
40
|
+
export function resolveDaemonEntry(argv1 = process.argv[1]) {
|
|
41
|
+
if (!argv1)
|
|
42
|
+
return undefined;
|
|
43
|
+
const entry = resolve(argv1);
|
|
44
|
+
return existsSync(entry) ? entry : undefined;
|
|
64
45
|
}
|
|
65
46
|
/**
|
|
66
47
|
* Build the delegation belt MCP-server descriptor injected into a delegate
|
|
67
|
-
* agent run's sandbox (D32). The child harness
|
|
68
|
-
*
|
|
69
|
-
*
|
|
48
|
+
* agent run's sandbox (D32). The child harness re-enters the exact running
|
|
49
|
+
* daemon entry as `node <daemon-entry> mcp serve-belt`; that entry dispatches
|
|
50
|
+
* the side-effect-free belt server before daemon startup. The belt process
|
|
51
|
+
* reads its policy from the injected env: depth 0
|
|
70
52
|
* (top-level — the sub-runs it starts carry no belt, so nesting cannot exceed
|
|
71
|
-
* 1), the sub-run cap, and a snapshot of the parent's paid-budget
|
|
53
|
+
* 1), the sub-run cap, and a conservative snapshot of the parent's paid-budget
|
|
54
|
+
* headroom. The daemon-lifetime shared ledger remains the authoritative cap.
|
|
72
55
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* never emits a descriptor that would MODULE_NOT_FOUND inside the harness and
|
|
77
|
-
* degrade into a silent native-subagent false success. Packaging shipping a
|
|
78
|
-
* real belt entry is Ф4 territory; until then the honest packaged behavior for
|
|
79
|
-
* `--delegate` is this refusal.
|
|
56
|
+
* QA-024 remains fail-closed: when the executing daemon entry cannot be
|
|
57
|
+
* resolved on disk, throw before harness spawn instead of emitting a dead MCP
|
|
58
|
+
* descriptor that could silently degrade to a native subagent.
|
|
80
59
|
*/
|
|
81
|
-
export function buildDelegationBeltDescriptor(paidBudget,
|
|
82
|
-
if (!
|
|
83
|
-
|
|
84
|
-
throw new DelegationBeltUnavailableError(`--delegate cannot start the Claudexor delegation belt: no 'cli.js' entry that hosts 'mcp serve-belt' exists (probed: ${probed.join(", ") || "<none>"}). This is the packaged single-file bundle without a bundled CLI entry — the belt would MODULE_NOT_FOUND inside the harness and silently degrade to a native subagent. Re-run without --delegate, or use an install that ships cli.js next to the daemon.`);
|
|
60
|
+
export function buildDelegationBeltDescriptor(paidBudget, daemonEntry = resolveDaemonEntry(), discoveryEnv = beltDaemonDiscoveryEnv()) {
|
|
61
|
+
if (!daemonEntry) {
|
|
62
|
+
throw new DelegationBeltUnavailableError("--delegate cannot start the Claudexor delegation belt: the running daemon entry could not be resolved on disk. Re-run without --delegate, or repair/update the Claudexor runtime.");
|
|
85
63
|
}
|
|
86
64
|
return {
|
|
87
65
|
name: "claudexor",
|
|
88
66
|
command: process.execPath,
|
|
89
|
-
args: [
|
|
67
|
+
args: [daemonEntry, "mcp", "serve-belt"],
|
|
68
|
+
required: true,
|
|
90
69
|
env: {
|
|
91
70
|
// Daemon discovery FIRST so the delegation-policy vars can never be
|
|
92
71
|
// clobbered by a discovery key (disjoint namespaces, but explicit).
|
|
93
72
|
...discoveryEnv,
|
|
94
73
|
...delegationEnv({
|
|
95
74
|
parentRunId: "",
|
|
75
|
+
// Rebound by the orchestrator from the normalized run input before the
|
|
76
|
+
// descriptor reaches any lane; empty fails closed at the tool boundary.
|
|
77
|
+
repoRoot: "",
|
|
96
78
|
depth: 0,
|
|
97
79
|
maxSubRuns: DEFAULT_MAX_SUBRUNS,
|
|
98
80
|
parentBudget: paidBudget ?? { kind: "unlimited" },
|
|
@@ -100,4 +82,19 @@ export function buildDelegationBeltDescriptor(paidBudget, cliEntry = resolveCliE
|
|
|
100
82
|
},
|
|
101
83
|
};
|
|
102
84
|
}
|
|
85
|
+
/** Composition-root policy: only a known pre-start entry absence may degrade
|
|
86
|
+
* Delegate to ordinary Agent. The orchestrator receives requested=true plus a
|
|
87
|
+
* null belt and owns the durable runtime_unavailable receipt. */
|
|
88
|
+
export function delegationBeltForRun(requested, paidBudget, daemonEntry = resolveDaemonEntry(), discoveryEnv = beltDaemonDiscoveryEnv()) {
|
|
89
|
+
if (!requested)
|
|
90
|
+
return null;
|
|
91
|
+
try {
|
|
92
|
+
return buildDelegationBeltDescriptor(paidBudget, daemonEntry ?? null, discoveryEnv);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (error instanceof DelegationBeltUnavailableError)
|
|
96
|
+
return null;
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
103
100
|
//# sourceMappingURL=delegation-belt-descriptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegation-belt-descriptor.js","sourceRoot":"","sources":["../src/delegation-belt-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"delegation-belt-descriptor.js","sourceRoot":"","sources":["../src/delegation-belt-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,O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AAa,CAAC;gBACf,WAAW,EAAE,EAAE;gBACf,uEAAuE;gBACvE,wEAAwE;gBACxE,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,CAAC;gBACR,UAAU,EAAE,mBAAmB;gBAC/B,YAAY,EAAE,UAAU,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE;aAClD,CAAC;SACH;KACF,CAAC;AACJ,CAAC;AAED;;iEAEiE;AACjE,MAAM,UAAU,oBAAoB,CAClC,SAAkB,EAClB,UAAkC,EAClC,WAAW,GAA8B,kBAAkB,EAAE,EAC7D,YAAY,GAA2B,sBAAsB,EAAE;IAE/D,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,CAAC;QACH,OAAO,6BAA6B,CAAC,UAAU,EAAE,WAAW,IAAI,IAAI,EAAE,YAAY,CAAC,CAAC;IACtF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,8BAA8B;YAAE,OAAO,IAAI,CAAC;QACjE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DelegationCapability, type HarnessManifest } from "@claudexor/schema";
|
|
2
|
+
/** One producer for the installed-runtime x harness Delegate capability. */
|
|
3
|
+
export declare function delegationCapabilityFor(manifest: HarnessManifest | null | undefined, runtimeAvailable?: boolean): DelegationCapability;
|
|
4
|
+
//# sourceMappingURL=delegation-capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-capability.d.ts","sourceRoot":"","sources":["../src/delegation-capability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG/E,4EAA4E;AAC5E,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC5C,gBAAgB,UAAqC,GACpD,oBAAoB,CAyBtB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DelegationCapability } from "@claudexor/schema";
|
|
2
|
+
import { resolveDaemonEntry } from "./delegation-belt-descriptor.js";
|
|
3
|
+
/** One producer for the installed-runtime x harness Delegate capability. */
|
|
4
|
+
export function delegationCapabilityFor(manifest, runtimeAvailable = resolveDaemonEntry() !== undefined) {
|
|
5
|
+
const requiresFullAccess = manifest?.capability_profile.mcp_injection_requires_full_access ?? false;
|
|
6
|
+
if (manifest?.capability_profile.mcp_injection !== true) {
|
|
7
|
+
return DelegationCapability.parse({
|
|
8
|
+
available: false,
|
|
9
|
+
reason: "manifest_unsupported",
|
|
10
|
+
remediation: "Choose a harness that supports Claudexor MCP injection.",
|
|
11
|
+
requiresFullAccess,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
if (!runtimeAvailable) {
|
|
15
|
+
return DelegationCapability.parse({
|
|
16
|
+
available: false,
|
|
17
|
+
reason: "runtime_unavailable",
|
|
18
|
+
remediation: "Update or repair the Claudexor runtime to restore Delegate.",
|
|
19
|
+
requiresFullAccess,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return DelegationCapability.parse({
|
|
23
|
+
available: true,
|
|
24
|
+
reason: "ready",
|
|
25
|
+
remediation: null,
|
|
26
|
+
requiresFullAccess,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=delegation-capability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-capability.js","sourceRoot":"","sources":["../src/delegation-capability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CACrC,QAA4C,EAC5C,gBAAgB,GAAG,kBAAkB,EAAE,KAAK,SAAS;IAErD,MAAM,kBAAkB,GACtB,QAAQ,EAAE,kBAAkB,CAAC,kCAAkC,IAAI,KAAK,CAAC;IAC3E,IAAI,QAAQ,EAAE,kBAAkB,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;QACxD,OAAO,oBAAoB,CAAC,KAAK,CAAC;YAChC,SAAS,EAAE,KAAK;YAChB,MAAM,EAAE,sBAAsB;YAC9B,WAAW,EAAE,yDAAyD;YACtE,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC;IACD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,oBAAoB,CAAC,KAAK,CAAC;YAChC,SAAS,EAAE,KAAK;YAChB,MAAM,EAAE,qBAAqB;YAC7B,WAAW,EAAE,6DAA6D;YAC1E,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,oBAAoB,CAAC,KAAK,CAAC;QAChC,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,IAAI;QACjB,kBAAkB;KACnB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DaemonServer } from "@claudexor/daemon";
|
|
2
|
+
import { DelegationBudgetAuthority } from "@claudexor/orchestrator";
|
|
3
|
+
/** Break the composition-root callback cycle without weakening cancellation ownership. */
|
|
4
|
+
export declare function createDelegationDaemonBinding(): {
|
|
5
|
+
authority: DelegationBudgetAuthority;
|
|
6
|
+
bind(server: Pick<DaemonServer, "cancelJob">): void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=delegation-daemon-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-daemon-binding.d.ts","sourceRoot":"","sources":["../src/delegation-daemon-binding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,0FAA0F;AAC1F,wBAAgB,6BAA6B,IAAI;IAC/C,SAAS,EAAE,yBAAyB,CAAC;IACrC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC;CACrD,CAaA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DelegationBudgetAuthority } from "@claudexor/orchestrator";
|
|
2
|
+
/** Break the composition-root callback cycle without weakening cancellation ownership. */
|
|
3
|
+
export function createDelegationDaemonBinding() {
|
|
4
|
+
let server = null;
|
|
5
|
+
return {
|
|
6
|
+
authority: new DelegationBudgetAuthority({
|
|
7
|
+
cancelAdmission: (jobId) => {
|
|
8
|
+
if (!server)
|
|
9
|
+
throw new Error("daemon cancellation authority is not initialized");
|
|
10
|
+
server.cancelJob(jobId);
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
|
+
bind(value) {
|
|
14
|
+
server = value;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=delegation-daemon-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-daemon-binding.js","sourceRoot":"","sources":["../src/delegation-daemon-binding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,0FAA0F;AAC1F,MAAM,UAAU,6BAA6B;IAI3C,IAAI,MAAM,GAA2C,IAAI,CAAC;IAC1D,OAAO;QACL,SAAS,EAAE,IAAI,yBAAyB,CAAC;YACvC,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;gBACzB,IAAI,CAAC,MAAM;oBAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;gBACjF,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC;SACF,CAAC;QACF,IAAI,CAAC,KAAK;YACR,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RunFailure } from "@claudexor/schema";
|
|
2
|
+
export interface DelegationReceipt {
|
|
3
|
+
requested?: boolean;
|
|
4
|
+
effective?: boolean;
|
|
5
|
+
used?: boolean;
|
|
6
|
+
reason?: string | null;
|
|
7
|
+
remediation?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function projectDelegation(detail: Record<string, unknown> | null): DelegationReceipt | null;
|
|
10
|
+
export declare function terminalDetailFields(detail: Record<string, unknown> | null): {
|
|
11
|
+
outcomeBanner?: string;
|
|
12
|
+
delegation?: DelegationReceipt;
|
|
13
|
+
applyEligibility?: Record<string, unknown>;
|
|
14
|
+
failure?: RunFailure;
|
|
15
|
+
};
|
|
16
|
+
export declare function terminalDelegationLines(receipt: DelegationReceipt | null): string[];
|
|
17
|
+
export declare function inspectDelegationLines(receipt: DelegationReceipt | null): string[];
|
|
18
|
+
//# sourceMappingURL=delegation-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-output.d.ts","sourceRoot":"","sources":["../src/delegation-output.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACrC,iBAAiB,GAAG,IAAI,CAE1B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,CAWA;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,EAAE,CAanF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,EAAE,CAclF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { projectApplyEligibility, projectOutcomeBanner, projectRunFailure, projectRunLineage, } from "./run-detail-projections.js";
|
|
2
|
+
export function projectDelegation(detail) {
|
|
3
|
+
return projectRunLineage(detail).delegation;
|
|
4
|
+
}
|
|
5
|
+
export function terminalDetailFields(detail) {
|
|
6
|
+
const outcomeBanner = projectOutcomeBanner(detail);
|
|
7
|
+
const delegation = projectDelegation(detail);
|
|
8
|
+
const applyEligibility = projectApplyEligibility(detail);
|
|
9
|
+
const failure = projectRunFailure(detail);
|
|
10
|
+
return {
|
|
11
|
+
...(outcomeBanner ? { outcomeBanner } : {}),
|
|
12
|
+
...(delegation ? { delegation } : {}),
|
|
13
|
+
...(applyEligibility ? { applyEligibility } : {}),
|
|
14
|
+
...(failure ? { failure } : {}),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function terminalDelegationLines(receipt) {
|
|
18
|
+
if (receipt?.requested !== true)
|
|
19
|
+
return [];
|
|
20
|
+
const partiallyDegraded = receipt.reason === "partially_degraded";
|
|
21
|
+
return [
|
|
22
|
+
` delegation: effective=${String(receipt.effective)} used=${String(receipt.used)} reason=${String(receipt.reason ?? "unknown")}`,
|
|
23
|
+
...(receipt.effective === true && !partiallyDegraded
|
|
24
|
+
? []
|
|
25
|
+
: [
|
|
26
|
+
partiallyDegraded
|
|
27
|
+
? " WARNING: one selected lane continued without Delegate; inspect its typed requirement receipt."
|
|
28
|
+
: " WARNING: continued without Delegate; inspect the run for the typed cause.",
|
|
29
|
+
]),
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
export function inspectDelegationLines(receipt) {
|
|
33
|
+
if (!receipt)
|
|
34
|
+
return [];
|
|
35
|
+
const lines = [
|
|
36
|
+
`delegation: requested=${String(receipt.requested)} effective=${String(receipt.effective)} used=${String(receipt.used)} reason=${String(receipt.reason ?? "unknown")}`,
|
|
37
|
+
];
|
|
38
|
+
if (receipt.requested && (!receipt.effective || receipt.reason === "partially_degraded")) {
|
|
39
|
+
lines.push(receipt.reason === "partially_degraded"
|
|
40
|
+
? "WARNING: Delegate was unavailable on one selected lane; that lane continued as ordinary Agent."
|
|
41
|
+
: `WARNING: Delegate was unavailable; this run continued as ordinary Agent (${receipt.reason ?? "unknown"}).`);
|
|
42
|
+
if (receipt.remediation)
|
|
43
|
+
lines.push(` next: ${receipt.remediation}`);
|
|
44
|
+
}
|
|
45
|
+
return lines;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=delegation-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-output.js","sourceRoot":"","sources":["../src/delegation-output.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AAWrC,MAAM,UAAU,iBAAiB,CAC/B,MAAsC;IAEtC,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,UAAsC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAsC;IAMzE,MAAM,aAAa,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAA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AC,MAAM,IAAI,SAAS,CAAC,EAAE;KACvK,CAAC;IACF,IAAI,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,oBAAoB,CAAC,EAAE,CAAC;QACzF,KAAK,CAAC,IAAI,CACR,OAAO,CAAC,MAAM,KAAK,oBAAoB;YACrC,CAAC,CAAC,gGAAgG;YAClG,CAAC,CAAC,4EAA4E,OAAO,CAAC,MAAM,IAAI,SAAS,IAAI,CAChH,CAAC;QACF,IAAI,OAAO,CAAC,WAAW;YAAE,KAAK,CAAC,IAAI,CAAC,WAAW,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ParsedArgs } from "./args.js";
|
|
2
|
+
/**
|
|
3
|
+
* `claudexor harness list [--all]` and `claudexor harness install <id>`.
|
|
4
|
+
* Fakes are test fixtures, not real harnesses; `--all` reveals them. The
|
|
5
|
+
* install verb is the disclosed pinned installer (harness-installer.ts,
|
|
6
|
+
* issue #89): exact npm pins for claude/codex/opencode, the human-verified
|
|
7
|
+
* PTY path for cursor, and nothing executes without disclosure. Flags are
|
|
8
|
+
* verb-owned (registry `subcommandFlags`): `harness list --yes` or
|
|
9
|
+
* `harness install --all` is a loud exit-2 usage error, never a silently
|
|
10
|
+
* ignored flag (INV-021).
|
|
11
|
+
*/
|
|
12
|
+
export declare function harnessCommand(args: ParsedArgs, json: boolean): number;
|
|
13
|
+
//# sourceMappingURL=harness-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-command.d.ts","sourceRoot":"","sources":["../src/harness-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAMtD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAkBtE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { flagBool } from "./args.js";
|
|
2
|
+
import { print, printJson, printUsageError } from "./cli-io.js";
|
|
3
|
+
import { subcommandFlagScopeError } from "./command-scope.js";
|
|
4
|
+
import { harnessInstallCommand } from "./harness-installer.js";
|
|
5
|
+
import { buildRegistry } from "./registry.js";
|
|
6
|
+
/**
|
|
7
|
+
* `claudexor harness list [--all]` and `claudexor harness install <id>`.
|
|
8
|
+
* Fakes are test fixtures, not real harnesses; `--all` reveals them. The
|
|
9
|
+
* install verb is the disclosed pinned installer (harness-installer.ts,
|
|
10
|
+
* issue #89): exact npm pins for claude/codex/opencode, the human-verified
|
|
11
|
+
* PTY path for cursor, and nothing executes without disclosure. Flags are
|
|
12
|
+
* verb-owned (registry `subcommandFlags`): `harness list --yes` or
|
|
13
|
+
* `harness install --all` is a loud exit-2 usage error, never a silently
|
|
14
|
+
* ignored flag (INV-021).
|
|
15
|
+
*/
|
|
16
|
+
export function harnessCommand(args, json) {
|
|
17
|
+
const sub = args._[1] ?? "";
|
|
18
|
+
const scopeError = subcommandFlagScopeError("harness", sub, Object.keys(args.flags));
|
|
19
|
+
if (scopeError)
|
|
20
|
+
return printUsageError(json, scopeError);
|
|
21
|
+
if (args._[1] === "list") {
|
|
22
|
+
const includeFakes = flagBool(args, "all");
|
|
23
|
+
const ids = [...buildRegistry({ includeFakes }).keys()];
|
|
24
|
+
if (json)
|
|
25
|
+
printJson({ harnesses: ids });
|
|
26
|
+
else
|
|
27
|
+
ids.forEach((id) => print(id));
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
if (args._[1] === "install") {
|
|
31
|
+
return harnessInstallCommand(args, json);
|
|
32
|
+
}
|
|
33
|
+
return printUsageError(json, "usage: claudexor harness list [--all] | install <claude|codex|cursor|opencode> [--dry-run] [--yes]");
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=harness-command.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AK,SAAS,EAAE,CAAC;QAC5B,OAAO,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,eAAe,CACpB,IAAI,EACJ,oGAAoG,CACrG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `claudexor harness install` — the disclosed, pinned remote vendor installer
|
|
3
|
+
* (issue #89; restored from the PR #82 cut with the security objections
|
|
4
|
+
* fixed).
|
|
5
|
+
*
|
|
6
|
+
* Contract:
|
|
7
|
+
* - npm-distributed harnesses (claude/codex/opencode) install ONE exact
|
|
8
|
+
* version — the per-package vendor-version SSOT — never `@latest`. npm
|
|
9
|
+
* verifies the registry integrity checksum for an exact version, so the
|
|
10
|
+
* pin is a real guarantee. For claude/codex that SSOT is the value the
|
|
11
|
+
* model/effort freshness gates verified; the opencode pin is a
|
|
12
|
+
* deterministic install target, NOT a verification claim (no recorded
|
|
13
|
+
* fixture yet — see packages/harness-opencode vendor-cli-version.ts).
|
|
14
|
+
* - cursor has no npm artifact and CANNOT be pinned. Instead of pretending,
|
|
15
|
+
* the HUMAN is the verifier: the complete vendor script is downloaded first
|
|
16
|
+
* (never piped to a shell), its size and sha256 are printed, and it runs in
|
|
17
|
+
* the visible PTY the operator is watching — the same principle as
|
|
18
|
+
* interactive SSH auth.
|
|
19
|
+
* - NOTHING executes without disclosure: the exact command and install
|
|
20
|
+
* destination print first, and execution needs a TTY confirmation or an
|
|
21
|
+
* explicit `--yes` (the macOS flow confirms against this module's own
|
|
22
|
+
* `--dry-run --json` disclosure before passing `--yes`).
|
|
23
|
+
* - failures are typed and loud; a failed download or non-zero installer exit
|
|
24
|
+
* never reads as success, and the temp download dir is removed on every
|
|
25
|
+
* path.
|
|
26
|
+
* - `--json` keeps stdout pure: exactly ONE JSON object. In json mode every
|
|
27
|
+
* human progress line goes to stderr and child processes (npm/curl/the
|
|
28
|
+
* vendor script) run with their stdout routed onto stderr, so vendor
|
|
29
|
+
* output stays visible without corrupting the machine envelope.
|
|
30
|
+
*/
|
|
31
|
+
import { spawnSync } from "node:child_process";
|
|
32
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
33
|
+
import { type ParsedArgs } from "./args.js";
|
|
34
|
+
export declare const INSTALLABLE_HARNESSES: readonly ["claude", "codex", "cursor", "opencode"];
|
|
35
|
+
export type InstallableHarness = (typeof INSTALLABLE_HARNESSES)[number];
|
|
36
|
+
export declare function isInstallableHarness(value: string): value is InstallableHarness;
|
|
37
|
+
/** Exact npm pins. Each version ALIASES the harness package's vendor-version
|
|
38
|
+
* SSOT (vendor-cli-version.ts there). For claude/codex that is the version
|
|
39
|
+
* this release's freshness gates verified; the opencode pin is a
|
|
40
|
+
* deterministic install target only — no recorded verification fixture
|
|
41
|
+
* vouches for it (its vendor-cli-version.ts discloses this). Cursor is
|
|
42
|
+
* absent deliberately: it ships no npm artifact (see the cursor branch
|
|
43
|
+
* below). */
|
|
44
|
+
export type HarnessInstallVerification = "release_verified" | "deterministic_only" | "human_observed";
|
|
45
|
+
export declare const CURSOR_INSTALL_URL = "https://cursor.com/install";
|
|
46
|
+
export interface HarnessInstallerDisclosure {
|
|
47
|
+
harness: InstallableHarness;
|
|
48
|
+
command: string;
|
|
49
|
+
installLocation: string;
|
|
50
|
+
/** Exact vendor version the command installs; null ONLY for cursor, which
|
|
51
|
+
* has no pinnable artifact (disclosed, never faked). */
|
|
52
|
+
pinnedVersion: string | null;
|
|
53
|
+
/** Evidence behind the install target. Package-registry integrity verifies
|
|
54
|
+
* downloaded bytes for every npm pin, but only release_verified means the
|
|
55
|
+
* exact vendor version was exercised by this release's freshness gates. */
|
|
56
|
+
verification: HarnessInstallVerification;
|
|
57
|
+
}
|
|
58
|
+
export declare function harnessInstallerDisclosure(harness: InstallableHarness): HarnessInstallerDisclosure;
|
|
59
|
+
export interface HarnessInstallRunResult {
|
|
60
|
+
exitCode: number;
|
|
61
|
+
/** Set when the installer refused loudly WITHOUT running the vendor
|
|
62
|
+
* payload (failed/unreadable download); never a silent partial install. */
|
|
63
|
+
refusal?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare function runHarnessInstaller(harness: InstallableHarness, options?: {
|
|
66
|
+
home?: string;
|
|
67
|
+
nodePath?: string;
|
|
68
|
+
spawn?: typeof spawnSync;
|
|
69
|
+
mkdir?: typeof mkdirSync;
|
|
70
|
+
exists?: typeof existsSync;
|
|
71
|
+
/** `--json` stdout purity: route human progress lines AND child stdout
|
|
72
|
+
* to stderr, so stdout carries exactly one JSON object (the caller's
|
|
73
|
+
* final envelope). Human mode keeps everything on stdout as before. */
|
|
74
|
+
json?: boolean;
|
|
75
|
+
}): HarnessInstallRunResult;
|
|
76
|
+
export declare function harnessInstallCommand(args: ParsedArgs, json: boolean,
|
|
77
|
+
/** Test seam: forwarded to `runHarnessInstaller` (spawn/home/... fakes). */
|
|
78
|
+
runnerOptions?: Omit<NonNullable<Parameters<typeof runHarnessInstaller>[1]>, "json">): number;
|
|
79
|
+
//# sourceMappingURL=harness-installer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-installer.d.ts","sourceRoot":"","sources":["../src/harness-installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAA+C,MAAM,SAAS,CAAC;AAQ7F,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGtD,eAAO,MAAM,qBAAqB,YAAI,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AACxF,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;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