musubix2 0.5.72 → 0.5.74
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/.claude/.musubix-managed +1 -1
- package/dist/assets/skills-manifest.json +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +125 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.js +125 -18
- package/package.json +1 -1
package/.claude/.musubix-managed
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generator":"musubix2","version":"0.5.
|
|
1
|
+
{"generator":"musubix2","version":"0.5.74","timestamp":"2026-07-10T23:43:33.040Z"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ export declare function handleReqValidate(filePath: string): Promise<ExitCodeVal
|
|
|
126
126
|
export declare function handleReqWizard(): Promise<ExitCodeValue>;
|
|
127
127
|
export declare function handleReqInterview(args: Record<string, unknown>): Promise<ExitCodeValue>;
|
|
128
128
|
export declare function handleDesignGenerate(filePath: string, outPath?: string): Promise<ExitCodeValue>;
|
|
129
|
-
export declare function handleDesignC4(filePath: string, level?: string): Promise<ExitCodeValue>;
|
|
129
|
+
export declare function handleDesignC4(filePath: string, level?: string, format?: string): Promise<ExitCodeValue>;
|
|
130
130
|
export declare function handleDesignVerify(filePath: string): Promise<ExitCodeValue>;
|
|
131
131
|
export declare function handleCodegen(nameOrFile: string, type?: string, outPath?: string): Promise<ExitCodeValue>;
|
|
132
132
|
export declare function handleTestGen(filePath: string): Promise<ExitCodeValue>;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAgC9D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,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 -1924,6 +1924,20 @@ var init_interviewer = __esm({
|
|
|
1924
1924
|
this.updateState();
|
|
1925
1925
|
return { ...this.state };
|
|
1926
1926
|
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Restore a previously serialized state so the 1問1答 flow can span separate
|
|
1929
|
+
* CLI invocations (each a fresh process). Pairs with getState().
|
|
1930
|
+
*/
|
|
1931
|
+
restoreState(state) {
|
|
1932
|
+
this.state = {
|
|
1933
|
+
context: state.context ?? {},
|
|
1934
|
+
answeredQuestions: state.answeredQuestions ?? [],
|
|
1935
|
+
currentQuestion: state.currentQuestion ?? null,
|
|
1936
|
+
isComplete: state.isComplete ?? false,
|
|
1937
|
+
completionPercentage: state.completionPercentage ?? 0,
|
|
1938
|
+
missingRequired: state.missingRequired ?? []
|
|
1939
|
+
};
|
|
1940
|
+
}
|
|
1927
1941
|
/** Reset the interview */
|
|
1928
1942
|
reset() {
|
|
1929
1943
|
this.state = {
|
|
@@ -16030,7 +16044,7 @@ function synthesisTools() {
|
|
|
16030
16044
|
return [
|
|
16031
16045
|
tool("synthesis.dsl.build", "Apply a DSL transform pipeline to an input string", "synthesis", [
|
|
16032
16046
|
param("input", "string", "Input string to transform"),
|
|
16033
|
-
param("ops", "array", "Ops: trim | upper | lower | reverse | capitalize | camelCase | snakeCase | replace:from:to")
|
|
16047
|
+
param("ops", "array", "Ops: trim | upper | lower | reverse | capitalize | camelCase | snakeCase | replace:from:to | prefixRemove:p | suffixAppend:s | repeat:n")
|
|
16034
16048
|
], async (params) => {
|
|
16035
16049
|
try {
|
|
16036
16050
|
const { createDSLBuilder: createDSLBuilder2 } = await Promise.resolve().then(() => (init_dist12(), dist_exports12));
|
|
@@ -16073,6 +16087,9 @@ function synthesisTools() {
|
|
|
16073
16087
|
case "suffixAppend":
|
|
16074
16088
|
builder.suffixAppend(a[0] ?? "");
|
|
16075
16089
|
break;
|
|
16090
|
+
case "repeat":
|
|
16091
|
+
builder.repeat(Number.parseInt(a[0] ?? "1", 10) || 1);
|
|
16092
|
+
break;
|
|
16076
16093
|
default:
|
|
16077
16094
|
return fail(`Unknown DSL op: ${name}`);
|
|
16078
16095
|
}
|
|
@@ -17073,7 +17090,7 @@ init_dist5();
|
|
|
17073
17090
|
init_dist6();
|
|
17074
17091
|
init_dist();
|
|
17075
17092
|
init_dist();
|
|
17076
|
-
import { readFileSync as readFileSync6, existsSync as existsSync12, statSync, readdirSync, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4 } from "node:fs";
|
|
17093
|
+
import { readFileSync as readFileSync6, existsSync as existsSync12, statSync, readdirSync, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, rmSync as rmSync2 } from "node:fs";
|
|
17077
17094
|
import { join as joinPath, dirname as dirnamePath } from "node:path";
|
|
17078
17095
|
function parseArgs(argv) {
|
|
17079
17096
|
const command = argv[0] ?? "";
|
|
@@ -17574,9 +17591,21 @@ async function handleTrace(sub, args, flags = {}) {
|
|
|
17574
17591
|
}
|
|
17575
17592
|
const generator = createMatrixGenerator();
|
|
17576
17593
|
const report = generator.generate(data.requirementIds, data.fileIds, data.links);
|
|
17577
|
-
console.log(generator.toMarkdown(report));
|
|
17578
17594
|
const covered = data.requirementIds.filter((r) => (data.refsByReq.get(r)?.length ?? 0) > 0);
|
|
17579
17595
|
const pct = Math.round(covered.length / data.requirementIds.length * 100);
|
|
17596
|
+
if (flags["json"] === true) {
|
|
17597
|
+
console.log(JSON.stringify({
|
|
17598
|
+
requirements: data.requirementIds,
|
|
17599
|
+
files: data.fileIds,
|
|
17600
|
+
links: data.links,
|
|
17601
|
+
completeness: report.completeness,
|
|
17602
|
+
gaps: report.gaps,
|
|
17603
|
+
referencedInCode: covered.length,
|
|
17604
|
+
coveragePercent: pct
|
|
17605
|
+
}, null, 2));
|
|
17606
|
+
return ExitCode.SUCCESS;
|
|
17607
|
+
}
|
|
17608
|
+
console.log(generator.toMarkdown(report));
|
|
17580
17609
|
console.log(`
|
|
17581
17610
|
Requirements: ${data.requirementIds.length}, referenced in code: ${covered.length} (${pct}%), source files: ${data.fileIds.length} (scanned ${srcDir}).`);
|
|
17582
17611
|
return ExitCode.SUCCESS;
|
|
@@ -17822,6 +17851,56 @@ var SECRET_SCAN_EXT = /* @__PURE__ */ new Set([
|
|
|
17822
17851
|
"pem",
|
|
17823
17852
|
"txt"
|
|
17824
17853
|
]);
|
|
17854
|
+
var RESERVED_WORDS = /* @__PURE__ */ new Set([
|
|
17855
|
+
"class",
|
|
17856
|
+
"interface",
|
|
17857
|
+
"enum",
|
|
17858
|
+
"function",
|
|
17859
|
+
"const",
|
|
17860
|
+
"let",
|
|
17861
|
+
"var",
|
|
17862
|
+
"return",
|
|
17863
|
+
"if",
|
|
17864
|
+
"else",
|
|
17865
|
+
"for",
|
|
17866
|
+
"while",
|
|
17867
|
+
"do",
|
|
17868
|
+
"switch",
|
|
17869
|
+
"case",
|
|
17870
|
+
"break",
|
|
17871
|
+
"continue",
|
|
17872
|
+
"new",
|
|
17873
|
+
"delete",
|
|
17874
|
+
"typeof",
|
|
17875
|
+
"instanceof",
|
|
17876
|
+
"void",
|
|
17877
|
+
"this",
|
|
17878
|
+
"super",
|
|
17879
|
+
"extends",
|
|
17880
|
+
"implements",
|
|
17881
|
+
"import",
|
|
17882
|
+
"export",
|
|
17883
|
+
"default",
|
|
17884
|
+
"try",
|
|
17885
|
+
"catch",
|
|
17886
|
+
"finally",
|
|
17887
|
+
"throw",
|
|
17888
|
+
"in",
|
|
17889
|
+
"of",
|
|
17890
|
+
"yield",
|
|
17891
|
+
"async",
|
|
17892
|
+
"await",
|
|
17893
|
+
"static",
|
|
17894
|
+
"public",
|
|
17895
|
+
"private",
|
|
17896
|
+
"protected",
|
|
17897
|
+
"package",
|
|
17898
|
+
"null",
|
|
17899
|
+
"true",
|
|
17900
|
+
"false",
|
|
17901
|
+
"with",
|
|
17902
|
+
"debugger"
|
|
17903
|
+
]);
|
|
17825
17904
|
var WALK_IGNORE = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", "coverage", ".next", "build"]);
|
|
17826
17905
|
function collectFiles(target, extFilter) {
|
|
17827
17906
|
const stat = statSync(target);
|
|
@@ -19153,7 +19232,7 @@ async function handleCodegraph(sub, args) {
|
|
|
19153
19232
|
output = lines.join("\n");
|
|
19154
19233
|
}
|
|
19155
19234
|
if (outPath) {
|
|
19156
|
-
|
|
19235
|
+
writeOut(outPath, output);
|
|
19157
19236
|
console.log(`\u2705 Exported ${fileSet.size} file(s), ${rels.length} edge(s) as ${format} to ${outPath}`);
|
|
19158
19237
|
} else {
|
|
19159
19238
|
console.log(output);
|
|
@@ -19390,18 +19469,35 @@ async function handleReqWizard() {
|
|
|
19390
19469
|
return ExitCode.GENERAL_ERROR;
|
|
19391
19470
|
}
|
|
19392
19471
|
}
|
|
19393
|
-
var
|
|
19472
|
+
var INTERVIEW_STATE_FILE = ".musubix/interview.json";
|
|
19394
19473
|
function getInterviewer() {
|
|
19395
|
-
|
|
19396
|
-
|
|
19474
|
+
const interviewer = createRequirementsInterviewer();
|
|
19475
|
+
if (existsSync12(INTERVIEW_STATE_FILE)) {
|
|
19476
|
+
try {
|
|
19477
|
+
interviewer.restoreState(JSON.parse(readFileSync6(INTERVIEW_STATE_FILE, "utf-8")));
|
|
19478
|
+
} catch {
|
|
19479
|
+
}
|
|
19397
19480
|
}
|
|
19398
|
-
return
|
|
19481
|
+
return interviewer;
|
|
19482
|
+
}
|
|
19483
|
+
function saveInterview(interviewer) {
|
|
19484
|
+
mkdirSync4(dirnamePath(INTERVIEW_STATE_FILE), { recursive: true });
|
|
19485
|
+
writeFileSync4(INTERVIEW_STATE_FILE, JSON.stringify(interviewer.getState(), null, 2), "utf-8");
|
|
19486
|
+
}
|
|
19487
|
+
function writeOut(filePath, content) {
|
|
19488
|
+
const dir = dirnamePath(filePath);
|
|
19489
|
+
if (dir && dir !== ".") {
|
|
19490
|
+
mkdirSync4(dir, { recursive: true });
|
|
19491
|
+
}
|
|
19492
|
+
writeFileSync4(filePath, content, "utf-8");
|
|
19399
19493
|
}
|
|
19400
19494
|
async function handleReqInterview(args) {
|
|
19401
19495
|
try {
|
|
19402
19496
|
const interviewer = getInterviewer();
|
|
19403
19497
|
if (args["reset"] === true) {
|
|
19404
|
-
|
|
19498
|
+
if (existsSync12(INTERVIEW_STATE_FILE)) {
|
|
19499
|
+
rmSync2(INTERVIEW_STATE_FILE, { force: true });
|
|
19500
|
+
}
|
|
19405
19501
|
console.log("\u{1F504} Interview state reset.");
|
|
19406
19502
|
return ExitCode.SUCCESS;
|
|
19407
19503
|
}
|
|
@@ -19435,6 +19531,7 @@ async function handleReqInterview(args) {
|
|
|
19435
19531
|
return ExitCode.GENERAL_ERROR;
|
|
19436
19532
|
}
|
|
19437
19533
|
const result2 = interviewer.answer(questionId, response);
|
|
19534
|
+
saveInterview(interviewer);
|
|
19438
19535
|
if (result2.status === "complete") {
|
|
19439
19536
|
console.log("\u2705 Interview complete! All required info gathered.");
|
|
19440
19537
|
console.log(" Run `musubix req:interview --generate` to generate the spec.");
|
|
@@ -19460,7 +19557,9 @@ async function handleReqInterview(args) {
|
|
|
19460
19557
|
console.log(" musubix req:interview --reset Reset interview");
|
|
19461
19558
|
return ExitCode.SUCCESS;
|
|
19462
19559
|
}
|
|
19560
|
+
interviewer.reset();
|
|
19463
19561
|
const result = interviewer.analyzeInput(inputText);
|
|
19562
|
+
saveInterview(interviewer);
|
|
19464
19563
|
if (result.status === "complete") {
|
|
19465
19564
|
console.log("\u2705 Sufficient info gathered! Generating requirements...");
|
|
19466
19565
|
const generator = createRequirementsDocGenerator();
|
|
@@ -19499,7 +19598,7 @@ async function handleDesignGenerate(filePath, outPath) {
|
|
|
19499
19598
|
if (outPath) {
|
|
19500
19599
|
const c4 = deriveC4FromRequirements(content);
|
|
19501
19600
|
const artifact = { ...design, elements: c4.elements, relationships: c4.relationships };
|
|
19502
|
-
|
|
19601
|
+
writeOut(outPath, JSON.stringify(artifact, null, 2) + "\n");
|
|
19503
19602
|
console.log(`\u2705 Wrote design artifact: ${outPath} (${design.sections.length} section(s))`);
|
|
19504
19603
|
console.log(` Next: musubix design:verify ${outPath} | musubix design:c4 ${outPath}`);
|
|
19505
19604
|
return ExitCode.SUCCESS;
|
|
@@ -19568,12 +19667,17 @@ function deriveC4FromRequirements(content) {
|
|
|
19568
19667
|
}
|
|
19569
19668
|
return { title: "System Architecture", elements, relationships };
|
|
19570
19669
|
}
|
|
19571
|
-
async function handleDesignC4(filePath, level = "context") {
|
|
19670
|
+
async function handleDesignC4(filePath, level = "context", format = "mermaid") {
|
|
19572
19671
|
try {
|
|
19573
19672
|
if (!existsSync12(filePath)) {
|
|
19574
19673
|
console.error(`\u274C Path not found: ${filePath}`);
|
|
19575
19674
|
return ExitCode.GENERAL_ERROR;
|
|
19576
19675
|
}
|
|
19676
|
+
const fmt = format.toLowerCase();
|
|
19677
|
+
if (fmt !== "mermaid" && fmt !== "plantuml") {
|
|
19678
|
+
console.error(`\u274C Unknown --format "${format}". Use mermaid or plantuml.`);
|
|
19679
|
+
return ExitCode.VALIDATION_ERROR;
|
|
19680
|
+
}
|
|
19577
19681
|
const content = readFileSync6(filePath, "utf-8");
|
|
19578
19682
|
let data;
|
|
19579
19683
|
if (content.trimStart().startsWith("{")) {
|
|
@@ -19593,8 +19697,7 @@ async function handleDesignC4(filePath, level = "context") {
|
|
|
19593
19697
|
}
|
|
19594
19698
|
const c4Level = level;
|
|
19595
19699
|
const diagram = generator.generateDiagram(c4Level, data.title ?? "System");
|
|
19596
|
-
|
|
19597
|
-
console.log(mermaid);
|
|
19700
|
+
console.log(fmt === "plantuml" ? generator.toPlantUML(diagram) : generator.toMermaid(diagram));
|
|
19598
19701
|
return ExitCode.SUCCESS;
|
|
19599
19702
|
} catch (err) {
|
|
19600
19703
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -19752,7 +19855,7 @@ async function handleCodegen(nameOrFile, type = "class", outPath) {
|
|
|
19752
19855
|
const entityDecls = renderEntityTypeStubs(targets);
|
|
19753
19856
|
const code = [...entityDecls, ...blocks].join("\n\n");
|
|
19754
19857
|
if (outPath) {
|
|
19755
|
-
|
|
19858
|
+
writeOut(outPath, code + "\n");
|
|
19756
19859
|
console.error(`\u2705 Wrote ${targets.length} skeleton(s) to ${outPath}`);
|
|
19757
19860
|
console.error(` Next: musubix test:gen ${outPath}`);
|
|
19758
19861
|
return ExitCode.SUCCESS;
|
|
@@ -19773,13 +19876,16 @@ async function handleCodegen(nameOrFile, type = "class", outPath) {
|
|
|
19773
19876
|
console.error(`\u274C Unknown --type "${type}". Valid: ${validTypes.join(", ")}`);
|
|
19774
19877
|
return ExitCode.VALIDATION_ERROR;
|
|
19775
19878
|
}
|
|
19776
|
-
|
|
19879
|
+
let safeName = /^[A-Za-z_$][\w$]*$/.test(nameOrFile) ? nameOrFile : toPascalCase(nameOrFile);
|
|
19880
|
+
if (RESERVED_WORDS.has(safeName)) {
|
|
19881
|
+
safeName = `${safeName}_`;
|
|
19882
|
+
}
|
|
19777
19883
|
const result = generator.generate({
|
|
19778
19884
|
templateType: type,
|
|
19779
19885
|
name: safeName
|
|
19780
19886
|
});
|
|
19781
19887
|
if (outPath) {
|
|
19782
|
-
|
|
19888
|
+
writeOut(outPath, result.code + "\n");
|
|
19783
19889
|
console.error(`\u2705 Wrote skeleton to ${outPath}`);
|
|
19784
19890
|
console.error(` Next: musubix test:gen ${outPath}`);
|
|
19785
19891
|
return ExitCode.SUCCESS;
|
|
@@ -20936,11 +21042,12 @@ function getDefaultCommands() {
|
|
|
20936
21042
|
const positionalArgs = args["args"] ?? [];
|
|
20937
21043
|
const filePath = args["file"] ?? args["subcommand"] ?? positionalArgs[0];
|
|
20938
21044
|
if (!filePath) {
|
|
20939
|
-
console.error("\u274C Usage: musubix design:c4 <file> [--level context|container|component]");
|
|
21045
|
+
console.error("\u274C Usage: musubix design:c4 <file> [--level context|container|component] [--format mermaid|plantuml]");
|
|
20940
21046
|
return ExitCode.VALIDATION_ERROR;
|
|
20941
21047
|
}
|
|
20942
21048
|
const level = args["level"] ?? "context";
|
|
20943
|
-
|
|
21049
|
+
const c4Format = args["format"] ?? "mermaid";
|
|
21050
|
+
return await handleDesignC4(filePath, level, c4Format);
|
|
20944
21051
|
}
|
|
20945
21052
|
},
|
|
20946
21053
|
{
|