@moldea.ai/cli 14.0.1 → 15.0.0
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/README.md +4 -4
- package/dist/chunks/{composition-D1OYuZ5d.js → composition-B4GH4Nqy.js} +1 -1
- package/dist/chunks/{composition-_3bygS_a.js → composition-DymbbpSr.js} +73 -109
- package/dist/chunks/composition-DymbbpSr.js.map +1 -0
- package/dist/chunks/{core-composition-BKcJ--NX.js → core-composition-DhjRyNO7.js} +79 -8
- package/dist/chunks/core-composition-DhjRyNO7.js.map +1 -0
- package/dist/moldea.js +51 -43
- package/dist/moldea.js.map +1 -1
- package/dist/portable/SHA256SUMS +7 -7
- package/dist/portable/analysis-worker.mjs +1 -1
- package/dist/portable/{chunk-43b8574a.mjs → chunk-ad32cb41.mjs} +389 -420
- package/dist/portable/{chunk-d9e49acd.mjs → chunk-afb0cf51.mjs} +132 -93
- package/dist/portable/chunk-b1f86976.mjs +2 -0
- package/dist/portable/{chunk-517c6bfb.mjs → chunk-cb0442cc.mjs} +1 -1
- package/dist/portable/{chunk-9e42770a.mjs → chunk-d372f5e0.mjs} +637 -631
- package/dist/portable/moldea.mjs +211 -210
- package/package.json +2 -2
- package/dist/chunks/composition-_3bygS_a.js.map +0 -1
- package/dist/chunks/core-composition-BKcJ--NX.js.map +0 -1
- package/dist/portable/chunk-1306b995.mjs +0 -2
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
The canonical read-only local command-line composition for deterministic inspection of `moldea` repositories.
|
|
6
6
|
|
|
7
|
-
The version
|
|
7
|
+
The version 15 executable exposes one schema 9 JSON contract. `validate` and `inspect` are content-free, `scope` matches changed paths by reading only the project manifest, and `content` retrieves one explicitly selected canonical text asset in bounded Unicode-safe chunks. Collection and content responses use deterministic snapshot-bound cursors, exact final UTF-8 byte accounting, a 65,536-byte default page budget, and a 1,048,576-byte hard page ceiling.
|
|
8
8
|
|
|
9
|
-
The CLI is optional for repositories using the moldea skill. To run it on its own from a Git checkout, use `npx @moldea.ai/cli@
|
|
9
|
+
The CLI is optional for repositories using the moldea skill. To run it on its own from a Git checkout, use `npx @moldea.ai/cli@15 validate` or add `@moldea.ai/cli` as a development dependency.
|
|
10
10
|
|
|
11
11
|
The tarball also contains a minified, source-map-free CLI under `dist/portable/`. Run `node <path-to-portable>/moldea.mjs validate` with Node.js and Git. The complete directory, including its adjacent runner, worker, chunks, `SHA256SUMS`, and `LICENSES.md`, can move as one unit. The skill ships this build.
|
|
12
12
|
|
|
@@ -103,7 +103,7 @@ Binding coverage reports the checks performed on each declared reference: `fileC
|
|
|
103
103
|
|
|
104
104
|
`inspect` uses the same completion status and exit codes. Its allowlisted pages contain agent identities, asset metadata, diagnostics and binding coverage. Both commands expose coverage counts and the specific file and export checks performed; a successful export check does not prove runtime wiring. Unbounded collections use independent record keys. Canonical bodies are available only through `content`.
|
|
105
105
|
|
|
106
|
-
`scope` accepts either one leading-slash repository-logical path through `--path` or NUL-delimited UTF-8 paths with the same grammar through `--paths-stdin`. Invalid paths return `PATH_INPUT_INVALID` before repository discovery; relative paths are not normalized. It reads only `/moldea/moldea.yaml`, invokes Core's deterministic manifest-only relationship matcher, and returns relevance, complete counts and
|
|
106
|
+
`scope` accepts either one leading-slash repository-logical path through `--path` or NUL-delimited UTF-8 paths with the same grammar through `--paths-stdin`. Invalid paths return `PATH_INPUT_INVALID` before repository discovery; relative paths are not normalized. It reads only `/moldea/moldea.yaml`, invokes Core's deterministic manifest-only relationship matcher, and returns relevance, complete counts, diagnostics and paged owner matches. Each owner match gives the owner’s canonical path, kind and any capability ID, with matched declarations as `{field, path}` pairs. A declaration path is the exact path or glob written in the manifest. `content` accepts exactly one canonical `moldea` text path and returns metadata plus the largest complete Unicode-scalar chunk that fits its output page.
|
|
107
107
|
|
|
108
108
|
For JSON collection and content output, `--max-output-bytes` accepts 4,096 through 1,048,576 bytes and defaults to 65,536. The measurement covers the final newline-terminated UTF-8 envelope after JSON escaping. `--cursor` continues a prior JSON page. Cursors are opaque canonical base64url documents bound to their format version, command, normalized filters, source snapshot, last key, and checksum. Invalid, tampered, cross-command, filter-mismatched, unsupported, or stale cursors fail with a safe structured error. An envelope or atomic record that cannot fit returns `OUTPUT_BUDGET_TOO_SMALL`; output is never truncated into invalid JSON.
|
|
109
109
|
|
|
@@ -117,7 +117,7 @@ Before `validate`, `inspect` or `composition` returns a result, installation che
|
|
|
117
117
|
|
|
118
118
|
`composition` reports the installed CLI and schema versions, supported Node.js range, minimum Git, sorted foundational package versions and Core repository-format versions. It reads installed metadata without creating a worker or accessing a client repository.
|
|
119
119
|
|
|
120
|
-
Successful human and JSON reports use exit code `0`; JSON uses status `valid` and the schema
|
|
120
|
+
Successful human and JSON reports use exit code `0`; JSON uses status `valid` and the schema 9 deterministic envelope. The command never uses status `invalid`. A contradictory installation returns the non-retryable `cli:COMPOSITION_STATE_INVALID` error with message `The installed composition state is invalid.` and exit code `3`, without a partial result. The command accesses no Git executable, repository filesystem, client manifest, network, or Cloud service.
|
|
121
121
|
|
|
122
122
|
## Development
|
|
123
123
|
|
|
@@ -49,8 +49,8 @@ var MOLDEA_CLI_DEFAULT_OUTPUT_BYTES = 65536;
|
|
|
49
49
|
var MoldeaCliOutputPageException = class extends Error {
|
|
50
50
|
code;
|
|
51
51
|
/** Creates one output-page failure with a stable public code. */
|
|
52
|
-
constructor(code) {
|
|
53
|
-
super(code);
|
|
52
|
+
constructor(code, options) {
|
|
53
|
+
super(code, options);
|
|
54
54
|
this.code = code;
|
|
55
55
|
this.name = "MoldeaCliOutputPageException";
|
|
56
56
|
}
|
|
@@ -87,7 +87,7 @@ var isCursorDocument = (value) => {
|
|
|
87
87
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
88
88
|
const record = value;
|
|
89
89
|
const keys = Object.keys(record).sort();
|
|
90
|
-
return keys.length === CURSOR_DOCUMENT_KEYS.length && keys.every((key, index) => key === CURSOR_DOCUMENT_KEYS[index]) && record["version"] ===
|
|
90
|
+
return keys.length === CURSOR_DOCUMENT_KEYS.length && keys.every((key, index) => key === CURSOR_DOCUMENT_KEYS[index]) && record["version"] === 3 && (record["command"] === "content" || record["command"] === "inspect" || record["command"] === "scope" || record["command"] === "validate") && typeof record["filtersDigest"] === "string" && SHA256_PATTERN.test(record["filtersDigest"]) && typeof record["lastKey"] === "string" && record["lastKey"].length > 0 && (record["sourceCursor"] === null || typeof record["sourceCursor"] === "string") && typeof record["snapshotDigest"] === "string" && SHA256_PATTERN.test(record["snapshotDigest"]) && typeof record["checksum"] === "string" && SHA256_PATTERN.test(record["checksum"]);
|
|
91
91
|
};
|
|
92
92
|
/** Encodes one command-, filter-, and snapshot-bound continuation cursor. */
|
|
93
93
|
var encodeMoldeaCliCursor = (command, filters, snapshotDigest, lastKey, sourceCursor = null) => {
|
|
@@ -97,7 +97,7 @@ var encodeMoldeaCliCursor = (command, filters, snapshotDigest, lastKey, sourceCu
|
|
|
97
97
|
lastKey,
|
|
98
98
|
sourceCursor,
|
|
99
99
|
snapshotDigest,
|
|
100
|
-
version:
|
|
100
|
+
version: 3
|
|
101
101
|
};
|
|
102
102
|
const document = {
|
|
103
103
|
...payload,
|
|
@@ -136,6 +136,8 @@ var decodeMoldeaCliCursor = (input) => {
|
|
|
136
136
|
};
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region src/output-page/page.ts
|
|
139
|
+
/** Returns an opaque record key in lexicographic ordinal order. */
|
|
140
|
+
var createMoldeaCliRecordKey = (index) => index.toString(36).padStart(11, "0");
|
|
139
141
|
/** Ensures records have unique keys in strict ascending order. */
|
|
140
142
|
var assertRecordOrder = (records) => {
|
|
141
143
|
for (let index = 0; index < records.length; index += 1) {
|
|
@@ -204,7 +206,7 @@ var parsePositiveSafeInteger = (input) => {
|
|
|
204
206
|
const parsedInteger = Number(input);
|
|
205
207
|
return Number.isSafeInteger(parsedInteger) && parsedInteger > 0 ? parsedInteger : null;
|
|
206
208
|
};
|
|
207
|
-
/** Parses one output byte budget inside the schema
|
|
209
|
+
/** Parses one output byte budget inside the schema 9 transport bounds. */
|
|
208
210
|
var parseMoldeaCliOutputByteLimit = (input) => {
|
|
209
211
|
const parsed = parsePositiveSafeInteger(input);
|
|
210
212
|
return parsed !== null && parsed >= 4096 && parsed <= 1048576 ? parsed : null;
|
|
@@ -250,7 +252,7 @@ var isMoldeaCliCommand = (input) => {
|
|
|
250
252
|
return input !== void 0 && COMMAND_NAMES.has(input);
|
|
251
253
|
};
|
|
252
254
|
/**
|
|
253
|
-
* Parses the complete schema
|
|
255
|
+
* Parses the complete schema 9 command grammar without mutating caller arguments.
|
|
254
256
|
* @param commandLineArguments The process arguments after the executable path.
|
|
255
257
|
* @returns A normalized command, informational request, or safe invocation error.
|
|
256
258
|
*/
|
|
@@ -482,7 +484,6 @@ var MOLDEA_CLI_ERROR_DEFINITIONS = Object.freeze({
|
|
|
482
484
|
source: "cli"
|
|
483
485
|
})
|
|
484
486
|
});
|
|
485
|
-
var MOLDEA_CLI_GIT_WORKING_TREE_SOURCE = Object.freeze({ kind: "git-working-tree" });
|
|
486
487
|
var MOLDEA_CLI_TOP_LEVEL_HELP = `Usage: moldea <command> [options]
|
|
487
488
|
|
|
488
489
|
Commands:
|
|
@@ -580,16 +581,16 @@ var createMoldeaCliOwnedError = (code, details = EMPTY_ERROR_DETAILS) => {
|
|
|
580
581
|
};
|
|
581
582
|
//#endregion
|
|
582
583
|
//#region src/json-output-contract/document.ts
|
|
583
|
-
/** Creates one strict schema
|
|
584
|
+
/** Creates one strict schema 9 JSON envelope. */
|
|
584
585
|
var createMoldeaCliJsonEnvelope = (input) => Object.freeze({
|
|
585
586
|
cliVersion: input.cliVersion,
|
|
586
587
|
command: input.command,
|
|
587
588
|
error: input.error,
|
|
588
589
|
result: input.result,
|
|
589
|
-
schemaVersion:
|
|
590
|
+
schemaVersion: 9,
|
|
590
591
|
status: input.status
|
|
591
592
|
});
|
|
592
|
-
/** Serializes one schema
|
|
593
|
+
/** Serializes one schema 9 envelope, keys in RFC 8785 order, with its trailing line feed. */
|
|
593
594
|
var serializeMoldeaCliJsonEnvelope = (input) => `${stringifyJsonDeterministically(createMoldeaCliJsonEnvelope(input), { strict: true })}\n`;
|
|
594
595
|
//#endregion
|
|
595
596
|
//#region src/presentation/formatters.ts
|
|
@@ -632,7 +633,7 @@ var formatMoldeaCliHelp = (command) => {
|
|
|
632
633
|
};
|
|
633
634
|
/** Formats one safe CLI error for human stderr output. */
|
|
634
635
|
var formatMoldeaCliHumanError = (error) => `${error.source}:${error.code} ${error.message}\n`;
|
|
635
|
-
/** Formats any strict schema
|
|
636
|
+
/** Formats any strict schema 9 JSON envelope. */
|
|
636
637
|
var formatMoldeaCliJsonResult = (command, result, error, status, cliVersion) => serializeMoldeaCliJsonEnvelope({
|
|
637
638
|
cliVersion,
|
|
638
639
|
command,
|
|
@@ -640,7 +641,7 @@ var formatMoldeaCliJsonResult = (command, result, error, status, cliVersion) =>
|
|
|
640
641
|
result,
|
|
641
642
|
status
|
|
642
643
|
});
|
|
643
|
-
/** Formats one safe schema
|
|
644
|
+
/** Formats one safe schema 9 JSON error envelope. */
|
|
644
645
|
var formatMoldeaCliJsonError = (error, command, cliVersion) => formatMoldeaCliJsonResult(command, null, error, "error", cliVersion);
|
|
645
646
|
/** Formats one valid composition result for human stdout. */
|
|
646
647
|
var formatMoldeaCliHumanCompositionResult = (result, cliVersion) => {
|
|
@@ -648,14 +649,14 @@ var formatMoldeaCliHumanCompositionResult = (result, cliVersion) => {
|
|
|
648
649
|
"The installed CLI composition state is valid.",
|
|
649
650
|
`CLI version: ${cliVersion}`,
|
|
650
651
|
`Supported Node.js: ${result.supportedNodeRange}`,
|
|
651
|
-
`JSON output schema:
|
|
652
|
+
`JSON output schema: 9`,
|
|
652
653
|
`Minimum Git: ${result.minimumGitVersion}`,
|
|
653
654
|
`Repository formats: ${result.repositoryFormatVersions.join(", ")}`,
|
|
654
655
|
"Packages:",
|
|
655
656
|
...result.packages.map(({ name, version }) => ` ${name}: ${version}`)
|
|
656
657
|
].join("\n")}\n`;
|
|
657
658
|
};
|
|
658
|
-
/** Formats one composition result in the strict schema
|
|
659
|
+
/** Formats one composition result in the strict schema 9 envelope. */
|
|
659
660
|
var formatMoldeaCliJsonCompositionResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Composition, result, null, "valid", cliVersion);
|
|
660
661
|
/** Describes completed checks without claiming runtime wiring. */
|
|
661
662
|
var formatCoverage = (counts) => `Coverage: ${counts.bindings} bindings, ${counts.exportsPassed} exports confirmed, ${counts.exportsFailed} exports missing, ${counts.exportsNotChecked} not checked`;
|
|
@@ -671,8 +672,16 @@ var formatMoldeaCliHumanValidateResult = (result) => {
|
|
|
671
672
|
if (result.page.cursor !== null) lines.push("Additional records are available through JSON pagination.");
|
|
672
673
|
return `${lines.join("\n")}\n`;
|
|
673
674
|
};
|
|
674
|
-
/** Formats one validation result in the strict schema
|
|
675
|
-
var formatMoldeaCliJsonValidateResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Validate,
|
|
675
|
+
/** Formats one validation result in the strict schema 9 envelope. */
|
|
676
|
+
var formatMoldeaCliJsonValidateResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Validate, {
|
|
677
|
+
valid: result.valid,
|
|
678
|
+
coverageCounts: result.coverageCounts,
|
|
679
|
+
diagnosticCount: result.diagnosticCount,
|
|
680
|
+
errorCount: result.errorCount,
|
|
681
|
+
warningCount: result.warningCount,
|
|
682
|
+
acceptedWarningCount: result.acceptedWarningCount,
|
|
683
|
+
page: result.page
|
|
684
|
+
}, null, result.valid ? "valid" : "invalid", cliVersion);
|
|
676
685
|
/** Formats one completed metadata inspection for human stdout. */
|
|
677
686
|
var formatMoldeaCliHumanInspectResult = (result) => {
|
|
678
687
|
const lines = createMoldeaCliHumanStatusLines(result.valid, result.formatVersion, result.counts.warnings);
|
|
@@ -682,8 +691,12 @@ var formatMoldeaCliHumanInspectResult = (result) => {
|
|
|
682
691
|
for (const [label, count] of Object.entries(result.counts)) lines.push(`${label}: ${count}`);
|
|
683
692
|
return `${lines.join("\n")}\n`;
|
|
684
693
|
};
|
|
685
|
-
/** Formats one metadata inspection in the strict schema
|
|
686
|
-
var formatMoldeaCliJsonInspectResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Inspect,
|
|
694
|
+
/** Formats one metadata inspection in the strict schema 9 envelope. */
|
|
695
|
+
var formatMoldeaCliJsonInspectResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Inspect, {
|
|
696
|
+
valid: result.valid,
|
|
697
|
+
counts: result.counts,
|
|
698
|
+
page: result.page
|
|
699
|
+
}, null, result.valid ? "valid" : "invalid", cliVersion);
|
|
687
700
|
/** Formats one changed-path scope result for human stdout. */
|
|
688
701
|
var formatMoldeaCliHumanScopeResult = (result) => {
|
|
689
702
|
return `${[
|
|
@@ -692,7 +705,7 @@ var formatMoldeaCliHumanScopeResult = (result) => {
|
|
|
692
705
|
...Object.entries(result.counts).map(([label, count]) => `${label}: ${count}`)
|
|
693
706
|
].join("\n")}\n`;
|
|
694
707
|
};
|
|
695
|
-
/** Formats one changed-path scope result in the strict schema
|
|
708
|
+
/** Formats one changed-path scope result in the strict schema 9 envelope. */
|
|
696
709
|
var formatMoldeaCliJsonScopeResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Scope, result, null, result.valid ? "valid" : "invalid", cliVersion);
|
|
697
710
|
/** Formats one explicit canonical content chunk for human stdout. */
|
|
698
711
|
var formatMoldeaCliHumanContentResult = (result) => {
|
|
@@ -706,7 +719,7 @@ var formatMoldeaCliHumanContentResult = (result) => {
|
|
|
706
719
|
result.chunk.content
|
|
707
720
|
].join("\n")}\n`;
|
|
708
721
|
};
|
|
709
|
-
/** Formats one explicit canonical content chunk in the strict schema
|
|
722
|
+
/** Formats one explicit canonical content chunk in the strict schema 9 envelope. */
|
|
710
723
|
var formatMoldeaCliJsonContentResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Content, result, null, "valid", cliVersion);
|
|
711
724
|
//#endregion
|
|
712
725
|
//#region src/presentation/transformers.ts
|
|
@@ -715,20 +728,13 @@ var assertProjectValidationInvariant = (validation) => {
|
|
|
715
728
|
const observedErrorCount = validation.diagnostics.filter((diagnostic) => diagnostic.severity === "error").length;
|
|
716
729
|
if (!(Number.isSafeInteger(validation.errorCount) && Number.isSafeInteger(validation.warningCount) && validation.errorCount === observedErrorCount && validation.acceptedWarningCount === validation.diagnostics.filter((diagnostic) => diagnostic.severity === "warning" && diagnostic.accepted === true).length && validation.warningCount === validation.diagnostics.length - observedErrorCount - validation.acceptedWarningCount && validation.diagnosticCount === validation.errorCount + validation.warningCount + validation.acceptedWarningCount && validation.valid === (validation.summary !== null && validation.errorCount === 0) && (validation.valid || validation.errorCount > 0))) throw new TypeError("The Core validation result is internally inconsistent.");
|
|
717
730
|
};
|
|
718
|
-
/** Creates one stable composite record key. */
|
|
719
|
-
var createRecordKey = (kind, ...parts) => JSON.stringify([kind, ...parts]);
|
|
720
731
|
/** Projects one diagnostic without retaining arbitrary detail payloads. */
|
|
721
|
-
var createMoldeaCliDiagnosticRecord = (diagnostic,
|
|
732
|
+
var createMoldeaCliDiagnosticRecord = (diagnostic, index) => {
|
|
722
733
|
const record = {
|
|
723
734
|
code: diagnostic.code,
|
|
724
735
|
group: diagnostic.group,
|
|
725
736
|
entity: diagnostic.entity,
|
|
726
|
-
key:
|
|
727
|
-
diagnostic.subject,
|
|
728
|
-
diagnostic.qualifier,
|
|
729
|
-
diagnostic.accepted === true,
|
|
730
|
-
diagnostic.accepted === true ? diagnostic.reason : null
|
|
731
|
-
] : null, occurrence),
|
|
737
|
+
key: createMoldeaCliRecordKey(index),
|
|
732
738
|
kind: "diagnostic",
|
|
733
739
|
message: diagnostic.message,
|
|
734
740
|
path: diagnostic.path,
|
|
@@ -750,64 +756,41 @@ var createMoldeaCliDiagnosticRecord = (diagnostic, occurrence = 0) => {
|
|
|
750
756
|
severity: "error"
|
|
751
757
|
});
|
|
752
758
|
};
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
entity: coverage.entity,
|
|
756
|
-
relationship: coverage.relationship,
|
|
757
|
-
path: coverage.path,
|
|
758
|
-
symbol: coverage.symbol,
|
|
759
|
-
fileCheck: coverage.fileCheck,
|
|
760
|
-
...coverage.exportCheck === "not-checked" ? {
|
|
761
|
-
exportCheck: coverage.exportCheck,
|
|
762
|
-
exportNotCheckedReason: coverage.exportNotCheckedReason
|
|
763
|
-
} : { exportCheck: coverage.exportCheck },
|
|
764
|
-
key: createRecordKey(order, "coverage", coverage.relationship, coverage.entity, coverage.path, coverage.symbol, index),
|
|
765
|
-
kind: "coverage"
|
|
766
|
-
});
|
|
767
|
-
/** Projects one bounded Core inspection item through the schema 8 allowlist. */
|
|
759
|
+
var hasExceptionalCoverage = (coverage) => coverage.fileCheck !== "passed" || coverage.exportCheck !== "passed";
|
|
760
|
+
/** Projects one inventory item or diagnostic without exposing file identities. */
|
|
768
761
|
var createInspectRecord = (item, index) => {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
return Object.freeze(record);
|
|
777
|
-
}
|
|
778
|
-
if (item.kind === "diagnostic") return Object.freeze({
|
|
779
|
-
...createMoldeaCliDiagnosticRecord(item.diagnostic, index),
|
|
780
|
-
key: createRecordKey(order, "diagnostic", item.diagnostic.source, item.diagnostic.severity, item.diagnostic.code, createMoldeaCliDiagnosticRecord(item.diagnostic, index).key)
|
|
781
|
-
});
|
|
782
|
-
if (item.kind === "coverage") return createCoverageRecord(item.coverage, index, order);
|
|
783
|
-
const metadata = item.metadata;
|
|
784
|
-
const record = {
|
|
785
|
-
agentId: metadata.agentId,
|
|
786
|
-
byteLength: metadata.byteLength,
|
|
787
|
-
canonicalDigest: metadata.canonicalDigest,
|
|
788
|
-
decisionId: metadata.decisionId,
|
|
789
|
-
digest: metadata.digest,
|
|
790
|
-
key: createRecordKey(order, "metadata", metadata.path, metadata.kind, metadata.agentId),
|
|
762
|
+
if (item.kind === "diagnostic") return createMoldeaCliDiagnosticRecord(item.diagnostic, index);
|
|
763
|
+
const { agentId, byteLength, decisionId, kind, path } = item.metadata;
|
|
764
|
+
return Object.freeze({
|
|
765
|
+
agentId,
|
|
766
|
+
byteLength,
|
|
767
|
+
decisionId,
|
|
768
|
+
key: createMoldeaCliRecordKey(index),
|
|
791
769
|
kind: "metadata",
|
|
792
|
-
metadataKind:
|
|
793
|
-
path
|
|
794
|
-
|
|
795
|
-
};
|
|
796
|
-
return Object.freeze(record);
|
|
770
|
+
metadataKind: kind,
|
|
771
|
+
path
|
|
772
|
+
});
|
|
797
773
|
};
|
|
798
774
|
/** Creates content-free validation metadata and ordered diagnostic records. */
|
|
799
775
|
var createMoldeaCliValidateProjection = (validation) => {
|
|
800
776
|
assertProjectValidationInvariant(validation);
|
|
801
|
-
const diagnostics = validation.diagnostics.map(
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
777
|
+
const diagnostics = validation.diagnostics.map(createMoldeaCliDiagnosticRecord);
|
|
778
|
+
const records = Object.freeze([...diagnostics, ...validation.coverage.filter(hasExceptionalCoverage).map((coverage, index) => Object.freeze({
|
|
779
|
+
entity: coverage.entity,
|
|
780
|
+
relationship: coverage.relationship,
|
|
781
|
+
path: coverage.path,
|
|
782
|
+
symbol: coverage.symbol,
|
|
783
|
+
fileCheck: coverage.fileCheck,
|
|
784
|
+
...coverage.exportCheck === "not-checked" ? {
|
|
785
|
+
exportCheck: coverage.exportCheck,
|
|
786
|
+
exportNotCheckedReason: coverage.exportNotCheckedReason
|
|
787
|
+
} : { exportCheck: coverage.exportCheck },
|
|
788
|
+
key: createMoldeaCliRecordKey(diagnostics.length + index),
|
|
789
|
+
kind: "coverage"
|
|
790
|
+
}))]);
|
|
809
791
|
const snapshotDigest = calculateMoldeaCliJsonDigest({
|
|
810
|
-
|
|
792
|
+
diagnostics,
|
|
793
|
+
coverage: validation.coverage,
|
|
811
794
|
coverageCounts: validation.coverageCounts,
|
|
812
795
|
acceptedWarningCount: validation.acceptedWarningCount,
|
|
813
796
|
errorCount: validation.errorCount,
|
|
@@ -824,41 +807,22 @@ var createMoldeaCliValidateProjection = (validation) => {
|
|
|
824
807
|
errorCount: validation.errorCount,
|
|
825
808
|
formatVersion: validation.formatVersion,
|
|
826
809
|
snapshotDigest,
|
|
827
|
-
source: MOLDEA_CLI_GIT_WORKING_TREE_SOURCE,
|
|
828
810
|
valid: validation.valid,
|
|
829
811
|
warningCount: validation.warningCount
|
|
830
812
|
});
|
|
831
813
|
};
|
|
832
|
-
/** Projects one bounded
|
|
814
|
+
/** Projects one bounded inspection page through the inventory and diagnostic allowlist. */
|
|
833
815
|
var createMoldeaCliInspectProjection = (inspection) => {
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
digest: inspection.summary.manifestDigest,
|
|
837
|
-
path: inspection.summary.manifestPath
|
|
838
|
-
}),
|
|
839
|
-
project: Object.freeze({
|
|
840
|
-
digest: inspection.summary.projectDigest,
|
|
841
|
-
path: inspection.summary.projectPath
|
|
842
|
-
})
|
|
843
|
-
});
|
|
844
|
-
const records = Object.freeze(inspection.page.records.map(({ item }, index) => createInspectRecord(item, index)));
|
|
845
|
-
const sourceCursors = new Map(inspection.page.records.map((record, index) => {
|
|
846
|
-
const projected = records[index];
|
|
847
|
-
if (projected === void 0) throw new TypeError("A projected inspection record is missing.");
|
|
848
|
-
return [projected.key, record.nextCursor];
|
|
849
|
-
}));
|
|
850
|
-
const snapshotDigest = inspection.inspectionDigest;
|
|
816
|
+
const records = Object.freeze(inspection.records.map(({ item }, index) => createInspectRecord(item, inspection.startIndex + index)));
|
|
817
|
+
const sourceCursors = new Map(inspection.records.map(({ nextCursor }, index) => [createMoldeaCliRecordKey(inspection.startIndex + index), nextCursor]));
|
|
851
818
|
return Object.freeze({
|
|
852
819
|
counts: inspection.counts,
|
|
853
820
|
formatVersion: inspection.formatVersion,
|
|
854
821
|
getSourceCursor: (record) => sourceCursors.get(record.key) ?? null,
|
|
855
|
-
project,
|
|
856
822
|
records,
|
|
857
|
-
snapshotDigest,
|
|
858
|
-
source: MOLDEA_CLI_GIT_WORKING_TREE_SOURCE,
|
|
823
|
+
snapshotDigest: inspection.inspectionDigest,
|
|
859
824
|
coverageCounts: inspection.coverageCounts,
|
|
860
|
-
valid: inspection.valid
|
|
861
|
-
view: inspection.view
|
|
825
|
+
valid: inspection.valid
|
|
862
826
|
});
|
|
863
827
|
};
|
|
864
828
|
//#endregion
|
|
@@ -2428,7 +2392,7 @@ var MOLDEA_CLI_FOUNDATIONAL_PACKAGE_NAMES = Object.freeze([
|
|
|
2428
2392
|
"@moldea.ai/repository-fs"
|
|
2429
2393
|
]);
|
|
2430
2394
|
var MOLDEA_CLI_FIRST_CLASS_PACKAGE_RANGES = Object.freeze({
|
|
2431
|
-
"@moldea.ai/core": "^10.0.
|
|
2395
|
+
"@moldea.ai/core": "^10.0.1",
|
|
2432
2396
|
"@moldea.ai/repository": "^4.0.0",
|
|
2433
2397
|
"@moldea.ai/repository-fs": "^4.0.0"
|
|
2434
2398
|
});
|
|
@@ -2447,7 +2411,7 @@ var hasUniquePositiveIntegers = (entries) => entries.length > 0 && entries.every
|
|
|
2447
2411
|
*/
|
|
2448
2412
|
var isMoldeaCliCompositionStateValid = (input) => {
|
|
2449
2413
|
const { dependencies, installedPackageVersions, supportedNodeRange, version } = input.packageMetadata;
|
|
2450
|
-
if ((0, import_semver.valid)(version) === null || supportedNodeRange === null || (0, import_semver.validRange)(supportedNodeRange) === null || (0, import_semver.valid)(input.minimumGitVersion) === null || input.outputSchemaVersion !==
|
|
2414
|
+
if ((0, import_semver.valid)(version) === null || supportedNodeRange === null || (0, import_semver.validRange)(supportedNodeRange) === null || (0, import_semver.valid)(input.minimumGitVersion) === null || input.outputSchemaVersion !== 9 || dependencies === null || installedPackageVersions === null || !hasUniquePositiveIntegers(input.coreSupportedRepositoryFormatVersions)) return false;
|
|
2451
2415
|
const expectedPackageNames = [...MOLDEA_CLI_FOUNDATIONAL_PACKAGE_NAMES];
|
|
2452
2416
|
const declaredPackageNames = Object.keys(dependencies).filter((packageName) => packageName.startsWith("@moldea.ai/"));
|
|
2453
2417
|
const resolvedPackageNames = Object.keys(installedPackageVersions);
|
|
@@ -2506,10 +2470,10 @@ var resolveMoldeaCliComposition = (input) => {
|
|
|
2506
2470
|
var resolveInstalledMoldeaCliComposition = (input) => resolveMoldeaCliComposition({
|
|
2507
2471
|
coreSupportedRepositoryFormatVersions: SUPPORTED_REPOSITORY_FORMAT_VERSIONS,
|
|
2508
2472
|
minimumGitVersion: MINIMUM_GIT_VERSION,
|
|
2509
|
-
outputSchemaVersion:
|
|
2473
|
+
outputSchemaVersion: 9,
|
|
2510
2474
|
packageMetadata: input.packageMetadata
|
|
2511
2475
|
});
|
|
2512
2476
|
//#endregion
|
|
2513
|
-
export {
|
|
2477
|
+
export { createMoldeaCliRecordKey as A, formatMoldeaCliJsonInspectResult as C, parseMoldeaCliArguments as D, createMoldeaCliOwnedError as E, MOLDEA_CLI_COMMANDS as F, decodeMoldeaCliCursor as M, encodeMoldeaCliCursor as N, isRepositoryDirectoryInputValid as O, MoldeaCliOutputPageException as P, formatMoldeaCliJsonError as S, formatMoldeaCliJsonValidateResult as T, formatMoldeaCliHumanInspectResult as _, require_semver as a, formatMoldeaCliJsonCompositionResult as b, runGitCommand as c, createMoldeaCliInspectProjection as d, createMoldeaCliValidateProjection as f, formatMoldeaCliHumanError as g, formatMoldeaCliHumanContentResult as h, isMoldeaCliCompositionStateValid as i, calculateMoldeaCliJsonDigest as j, createMoldeaCliOutputPage as k, readGit as l, formatMoldeaCliHumanCompositionResult as m, resolveMoldeaCliComposition as n, MoldeaCliCompositionException as o, formatMoldeaCliHelp as p, createMoldeaCliCompositionResult as r, createGitVersionPreflight as s, resolveInstalledMoldeaCliComposition as t, createMoldeaCliDiagnosticRecord as u, formatMoldeaCliHumanScopeResult as v, formatMoldeaCliJsonScopeResult as w, formatMoldeaCliJsonContentResult as x, formatMoldeaCliHumanValidateResult as y };
|
|
2514
2478
|
|
|
2515
|
-
//# sourceMappingURL=composition-
|
|
2479
|
+
//# sourceMappingURL=composition-DymbbpSr.js.map
|