@outerlayer/cli 0.8.3 → 0.8.5
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 +13 -0
- package/dist/{agent-setup-FMTXHWWM.js → agent-setup-LEQF4V5F.js} +9 -7
- package/dist/build-info.json +1 -1
- package/dist/{builder-QZA2Z3M3.js → builder-5UFAF5LW.js} +3 -3
- package/dist/{check-AFYUJ5SQ.js → check-HWYLSMEL.js} +21 -21
- package/dist/{chunk-42OX3Q3A.js → chunk-2MFYKH3C.js} +1 -1
- package/dist/{chunk-NT5M6LF3.js → chunk-4KPMIGBQ.js} +8 -8
- package/dist/{chunk-4NOIKXUL.js → chunk-6AFQOYO3.js} +3 -3
- package/dist/{chunk-KZ2FOICE.js → chunk-AGMIJ725.js} +34 -5
- package/dist/{chunk-ZYHKJKSU.js → chunk-BL63NBJZ.js} +1 -1
- package/dist/{chunk-HN2JBGSI.js → chunk-CDISNKM4.js} +1 -1
- package/dist/{chunk-CLURXEWV.js → chunk-DE4GLH3P.js} +1 -1
- package/dist/{chunk-OULFBETM.js → chunk-DSPYQUH4.js} +2 -2
- package/dist/{chunk-SMPKFYKY.js → chunk-FCDET2U5.js} +3 -3
- package/dist/{chunk-4GS22GWM.js → chunk-FTW6C2E7.js} +7 -7
- package/dist/{chunk-BPTAOD6W.js → chunk-GJ3OWUFO.js} +8 -8
- package/dist/{chunk-YCHJIAP2.js → chunk-H6IGIE3I.js} +4 -4
- package/dist/{chunk-OCHRV5A6.js → chunk-IOG6LPEI.js} +2 -2
- package/dist/{chunk-7HWIKEU5.js → chunk-K4MGMSMN.js} +1 -1
- package/dist/{chunk-VITHLJOZ.js → chunk-LKUUQ3XV.js} +1 -1
- package/dist/{chunk-WMPO3SKK.js → chunk-MSV44EB5.js} +4 -4
- package/dist/{chunk-36H5BONJ.js → chunk-NKU5OPYP.js} +31 -37
- package/dist/{chunk-YNJEOGDL.js → chunk-PK5NANMT.js} +1 -1
- package/dist/{chunk-33GOCSRO.js → chunk-PVC36MFI.js} +3 -3
- package/dist/{chunk-BORFBENT.js → chunk-SWGQAURM.js} +4 -4
- package/dist/{chunk-EWBM2USM.js → chunk-TFJGK4UB.js} +6 -3
- package/dist/{chunk-2OZH6ZY2.js → chunk-TY7EZC7U.js} +5 -5
- package/dist/{chunk-NPBLDMSD.js → chunk-WGLWDX5J.js} +1 -1
- package/dist/{chunk-OPSPDEVU.js → chunk-WLV4KCAW.js} +1 -1
- package/dist/{chunk-SPUWEK2Q.js → chunk-ZMKXBWIK.js} +20 -16
- package/dist/{cli-L2TU7WDF.js → cli-5QAP7N4A.js} +59 -59
- package/dist/{command-J5KLUIOI.js → command-WKRTL3JQ.js} +14 -14
- package/dist/{connect-cmd-NV7WVBY7.js → connect-cmd-YEO7WRSL.js} +4 -4
- package/dist/{context-adopt-3GFYGDRT.js → context-adopt-3REPEEQR.js} +5 -5
- package/dist/{context-materialize-YBOW5YCC.js → context-materialize-DU6B6RXF.js} +5 -5
- package/dist/{dist-2LNAXGPZ.js → dist-PKBWZAAL.js} +2 -2
- package/dist/{docker-RSALMGPL.js → docker-5DUNHNOH.js} +4 -4
- package/dist/{doctor-M65EXDE6.js → doctor-FEIBPZL7.js} +16 -16
- package/dist/{emit-artifact-cmd-SGDZQNHP.js → emit-artifact-cmd-S3CASUQK.js} +7 -7
- package/dist/{emit-cmd-KBVRX42C.js → emit-cmd-ETI47BA6.js} +4 -4
- package/dist/{emit-criteria-cmd-PSZYZ32B.js → emit-criteria-cmd-ZTUP7OGA.js} +5 -5
- package/dist/{emit-finding-cmd-VTSYDJYZ.js → emit-finding-cmd-TTXBZ4B7.js} +5 -5
- package/dist/{emit-result-cmd-ANAY4ZXF.js → emit-result-cmd-34OC6TI5.js} +7 -7
- package/dist/{hook-fast-B7TFCJR2.js → hook-fast-CFLLVMSV.js} +1 -1
- package/dist/{import-capture-cmd-SD6FI2BM.js → import-capture-cmd-Z3232HR4.js} +3 -3
- package/dist/{import-ruler-cmd-NUSPILXT.js → import-ruler-cmd-2PLXZXM7.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{init-EE4JI2E4.js → init-AHQHM56A.js} +15 -15
- package/dist/{init-S2Z3YDK2.js → init-UZ5TXACM.js} +15 -15
- package/dist/{init-cmd-X6BETOWP.js → init-cmd-F4FS5AVC.js} +10 -10
- package/dist/{loop-CR46DEHT.js → loop-FN67ZHLO.js} +21 -21
- package/dist/{machine-XZ34ENE2.js → machine-Y3TBDMXD.js} +14 -14
- package/dist/{session-sender-B67S2DHF.js → session-sender-LKVVLAUP.js} +6 -6
- package/dist/{starter-pack-TC6HZ7JK.js → starter-pack-L5WPXL4Q.js} +4 -4
- package/dist/{status-HIOSSWBN.js → status-7RNWHYG6.js} +17 -17
- package/dist/{sync-cmd-JN5RXCJQ.js → sync-cmd-VH6HSMG5.js} +5 -5
- package/dist/{watch-2H4RVURC.js → watch-HUKDEFUX.js} +5 -5
- package/dist/{work-claim-cmd-JUC6E3R2.js → work-claim-cmd-JLCU5SPP.js} +7 -7
- package/dist/{work-cmd-66GA4ETV.js → work-cmd-SBKQJBJ2.js} +6 -6
- package/dist/{work-comment-cmd-J5K47MBZ.js → work-comment-cmd-TNUDUUAT.js} +6 -6
- package/dist/{work-open-pr-cmd-X46UWSPE.js → work-open-pr-cmd-IB57SMAD.js} +7 -7
- package/dist/{work-pr-cmd-T6SU4TYN.js → work-pr-cmd-HDDNFSKA.js} +6 -6
- package/package.json +1 -1
- package/skill-pack/maintained/emitting-evidence/SKILL.md +12 -5
- package/skill-pack/template/build/SKILL.md +6 -2
- package/skill-pack/template/build/references/release.md +13 -0
- package/skill-pack/template/build/references/review-loop.md +3 -1
- package/skill-pack/validators/code-review.yaml +27 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RESERVED_EMIT_NAMES } from './chunk-
|
|
3
|
+
import { RESERVED_EMIT_NAMES, ARTIFACT_KINDS, ArtifactCriterionIdSchema } from './chunk-PK5NANMT.js';
|
|
4
4
|
import { __commonJS, __require, __toESM } from './chunk-Z5GEFMRW.js';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
@@ -7287,8 +7287,8 @@ function classifyOnePath(rawPath) {
|
|
|
7287
7287
|
const segs = path.split("/");
|
|
7288
7288
|
const outerlayerIndex = segs.indexOf(OUTERLAYER_DIR);
|
|
7289
7289
|
if (outerlayerIndex === -1) {
|
|
7290
|
-
const
|
|
7291
|
-
if (
|
|
7290
|
+
const base = segs[segs.length - 1];
|
|
7291
|
+
if (base === "AGENTS.md" || base === "CLAUDE.md") {
|
|
7292
7292
|
const scopePath2 = segs.slice(0, -1).join("/");
|
|
7293
7293
|
return { type: "entry", entry: { path, kind: "external-instructions", scopePath: scopePath2 } };
|
|
7294
7294
|
}
|
|
@@ -7975,26 +7975,9 @@ function normalizeRepoName(repo) {
|
|
|
7975
7975
|
}
|
|
7976
7976
|
var CONTEXT_PIN_FILENAME = ".outerlayer-pin.json";
|
|
7977
7977
|
var CONTEXT_PIN_SCHEMA_VERSION = 1;
|
|
7978
|
-
var base = {
|
|
7979
|
-
whenPaths: null,
|
|
7980
|
-
whenIssueType: null,
|
|
7981
|
-
whenIssueLabels: null,
|
|
7982
|
-
needs: [],
|
|
7983
|
-
declaresEmit: null,
|
|
7984
|
-
level: "warn"
|
|
7985
|
-
};
|
|
7986
|
-
var REGISTRY_VALIDATORS = [
|
|
7987
|
-
{
|
|
7988
|
-
...base,
|
|
7989
|
-
id: "code-review-ran",
|
|
7990
|
-
name: "Code review report",
|
|
7991
|
-
row: "A code review report is attached to this change",
|
|
7992
|
-
requireAny: [{ type: "artifact", kind: "report", for: "code-review-ran" }]
|
|
7993
|
-
}
|
|
7994
|
-
];
|
|
7995
7978
|
var MAX_COMMAND_LENGTH = 2e3;
|
|
7996
|
-
var
|
|
7997
|
-
var FREED_BUILTINS = /* @__PURE__ */ new Set(["ci-passed", "acceptance-criteria"]);
|
|
7979
|
+
var EXTENDS_PROBLEM = '"extends" is not a policy key \u2014 every check is a file in .outerlayer/validators/. Run outerlayer init --template default to write .outerlayer/validators/code-review.yaml, then delete the extends line';
|
|
7980
|
+
var FREED_BUILTINS = /* @__PURE__ */ new Set(["ci-passed", "acceptance-criteria", "code-review-ran"]);
|
|
7998
7981
|
var RETIRED_BUILTINS = /* @__PURE__ */ new Set([
|
|
7999
7982
|
"red-then-green",
|
|
8000
7983
|
"no-test-tampering",
|
|
@@ -8033,7 +8016,7 @@ function parsePolicyFile(file) {
|
|
|
8033
8016
|
const problems = [];
|
|
8034
8017
|
const fail = (problem) => {
|
|
8035
8018
|
problems.push({ file: file.path, problem });
|
|
8036
|
-
return {
|
|
8019
|
+
return { overrides: {}, mergeGate: null, review: null, testProof: null, criteriaMissing: null, problems };
|
|
8037
8020
|
};
|
|
8038
8021
|
let root;
|
|
8039
8022
|
try {
|
|
@@ -8041,9 +8024,11 @@ function parsePolicyFile(file) {
|
|
|
8041
8024
|
} catch (error) {
|
|
8042
8025
|
return fail(`not valid YAML \u2014 ${error instanceof Error ? error.message : String(error)}`);
|
|
8043
8026
|
}
|
|
8027
|
+
if (root === null) root = {};
|
|
8044
8028
|
if (!isRecord(root)) return fail("must be a YAML mapping");
|
|
8029
|
+
if (root["extends"] !== void 0) return fail(EXTENDS_PROBLEM);
|
|
8045
8030
|
for (const key of Object.keys(root)) {
|
|
8046
|
-
if (key !== "
|
|
8031
|
+
if (key !== "validators" && key !== "merge_gate" && key !== "review" && key !== "build" && key !== "criteria") {
|
|
8047
8032
|
return fail(`unknown key "${inlineText(key)}"`);
|
|
8048
8033
|
}
|
|
8049
8034
|
}
|
|
@@ -8104,14 +8089,6 @@ function parsePolicyFile(file) {
|
|
|
8104
8089
|
return fail(`review has value "${inlineText(String(root["review"]))}" \u2014 use required or optional`);
|
|
8105
8090
|
}
|
|
8106
8091
|
}
|
|
8107
|
-
if (root["extends"] === void 0) {
|
|
8108
|
-
return fail(`missing "extends" \u2014 adopt the registry with extends: ${RECOMMENDED_EXTENDS}`);
|
|
8109
|
-
}
|
|
8110
|
-
if (root["extends"] !== RECOMMENDED_EXTENDS) {
|
|
8111
|
-
return fail(
|
|
8112
|
-
`unknown extends "${inlineText(String(root["extends"]))}" \u2014 the only supported registry is ${RECOMMENDED_EXTENDS}`
|
|
8113
|
-
);
|
|
8114
|
-
}
|
|
8115
8092
|
const overrides = {};
|
|
8116
8093
|
const validators = root["validators"];
|
|
8117
8094
|
if (validators !== void 0) {
|
|
@@ -8124,7 +8101,7 @@ function parsePolicyFile(file) {
|
|
|
8124
8101
|
overrides[id] = level;
|
|
8125
8102
|
}
|
|
8126
8103
|
}
|
|
8127
|
-
return {
|
|
8104
|
+
return { overrides, mergeGate, review, testProof, criteriaMissing, problems };
|
|
8128
8105
|
}
|
|
8129
8106
|
function parseSessionRan(value, file, problems) {
|
|
8130
8107
|
var _a;
|
|
@@ -8150,6 +8127,24 @@ function parseSessionRan(value, file, problems) {
|
|
|
8150
8127
|
}
|
|
8151
8128
|
return { type: "session-ran", command: command.trim(), status };
|
|
8152
8129
|
}
|
|
8130
|
+
function parseArtifactRequirement(value, file, problems) {
|
|
8131
|
+
const fail = (problem) => {
|
|
8132
|
+
problems.push({ file, problem });
|
|
8133
|
+
return null;
|
|
8134
|
+
};
|
|
8135
|
+
if (!isRecord(value) || Object.keys(value).some((key) => key !== "kind" && key !== "for")) {
|
|
8136
|
+
return fail(`"artifact" must be a mapping of "kind" and "for"`);
|
|
8137
|
+
}
|
|
8138
|
+
const kind = ARTIFACT_KINDS.find((known) => known === value["kind"]);
|
|
8139
|
+
if (kind === void 0) {
|
|
8140
|
+
return fail(`"artifact" kind must be one of ${ARTIFACT_KINDS.join(", ")}`);
|
|
8141
|
+
}
|
|
8142
|
+
const boundTo = ArtifactCriterionIdSchema.safeParse(value["for"]);
|
|
8143
|
+
if (!boundTo.success) {
|
|
8144
|
+
return fail(`"artifact" for must name the id the artifact is emitted --for`);
|
|
8145
|
+
}
|
|
8146
|
+
return { type: "artifact", kind, for: boundTo.data };
|
|
8147
|
+
}
|
|
8153
8148
|
function parseRequirementAlt(value, file, problems) {
|
|
8154
8149
|
if (!isRecord(value)) {
|
|
8155
8150
|
problems.push({ file, problem: `each requirement must be a single-key mapping` });
|
|
@@ -8159,7 +8154,7 @@ function parseRequirementAlt(value, file, problems) {
|
|
|
8159
8154
|
if (keys.length !== 1) {
|
|
8160
8155
|
problems.push({
|
|
8161
8156
|
file,
|
|
8162
|
-
problem: `a requirement names exactly one of session.ran, validator, emitted`
|
|
8157
|
+
problem: `a requirement names exactly one of session.ran, validator, emitted, artifact`
|
|
8163
8158
|
});
|
|
8164
8159
|
return null;
|
|
8165
8160
|
}
|
|
@@ -8181,6 +8176,7 @@ function parseRequirementAlt(value, file, problems) {
|
|
|
8181
8176
|
}
|
|
8182
8177
|
return { type: "emitted", name };
|
|
8183
8178
|
}
|
|
8179
|
+
if (key === "artifact") return parseArtifactRequirement(value[key], file, problems);
|
|
8184
8180
|
problems.push({ file, problem: `unknown requirement "${key}"` });
|
|
8185
8181
|
return null;
|
|
8186
8182
|
}
|
|
@@ -8456,7 +8452,6 @@ function parsePolicy(policyFile, validatorFiles) {
|
|
|
8456
8452
|
var _a, _b, _c, _d, _e;
|
|
8457
8453
|
const problems = [];
|
|
8458
8454
|
const policy = policyFile ? parsePolicyFile(policyFile) : {
|
|
8459
|
-
extendsOk: true,
|
|
8460
8455
|
overrides: {},
|
|
8461
8456
|
mergeGate: null,
|
|
8462
8457
|
review: null,
|
|
@@ -8503,8 +8498,7 @@ function parsePolicy(policyFile, validatorFiles) {
|
|
|
8503
8498
|
return false;
|
|
8504
8499
|
});
|
|
8505
8500
|
const resolved = resolveReferences(deduped, signalIds, problems);
|
|
8506
|
-
const
|
|
8507
|
-
const sorted = [...resolved.map((p) => p.def), ...registry].sort((a, b) => a.id < b.id ? -1 : 1);
|
|
8501
|
+
const sorted = resolved.map((p) => p.def).sort((a, b) => a.id < b.id ? -1 : 1);
|
|
8508
8502
|
const levels = {};
|
|
8509
8503
|
for (const custom of sorted) levels[custom.id] = custom.level;
|
|
8510
8504
|
for (const [id, level] of Object.entries(policy.overrides)) {
|
|
@@ -22431,4 +22431,4 @@ xmlchars/xmlns/1.0/ed3.js:
|
|
|
22431
22431
|
*)
|
|
22432
22432
|
*/
|
|
22433
22433
|
|
|
22434
|
-
export { ARTIFACT_MAX_CAPTION_LENGTH, ARTIFACT_MAX_FILENAME_LENGTH, ARTIFACT_MAX_REPLACES_TARGETS, ArtifactCriterionIdSchema, ArtifactSpoolRecordSchema, ArtifactTombstoneRecordSchema, BUCKET_MODEL_MAX_LENGTH, CAPTURE_TIERS, CriteriaListSchema, EMITTED_RESULTS, EMITTED_RESULT_MAX_BODY_LENGTH, EMITTED_RESULT_MAX_LINK_LENGTH, EVENT_TYPES, EmittedNameSchema, FindingBatchSchema, RESERVED_EMIT_NAMES, SCHEMA_VERSION, SPEED_MAX_LENGTH, bannedPathsForTier, bindTests, downconvertSession, inferArtifactKind, inputBandOf, isHumanUserTurn, mediaTypeForArtifactPath, parseAgentSession, parseJunit, parseTestSelector, turnCountBound };
|
|
22434
|
+
export { ARTIFACT_KINDS, ARTIFACT_MAX_CAPTION_LENGTH, ARTIFACT_MAX_FILENAME_LENGTH, ARTIFACT_MAX_REPLACES_TARGETS, ArtifactCriterionIdSchema, ArtifactSpoolRecordSchema, ArtifactTombstoneRecordSchema, BUCKET_MODEL_MAX_LENGTH, CAPTURE_TIERS, CriteriaListSchema, EMITTED_RESULTS, EMITTED_RESULT_MAX_BODY_LENGTH, EMITTED_RESULT_MAX_LINK_LENGTH, EVENT_TYPES, EmittedNameSchema, FindingBatchSchema, RESERVED_EMIT_NAMES, SCHEMA_VERSION, SPEED_MAX_LENGTH, bannedPathsForTier, bindTests, downconvertSession, inferArtifactKind, inputBandOf, isHumanUserTurn, mediaTypeForArtifactPath, parseAgentSession, parseJunit, parseTestSelector, turnCountBound };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { autoConnect } from './chunk-
|
|
3
|
+
import { autoConnect } from './chunk-MSV44EB5.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-BFESLKPP.js';
|
|
5
|
-
import { resolveRepoIdentity } from './chunk-
|
|
5
|
+
import { resolveRepoIdentity } from './chunk-CDISNKM4.js';
|
|
6
6
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
7
7
|
import { defaultFetch } from './chunk-YO4PSLVB.js';
|
|
8
8
|
import { unauthorizedMessage, resolveGatewayCredentials } from './chunk-PLMTLGYH.js';
|
|
@@ -38,7 +38,7 @@ async function runWorkPr(opts) {
|
|
|
38
38
|
const cwd = opts.cwd ?? process.cwd();
|
|
39
39
|
const env = opts.env ?? process.env;
|
|
40
40
|
const home = opts.home ?? homeFromEnv(env);
|
|
41
|
-
const refusal = await autoConnect(opts);
|
|
41
|
+
const refusal = await autoConnect({ ...opts, repository: opts.repo });
|
|
42
42
|
if (refusal !== void 0) throw new WorkPrCommandError(refusal);
|
|
43
43
|
const creds = resolveCredentials(opts);
|
|
44
44
|
const prNumber = resolvePrNumber(opts.number);
|
|
@@ -1,9 +1,9 @@
|
|
|
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 { sanitizeTerminal } from './chunk-
|
|
3
|
+
import { isPlaceholderCommand } from './chunk-IOG6LPEI.js';
|
|
4
|
+
import { describeCallFailure } from './chunk-GJ3OWUFO.js';
|
|
5
|
+
import { WorkCommandError, getJson } from './chunk-TY7EZC7U.js';
|
|
6
|
+
import { sanitizeTerminal } from './chunk-BL63NBJZ.js';
|
|
7
7
|
import { builtinKind } from './chunk-7KI224YS.js';
|
|
8
8
|
import { CLAUDE_CREDENTIAL_VARIABLES, claudeCredential } from './chunk-2FWL7CE2.js';
|
|
9
9
|
import { signerFor } from './chunk-V7NIVOFD.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sanitizeTerminal } from './chunk-
|
|
4
|
-
import { remoteLookupFailed } from './chunk-
|
|
3
|
+
import { sanitizeTerminal } from './chunk-BL63NBJZ.js';
|
|
4
|
+
import { remoteLookupFailed } from './chunk-CDISNKM4.js';
|
|
5
5
|
import { DEFAULT_DASHBOARD } from './chunk-USO2DKBD.js';
|
|
6
6
|
import { resolveGatewayCredentials } from './chunk-PLMTLGYH.js';
|
|
7
7
|
import { readCloudConfig } from './chunk-EABW6AJQ.js';
|
|
@@ -168,6 +168,9 @@ function saveFactoryConnection(gitCommonDir, saved, factory, now) {
|
|
|
168
168
|
function connectedLine(repository, factory, reason) {
|
|
169
169
|
return `Connected ${repository} to factory "${factory.displayName}" in ${factory.organization.displayName} (${REASON_TEXT[reason]}).`;
|
|
170
170
|
}
|
|
171
|
+
function autoConnectedLine(repository, factory, reason) {
|
|
172
|
+
return `Using factory "${factory.displayName}" in ${factory.organization.displayName} for ${repository} (${REASON_TEXT[reason]}); saved for this checkout.`;
|
|
173
|
+
}
|
|
171
174
|
async function choose(flags, deps, factories, saved, repository) {
|
|
172
175
|
if (flags.factory !== void 0) {
|
|
173
176
|
const wanted = flags.factory.toLowerCase();
|
|
@@ -289,4 +292,4 @@ async function runConnectCommand(flags, deps, out) {
|
|
|
289
292
|
return r.code;
|
|
290
293
|
}
|
|
291
294
|
|
|
292
|
-
export {
|
|
295
|
+
export { autoConnectedLine, fetchFactories, isLinkedRepository, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { autoConnect } from './chunk-
|
|
3
|
+
import { autoConnect } from './chunk-MSV44EB5.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-BFESLKPP.js';
|
|
5
|
-
import { sanitizeTerminal } from './chunk-
|
|
6
|
-
import { resolveRepoIdentity } from './chunk-
|
|
5
|
+
import { sanitizeTerminal } from './chunk-BL63NBJZ.js';
|
|
6
|
+
import { resolveRepoIdentity } from './chunk-CDISNKM4.js';
|
|
7
7
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
8
8
|
import { defaultFetch } from './chunk-YO4PSLVB.js';
|
|
9
9
|
import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-PLMTLGYH.js';
|
|
@@ -81,7 +81,7 @@ function resolveCredentials(opts) {
|
|
|
81
81
|
return { url: resolved.url, apiKey: resolved.credential, appId: resolved.appId };
|
|
82
82
|
}
|
|
83
83
|
async function connectIfOneFits(opts) {
|
|
84
|
-
const refusal = await autoConnect(opts);
|
|
84
|
+
const refusal = await autoConnect({ ...opts, repository: opts.repo });
|
|
85
85
|
if (refusal !== void 0) throw new WorkCommandError(refusal);
|
|
86
86
|
}
|
|
87
87
|
function resolveRepository(repoFlag, cwd) {
|
|
@@ -347,7 +347,7 @@ async function runWorkLinkSession(opts) {
|
|
|
347
347
|
return await linkSession(opts);
|
|
348
348
|
} catch (err) {
|
|
349
349
|
if (opts.logFailures) {
|
|
350
|
-
const { logHookError } = await import('./hook-fast-
|
|
350
|
+
const { logHookError } = await import('./hook-fast-CFLLVMSV.js');
|
|
351
351
|
const reason = err instanceof Error ? err.message : String(err);
|
|
352
352
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
353
353
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { RecipeError } from './chunk-QOZKPLVJ.js';
|
|
4
|
-
import { trackImageBuild, isOutOfMemory, ensureBuilder } from './chunk-
|
|
4
|
+
import { trackImageBuild, isOutOfMemory, ensureBuilder } from './chunk-DE4GLH3P.js';
|
|
5
5
|
import { spawn } from 'child_process';
|
|
6
6
|
import { existsSync, mkdirSync, createWriteStream, rmSync, readFileSync } from 'fs';
|
|
7
7
|
import { join, dirname } from 'path';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { splitRawFile } from './chunk-
|
|
3
|
+
import { splitRawFile } from './chunk-NKU5OPYP.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';
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { decideInstalledSwitch, fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-IS4DIGBQ.js';
|
|
4
4
|
import { compareVersions, satisfiesRange } from './chunk-I2UOAV7X.js';
|
|
5
|
-
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-
|
|
5
|
+
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-4KPMIGBQ.js';
|
|
6
6
|
import { writeJobFile, readJobFile, readJobFileChecked } from './chunk-T6OIJQRT.js';
|
|
7
7
|
import { RUNNER_PROTOCOL } from './chunk-AIW6GLET.js';
|
|
8
8
|
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-UGP76IZ5.js';
|
|
9
|
-
import { placeholderQueues, placeholderProblem } from './chunk-
|
|
10
|
-
import {
|
|
9
|
+
import { placeholderQueues, placeholderProblem } from './chunk-SWGQAURM.js';
|
|
10
|
+
import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, cleanVersions, isInLayout, stagingDir } from './chunk-TI7B7UEO.js';
|
|
11
11
|
import { freeBytes, formatBytes } from './chunk-YYYRBYWG.js';
|
|
12
12
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
13
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, provisionContainer, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandLine, BuildTokens, classifyRefusal, refusalCode, measureDisk, createRunnerLog, setUpRunnerCgroup, parseCpuList, ensureTunnel, keepGhConfigCurrent, createContainerRuntime, formatClock } from './chunk-
|
|
13
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, provisionContainer, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandLine, BuildTokens, classifyRefusal, refusalCode, measureDisk, createRunnerLog, setUpRunnerCgroup, parseCpuList, ensureTunnel, keepGhConfigCurrent, createContainerRuntime, formatClock } from './chunk-GJ3OWUFO.js';
|
|
14
14
|
import { checkFit } from './chunk-JKIWMRFH.js';
|
|
15
15
|
import { startTimeOf, claimPidFile, readPidFile, isSameProcess, releasePidFile } from './chunk-N5FOE5PS.js';
|
|
16
|
-
import { spawnRun } from './chunk-
|
|
17
|
-
import { builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, BUILD_LABEL, RUNNER_LABEL } from './chunk-
|
|
18
|
-
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-
|
|
16
|
+
import { spawnRun } from './chunk-WGLWDX5J.js';
|
|
17
|
+
import { builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, BUILD_LABEL, RUNNER_LABEL } from './chunk-DE4GLH3P.js';
|
|
18
|
+
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-TY7EZC7U.js';
|
|
19
19
|
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind } from './chunk-7KI224YS.js';
|
|
20
20
|
import { exceedsDisk } from './chunk-7RQ73DLO.js';
|
|
21
21
|
import { sharedUserEnvironment, JOB_MOUNT, claudeCredential } from './chunk-2FWL7CE2.js';
|
|
@@ -949,7 +949,7 @@ function considerNamedVersion(state, named) {
|
|
|
949
949
|
const updating = decision === "update" && !retryHeld(state, named);
|
|
950
950
|
state.pendingUpdate = updating ? named : void 0;
|
|
951
951
|
if (!updating || state.preflightedUpdate !== named) state.preflightedUpdate = void 0;
|
|
952
|
-
if (decision === "cannot_self_update" && !state.cannotSelfUpdateLogged) {
|
|
952
|
+
if (decision === "cannot_self_update" && !state.cannotSelfUpdateLogged && installedSwitchOf(state, update).kind !== "restart") {
|
|
953
953
|
state.cannotSelfUpdateLogged = true;
|
|
954
954
|
logOf(state).line(`this runner cannot update itself to ${named}: ${blocker}`);
|
|
955
955
|
}
|
|
@@ -980,19 +980,23 @@ function reportUpdateResult(state, version, result) {
|
|
|
980
980
|
const retryAt = new Date(result.retryAtMs).toISOString().slice(11, 16);
|
|
981
981
|
logOf(state).error(`could not update to ${version}: ${result.detail} \xB7 attempt ${result.attempts}, trying again after ${retryAt} UTC`);
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
const update = state.deps.update;
|
|
985
|
-
if (update === void 0) return false;
|
|
983
|
+
function installedSwitchOf(state, update) {
|
|
986
984
|
const configPath = state.config.configPath;
|
|
987
|
-
const own = ownVersionOf(state.deps);
|
|
988
985
|
const current = currentVersion(configPath);
|
|
989
|
-
|
|
990
|
-
own,
|
|
986
|
+
return decideInstalledSwitch({
|
|
987
|
+
own: ownVersionOf(state.deps),
|
|
991
988
|
current,
|
|
992
989
|
fromCurrent: startedThroughCurrent(configPath, update.entryPath),
|
|
993
990
|
underService: update.underService === true,
|
|
994
991
|
installed: current !== void 0 && existsSync(entryIn(versionDir(configPath, current)))
|
|
995
992
|
});
|
|
993
|
+
}
|
|
994
|
+
function restartOntoInstalled(state) {
|
|
995
|
+
const update = state.deps.update;
|
|
996
|
+
if (update === void 0) return false;
|
|
997
|
+
const configPath = state.config.configPath;
|
|
998
|
+
const own = ownVersionOf(state.deps);
|
|
999
|
+
const decision = installedSwitchOf(state, update);
|
|
996
1000
|
if (decision.kind === "none") {
|
|
997
1001
|
state.installedSwitch = void 0;
|
|
998
1002
|
return false;
|
|
@@ -1232,7 +1236,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
1232
1236
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous branch_claimed_elsewhere".split(" ")
|
|
1233
1237
|
);
|
|
1234
1238
|
async function tryClaimAndStart(state, item, queue) {
|
|
1235
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
1239
|
+
const { postJson: postJson2 } = await import('./work-cmd-SBKQJBJ2.js');
|
|
1236
1240
|
const log = logOf(state);
|
|
1237
1241
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
1238
1242
|
const claim = await retrySend(
|
|
@@ -1956,7 +1960,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
1956
1960
|
const outcome = await onStartUnderMarker({
|
|
1957
1961
|
configPath,
|
|
1958
1962
|
own: ownVersionOf(deps),
|
|
1959
|
-
check: update.check ? () => update.check(configPath) : async () => (await import('./check-
|
|
1963
|
+
check: update.check ? () => update.check(configPath) : async () => (await import('./check-HWYLSMEL.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl }),
|
|
1960
1964
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
1961
1965
|
log
|
|
1962
1966
|
});
|