@moldea.ai/cli 10.0.0 → 11.0.1
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 +19 -31
- package/dist/chunks/{composition-DIN3r5rw.js → composition-plpY2VTL.js} +86 -125
- package/dist/chunks/composition-plpY2VTL.js.map +1 -0
- package/dist/chunks/{composition-B1VCddjs.js → composition-qEC_umal.js} +1 -1
- package/dist/chunks/{core-composition-CWyDX8h6.js → core-composition-vn2fp5zf.js} +14 -51
- package/dist/chunks/core-composition-vn2fp5zf.js.map +1 -0
- package/dist/moldea.js +21 -32
- package/dist/moldea.js.map +1 -1
- package/package.json +2 -15
- package/dist/adapter-registry.js +0 -28
- package/dist/adapter-registry.js.map +0 -1
- package/dist/chunks/composition-DIN3r5rw.js.map +0 -1
- package/dist/chunks/core-composition-CWyDX8h6.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# `@moldea.ai/cli`
|
|
4
4
|
|
|
5
|
-
The canonical read-only local command-line composition for deterministic inspection of
|
|
5
|
+
The canonical read-only local command-line composition for deterministic inspection of moldea repositories.
|
|
6
6
|
|
|
7
|
-
The version
|
|
7
|
+
The version 11 executable exposes one schema-7-only 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
9
|
Install and invoke the CLI from each adopted repository. Global or user-home installation is outside the supported trust boundary because it can make unrelated repositories share ambient skill and executable behavior.
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ Tarball, installed-bin, runtime, and testing-peer checks remain the package rele
|
|
|
14
14
|
|
|
15
15
|
The command names are:
|
|
16
16
|
|
|
17
|
-
```
|
|
17
|
+
```bash
|
|
18
18
|
moldea validate
|
|
19
19
|
moldea inspect
|
|
20
20
|
moldea scope --path /src/example.ts
|
|
@@ -23,7 +23,7 @@ moldea content --path /moldea/project.md
|
|
|
23
23
|
moldea composition
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
The executable supports top-level and command-specific help, `moldea --version`, strict option validation, and deterministic usage failures. Repository-backed commands discover and pin a Git working tree, use a no-follow exact-path reader, and retry complete provisional operations when the selected source changes. `validate` and `inspect` run the full Core
|
|
26
|
+
The executable supports top-level and command-specific help, `moldea --version`, strict option validation, and deterministic usage failures. Repository-backed commands discover and pin a Git working tree, use a no-follow exact-path reader, and retry complete provisional operations when the selected source changes. `validate` and `inspect` run the full Core inspection in a supervised analysis worker. The CLI owns repository reads and closes the worker before source post-checks or successful output. `scope` and `content` limit Git inventory to the manifest or requested canonical path. `composition` reports installed executable state without discovering a repository.
|
|
27
27
|
|
|
28
28
|
## Package boundary
|
|
29
29
|
|
|
@@ -32,24 +32,12 @@ The package exposes the `moldea` executable and no supported JavaScript or TypeS
|
|
|
32
32
|
- `@moldea.ai/repository`
|
|
33
33
|
- `@moldea.ai/repository-fs`
|
|
34
34
|
- `@moldea.ai/core`
|
|
35
|
-
- `@moldea.ai/adapter-anthropic`
|
|
36
|
-
- `@moldea.ai/adapter-claude-agent-sdk`
|
|
37
|
-
- `@moldea.ai/adapter-cloudflare-agents`
|
|
38
|
-
- `@moldea.ai/adapter-eve`
|
|
39
|
-
- `@moldea.ai/adapter-google-genai`
|
|
40
|
-
- `@moldea.ai/adapter-langchain`
|
|
41
|
-
- `@moldea.ai/adapter-langgraph`
|
|
42
|
-
- `@moldea.ai/adapter-openai`
|
|
43
|
-
- `@moldea.ai/adapter-openai-agents-sdk`
|
|
44
|
-
- `@moldea.ai/adapter-vercel-ai-sdk`
|
|
45
|
-
|
|
46
|
-
The package-backed `anthropic`, `claude-agent-sdk`, `cloudflare-agents`, `eve`, `google-genai`, `langchain`, `langgraph`, `openai`, `openai-agents-sdk`, and `vercel-ai-sdk` runtime adapters are active. The `custom` adapter remains built into Core and requires no separate package. Target maturity is not part of the CLI contract.
|
|
47
35
|
|
|
48
36
|
The package declares `preferUnplugged: true` so Yarn Plug'n'Play materializes the executable on the physical filesystem instead of leaving the bundled ESM entry point inside ZipFS. This package-owned hint preserves repository-local Yarn execution without requiring client configuration or a `node_modules` linker.
|
|
49
37
|
|
|
50
|
-
The executable derives
|
|
38
|
+
The executable derives composition from its installed manifest, resolved foundational package versions, Core format constants, minimum Git constant and JSON schema constant.
|
|
51
39
|
|
|
52
|
-
The executable performs no network requests, telemetry, repository writes, configured Git content transformations, temporary-index operations
|
|
40
|
+
The executable performs no network requests, telemetry, repository writes, configured Git content transformations, temporary-index operations or object-writing Git commands. Repository commands use read-only Git and no-follow filesystem observations within at most three complete snapshot attempts. Help, version and usage failures skip the installation preflight. The preflight compares installed package metadata; `composition` does not create an inspection worker.
|
|
53
41
|
|
|
54
42
|
## Runtime support
|
|
55
43
|
|
|
@@ -91,7 +79,7 @@ Before attempting a snapshot, the CLI pins the selected root directory, its work
|
|
|
91
79
|
|
|
92
80
|
The CLI retries the complete provisional attempt for differing inventories, Repository FS `SNAPSHOT_CHANGED` failures, and reader-creation missing-entry or parent-type failures when a fresh inventory proves the source changed. It recreates the inventory, reader, wrappers, operation state, and filesystem resource budget for every retry and never reuses provisional bytes or results. Three total attempts are allowed. Exhaustion or a changed pinned identity returns `cli:WORKING_TREE_UNSTABLE` with message `The working tree did not remain stable.` and `retryable: true`.
|
|
93
81
|
|
|
94
|
-
The CLI does not expose selected paths, candidate paths, resolved repository roots, raw process errors, or Git diagnostics in failures. Every accepted snapshot operation creates a fresh Core instance with the exact effective limits: `maxEntries`, `maxFileBytes`, `maxManifestBytes`, `maxDiagnostics`, and `
|
|
82
|
+
The CLI does not expose selected paths, candidate paths, resolved repository roots, raw process errors, or Git diagnostics in failures. Every accepted snapshot operation creates a fresh Core instance with the exact effective limits: `maxEntries`, `maxFileBytes`, `maxManifestBytes`, `maxDiagnostics`, and `maxCoverage` retain their names, while `maxTotalBytes` becomes Core's `maxTotalBytesRead`. Core's logical `maxRetainedBytes` ceiling is four times that total-read limit, capped at JavaScript's maximum safe integer, so validation and prepared inspection state remain bounded without adding another CLI option. Each `inspect` attempt prepares one content-free Core inspection and reads its requested page without a second validation pass.
|
|
95
83
|
|
|
96
84
|
Core resource refusals are mapped without loss into safe CLI error details: the limit name, configured maximum, observed or projected usage, and stable next action remain available, while repository bodies and private host diagnostics remain absent.
|
|
97
85
|
|
|
@@ -99,33 +87,33 @@ Known `RepositorySourceException`, `CoreConfigurationException`, and `CoreOperat
|
|
|
99
87
|
|
|
100
88
|
## Cancellation and process signals
|
|
101
89
|
|
|
102
|
-
The executable owns one operation-scoped `AbortController`. Repository-backed commands pass its signal through every Git child process, working-tree snapshot step, Repository FS creation, repository read, Core operation
|
|
90
|
+
The executable owns one operation-scoped `AbortController`. Repository-backed commands pass its signal through every Git child process, working-tree snapshot step, Repository FS creation, repository read, Core operation. `SIGINT` and `SIGTERM` abort the active operation, prevent another snapshot retry, discard an unwritten result, and exit with code `130` and `143`, respectively. The first received signal determines the exit code. A signal received after output has been completely written does not alter the completed result.
|
|
103
91
|
|
|
104
92
|
Git process cancellation uses the safe retryable `git:GIT_OPERATION_ABORTED` contract with message `The Git operation was aborted.` at internal command boundaries. When cancellation originates from a process signal before output completion, the executable may emit no human or JSON document rather than expose a successful or partial result. Active Git child processes are terminated through the same operation signal; no raw abort reason or process diagnostic is printed.
|
|
105
93
|
|
|
106
|
-
A
|
|
94
|
+
A completed Core inspection produces content-free `validate` output. Zero errors return `valid` and exit `0`; errors return `invalid` and exit `1`. Every diagnostic has severity and group. Warnings have a stable subject and qualifier, acceptance eligibility, an accepted flag and its reason when accepted. Complete errors, unaccepted warnings and accepted warnings are counted separately on every JSON page.
|
|
107
95
|
|
|
108
|
-
|
|
96
|
+
Binding coverage reports the checks performed on each declared reference: `fileCheck`, `exportCheck`, and a reason when an export could not be checked. TypeScript and JavaScript ESM use conservative syntax-only export inventories; CommonJS, unsupported extensions and inconclusive syntax remain not checked. A passed export check does not establish runtime wiring or SDK compatibility. Interrupted operations return an error without a partial coverage result.
|
|
109
97
|
|
|
110
|
-
`inspect` uses the same completion status and exit codes.
|
|
98
|
+
`inspect` uses the same completion status and exit codes. Its allowlisted pages contain agent/runtime assignments, 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`.
|
|
111
99
|
|
|
112
|
-
`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 relationship matcher
|
|
100
|
+
`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 digests, and paged match or diagnostic records. `content` accepts exactly one canonical moldea text path and returns metadata plus the largest complete Unicode-scalar chunk that fits its output page.
|
|
113
101
|
|
|
114
102
|
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.
|
|
115
103
|
|
|
116
|
-
The 65,536
|
|
104
|
+
The default output budget remains 65,536 bytes. The [historical release observations](../../docs/launch-readiness.md) record the earlier resource corpus and its original package versions; those measurements do not establish current release performance. Large traversals use additional bounded pages without raising the page peak. The 1 MiB hard maximum is a single-response safety boundary, not a total repository-size limit.
|
|
117
105
|
|
|
118
106
|
The `inspect` unresolved count includes project-owned and agent-owned requirements across all effects. IDs are scoped to their owners, so identical IDs under different owners count separately. These readiness gaps do not themselves invalidate structurally valid project state.
|
|
119
107
|
|
|
120
|
-
Each CLI invocation is stateless. An `inspect --cursor` call repeats Git inventory and Core preparation before returning its page; a prepared Core inspection used within one process can read further pages without repeating that work.
|
|
108
|
+
Each CLI invocation is stateless. An `inspect --cursor` call repeats Git inventory and Core preparation before returning its page; a prepared Core inspection used within one process can read further pages without repeating that work. Use `scope` for changed-path relevance and `content` for one canonical file when a full inspection is unnecessary, and request only the pages needed for the task.
|
|
121
109
|
|
|
122
110
|
## Installed composition and integrity
|
|
123
111
|
|
|
124
|
-
Before `validate`, `inspect
|
|
112
|
+
Before `validate`, `inspect` or `composition` returns a result, installation checks compare package identities and resolved versions, compatible-major dependency declarations, Core format support, minimum Git and JSON schema constants. Source dependencies use `workspace:^<minimum>` and packed dependencies use `^<minimum>`. Missing, additional, prerelease or breaking-major substitutions fail closed. Compatible patches and minor releases are reported exactly by `composition`.
|
|
125
113
|
|
|
126
|
-
`composition` reports the installed CLI
|
|
114
|
+
`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.
|
|
127
115
|
|
|
128
|
-
Successful human and JSON reports use exit code `0`; JSON uses status `valid` and the schema
|
|
116
|
+
Successful human and JSON reports use exit code `0`; JSON uses status `valid` and the schema 7 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.
|
|
129
117
|
|
|
130
118
|
## Development
|
|
131
119
|
|
|
@@ -142,6 +130,6 @@ pnpm --filter @moldea.ai/cli test
|
|
|
142
130
|
|
|
143
131
|
Unit, integration, and end-to-end tests are colocated with their owning modules. The end-to-end suite installs real package tarballs and executes the resulting package bin without requiring any `@moldea.ai/*` package to be published. It verifies command, output, exit, security, package-content, process-signal, and repository-immutability behavior at the consumer boundary.
|
|
144
132
|
|
|
145
|
-
CI
|
|
133
|
+
CI packs Repository, Repository FS, Core and CLI and tests installed commands across the supported Node versions on Linux, macOS and Windows. The packed Node harness checks bounded paging, handled worker exhaustion, timeout, readmission and parent-loss cleanup. Its failure fixtures inject only the worker workload while retaining the real packed supervisor and IPC. The fifteen repository-neutral corpus workloads run three cold samples each and check expected errors and warnings. SDK calls and runtime wiring are outside this guarantee.
|
|
146
134
|
|
|
147
|
-
|
|
135
|
+
The consumer checksum selection and qualification evidence live in [`consumers/`](../../consumers/). Historical evidence applies only to its recorded versions and sources.
|
|
@@ -21,7 +21,7 @@ var MOLDEA_CLI_OPTIONS = {
|
|
|
21
21
|
Cursor: "--cursor",
|
|
22
22
|
MaxDiagnostics: "--max-diagnostics",
|
|
23
23
|
MaxEntries: "--max-entries",
|
|
24
|
-
|
|
24
|
+
MaxCoverage: "--max-coverage",
|
|
25
25
|
MaxFileBytes: "--max-file-bytes",
|
|
26
26
|
MaxManifestBytes: "--max-manifest-bytes",
|
|
27
27
|
MaxOutputBytes: "--max-output-bytes",
|
|
@@ -35,7 +35,7 @@ var MOLDEA_CLI_OPTIONS = {
|
|
|
35
35
|
var DEFAULT_MOLDEA_CLI_RESOURCE_LIMITS = Object.freeze({
|
|
36
36
|
maxDiagnostics: 1e4,
|
|
37
37
|
maxEntries: 1e5,
|
|
38
|
-
|
|
38
|
+
maxCoverage: 1e4,
|
|
39
39
|
maxFileBytes: 8388608,
|
|
40
40
|
maxManifestBytes: 2097152,
|
|
41
41
|
maxTotalBytes: 134217728
|
|
@@ -282,7 +282,7 @@ var parsePositiveSafeInteger = (input) => {
|
|
|
282
282
|
const parsedInteger = Number(input);
|
|
283
283
|
return Number.isSafeInteger(parsedInteger) && parsedInteger > 0 ? parsedInteger : null;
|
|
284
284
|
};
|
|
285
|
-
/** Parses one output byte budget inside the schema
|
|
285
|
+
/** Parses one output byte budget inside the schema 7 transport bounds. */
|
|
286
286
|
var parseMoldeaCliOutputByteLimit = (input) => {
|
|
287
287
|
const parsed = parsePositiveSafeInteger(input);
|
|
288
288
|
return parsed !== null && parsed >= 4096 && parsed <= 1048576 ? parsed : null;
|
|
@@ -313,7 +313,7 @@ var COMMAND_NAMES = new Set(Object.values(MOLDEA_CLI_COMMANDS));
|
|
|
313
313
|
var RESOURCE_OPTION_FIELDS = {
|
|
314
314
|
[MOLDEA_CLI_OPTIONS.MaxDiagnostics]: "maxDiagnostics",
|
|
315
315
|
[MOLDEA_CLI_OPTIONS.MaxEntries]: "maxEntries",
|
|
316
|
-
[MOLDEA_CLI_OPTIONS.
|
|
316
|
+
[MOLDEA_CLI_OPTIONS.MaxCoverage]: "maxCoverage",
|
|
317
317
|
[MOLDEA_CLI_OPTIONS.MaxFileBytes]: "maxFileBytes",
|
|
318
318
|
[MOLDEA_CLI_OPTIONS.MaxManifestBytes]: "maxManifestBytes",
|
|
319
319
|
[MOLDEA_CLI_OPTIONS.MaxTotalBytes]: "maxTotalBytes"
|
|
@@ -328,7 +328,7 @@ var isMoldeaCliCommand = (input) => {
|
|
|
328
328
|
return input !== void 0 && COMMAND_NAMES.has(input);
|
|
329
329
|
};
|
|
330
330
|
/**
|
|
331
|
-
* Parses the complete schema
|
|
331
|
+
* Parses the complete schema 7 command grammar without mutating caller arguments.
|
|
332
332
|
* @param commandLineArguments The process arguments after the executable path.
|
|
333
333
|
* @returns A normalized command, informational request, or safe invocation error.
|
|
334
334
|
*/
|
|
@@ -416,10 +416,10 @@ var parseMoldeaCliArguments = (commandLineArguments) => {
|
|
|
416
416
|
if ((hasPathInput || hasStdinInput) && !isScope && !isContent) return createArgumentError("INVALID_ARGUMENT", command, isJson);
|
|
417
417
|
if (isScope && hasPathInput === hasStdinInput) return createArgumentError("INVALID_ARGUMENT", command, isJson);
|
|
418
418
|
if (isContent && (!hasPathInput || hasStdinInput)) return createArgumentError("INVALID_ARGUMENT", command, isJson);
|
|
419
|
-
if (isScope && seenOptions.has(MOLDEA_CLI_OPTIONS.
|
|
419
|
+
if (isScope && seenOptions.has(MOLDEA_CLI_OPTIONS.MaxCoverage)) return createArgumentError("INVALID_ARGUMENT", command, isJson);
|
|
420
420
|
if (isContent && [
|
|
421
421
|
MOLDEA_CLI_OPTIONS.MaxDiagnostics,
|
|
422
|
-
MOLDEA_CLI_OPTIONS.
|
|
422
|
+
MOLDEA_CLI_OPTIONS.MaxCoverage,
|
|
423
423
|
MOLDEA_CLI_OPTIONS.MaxManifestBytes
|
|
424
424
|
].some((option) => seenOptions.has(option))) return createArgumentError("INVALID_ARGUMENT", command, isJson);
|
|
425
425
|
if (!isJson && (cursor !== null || seenOptions.has(MOLDEA_CLI_OPTIONS.MaxOutputBytes))) return createArgumentError("INVALID_ARGUMENT", command, isJson);
|
|
@@ -590,7 +590,7 @@ var INSPECTION_RESOURCE_OPTIONS_HELP = `${BASE_RESOURCE_OPTIONS_HELP} --max-man
|
|
|
590
590
|
var PAGINATION_OPTIONS_HELP = ` --max-output-bytes <integer> Bound JSON output from 4096 to 1048576 bytes.
|
|
591
591
|
--cursor <opaque-cursor> Continue a prior JSON result page.
|
|
592
592
|
`;
|
|
593
|
-
var COMPLETE_INSPECTION_OPTIONS_HELP = `${REPOSITORY_OPTIONS_HELP}${INSPECTION_RESOURCE_OPTIONS_HELP} --max-
|
|
593
|
+
var COMPLETE_INSPECTION_OPTIONS_HELP = `${REPOSITORY_OPTIONS_HELP}${INSPECTION_RESOURCE_OPTIONS_HELP} --max-coverage <integer> Override the binding coverage count limit.
|
|
594
594
|
${PAGINATION_OPTIONS_HELP}`;
|
|
595
595
|
var SCOPE_OPTIONS_HELP = `${REPOSITORY_OPTIONS_HELP}${INSPECTION_RESOURCE_OPTIONS_HELP}${PAGINATION_OPTIONS_HELP}`;
|
|
596
596
|
var CONTENT_OPTIONS_HELP = `${REPOSITORY_OPTIONS_HELP}${BASE_RESOURCE_OPTIONS_HELP}${PAGINATION_OPTIONS_HELP}`;
|
|
@@ -657,16 +657,16 @@ var createMoldeaCliOwnedError = (code) => {
|
|
|
657
657
|
};
|
|
658
658
|
//#endregion
|
|
659
659
|
//#region src/json-output-contract/document.ts
|
|
660
|
-
/** Creates one strict schema
|
|
660
|
+
/** Creates one strict schema 7 JSON envelope. */
|
|
661
661
|
var createMoldeaCliJsonEnvelope = (input) => Object.freeze({
|
|
662
662
|
cliVersion: input.cliVersion,
|
|
663
663
|
command: input.command,
|
|
664
664
|
error: input.error,
|
|
665
665
|
result: input.result,
|
|
666
|
-
schemaVersion:
|
|
666
|
+
schemaVersion: 7,
|
|
667
667
|
status: input.status
|
|
668
668
|
});
|
|
669
|
-
/** Serializes one schema
|
|
669
|
+
/** Serializes one schema 7 envelope with its required trailing line feed. */
|
|
670
670
|
var serializeMoldeaCliJsonEnvelope = (input) => `${serializeJsonDeterministically(createMoldeaCliJsonEnvelope(input))}\n`;
|
|
671
671
|
//#endregion
|
|
672
672
|
//#region src/presentation/formatters.ts
|
|
@@ -676,7 +676,8 @@ var DIAGNOSTIC_ENTITY_KEYS = [
|
|
|
676
676
|
"capabilityId",
|
|
677
677
|
"decisionId",
|
|
678
678
|
"variableId",
|
|
679
|
-
"
|
|
679
|
+
"contextPath",
|
|
680
|
+
"integrationPath"
|
|
680
681
|
];
|
|
681
682
|
/** Formats one diagnostic entity in the canonical Core field order. */
|
|
682
683
|
var formatMoldeaCliHumanDiagnosticEntity = (entity) => DIAGNOSTIC_ENTITY_KEYS.flatMap((key) => {
|
|
@@ -690,13 +691,8 @@ var formatMoldeaCliHumanDiagnostic = (diagnostic) => {
|
|
|
690
691
|
if (diagnostic.pointer !== null) lines.push(` pointer: ${diagnostic.pointer}`);
|
|
691
692
|
if (diagnostic.entity !== null) lines.push(` entity: ${formatMoldeaCliHumanDiagnosticEntity(diagnostic.entity)}`);
|
|
692
693
|
if (diagnostic.severity === "warning") {
|
|
693
|
-
lines.push(`
|
|
694
|
-
lines.push(`
|
|
695
|
-
if (diagnostic.details.reason === "version-dependent-behavior") {
|
|
696
|
-
lines.push(` package: ${diagnostic.details.packageName}`);
|
|
697
|
-
lines.push(` declared range: ${diagnostic.details.declaredRange ?? "unavailable"}`);
|
|
698
|
-
lines.push(` behavior boundary: ${diagnostic.details.boundaryVersion}`);
|
|
699
|
-
}
|
|
694
|
+
lines.push(` subject: ${diagnostic.subject}`);
|
|
695
|
+
if (diagnostic.qualifier !== null) lines.push(` qualifier: ${diagnostic.qualifier}`);
|
|
700
696
|
}
|
|
701
697
|
return lines.join("\n");
|
|
702
698
|
};
|
|
@@ -714,7 +710,7 @@ var formatMoldeaCliHelp = (command) => {
|
|
|
714
710
|
};
|
|
715
711
|
/** Formats one safe CLI error for human stderr output. */
|
|
716
712
|
var formatMoldeaCliHumanError = (error) => `${error.source}:${error.code} ${error.message}\n`;
|
|
717
|
-
/** Formats any strict schema
|
|
713
|
+
/** Formats any strict schema 7 JSON envelope. */
|
|
718
714
|
var formatMoldeaCliJsonResult = (command, result, error, status, cliVersion) => serializeMoldeaCliJsonEnvelope({
|
|
719
715
|
cliVersion,
|
|
720
716
|
command,
|
|
@@ -722,7 +718,7 @@ var formatMoldeaCliJsonResult = (command, result, error, status, cliVersion) =>
|
|
|
722
718
|
result,
|
|
723
719
|
status
|
|
724
720
|
});
|
|
725
|
-
/** Formats one safe schema
|
|
721
|
+
/** Formats one safe schema 7 JSON error envelope. */
|
|
726
722
|
var formatMoldeaCliJsonError = (error, command, cliVersion) => formatMoldeaCliJsonResult(command, null, error, "error", cliVersion);
|
|
727
723
|
/** Formats one valid composition result for human stdout. */
|
|
728
724
|
var formatMoldeaCliHumanCompositionResult = (result, cliVersion) => {
|
|
@@ -730,38 +726,41 @@ var formatMoldeaCliHumanCompositionResult = (result, cliVersion) => {
|
|
|
730
726
|
"The installed CLI composition state is valid.",
|
|
731
727
|
`CLI version: ${cliVersion}`,
|
|
732
728
|
`Supported Node.js: ${result.supportedNodeRange}`,
|
|
733
|
-
`JSON output schema:
|
|
729
|
+
`JSON output schema: 7`,
|
|
734
730
|
`Minimum Git: ${result.minimumGitVersion}`,
|
|
735
731
|
`Repository formats: ${result.repositoryFormatVersions.join(", ")}`,
|
|
736
732
|
"Packages:",
|
|
737
|
-
...result.packages.map(({ name, version }) => ` ${name}: ${version}`)
|
|
738
|
-
"Adapters:",
|
|
739
|
-
...result.adapters.map(({ id, repositoryFormatVersions }) => ` ${id}: repository formats ${repositoryFormatVersions.join(", ")}`)
|
|
733
|
+
...result.packages.map(({ name, version }) => ` ${name}: ${version}`)
|
|
740
734
|
].join("\n")}\n`;
|
|
741
735
|
};
|
|
742
|
-
/** Formats one composition result in the strict schema
|
|
736
|
+
/** Formats one composition result in the strict schema 7 envelope. */
|
|
743
737
|
var formatMoldeaCliJsonCompositionResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Composition, result, null, "valid", cliVersion);
|
|
738
|
+
/** Describes completed checks without claiming runtime wiring. */
|
|
739
|
+
var formatCoverage = (counts) => `Coverage: ${counts.bindings} bindings, ${counts.exportsPassed} exports confirmed, ${counts.exportsFailed} exports missing, ${counts.exportsNotChecked} not checked`;
|
|
744
740
|
/** Formats one completed validation result for human stdout. */
|
|
745
741
|
var formatMoldeaCliHumanValidateResult = (result) => {
|
|
746
742
|
const lines = createMoldeaCliHumanStatusLines(result.valid, result.formatVersion, result.warningCount);
|
|
747
|
-
lines.push(
|
|
748
|
-
for (const
|
|
743
|
+
lines.push(formatCoverage(result.coverageCounts));
|
|
744
|
+
for (const record of result.page.records) if (record.kind === "diagnostic" && !(record.severity === "warning" && record.accepted)) lines.push(formatMoldeaCliHumanDiagnostic(record));
|
|
749
745
|
lines.push(formatMoldeaCliHumanCount(result.diagnosticCount, "Diagnostic", "Diagnostics"));
|
|
750
746
|
lines.push(formatMoldeaCliHumanCount(result.errorCount, "Error", "Errors"));
|
|
751
747
|
lines.push(formatMoldeaCliHumanCount(result.warningCount, "Warning", "Warnings"));
|
|
752
|
-
|
|
748
|
+
lines.push(`${result.acceptedWarningCount} accepted ${result.acceptedWarningCount === 1 ? "warning" : "warnings"}`);
|
|
749
|
+
if (result.page.cursor !== null) lines.push("Additional records are available through JSON pagination.");
|
|
753
750
|
return `${lines.join("\n")}\n`;
|
|
754
751
|
};
|
|
755
|
-
/** Formats one validation result in the strict schema
|
|
752
|
+
/** Formats one validation result in the strict schema 7 envelope. */
|
|
756
753
|
var formatMoldeaCliJsonValidateResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Validate, result, null, result.valid ? "valid" : "invalid", cliVersion);
|
|
757
754
|
/** Formats one completed metadata inspection for human stdout. */
|
|
758
755
|
var formatMoldeaCliHumanInspectResult = (result) => {
|
|
759
756
|
const lines = createMoldeaCliHumanStatusLines(result.valid, result.formatVersion, result.counts.warnings);
|
|
760
|
-
lines.push(
|
|
757
|
+
lines.push(formatCoverage(result.coverageCounts));
|
|
758
|
+
lines.push(`${result.counts.acceptedWarnings} accepted ${result.counts.acceptedWarnings === 1 ? "warning" : "warnings"}`);
|
|
759
|
+
for (const record of result.page.records) if (record.kind === "diagnostic" && !(record.severity === "warning" && record.accepted)) lines.push(formatMoldeaCliHumanDiagnostic(record));
|
|
761
760
|
for (const [label, count] of Object.entries(result.counts)) lines.push(`${label}: ${count}`);
|
|
762
761
|
return `${lines.join("\n")}\n`;
|
|
763
762
|
};
|
|
764
|
-
/** Formats one metadata inspection in the strict schema
|
|
763
|
+
/** Formats one metadata inspection in the strict schema 7 envelope. */
|
|
765
764
|
var formatMoldeaCliJsonInspectResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Inspect, result, null, result.valid ? "valid" : "invalid", cliVersion);
|
|
766
765
|
/** Formats one changed-path scope result for human stdout. */
|
|
767
766
|
var formatMoldeaCliHumanScopeResult = (result) => {
|
|
@@ -771,7 +770,7 @@ var formatMoldeaCliHumanScopeResult = (result) => {
|
|
|
771
770
|
...Object.entries(result.counts).map(([label, count]) => `${label}: ${count}`)
|
|
772
771
|
].join("\n")}\n`;
|
|
773
772
|
};
|
|
774
|
-
/** Formats one changed-path scope result in the strict schema
|
|
773
|
+
/** Formats one changed-path scope result in the strict schema 7 envelope. */
|
|
775
774
|
var formatMoldeaCliJsonScopeResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Scope, result, null, result.valid ? "valid" : "invalid", cliVersion);
|
|
776
775
|
/** Formats one explicit canonical content chunk for human stdout. */
|
|
777
776
|
var formatMoldeaCliHumanContentResult = (result) => {
|
|
@@ -785,14 +784,14 @@ var formatMoldeaCliHumanContentResult = (result) => {
|
|
|
785
784
|
result.chunk.content
|
|
786
785
|
].join("\n")}\n`;
|
|
787
786
|
};
|
|
788
|
-
/** Formats one explicit canonical content chunk in the strict schema
|
|
787
|
+
/** Formats one explicit canonical content chunk in the strict schema 7 envelope. */
|
|
789
788
|
var formatMoldeaCliJsonContentResult = (result, cliVersion) => formatMoldeaCliJsonResult(MOLDEA_CLI_COMMANDS.Content, result, null, "valid", cliVersion);
|
|
790
789
|
//#endregion
|
|
791
790
|
//#region src/presentation/transformers.ts
|
|
792
791
|
/** Rejects a Core validation result whose completion fields contradict its validity. */
|
|
793
792
|
var assertProjectValidationInvariant = (validation) => {
|
|
794
793
|
const observedErrorCount = validation.diagnostics.filter((diagnostic) => diagnostic.severity === "error").length;
|
|
795
|
-
if (!(Number.isSafeInteger(validation.errorCount) && Number.isSafeInteger(validation.warningCount) && validation.errorCount === observedErrorCount && validation.warningCount === validation.diagnostics.length - observedErrorCount && validation.valid === (validation.summary !== null && validation.errorCount === 0) && (validation.valid || validation.errorCount > 0))) throw new TypeError("The Core validation result is internally inconsistent.");
|
|
794
|
+
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.");
|
|
796
795
|
};
|
|
797
796
|
/** Creates one stable composite record key. */
|
|
798
797
|
var createRecordKey = (kind, ...parts) => JSON.stringify([kind, ...parts]);
|
|
@@ -800,8 +799,14 @@ var createRecordKey = (kind, ...parts) => JSON.stringify([kind, ...parts]);
|
|
|
800
799
|
var createMoldeaCliDiagnosticRecord = (diagnostic, occurrence = 0) => {
|
|
801
800
|
const record = {
|
|
802
801
|
code: diagnostic.code,
|
|
802
|
+
group: diagnostic.group,
|
|
803
803
|
entity: diagnostic.entity,
|
|
804
|
-
key: createRecordKey("diagnostic", diagnostic.source, diagnostic.severity, diagnostic.code, diagnostic.path, diagnostic.pointer, diagnostic.severity === "warning" ?
|
|
804
|
+
key: createRecordKey("diagnostic", diagnostic.source, diagnostic.severity, diagnostic.code, diagnostic.path, diagnostic.pointer, diagnostic.severity === "warning" ? [
|
|
805
|
+
diagnostic.subject,
|
|
806
|
+
diagnostic.qualifier,
|
|
807
|
+
diagnostic.accepted === true,
|
|
808
|
+
diagnostic.accepted === true ? diagnostic.reason : null
|
|
809
|
+
] : null, occurrence),
|
|
805
810
|
kind: "diagnostic",
|
|
806
811
|
message: diagnostic.message,
|
|
807
812
|
path: diagnostic.path,
|
|
@@ -809,29 +814,35 @@ var createMoldeaCliDiagnosticRecord = (diagnostic, occurrence = 0) => {
|
|
|
809
814
|
range: diagnostic.range,
|
|
810
815
|
source: diagnostic.source
|
|
811
816
|
};
|
|
812
|
-
if (diagnostic.severity === "warning") {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
relationship: diagnostic.details.relationship
|
|
822
|
-
});
|
|
823
|
-
return Object.freeze({
|
|
824
|
-
...record,
|
|
825
|
-
details,
|
|
826
|
-
severity: "warning"
|
|
827
|
-
});
|
|
828
|
-
}
|
|
817
|
+
if (diagnostic.severity === "warning") return Object.freeze({
|
|
818
|
+
...record,
|
|
819
|
+
severity: "warning",
|
|
820
|
+
subject: diagnostic.subject,
|
|
821
|
+
qualifier: diagnostic.qualifier,
|
|
822
|
+
acceptable: diagnostic.acceptable,
|
|
823
|
+
accepted: diagnostic.accepted === true,
|
|
824
|
+
reason: diagnostic.accepted === true ? diagnostic.reason : null
|
|
825
|
+
});
|
|
829
826
|
return Object.freeze({
|
|
830
827
|
...record,
|
|
831
828
|
severity: "error"
|
|
832
829
|
});
|
|
833
830
|
};
|
|
834
|
-
/** Projects
|
|
831
|
+
/** Projects a binding's file and export checks with a stable record key. */
|
|
832
|
+
var createCoverageRecord = (coverage, index, order = "coverage") => Object.freeze({
|
|
833
|
+
entity: coverage.entity,
|
|
834
|
+
relationship: coverage.relationship,
|
|
835
|
+
path: coverage.path,
|
|
836
|
+
symbol: coverage.symbol,
|
|
837
|
+
fileCheck: coverage.fileCheck,
|
|
838
|
+
...coverage.exportCheck === "not-checked" ? {
|
|
839
|
+
exportCheck: coverage.exportCheck,
|
|
840
|
+
exportNotCheckedReason: coverage.exportNotCheckedReason
|
|
841
|
+
} : { exportCheck: coverage.exportCheck },
|
|
842
|
+
key: createRecordKey(order, "coverage", coverage.relationship, coverage.entity, coverage.path, coverage.symbol, index),
|
|
843
|
+
kind: "coverage"
|
|
844
|
+
});
|
|
845
|
+
/** Projects one bounded Core inspection item through the schema 7 allowlist. */
|
|
835
846
|
var createInspectRecord = (item, index) => {
|
|
836
847
|
const order = index.toString().padStart(6, "0");
|
|
837
848
|
if (item.kind === "agent") {
|
|
@@ -845,26 +856,9 @@ var createInspectRecord = (item, index) => {
|
|
|
845
856
|
}
|
|
846
857
|
if (item.kind === "diagnostic") return Object.freeze({
|
|
847
858
|
...createMoldeaCliDiagnosticRecord(item.diagnostic, index),
|
|
848
|
-
key: createRecordKey(order, "diagnostic", item.diagnostic.source, item.diagnostic.severity, item.diagnostic.code, item.diagnostic
|
|
859
|
+
key: createRecordKey(order, "diagnostic", item.diagnostic.source, item.diagnostic.severity, item.diagnostic.code, createMoldeaCliDiagnosticRecord(item.diagnostic, index).key)
|
|
849
860
|
});
|
|
850
|
-
if (item.kind === "
|
|
851
|
-
const evidence = item.evidence;
|
|
852
|
-
const record = {
|
|
853
|
-
agentId: evidence.agentId,
|
|
854
|
-
capabilityId: evidence.capabilityId,
|
|
855
|
-
capabilityKind: evidence.capabilityKind,
|
|
856
|
-
evidenceKind: evidence.kind,
|
|
857
|
-
key: createRecordKey(order, "evidence", evidence.source, evidence.kind, evidence.agentId, evidence.capabilityKind, evidence.capabilityId, evidence.runtimeName),
|
|
858
|
-
kind: "evidence",
|
|
859
|
-
references: Object.freeze(evidence.references.map((reference) => Object.freeze({
|
|
860
|
-
path: reference.path,
|
|
861
|
-
symbol: reference.symbol ?? null
|
|
862
|
-
}))),
|
|
863
|
-
runtimeName: evidence.runtimeName,
|
|
864
|
-
source: evidence.source
|
|
865
|
-
};
|
|
866
|
-
return Object.freeze(record);
|
|
867
|
-
}
|
|
861
|
+
if (item.kind === "coverage") return createCoverageRecord(item.coverage, index, order);
|
|
868
862
|
const metadata = item.metadata;
|
|
869
863
|
const record = {
|
|
870
864
|
agentId: metadata.agentId,
|
|
@@ -884,27 +878,31 @@ var createInspectRecord = (item, index) => {
|
|
|
884
878
|
var createMoldeaCliValidateProjection = (validation) => {
|
|
885
879
|
assertProjectValidationInvariant(validation);
|
|
886
880
|
const diagnostics = Object.freeze(validation.diagnostics.map((diagnostic, index) => createMoldeaCliDiagnosticRecord(diagnostic, index)).sort((left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : 0));
|
|
881
|
+
const records = Object.freeze([...diagnostics, ...validation.coverage.map((coverage, index) => createCoverageRecord(coverage, index))].sort((left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : 0));
|
|
887
882
|
const snapshotDigest = calculateMoldeaCliJsonDigest({
|
|
888
|
-
|
|
883
|
+
records,
|
|
884
|
+
coverageCounts: validation.coverageCounts,
|
|
885
|
+
acceptedWarningCount: validation.acceptedWarningCount,
|
|
889
886
|
errorCount: validation.errorCount,
|
|
890
887
|
formatVersion: validation.formatVersion,
|
|
891
888
|
summary: validation.summary,
|
|
892
|
-
runtimeInspection: validation.runtimeInspection,
|
|
893
889
|
valid: validation.valid,
|
|
894
890
|
warningCount: validation.warningCount
|
|
895
891
|
});
|
|
896
892
|
return Object.freeze({
|
|
897
|
-
|
|
893
|
+
records,
|
|
894
|
+
diagnosticCount: validation.diagnosticCount,
|
|
895
|
+
acceptedWarningCount: validation.acceptedWarningCount,
|
|
896
|
+
coverageCounts: validation.coverageCounts,
|
|
898
897
|
errorCount: validation.errorCount,
|
|
899
898
|
formatVersion: validation.formatVersion,
|
|
900
899
|
snapshotDigest,
|
|
901
900
|
source: MOLDEA_CLI_GIT_WORKING_TREE_SOURCE,
|
|
902
|
-
runtimeInspection: validation.runtimeInspection,
|
|
903
901
|
valid: validation.valid,
|
|
904
902
|
warningCount: validation.warningCount
|
|
905
903
|
});
|
|
906
904
|
};
|
|
907
|
-
/** Projects one bounded Core page through the content-free schema
|
|
905
|
+
/** Projects one bounded Core page through the content-free schema 7 allowlist. */
|
|
908
906
|
var createMoldeaCliInspectProjection = (inspection) => {
|
|
909
907
|
const project = inspection.summary === null ? null : Object.freeze({
|
|
910
908
|
manifest: Object.freeze({
|
|
@@ -931,7 +929,7 @@ var createMoldeaCliInspectProjection = (inspection) => {
|
|
|
931
929
|
records,
|
|
932
930
|
snapshotDigest,
|
|
933
931
|
source: MOLDEA_CLI_GIT_WORKING_TREE_SOURCE,
|
|
934
|
-
|
|
932
|
+
coverageCounts: inspection.coverageCounts,
|
|
935
933
|
valid: inspection.valid,
|
|
936
934
|
view: inspection.view
|
|
937
935
|
});
|
|
@@ -2735,51 +2733,28 @@ var MOLDEA_CLI_FOUNDATIONAL_PACKAGE_NAMES = Object.freeze([
|
|
|
2735
2733
|
"@moldea.ai/repository",
|
|
2736
2734
|
"@moldea.ai/repository-fs"
|
|
2737
2735
|
]);
|
|
2738
|
-
var MOLDEA_CLI_ADAPTER_PACKAGE_PREFIX = "@moldea.ai/adapter-";
|
|
2739
|
-
var MOLDEA_CLI_CUSTOM_ADAPTER_ID = "custom";
|
|
2740
2736
|
var MOLDEA_CLI_FIRST_CLASS_PACKAGE_RANGES = Object.freeze({
|
|
2741
|
-
"@moldea.ai/
|
|
2742
|
-
"@moldea.ai/adapter-claude-agent-sdk": "^5.0.0",
|
|
2743
|
-
"@moldea.ai/adapter-cloudflare-agents": "^5.0.0",
|
|
2744
|
-
"@moldea.ai/adapter-eve": "^5.0.0",
|
|
2745
|
-
"@moldea.ai/adapter-google-genai": "^5.0.0",
|
|
2746
|
-
"@moldea.ai/adapter-langchain": "^5.0.0",
|
|
2747
|
-
"@moldea.ai/adapter-langgraph": "^5.0.0",
|
|
2748
|
-
"@moldea.ai/adapter-openai": "^6.0.0",
|
|
2749
|
-
"@moldea.ai/adapter-openai-agents-sdk": "^5.0.0",
|
|
2750
|
-
"@moldea.ai/adapter-vercel-ai-sdk": "^5.0.0",
|
|
2751
|
-
"@moldea.ai/core": "^6.0.0",
|
|
2737
|
+
"@moldea.ai/core": "^7.0.0",
|
|
2752
2738
|
"@moldea.ai/repository": "^2.0.0",
|
|
2753
2739
|
"@moldea.ai/repository-fs": "^2.0.3"
|
|
2754
2740
|
});
|
|
2755
2741
|
//#endregion
|
|
2756
2742
|
//#region src/composition/validations.ts
|
|
2757
|
-
var ADAPTER_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
2758
2743
|
var hasExactStringSet = (left, right) => {
|
|
2759
2744
|
if (left.length !== right.length || new Set(left).size !== left.length || new Set(right).size !== right.length) return false;
|
|
2760
2745
|
const rightValues = new Set(right);
|
|
2761
2746
|
return left.every((entry) => rightValues.has(entry));
|
|
2762
2747
|
};
|
|
2763
2748
|
var hasUniquePositiveIntegers = (entries) => entries.length > 0 && entries.every((entry) => Number.isSafeInteger(entry) && entry > 0) && new Set(entries).size === entries.length;
|
|
2764
|
-
var createActiveAdapterMap = (adapters, coreRepositoryFormatVersions) => {
|
|
2765
|
-
const adapterMap = /* @__PURE__ */ new Map();
|
|
2766
|
-
for (const adapter of adapters) {
|
|
2767
|
-
if (adapterMap.has(adapter.id) || adapter.id === "custom" || !ADAPTER_ID_PATTERN.test(adapter.id) || !hasUniquePositiveIntegers(adapter.supportedRepositoryFormatVersions) || adapter.supportedRepositoryFormatVersions.some((version) => !coreRepositoryFormatVersions.includes(version))) return null;
|
|
2768
|
-
adapterMap.set(adapter.id, adapter);
|
|
2769
|
-
}
|
|
2770
|
-
return adapterMap;
|
|
2771
|
-
};
|
|
2772
2749
|
/**
|
|
2773
|
-
* Verifies the installed package manifest and
|
|
2774
|
-
* @param input The installed package, Core,
|
|
2750
|
+
* Verifies the installed package manifest and resolved package composition.
|
|
2751
|
+
* @param input The installed package, Core, Git, and JSON-schema state.
|
|
2775
2752
|
* @returns Whether every runtime composition invariant is satisfied.
|
|
2776
2753
|
*/
|
|
2777
2754
|
var isMoldeaCliCompositionStateValid = (input) => {
|
|
2778
2755
|
const { dependencies, installedPackageVersions, supportedNodeRange, version } = input.packageMetadata;
|
|
2779
|
-
if ((0, import_semver.valid)(version) === null || supportedNodeRange === null || (0, import_semver.validRange)(supportedNodeRange) === null || (0, import_semver.valid)(input.minimumGitVersion) === null || input.outputSchemaVersion !==
|
|
2780
|
-
const
|
|
2781
|
-
if (activeAdapterMap === null) return false;
|
|
2782
|
-
const expectedPackageNames = [...MOLDEA_CLI_FOUNDATIONAL_PACKAGE_NAMES, ...[...activeAdapterMap.keys()].map((adapterId) => `${MOLDEA_CLI_ADAPTER_PACKAGE_PREFIX}${adapterId}`)];
|
|
2756
|
+
if ((0, import_semver.valid)(version) === null || supportedNodeRange === null || (0, import_semver.validRange)(supportedNodeRange) === null || (0, import_semver.valid)(input.minimumGitVersion) === null || input.outputSchemaVersion !== 7 || dependencies === null || installedPackageVersions === null || !hasUniquePositiveIntegers(input.coreSupportedRepositoryFormatVersions)) return false;
|
|
2757
|
+
const expectedPackageNames = [...MOLDEA_CLI_FOUNDATIONAL_PACKAGE_NAMES];
|
|
2783
2758
|
const declaredPackageNames = Object.keys(dependencies).filter((packageName) => packageName.startsWith("@moldea.ai/"));
|
|
2784
2759
|
const resolvedPackageNames = Object.keys(installedPackageVersions);
|
|
2785
2760
|
if (!hasExactStringSet(declaredPackageNames, expectedPackageNames) || !hasExactStringSet(resolvedPackageNames, expectedPackageNames)) return false;
|
|
@@ -2812,19 +2787,11 @@ var freezeCompositionValue = (value) => {
|
|
|
2812
2787
|
* @returns A deeply immutable composition result in deterministic report order.
|
|
2813
2788
|
*/
|
|
2814
2789
|
var createMoldeaCliCompositionResult = (input) => {
|
|
2815
|
-
const adapters = [{
|
|
2816
|
-
id: MOLDEA_CLI_CUSTOM_ADAPTER_ID,
|
|
2817
|
-
repositoryFormatVersions: [...input.coreSupportedRepositoryFormatVersions].sort((left, right) => left - right)
|
|
2818
|
-
}, ...input.activeAdapters.map((adapter) => ({
|
|
2819
|
-
id: adapter.id,
|
|
2820
|
-
repositoryFormatVersions: [...adapter.supportedRepositoryFormatVersions].sort((left, right) => left - right)
|
|
2821
|
-
}))].sort((left, right) => compareIdentifiers(left.id, right.id));
|
|
2822
2790
|
const packages = Object.entries(input.packageMetadata.installedPackageVersions ?? {}).map(([name, version]) => ({
|
|
2823
2791
|
name,
|
|
2824
2792
|
version
|
|
2825
2793
|
})).sort((left, right) => compareIdentifiers(left.name, right.name));
|
|
2826
2794
|
return freezeCompositionValue({
|
|
2827
|
-
adapters,
|
|
2828
2795
|
minimumGitVersion: input.minimumGitVersion,
|
|
2829
2796
|
packages,
|
|
2830
2797
|
repositoryFormatVersions: [...input.coreSupportedRepositoryFormatVersions].sort((left, right) => left - right),
|
|
@@ -2834,10 +2801,6 @@ var createMoldeaCliCompositionResult = (input) => {
|
|
|
2834
2801
|
//#endregion
|
|
2835
2802
|
//#region src/composition/composition.ts
|
|
2836
2803
|
var INVALID_COMPOSITION_RESOLUTION = Object.freeze({ kind: "invalid" });
|
|
2837
|
-
var EXPECTED_ADAPTERS = Object.keys(MOLDEA_CLI_FIRST_CLASS_PACKAGE_RANGES).filter((name) => name.startsWith(MOLDEA_CLI_ADAPTER_PACKAGE_PREFIX)).map((name) => ({
|
|
2838
|
-
id: name.slice(MOLDEA_CLI_ADAPTER_PACKAGE_PREFIX.length),
|
|
2839
|
-
supportedRepositoryFormatVersions: SUPPORTED_REPOSITORY_FORMAT_VERSIONS
|
|
2840
|
-
}));
|
|
2841
2804
|
/**
|
|
2842
2805
|
* Resolves one explicit runtime composition without emitting a partial composition result.
|
|
2843
2806
|
* @param input The installed and actual runtime state to compare.
|
|
@@ -2855,19 +2818,17 @@ var resolveMoldeaCliComposition = (input) => {
|
|
|
2855
2818
|
}
|
|
2856
2819
|
};
|
|
2857
2820
|
/**
|
|
2858
|
-
* Checks installed package metadata and
|
|
2859
|
-
*
|
|
2860
|
-
* @param input The installed package metadata and optional actual executable identities.
|
|
2821
|
+
* Checks installed package metadata and resolved first-class package identities.
|
|
2822
|
+
* @param input The installed package metadata.
|
|
2861
2823
|
* @returns A valid immutable result or the single invalid-state outcome.
|
|
2862
2824
|
*/
|
|
2863
2825
|
var resolveInstalledMoldeaCliComposition = (input) => resolveMoldeaCliComposition({
|
|
2864
|
-
activeAdapters: input.activeAdapters ?? EXPECTED_ADAPTERS,
|
|
2865
2826
|
coreSupportedRepositoryFormatVersions: SUPPORTED_REPOSITORY_FORMAT_VERSIONS,
|
|
2866
2827
|
minimumGitVersion: MINIMUM_GIT_VERSION,
|
|
2867
|
-
outputSchemaVersion:
|
|
2828
|
+
outputSchemaVersion: 7,
|
|
2868
2829
|
packageMetadata: input.packageMetadata
|
|
2869
2830
|
});
|
|
2870
2831
|
//#endregion
|
|
2871
2832
|
export { hasOnlyUnicodeScalarValues as A, formatMoldeaCliJsonError as C, createMoldeaCliOwnedError as D, formatMoldeaCliJsonValidateResult as E, encodeMoldeaCliCursor as F, MoldeaCliOutputPageException as I, MOLDEA_CLI_COMMANDS as L, createMoldeaCliOutputPage as M, calculateMoldeaCliJsonDigest as N, MOLDEA_CLI_GIT_WORKING_TREE_SOURCE as O, decodeMoldeaCliCursor as P, formatMoldeaCliJsonContentResult as S, formatMoldeaCliJsonScopeResult as T, formatMoldeaCliHumanError as _, require_semver as a, formatMoldeaCliHumanValidateResult as b, executeGitStreamingProcess as c, createMoldeaCliDiagnosticRecord as d, createMoldeaCliInspectProjection as f, formatMoldeaCliHumanContentResult as g, formatMoldeaCliHumanCompositionResult as h, isMoldeaCliCompositionStateValid as i, isRepositoryDirectoryInputValid as j, parseMoldeaCliArguments as k, executeGitProcess as l, formatMoldeaCliHelp as m, resolveMoldeaCliComposition as n, MoldeaCliCompositionException as o, createMoldeaCliValidateProjection as p, createMoldeaCliCompositionResult as r, createGitVersionPreflight as s, resolveInstalledMoldeaCliComposition as t, MAX_GIT_PROCESS_DIAGNOSTIC_BYTES as u, formatMoldeaCliHumanInspectResult as v, formatMoldeaCliJsonInspectResult as w, formatMoldeaCliJsonCompositionResult as x, formatMoldeaCliHumanScopeResult as y };
|
|
2872
2833
|
|
|
2873
|
-
//# sourceMappingURL=composition-
|
|
2834
|
+
//# sourceMappingURL=composition-plpY2VTL.js.map
|