@on-par/factory-cli 0.9.8-next.7 → 0.9.8-next.70
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/doctor-harness.d.ts +11 -0
- package/dist/cli/doctor-harness.d.ts.map +1 -1
- package/dist/cli/doctor-harness.js +43 -1
- package/dist/cli/doctor-harness.js.map +1 -1
- package/dist/cli/doctor-opencode-probe.d.ts +22 -0
- package/dist/cli/doctor-opencode-probe.d.ts.map +1 -0
- package/dist/cli/doctor-opencode-probe.js +110 -0
- package/dist/cli/doctor-opencode-probe.js.map +1 -0
- package/dist/cli/doctor.d.ts +30 -8
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +114 -44
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/first-run.d.ts +3 -1
- package/dist/cli/first-run.d.ts.map +1 -1
- package/dist/cli/first-run.js +5 -2
- package/dist/cli/first-run.js.map +1 -1
- package/dist/cli/github-stub.js +1 -1
- package/dist/cli/github-stub.js.map +1 -1
- package/dist/cli/harness-check.d.ts +27 -0
- package/dist/cli/harness-check.d.ts.map +1 -0
- package/dist/cli/harness-check.js +58 -0
- package/dist/cli/harness-check.js.map +1 -0
- package/dist/cli/help-groups.js +1 -1
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/index.d.ts +21 -18
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +62 -56
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/program-run-work.js +2 -2
- package/dist/cli/program-run-work.js.map +1 -1
- package/dist/cli/program-setup.d.ts.map +1 -1
- package/dist/cli/program-setup.js +10 -1
- package/dist/cli/program-setup.js.map +1 -1
- package/dist/cli/queue-add-json.d.ts +3 -1
- package/dist/cli/queue-add-json.d.ts.map +1 -1
- package/dist/cli/queue-add-json.js +1 -0
- package/dist/cli/queue-add-json.js.map +1 -1
- package/dist/cli/queue-output.d.ts +9 -0
- package/dist/cli/queue-output.d.ts.map +1 -0
- package/dist/cli/queue-output.js +38 -0
- package/dist/cli/queue-output.js.map +1 -0
- package/dist/cli/run-lane.d.ts +3 -0
- package/dist/cli/run-lane.d.ts.map +1 -1
- package/dist/cli/run-lane.js +6 -1
- package/dist/cli/run-lane.js.map +1 -1
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +13 -1
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/self-update-apply.d.ts +2 -0
- package/dist/cli/self-update-apply.d.ts.map +1 -1
- package/dist/cli/self-update-apply.js +49 -6
- package/dist/cli/self-update-apply.js.map +1 -1
- package/dist/cli/self-update.d.ts +4 -0
- package/dist/cli/self-update.d.ts.map +1 -1
- package/dist/cli/self-update.js +1 -1
- package/dist/cli/self-update.js.map +1 -1
- package/dist/cli/ship.d.ts.map +1 -1
- package/dist/cli/ship.js +17 -9
- package/dist/cli/ship.js.map +1 -1
- package/dist/cli/status.d.ts +5 -0
- package/dist/cli/status.d.ts.map +1 -1
- package/dist/cli/status.js +5 -4
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/stop-sentinel.d.ts +4 -0
- package/dist/cli/stop-sentinel.d.ts.map +1 -1
- package/dist/cli/stop-sentinel.js +11 -0
- package/dist/cli/stop-sentinel.js.map +1 -1
- package/dist/cli/supervise.d.ts +5 -0
- package/dist/cli/supervise.d.ts.map +1 -1
- package/dist/cli/supervise.js +1 -0
- package/dist/cli/supervise.js.map +1 -1
- package/dist/cli/triage-open-prs.d.ts +10 -0
- package/dist/cli/triage-open-prs.d.ts.map +1 -0
- package/dist/cli/triage-open-prs.js +38 -0
- package/dist/cli/triage-open-prs.js.map +1 -0
- package/dist/cli/update-state.d.ts +2 -0
- package/dist/cli/update-state.d.ts.map +1 -1
- package/dist/cli/update-state.js +14 -0
- package/dist/cli/update-state.js.map +1 -1
- package/dist/cli/worktree-reap.d.ts +31 -0
- package/dist/cli/worktree-reap.d.ts.map +1 -0
- package/dist/cli/worktree-reap.js +72 -0
- package/dist/cli/worktree-reap.js.map +1 -0
- package/package.json +3 -3
|
@@ -7,6 +7,8 @@ export interface HarnessSetup {
|
|
|
7
7
|
install: string;
|
|
8
8
|
/** Exact shell command that signs the harness in (#2556); also the row's `next` command. */
|
|
9
9
|
login: string;
|
|
10
|
+
/** Shell command for the sign-in row's `next` line when `login` is a prose hint (#2903); defaults to `login`. */
|
|
11
|
+
next?: string;
|
|
10
12
|
/** Env vars that count as sign-in evidence (#2556). */
|
|
11
13
|
envKeys: readonly string[];
|
|
12
14
|
/** Judges the first `--version` line for the installed row (#2880); harnesses without one just print it. */
|
|
@@ -16,6 +18,15 @@ export interface HarnessSetup {
|
|
|
16
18
|
export declare function openCodeVersionCheck(versionLine: string | undefined): Pick<DoctorCheck, 'ok' | 'detail' | 'fix'>;
|
|
17
19
|
/** One doctor section per built-in harness (#2555), in display order. */
|
|
18
20
|
export declare const HARNESS_SETUP: readonly HarnessSetup[];
|
|
21
|
+
/** Detail of a `<cli> installed` row when the CLI is not on PATH; doctor matches it exactly to skip the row (#2996). */
|
|
22
|
+
export declare function notInstalledDetail(cli: string): string;
|
|
23
|
+
/** #2996: rewrites a not-installed agent row (`<cli> installed` with the exact not-on-PATH detail)
|
|
24
|
+
* to ➖ skipped info; every other row is returned as is. Call only while an agent is signed in. */
|
|
25
|
+
export declare function skipMissingAgentCheck(c: DoctorCheck): DoctorCheck;
|
|
26
|
+
/** #3000: with no agent found, a not-installed agent row is a hard failure (keeps its install fix); other rows are returned as is. */
|
|
27
|
+
export declare function failMissingAgentCheck(c: DoctorCheck, noAgentFound: boolean): DoctorCheck;
|
|
19
28
|
/** One optional `<cli> installed` row per harness, with the CLI version when found and the install command when not (#2555). */
|
|
20
29
|
export declare function harnessInstallChecks(commandAvailable: (cmd: string) => boolean, tryExec: (cmd: string) => string | null): DoctorCheck[];
|
|
30
|
+
/** Agents whose `<cli> signed in` row is a hard pass (#2999), in HARNESS_SETUP order. */
|
|
31
|
+
export declare function readyAgents(checks: DoctorCheck[]): string[];
|
|
21
32
|
//# sourceMappingURL=doctor-harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-harness.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-harness.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor-harness.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-harness.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,KAAK,EAAE,MAAM,CAAC;IACd,iHAAiH;IACjH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,4GAA4G;IAC5G,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,CAAC;CAChG;AAED,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,CAyBhH;AAED,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,SAAS,YAAY,EAmChD,CAAC;AAEF,wHAAwH;AACxH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAID;mGACmG;AACnG,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW,CAWjE;AAED,sIAAsI;AACtI,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,GAAG,WAAW,CAKxF;AAED,gIAAgI;AAChI,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,EAC1C,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GACtC,WAAW,EAAE,CA0Bf;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAI3D"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/cli/doctor-harness.ts — per-harness setup table and `<cli> installed` rows for `factory doctor`.
|
|
2
2
|
import { openCodeVersion } from '@on-par/factory-core/internal';
|
|
3
|
+
import { PI_INSTALL } from './first-run.js';
|
|
3
4
|
/** Warns, without failing, when the installed OpenCode is outside the supported range (#2880). */
|
|
4
5
|
export function openCodeVersionCheck(versionLine) {
|
|
5
6
|
if (!versionLine) {
|
|
@@ -54,7 +55,44 @@ export const HARNESS_SETUP = [
|
|
|
54
55
|
envKeys: ['OPENCODE_API_KEY'],
|
|
55
56
|
checkVersion: openCodeVersionCheck,
|
|
56
57
|
},
|
|
58
|
+
{
|
|
59
|
+
section: 'Pi',
|
|
60
|
+
harnessId: 'pi',
|
|
61
|
+
cli: 'pi',
|
|
62
|
+
install: PI_INSTALL,
|
|
63
|
+
login: 'run `pi` then `/login <provider>`, or export the provider key',
|
|
64
|
+
next: 'pi',
|
|
65
|
+
envKeys: ['OPENROUTER_API_KEY', 'OPENCODE_API_KEY', 'AZURE_OPENAI_API_KEY'],
|
|
66
|
+
},
|
|
57
67
|
];
|
|
68
|
+
/** Detail of a `<cli> installed` row when the CLI is not on PATH; doctor matches it exactly to skip the row (#2996). */
|
|
69
|
+
export function notInstalledDetail(cli) {
|
|
70
|
+
return `${cli} not found on PATH, ${cli} routes unavailable`;
|
|
71
|
+
}
|
|
72
|
+
const INSTALL_ROW_CLI = new Map(HARNESS_SETUP.map(({ cli }) => [`${cli} installed`, cli]));
|
|
73
|
+
/** #2996: rewrites a not-installed agent row (`<cli> installed` with the exact not-on-PATH detail)
|
|
74
|
+
* to ➖ skipped info; every other row is returned as is. Call only while an agent is signed in. */
|
|
75
|
+
export function skipMissingAgentCheck(c) {
|
|
76
|
+
if (c.ok)
|
|
77
|
+
return c;
|
|
78
|
+
const cli = INSTALL_ROW_CLI.get(c.name);
|
|
79
|
+
if (cli === undefined || c.detail !== notInstalledDetail(cli))
|
|
80
|
+
return c;
|
|
81
|
+
const { fix: _fix, ...rest } = c;
|
|
82
|
+
return {
|
|
83
|
+
...rest,
|
|
84
|
+
ok: true,
|
|
85
|
+
optional: true,
|
|
86
|
+
detail: `skipped: ${cli} not installed; another agent is signed in, so runs can proceed`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** #3000: with no agent found, a not-installed agent row is a hard failure (keeps its install fix); other rows are returned as is. */
|
|
90
|
+
export function failMissingAgentCheck(c, noAgentFound) {
|
|
91
|
+
const cli = INSTALL_ROW_CLI.get(c.name);
|
|
92
|
+
return noAgentFound && !c.ok && cli !== undefined && c.detail === notInstalledDetail(cli)
|
|
93
|
+
? { ...c, optional: false }
|
|
94
|
+
: c;
|
|
95
|
+
}
|
|
58
96
|
/** One optional `<cli> installed` row per harness, with the CLI version when found and the install command when not (#2555). */
|
|
59
97
|
export function harnessInstallChecks(commandAvailable, tryExec) {
|
|
60
98
|
return HARNESS_SETUP.map(({ section, cli, install, checkVersion }) => {
|
|
@@ -65,7 +103,7 @@ export function harnessInstallChecks(commandAvailable, tryExec) {
|
|
|
65
103
|
section,
|
|
66
104
|
ok: false,
|
|
67
105
|
optional: true,
|
|
68
|
-
detail:
|
|
106
|
+
detail: notInstalledDetail(cli),
|
|
69
107
|
fix: `install ${section}: ${install}`,
|
|
70
108
|
};
|
|
71
109
|
}
|
|
@@ -83,4 +121,8 @@ export function harnessInstallChecks(commandAvailable, tryExec) {
|
|
|
83
121
|
};
|
|
84
122
|
});
|
|
85
123
|
}
|
|
124
|
+
/** Agents whose `<cli> signed in` row is a hard pass (#2999), in HARNESS_SETUP order. */
|
|
125
|
+
export function readyAgents(checks) {
|
|
126
|
+
return HARNESS_SETUP.filter(({ cli }) => checks.some((c) => c.name === `${cli} signed in` && c.ok && c.optional !== true)).map(({ cli }) => cli);
|
|
127
|
+
}
|
|
86
128
|
//# sourceMappingURL=doctor-harness.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-harness.js","sourceRoot":"","sources":["../../src/cli/doctor-harness.ts"],"names":[],"mappings":"AAAA,uGAAuG;AAEvG,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor-harness.js","sourceRoot":"","sources":["../../src/cli/doctor-harness.ts"],"names":[],"mappings":"AAAA,uGAAuG;AAEvG,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkB5C,kGAAkG;AAClG,MAAM,UAAU,oBAAoB,CAAC,WAA+B;IAClE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO;YACL,EAAE,EAAE,IAAI;YACR,MAAM,EAAE,6CAA6C,eAAe,CAAC,wBAAwB,GAAG;SACjG,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,eAAe,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,EAAE,EAAE,IAAI;YACR,MAAM,EAAE,mCAAmC,WAAW,eAAe,eAAe,CAAC,wBAAwB,GAAG;SACjH,CAAC;IACJ,CAAC;IACD,IAAI,eAAe,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;QACvD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,MAAM,EAAE,kBAAkB,WAAW,eAAe,e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YAAY,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,CACjF,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DoctorCheck, DoctorRuntime } from './doctor.js';
|
|
2
|
+
export declare const OPENCODE_LIVE_AUTH_CHECK = "opencode auth (live)";
|
|
3
|
+
export declare const OPENCODE_PROBE_TIMEOUT_MS = 60000;
|
|
4
|
+
/** One `opencode run` probe (#2892): not run, timed out, or ran with its captured output. */
|
|
5
|
+
export type OpencodeAuthProbeResult = {
|
|
6
|
+
kind: 'skipped';
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'timeout';
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'ran';
|
|
11
|
+
exitCode: number;
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function opencodeAuthProbeCommand(providerModel?: string): string;
|
|
16
|
+
/** Provider model of the repo's first OpenCode-harness pin (build, plan, checker, triage), if any. */
|
|
17
|
+
export declare function pinnedOpencodeProviderModel(models: ReturnType<DoctorRuntime['configLoaders']['loadModelsConfig']>, repo: ReturnType<DoctorRuntime['configLoaders']['loadRepoConfig']>): string | undefined;
|
|
18
|
+
/** Maps one `opencode run` probe to the `opencode auth (live)` row (#2892). */
|
|
19
|
+
export declare function opencodeLiveAuthCheck(result: OpencodeAuthProbeResult): DoctorCheck;
|
|
20
|
+
/** Runs the one `opencode run` probe; a thrown exec error keeps its stdout, status and timeout flag. */
|
|
21
|
+
export declare function runOpencodeAuthProbe(rt: DoctorRuntime, repoRoot: string | null): OpencodeAuthProbeResult;
|
|
22
|
+
//# sourceMappingURL=doctor-opencode-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-opencode-probe.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-opencode-probe.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9D,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD,6FAA6F;AAC7F,MAAM,MAAM,uBAAuB,GACjC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhH,wBAAgB,wBAAwB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAGvE;AAED,sGAAsG;AACtG,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,UAAU,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,kBAAkB,CAAC,CAAC,EACtE,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,CAAC,GACjE,MAAM,GAAG,SAAS,CAcpB;AAED,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,GAAG,WAAW,CAmDlF;AAED,wGAAwG;AACxG,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,uBAAuB,CA6BxG"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// packages/cli/src/cli/doctor-opencode-probe.ts — live OpenCode auth probe for `factory doctor --probe-inference` (#2892)
|
|
2
|
+
import { applyRepoConfig } from '@on-par/factory-core';
|
|
3
|
+
import { classifyFailure, classifyOpenCodeErrorType, parseOpenCodeJson, shellEscape, } from '@on-par/factory-core/internal';
|
|
4
|
+
export const OPENCODE_LIVE_AUTH_CHECK = 'opencode auth (live)';
|
|
5
|
+
export const OPENCODE_PROBE_TIMEOUT_MS = 60_000;
|
|
6
|
+
export function opencodeAuthProbeCommand(providerModel) {
|
|
7
|
+
const model = providerModel ? ` --model ${shellEscape(providerModel)}` : '';
|
|
8
|
+
return `opencode run --format json${model} "reply with exactly: ok"`;
|
|
9
|
+
}
|
|
10
|
+
/** Provider model of the repo's first OpenCode-harness pin (build, plan, checker, triage), if any. */
|
|
11
|
+
export function pinnedOpencodeProviderModel(models, repo) {
|
|
12
|
+
try {
|
|
13
|
+
const merged = applyRepoConfig(models, repo).models;
|
|
14
|
+
for (const field of ['build', 'plan', 'checker', 'triage']) {
|
|
15
|
+
const id = repo?.models?.pins?.[field];
|
|
16
|
+
const def = id ? merged[id] : undefined;
|
|
17
|
+
if (def?.harness === 'opencode' && typeof def.providerModel === 'string' && def.providerModel !== '') {
|
|
18
|
+
return def.providerModel;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// config problems are reported by the config checks
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
/** Maps one `opencode run` probe to the `opencode auth (live)` row (#2892). */
|
|
28
|
+
export function opencodeLiveAuthCheck(result) {
|
|
29
|
+
const name = OPENCODE_LIVE_AUTH_CHECK;
|
|
30
|
+
if (result.kind === 'skipped') {
|
|
31
|
+
return { name, ok: true, optional: true, detail: 'skipped: opencode CLI not on PATH' };
|
|
32
|
+
}
|
|
33
|
+
if (result.kind === 'timeout') {
|
|
34
|
+
return {
|
|
35
|
+
name,
|
|
36
|
+
ok: false,
|
|
37
|
+
detail: 'opencode run timed out after 60s',
|
|
38
|
+
fix: 'check your network and provider status, then re-run `factory doctor --probe-inference`',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const { exitCode, stdout, stderr } = result;
|
|
42
|
+
const parsed = parseOpenCodeJson(stdout);
|
|
43
|
+
if (parsed && parsed.text.trim() !== '' && parsed.errorText === '') {
|
|
44
|
+
return { name, ok: true, detail: 'opencode run succeeded' };
|
|
45
|
+
}
|
|
46
|
+
const errorText = parsed?.errorText ?? '';
|
|
47
|
+
const fallbackText = [stderr, errorText].filter(Boolean).join('\n');
|
|
48
|
+
const reason = classifyOpenCodeErrorType(parsed?.errorType) ??
|
|
49
|
+
(parsed?.errorStatus === 401 || parsed?.errorStatus === 403 || /\bstatus (401|403)\b/.test(errorText)
|
|
50
|
+
? 'local_auth'
|
|
51
|
+
: undefined) ??
|
|
52
|
+
(fallbackText !== '' ? classifyFailure(fallbackText, exitCode || 1) : undefined);
|
|
53
|
+
const firstError = errorText.split('\n')[0] || stderr.split('\n')[0] || `no text in opencode run output (exit ${exitCode})`;
|
|
54
|
+
if (reason === 'local_auth') {
|
|
55
|
+
return {
|
|
56
|
+
name,
|
|
57
|
+
ok: false,
|
|
58
|
+
detail: `opencode rejected the stored credential: ${firstError}`,
|
|
59
|
+
fix: 'opencode auth login',
|
|
60
|
+
next: 'opencode auth login',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (reason === 'usage_cap' || reason === 'rate_limit') {
|
|
64
|
+
return {
|
|
65
|
+
name,
|
|
66
|
+
ok: false,
|
|
67
|
+
optional: true,
|
|
68
|
+
detail: `opencode hit a ${reason === 'usage_cap' ? 'usage cap' : 'rate limit'} (the credential was accepted): ${firstError}`,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
name,
|
|
73
|
+
ok: false,
|
|
74
|
+
detail: `opencode run failed: ${firstError}`,
|
|
75
|
+
fix: 'run `opencode run "hi"` to see the error, or `opencode auth login`',
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** Runs the one `opencode run` probe; a thrown exec error keeps its stdout, status and timeout flag. */
|
|
79
|
+
export function runOpencodeAuthProbe(rt, repoRoot) {
|
|
80
|
+
if (!rt.coreOps.isCommandAvailable('opencode'))
|
|
81
|
+
return { kind: 'skipped' };
|
|
82
|
+
let providerModel;
|
|
83
|
+
if (repoRoot !== null) {
|
|
84
|
+
try {
|
|
85
|
+
providerModel = pinnedOpencodeProviderModel(rt.configLoaders.loadModelsConfig(), rt.configLoaders.loadRepoConfig(repoRoot));
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
// config problems are reported elsewhere
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const stdout = rt.shellOps.execSync(opencodeAuthProbeCommand(providerModel), {
|
|
93
|
+
timeout: OPENCODE_PROBE_TIMEOUT_MS,
|
|
94
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
95
|
+
});
|
|
96
|
+
return { kind: 'ran', exitCode: 0, stdout, stderr: '' };
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
const e = err;
|
|
100
|
+
if (e.code === 'ETIMEDOUT')
|
|
101
|
+
return { kind: 'timeout' };
|
|
102
|
+
return {
|
|
103
|
+
kind: 'ran',
|
|
104
|
+
exitCode: typeof e.status === 'number' ? e.status : 1,
|
|
105
|
+
stdout: String(e.stdout ?? ''),
|
|
106
|
+
stderr: String(e.stderr ?? ''),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=doctor-opencode-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-opencode-probe.js","sourceRoot":"","sources":["../../src/cli/doctor-opencode-probe.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAE1H,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,WAAW,GACZ,MAAM,+BAA+B,CAAC;AAIvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAMhD,MAAM,UAAU,wBAAwB,C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,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAC1D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,GAAG,GAA+E,CAAC;QAC1F,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW;YAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACvD,OAAO;YACL,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACrD,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC;YAC9B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC;SAC/B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/cli/doctor.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { Octokit } from '@octokit/rest';
|
|
|
2
2
|
import type { FactoryConfig, LeaseHealth } from '@on-par/factory-core';
|
|
3
3
|
import type { WorktreeSandbox } from '@on-par/factory-core/internal';
|
|
4
4
|
import { type GreenPrScanResult, type LeaseHealthRow } from './doctor-health.js';
|
|
5
|
-
import { HARNESS_SETUP, harnessInstallChecks } from './doctor-harness.js';
|
|
6
|
-
export { HARNESS_SETUP, harnessInstallChecks };
|
|
5
|
+
import { HARNESS_SETUP, harnessInstallChecks, readyAgents } from './doctor-harness.js';
|
|
6
|
+
export { HARNESS_SETUP, harnessInstallChecks, readyAgents };
|
|
7
7
|
import type { CliDeps } from './index.js';
|
|
8
8
|
export interface DoctorCheck {
|
|
9
9
|
name: string;
|
|
@@ -51,8 +51,8 @@ export interface DoctorEnvProbes {
|
|
|
51
51
|
/** Stored Claude Code OAuth session state (#2721), read locally; never refreshes. */
|
|
52
52
|
claudeSessionState?: () => 'ok' | 'refresh-pending' | 'unusable' | 'unknown';
|
|
53
53
|
/** The agent's last recorded run-time local_auth failure when no login has happened since
|
|
54
|
-
* (#2733); reads local state only, never refreshes. */
|
|
55
|
-
localAuthFailure?: (agent: 'claude' | 'codex') => {
|
|
54
|
+
* (#2733, #2890); reads local state only, never refreshes. */
|
|
55
|
+
localAuthFailure?: (agent: 'claude' | 'codex' | 'opencode') => {
|
|
56
56
|
agent: string;
|
|
57
57
|
at: string;
|
|
58
58
|
} | null;
|
|
@@ -91,10 +91,29 @@ export declare const GIT_AUTH_PROBE_ENV: Readonly<Record<string, string>>;
|
|
|
91
91
|
export declare const GIT_AUTH_PROBE_TIMEOUT_MS = 15000;
|
|
92
92
|
/** Remedy shown only when the git-auth probe fails: wires git's credential helper to gh. */
|
|
93
93
|
export declare const GIT_AUTH_FIX = "run `gh auth setup-git` so git uses your gh credentials, then re-run `factory doctor`";
|
|
94
|
+
/** Classifies an origin URL's transport (#2939). Returns null when it is not SSH (ssh://,
|
|
95
|
+
* git+ssh://, ssh+git:// or scp-style `[user@]host:path`), else the bare hostname, or null
|
|
96
|
+
* when the host is not a safe hostname. Never returns the user, port or path. */
|
|
97
|
+
export declare function sshOriginHost(origin: string): {
|
|
98
|
+
host: string | null;
|
|
99
|
+
} | null;
|
|
100
|
+
/** Remedy for a failing SSH origin (#2939); `<host>` stands in when the host is unknown. */
|
|
101
|
+
export declare function gitAuthSshFix(host: string | null): string;
|
|
102
|
+
type TryExec = (cmd: string, opts?: DoctorExecOptions) => string | null;
|
|
103
|
+
/** Identity files `ssh -G <host>` offers, `~` expanded; null when ssh could not run (#2940). The host is shell-safe. */
|
|
104
|
+
export declare function sshIdentityFiles(host: string, tryExec: TryExec, home?: string): string[] | null;
|
|
105
|
+
/** Host alias mismatch (#2940): no existing key for the origin host, but its GitHub sibling has one. */
|
|
106
|
+
export declare function sshHostAliasMismatch(host: string, tryExec: TryExec, fileExists: (p: string) => boolean, home?: string): {
|
|
107
|
+
originHost: string;
|
|
108
|
+
siblingHost: string;
|
|
109
|
+
} | null;
|
|
110
|
+
export declare function gitAuthSshAliasFix(originHost: string, siblingHost: string): string;
|
|
94
111
|
/** Git-auth check (#2482, #2483): skipped, never failing, outside a git repository or without
|
|
95
112
|
* an origin remote. Otherwise runs a non-interactive `git ls-remote` against origin and fails
|
|
96
|
-
* when it cannot authenticate.
|
|
97
|
-
|
|
113
|
+
* when it cannot authenticate. SSH origins get SSH guidance instead of `gh auth setup-git`
|
|
114
|
+
* (#2939), and a Host alias mismatch is named when detected (#2940). The output never echoes the
|
|
115
|
+
* origin URL, which may hold a token; only a bare SSH hostname may appear. */
|
|
116
|
+
export declare function gitAuthCheck(repoRoot: string | null, tryExec: TryExec, fileExists?: (path: string) => boolean): DoctorCheck;
|
|
98
117
|
/** One `<cli> signed in` row per installed harness CLI (#2556, #2631), judged only from local evidence: an env key,
|
|
99
118
|
* stored credentials, or `codex login status`. Never runs inference and never prints a secret. */
|
|
100
119
|
export declare function harnessSignInChecks(probes: DoctorEnvProbes): DoctorCheck[];
|
|
@@ -112,6 +131,7 @@ export declare function repoCommandHarnesses(harnesses: Readonly<Record<string,
|
|
|
112
131
|
export declare function commandHarnessChecks(harnesses: readonly ConfiguredCommandHarness[], commandAvailable: (cmd: string) => boolean): DoctorCheck[];
|
|
113
132
|
/** Coding agent prerequisites: at least one agent CLI is required; each CLI is then reported
|
|
114
133
|
* on its own optional line, with sign-in reported separately from installation (#1269, #2422, #2555, #2556).
|
|
134
|
+
* The codex sandbox note is folded into the ok `codex installed` row, so each agent has one row (#2997).
|
|
115
135
|
* A repo-configured command harness whose executable is on PATH also counts as a coding agent (#2691). */
|
|
116
136
|
export declare function agentCliChecks(probes: DoctorEnvProbes): DoctorCheck[];
|
|
117
137
|
export declare function runDoctorChecks(probes: DoctorEnvProbes): DoctorCheck[];
|
|
@@ -139,6 +159,8 @@ export type KeychainProbeStatus = {
|
|
|
139
159
|
inTmux: boolean;
|
|
140
160
|
} & KeychainProbeProfile);
|
|
141
161
|
export declare function claudeKeychainCheck(probe: KeychainProbeStatus): DoctorCheck;
|
|
162
|
+
/** The keychain row(s) for doctor: none off macOS, where the login keychain does not apply (#2998). */
|
|
163
|
+
export declare function claudeKeychainChecks(platform: NodeJS.Platform, probe: () => KeychainProbeStatus): DoctorCheck[];
|
|
142
164
|
/** Non-null when `factory run` must fail fast instead of claiming issues (#1014).
|
|
143
165
|
* Only the tmux-without-keychain differential is certain enough to abort a run on. */
|
|
144
166
|
export declare function keychainPreflightError(probe: KeychainProbeStatus): string | null;
|
|
@@ -155,8 +177,8 @@ export interface ClaudeAuthProbeResult {
|
|
|
155
177
|
* combination that proves the sandbox, not the credentials, is at fault. */
|
|
156
178
|
export declare function sandboxClaudeAuthChecks(result: ClaudeAuthProbeResult): DoctorCheck[];
|
|
157
179
|
/** #2496: doctor fails on agent sign-in only when no installed agent is signed in. A logged-out
|
|
158
|
-
* agent is a warning while another one is signed in, and a hard failure when none is. Skipped
|
|
159
|
-
*
|
|
180
|
+
* agent is a warning while another one is signed in, and a hard failure when none is. Skipped probes
|
|
181
|
+
* never count as signed in. #2996: not-installed agents become ➖ skipped info while one is signed in. */
|
|
160
182
|
export declare function reconcileAgentAuthChecks(checks: DoctorCheck[]): DoctorCheck[];
|
|
161
183
|
/** index.ts's seams and helpers for `factory doctor`, built at call time so main() deps injection reaches the handler. */
|
|
162
184
|
export interface DoctorRuntime {
|
package/dist/cli/doctor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAmC,aAAa,EAAE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