@holmes-lab/holmes-kit 0.40.1 → 0.41.1
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 +86 -0
- package/README.md +12 -4
- package/dist/.build-id +1 -1
- package/dist/holmes/cli/approve-context.js +4 -3
- package/dist/holmes/cli/approve.js +22 -12
- package/dist/holmes/cli/autonomy.d.ts +21 -0
- package/dist/holmes/cli/autonomy.js +35 -5
- package/dist/holmes/cli/doctor.js +58 -6
- package/dist/holmes/cli/index.js +371 -250
- package/dist/holmes/cli/init.js +26 -6
- package/dist/holmes/cli/ledger-witness.d.ts +61 -0
- package/dist/holmes/cli/ledger-witness.js +252 -0
- package/dist/holmes/cli/playbook-skills.d.ts +3 -56
- package/dist/holmes/cli/playbook-skills.js +63 -354
- package/dist/holmes/cli/test-platform.d.ts +6 -0
- package/dist/holmes/cli/test-platform.js +12 -0
- package/dist/holmes/config/config.d.ts +9 -1
- package/dist/holmes/config/config.js +10 -3
- package/dist/holmes/governance/approval-grants.d.ts +2 -0
- package/dist/holmes/governance/approval-grants.js +6 -5
- package/dist/holmes/governance/approval-queue.d.ts +65 -1
- package/dist/holmes/governance/approval-queue.js +279 -9
- package/dist/holmes/governance/autonomous-shell.d.ts +13 -1
- package/dist/holmes/governance/autonomous-shell.js +157 -4
- package/dist/holmes/governance/autonomy.d.ts +209 -0
- package/dist/holmes/governance/autonomy.js +1129 -6
- package/dist/holmes/governance/install-manifest.d.ts +7 -4
- package/dist/holmes/governance/install-manifest.js +159 -15
- package/dist/holmes/governance/ledger-witness.d.ts +63 -0
- package/dist/holmes/governance/ledger-witness.js +296 -0
- package/dist/holmes/governance/provenance-chain.d.ts +8 -1
- package/dist/holmes/governance/provenance-chain.js +23 -4
- package/dist/holmes/governance/recorded-pairs.d.ts +4 -0
- package/dist/holmes/governance/recorded-pairs.js +25 -1
- package/dist/holmes/governance/session-context.d.ts +7 -0
- package/dist/holmes/governance/session-context.js +34 -6
- package/dist/holmes/guardrail/anchor-scope-text.d.ts +9 -0
- package/dist/holmes/guardrail/anchor-scope-text.js +7 -0
- package/dist/holmes/guardrail/command-traits.d.ts +102 -0
- package/dist/holmes/guardrail/command-traits.js +379 -0
- package/dist/holmes/guardrail/fixtures/manager-builtins.json +23 -0
- package/dist/holmes/guardrail/fixtures/npm-commands.json +7 -0
- package/dist/holmes/guardrail/outward-acts.d.ts +47 -0
- package/dist/holmes/guardrail/outward-acts.js +1102 -0
- package/dist/holmes/guardrail/refusal-codes.js +8 -1
- package/dist/holmes/guardrail/refusal-templates.d.ts +15 -0
- package/dist/holmes/guardrail/refusal-templates.js +71 -0
- package/dist/holmes/guardrail/risk-classifier.d.ts +22 -6
- package/dist/holmes/guardrail/risk-classifier.js +12 -118
- package/dist/holmes/guardrail/shell-lexer.d.ts +69 -0
- package/dist/holmes/guardrail/shell-lexer.js +567 -0
- package/dist/holmes/guardrail/write-target.js +7 -1
- package/dist/holmes/hooks/pre-tool-use.d.ts +60 -0
- package/dist/holmes/hooks/pre-tool-use.js +1423 -10
- package/dist/holmes/hooks/session-start.js +11 -1
- package/dist/holmes/hooks/stop.d.ts +7 -0
- package/dist/holmes/hooks/stop.js +39 -2
- package/dist/holmes/mcp/elicit-approval.d.ts +0 -21
- package/dist/holmes/mcp/elicit-approval.js +5 -2
- package/dist/holmes/mcp/handlers/approval-ask.js +3 -2
- package/dist/holmes/mcp/handlers/entity-integration.d.ts +1 -1
- package/dist/holmes/mcp/handlers/entity-integration.js +9 -6
- package/dist/holmes/mcp/handlers/entity-renumber.js +2 -1
- package/dist/holmes/mcp/handlers/entity-store.js +7 -2
- package/dist/holmes/mcp/handlers/operator-inspection.d.ts +2 -0
- package/dist/holmes/mcp/handlers/operator-inspection.js +25 -4
- package/dist/holmes/mcp/handlers/spec-approval.d.ts +3 -1
- package/dist/holmes/mcp/handlers/spec-approval.js +28 -10
- package/dist/holmes/mcp/handlers/spec-lifecycle.js +10 -7
- package/dist/holmes/mcp/handlers/test-execution.d.ts +6 -0
- package/dist/holmes/mcp/handlers/test-execution.js +37 -9
- package/dist/holmes/mcp/handlers.d.ts +5 -5
- package/dist/holmes/mcp/handlers.js +2 -1
- package/dist/holmes/mcp/tool-schemas.js +4 -4
- package/dist/holmes/project/playbook-reference.d.ts +50 -0
- package/dist/holmes/project/playbook-reference.js +259 -0
- package/dist/holmes/project/playbook-skill-states.d.ts +94 -0
- package/dist/holmes/project/playbook-skill-states.js +396 -0
- package/dist/holmes/project/root.d.ts +9 -1
- package/dist/holmes/project/root.js +23 -2
- package/dist/holmes/project/running-package.d.ts +15 -0
- package/dist/holmes/project/running-package.js +87 -0
- package/dist/holmes/review/head-worktree.js +9 -1
- package/dist/holmes/review/test-runner.d.ts +2 -0
- package/dist/holmes/review/test-runner.js +38 -11
- package/dist/holmes/spec/entity-integration-transaction.d.ts +19 -2
- package/dist/holmes/spec/entity-integration-transaction.js +68 -7
- package/package.json +5 -2
|
@@ -51,8 +51,9 @@ exports.keyedSelfConsistent = keyedSelfConsistent;
|
|
|
51
51
|
exports.bodyCanon = bodyCanon;
|
|
52
52
|
exports.parseLedgerLines = parseLedgerLines;
|
|
53
53
|
exports.consumeNonceExclusively = consumeNonceExclusively;
|
|
54
|
-
// @implements A-SPEC-125.2, A-SPEC-624, A-SPEC-734, A-SPEC-794.46
|
|
54
|
+
// @implements A-SPEC-125.2, A-SPEC-624, A-SPEC-734, A-SPEC-794.46, A-SPEC-794.115
|
|
55
55
|
const execution_context_1 = require("../project/execution-context");
|
|
56
|
+
const witness = __importStar(require("./ledger-witness"));
|
|
56
57
|
const crypto = __importStar(require("node:crypto"));
|
|
57
58
|
const fs = __importStar(require("node:fs"));
|
|
58
59
|
const path = __importStar(require("node:path"));
|
|
@@ -392,12 +393,30 @@ class ProvenanceChain {
|
|
|
392
393
|
appendInsideLock(body) {
|
|
393
394
|
return this.appendUnlocked(body);
|
|
394
395
|
}
|
|
395
|
-
/**
|
|
396
|
+
/**
|
|
397
|
+
* The append itself, assuming exclusion is already held. Only callers INSIDE a hold may use it.
|
|
398
|
+
*
|
|
399
|
+
* @implements A-SPEC-794.115 — the chain's one write point, so the ledger witness of A-SPEC-794.114 moves here and
|
|
400
|
+
* nowhere else: every append, the grant spend (`consumeNonceExclusively` appends inside its own hold) and the
|
|
401
|
+
* stale-lock record. The witness's pending entry is written before the row, its head after; the witness module decides
|
|
402
|
+
* whether to move at all (it never creates an entry, and never moves one the current file does not match).
|
|
403
|
+
*/
|
|
396
404
|
appendUnlocked(body) {
|
|
397
|
-
|
|
405
|
+
let before = '';
|
|
406
|
+
try {
|
|
407
|
+
before = (0, bounded_io_1.readRegularTextSync)(this.file);
|
|
408
|
+
}
|
|
409
|
+
catch (err) {
|
|
410
|
+
if (err.code !== 'ENOENT')
|
|
411
|
+
throw err;
|
|
412
|
+
}
|
|
413
|
+
const chain = parseLedgerLines(before, this.file, { throwOnCorruption: false });
|
|
398
414
|
const evt = chainNext(chain, writtenBody(body), process.env.HOLMES_LEDGER_KEY || undefined);
|
|
415
|
+
const line = JSON.stringify(evt) + '\n';
|
|
416
|
+
const token = witness.beforeAppend(this.file, before, evt, line);
|
|
399
417
|
fs.mkdirSync(path.dirname(this.file), { recursive: true });
|
|
400
|
-
fs.appendFileSync(this.file,
|
|
418
|
+
fs.appendFileSync(this.file, line, 'utf8');
|
|
419
|
+
witness.afterAppend(token);
|
|
401
420
|
return evt;
|
|
402
421
|
}
|
|
403
422
|
/**
|
|
@@ -36,6 +36,10 @@ export declare function trustedActor(e: {
|
|
|
36
36
|
actor?: unknown;
|
|
37
37
|
authorization?: unknown;
|
|
38
38
|
}): boolean;
|
|
39
|
+
export declare function trustedLedgerEventsCached(root: string): {
|
|
40
|
+
events: StoreEvent[];
|
|
41
|
+
ignored: IgnoredEvent[];
|
|
42
|
+
};
|
|
39
43
|
/** Every trusted event across the ledger's chains, and every event or chain that was ignored with its reason. */
|
|
40
44
|
export declare function trustedLedgerEvents(root: string, deps?: TrustDeps): {
|
|
41
45
|
events: StoreEvent[];
|
|
@@ -38,12 +38,13 @@ exports.headRefOf = headRefOf;
|
|
|
38
38
|
exports.headCommitOf = headCommitOf;
|
|
39
39
|
exports.committedLedgerTexts = committedLedgerTexts;
|
|
40
40
|
exports.trustedActor = trustedActor;
|
|
41
|
+
exports.trustedLedgerEventsCached = trustedLedgerEventsCached;
|
|
41
42
|
exports.trustedLedgerEvents = trustedLedgerEvents;
|
|
42
43
|
exports.ownLedgerShortened = ownLedgerShortened;
|
|
43
44
|
exports.approvedSeals = approvedSeals;
|
|
44
45
|
exports.recordedPairsPort = recordedPairsPort;
|
|
45
46
|
exports.describeIgnored = describeIgnored;
|
|
46
|
-
// @implements A-SPEC-222.9, A-SPEC-222.10, A-SPEC-222.12, A-SPEC-222.13
|
|
47
|
+
// @implements A-SPEC-222.9, A-SPEC-222.10, A-SPEC-222.12, A-SPEC-222.13, A-SPEC-794.95
|
|
47
48
|
/**
|
|
48
49
|
* The ledger events a successor, a seal or a provenance proof may be taken from (H1 of the 2026-10-25 review, SD1
|
|
49
50
|
* finding 2; A-SPEC-222.10 H-A, H-C, M-1): one port for every reader that needs trust, so none opens the ledger itself.
|
|
@@ -269,6 +270,29 @@ function trustedActor(e) {
|
|
|
269
270
|
const a = typeof e.authorization === 'string' ? e.authorization : '';
|
|
270
271
|
return a.startsWith(`${actor}:`) && /^[0-9a-f]{12}$/.test(a.slice(actor.length + 1)) && !/(?:^|:)unattested:/.test(a);
|
|
271
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* @implements A-SPEC-794.95 (B-M2) — trustedLedgerEvents over the real ledger, remembered in this process while every
|
|
275
|
+
* ledger file keeps its size and modification time and HEAD stays the same commit (a hook judging several things, and
|
|
276
|
+
* the MCP server, read it once). Nothing is kept on disk: a cache another process could write would forge seals.
|
|
277
|
+
*/
|
|
278
|
+
const trustedMemo = new Map();
|
|
279
|
+
function trustedLedgerEventsCached(root) {
|
|
280
|
+
let key;
|
|
281
|
+
try {
|
|
282
|
+
const dir = path.join(root, '.ax', 'ledger');
|
|
283
|
+
const files = fs.readdirSync(dir).filter((f) => f.endsWith('.jsonl')).sort();
|
|
284
|
+
key = files.map((f) => { const st = fs.statSync(path.join(dir, f)); return `${f}:${st.size}:${st.mtimeMs}`; }).join('|') + `|head:${headCommitOf(root) ?? ''}`;
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
return trustedLedgerEvents(root);
|
|
288
|
+
}
|
|
289
|
+
const hit = trustedMemo.get(root);
|
|
290
|
+
if (hit && hit.key === key)
|
|
291
|
+
return hit.value;
|
|
292
|
+
const value = trustedLedgerEvents(root);
|
|
293
|
+
trustedMemo.set(root, { key, value });
|
|
294
|
+
return value;
|
|
295
|
+
}
|
|
272
296
|
/** Every trusted event across the ledger's chains, and every event or chain that was ignored with its reason. */
|
|
273
297
|
function trustedLedgerEvents(root, deps = realTrustDeps(root)) {
|
|
274
298
|
const ignored = [];
|
|
@@ -30,6 +30,12 @@ export interface ClientRecord {
|
|
|
30
30
|
ts: string;
|
|
31
31
|
replica?: string;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* @implements A-SPEC-564.7 — the counting rule a usage record was made under. 564.5 changed usage/turns from per
|
|
35
|
+
* record to per response; a record without this marker is the old per-record count (about 2.7 times larger), and a
|
|
36
|
+
* reader must not add the two kinds together.
|
|
37
|
+
*/
|
|
38
|
+
export declare const USAGE_COUNT_RULE: "per-message-id";
|
|
33
39
|
export interface UsageRecord {
|
|
34
40
|
execution?: ExecutionContext;
|
|
35
41
|
kind: 'usage';
|
|
@@ -38,6 +44,7 @@ export interface UsageRecord {
|
|
|
38
44
|
usage: UsageTotals;
|
|
39
45
|
turns: number;
|
|
40
46
|
truncated?: boolean;
|
|
47
|
+
count?: typeof USAGE_COUNT_RULE;
|
|
41
48
|
ts: string;
|
|
42
49
|
replica?: string;
|
|
43
50
|
}
|
|
@@ -33,17 +33,24 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.USAGE_COUNT_RULE = void 0;
|
|
36
37
|
exports.sessionContextFilename = sessionContextFilename;
|
|
37
38
|
exports.isSessionContextFilename = isSessionContextFilename;
|
|
38
39
|
exports.appendSessionContext = appendSessionContext;
|
|
39
40
|
exports.readSessionContext = readSessionContext;
|
|
40
41
|
exports.makeSessionStamper = makeSessionStamper;
|
|
41
42
|
exports.summarizeTranscript = summarizeTranscript;
|
|
42
|
-
// @implements A-SPEC-564.1, A-SPEC-625
|
|
43
|
+
// @implements A-SPEC-564.1, A-SPEC-625, A-SPEC-564.5, A-SPEC-564.7
|
|
43
44
|
const execution_context_1 = require("../project/execution-context");
|
|
44
45
|
const fs = __importStar(require("node:fs"));
|
|
45
46
|
const path = __importStar(require("node:path"));
|
|
46
47
|
const replica_id_1 = require("./replica-id");
|
|
48
|
+
/**
|
|
49
|
+
* @implements A-SPEC-564.7 — the counting rule a usage record was made under. 564.5 changed usage/turns from per
|
|
50
|
+
* record to per response; a record without this marker is the old per-record count (about 2.7 times larger), and a
|
|
51
|
+
* reader must not add the two kinds together.
|
|
52
|
+
*/
|
|
53
|
+
exports.USAGE_COUNT_RULE = 'per-message-id';
|
|
47
54
|
const FILE_RE = /^session-context\.([^.]+)\.jsonl$/;
|
|
48
55
|
function sessionContextFilename(replica) {
|
|
49
56
|
return `session-context.${replica}.jsonl`;
|
|
@@ -169,6 +176,17 @@ function summarizeTranscript(lines, opts) {
|
|
|
169
176
|
let bytes = 0;
|
|
170
177
|
let truncated = false;
|
|
171
178
|
const num = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : 0);
|
|
179
|
+
const add = (u) => {
|
|
180
|
+
usage.input += u.input;
|
|
181
|
+
usage.output += u.output;
|
|
182
|
+
usage.cacheRead += u.cacheRead;
|
|
183
|
+
usage.cacheCreation += u.cacheCreation;
|
|
184
|
+
};
|
|
185
|
+
// @implements A-SPEC-564.5 — Claude Code writes one response as several records (one per content block), each
|
|
186
|
+
// carrying the same usage: counting records counted one response ~2.7 times. One per distinct message id now,
|
|
187
|
+
// from the line with the largest output (ties: the later line) — the rule of A-SPEC-564.4 D7. A usage line with
|
|
188
|
+
// no id (older or synthetic shapes) still counts on its own.
|
|
189
|
+
const byId = new Map();
|
|
172
190
|
for (const line of lines) {
|
|
173
191
|
bytes += line.length + 1;
|
|
174
192
|
if (bytes > maxBytes) {
|
|
@@ -185,13 +203,23 @@ function summarizeTranscript(lines, opts) {
|
|
|
185
203
|
}
|
|
186
204
|
if (!m || typeof m !== 'object' || !m.usage || typeof m.usage !== 'object')
|
|
187
205
|
continue;
|
|
188
|
-
turns += 1;
|
|
189
206
|
if (typeof m.model === 'string' && m.model !== '' && !models.includes(m.model))
|
|
190
207
|
models.push(m.model);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
208
|
+
const u = {
|
|
209
|
+
input: num(m.usage.input_tokens), output: num(m.usage.output_tokens),
|
|
210
|
+
cacheRead: num(m.usage.cache_read_input_tokens), cacheCreation: num(m.usage.cache_creation_input_tokens),
|
|
211
|
+
};
|
|
212
|
+
if (typeof m.id === 'string' && m.id !== '') {
|
|
213
|
+
const prev = byId.get(m.id);
|
|
214
|
+
if (prev === undefined || u.output >= prev.output)
|
|
215
|
+
byId.set(m.id, u);
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
turns += 1;
|
|
219
|
+
add(u);
|
|
195
220
|
}
|
|
221
|
+
for (const u of byId.values())
|
|
222
|
+
add(u);
|
|
223
|
+
turns += byId.size;
|
|
196
224
|
return { models, usage, turns, truncated };
|
|
197
225
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The anchor-scope refusal's text, in one place: the gate writes it, and the field report's tests produce it here
|
|
3
|
+
* instead of copying it by hand.
|
|
4
|
+
*/
|
|
5
|
+
export interface AnchorScopeFailure {
|
|
6
|
+
id: string;
|
|
7
|
+
reason: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function anchorScopeRefusal(relPath: string, failed: readonly AnchorScopeFailure[]): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.anchorScopeRefusal = anchorScopeRefusal;
|
|
4
|
+
function anchorScopeRefusal(relPath, failed) {
|
|
5
|
+
const each = failed.map((f) => `${relPath} is anchored to ${f.id} but falls outside its 'Files to Touch' scope (${f.reason})`).join('; ');
|
|
6
|
+
return `[Holmes-Kit] ${each} — extend that section first (spec edit is allowed), add it as a test under the anchored spec, or supply out-of-band approval`;
|
|
7
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export declare const NPM_TABLE: {
|
|
2
|
+
commands: string[];
|
|
3
|
+
aliases: Record<string, string>;
|
|
4
|
+
dryRun: string[];
|
|
5
|
+
};
|
|
6
|
+
/** The npm command a word names, as npm's `deref` resolves it; undefined when npm would not run one. */
|
|
7
|
+
export declare function npmCommand(word: string): string | undefined;
|
|
8
|
+
export declare function npmHonoursDryRun(command: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A registry write: `true` for a command that writes, or a group whose writing sub-subcommands are listed with the
|
|
11
|
+
* ones that only read (a missing sub-subcommand reads; any other word is closed as a write).
|
|
12
|
+
*/
|
|
13
|
+
export type WriteRule = true | {
|
|
14
|
+
writes: readonly string[];
|
|
15
|
+
reads: readonly string[];
|
|
16
|
+
};
|
|
17
|
+
/** npm's registry writes, by canonical command. */
|
|
18
|
+
export declare const NPM_WRITES: Readonly<Record<string, WriteRule>>;
|
|
19
|
+
/**
|
|
20
|
+
* The scripts an npm command runs, by canonical command (`run` runs the named one), and what `--ignore-scripts` skips
|
|
21
|
+
* (A-SPEC-794.71): for a script runner only the pre and post scripts (npm 11's run.js runs the named one), for a
|
|
22
|
+
* lifecycle command all of them. --dry-run skips none: run does not follow it, and publish runs prepublishOnly and
|
|
23
|
+
* postpublish under it (publish.js).
|
|
24
|
+
*/
|
|
25
|
+
export interface ScriptRun {
|
|
26
|
+
names: readonly string[] | 'named';
|
|
27
|
+
ignoreSkips: 'prepost' | 'all';
|
|
28
|
+
}
|
|
29
|
+
export declare const NPM_SCRIPT_RUNS: Readonly<Record<string, ScriptRun>>;
|
|
30
|
+
/** Sub-subcommands that follow --dry-run by inheritance: npm's StagePublish extends Publish (stage/publish.js). */
|
|
31
|
+
export declare const NPM_DRY_RUN_SUBCOMMANDS: Readonly<Record<string, readonly string[]>>;
|
|
32
|
+
/** Whether a dry flag is on, read with its value: `--dry-run`, `--dry-run=<v>`, `--no-dry-run`; the last one wins. */
|
|
33
|
+
export declare function dryFlagOn(args: readonly string[], flags: readonly string[]): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Programs whose arguments are data (A-SPEC-794.71): only these exempt their arguments. Any other program — an unknown
|
|
36
|
+
* wrapper included — is read again from the first registry token among its arguments.
|
|
37
|
+
*/
|
|
38
|
+
export declare const DATA_PROGRAMS: ReadonlySet<string>;
|
|
39
|
+
/** A-SPEC-794.74 — programs whose command-string positions are read (commandStrings); their other words are data. */
|
|
40
|
+
export declare const COMMAND_STRING_PROGRAMS: ReadonlySet<string>;
|
|
41
|
+
/** A-SPEC-794.74 — pnpm's names for a recursive run. */
|
|
42
|
+
export declare const PNPM_RECURSIVE: ReadonlySet<string>;
|
|
43
|
+
/** A release tool's own help and version flags: nothing is published. */
|
|
44
|
+
export declare const RELEASE_HELP: ReadonlySet<string>;
|
|
45
|
+
/** Program tokens that start a registry act when they appear among another program's arguments. */
|
|
46
|
+
export declare const REGISTRY_TOKENS: ReadonlySet<string>;
|
|
47
|
+
/** Options whose value is a command, by program; and programs whose positional arguments are commands. */
|
|
48
|
+
export declare const COMMAND_OPTIONS: Readonly<Record<string, readonly string[]>>;
|
|
49
|
+
export declare const POSITIONAL_COMMANDS: ReadonlySet<string>;
|
|
50
|
+
/** A package that runs a release tool's bin. */
|
|
51
|
+
export declare const PACKAGE_BINS: Readonly<Record<string, string>>;
|
|
52
|
+
/** A-SPEC-794.72 — the registry programs read as independent tokens in an unknown program's arguments. */
|
|
53
|
+
export declare const REGISTRY_PROGRAMS: ReadonlySet<string>;
|
|
54
|
+
/**
|
|
55
|
+
* A-SPEC-794.72 — programs that run the command after them: the subcommand they need, their valued options, the
|
|
56
|
+
* positional words before the command, whether `NAME=value` words come first, and the option after which the command
|
|
57
|
+
* starts. Push and publish share this one unwrapping.
|
|
58
|
+
*/
|
|
59
|
+
export interface Wrapper {
|
|
60
|
+
sub?: string | readonly string[];
|
|
61
|
+
valued?: readonly string[];
|
|
62
|
+
positionals?: number;
|
|
63
|
+
assigns?: boolean;
|
|
64
|
+
commandFlag?: readonly string[];
|
|
65
|
+
toolArgs?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare const WRAPPERS: Readonly<Record<string, Wrapper>>;
|
|
68
|
+
/** The command after a wrapper's own words, or null when the words do not run one. */
|
|
69
|
+
export declare function unwrapWith(w: Wrapper, args: readonly string[]): string[] | null;
|
|
70
|
+
/**
|
|
71
|
+
* A-SPEC-794.72 — the command strings a program runs, at the positions this table names. A string anywhere else is
|
|
72
|
+
* data. (Shells' -c, npx -c and npm exec -c are read where they were.)
|
|
73
|
+
*/
|
|
74
|
+
export declare function commandStrings(name: string, args: readonly string[]): string[];
|
|
75
|
+
/** Runners that run scripts of the current package by name (globs allowed). */
|
|
76
|
+
export declare const SCRIPT_NAME_RUNNERS: ReadonlySet<string>;
|
|
77
|
+
/** npm options before the subcommand that take the next word as their value. */
|
|
78
|
+
export declare const NPM_VALUED_OPTIONS: ReadonlySet<string>;
|
|
79
|
+
/** A-SPEC-794.75 — `yarn workspaces foreach`'s valued options before the command it runs. */
|
|
80
|
+
export declare const YARN_FOREACH_VALUED: ReadonlySet<string>;
|
|
81
|
+
/** yarn: its own registry writes (v1 and berry's `npm` group) and its own subcommands (never a script name). */
|
|
82
|
+
export declare const YARN_WRITES: Readonly<Record<string, WriteRule>>;
|
|
83
|
+
export declare const YARN_NPM_WRITES: Readonly<Record<string, WriteRule>>;
|
|
84
|
+
export declare function managerBuiltins(tool: string): ReadonlySet<string>;
|
|
85
|
+
/** Release tools that publish: their dry-run flags, and the subcommand they need when they have one. */
|
|
86
|
+
export interface ReleaseTool {
|
|
87
|
+
dry: readonly string[];
|
|
88
|
+
needs?: (args: readonly string[]) => boolean;
|
|
89
|
+
}
|
|
90
|
+
export declare const RELEASE_TOOLS: Readonly<Record<string, ReleaseTool>>;
|
|
91
|
+
/** Runners that run a package script by name in every package: the script names they run, or null. */
|
|
92
|
+
export declare function runnerScripts(name: string, args: readonly string[]): string[] | null;
|
|
93
|
+
/** Shells whose `-c` string is a command, and that read their program from stdin without one. */
|
|
94
|
+
export declare const SHELL_PROGRAMS: RegExp;
|
|
95
|
+
/** Interpreters whose inline or stdin program is another language. */
|
|
96
|
+
export declare const INTERPRETERS: RegExp;
|
|
97
|
+
/** Their flag for an inline program. */
|
|
98
|
+
export declare const INLINE_FLAGS: ReadonlySet<string>;
|
|
99
|
+
/** Environment variables whose value a program runs as a command. */
|
|
100
|
+
export declare const COMMAND_VARIABLES: ReadonlySet<string>;
|
|
101
|
+
/** Programs that run the package named by their first positional word (with its version stripped). */
|
|
102
|
+
export declare const PACKAGE_RUNNERS: ReadonlySet<string>;
|