@on-par/factory-cli 0.9.38-next.6 → 0.9.38-next.61
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-github-credentials.d.ts +4 -0
- package/dist/cli/doctor-github-credentials.d.ts.map +1 -0
- package/dist/cli/doctor-github-credentials.js +29 -0
- package/dist/cli/doctor-github-credentials.js.map +1 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +2 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/feedback.js +1 -1
- package/dist/cli/feedback.js.map +1 -1
- package/dist/cli/github-scope.d.ts +29 -0
- package/dist/cli/github-scope.d.ts.map +1 -0
- package/dist/cli/github-scope.js +75 -0
- package/dist/cli/github-scope.js.map +1 -0
- package/dist/cli/index.d.ts +2 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +7 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/land.d.ts.map +1 -1
- package/dist/cli/land.js +2 -0
- package/dist/cli/land.js.map +1 -1
- package/dist/cli/program-advanced.d.ts.map +1 -1
- package/dist/cli/program-advanced.js +2 -1
- package/dist/cli/program-advanced.js.map +1 -1
- package/dist/cli/ship-github-scope.d.ts +21 -0
- package/dist/cli/ship-github-scope.d.ts.map +1 -0
- package/dist/cli/ship-github-scope.js +32 -0
- package/dist/cli/ship-github-scope.js.map +1 -0
- package/dist/cli/ship-options.js +1 -1
- package/dist/cli/ship-options.js.map +1 -1
- package/dist/cli/ship-runtime.d.ts +2 -2
- package/dist/cli/ship-runtime.d.ts.map +1 -1
- package/dist/cli/ship.js +10 -6
- package/dist/cli/ship.js.map +1 -1
- package/dist/cli/state-backup-gc.d.ts +17 -0
- package/dist/cli/state-backup-gc.d.ts.map +1 -0
- package/dist/cli/state-backup-gc.js +27 -0
- package/dist/cli/state-backup-gc.js.map +1 -0
- package/package.json +4 -4
package/dist/cli/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { promisify, styleText } from 'node:util';
|
|
|
9
9
|
import { LaneEnvironmentPauseError } from './lane-environment-pause-error.js';
|
|
10
10
|
import { INVALID_BRANCH_PREFIX_MESSAGE, resolveBranchPrefixOption } from './branch-prefix.js';
|
|
11
11
|
import { startupSweeps, warnQueueDiagnostics } from './queue-startup.js';
|
|
12
|
+
import { appendAutoPrune, stateBackupGcReport } from './state-backup-gc.js';
|
|
12
13
|
import { proposeTriageQueue } from './triage-open-prs.js';
|
|
13
14
|
import { makeQueuePreflightOps, preflightQueuedIssue, } from './queue-preflight.js';
|
|
14
15
|
import { acquirePortLease, aggregateCosts, appendKpiHistoryLine, applyRepoConfig, buildPhase, checkPhase, clearProxyState, computeHealthKpis, ConstitutionLoader, createDefaultWorkSourceRegistry, createLogger, createLaneProxy, defaultFindPortListeners, describeEffectiveConfig, detectPostMergeDefects, diagnoseModels, probeDeclaredHarnesses, estimateTrailingSpend, fetchDefectSources, fetchSubscriptionUsage, formatUsageReport, getConstitutionsDir, getFactoryPaths, GITHUB_ISSUE_SOURCE, hasUnresolvedPark, InvalidWorkRequestInputError, isCommandAvailable, isProxyRunning, kpiBranchPrefixes, kpisToHistoryRecord, laneBaseUrl, laneEnv, laneHostLabel, loadFactoryConfigForRepo, loadModelsConfig, loadRepoConfig, loadRoutesConfig, joinClassifierOutcomes, mergeClassifierOutcomes, parseClassifierOutcomes, summarizeClassifierOutcomes, formatClassifierReport, mergedPrRefs, ModelRegistry, ModelRouter, parkReasonFor, parseKpiHistory, parseQueue, planPhase, readEvents, readPortLeases, readQueue, readUsage, reapOrphanProcesses, reconstructKpiEvents, recordLeasePgid, releasePortLease, renderKpiReport, renderKpiTrend, resolveDefectWindowDays, parseSizeGateMode, parseMaxSlices, SIZE_GATE_MODES, resolveEffectiveModelPins, resolveEnvironmentProxy, resolveMergePolicy, resolveSkipCI, resolveTimeouts, resolveUsageCap, resolveWatchdogPolicy, runAutoIngest, shipPhase, formatCostTotal, validateQueue, watchUsage, writeLocalRunReport, isNumericWorkKey, issueNumberOf, workKeyFromIssue, writeProxyState, } from '@on-par/factory-core';
|
|
@@ -68,7 +69,7 @@ import { applyRouterGuards, newRepoRouter } from './repo-router.js';
|
|
|
68
69
|
import { cmdLogs } from './logs.js';
|
|
69
70
|
import { mergeScopeNotice } from './merge-scope.js';
|
|
70
71
|
import { selectOctokit } from './github-stub.js';
|
|
71
|
-
import { createFactoryOctokit } from './
|
|
72
|
+
import { createFactoryOctokit, createLocalOctokit } from './github-scope.js';
|
|
72
73
|
import { runDraftCommand } from './draft-command.js';
|
|
73
74
|
import { checkErrorExit, checkReportExit, createDeepModelRunner, runIssueCheck } from './ready-check.js';
|
|
74
75
|
import { cmdRunBrief as cmdRunBriefWith } from './run-brief.js';
|
|
@@ -332,7 +333,7 @@ function getOctokit(shell = shellOps, options) {
|
|
|
332
333
|
if (octokitFactory)
|
|
333
334
|
return octokitFactory();
|
|
334
335
|
const resolveToken = () => resolveGitHubToken(shell);
|
|
335
|
-
return selectOctokit(process.env, () =>
|
|
336
|
+
return selectOctokit(process.env, () => createLocalOctokit(shell, resolveToken, process.env, options));
|
|
336
337
|
}
|
|
337
338
|
export function errorDetail(err) {
|
|
338
339
|
const e = err;
|
|
@@ -349,7 +350,7 @@ setLandRuntime(() => ({
|
|
|
349
350
|
gitOps,
|
|
350
351
|
internalOps,
|
|
351
352
|
shellOps,
|
|
352
|
-
getOctokit: () => getOctokit(),
|
|
353
|
+
getOctokit: () => getOctokit(shellOps, { phase: 'land' }),
|
|
353
354
|
errorDetail,
|
|
354
355
|
worktreePathFor,
|
|
355
356
|
LaneParkError,
|
|
@@ -1562,7 +1563,7 @@ async function runAutoWorktreeGc(repoRoot, paths, ghRepo, eventScope) {
|
|
|
1562
1563
|
branchPrefix: resolveBranchPrefix(factoryConfig),
|
|
1563
1564
|
}, { log: gcLog, octokit: getOctokit(), sandbox: gcSandbox })));
|
|
1564
1565
|
logEvent(paths.events, 'worktree-gc', eventScope, `removed ${report.removed.length} stale worktree(s), kept ${report.kept}`);
|
|
1565
|
-
console.log(internalOps.formatGcReport(report));
|
|
1566
|
+
console.log(appendAutoPrune(internalOps.formatGcReport(report), paths, factoryConfig, eventScope));
|
|
1566
1567
|
}
|
|
1567
1568
|
catch (err) {
|
|
1568
1569
|
logEvent(paths.events, 'warn', eventScope, `worktree gc failed: ${err.message}`);
|
|
@@ -1937,7 +1938,7 @@ export async function cmdWorktreeGc(opts) {
|
|
|
1937
1938
|
const sandbox = gcWorktreeSandbox(factoryConfig.sandbox, repoRoot);
|
|
1938
1939
|
const run = () => internalOps.sweepWorktrees({ repoRoot, ttlDays, dryRun: opts.dryRun, repo: ghRepo, branchPrefix }, { log, octokit, sandbox });
|
|
1939
1940
|
const report = opts.dryRun ? await run() : await withGitLock(repoRoot, () => withFileLock(paths.gitLock, run));
|
|
1940
|
-
console.log(internalOps.formatGcReport(report));
|
|
1941
|
+
console.log(`${internalOps.formatGcReport(report)}\n${stateBackupGcReport(paths.root, factoryConfig, opts)}`);
|
|
1941
1942
|
}
|
|
1942
1943
|
/** `factory worktree keep <issue>` (#3318): protect the lane worktree from GC while finishing by hand. */
|
|
1943
1944
|
export async function cmdWorktreeKeep(issueArg, opts) {
|
|
@@ -2010,7 +2011,7 @@ export async function cmdLand(issueNum, opts = {}, deps = {}) {
|
|
|
2010
2011
|
const ghRepo = await getGitHubRepo();
|
|
2011
2012
|
const paths = getFactoryPaths(repoRoot);
|
|
2012
2013
|
const branchPrefix = branchPrefixOrExit(opts.branchPrefix, paths.config);
|
|
2013
|
-
const octokit = getOctokit();
|
|
2014
|
+
const octokit = getOctokit(shellOps, { phase: 'land', repo: ghRepo });
|
|
2014
2015
|
const factoryConfig = configLoaders.loadFactoryConfigForRepo(paths.config);
|
|
2015
2016
|
const skipCI = configLoaders.resolveSkipCI(factoryConfig);
|
|
2016
2017
|
try {
|