truecourse 0.6.0-next.2 → 0.6.0-next.4
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/cli.mjs +59 -22
- package/package.json +1 -1
- package/server.mjs +1 -1
package/cli.mjs
CHANGED
|
@@ -128242,7 +128242,7 @@ function readToolVersion() {
|
|
|
128242
128242
|
if (cachedVersion)
|
|
128243
128243
|
return cachedVersion;
|
|
128244
128244
|
if (true) {
|
|
128245
|
-
cachedVersion = "0.6.0-next.
|
|
128245
|
+
cachedVersion = "0.6.0-next.4";
|
|
128246
128246
|
return cachedVersion;
|
|
128247
128247
|
}
|
|
128248
128248
|
try {
|
|
@@ -149105,12 +149105,14 @@ async function runContractsGenerate(options = {}) {
|
|
|
149105
149105
|
const extractModel = resolveModel("contract.extract", void 0, repoRoot5);
|
|
149106
149106
|
const repairModel = resolveModel("contract.repair", void 0, repoRoot5);
|
|
149107
149107
|
const fallbackModel = resolveFallbackModel(repoRoot5) ?? void 0;
|
|
149108
|
+
let totalSlices = 0;
|
|
149109
|
+
let sliceNum = 0;
|
|
149108
149110
|
const runner = spawnRunner2({
|
|
149109
149111
|
concurrency,
|
|
149110
149112
|
model: extractModel,
|
|
149111
149113
|
fallbackModel,
|
|
149112
149114
|
onSliceStart: (s) => {
|
|
149113
|
-
O2.step(`extracting ${s.specPath} :: ${s.headingPath.join(" \u2192 ")}`);
|
|
149115
|
+
O2.step(`extracting ${++sliceNum}/${totalSlices} ${s.specPath} :: ${s.headingPath.join(" \u2192 ")}`);
|
|
149114
149116
|
}
|
|
149115
149117
|
});
|
|
149116
149118
|
let result;
|
|
@@ -149120,8 +149122,11 @@ async function runContractsGenerate(options = {}) {
|
|
|
149120
149122
|
runner,
|
|
149121
149123
|
models: { extract: extractModel, repair: repairModel, fallback: fallbackModel },
|
|
149122
149124
|
dryRun: !!options.diff,
|
|
149125
|
+
onSlicesReady: (t2) => {
|
|
149126
|
+
totalSlices = t2;
|
|
149127
|
+
},
|
|
149123
149128
|
onSliceCacheHit: (s) => {
|
|
149124
|
-
O2.message(` cache hit ${s.specPath} :: ${s.headingPath.join(" \u2192 ")}`, { symbol: "\xB7" });
|
|
149129
|
+
O2.message(` cache hit ${++sliceNum}/${totalSlices} ${s.specPath} :: ${s.headingPath.join(" \u2192 ")}`, { symbol: "\xB7" });
|
|
149125
149130
|
}
|
|
149126
149131
|
});
|
|
149127
149132
|
} catch (e) {
|
|
@@ -149166,7 +149171,7 @@ async function runContractsGenerate(options = {}) {
|
|
|
149166
149171
|
}
|
|
149167
149172
|
stampGeneratedMarker(repoRoot5);
|
|
149168
149173
|
if (result.write.written.length === 0) {
|
|
149169
|
-
gt("Up to date \u2014
|
|
149174
|
+
gt("Up to date \u2014 run `truecourse verify`.");
|
|
149170
149175
|
return;
|
|
149171
149176
|
}
|
|
149172
149177
|
O2.success(`Wrote ${result.write.written.length} contract file${result.write.written.length === 1 ? "" : "s"}.`);
|
|
@@ -149197,7 +149202,7 @@ async function runContractsList(options = {}) {
|
|
|
149197
149202
|
}
|
|
149198
149203
|
mt(`Contracts (${files.length})`);
|
|
149199
149204
|
for (const f2 of files) console.log(` ${path54.relative(repoRoot5, f2)}`);
|
|
149200
|
-
gt("");
|
|
149205
|
+
gt("`truecourse contracts validate` then `truecourse verify`.");
|
|
149201
149206
|
}
|
|
149202
149207
|
async function runContractsValidate(options = {}) {
|
|
149203
149208
|
const repoRoot5 = options.cwd ?? process.cwd();
|
|
@@ -149233,6 +149238,7 @@ async function runContractsValidate(options = {}) {
|
|
|
149233
149238
|
}
|
|
149234
149239
|
if (issues.length === 0) {
|
|
149235
149240
|
O2.success(`Validated ${resolution.index.size} artifact${resolution.index.size === 1 ? "" : "s"} \u2014 no issues.`);
|
|
149241
|
+
gt("Run `truecourse verify`.");
|
|
149236
149242
|
return;
|
|
149237
149243
|
}
|
|
149238
149244
|
O2.error(`${issues.length} issue${issues.length === 1 ? "" : "s"}:`);
|
|
@@ -149354,7 +149360,9 @@ async function runSpecScan(opts = {}) {
|
|
|
149354
149360
|
O2.message(' truecourse spec conflicts custom <id> --text "\u2026"');
|
|
149355
149361
|
O2.message(" \u2022 accept defaults: truecourse spec resolve --all-defaults");
|
|
149356
149362
|
}
|
|
149357
|
-
gt(
|
|
149363
|
+
gt(
|
|
149364
|
+
merge2.openConflicts.length === 0 ? "No open conflicts \u2014 run `truecourse contracts generate`." : `${merge2.openConflicts.length} open.`
|
|
149365
|
+
);
|
|
149358
149366
|
} catch (e) {
|
|
149359
149367
|
renderer.dispose();
|
|
149360
149368
|
pt(`Failed: ${e.message}`);
|
|
@@ -149405,7 +149413,9 @@ async function runSpecStatus(opts = {}) {
|
|
|
149405
149413
|
O2.message("");
|
|
149406
149414
|
summarizeConflicts("Open", merge2.openConflicts);
|
|
149407
149415
|
}
|
|
149408
|
-
gt(
|
|
149416
|
+
gt(
|
|
149417
|
+
merge2.openConflicts.length === 0 ? "Up to date \u2014 run `truecourse contracts generate`." : "Pending decisions \u2014 see `truecourse spec conflicts list`."
|
|
149418
|
+
);
|
|
149409
149419
|
} catch (e) {
|
|
149410
149420
|
renderer.dispose();
|
|
149411
149421
|
pt(`Failed: ${e.message}`);
|
|
@@ -149571,7 +149581,7 @@ async function runSpecConflictsList(opts = {}) {
|
|
|
149571
149581
|
for (const c2 of list) {
|
|
149572
149582
|
O2.message(` \u2022 ${c2.id} [${c2.topic}] ${c2.subject} (${c2.candidates.length} candidates)`);
|
|
149573
149583
|
}
|
|
149574
|
-
gt(
|
|
149584
|
+
gt('`show <id>` for detail \xB7 resolve with `pick <id> <n>` or `custom <id> --text "\u2026"`.');
|
|
149575
149585
|
}
|
|
149576
149586
|
async function runSpecConflictsShow(conflictId2, opts = {}) {
|
|
149577
149587
|
const root = repoRoot2(opts);
|
|
@@ -149605,7 +149615,10 @@ async function runSpecConflictsShow(conflictId2, opts = {}) {
|
|
|
149605
149615
|
if (diffs.length > 12) O2.message(` \u2026 and ${diffs.length - 12} more`);
|
|
149606
149616
|
}
|
|
149607
149617
|
}
|
|
149608
|
-
|
|
149618
|
+
if (!opts.diff) O2.message("add --diff to see field-level differences.");
|
|
149619
|
+
gt(
|
|
149620
|
+
`resolve: truecourse spec conflicts pick ${conflict.id} <n> \xB7 custom ${conflict.id} --text "\u2026"`
|
|
149621
|
+
);
|
|
149609
149622
|
}
|
|
149610
149623
|
async function runSpecConflictsPick(conflictId2, candidateIndex, opts = {}) {
|
|
149611
149624
|
const root = repoRoot2(opts);
|
|
@@ -149624,7 +149637,10 @@ async function runSpecConflictsPick(conflictId2, candidateIndex, opts = {}) {
|
|
|
149624
149637
|
note: opts.note
|
|
149625
149638
|
});
|
|
149626
149639
|
await refreshScan(root);
|
|
149627
|
-
emitOk(
|
|
149640
|
+
emitOk(
|
|
149641
|
+
`Picked candidate ${candidateIndex} on ${conflictId2.slice(0, 12)}\u2026`,
|
|
149642
|
+
"next: resolve remaining (`truecourse spec conflicts list`) or `truecourse contracts generate`."
|
|
149643
|
+
);
|
|
149628
149644
|
}
|
|
149629
149645
|
async function runSpecConflictsCustom(conflictId2, text, opts = {}) {
|
|
149630
149646
|
const root = repoRoot2(opts);
|
|
@@ -149640,13 +149656,19 @@ async function runSpecConflictsCustom(conflictId2, text, opts = {}) {
|
|
|
149640
149656
|
candidateFingerprint: candidateFingerprint(conflict)
|
|
149641
149657
|
});
|
|
149642
149658
|
await refreshScan(root);
|
|
149643
|
-
emitOk(
|
|
149659
|
+
emitOk(
|
|
149660
|
+
`Wrote custom answer for ${conflictId2.slice(0, 12)}\u2026`,
|
|
149661
|
+
"next: resolve remaining (`truecourse spec conflicts list`) or `truecourse contracts generate`."
|
|
149662
|
+
);
|
|
149644
149663
|
}
|
|
149645
149664
|
async function runSpecConflictsRevoke(conflictId2, opts = {}) {
|
|
149646
149665
|
const root = repoRoot2(opts);
|
|
149647
149666
|
revokeDecision(root, conflictId2);
|
|
149648
149667
|
await refreshScan(root);
|
|
149649
|
-
emitOk(
|
|
149668
|
+
emitOk(
|
|
149669
|
+
`Revoked decision for ${conflictId2.slice(0, 12)}\u2026`,
|
|
149670
|
+
`re-resolve: truecourse spec conflicts pick ${conflictId2} <n> \xB7 custom ${conflictId2} --text "\u2026"`
|
|
149671
|
+
);
|
|
149650
149672
|
}
|
|
149651
149673
|
function serializeConflict(c2) {
|
|
149652
149674
|
return {
|
|
@@ -149657,7 +149679,8 @@ function serializeConflict(c2) {
|
|
|
149657
149679
|
async function refreshScan(root) {
|
|
149658
149680
|
await scanInProcess(root, {});
|
|
149659
149681
|
}
|
|
149660
|
-
function emitOk(msg) {
|
|
149682
|
+
function emitOk(msg, hint) {
|
|
149683
|
+
if (hint) O2.message(hint);
|
|
149661
149684
|
gt(msg);
|
|
149662
149685
|
}
|
|
149663
149686
|
function fail(msg) {
|
|
@@ -149739,22 +149762,29 @@ async function runSpecChainsList(opts = {}) {
|
|
|
149739
149762
|
for (const c2 of manual) {
|
|
149740
149763
|
O2.message(` ${c2.older} \u2192 ${c2.newer} ${c2.note ? `\xB7 ${c2.note}` : ""}`);
|
|
149741
149764
|
}
|
|
149742
|
-
gt("");
|
|
149765
|
+
gt("manage with `truecourse spec chains add/remove`.");
|
|
149743
149766
|
}
|
|
149744
149767
|
async function runSpecChainsAdd(opts) {
|
|
149745
149768
|
const root = repoRoot3(opts);
|
|
149746
149769
|
if (opts.older === opts.newer) return fail2("older and newer must be different docs");
|
|
149747
149770
|
addManualChain(root, { older: opts.older, newer: opts.newer, note: opts.note });
|
|
149748
149771
|
await scanInProcess(root, {});
|
|
149749
|
-
emitOk2(
|
|
149772
|
+
emitOk2(
|
|
149773
|
+
`Marked ${opts.older} as superseded by ${opts.newer}`,
|
|
149774
|
+
"re-run `truecourse spec scan` to apply."
|
|
149775
|
+
);
|
|
149750
149776
|
}
|
|
149751
149777
|
async function runSpecChainsRemove(opts) {
|
|
149752
149778
|
const root = repoRoot3(opts);
|
|
149753
149779
|
removeManualChain(root, { older: opts.older, newer: opts.newer });
|
|
149754
149780
|
await scanInProcess(root, {});
|
|
149755
|
-
emitOk2(
|
|
149781
|
+
emitOk2(
|
|
149782
|
+
`Removed chain ${opts.older} \u2192 ${opts.newer}`,
|
|
149783
|
+
"re-run `truecourse spec scan` to apply."
|
|
149784
|
+
);
|
|
149756
149785
|
}
|
|
149757
|
-
function emitOk2(msg) {
|
|
149786
|
+
function emitOk2(msg, hint) {
|
|
149787
|
+
if (hint) O2.message(hint);
|
|
149758
149788
|
gt(msg);
|
|
149759
149789
|
}
|
|
149760
149790
|
function fail2(msg) {
|
|
@@ -149782,23 +149812,30 @@ async function runSpecDocsSkipped(opts = {}) {
|
|
|
149782
149812
|
O2.step(`Manual includes (${manualIncludes.length})`);
|
|
149783
149813
|
for (const inc of manualIncludes) O2.message(` ${inc}`);
|
|
149784
149814
|
}
|
|
149785
|
-
gt("");
|
|
149815
|
+
gt("force-include with `truecourse spec docs include <path>`.");
|
|
149786
149816
|
}
|
|
149787
149817
|
async function runSpecDocsInclude(docPath, opts = {}) {
|
|
149788
149818
|
const root = repoRoot4(opts);
|
|
149789
149819
|
if (!docPath) return fail3("Missing doc path");
|
|
149790
149820
|
addManualInclude(root, docPath);
|
|
149791
149821
|
await scanInProcess(root, {});
|
|
149792
|
-
emitOk3(
|
|
149822
|
+
emitOk3(
|
|
149823
|
+
`Force-include ${docPath}`,
|
|
149824
|
+
"re-scanned \u2014 review `truecourse spec conflicts list`."
|
|
149825
|
+
);
|
|
149793
149826
|
}
|
|
149794
149827
|
async function runSpecDocsUninclude(docPath, opts = {}) {
|
|
149795
149828
|
const root = repoRoot4(opts);
|
|
149796
149829
|
if (!docPath) return fail3("Missing doc path");
|
|
149797
149830
|
removeManualInclude(root, docPath);
|
|
149798
149831
|
await scanInProcess(root, {});
|
|
149799
|
-
emitOk3(
|
|
149832
|
+
emitOk3(
|
|
149833
|
+
`Removed force-include for ${docPath}`,
|
|
149834
|
+
"re-scanned \u2014 review `truecourse spec conflicts list`."
|
|
149835
|
+
);
|
|
149800
149836
|
}
|
|
149801
|
-
function emitOk3(msg) {
|
|
149837
|
+
function emitOk3(msg, hint) {
|
|
149838
|
+
if (hint) O2.message(hint);
|
|
149802
149839
|
gt(msg);
|
|
149803
149840
|
}
|
|
149804
149841
|
function fail3(msg) {
|
|
@@ -152751,7 +152788,7 @@ async function runHooksRun() {
|
|
|
152751
152788
|
|
|
152752
152789
|
// tools/cli/src/index.ts
|
|
152753
152790
|
var program2 = new Command();
|
|
152754
|
-
program2.name("truecourse").version("0.6.0-next.
|
|
152791
|
+
program2.name("truecourse").version("0.6.0-next.4").description("TrueCourse CLI \u2014 analyze your repository and open the dashboard");
|
|
152755
152792
|
var dashboardCmd = program2.command("dashboard").description("Start the TrueCourse dashboard and open it in your browser").option("--reconfigure", "Re-prompt for console vs background service mode").option("--service", "Run as a background service (skips mode prompt)").option("--console", "Run in this terminal (skips mode prompt)").action(async (options) => {
|
|
152756
152793
|
if (options.service && options.console) {
|
|
152757
152794
|
console.error("error: --service and --console are mutually exclusive");
|
package/package.json
CHANGED
package/server.mjs
CHANGED
|
@@ -156920,7 +156920,7 @@ function readToolVersion() {
|
|
|
156920
156920
|
if (cachedVersion)
|
|
156921
156921
|
return cachedVersion;
|
|
156922
156922
|
if (true) {
|
|
156923
|
-
cachedVersion = "0.6.0-next.
|
|
156923
|
+
cachedVersion = "0.6.0-next.4";
|
|
156924
156924
|
return cachedVersion;
|
|
156925
156925
|
}
|
|
156926
156926
|
try {
|