musubix2 0.3.7 → 0.3.8
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/dist/index.d.ts +1 -1
- package/dist/index.js +27 -49
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { EARSValidator as _EARSValidator, MarkdownEARSParser as _MarkdownEARSParser, RequirementsValidator as _RequirementsValidator } from '@musubix2/core';
|
|
10
10
|
export { ActionableError, ErrorCodes, CommonErrors, ErrorFormatter, CircuitBreaker, retryWithBackoff, createGracefulDegradation, Logger, AuditLogger, ConfigLoader, EARSValidator, createEARSValidator, MarkdownEARSParser, RequirementsValidator, createMarkdownEARSParser, createRequirementsValidator, ReplEngine, ReasoningChainRecorder, ExplanationGenerator, InMemoryRepository, createInMemoryRepository, ExitCode, formatTable, formatSuccess, formatError, type EARSPattern, type ParsedRequirement, type ValidationResult, type ErrorSeverity, type MuSubixConfig, type ReplCommand, type ReasoningChain, } from '@musubix2/core';
|
|
11
|
-
export declare const MUSUBI_VERSION = "0.3.
|
|
11
|
+
export declare const MUSUBI_VERSION = "0.3.8";
|
|
12
12
|
export { CLIDispatcher, createCLIDispatcher, getDefaultCommands, parseArgs, showHelp, handleInit, handleTasksValidate, handleTasksList, handleTasksStats, parseTaskFile, handleSkills, handleKnowledge, handleDecision, handleDeepResearch, handleRepl, handleScaffold, handleExplain, handleLearn, handleSynthesis, handleWatch, type CLICommand, type CLIConfig, type ParsedArgs, } from './cli.js';
|
|
13
13
|
/**
|
|
14
14
|
* Quick-start helper: create a configured EARS validator + parser combo.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
//
|
|
1
|
+
// dist/index.js
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
5
|
+
import { join as join2 } from "node:path";
|
|
6
|
+
import { randomUUID } from "node:crypto";
|
|
7
|
+
import { readFile as readFile22, writeFile, mkdir } from "node:fs/promises";
|
|
8
|
+
import { join as join22, dirname } from "node:path";
|
|
9
|
+
import { writeFile as writeFile2, mkdir as mkdir2 } from "node:fs/promises";
|
|
10
|
+
import { join as join3 } from "node:path";
|
|
11
|
+
import ts from "typescript";
|
|
12
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
2
13
|
var ActionableError = class _ActionableError extends Error {
|
|
3
14
|
code;
|
|
4
15
|
severity;
|
|
@@ -235,8 +246,6 @@ var CommonErrors = {
|
|
|
235
246
|
});
|
|
236
247
|
}
|
|
237
248
|
};
|
|
238
|
-
|
|
239
|
-
// ../core/dist/error/graceful-degradation.js
|
|
240
249
|
var MemoryCacheProvider = class {
|
|
241
250
|
cache = /* @__PURE__ */ new Map();
|
|
242
251
|
async get(key) {
|
|
@@ -613,8 +622,6 @@ var CircuitBreaker = class {
|
|
|
613
622
|
this.state = "closed";
|
|
614
623
|
}
|
|
615
624
|
};
|
|
616
|
-
|
|
617
|
-
// ../core/dist/logging/index.js
|
|
618
625
|
var ConsoleTransport = class {
|
|
619
626
|
write(entry) {
|
|
620
627
|
const prefix = `[${entry.timestamp.toISOString()}] [${entry.level.toUpperCase()}]`;
|
|
@@ -711,10 +718,6 @@ var AuditLogger = class {
|
|
|
711
718
|
this.events.length = 0;
|
|
712
719
|
}
|
|
713
720
|
};
|
|
714
|
-
|
|
715
|
-
// ../core/dist/config/index.js
|
|
716
|
-
import { readFile } from "node:fs/promises";
|
|
717
|
-
import { join } from "node:path";
|
|
718
721
|
var DEFAULT_CONFIG = {
|
|
719
722
|
steeringDir: "steering",
|
|
720
723
|
storageDir: "storage",
|
|
@@ -795,8 +798,6 @@ var ConfigLoader = class {
|
|
|
795
798
|
};
|
|
796
799
|
}
|
|
797
800
|
};
|
|
798
|
-
|
|
799
|
-
// ../core/dist/infrastructure/repository.js
|
|
800
801
|
var InMemoryRepository = class {
|
|
801
802
|
store = /* @__PURE__ */ new Map();
|
|
802
803
|
async get(id) {
|
|
@@ -818,8 +819,6 @@ var InMemoryRepository = class {
|
|
|
818
819
|
function createInMemoryRepository() {
|
|
819
820
|
return new InMemoryRepository();
|
|
820
821
|
}
|
|
821
|
-
|
|
822
|
-
// ../core/dist/interface/cli/index.js
|
|
823
822
|
var ExitCode = {
|
|
824
823
|
SUCCESS: 0,
|
|
825
824
|
GENERAL_ERROR: 1,
|
|
@@ -845,8 +844,6 @@ function formatTable(headers, rows) {
|
|
|
845
844
|
${separator}
|
|
846
845
|
${body}`;
|
|
847
846
|
}
|
|
848
|
-
|
|
849
|
-
// ../core/dist/validators/ears-validator.js
|
|
850
847
|
var PATTERN_RULES = [
|
|
851
848
|
{
|
|
852
849
|
pattern: "event-driven",
|
|
@@ -1020,8 +1017,6 @@ var EARSValidator = class {
|
|
|
1020
1017
|
function createEARSValidator() {
|
|
1021
1018
|
return new EARSValidator();
|
|
1022
1019
|
}
|
|
1023
|
-
|
|
1024
|
-
// ../core/dist/validators/markdown-ears-parser.js
|
|
1025
1020
|
var REQ_HEADING_REGEX = /^#{1,4}\s+(REQ-[A-Z]{3}-\d{3}):\s*(.+)$/;
|
|
1026
1021
|
var FIELD_REGEX = {
|
|
1027
1022
|
type: /^\*\*種別\*\*:\s*(.+)$/m,
|
|
@@ -1187,8 +1182,6 @@ function createMarkdownEARSParser() {
|
|
|
1187
1182
|
function createRequirementsValidator() {
|
|
1188
1183
|
return new RequirementsValidator();
|
|
1189
1184
|
}
|
|
1190
|
-
|
|
1191
|
-
// ../core/dist/repl/index.js
|
|
1192
1185
|
var DefaultReplFormatter = class {
|
|
1193
1186
|
formatResult(value) {
|
|
1194
1187
|
if (value === void 0 || value === null) {
|
|
@@ -1332,8 +1325,6 @@ var ReplEngine = class {
|
|
|
1332
1325
|
});
|
|
1333
1326
|
}
|
|
1334
1327
|
};
|
|
1335
|
-
|
|
1336
|
-
// ../core/dist/explanation/index.js
|
|
1337
1328
|
var ReasoningChainRecorder = class {
|
|
1338
1329
|
chains = /* @__PURE__ */ new Map();
|
|
1339
1330
|
activeChainId = null;
|
|
@@ -1461,17 +1452,6 @@ var ExplanationGenerator = class {
|
|
|
1461
1452
|
return lines.join("\n");
|
|
1462
1453
|
}
|
|
1463
1454
|
};
|
|
1464
|
-
|
|
1465
|
-
// dist/cli.js
|
|
1466
|
-
import { readFile as readFile2 } from "node:fs/promises";
|
|
1467
|
-
import { join as join2 } from "node:path";
|
|
1468
|
-
import { randomUUID } from "node:crypto";
|
|
1469
|
-
import { readFile as readFile22, writeFile, mkdir } from "node:fs/promises";
|
|
1470
|
-
import { join as join22, dirname } from "node:path";
|
|
1471
|
-
import { writeFile as writeFile2, mkdir as mkdir2 } from "node:fs/promises";
|
|
1472
|
-
import { join as join3 } from "node:path";
|
|
1473
|
-
import ts from "typescript";
|
|
1474
|
-
import { readFileSync, existsSync } from "node:fs";
|
|
1475
1455
|
var __defProp = Object.defineProperty;
|
|
1476
1456
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1477
1457
|
var __esm = (fn, res) => function __init() {
|
|
@@ -1488,7 +1468,7 @@ var CommonErrors2;
|
|
|
1488
1468
|
var init_actionable_error = __esm({
|
|
1489
1469
|
"../core/dist/error/actionable-error.js"() {
|
|
1490
1470
|
"use strict";
|
|
1491
|
-
ActionableError2 = class
|
|
1471
|
+
ActionableError2 = class _ActionableError2 extends Error {
|
|
1492
1472
|
code;
|
|
1493
1473
|
severity;
|
|
1494
1474
|
context;
|
|
@@ -1501,27 +1481,27 @@ var init_actionable_error = __esm({
|
|
|
1501
1481
|
this.context = options.context ?? {};
|
|
1502
1482
|
this.suggestions = options.suggestions ?? [];
|
|
1503
1483
|
if (Error.captureStackTrace) {
|
|
1504
|
-
Error.captureStackTrace(this,
|
|
1484
|
+
Error.captureStackTrace(this, _ActionableError2);
|
|
1505
1485
|
}
|
|
1506
1486
|
if (options.cause) {
|
|
1507
1487
|
this.cause = options.cause;
|
|
1508
1488
|
}
|
|
1509
1489
|
}
|
|
1510
1490
|
static withSuggestion(message, code, suggestion) {
|
|
1511
|
-
return new
|
|
1491
|
+
return new _ActionableError2(message, {
|
|
1512
1492
|
code,
|
|
1513
1493
|
suggestions: [suggestion]
|
|
1514
1494
|
});
|
|
1515
1495
|
}
|
|
1516
1496
|
static fromError(error, code, suggestions) {
|
|
1517
|
-
return new
|
|
1497
|
+
return new _ActionableError2(error.message, {
|
|
1518
1498
|
code,
|
|
1519
1499
|
cause: error,
|
|
1520
1500
|
suggestions
|
|
1521
1501
|
});
|
|
1522
1502
|
}
|
|
1523
1503
|
static isActionableError(error) {
|
|
1524
|
-
return error instanceof
|
|
1504
|
+
return error instanceof _ActionableError2;
|
|
1525
1505
|
}
|
|
1526
1506
|
addSuggestion(suggestion) {
|
|
1527
1507
|
this.suggestions.push(suggestion);
|
|
@@ -1554,16 +1534,16 @@ var init_actionable_error = __esm({
|
|
|
1554
1534
|
PATTERN_NOT_FOUND: "PATTERN_NOT_FOUND",
|
|
1555
1535
|
PATTERN_CONFLICT: "PATTERN_CONFLICT"
|
|
1556
1536
|
};
|
|
1557
|
-
ErrorFormatter2 = class
|
|
1537
|
+
ErrorFormatter2 = class _ErrorFormatter2 {
|
|
1558
1538
|
static useColors = true;
|
|
1559
1539
|
static setColorOutput(enabled) {
|
|
1560
|
-
|
|
1540
|
+
_ErrorFormatter2.useColors = enabled;
|
|
1561
1541
|
}
|
|
1562
1542
|
static format(error) {
|
|
1563
1543
|
const lines = [];
|
|
1564
|
-
const icon =
|
|
1544
|
+
const icon = _ErrorFormatter2.getSeverityIcon(error.severity);
|
|
1565
1545
|
const header = `${icon} [${error.code}] ${error.message}`;
|
|
1566
|
-
lines.push(
|
|
1546
|
+
lines.push(_ErrorFormatter2.colorize(header, error.severity));
|
|
1567
1547
|
if (error.context.file) {
|
|
1568
1548
|
let location = ` \u{1F4CD} ${error.context.file}`;
|
|
1569
1549
|
if (error.context.line !== void 0) {
|
|
@@ -1594,7 +1574,7 @@ var init_actionable_error = __esm({
|
|
|
1594
1574
|
}
|
|
1595
1575
|
static formatAll(errors) {
|
|
1596
1576
|
if (errors.length === 0) {
|
|
1597
|
-
return
|
|
1577
|
+
return _ErrorFormatter2.colorize("\u2705 No errors", "info");
|
|
1598
1578
|
}
|
|
1599
1579
|
const lines = [];
|
|
1600
1580
|
const counts = {
|
|
@@ -1605,7 +1585,7 @@ var init_actionable_error = __esm({
|
|
|
1605
1585
|
lines.push(`Found ${errors.length} issue(s): ${counts.error} errors, ${counts.warning} warnings, ${counts.info} info
|
|
1606
1586
|
`);
|
|
1607
1587
|
for (const error of errors) {
|
|
1608
|
-
lines.push(
|
|
1588
|
+
lines.push(_ErrorFormatter2.format(error));
|
|
1609
1589
|
lines.push("");
|
|
1610
1590
|
}
|
|
1611
1591
|
return lines.join("\n");
|
|
@@ -1630,7 +1610,7 @@ var init_actionable_error = __esm({
|
|
|
1630
1610
|
}
|
|
1631
1611
|
}
|
|
1632
1612
|
static colorize(text, severity) {
|
|
1633
|
-
if (!
|
|
1613
|
+
if (!_ErrorFormatter2.useColors) {
|
|
1634
1614
|
return text;
|
|
1635
1615
|
}
|
|
1636
1616
|
const colors = {
|
|
@@ -2162,7 +2142,7 @@ var init_logging = __esm({
|
|
|
2162
2142
|
warn: 2,
|
|
2163
2143
|
error: 3
|
|
2164
2144
|
};
|
|
2165
|
-
Logger2 = class
|
|
2145
|
+
Logger2 = class _Logger2 {
|
|
2166
2146
|
transports;
|
|
2167
2147
|
minLevel;
|
|
2168
2148
|
source;
|
|
@@ -2184,7 +2164,7 @@ var init_logging = __esm({
|
|
|
2184
2164
|
this.log("error", message, context);
|
|
2185
2165
|
}
|
|
2186
2166
|
child(source) {
|
|
2187
|
-
return new
|
|
2167
|
+
return new _Logger2({
|
|
2188
2168
|
transports: this.transports,
|
|
2189
2169
|
level: this.minLevel,
|
|
2190
2170
|
source: this.source ? `${this.source}:${source}` : source
|
|
@@ -13452,9 +13432,7 @@ function createCLIDispatcher() {
|
|
|
13452
13432
|
dispatcher.registerBatch(getDefaultCommands());
|
|
13453
13433
|
return dispatcher;
|
|
13454
13434
|
}
|
|
13455
|
-
|
|
13456
|
-
// dist/index.js
|
|
13457
|
-
var MUSUBI_VERSION = "0.3.7";
|
|
13435
|
+
var MUSUBI_VERSION = "0.3.8";
|
|
13458
13436
|
function createEARSPipeline() {
|
|
13459
13437
|
const validator = createEARSValidator();
|
|
13460
13438
|
const parser = createMarkdownEARSParser();
|