@outerlayer/cli 0.33.0-next.20261022195547 → 0.33.0-next.20261023003700
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/README.md +5 -0
- package/dist/{agent-setup-RJOVRRHK.js → agent-setup-55ZDEXCS.js} +6 -6
- package/dist/{bridge-BCG2EB7F.js → bridge-NBCXFTT4.js} +2 -2
- package/dist/{build-GKCVFHF4.js → build-SEAQVLD5.js} +5 -5
- package/dist/build-disk-JHTMPRAA.js +16 -0
- package/dist/build-info.json +1 -1
- package/dist/{builder-DPNHJXG3.js → builder-Y4P7QARW.js} +5 -6
- package/dist/{check-64UX323V.js → check-MRYFTLOO.js} +36 -40
- package/dist/{chunk-D3HRAPNF.js → chunk-2EGCI2VW.js} +3424 -2700
- package/dist/{chunk-3MXPS7ED.js → chunk-2N67C6IV.js} +5 -4
- package/dist/{chunk-ZQOSIMKU.js → chunk-2WMZPJVE.js} +6 -3
- package/dist/{chunk-ZXBQ6E72.js → chunk-3RIFVLPO.js} +15 -10
- package/dist/{chunk-UOFBHIOZ.js → chunk-57L2YAJA.js} +1 -1
- package/dist/{chunk-6NWS455T.js → chunk-5THSC6BD.js} +1 -1
- package/dist/{chunk-QL3LPZ67.js → chunk-6LBSAW6I.js} +1 -1
- package/dist/{chunk-WPGBDY73.js → chunk-6RKD7YZ6.js} +1 -1
- package/dist/{chunk-77B36F5K.js → chunk-6Z4SZHV2.js} +4 -3
- package/dist/chunk-7HHNGZS5.js +146 -0
- package/dist/{chunk-DETKDTNL.js → chunk-AU346ENF.js} +3 -2
- package/dist/chunk-B2JURP6A.js +41 -0
- package/dist/{chunk-BCCI32ME.js → chunk-BALIE3BA.js} +36 -7
- package/dist/{chunk-BY36DVJV.js → chunk-BKADJZ7F.js} +3 -2
- package/dist/{chunk-CUBIZBMF.js → chunk-DISTLL2Q.js} +3 -3
- package/dist/{chunk-GN2R5Z7G.js → chunk-DXJTBU7A.js} +3 -3
- package/dist/{chunk-WCELNMXT.js → chunk-EUVE2EAE.js} +2 -2
- package/dist/{chunk-DDS2ISML.js → chunk-F5UL23I2.js} +1 -1
- package/dist/{chunk-43PV5KDB.js → chunk-FR7HWWCF.js} +37 -6
- package/dist/{chunk-JEKENLLA.js → chunk-GH246BGV.js} +1 -1
- package/dist/{chunk-ZRRUWNJS.js → chunk-HE4FBF4T.js} +4 -4
- package/dist/{chunk-W5DOK7BL.js → chunk-HVRQQOMH.js} +3 -3
- package/dist/{chunk-6IKSUAIA.js → chunk-HXA5GIHK.js} +61 -3
- package/dist/{chunk-2QT4JUW3.js → chunk-IP7BIBXJ.js} +1 -35
- package/dist/{chunk-LWTBE5J6.js → chunk-L26V6ILJ.js} +1 -1
- package/dist/{chunk-SK4TWCN3.js → chunk-MZBQTVFG.js} +1 -1
- package/dist/{chunk-YKYCE4HY.js → chunk-MZYOUIY5.js} +1 -1
- package/dist/{chunk-OWDSO3PE.js → chunk-NBZ7XBT6.js} +1 -1
- package/dist/{chunk-TGHBOXKJ.js → chunk-NE63JADS.js} +2 -2
- package/dist/{chunk-AGZNCIIJ.js → chunk-PA6CK6WQ.js} +1 -1
- package/dist/{chunk-L6JFFP3Q.js → chunk-PWH3BEZF.js} +55 -283
- package/dist/{chunk-QDMMW5PC.js → chunk-Q2CMEQV7.js} +2 -2
- package/dist/{chunk-DJWKUQLO.js → chunk-QPWFVE3X.js} +1 -1
- package/dist/{chunk-5BNWAIHN.js → chunk-RQJMN5TJ.js} +47 -7
- package/dist/{chunk-H7A3IQH5.js → chunk-SDU2IE22.js} +72 -28
- package/dist/{chunk-AA6LYZC4.js → chunk-SOI6K5DY.js} +1 -1
- package/dist/{chunk-35IY5HQY.js → chunk-SVDOA4W2.js} +1 -1
- package/dist/{chunk-RBJG5MM4.js → chunk-T5REPMNL.js} +5 -5
- package/dist/{chunk-6KLPC4U7.js → chunk-ULBNTSAD.js} +3 -2
- package/dist/{chunk-CMKY36NV.js → chunk-VT4TTJPG.js} +6 -5
- package/dist/chunk-W2AEL4BJ.js +179 -0
- package/dist/{chunk-6C2YWM6N.js → chunk-XHHTMFCX.js} +1 -1
- package/dist/{chunk-FAZDYI2D.js → chunk-XL2XWWU7.js} +3 -2
- package/dist/{chunk-KLXWS5Z7.js → chunk-YXHKCHWG.js} +4 -4
- package/dist/{chunk-GWDS42JC.js → chunk-Z5IW4DHH.js} +1 -1
- package/dist/{claude-launcher-66GKNIRZ.js → claude-launcher-NTYHJUJM.js} +1 -1
- package/dist/{cli-WICFAKFW.js → cli-K6XGL4EZ.js} +126 -102
- package/dist/{command-VGR24IPI.js → command-7FAIIQGF.js} +25 -26
- package/dist/{config-DUY2PT7K.js → config-QXMUWJAQ.js} +10 -4
- package/dist/{connect-cmd-ADRPR6ES.js → connect-cmd-P5GASVAF.js} +5 -5
- package/dist/{container-start-QX53HKXW.js → container-start-CVP3NTDG.js} +23 -26
- package/dist/context-show-cmd-3EPJ7CJC.js +115 -0
- package/dist/{control-plane-launch-SMHL6MWW.js → control-plane-launch-A3YCHQNQ.js} +5 -5
- package/dist/{docker-GGRJHHBP.js → docker-ANW76BNW.js} +5 -6
- package/dist/{doctor-N3CDJ66I.js → doctor-GJAHI3KU.js} +32 -39
- package/dist/{emit-artifact-cmd-73OWUBH6.js → emit-artifact-cmd-FDPJKGOO.js} +11 -10
- package/dist/{emit-criteria-cmd-D7OR356Y.js → emit-criteria-cmd-3SVGCMJN.js} +8 -7
- package/dist/{emit-demo-cmd-4AV74GMZ.js → emit-demo-cmd-6DF2QIAS.js} +12 -11
- package/dist/{emit-finding-cmd-GEPRJ6KO.js → emit-finding-cmd-TLJWBGQE.js} +8 -7
- package/dist/{emit-result-cmd-N52IABK6.js → emit-result-cmd-CJNVDV5V.js} +10 -9
- package/dist/{emit-step-cmd-CC6MUJ2S.js → emit-step-cmd-347CZO7Y.js} +8 -7
- package/dist/{exec-client-KLI262IX.js → exec-client-7PT4W7JR.js} +3 -3
- package/dist/{findings-cmd-7I72XX2H.js → findings-cmd-LHTYEHYB.js} +8 -7
- package/dist/{fleet-readiness-EZAGL32M.js → fleet-readiness-KGR5AC2J.js} +5 -5
- package/dist/{governing-source-M7ZRJCGY.js → governing-source-JZQZUTMA.js} +10 -9
- package/dist/{guest-init-ZJIE6MU3.js → guest-init-J3F3AEEY.js} +4 -4
- package/dist/{hook-fast-WNKICZ6E.js → hook-fast-6WDMNZG5.js} +1 -1
- package/dist/{pending-I5TY6SQH.js → host-key-UERIQRE6.js} +3 -3
- package/dist/{image-tag-MORUQ4LF.js → image-tag-ADSLWXBA.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/{init-VCWDBOT4.js → init-XDOKWBL2.js} +22 -25
- package/dist/{init-XG4NRZX4.js → init-ZQ5B3TJZ.js} +22 -25
- package/dist/{init-cmd-2CAMWMRP.js → init-cmd-YMGW2WXJ.js} +11 -10
- package/dist/{init-update-NCM4GA3S.js → init-update-X7YLZL6H.js} +8 -8
- package/dist/install-QPA7DQHO.js +19 -0
- package/dist/{install-cmd-HFGINYEE.js → install-cmd-FV7IZ7XF.js} +5 -5
- package/dist/{logs-QSKJ4G6M.js → logs-HI46FO6Z.js} +2 -2
- package/dist/{loop-PXALY3VY.js → loop-UJL2UCUM.js} +36 -40
- package/dist/{machine-AZRL432D.js → machine-2YPAFFCH.js} +22 -21
- package/dist/{mcp-serve-cmd-DQSO6MOL.js → mcp-serve-cmd-7ABBV2QE.js} +4 -4
- package/dist/{paths-KHDFSBEI.js → paths-7HVTDE6J.js} +2 -2
- package/dist/{host-key-REZADWAM.js → pending-5HZACM2V.js} +3 -3
- package/dist/{pidfile-BSY63HIC.js → pidfile-5UDLYPMC.js} +3 -3
- package/dist/{record-7CNTGRLD.js → record-PPZEXAVA.js} +3 -3
- package/dist/runner-env-HOUXKWIJ.js +20 -0
- package/dist/{runner-identity-WGH73DTV.js → runner-identity-KPUVTRLS.js} +5 -6
- package/dist/{runner-key-6BIULOR4.js → runner-key-FUJD66R6.js} +22 -25
- package/dist/{session-sender-MSHKJSBG.js → session-sender-7B3ZDWMC.js} +11 -10
- package/dist/{spec-cmd-AWIMO32E.js → spec-cmd-Q26NE22H.js} +9 -8
- package/dist/{status-BILERIXB.js → status-2KNTILGQ.js} +29 -28
- package/dist/{sync-cmd-BSUZ65CU.js → sync-cmd-SSUYTMLJ.js} +10 -9
- package/dist/{watch-UF6XCGSI.js → watch-L5NCO46E.js} +10 -9
- package/dist/{work-claim-cmd-4FXVAZWF.js → work-claim-cmd-NJNOQFQE.js} +16 -13
- package/dist/{work-cmd-NCP4637R.js → work-cmd-W7WEHMQJ.js} +8 -7
- package/dist/{work-comment-cmd-YNQYVHYS.js → work-comment-cmd-SSUOGVDD.js} +8 -7
- package/dist/{work-logs-cmd-HHWVYQBG.js → work-logs-cmd-WPMWMDX6.js} +8 -7
- package/dist/{work-open-pr-cmd-ALVD7KLY.js → work-open-pr-cmd-NO5YLOXD.js} +9 -8
- package/dist/{work-pr-cmd-KBNFVRB4.js → work-pr-cmd-37B5KECR.js} +8 -7
- package/dist/{work-stop-cmd-DBWNHZJO.js → work-stop-cmd-3BJLXUJ3.js} +8 -7
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/SKILL.md +4 -2
- package/dist/build-disk-6QAXMA2J.js +0 -18
- package/dist/chunk-DNKUSXQU.js +0 -241
- package/dist/chunk-I5LGKZ4M.js +0 -107
- package/dist/chunk-P5FC7VUO.js +0 -111
- package/dist/chunk-UXYLWVTQ.js +0 -43
- package/dist/chunk-WBZJWVT2.js +0 -146
- package/dist/chunk-YJLHUKYS.js +0 -38
- package/dist/chunk-YYYRBYWG.js +0 -32
- package/dist/install-NLVYISAV.js +0 -14
- package/dist/runner-env-26NLQI35.js +0 -15
package/dist/chunk-WBZJWVT2.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-CUBIZBMF.js';
|
|
4
|
-
import { detectMachine, supportsContainerBuilds, reachDockerStep, describeMachineDocker, supportsMicroVmBuilds } from './chunk-I5LGKZ4M.js';
|
|
5
|
-
import { MIN_ENGINE_MAJOR } from './chunk-D3HRAPNF.js';
|
|
6
|
-
import { runnerCredentialProblem } from './chunk-5BNWAIHN.js';
|
|
7
|
-
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-AGZNCIIJ.js';
|
|
8
|
-
import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
9
|
-
import { dirname } from 'path';
|
|
10
|
-
|
|
11
|
-
createRequire(import.meta.url);
|
|
12
|
-
var RunnerInitError = class extends Error {
|
|
13
|
-
};
|
|
14
|
-
var UNMARKED_PLACEHOLDER_COMMAND = "echo 'edit runner.commands in this config file: it must start your agent on item $OUTERLAYER_WORK' >&2; exit 1";
|
|
15
|
-
var PLACEHOLDER_MARKER = "outerlayer-placeholder";
|
|
16
|
-
var PLACEHOLDER_COMMAND = `${UNMARKED_PLACEHOLDER_COMMAND} # ${PLACEHOLDER_MARKER}`;
|
|
17
|
-
function isolationNote(machine) {
|
|
18
|
-
const has = describeMachineDocker(machine);
|
|
19
|
-
const reach = reachDockerStep(machine);
|
|
20
|
-
const needs = reach !== void 0 ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later: ${reach}, then set both hooks to builtin:container.` : machine.platform === "windows" ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later inside WSL2: install it there, run the runner from a WSL2 shell, and set both hooks to builtin:container.` : `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later on Linux or WSL2. Once it is installed, set both hooks to builtin:container.`;
|
|
21
|
-
return `This machine has ${has}, so builds run as processes under this user (isolation: shared-user), through the tunnel. ${needs}`;
|
|
22
|
-
}
|
|
23
|
-
function processRefusal(machine) {
|
|
24
|
-
const reach = reachDockerStep(machine);
|
|
25
|
-
const needs = machine.platform === "darwin" ? "Isolated builds on a Mac run in the runner image on Docker Desktop (https://docs.outerlayer.ai/run-the-runner-in-a-container) or in a Linux VM: run this again with --vm." : reach !== void 0 ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later: ${reach}, then run this again.` : machine.platform === "windows" ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later inside WSL2: install it there, then run this again from a WSL2 shell.` : `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later on Linux or WSL2: install it, then run this again.`;
|
|
26
|
-
return `This machine has ${describeMachineDocker(machine)}, so it cannot isolate a build. ${needs} To run builds as processes under this user instead, where a build can read this user's files and the runner's Claude credential, run this again with --allow-process-builds.`;
|
|
27
|
-
}
|
|
28
|
-
function isPlaceholderCommand(command) {
|
|
29
|
-
return command === UNMARKED_PLACEHOLDER_COMMAND || command.includes(PLACEHOLDER_MARKER);
|
|
30
|
-
}
|
|
31
|
-
function readConfigObject(configPath) {
|
|
32
|
-
if (!existsSync(configPath)) {
|
|
33
|
-
throw new RunnerInitError(
|
|
34
|
-
`${configPath}: no config file. Run \`outerlayer login\` first, then this command.`
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
return JSON.parse(readFileSync(configPath, "utf8"));
|
|
39
|
-
} catch (err) {
|
|
40
|
-
throw new RunnerInitError(`${configPath}: not valid JSON (${err instanceof Error ? err.message : String(err)})`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function handedCredential(value) {
|
|
44
|
-
if (value === void 0) return void 0;
|
|
45
|
-
if (typeof value !== "string") throw new RunnerInitError("the config on stdin carries a claudeCredential that is not text.");
|
|
46
|
-
return credentialFromStdin(value);
|
|
47
|
-
}
|
|
48
|
-
function handedAgent(value) {
|
|
49
|
-
if (value === void 0) return void 0;
|
|
50
|
-
if (!isAgentName(value)) throw new RunnerInitError("the config on stdin names an agent runner init does not know.");
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
function parseStdinConfig(configPath, text) {
|
|
54
|
-
if (existsSync(configPath)) {
|
|
55
|
-
throw new RunnerInitError(
|
|
56
|
-
`${configPath}: a config file is already here, so the runner key in it is not replaced. Remove it, or delete the VM and start again.`
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
let config;
|
|
60
|
-
try {
|
|
61
|
-
config = JSON.parse(text);
|
|
62
|
-
} catch (err) {
|
|
63
|
-
throw new RunnerInitError(`the config on stdin is not valid JSON (${err instanceof Error ? err.message : String(err)})`);
|
|
64
|
-
}
|
|
65
|
-
const problem = runnerCredentialProblem(config);
|
|
66
|
-
if (problem !== void 0) throw new RunnerInitError(`the config on stdin: ${problem.field} ${problem.reason}.`);
|
|
67
|
-
const carried = config.runner;
|
|
68
|
-
const credential = handedCredential(config.claudeCredential);
|
|
69
|
-
const agent = handedAgent(config.agent);
|
|
70
|
-
delete config.runner;
|
|
71
|
-
delete config.claudeCredential;
|
|
72
|
-
delete config.agent;
|
|
73
|
-
return { config, carried, credential, agent };
|
|
74
|
-
}
|
|
75
|
-
function runRunnerInit(configPath, opts = {}) {
|
|
76
|
-
return writeRunnerInit(prepareRunnerInit(configPath, opts));
|
|
77
|
-
}
|
|
78
|
-
function prepareRunnerInit(configPath, opts = {}) {
|
|
79
|
-
let config;
|
|
80
|
-
let carried;
|
|
81
|
-
let credential = opts.credential;
|
|
82
|
-
let agent = opts.agent;
|
|
83
|
-
let needsKey = false;
|
|
84
|
-
if (opts.configFromStdin === void 0) {
|
|
85
|
-
config = opts.keyFromLogin === true && !existsSync(configPath) ? {} : readConfigObject(configPath);
|
|
86
|
-
if (config.runner !== void 0) {
|
|
87
|
-
throw new RunnerInitError(`${configPath}: a runner block is already here. Edit it, or remove it and run this again.`);
|
|
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}.`);
|
|
92
|
-
} else {
|
|
93
|
-
const handed = parseStdinConfig(configPath, opts.configFromStdin);
|
|
94
|
-
({ config, carried } = handed);
|
|
95
|
-
credential ??= handed.credential;
|
|
96
|
-
agent ??= handed.agent;
|
|
97
|
-
}
|
|
98
|
-
const machine = opts.machine ?? detectMachine();
|
|
99
|
-
if (opts.requireContainer === true && !supportsContainerBuilds(machine)) {
|
|
100
|
-
const fix = reachDockerStep(machine) ?? `install Docker Engine ${MIN_ENGINE_MAJOR} or later in the VM`;
|
|
101
|
-
throw new RunnerInitError(`the VM has ${describeMachineDocker(machine)}, but the runner in it needs container builds: ${fix}, then run this again.`);
|
|
102
|
-
}
|
|
103
|
-
const hooks = opts.requireContainer !== true && supportsMicroVmBuilds(machine) ? "builtin:vm" : supportsContainerBuilds(machine) ? "builtin:container" : "builtin:process";
|
|
104
|
-
if (hooks === "builtin:process" && opts.allowProcess !== true) throw new RunnerInitError(processRefusal(machine));
|
|
105
|
-
if (agent === "claude" && credential === void 0 && opts.credentialInEnvironment !== true && !hasStoredCredential(configPath)) {
|
|
106
|
-
throw new RunnerInitError(
|
|
107
|
-
"--agent claude needs Claude's credential, and none was piped on stdin or is in the claude.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"
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
return { configPath, config, carried, credential, agent, machine, hooks, needsKey, host: opts.host };
|
|
111
|
-
}
|
|
112
|
-
function writeRunnerInit(prepared, runnerKey) {
|
|
113
|
-
const { configPath, config, carried, credential, agent, machine, hooks, host } = prepared;
|
|
114
|
-
if (prepared.needsKey && runnerKey === void 0) {
|
|
115
|
-
throw new RunnerInitError(`${configPath}: apiKey is missing, and no runner key was pasted.`);
|
|
116
|
-
}
|
|
117
|
-
if (runnerKey !== void 0) Object.assign(config, { url: runnerKey.url, apiKey: runnerKey.apiKey, appId: runnerKey.appId });
|
|
118
|
-
mkdirSync(runnerDir(configPath), { recursive: true, mode: RUNNER_DIR_MODE });
|
|
119
|
-
config.runner = {
|
|
120
|
-
queues: ["implement", "amend"],
|
|
121
|
-
concurrency: 1,
|
|
122
|
-
pollSeconds: 60,
|
|
123
|
-
timeLimitMinutes: 480,
|
|
124
|
-
idleLimitMinutes: 30,
|
|
125
|
-
// A placeholder that fails loudly. A command line that quietly did
|
|
126
|
-
// nothing would claim an item, run, exit zero, and record `ok` —
|
|
127
|
-
// every attempt reading as a success that produced nothing.
|
|
128
|
-
commands: {
|
|
129
|
-
implement: PLACEHOLDER_COMMAND,
|
|
130
|
-
amend: PLACEHOLDER_COMMAND
|
|
131
|
-
},
|
|
132
|
-
...carried,
|
|
133
|
-
...host === void 0 ? {} : { name: host },
|
|
134
|
-
// The agent was named on this command line, so its commands win over any the hand-off carried.
|
|
135
|
-
...agent === void 0 ? {} : { commands: { ...AGENT_COMMANDS[agent] } },
|
|
136
|
-
hooks: { provision: hooks, cleanup: hooks }
|
|
137
|
-
};
|
|
138
|
-
if (host !== void 0) delete config.runner.host;
|
|
139
|
-
mkdirSync(dirname(configPath), { recursive: true });
|
|
140
|
-
const stored = credential === void 0 ? void 0 : { variable: credential.variable, path: storeClaudeCredential(configPath, credential) };
|
|
141
|
-
writeFileSync(configPath, `${JSON.stringify(config, null, 2)}
|
|
142
|
-
`, { mode: RUNNER_FILE_MODE });
|
|
143
|
-
return { configPath, hooks, ...hooks === "builtin:process" ? { note: isolationNote(machine) } : {}, credential: stored };
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export { PLACEHOLDER_MARKER, RunnerInitError, isPlaceholderCommand, prepareRunnerInit, readConfigObject, runRunnerInit, writeRunnerInit };
|
package/dist/chunk-YJLHUKYS.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
|
|
4
|
-
createRequire(import.meta.url);
|
|
5
|
-
|
|
6
|
-
// src/runner/container/disk.ts
|
|
7
|
-
var UNITS = { "": 1, k: 1024, m: 1024 ** 2, g: 1024 ** 3 };
|
|
8
|
-
function parseSize(text) {
|
|
9
|
-
const match = /^(\d+(?:\.\d+)?)([kKmMgG]?)$/.exec(text);
|
|
10
|
-
if (match === null) return void 0;
|
|
11
|
-
const bytes = Number(match[1]) * UNITS[match[2].toLowerCase()];
|
|
12
|
-
return bytes > 0 ? bytes : void 0;
|
|
13
|
-
}
|
|
14
|
-
function exceedsDisk(usedKilobytes, limit) {
|
|
15
|
-
const bytes = parseSize(limit);
|
|
16
|
-
return usedKilobytes * 1024 > (bytes ?? Number.POSITIVE_INFINITY);
|
|
17
|
-
}
|
|
18
|
-
var TOTAL = /^(\d+)\t\/build$/;
|
|
19
|
-
var GONE = /: No such file or directory$/;
|
|
20
|
-
var LINE_MAX = 200;
|
|
21
|
-
function readDu(result) {
|
|
22
|
-
const stdoutLines = result.stdout.split("\n");
|
|
23
|
-
const totalAt = stdoutLines.map((line) => TOTAL.test(line)).lastIndexOf(true);
|
|
24
|
-
const kib = totalAt === -1 ? void 0 : Number(TOTAL.exec(stdoutLines[totalAt])[1]);
|
|
25
|
-
const lines = [...result.stderr.split("\n"), ...stdoutLines.filter((_, index) => index !== totalAt)].map((line) => line.trim()).filter((line) => line !== "");
|
|
26
|
-
const other = lines.find((line) => !GONE.test(line));
|
|
27
|
-
if (kib !== void 0 && result.status === 0) return { kib };
|
|
28
|
-
if (kib !== void 0 && other === void 0 && lines.length > 0) return { kib };
|
|
29
|
-
const detail = other === void 0 ? "" : `: ${cut(other.replace(/[\u0000-\u001f\u007f]/g, " "))}`;
|
|
30
|
-
return { ...kib === void 0 ? {} : { kib }, failure: `docker exec exited ${result.status}${detail}` };
|
|
31
|
-
}
|
|
32
|
-
function cut(line) {
|
|
33
|
-
const head = line.slice(0, LINE_MAX);
|
|
34
|
-
const last = head.charCodeAt(head.length - 1);
|
|
35
|
-
return last >= 55296 && last <= 56319 ? head.slice(0, -1) : head;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { exceedsDisk, parseSize, readDu };
|
package/dist/chunk-YYYRBYWG.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
import { statfsSync } from 'fs';
|
|
4
|
-
import { dirname } from 'path';
|
|
5
|
-
|
|
6
|
-
createRequire(import.meta.url);
|
|
7
|
-
function freeBytes(path, statfs = statfsSync) {
|
|
8
|
-
let at = path;
|
|
9
|
-
for (; ; ) {
|
|
10
|
-
try {
|
|
11
|
-
const stats = statfs(at);
|
|
12
|
-
return Number(stats.bavail) * Number(stats.bsize);
|
|
13
|
-
} catch (err) {
|
|
14
|
-
if (err.code !== "ENOENT") return void 0;
|
|
15
|
-
const parent = dirname(at);
|
|
16
|
-
if (parent === at) return void 0;
|
|
17
|
-
at = parent;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
var UNITS = ["B", "KB", "MB", "GB", "TB"];
|
|
22
|
-
function formatBytes(bytes) {
|
|
23
|
-
let value = Math.max(0, bytes);
|
|
24
|
-
let unit = 0;
|
|
25
|
-
while (value >= 1024 && unit < UNITS.length - 1) {
|
|
26
|
-
value /= 1024;
|
|
27
|
-
unit++;
|
|
28
|
-
}
|
|
29
|
-
return unit === 0 ? `${Math.round(value)} B` : `${value.toFixed(1)} ${UNITS[unit]}`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { formatBytes, freeBytes };
|
package/dist/install-NLVYISAV.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
export { DEFAULT_UNIT_NAME, installService, uninstallService, unitPathFor } from './chunk-ZRRUWNJS.js';
|
|
4
|
-
import './chunk-5BNWAIHN.js';
|
|
5
|
-
import './chunk-UXYLWVTQ.js';
|
|
6
|
-
import './chunk-YJLHUKYS.js';
|
|
7
|
-
import './chunk-AGZNCIIJ.js';
|
|
8
|
-
import './chunk-BCCI32ME.js';
|
|
9
|
-
import './chunk-VNVZDWO3.js';
|
|
10
|
-
import './chunk-HACGUL52.js';
|
|
11
|
-
import './chunk-MESOOLF4.js';
|
|
12
|
-
import './chunk-Z5GEFMRW.js';
|
|
13
|
-
|
|
14
|
-
createRequire(import.meta.url);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
export { AGENT_COMMANDS, RunnerEnvError, credentialFromStdin, hasStoredCredential, isAgentName, restartForCredential, storeClaudeCredential } from './chunk-CUBIZBMF.js';
|
|
4
|
-
import './chunk-ZRRUWNJS.js';
|
|
5
|
-
import './chunk-5BNWAIHN.js';
|
|
6
|
-
import './chunk-UXYLWVTQ.js';
|
|
7
|
-
import './chunk-YJLHUKYS.js';
|
|
8
|
-
import './chunk-AGZNCIIJ.js';
|
|
9
|
-
import './chunk-BCCI32ME.js';
|
|
10
|
-
import './chunk-VNVZDWO3.js';
|
|
11
|
-
import './chunk-HACGUL52.js';
|
|
12
|
-
import './chunk-MESOOLF4.js';
|
|
13
|
-
import './chunk-Z5GEFMRW.js';
|
|
14
|
-
|
|
15
|
-
createRequire(import.meta.url);
|