@outerlayer/cli 0.12.0 → 0.14.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/CHANGELOG.md +25 -0
- package/README.md +9 -4
- package/dist/agent-setup-CN2HUBEJ.js +26 -0
- package/dist/{build-LELVCWHV.js → build-BG2YENGK.js} +2 -2
- package/dist/build-info.json +1 -1
- package/dist/{builder-OF67QKDS.js → builder-2D3WSOOY.js} +4 -4
- package/dist/{check-RJOJU2WA.js → check-SRGR36KI.js} +37 -37
- package/dist/{chunk-XR3BJN33.js → chunk-22RMZBGW.js} +20 -1
- package/dist/{chunk-AHZQBGD2.js → chunk-2M63GG56.js} +1 -1
- package/dist/{chunk-SZOVKFWB.js → chunk-3NLOVYJQ.js} +4 -4
- package/dist/{chunk-USO2DKBD.js → chunk-4KSQKQXE.js} +8 -2
- package/dist/{chunk-QEESCZ26.js → chunk-4NPZVMJU.js} +2 -2
- package/dist/{chunk-DVT73QJO.js → chunk-4OGPT6I2.js} +14 -14
- package/dist/{chunk-ZQUCTFXC.js → chunk-FOJGZYFC.js} +11 -5
- package/dist/{chunk-G5XY6CVG.js → chunk-HFKKFTXU.js} +12 -16
- package/dist/{chunk-ANW7VHMH.js → chunk-HFKQIZXL.js} +95 -16
- package/dist/{chunk-325272HM.js → chunk-J5M7BSJQ.js} +11 -4
- package/dist/{chunk-NPXQXYVA.js → chunk-JJEGKEFV.js} +6 -8
- package/dist/{chunk-3ZPYPFNM.js → chunk-JXYVA45C.js} +1 -1
- package/dist/{chunk-IBB4D4KE.js → chunk-JYIEHQIF.js} +1 -1
- package/dist/{chunk-5TGQHOUX.js → chunk-KFRM23WD.js} +3 -3
- package/dist/{chunk-GGMRZPEA.js → chunk-KMDLFI4P.js} +1 -1
- package/dist/{chunk-G5IEVZGI.js → chunk-LCEXHCHD.js} +1 -1
- package/dist/{chunk-27Y7AX2O.js → chunk-MSASO5O4.js} +44 -8
- package/dist/chunk-MTF3PHVZ.js +161 -0
- package/dist/{chunk-G4RXNF2L.js → chunk-NHDVD7DU.js} +12 -12
- package/dist/{chunk-GATMPAMK.js → chunk-NPQWKGUA.js} +2 -2
- package/dist/{chunk-YEQL54G5.js → chunk-PQUM37BK.js} +1 -1
- package/dist/{chunk-GEBQXUFY.js → chunk-Q2UK3C4P.js} +24 -10
- package/dist/{chunk-SKHN72JO.js → chunk-RBKIH5ST.js} +13 -13
- package/dist/{chunk-2KLBKHT4.js → chunk-RLYZLUQ7.js} +1 -1
- package/dist/chunk-RMWLBUCJ.js +50 -0
- package/dist/{chunk-PDRYXERC.js → chunk-SMHOCDCI.js} +5 -5
- package/dist/{chunk-6FH2AHJY.js → chunk-SWHQ4LUM.js} +30 -17
- package/dist/{agent-setup-52LRZ6AY.js → chunk-SXWS25JC.js} +8 -21
- package/dist/{chunk-VK25O2ZM.js → chunk-T5VPP6H7.js} +1 -1
- package/dist/{chunk-JOXYKGUV.js → chunk-WUYTWNMA.js} +4 -2
- package/dist/{chunk-A56PYPDF.js → chunk-XCK2YAY5.js} +14 -4
- package/dist/{chunk-C7N4TDHW.js → chunk-YDSMROTB.js} +5 -5
- package/dist/{chunk-FO7KKPYG.js → chunk-ZA5CHAFY.js} +2 -2
- package/dist/{cli-JSSRGA6V.js → cli-UW2H3UUW.js} +138 -85
- package/dist/{command-3WYZ2ML5.js → command-5LD7G2QQ.js} +27 -27
- package/dist/{config-MKBX2ZQD.js → config-N3C6DFQA.js} +1 -1
- package/dist/{connect-cmd-A5NGODCJ.js → connect-cmd-JUAW6MU4.js} +5 -5
- package/dist/{context-adopt-BAHGXJZV.js → context-adopt-PJUMW2EZ.js} +6 -6
- package/dist/{context-materialize-45OVRRK2.js → context-materialize-FDHYKNDT.js} +6 -6
- package/dist/{dist-EQDW7MZW.js → dist-LKDWQWZ7.js} +2 -2
- package/dist/{docker-VGWEJWI7.js → docker-4J77Q2BF.js} +5 -5
- package/dist/{doctor-4FFXTQJ2.js → doctor-H7REBSLQ.js} +29 -29
- package/dist/{emit-artifact-cmd-QS7XNKBT.js → emit-artifact-cmd-FOGNJXVR.js} +18 -21
- package/dist/emit-cmd-ZEYWLC2C.js +11 -0
- package/dist/{emit-criteria-cmd-XN6AKA53.js → emit-criteria-cmd-HBP6XS5C.js} +8 -11
- package/dist/{emit-finding-cmd-SQJSEHYS.js → emit-finding-cmd-DLI4MKMN.js} +8 -11
- package/dist/{emit-result-cmd-56RHPHOA.js → emit-result-cmd-MUSL7GQA.js} +12 -15
- package/dist/{hook-fast-HLESEJAL.js → hook-fast-WYQD6D7T.js} +1 -1
- package/dist/{import-capture-cmd-NHMAFDM6.js → import-capture-cmd-6QVCOIHK.js} +10 -13
- package/dist/{import-ruler-cmd-UYB32YUT.js → import-ruler-cmd-KLRGRBCP.js} +7 -10
- package/dist/index.js +3 -3
- package/dist/{init-UZKD4RY7.js → init-NTXA3SN7.js} +28 -28
- package/dist/{init-6AY5T3P6.js → init-UBXK6MF7.js} +47 -37
- package/dist/{init-cmd-XGSX2BCC.js → init-cmd-NARDUPIG.js} +20 -13
- package/dist/init-update-O5YYFGF4.js +165 -0
- package/dist/{install-VXXI7UR6.js → install-HDBIPHTX.js} +2 -2
- package/dist/{login-browser-7XGSV7MA.js → login-browser-QZCS3WW6.js} +2 -1
- package/dist/{loop-4NMI2USY.js → loop-SW2M5VDD.js} +37 -37
- package/dist/{machine-4JX2D4TS.js → machine-U66FKVDP.js} +23 -23
- package/dist/mcp-install-cmd-FDTPQQS6.js +9 -0
- package/dist/{runner-env-WAXTJXZK.js → runner-env-XTC53CHN.js} +3 -3
- package/dist/runner-key-3JSMDRJA.js +154 -0
- package/dist/{session-sender-T7PN4YRC.js → session-sender-4M247XSV.js} +7 -7
- package/dist/starter-pack-IB4UUIX3.js +11 -0
- package/dist/{status-OXBIRWJ7.js → status-STZYPU3W.js} +30 -30
- package/dist/{sync-cmd-EVXNR47N.js → sync-cmd-UWD5JOFU.js} +6 -6
- package/dist/{watch-7NSFOAL5.js → watch-DBNB7R6X.js} +6 -6
- package/dist/{work-claim-cmd-KR7UR2AB.js → work-claim-cmd-LY4U6QHN.js} +13 -13
- package/dist/{work-cmd-JPM37MLF.js → work-cmd-RVRQ32EH.js} +7 -7
- package/dist/{work-comment-cmd-3DC6BC34.js → work-comment-cmd-FFUM4TJU.js} +10 -13
- package/dist/{work-open-pr-cmd-XZQRJBNZ.js → work-open-pr-cmd-HLDWP4T2.js} +10 -13
- package/dist/{work-pr-cmd-WHGZOP22.js → work-pr-cmd-L77K32WK.js} +7 -7
- package/package.json +1 -1
- package/skill-pack/maintained/emitting-evidence/SKILL.md +8 -2
- package/skill-pack/shipped.json +70 -0
- package/skill-pack/template/build/SKILL.md +66 -35
- package/skill-pack/template/build/references/agent-briefs.md +4 -2
- package/skill-pack/template/build/references/release.md +36 -8
- package/skill-pack/template/build/references/review-loop.md +6 -2
- package/skill-pack/template/build/scripts/record-criteria.mjs +109 -143
- package/skill-pack/template/spec/SKILL.md +33 -22
- package/skill-pack/template/writing-specs/SKILL.md +36 -3
- package/skill-pack/template/writing-specs/references/agents-snippet.md +57 -0
- package/skill-pack/template/writing-tests/SKILL.md +117 -0
- package/skill-pack/validators/acceptance-criteria.yaml +35 -0
- package/skill-pack/validators/code-review.yaml +4 -2
- package/dist/chunk-T6OIJQRT.js +0 -31
- package/dist/emit-cmd-LXEIDKLT.js +0 -10
- package/dist/mcp-install-cmd-XZARXNYT.js +0 -9
- package/dist/starter-pack-Z22VRFPF.js +0 -11
- package/dist/{chunk-3FMPZPJQ.js → chunk-R7PF5OOU.js} +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LEASE_SECONDS, releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, execCommandLine, startSender, startHostServices, finishJob, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, ALREADY_RELEASED } from './chunk-
|
|
3
|
+
import { LEASE_SECONDS, releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, execCommandLine, startSender, startHostServices, finishJob, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, ALREADY_RELEASED } from './chunk-4OGPT6I2.js';
|
|
4
4
|
import { writePendingUpdate } from './chunk-O765JR4W.js';
|
|
5
5
|
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-UGP76IZ5.js';
|
|
6
6
|
import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
|
|
7
|
-
import { writeJobFile, readJobFile, readJobFileChecked } from './chunk-T6OIJQRT.js';
|
|
8
|
-
import { compareVersions, satisfiesRange } from './chunk-I2UOAV7X.js';
|
|
9
7
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-YETTWTAY.js';
|
|
8
|
+
import { writeJobFile, readJobFile, readJobFileChecked } from './chunk-RMWLBUCJ.js';
|
|
9
|
+
import { compareVersions, satisfiesRange } from './chunk-I2UOAV7X.js';
|
|
10
10
|
import { RUNNER_PROTOCOL } from './chunk-FI5UYJMQ.js';
|
|
11
|
-
import { placeholderQueues, placeholderProblem } from './chunk-
|
|
11
|
+
import { placeholderQueues, placeholderProblem } from './chunk-SMHOCDCI.js';
|
|
12
12
|
import { freeBytes, formatBytes } from './chunk-YYYRBYWG.js';
|
|
13
13
|
import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, cleanVersions, isInLayout, stagingDir } from './chunk-TI7B7UEO.js';
|
|
14
14
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
15
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, provisionContainer, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandLine, BuildTokens, classifyRefusal, refusalCode, measureDisk, createRunnerLog, setUpRunnerCgroup, parseCpuList, ensureTunnel, keepGhConfigCurrent, createContainerRuntime, formatClock } from './chunk-
|
|
16
|
-
import {
|
|
15
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, provisionContainer, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandLine, BuildTokens, classifyRefusal, refusalCode, measureDisk, createRunnerLog, setUpRunnerCgroup, parseCpuList, ensureTunnel, keepGhConfigCurrent, createContainerRuntime, formatClock } from './chunk-RBKIH5ST.js';
|
|
16
|
+
import { spawnRun } from './chunk-KMDLFI4P.js';
|
|
17
|
+
import { checkFit } from './chunk-RLYZLUQ7.js';
|
|
18
|
+
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-SWHQ4LUM.js';
|
|
19
|
+
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-22RMZBGW.js';
|
|
17
20
|
import { startTimeOf, claimPidFile, readPidFile, isSameProcess, releasePidFile } from './chunk-N5FOE5PS.js';
|
|
18
|
-
import {
|
|
19
|
-
import { builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, BUILD_LABEL, RUNNER_LABEL } from './chunk-QEESCZ26.js';
|
|
20
|
-
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-6FH2AHJY.js';
|
|
21
|
-
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-XR3BJN33.js';
|
|
21
|
+
import { builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, BUILD_LABEL, RUNNER_LABEL } from './chunk-4NPZVMJU.js';
|
|
22
22
|
import { exceedsDisk } from './chunk-7RQ73DLO.js';
|
|
23
23
|
import { parseClaimedRepositories, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, claudeCredential } from './chunk-4Q7OMKAT.js';
|
|
24
24
|
import { parseClaimIdentity } from './chunk-BYT5O5RV.js';
|
|
@@ -1315,7 +1315,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
1315
1315
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected branch_claimed_elsewhere".split(" ")
|
|
1316
1316
|
);
|
|
1317
1317
|
async function tryClaimAndStart(state, item, queue) {
|
|
1318
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
1318
|
+
const { postJson: postJson2 } = await import('./work-cmd-RVRQ32EH.js');
|
|
1319
1319
|
const log = logOf(state);
|
|
1320
1320
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
1321
1321
|
const claim = await retrySend(
|
|
@@ -2072,7 +2072,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
2072
2072
|
const outcome = await onStartUnderMarker({
|
|
2073
2073
|
configPath,
|
|
2074
2074
|
own: ownVersionOf(deps),
|
|
2075
|
-
check: update.check ? () => update.check(configPath) : async () => (await import('./check-
|
|
2075
|
+
check: update.check ? () => update.check(configPath) : async () => (await import('./check-SRGR36KI.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl }),
|
|
2076
2076
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
2077
2077
|
log
|
|
2078
2078
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-
|
|
4
|
-
import { resolveRepoIdentity } from './chunk-
|
|
3
|
+
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-YDSMROTB.js';
|
|
4
|
+
import { resolveRepoIdentity } from './chunk-JXYVA45C.js';
|
|
5
5
|
import { resolveGatewayCredentials } from './chunk-PLMTLGYH.js';
|
|
6
6
|
import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -634,7 +634,7 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
|
|
|
634
634
|
recordHookErrorsSeen(home, hookErrorsBytes);
|
|
635
635
|
if (contextPossiblyGoverned(sessionCwd, home)) {
|
|
636
636
|
try {
|
|
637
|
-
const { materializeContext: materialize } = await import('./context-materialize-
|
|
637
|
+
const { materializeContext: materialize } = await import('./context-materialize-FDHYKNDT.js');
|
|
638
638
|
const sessionId = typeof payload.session_id === "string" ? payload.session_id : "unknown";
|
|
639
639
|
const result = await materialize({ cwd: sessionCwd, sessionId, home });
|
|
640
640
|
materializeMessage = result.message;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { detectMachine, supportsContainerBuilds, reachDockerStep, describeMachineDocker, supportsMicroVmBuilds } from './chunk-
|
|
4
|
-
import { MIN_ENGINE_MAJOR } from './chunk-
|
|
5
|
-
import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-
|
|
6
|
-
import {
|
|
3
|
+
import { detectMachine, supportsContainerBuilds, reachDockerStep, describeMachineDocker, supportsMicroVmBuilds } from './chunk-JYIEHQIF.js';
|
|
4
|
+
import { MIN_ENGINE_MAJOR } from './chunk-RBKIH5ST.js';
|
|
5
|
+
import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-T5VPP6H7.js';
|
|
6
|
+
import { runnerCredentialProblem } from './chunk-22RMZBGW.js';
|
|
7
|
+
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-ZM2IMMYN.js';
|
|
7
8
|
import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
9
|
import { dirname } from 'path';
|
|
9
10
|
|
|
@@ -61,9 +62,8 @@ function parseStdinConfig(configPath, text) {
|
|
|
61
62
|
} catch (err) {
|
|
62
63
|
throw new RunnerInitError(`the config on stdin is not valid JSON (${err instanceof Error ? err.message : String(err)})`);
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
65
|
+
const problem = runnerCredentialProblem(config);
|
|
66
|
+
if (problem !== void 0) throw new RunnerInitError(`the config on stdin: ${problem.field} ${problem.reason}.`);
|
|
67
67
|
const carried = config.runner;
|
|
68
68
|
const credential = handedCredential(config.claudeCredential);
|
|
69
69
|
const agent = handedAgent(config.agent);
|
|
@@ -73,15 +73,22 @@ function parseStdinConfig(configPath, text) {
|
|
|
73
73
|
return { config, carried, credential, agent };
|
|
74
74
|
}
|
|
75
75
|
function runRunnerInit(configPath, opts = {}) {
|
|
76
|
+
return writeRunnerInit(prepareRunnerInit(configPath, opts));
|
|
77
|
+
}
|
|
78
|
+
function prepareRunnerInit(configPath, opts = {}) {
|
|
76
79
|
let config;
|
|
77
80
|
let carried;
|
|
78
81
|
let credential = opts.credential;
|
|
79
82
|
let agent = opts.agent;
|
|
83
|
+
let needsKey = false;
|
|
80
84
|
if (opts.configFromStdin === void 0) {
|
|
81
|
-
config = readConfigObject(configPath);
|
|
85
|
+
config = opts.keyFromLogin === true && !existsSync(configPath) ? {} : readConfigObject(configPath);
|
|
82
86
|
if (config.runner !== void 0) {
|
|
83
87
|
throw new RunnerInitError(`${configPath}: a runner block is already here. Edit it, or remove it and run this again.`);
|
|
84
88
|
}
|
|
89
|
+
needsKey = opts.keyFromLogin === true && config.apiKey === void 0;
|
|
90
|
+
const problem = needsKey ? void 0 : runnerCredentialProblem(config);
|
|
91
|
+
if (problem !== void 0) throw new RunnerInitError(`${configPath}: ${problem.field} ${problem.reason}.`);
|
|
85
92
|
} else {
|
|
86
93
|
const handed = parseStdinConfig(configPath, opts.configFromStdin);
|
|
87
94
|
({ config, carried } = handed);
|
|
@@ -100,7 +107,14 @@ function runRunnerInit(configPath, opts = {}) {
|
|
|
100
107
|
"--agent claude needs Claude's credential, and none was piped on stdin or is in the runner.env beside the config. Pipe a token from `claude setup-token`, or an Anthropic API key: printf '%s' \"$CLAUDE_CODE_OAUTH_TOKEN\" | outerlayer runner init --agent claude"
|
|
101
108
|
);
|
|
102
109
|
}
|
|
103
|
-
|
|
110
|
+
return { configPath, config, carried, credential, agent, machine, hooks, needsKey };
|
|
111
|
+
}
|
|
112
|
+
function writeRunnerInit(prepared, runnerKey) {
|
|
113
|
+
const { configPath, config, carried, credential, agent, machine, hooks } = prepared;
|
|
114
|
+
if (prepared.needsKey && runnerKey === void 0) {
|
|
115
|
+
throw new RunnerInitError(`${configPath}: apiKey is missing, and no runner key was created from the login.`);
|
|
116
|
+
}
|
|
117
|
+
if (runnerKey !== void 0) Object.assign(config, { url: runnerKey.url, apiKey: runnerKey.apiKey, appId: runnerKey.appId });
|
|
104
118
|
mkdirSync(runnerDir(configPath), { recursive: true, mode: RUNNER_DIR_MODE });
|
|
105
119
|
config.runner = {
|
|
106
120
|
queues: ["implement", "amend"],
|
|
@@ -127,4 +141,4 @@ function runRunnerInit(configPath, opts = {}) {
|
|
|
127
141
|
return { configPath, hooks, ...hooks === "builtin:process" ? { note: isolationNote(machine) } : {}, credential: stored };
|
|
128
142
|
}
|
|
129
143
|
|
|
130
|
-
export { PLACEHOLDER_MARKER, RunnerInitError, isPlaceholderCommand, readConfigObject, runRunnerInit };
|
|
144
|
+
export { PLACEHOLDER_MARKER, RunnerInitError, isPlaceholderCommand, prepareRunnerInit, readConfigObject, runRunnerInit, writeRunnerInit };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import {
|
|
4
|
-
import { startTimeOf, isSameProcess } from './chunk-N5FOE5PS.js';
|
|
5
|
-
import { currentCliBuild } from './chunk-OGFGZQA3.js';
|
|
6
|
-
import { createDockerHost, childEnvironment, spawnRun } from './chunk-GGMRZPEA.js';
|
|
7
|
-
import { RecipeError } from './chunk-QOZKPLVJ.js';
|
|
8
|
-
import { builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, containerExecArgs } from './chunk-QEESCZ26.js';
|
|
9
|
-
import { CLAUDE_CODE_VERSION, firecrackerArch, MICROVM_ARCHES, DEFAULT_BASE_IMAGE, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, FIRECRACKER_VERSION, GUEST_ASSETS_VERSION } from './chunk-CX22S5BA.js';
|
|
3
|
+
import { createDockerHost, childEnvironment, spawnRun } from './chunk-KMDLFI4P.js';
|
|
10
4
|
import { execCapture } from './chunk-QKFB4K7X.js';
|
|
11
5
|
import { GUEST_CID } from './chunk-RSNSZ2LJ.js';
|
|
12
|
-
import { WorkCommandError, postJson } from './chunk-
|
|
13
|
-
import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-3ZPYPFNM.js';
|
|
6
|
+
import { WorkCommandError, postJson } from './chunk-SWHQ4LUM.js';
|
|
14
7
|
import { hostAllowed } from './chunk-UXYLWVTQ.js';
|
|
8
|
+
import { readDefaultBranchHead, cloneRepository, buildRepositoryImage } from './chunk-R7PF5OOU.js';
|
|
9
|
+
import { RecipeError } from './chunk-QOZKPLVJ.js';
|
|
10
|
+
import { startTimeOf, isSameProcess } from './chunk-N5FOE5PS.js';
|
|
11
|
+
import { currentCliBuild } from './chunk-OGFGZQA3.js';
|
|
12
|
+
import { builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, containerExecArgs } from './chunk-4NPZVMJU.js';
|
|
15
13
|
import { parseDuKilobytes } from './chunk-7RQ73DLO.js';
|
|
16
14
|
import { repositoriesOf, primaryOf, RELAY_PORT, CHECKOUT_DIR, JOB_MOUNT, claudeCredential, buildEnvironment, startBuildServices, checkEnvironment, AGENT_CREDENTIAL_MISSING, checkoutPath } from './chunk-4Q7OMKAT.js';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
15
|
+
import { CLAUDE_CODE_VERSION, firecrackerArch, MICROVM_ARCHES, DEFAULT_BASE_IMAGE, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, FIRECRACKER_VERSION, GUEST_ASSETS_VERSION } from './chunk-CX22S5BA.js';
|
|
16
|
+
import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-JXYVA45C.js';
|
|
17
|
+
import { defaultGitRunner, materializeContext } from './chunk-3NLOVYJQ.js';
|
|
18
|
+
import { readContextManifest, readSourceCache } from './chunk-LCEXHCHD.js';
|
|
20
19
|
import { signingFetchFor } from './chunk-YO4PSLVB.js';
|
|
21
|
-
import {
|
|
20
|
+
import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-2M63GG56.js';
|
|
21
|
+
import { downconvertSession } from './chunk-J5M7BSJQ.js';
|
|
22
22
|
import { signerFor } from './chunk-V7NIVOFD.js';
|
|
23
23
|
import { rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, stagedContextDir, contextHomeDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, buildDir, RUNNER_DIR_MODE, vmAssetsDir } from './chunk-ZM2IMMYN.js';
|
|
24
24
|
import { relative, join, dirname, basename } from 'path';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { builtinKind } from './chunk-
|
|
3
|
+
import { builtinKind } from './chunk-22RMZBGW.js';
|
|
4
4
|
import { parseSize } from './chunk-7RQ73DLO.js';
|
|
5
5
|
import { runnerDir } from './chunk-ZM2IMMYN.js';
|
|
6
6
|
import { dirname } from 'path';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-ZM2IMMYN.js';
|
|
4
|
+
import { existsSync, readFileSync, mkdirSync, chmodSync, writeFileSync } from 'fs';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
|
|
7
|
+
createRequire(import.meta.url);
|
|
8
|
+
var ITEM_KEY_FILE = "item-key";
|
|
9
|
+
function itemKeyPath(jobPath) {
|
|
10
|
+
return join(dirname(jobPath), ITEM_KEY_FILE);
|
|
11
|
+
}
|
|
12
|
+
function withItemKey(jobPath, job) {
|
|
13
|
+
let key;
|
|
14
|
+
try {
|
|
15
|
+
key = readFileSync(itemKeyPath(jobPath), "utf8").trim();
|
|
16
|
+
} catch {
|
|
17
|
+
return job;
|
|
18
|
+
}
|
|
19
|
+
return key === "" ? job : { ...job, itemKey: key };
|
|
20
|
+
}
|
|
21
|
+
function writeOwnerOnly(path, content) {
|
|
22
|
+
if (existsSync(path)) chmodSync(path, RUNNER_FILE_MODE);
|
|
23
|
+
writeFileSync(path, content, { mode: RUNNER_FILE_MODE });
|
|
24
|
+
}
|
|
25
|
+
function readJobFile(path) {
|
|
26
|
+
if (!existsSync(path)) return null;
|
|
27
|
+
try {
|
|
28
|
+
return withItemKey(path, JSON.parse(readFileSync(path, "utf8")));
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function readJobFileChecked(path) {
|
|
34
|
+
if (!existsSync(path)) return { kind: "missing" };
|
|
35
|
+
try {
|
|
36
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
37
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return { kind: "unreadable" };
|
|
38
|
+
return { kind: "ok", job: withItemKey(path, parsed) };
|
|
39
|
+
} catch {
|
|
40
|
+
return { kind: "unreadable" };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function writeJobFile(path, job) {
|
|
44
|
+
mkdirSync(dirname(path), { recursive: true, mode: RUNNER_DIR_MODE });
|
|
45
|
+
const { itemKey, ...rest } = job;
|
|
46
|
+
if (itemKey !== void 0) writeOwnerOnly(itemKeyPath(path), itemKey);
|
|
47
|
+
writeOwnerOnly(path, JSON.stringify(rest, null, 2));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { readJobFile, readJobFileChecked, writeJobFile };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { isPlaceholderCommand } from './chunk-
|
|
4
|
-
import { describeCallFailure } from './chunk-
|
|
5
|
-
import { WorkCommandError, getJson } from './chunk-
|
|
6
|
-
import {
|
|
7
|
-
import { builtinKind } from './chunk-XR3BJN33.js';
|
|
3
|
+
import { isPlaceholderCommand } from './chunk-Q2UK3C4P.js';
|
|
4
|
+
import { describeCallFailure } from './chunk-RBKIH5ST.js';
|
|
5
|
+
import { WorkCommandError, getJson } from './chunk-SWHQ4LUM.js';
|
|
6
|
+
import { builtinKind } from './chunk-22RMZBGW.js';
|
|
8
7
|
import { CLAUDE_CREDENTIAL_VARIABLES, claudeCredential } from './chunk-4Q7OMKAT.js';
|
|
8
|
+
import { sanitizeTerminal } from './chunk-WUYTWNMA.js';
|
|
9
9
|
import { signerFor } from './chunk-V7NIVOFD.js';
|
|
10
10
|
|
|
11
11
|
createRequire(import.meta.url);
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { autoConnect } from './chunk-
|
|
3
|
+
import { autoConnect } from './chunk-NPQWKGUA.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { workPageUrl } from './chunk-YDSMROTB.js';
|
|
6
|
+
import { sanitizeTerminal } from './chunk-WUYTWNMA.js';
|
|
7
|
+
import { resolveRepoIdentity } from './chunk-JXYVA45C.js';
|
|
8
|
+
import { C } from './chunk-YRYMNBGQ.js';
|
|
7
9
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
8
10
|
import { defaultFetch } from './chunk-YO4PSLVB.js';
|
|
9
11
|
import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-PLMTLGYH.js';
|
|
10
12
|
import { signRunnerRequest } from './chunk-V7NIVOFD.js';
|
|
13
|
+
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
11
14
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
12
15
|
|
|
13
16
|
createRequire(import.meta.url);
|
|
@@ -39,10 +42,6 @@ function isSignatureRefusal(code) {
|
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
// src/work-cmd.ts
|
|
42
|
-
var GREEN = "\x1B[32m";
|
|
43
|
-
var YELLOW = "\x1B[33m";
|
|
44
|
-
var DIM = "\x1B[2m";
|
|
45
|
-
var RESET = "\x1B[0m";
|
|
46
45
|
async function signatureHeaders(method, endpoint, payload, signer) {
|
|
47
46
|
if (signer === void 0) return {};
|
|
48
47
|
return { ...await signRunnerRequest({ method, url: endpoint, body: new TextEncoder().encode(payload), signer }) };
|
|
@@ -298,7 +297,19 @@ function tokenWarning(data) {
|
|
|
298
297
|
if (tokens === void 0 || tokens === null || tokens.earnable !== false) return "";
|
|
299
298
|
const why = typeof tokens.message === "string" ? sanitizeTerminal(tokens.message) : "the gateway named no reason";
|
|
300
299
|
return `
|
|
301
|
-
${
|
|
300
|
+
${C.yellow}!${C.reset} a container host will fail this build: ${why}`;
|
|
301
|
+
}
|
|
302
|
+
function itemLabel(data) {
|
|
303
|
+
return data.number != null ? `item #${data.number}` : `item ${sanitizeTerminal(String(data.workItemId))}`;
|
|
304
|
+
}
|
|
305
|
+
function issueLabel(subject) {
|
|
306
|
+
if ("issue" in subject) return `issue ${sanitizeTerminal(subject.repository)}#${subject.issue}`;
|
|
307
|
+
return `issue ${sanitizeTerminal(subject.key)}`;
|
|
308
|
+
}
|
|
309
|
+
function itemPageUrl(home, cwd, appId, workItemId) {
|
|
310
|
+
const connection = readRepoConnection(cwd);
|
|
311
|
+
if (connection === void 0 || connection.appId !== appId || typeof workItemId !== "string" || workItemId === "") return void 0;
|
|
312
|
+
return `${workPageUrl(home, connection.organization.name, connection.factory.name)}/${encodeURIComponent(workItemId)}`;
|
|
302
313
|
}
|
|
303
314
|
async function runWorkBuild(opts) {
|
|
304
315
|
const cwd = opts.cwd ?? process.cwd();
|
|
@@ -326,7 +337,7 @@ async function runWorkBuild(opts) {
|
|
|
326
337
|
const label = data2.number != null ? `#${data2.number}` : String(data2.workItemId);
|
|
327
338
|
const launch = data2.number != null ? `OUTERLAYER_WORK=${data2.number} claude` : null;
|
|
328
339
|
const branch = typeof data2.branch === "string" && data2.branch !== "" ? data2.branch : null;
|
|
329
|
-
const output2 = opts.json ? JSON.stringify({ ...data2, ...launch !== null ? { launchCommand: launch } : {} }) : `${
|
|
340
|
+
const output2 = opts.json ? JSON.stringify({ ...data2, ...launch !== null ? { launchCommand: launch } : {} }) : `${C.green}\u2713${C.reset} on Work for you to build ${C.dim}\xB7${C.reset} ${label} ${C.dim}\xB7${C.reset} no host will take it` + (branch !== null ? `
|
|
330
341
|
branch: ${branch}` : "") + (launch !== null ? `
|
|
331
342
|
start your session with: ${launch}` : "");
|
|
332
343
|
if (!opts.quiet) process.stdout.write(output2 + "\n");
|
|
@@ -338,7 +349,9 @@ async function runWorkBuild(opts) {
|
|
|
338
349
|
...facts
|
|
339
350
|
};
|
|
340
351
|
const { data } = await postJsonWithRetry(url, "/v1/work-items/build", apiKey, appId, body, fetchImpl, retries, sleep);
|
|
341
|
-
const
|
|
352
|
+
const page = itemPageUrl(home, cwd, appId, data.workItemId);
|
|
353
|
+
const output = opts.json ? JSON.stringify(data) : `${C.green}\u2713${C.reset} build requested ${C.dim}\xB7${C.reset} ${itemLabel(data)}${"subject" in body ? ` (${issueLabel(body.subject)})` : ""} ${C.dim}\xB7${C.reset} by ${data.attestor}` + (page !== void 0 ? `
|
|
354
|
+
${page}` : "") + tokenWarning(data);
|
|
342
355
|
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
343
356
|
return { data, output };
|
|
344
357
|
}
|
|
@@ -347,7 +360,7 @@ async function runWorkLinkSession(opts) {
|
|
|
347
360
|
return await linkSession(opts);
|
|
348
361
|
} catch (err) {
|
|
349
362
|
if (opts.logFailures) {
|
|
350
|
-
const { logHookError } = await import('./hook-fast-
|
|
363
|
+
const { logHookError } = await import('./hook-fast-WYQD6D7T.js');
|
|
351
364
|
const reason = err instanceof Error ? err.message : String(err);
|
|
352
365
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
353
366
|
}
|
|
@@ -387,7 +400,7 @@ async function linkSession(opts) {
|
|
|
387
400
|
}
|
|
388
401
|
const heldBy = typeof data.heldBy === "string" ? data.heldBy : void 0;
|
|
389
402
|
const linked = data.linked === true;
|
|
390
|
-
const output = opts.json ? JSON.stringify(data) : opts.ended ? linked ? `${
|
|
403
|
+
const output = opts.json ? JSON.stringify(data) : opts.ended ? linked ? `${C.green}\u2713${C.reset} ended ${C.dim}\xB7${C.reset} session ${sessionId} ${C.dim}\xB7${C.reset} #${number}` : `${C.dim}\xB7${C.reset} session ${sessionId} was not linked to #${number}` : heldBy ? `${C.dim}\xB7${C.reset} session ${sessionId} linked to #${number}, held by ${sanitizeTerminal(heldBy)} \u2014 no lease taken` : `${C.green}\u2713${C.reset} linked ${C.dim}\xB7${C.reset} session ${sessionId} ${C.dim}\xB7${C.reset} #${number}`;
|
|
391
404
|
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
392
405
|
return { data, output };
|
|
393
406
|
}
|
|
@@ -411,7 +424,7 @@ async function runWorkRemove(opts) {
|
|
|
411
424
|
{ reason: opts.reason, ...environmentFacts({ cwd, env, home }) },
|
|
412
425
|
fetchImpl
|
|
413
426
|
);
|
|
414
|
-
const output2 = opts.json ? JSON.stringify(data2) : `${
|
|
427
|
+
const output2 = opts.json ? JSON.stringify(data2) : `${C.green}\u2713${C.reset} removed ${C.dim}\xB7${C.reset} ${data2.workItemId} ${C.dim}\xB7${C.reset} withdrawn ${data2.itemWithdrawn}`;
|
|
415
428
|
if (!opts.quiet) process.stdout.write(output2 + "\n");
|
|
416
429
|
return { data: data2, output: output2 };
|
|
417
430
|
}
|
|
@@ -421,7 +434,7 @@ async function runWorkRemove(opts) {
|
|
|
421
434
|
const item = await findLiveItem(creds, repository, subject, fetchImpl);
|
|
422
435
|
if (!item) {
|
|
423
436
|
const data2 = { workItemId: null, removed: true, itemWithdrawn: false, noLiveAddition: true };
|
|
424
|
-
const output2 = opts.json ? JSON.stringify(data2) : `${
|
|
437
|
+
const output2 = opts.json ? JSON.stringify(data2) : `${C.green}\u2713${C.reset} nothing to remove ${C.dim}\xB7${C.reset} no live addition on ${repository}#${number}`;
|
|
425
438
|
if (!opts.quiet) process.stdout.write(output2 + "\n");
|
|
426
439
|
return { data: data2, output: output2 };
|
|
427
440
|
}
|
|
@@ -433,7 +446,7 @@ async function runWorkRemove(opts) {
|
|
|
433
446
|
{ reason: opts.reason, ...environmentFacts({ cwd, env, home }) },
|
|
434
447
|
fetchImpl
|
|
435
448
|
);
|
|
436
|
-
const output = opts.json ? JSON.stringify(data) : `${
|
|
449
|
+
const output = opts.json ? JSON.stringify(data) : `${C.green}\u2713${C.reset} removed ${C.dim}\xB7${C.reset} ${data.workItemId} ${C.dim}\xB7${C.reset} withdrawn ${data.itemWithdrawn}`;
|
|
437
450
|
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
438
451
|
return { data, output };
|
|
439
452
|
}
|
|
@@ -496,10 +509,10 @@ async function runWorkList(opts) {
|
|
|
496
509
|
const claimSuffix = (claim) => {
|
|
497
510
|
if (!claim) return "";
|
|
498
511
|
const holder = claim.holderKind === "session" ? `${claim.memberName || "a member"} (local session` : `${sanitizeTerminal(claim.host)} (${claim.kind}`;
|
|
499
|
-
return ` ${
|
|
512
|
+
return ` ${C.dim}\xB7${C.reset} claimed by ${holder}, since ${claim.createdAt}, until ${claim.expiresAt})`;
|
|
500
513
|
};
|
|
501
514
|
const output = opts.json ? JSON.stringify(data) : items.length === 0 ? "no live work items" : items.map(
|
|
502
|
-
(i) => `${i.trackerKey} ${
|
|
515
|
+
(i) => `${i.trackerKey} ${C.dim}\xB7${C.reset} ${i.stage} ${C.dim}\xB7${C.reset} ${i.section} ${C.dim}\xB7${C.reset} ${i.title}${claimSuffix(i.claim)}`
|
|
503
516
|
).join("\n");
|
|
504
517
|
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
505
518
|
return { data, output };
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runEmit } from './chunk-
|
|
4
|
-
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-
|
|
5
|
-
import { installStarterPack } from './chunk-
|
|
3
|
+
import { runEmit } from './chunk-HFKKFTXU.js';
|
|
4
|
+
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-XCK2YAY5.js';
|
|
5
|
+
import { installStarterPack } from './chunk-FOJGZYFC.js';
|
|
6
6
|
import { C } from './chunk-YRYMNBGQ.js';
|
|
7
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import { loadTemplateFiles, loadMaintainedFiles, skillDir } from './chunk-
|
|
10
|
-
import {
|
|
11
|
-
import { generatedHeaderSource } from './chunk-AHZQBGD2.js';
|
|
12
|
-
import './chunk-YO4PSLVB.js';
|
|
13
|
-
import './chunk-PLMTLGYH.js';
|
|
14
|
-
import './chunk-325272HM.js';
|
|
15
|
-
import './chunk-EABW6AJQ.js';
|
|
16
|
-
import './chunk-BYT5O5RV.js';
|
|
17
|
-
import './chunk-RA3O54FC.js';
|
|
18
|
-
import './chunk-V7NIVOFD.js';
|
|
19
|
-
import './chunk-ZM2IMMYN.js';
|
|
20
|
-
import './chunk-XCCLFVXM.js';
|
|
21
|
-
import './chunk-BJ3KTMDH.js';
|
|
22
|
-
import './chunk-VNVZDWO3.js';
|
|
23
|
-
import './chunk-Z5GEFMRW.js';
|
|
7
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-3NLOVYJQ.js';
|
|
8
|
+
import { pinExists, readContextManifest } from './chunk-LCEXHCHD.js';
|
|
9
|
+
import { loadTemplateFiles, loadMaintainedFiles, skillDir } from './chunk-ZA5CHAFY.js';
|
|
10
|
+
import { generatedHeaderSource } from './chunk-2M63GG56.js';
|
|
24
11
|
import { execFileSync } from 'child_process';
|
|
25
12
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
26
13
|
import { join, dirname } from 'path';
|
|
@@ -201,4 +188,4 @@ ${renderPaths(paths, kept)}${mcpNote}`;
|
|
|
201
188
|
`;
|
|
202
189
|
}
|
|
203
190
|
|
|
204
|
-
export { runAgentSetup };
|
|
191
|
+
export { keepHandWritten, runAgentSetup };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { DEFAULT_UNIT_NAME } from './chunk-
|
|
3
|
+
import { DEFAULT_UNIT_NAME } from './chunk-RLYZLUQ7.js';
|
|
4
4
|
import { parseRunnerEnv } from './chunk-6MZSX4M7.js';
|
|
5
5
|
import { RUNNER_FILE_MODE } from './chunk-ZM2IMMYN.js';
|
|
6
6
|
import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-
|
|
3
|
+
import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-J5M7BSJQ.js';
|
|
4
4
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
5
5
|
import { mkdirSync, appendFileSync, writeFileSync, renameSync, unlinkSync, existsSync, readdirSync, readFileSync, statSync } from 'fs';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
@@ -214,7 +214,9 @@ function readPersistedArtifactSpoolState(home) {
|
|
|
214
214
|
attempts: typeof e.attempts === "number" && Number.isFinite(e.attempts) ? e.attempts : 0,
|
|
215
215
|
firstSeen: typeof e.firstSeen === "string" ? e.firstSeen : (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
216
216
|
sha256: typeof e.sha256 === "string" ? e.sha256 : "",
|
|
217
|
-
reachedServer: e.reachedServer === true
|
|
217
|
+
reachedServer: e.reachedServer === true,
|
|
218
|
+
...typeof e.serverId === "string" ? { serverId: e.serverId } : {},
|
|
219
|
+
...typeof e.url === "string" ? { url: e.url } : {}
|
|
218
220
|
});
|
|
219
221
|
}
|
|
220
222
|
return { state, corrupt: false };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { C } from './chunk-YRYMNBGQ.js';
|
|
4
4
|
import { readCloudConfig } from './chunk-EABW6AJQ.js';
|
|
5
|
-
import { existsSync, writeFileSync,
|
|
5
|
+
import { existsSync, writeFileSync, readFileSync, mkdirSync } from 'fs';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
|
|
8
8
|
createRequire(import.meta.url);
|
|
@@ -62,13 +62,23 @@ function addMcpEntryIfAbsent(repoRoot, name, entry) {
|
|
|
62
62
|
`);
|
|
63
63
|
return { path: relPath, added: true };
|
|
64
64
|
}
|
|
65
|
+
function setMcpEntry(repoRoot, name, entry) {
|
|
66
|
+
const relPath = mcpTargetPath(repoRoot);
|
|
67
|
+
const absPath = join(repoRoot, relPath);
|
|
68
|
+
const doc = readMcpDoc(absPath, relPath);
|
|
69
|
+
const servers = doc.mcpServers ?? {};
|
|
70
|
+
writeFileSync(absPath, `${JSON.stringify({ ...doc, mcpServers: { ...servers, [name]: entry } }, null, 2)}
|
|
71
|
+
`);
|
|
72
|
+
}
|
|
73
|
+
var INIT_STDIO_ENTRY = { type: "stdio", command: "npx", args: ["-y", "@outerlayer/cli", "mcp", "serve"] };
|
|
65
74
|
function addStdioMcpEntryIfAbsent(repoRoot, name = "outerlayer") {
|
|
66
|
-
return addMcpEntryIfAbsent(repoRoot, name,
|
|
75
|
+
return addMcpEntryIfAbsent(repoRoot, name, { ...INIT_STDIO_ENTRY, args: [...INIT_STDIO_ENTRY.args] });
|
|
67
76
|
}
|
|
68
77
|
var DOCS_MCP_SERVER_NAME = "outerlayer-docs";
|
|
69
78
|
var DOCS_MCP_URL = "https://docs.outerlayer.ai/mcp";
|
|
79
|
+
var INIT_DOCS_ENTRY = { type: "http", url: DOCS_MCP_URL };
|
|
70
80
|
function addDocsMcpEntryIfAbsent(repoRoot) {
|
|
71
|
-
return addMcpEntryIfAbsent(repoRoot, DOCS_MCP_SERVER_NAME, {
|
|
81
|
+
return addMcpEntryIfAbsent(repoRoot, DOCS_MCP_SERVER_NAME, { ...INIT_DOCS_ENTRY });
|
|
72
82
|
}
|
|
73
83
|
function runMcpInstall(opts = {}) {
|
|
74
84
|
const cwd = opts.cwd ?? process.cwd();
|
|
@@ -99,4 +109,4 @@ function handleMcpInstallError(err) {
|
|
|
99
109
|
process.exitCode = 1;
|
|
100
110
|
}
|
|
101
111
|
|
|
102
|
-
export { DEFAULT_MCP_COMMAND, DOCS_MCP_SERVER_NAME, McpInstallError, addDocsMcpEntryIfAbsent, addStdioMcpEntryIfAbsent, buildServerEntry, buildStdioServerEntry, defaultMcpUrl, handleMcpInstallError, runMcpInstall };
|
|
112
|
+
export { DEFAULT_MCP_COMMAND, DOCS_MCP_SERVER_NAME, INIT_DOCS_ENTRY, INIT_STDIO_ENTRY, McpInstallError, addDocsMcpEntryIfAbsent, addStdioMcpEntryIfAbsent, buildServerEntry, buildStdioServerEntry, defaultMcpUrl, handleMcpInstallError, mcpTargetPath, runMcpInstall, setMcpEntry };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sanitizeTerminal } from './chunk-
|
|
4
|
-
import { remoteLookupFailed } from './chunk-
|
|
5
|
-
import { DEFAULT_DASHBOARD } from './chunk-
|
|
3
|
+
import { sanitizeTerminal } from './chunk-WUYTWNMA.js';
|
|
4
|
+
import { remoteLookupFailed } from './chunk-JXYVA45C.js';
|
|
5
|
+
import { DEFAULT_DASHBOARD } from './chunk-4KSQKQXE.js';
|
|
6
6
|
import { resolveGatewayCredentials } from './chunk-PLMTLGYH.js';
|
|
7
7
|
import { readCloudConfig } from './chunk-EABW6AJQ.js';
|
|
8
8
|
import { writeRepoConnection, findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
@@ -181,7 +181,7 @@ function saveFactoryConnection(gitCommonDir, saved, factory, now) {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
function connectedLine(repository, factory, reason) {
|
|
184
|
-
return `Connected ${repository} to factory "${factory.displayName}" in ${factory.organization.displayName} (${REASON_TEXT[reason]}).`;
|
|
184
|
+
return `Connected ${repository} to factory "${factory.displayName}" (${slug(factory)}) in ${factory.organization.displayName} (${REASON_TEXT[reason]}).`;
|
|
185
185
|
}
|
|
186
186
|
function autoConnectedLine(repository, factory, reason) {
|
|
187
187
|
return `Using factory "${factory.displayName}" in ${factory.organization.displayName} for ${repository} (${REASON_TEXT[reason]}); saved for this checkout.`;
|
|
@@ -310,4 +310,4 @@ ${COMMIT_LINE}
|
|
|
310
310
|
return r.code;
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
export { COMMIT_LINE, autoConnectedLine, fetchFactories, isLinkedRepository, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory };
|
|
313
|
+
export { COMMIT_LINE, autoConnectedLine, fetchFactories, isLinkedRepository, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory, workPageUrl };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { splitRawFile } from './chunk-
|
|
3
|
+
import { splitRawFile } from './chunk-2M63GG56.js';
|
|
4
4
|
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
5
5
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'fs';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
|
|
9
9
|
createRequire(import.meta.url);
|
|
10
|
-
var TEMPLATE_SKILLS = ["spec", "writing-specs", "build"];
|
|
10
|
+
var TEMPLATE_SKILLS = ["spec", "writing-specs", "writing-tests", "build"];
|
|
11
11
|
var MAINTAINED_SKILLS = ["emitting-evidence", "amend", "reporting-findings", "outerlayer"];
|
|
12
12
|
var TEMPLATE_CLASS_LINE = "<!-- yours to edit. Copied once from the default template by outerlayer init; never overwritten. -->";
|
|
13
13
|
function maintainedClassLine(version) {
|