codebase-snapshot 0.20.3 → 0.20.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 +108 -0
- package/README.md +1 -1
- package/dist/bin.js +1971 -939
- package/dist/{chunk-7JQRJBMP.js → chunk-C3WVC4FV.js} +1720 -850
- package/dist/{chunk-TUL3I7O6.js → chunk-HYTY6T7P.js} +147 -16
- package/dist/cli.cjs +2052 -1022
- package/dist/cli.d.cts +16 -2
- package/dist/cli.d.ts +16 -2
- package/dist/cli.js +103 -78
- package/dist/{generate-worker-C6Z1I0XS.d.cts → generate-worker-CNRsO_z7.d.cts} +4 -0
- package/dist/{generate-worker-C6Z1I0XS.d.ts → generate-worker-CNRsO_z7.d.ts} +4 -0
- package/dist/index.cjs +1714 -817
- package/dist/index.d.cts +38 -6
- package/dist/index.d.ts +38 -6
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +1157 -494
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{types-Drw1J0e0.d.cts → types-DnYsA6_Y.d.cts} +4 -0
- package/dist/{types-Drw1J0e0.d.ts → types-DnYsA6_Y.d.ts} +4 -0
- package/docs/brief.md +5 -0
- package/docs/cli.md +5 -5
- package/docs/configuration.md +5 -0
- package/docs/deploy.md +2 -2
- package/docs/mcp.md +11 -4
- package/docs/security-review.md +42 -4
- package/docs/serve.md +8 -4
- package/docs/workspace.md +3 -0
- package/package.json +1 -1
package/dist/cli.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-
|
|
1
|
+
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, C as CliOptions, R as ResolvedSnapshotConfig } from './types-DnYsA6_Y.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The machine-readable description of this tool.
|
|
@@ -460,6 +460,8 @@ declare function parsePositiveInteger(raw: string | undefined, optionName: strin
|
|
|
460
460
|
* as well as raw byte counts.
|
|
461
461
|
*/
|
|
462
462
|
declare function parseByteOption(raw: string | undefined, optionName: string, minimum: number, unit?: string): number | undefined;
|
|
463
|
+
/** Parses a TCP port, where 0 is the documented "pick an ephemeral port" value. */
|
|
464
|
+
declare function parsePort(raw: string | undefined): number | undefined;
|
|
463
465
|
/**
|
|
464
466
|
* Parses a whole-number option such as `--attachment-slots 20`.
|
|
465
467
|
*
|
|
@@ -495,6 +497,18 @@ declare function cleanInstallEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
|
495
497
|
* to the payload, and a JSON consumer must never have to parse a suggestion.
|
|
496
498
|
*/
|
|
497
499
|
declare function main(argv?: string[]): Promise<number>;
|
|
500
|
+
/** The command itself. Every early return here is a finished invocation. */
|
|
501
|
+
/**
|
|
502
|
+
* The generate-scoped options a CLI invocation carries.
|
|
503
|
+
*
|
|
504
|
+
* runCommand built this object by hand and runWatchLoop built a second, shorter copy. Every flag
|
|
505
|
+
* added after the watch loop was written worked once and disappeared on the first file edit:
|
|
506
|
+
* --only, --strip-comments, --token-tree, --include-diffs, --include-logs, --pack and --sign.
|
|
507
|
+
* One builder makes the two paths agree by construction.
|
|
508
|
+
*/
|
|
509
|
+
declare function generateCliOptions(invocation: ParsedInvocation): Partial<CliOptions> & {
|
|
510
|
+
discovery?: DiscoveryMode;
|
|
511
|
+
};
|
|
498
512
|
/** Coalesce bursts of filesystem events into one run. */
|
|
499
513
|
declare const WATCH_DEBOUNCE_MS = 250;
|
|
500
514
|
/**
|
|
@@ -574,4 +588,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
|
|
|
574
588
|
*/
|
|
575
589
|
declare function watchSupportProblem(platform?: string, version?: string): string | null;
|
|
576
590
|
|
|
577
|
-
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|
|
591
|
+
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, generateCliOptions, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePort, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-
|
|
1
|
+
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, C as CliOptions, R as ResolvedSnapshotConfig } from './types-DnYsA6_Y.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The machine-readable description of this tool.
|
|
@@ -460,6 +460,8 @@ declare function parsePositiveInteger(raw: string | undefined, optionName: strin
|
|
|
460
460
|
* as well as raw byte counts.
|
|
461
461
|
*/
|
|
462
462
|
declare function parseByteOption(raw: string | undefined, optionName: string, minimum: number, unit?: string): number | undefined;
|
|
463
|
+
/** Parses a TCP port, where 0 is the documented "pick an ephemeral port" value. */
|
|
464
|
+
declare function parsePort(raw: string | undefined): number | undefined;
|
|
463
465
|
/**
|
|
464
466
|
* Parses a whole-number option such as `--attachment-slots 20`.
|
|
465
467
|
*
|
|
@@ -495,6 +497,18 @@ declare function cleanInstallEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
|
495
497
|
* to the payload, and a JSON consumer must never have to parse a suggestion.
|
|
496
498
|
*/
|
|
497
499
|
declare function main(argv?: string[]): Promise<number>;
|
|
500
|
+
/** The command itself. Every early return here is a finished invocation. */
|
|
501
|
+
/**
|
|
502
|
+
* The generate-scoped options a CLI invocation carries.
|
|
503
|
+
*
|
|
504
|
+
* runCommand built this object by hand and runWatchLoop built a second, shorter copy. Every flag
|
|
505
|
+
* added after the watch loop was written worked once and disappeared on the first file edit:
|
|
506
|
+
* --only, --strip-comments, --token-tree, --include-diffs, --include-logs, --pack and --sign.
|
|
507
|
+
* One builder makes the two paths agree by construction.
|
|
508
|
+
*/
|
|
509
|
+
declare function generateCliOptions(invocation: ParsedInvocation): Partial<CliOptions> & {
|
|
510
|
+
discovery?: DiscoveryMode;
|
|
511
|
+
};
|
|
498
512
|
/** Coalesce bursts of filesystem events into one run. */
|
|
499
513
|
declare const WATCH_DEBOUNCE_MS = 250;
|
|
500
514
|
/**
|
|
@@ -574,4 +588,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
|
|
|
574
588
|
*/
|
|
575
589
|
declare function watchSupportProblem(platform?: string, version?: string): string | null;
|
|
576
590
|
|
|
577
|
-
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|
|
591
|
+
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, generateCliOptions, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePort, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { startHttpTransport } from './chunk-
|
|
2
|
-
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, buildAgentContract, startWebServer, runStdioServer, parseRemoteSource, assertPublicHost, cloneRepository, makeCloneDirectory, loadConfigFileDetailed, resolveConfig, validateSnapshot, auditSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, getGitInfo,
|
|
3
|
-
export { buildAgentContract } from './chunk-
|
|
1
|
+
import { startHttpTransport } from './chunk-HYTY6T7P.js';
|
|
2
|
+
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, buildAgentContract, startWebServer, runStdioServer, parseRemoteSource, assertPublicHost, cloneRepository, makeCloneDirectory, loadConfigFileDetailed, resolveConfig, validateSnapshot, auditSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, getGitInfo, loadSigningKey, SIGNATURE_FILE, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, COMMAND_OPTION_SCOPE, commandsForOption, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, SKILL_NAME, renderSkill, resolveLatest, isNewer, updateCommand, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, runWithStdoutCapture, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderContractText, renderExplainText } from './chunk-C3WVC4FV.js';
|
|
3
|
+
export { buildAgentContract } from './chunk-C3WVC4FV.js';
|
|
4
4
|
import { spawnSync } from 'child_process';
|
|
5
5
|
import * as fs2 from 'fs';
|
|
6
6
|
import * as path2 from 'path';
|
|
@@ -341,6 +341,13 @@ function parseByteOption(raw, optionName, minimum, unit = "byte count") {
|
|
|
341
341
|
}
|
|
342
342
|
return value;
|
|
343
343
|
}
|
|
344
|
+
function parsePort(raw) {
|
|
345
|
+
const value = parsePositiveInteger(raw, "port", 0);
|
|
346
|
+
if (value !== void 0 && value > 65535) {
|
|
347
|
+
throw new UsageError(`--port must be at most 65535, received "${raw}".`);
|
|
348
|
+
}
|
|
349
|
+
return value;
|
|
350
|
+
}
|
|
344
351
|
function parseCountOption(raw, optionName, minimum = 0) {
|
|
345
352
|
if (raw === void 0) return void 0;
|
|
346
353
|
const trimmed = raw.trim();
|
|
@@ -629,7 +636,7 @@ function parseCliArgs(argv) {
|
|
|
629
636
|
sarif: values.sarif === true ? true : void 0,
|
|
630
637
|
strict: values.strict === true ? true : void 0,
|
|
631
638
|
http: values.http === true ? true : void 0,
|
|
632
|
-
port:
|
|
639
|
+
port: parsePort(values.port),
|
|
633
640
|
host: values.host === void 0 ? void 0 : String(values.host),
|
|
634
641
|
token: values.token === void 0 ? void 0 : String(values.token),
|
|
635
642
|
noAuth: values["no-auth"] === true ? true : void 0,
|
|
@@ -1210,6 +1217,42 @@ ${formatUpdateNotice(notice, installKind())}
|
|
|
1210
1217
|
}
|
|
1211
1218
|
return code;
|
|
1212
1219
|
}
|
|
1220
|
+
function generateCliOptions(invocation) {
|
|
1221
|
+
return {
|
|
1222
|
+
mode: invocation.command,
|
|
1223
|
+
format: invocation.format,
|
|
1224
|
+
dryRun: invocation.dryRun,
|
|
1225
|
+
cwd: invocation.cwd,
|
|
1226
|
+
outDir: invocation.outDir,
|
|
1227
|
+
includeMonolith: invocation.includeMonolith,
|
|
1228
|
+
includeSensitiveFiles: invocation.includeSensitiveFiles,
|
|
1229
|
+
maxPartBytes: invocation.maxPartBytes,
|
|
1230
|
+
maxPartTokens: invocation.maxPartTokens,
|
|
1231
|
+
largeFileBytes: invocation.largeFileBytes,
|
|
1232
|
+
maxMonolithBytes: invocation.maxMonolithBytes,
|
|
1233
|
+
attachmentSlots: invocation.attachmentSlots,
|
|
1234
|
+
maxParts: invocation.maxParts,
|
|
1235
|
+
...invocation.includeDiffs === true ? { includeDiffs: true } : {},
|
|
1236
|
+
...invocation.includeLogs === void 0 ? {} : { includeLogs: invocation.includeLogs },
|
|
1237
|
+
...invocation.tokenTree === true ? { tokenTree: true } : {},
|
|
1238
|
+
...invocation.stripComments === true ? { stripComments: true } : {},
|
|
1239
|
+
...invocation.removeEmptyLines === true ? { removeEmptyLines: true } : {},
|
|
1240
|
+
...invocation.only === void 0 ? {} : { only: invocation.only },
|
|
1241
|
+
...invocation.ignore === void 0 ? {} : { ignore: invocation.ignore },
|
|
1242
|
+
...invocation.pack === void 0 ? {} : { pack: invocation.pack },
|
|
1243
|
+
...invocation.sign === true ? { sign: true } : {},
|
|
1244
|
+
brief: invocation.brief,
|
|
1245
|
+
promptTask: invocation.promptTask,
|
|
1246
|
+
skipArtifacts: invocation.skipArtifacts,
|
|
1247
|
+
onlyArtifacts: invocation.onlyArtifacts,
|
|
1248
|
+
discovery: invocation.discovery,
|
|
1249
|
+
changedSince: invocation.changedSince,
|
|
1250
|
+
staged: invocation.staged,
|
|
1251
|
+
withDependents: invocation.withDependents,
|
|
1252
|
+
skeleton: invocation.skeleton,
|
|
1253
|
+
sarif: invocation.sarif
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1213
1256
|
async function runCommand(argv) {
|
|
1214
1257
|
let invocation;
|
|
1215
1258
|
try {
|
|
@@ -1363,42 +1406,7 @@ ${USAGE}
|
|
|
1363
1406
|
try {
|
|
1364
1407
|
resolved = resolveConfig(
|
|
1365
1408
|
loaded.config,
|
|
1366
|
-
|
|
1367
|
-
mode: invocation.command,
|
|
1368
|
-
format: invocation.format,
|
|
1369
|
-
dryRun: invocation.dryRun,
|
|
1370
|
-
cwd: invocation.cwd,
|
|
1371
|
-
outDir: invocation.outDir,
|
|
1372
|
-
includeMonolith: invocation.includeMonolith,
|
|
1373
|
-
includeSensitiveFiles: invocation.includeSensitiveFiles,
|
|
1374
|
-
maxPartBytes: invocation.maxPartBytes,
|
|
1375
|
-
maxPartTokens: invocation.maxPartTokens,
|
|
1376
|
-
largeFileBytes: invocation.largeFileBytes,
|
|
1377
|
-
maxMonolithBytes: invocation.maxMonolithBytes,
|
|
1378
|
-
attachmentSlots: invocation.attachmentSlots,
|
|
1379
|
-
maxParts: invocation.maxParts,
|
|
1380
|
-
...invocation.includeDiffs === true ? { includeDiffs: true } : {},
|
|
1381
|
-
...invocation.includeLogs === void 0 ? {} : { includeLogs: invocation.includeLogs },
|
|
1382
|
-
...invocation.tokenTree === true ? { tokenTree: true } : {},
|
|
1383
|
-
...invocation.stripComments === true ? { stripComments: true } : {},
|
|
1384
|
-
...invocation.removeEmptyLines === true ? { removeEmptyLines: true } : {},
|
|
1385
|
-
...invocation.only === void 0 ? {} : { only: invocation.only },
|
|
1386
|
-
...invocation.ignore === void 0 ? {} : { ignore: invocation.ignore },
|
|
1387
|
-
...invocation.pack === void 0 ? {} : { pack: invocation.pack },
|
|
1388
|
-
brief: invocation.brief,
|
|
1389
|
-
promptTask: invocation.promptTask,
|
|
1390
|
-
skipArtifacts: invocation.skipArtifacts,
|
|
1391
|
-
// `--only-artifacts` is forwarded as itself, not only as the derived suppression list:
|
|
1392
|
-
// suppression cannot switch an artifact *on*, so a config that had turned one of the
|
|
1393
|
-
// requested artifacts off left the run with nothing to write.
|
|
1394
|
-
onlyArtifacts: invocation.onlyArtifacts,
|
|
1395
|
-
discovery: invocation.discovery,
|
|
1396
|
-
changedSince: invocation.changedSince,
|
|
1397
|
-
staged: invocation.staged,
|
|
1398
|
-
withDependents: invocation.withDependents,
|
|
1399
|
-
skeleton: invocation.skeleton,
|
|
1400
|
-
sarif: invocation.sarif
|
|
1401
|
-
},
|
|
1409
|
+
generateCliOptions(invocation),
|
|
1402
1410
|
invocation.cwd
|
|
1403
1411
|
);
|
|
1404
1412
|
} catch (err) {
|
|
@@ -1434,7 +1442,11 @@ ${USAGE}
|
|
|
1434
1442
|
rows.push({ name, score: 0, counts: { pass: 0, warn: 0, fail: 1 }, failed: [], error: "no snapshot at " + snapshotDir2 });
|
|
1435
1443
|
continue;
|
|
1436
1444
|
}
|
|
1437
|
-
const report2 = auditSnapshot({
|
|
1445
|
+
const report2 = auditSnapshot({
|
|
1446
|
+
snapshotDir: snapshotDir2,
|
|
1447
|
+
repoDir,
|
|
1448
|
+
...invocation.deep === true ? { deep: true } : {}
|
|
1449
|
+
});
|
|
1438
1450
|
rows.push({
|
|
1439
1451
|
name,
|
|
1440
1452
|
score: report2.score,
|
|
@@ -1576,6 +1588,12 @@ ${USAGE}
|
|
|
1576
1588
|
if (invocation.watch) {
|
|
1577
1589
|
const problem = watchSupportProblem();
|
|
1578
1590
|
if (problem !== null) return fail(invocation.format, problem);
|
|
1591
|
+
if (invocation.delta !== void 0) {
|
|
1592
|
+
return fail(
|
|
1593
|
+
invocation.format,
|
|
1594
|
+
"--watch cannot track a fixed --delta base; run a one-shot generate --delta, or watch without it."
|
|
1595
|
+
);
|
|
1596
|
+
}
|
|
1579
1597
|
}
|
|
1580
1598
|
if (invocation.workspace !== void 0) {
|
|
1581
1599
|
const members = invocation.workspace.split(",").map((member) => member.trim()).filter((member) => member.length > 0);
|
|
@@ -1587,6 +1605,14 @@ ${USAGE}
|
|
|
1587
1605
|
);
|
|
1588
1606
|
}
|
|
1589
1607
|
const outRoot = path2.resolve(invocation.cwd, invocation.outDir ?? "snapshot");
|
|
1608
|
+
const workspaceCwd = path2.resolve(invocation.cwd);
|
|
1609
|
+
const outRootRelative = path2.relative(outRoot, workspaceCwd);
|
|
1610
|
+
if (outRootRelative === "" || !outRootRelative.startsWith("..") && !path2.isAbsolute(outRootRelative)) {
|
|
1611
|
+
return fail(
|
|
1612
|
+
invocation.format,
|
|
1613
|
+
`--workspace refuses --out-dir ${outRoot}: it is the working directory or one of its ancestors.`
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1590
1616
|
const records = [];
|
|
1591
1617
|
let failed = 0;
|
|
1592
1618
|
for (const member of members) {
|
|
@@ -1606,7 +1632,10 @@ ${USAGE}
|
|
|
1606
1632
|
continue;
|
|
1607
1633
|
}
|
|
1608
1634
|
try {
|
|
1609
|
-
const manifest = generateSnapshot(
|
|
1635
|
+
const manifest = generateSnapshot(
|
|
1636
|
+
{ cwd: directory, outDir: path2.join(outRoot, name) },
|
|
1637
|
+
{ dryRun: invocation.dryRun }
|
|
1638
|
+
);
|
|
1610
1639
|
records.push({
|
|
1611
1640
|
name,
|
|
1612
1641
|
path: directory,
|
|
@@ -1622,7 +1651,7 @@ ${USAGE}
|
|
|
1622
1651
|
failed += 1;
|
|
1623
1652
|
}
|
|
1624
1653
|
}
|
|
1625
|
-
fs2.mkdirSync(outRoot, { recursive: true });
|
|
1654
|
+
if (!invocation.dryRun) fs2.mkdirSync(outRoot, { recursive: true });
|
|
1626
1655
|
const links = [];
|
|
1627
1656
|
for (const record of records) {
|
|
1628
1657
|
const counts = /* @__PURE__ */ new Map();
|
|
@@ -1652,9 +1681,17 @@ ${USAGE}
|
|
|
1652
1681
|
members: records.map(({ imports: _imports, ...rest }) => rest),
|
|
1653
1682
|
links
|
|
1654
1683
|
};
|
|
1655
|
-
|
|
1684
|
+
if (!invocation.dryRun) {
|
|
1685
|
+
fs2.writeFileSync(
|
|
1686
|
+
path2.join(outRoot, "WORKSPACE.json"),
|
|
1687
|
+
JSON.stringify(document, null, 2) + "\n",
|
|
1688
|
+
"utf8"
|
|
1689
|
+
);
|
|
1690
|
+
}
|
|
1656
1691
|
emit(invocation.format, document, () => {
|
|
1657
|
-
info(
|
|
1692
|
+
info(
|
|
1693
|
+
"\n\u{1F5C2} Workspace: " + records.length + " of " + members.length + (invocation.dryRun ? " member(s) planned; nothing was written." : " member(s) written under " + outRoot)
|
|
1694
|
+
);
|
|
1658
1695
|
for (const record of records) {
|
|
1659
1696
|
info(" - " + record.name + " (" + record.fingerprint.slice(0, 12) + ")");
|
|
1660
1697
|
}
|
|
@@ -1701,16 +1738,18 @@ ${USAGE}
|
|
|
1701
1738
|
question: invocation.slice,
|
|
1702
1739
|
...invocation.sliceTokens === void 0 ? {} : { maxTokens: invocation.sliceTokens }
|
|
1703
1740
|
}
|
|
1704
|
-
}
|
|
1741
|
+
},
|
|
1742
|
+
...invocation.sign === true && !invocation.dryRun ? { sign: { key: loadSigningKey() } } : {}
|
|
1705
1743
|
});
|
|
1706
1744
|
if (invocation.sign === true && !invocation.dryRun) {
|
|
1707
|
-
const
|
|
1745
|
+
const signaturePath = path2.resolve(resolved.cwd, resolved.outDir, SIGNATURE_FILE);
|
|
1708
1746
|
try {
|
|
1709
|
-
const record =
|
|
1710
|
-
|
|
1711
|
-
|
|
1747
|
+
const record = JSON.parse(fs2.readFileSync(signaturePath, "utf8"));
|
|
1748
|
+
info(
|
|
1749
|
+
" Signature: ed25519, " + (record.keyOrigin ?? "unknown") + " key, " + (record.fingerprint ?? manifest.fingerprint).slice(0, 12)
|
|
1750
|
+
);
|
|
1712
1751
|
} catch (error) {
|
|
1713
|
-
return fail(invocation.format, "
|
|
1752
|
+
return fail(invocation.format, "The snapshot was written but its signature could not be read: " + error.message);
|
|
1714
1753
|
}
|
|
1715
1754
|
}
|
|
1716
1755
|
const elapsed = ((performance.now() - started) / 1e3).toFixed(2);
|
|
@@ -1938,34 +1977,20 @@ async function runWatchLoop(invocation, resolved, options) {
|
|
|
1938
1977
|
for (const warning of loaded.warnings) warn(`\u26A0 Config: ${warning}`);
|
|
1939
1978
|
const next = resolveConfig(
|
|
1940
1979
|
loaded.config,
|
|
1941
|
-
|
|
1942
|
-
mode: invocation.command,
|
|
1943
|
-
format: invocation.format,
|
|
1944
|
-
dryRun: invocation.dryRun,
|
|
1945
|
-
cwd: invocation.cwd,
|
|
1946
|
-
outDir: invocation.outDir,
|
|
1947
|
-
includeMonolith: invocation.includeMonolith,
|
|
1948
|
-
includeSensitiveFiles: invocation.includeSensitiveFiles,
|
|
1949
|
-
maxPartBytes: invocation.maxPartBytes,
|
|
1950
|
-
maxPartTokens: invocation.maxPartTokens,
|
|
1951
|
-
largeFileBytes: invocation.largeFileBytes,
|
|
1952
|
-
maxMonolithBytes: invocation.maxMonolithBytes,
|
|
1953
|
-
attachmentSlots: invocation.attachmentSlots,
|
|
1954
|
-
maxParts: invocation.maxParts,
|
|
1955
|
-
brief: invocation.brief,
|
|
1956
|
-
promptTask: invocation.promptTask,
|
|
1957
|
-
skipArtifacts: invocation.skipArtifacts,
|
|
1958
|
-
onlyArtifacts: invocation.onlyArtifacts,
|
|
1959
|
-
discovery: invocation.discovery,
|
|
1960
|
-
changedSince: invocation.changedSince,
|
|
1961
|
-
staged: invocation.staged,
|
|
1962
|
-
withDependents: invocation.withDependents,
|
|
1963
|
-
skeleton: invocation.skeleton,
|
|
1964
|
-
sarif: invocation.sarif
|
|
1965
|
-
},
|
|
1980
|
+
generateCliOptions(invocation),
|
|
1966
1981
|
invocation.cwd
|
|
1967
1982
|
);
|
|
1968
|
-
const manifest = generateSnapshot(next, {
|
|
1983
|
+
const manifest = generateSnapshot(next, {
|
|
1984
|
+
dryRun: invocation.dryRun,
|
|
1985
|
+
...invocation.budgetTokens === void 0 ? {} : { budgetTokens: invocation.budgetTokens },
|
|
1986
|
+
...invocation.slice === void 0 ? {} : {
|
|
1987
|
+
slice: {
|
|
1988
|
+
question: invocation.slice,
|
|
1989
|
+
...invocation.sliceTokens === void 0 ? {} : { maxTokens: invocation.sliceTokens }
|
|
1990
|
+
}
|
|
1991
|
+
},
|
|
1992
|
+
...invocation.sign === true && !invocation.dryRun ? { sign: { key: loadSigningKey() } } : {}
|
|
1993
|
+
});
|
|
1969
1994
|
paths = watchPathsFor(next);
|
|
1970
1995
|
const elapsed = ((performance.now() - started) / 1e3).toFixed(2);
|
|
1971
1996
|
info(
|
|
@@ -2040,4 +2065,4 @@ if (invokedDirectly) {
|
|
|
2040
2065
|
);
|
|
2041
2066
|
}
|
|
2042
2067
|
|
|
2043
|
-
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, beginWatchRun, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|
|
2068
|
+
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, beginWatchRun, cleanInstallEnv, decideWatchEvent, finishWatchRun, generateCliOptions, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePort, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|
|
@@ -96,6 +96,10 @@ declare function generateInWorker(cwd: string, cliOptions: WorkspaceCliOptions,
|
|
|
96
96
|
};
|
|
97
97
|
budgetTokens?: number;
|
|
98
98
|
};
|
|
99
|
+
/** Identity the parent can name when the worker is terminated mid-run. */
|
|
100
|
+
runId?: string;
|
|
101
|
+
/** Directories whose locks/staging this run may own; used only for abandoned-worker cleanup. */
|
|
102
|
+
lockRoots?: readonly string[];
|
|
99
103
|
}): Promise<WorkerResults>;
|
|
100
104
|
|
|
101
105
|
export { type GenerateSummary as G, type WorkerResults as W, generateInWorker as g, workerEntry as w };
|
|
@@ -96,6 +96,10 @@ declare function generateInWorker(cwd: string, cliOptions: WorkspaceCliOptions,
|
|
|
96
96
|
};
|
|
97
97
|
budgetTokens?: number;
|
|
98
98
|
};
|
|
99
|
+
/** Identity the parent can name when the worker is terminated mid-run. */
|
|
100
|
+
runId?: string;
|
|
101
|
+
/** Directories whose locks/staging this run may own; used only for abandoned-worker cleanup. */
|
|
102
|
+
lockRoots?: readonly string[];
|
|
99
103
|
}): Promise<WorkerResults>;
|
|
100
104
|
|
|
101
105
|
export { type GenerateSummary as G, type WorkerResults as W, generateInWorker as g, workerEntry as w };
|