@moldea.ai/cli 11.0.5 → 11.0.6
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 +1 -1
- package/dist/chunks/{composition-yd6mpUnt.js → composition-Bb9UaGLi.js} +2 -2
- package/dist/chunks/{composition-yd6mpUnt.js.map → composition-Bb9UaGLi.js.map} +1 -1
- package/dist/chunks/{composition-B_oQMnbd.js → composition-BkoXoPOQ.js} +1 -1
- package/dist/chunks/{core-composition-h-p3RtWT.js → core-composition-SPqzv6Kz.js} +2 -2
- package/dist/chunks/{core-composition-h-p3RtWT.js.map → core-composition-SPqzv6Kz.js.map} +1 -1
- package/dist/moldea.js +21 -12
- package/dist/moldea.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { o as MoldeaCliCompositionException, t as resolveInstalledMoldeaCliComposition } from "./composition-
|
|
2
|
+
import { o as MoldeaCliCompositionException, t as resolveInstalledMoldeaCliComposition } from "./composition-Bb9UaGLi.js";
|
|
3
3
|
import { createNodeProjectInspection } from "@moldea.ai/core/node";
|
|
4
4
|
//#region src/core-composition/executor.ts
|
|
5
5
|
var calculateRetainedByteLimit = (maxTotalBytes) => maxTotalBytes > Math.floor(Number.MAX_SAFE_INTEGER / 4) ? Number.MAX_SAFE_INTEGER : maxTotalBytes * 4;
|
|
@@ -90,4 +90,4 @@ var executeMoldeaCliCoreInspection = createMoldeaCliCoreInspectionExecutor();
|
|
|
90
90
|
//#endregion
|
|
91
91
|
export { executeMoldeaCliCoreInspection };
|
|
92
92
|
|
|
93
|
-
//# sourceMappingURL=core-composition-
|
|
93
|
+
//# sourceMappingURL=core-composition-SPqzv6Kz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-composition-
|
|
1
|
+
{"version":3,"file":"core-composition-SPqzv6Kz.js","names":[],"sources":["../../src/core-composition/executor.ts"],"sourcesContent":["import type { IDiagnostic, IProjectValidationResult, IBindingCoverage } from '@moldea.ai/core';\nimport { createNodeProjectInspection } from '@moldea.ai/core/node';\n\nimport {\n MoldeaCliCompositionException,\n resolveInstalledMoldeaCliComposition,\n} from '../composition/index.js';\n\nimport type { IMoldeaCliCoreInspectionExecutor, IMoldeaCliNodeInspectionFactory } from './types.js';\n\nconst calculateRetainedByteLimit = (maxTotalBytes: number): number =>\n maxTotalBytes > Math.floor(Number.MAX_SAFE_INTEGER / 4)\n ? Number.MAX_SAFE_INTEGER\n : maxTotalBytes * 4;\n\n/**\n * Creates one isolated inspection per snapshot attempt, with no in-process fallback.\n * @param nodeInspectionFactory The supervised Node inspection boundary.\n * @returns An executor that disposes its worker before returning any successful result.\n */\nexport const createMoldeaCliCoreInspectionExecutor =\n (\n nodeInspectionFactory: IMoldeaCliNodeInspectionFactory = createNodeProjectInspection,\n ): IMoldeaCliCoreInspectionExecutor =>\n async (input) => {\n const inspection = await nodeInspectionFactory({\n repository: input.repository,\n limits: {\n maxDiagnostics: input.resourceLimits.maxDiagnostics,\n maxEntries: input.resourceLimits.maxEntries,\n maxCoverage: input.resourceLimits.maxCoverage,\n maxFileBytes: input.resourceLimits.maxFileBytes,\n maxManifestBytes: input.resourceLimits.maxManifestBytes,\n maxRetainedBytes: calculateRetainedByteLimit(input.resourceLimits.maxTotalBytes),\n maxTotalBytesRead: input.resourceLimits.maxTotalBytes,\n },\n ...(input.signal === undefined ? {} : { signal: input.signal }),\n });\n try {\n if (\n resolveInstalledMoldeaCliComposition({\n packageMetadata: input.packageMetadata,\n }).kind === 'invalid'\n )\n throw new MoldeaCliCompositionException();\n if (input.command === 'inspect')\n return await inspection.readPage({\n ...(input.cursor === undefined ? {} : { cursor: input.cursor }),\n maxItems: Math.min(256, input.resourceLimits.maxEntries),\n view: 'all',\n });\n const diagnostics: IDiagnostic[] = [];\n const coverage: IBindingCoverage[] = [];\n for (const view of ['diagnostics', 'coverage'] as const) {\n let cursor: string | undefined;\n do {\n const result = await inspection.readPage({\n view,\n maxItems: Math.min(256, input.resourceLimits.maxEntries),\n ...(cursor === undefined ? {} : { cursor }),\n });\n for (const { item } of result.page.records) {\n if (item.kind === 'diagnostic') diagnostics.push(item.diagnostic);\n else if (item.kind === 'coverage') coverage.push(item.coverage);\n }\n cursor = result.page.nextCursor ?? undefined;\n } while (cursor !== undefined);\n }\n return Object.freeze({\n diagnostics: Object.freeze(diagnostics),\n coverage: Object.freeze(coverage),\n coverageCounts: inspection.coverageCounts,\n diagnosticCount: inspection.counts.diagnostics,\n acceptedWarningCount: inspection.counts.acceptedWarnings,\n errorCount: inspection.counts.errors,\n warningCount: inspection.counts.warnings,\n valid: inspection.valid,\n formatVersion: inspection.formatVersion,\n source: inspection.source,\n summary: inspection.summary,\n } satisfies IProjectValidationResult);\n } finally {\n await inspection.dispose();\n }\n };\n\n/**\n * Executes one project inspection through the isolated CLI-configured Node boundary.\n * @returns A promise resolving to Core's complete immutable inspection result.\n * @throws\n * - INVALID_RESOURCE_LIMIT: A Core resource limit is invalid.\n * - INVALID_ARGUMENT: The Core operation received an invalid argument.\n * - INVALID_REPOSITORY_PATH: The repository path is invalid.\n * - ENTRY_NOT_FOUND: The requested repository entry was not found.\n * - ENTRY_NOT_FILE: The requested repository entry is not a file.\n * - ENTRY_NOT_DIRECTORY: The requested repository entry is not a directory.\n * - INVALID_PAGE_REQUEST: The repository page request is invalid.\n * - ACCESS_DENIED: Access to the repository source was denied.\n * - SOURCE_UNAVAILABLE: The repository source is unavailable.\n * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.\n * - PROVIDER_INCOMPLETE: The repository provider cannot expose a complete result.\n * - INVALID_SOURCE_DATA: The repository source returned invalid data.\n * - RESOURCE_LIMIT_EXCEEDED: A named repository resource limit was exceeded.\n * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.\n * - ABORTED: The repository operation was aborted.\n * - ABORTED: The Core operation was aborted.\n * - INSPECTION_BUSY: Project inspection capacity is busy. Try again shortly.\n * - INSPECTION_TIMEOUT: The isolated project inspection timed out.\n * - INSPECTION_PROCESS_FAILED: The isolated project inspection failed.\n * - COMPOSITION_STATE_INVALID: The installed composition state is invalid.\n */\nexport const executeMoldeaCliCoreInspection = createMoldeaCliCoreInspectionExecutor();\n"],"mappings":";;;;AAUA,IAAM,8BAA8B,kBAClC,gBAAgB,KAAK,MAAM,OAAO,mBAAmB,CAAC,IAClD,OAAO,mBACP,gBAAgB;;;;;;AAOtB,IAAa,yCAET,wBAAyD,gCAE3D,OAAO,UAAU;CACf,MAAM,aAAa,MAAM,sBAAsB;EAC7C,YAAY,MAAM;EAClB,QAAQ;GACN,gBAAgB,MAAM,eAAe;GACrC,YAAY,MAAM,eAAe;GACjC,aAAa,MAAM,eAAe;GAClC,cAAc,MAAM,eAAe;GACnC,kBAAkB,MAAM,eAAe;GACvC,kBAAkB,2BAA2B,MAAM,eAAe,aAAa;GAC/E,mBAAmB,MAAM,eAAe;EAC1C;EACA,GAAI,MAAM,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ,MAAM,OAAO;CAC/D,CAAC;CACD,IAAI;EACF,IACE,qCAAqC,EACnC,iBAAiB,MAAM,gBACzB,CAAC,CAAC,CAAC,SAAS,WAEZ,MAAM,IAAI,8BAA8B;EAC1C,IAAI,MAAM,YAAY,WACpB,OAAO,MAAM,WAAW,SAAS;GAC/B,GAAI,MAAM,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ,MAAM,OAAO;GAC7D,UAAU,KAAK,IAAI,KAAK,MAAM,eAAe,UAAU;GACvD,MAAM;EACR,CAAC;EACH,MAAM,cAA6B,CAAC;EACpC,MAAM,WAA+B,CAAC;EACtC,KAAK,MAAM,QAAQ,CAAC,eAAe,UAAU,GAAY;GACvD,IAAI;GACJ,GAAG;IACD,MAAM,SAAS,MAAM,WAAW,SAAS;KACvC;KACA,UAAU,KAAK,IAAI,KAAK,MAAM,eAAe,UAAU;KACvD,GAAI,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO;IAC3C,CAAC;IACD,KAAK,MAAM,EAAE,UAAU,OAAO,KAAK,SACjC,IAAI,KAAK,SAAS,cAAc,YAAY,KAAK,KAAK,UAAU;SAC3D,IAAI,KAAK,SAAS,YAAY,SAAS,KAAK,KAAK,QAAQ;IAEhE,SAAS,OAAO,KAAK,cAAc,KAAA;GACrC,SAAS,WAAW,KAAA;EACtB;EACA,OAAO,OAAO,OAAO;GACnB,aAAa,OAAO,OAAO,WAAW;GACtC,UAAU,OAAO,OAAO,QAAQ;GAChC,gBAAgB,WAAW;GAC3B,iBAAiB,WAAW,OAAO;GACnC,sBAAsB,WAAW,OAAO;GACxC,YAAY,WAAW,OAAO;GAC9B,cAAc,WAAW,OAAO;GAChC,OAAO,WAAW;GAClB,eAAe,WAAW;GAC1B,QAAQ,WAAW;GACnB,SAAS,WAAW;EACtB,CAAoC;CACtC,UAAU;EACR,MAAM,WAAW,QAAQ;CAC3B;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BF,IAAa,iCAAiC,sCAAsC"}
|
package/dist/moldea.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as hasOnlyUnicodeScalarValues$1, C as formatMoldeaCliJsonError, D as createMoldeaCliOwnedError, E as formatMoldeaCliJsonValidateResult, F as encodeMoldeaCliCursor, I as MoldeaCliOutputPageException, L as MOLDEA_CLI_COMMANDS, M as createMoldeaCliOutputPage, N as calculateMoldeaCliJsonDigest, O as MOLDEA_CLI_GIT_WORKING_TREE_SOURCE, P as decodeMoldeaCliCursor, S as formatMoldeaCliJsonContentResult, T as formatMoldeaCliJsonScopeResult, _ as formatMoldeaCliHumanError, a as require_semver, b as formatMoldeaCliHumanValidateResult, c as executeGitStreamingProcess, d as createMoldeaCliDiagnosticRecord, f as createMoldeaCliInspectProjection, g as formatMoldeaCliHumanContentResult, h as formatMoldeaCliHumanCompositionResult, j as isRepositoryDirectoryInputValid, k as parseMoldeaCliArguments, l as executeGitProcess, m as formatMoldeaCliHelp, o as MoldeaCliCompositionException, p as createMoldeaCliValidateProjection, s as createGitVersionPreflight, u as MAX_GIT_PROCESS_DIAGNOSTIC_BYTES, v as formatMoldeaCliHumanInspectResult, w as formatMoldeaCliJsonInspectResult, x as formatMoldeaCliJsonCompositionResult, y as formatMoldeaCliHumanScopeResult } from "./chunks/composition-
|
|
2
|
+
import { A as hasOnlyUnicodeScalarValues$1, C as formatMoldeaCliJsonError, D as createMoldeaCliOwnedError, E as formatMoldeaCliJsonValidateResult, F as encodeMoldeaCliCursor, I as MoldeaCliOutputPageException, L as MOLDEA_CLI_COMMANDS, M as createMoldeaCliOutputPage, N as calculateMoldeaCliJsonDigest, O as MOLDEA_CLI_GIT_WORKING_TREE_SOURCE, P as decodeMoldeaCliCursor, S as formatMoldeaCliJsonContentResult, T as formatMoldeaCliJsonScopeResult, _ as formatMoldeaCliHumanError, a as require_semver, b as formatMoldeaCliHumanValidateResult, c as executeGitStreamingProcess, d as createMoldeaCliDiagnosticRecord, f as createMoldeaCliInspectProjection, g as formatMoldeaCliHumanContentResult, h as formatMoldeaCliHumanCompositionResult, j as isRepositoryDirectoryInputValid, k as parseMoldeaCliArguments, l as executeGitProcess, m as formatMoldeaCliHelp, o as MoldeaCliCompositionException, p as createMoldeaCliValidateProjection, s as createGitVersionPreflight, u as MAX_GIT_PROCESS_DIAGNOSTIC_BYTES, v as formatMoldeaCliHumanInspectResult, w as formatMoldeaCliJsonInspectResult, x as formatMoldeaCliJsonCompositionResult, y as formatMoldeaCliHumanScopeResult } from "./chunks/composition-Bb9UaGLi.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -1417,13 +1417,23 @@ var compareRepositoryPaths = (left, right) => {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
};
|
|
1419
1419
|
/**
|
|
1420
|
-
*
|
|
1420
|
+
* Omits invalid external paths and rejects invalid canonical paths before inspection.
|
|
1421
1421
|
* @param input The complete decoded tracked and untracked candidate set.
|
|
1422
|
-
* @returns
|
|
1422
|
+
* @returns Retained candidates, or failure when a canonical candidate is not portable.
|
|
1423
1423
|
*/
|
|
1424
|
-
var
|
|
1425
|
-
|
|
1426
|
-
|
|
1424
|
+
var filterGitInventoryCandidateLogicalPaths = (input) => {
|
|
1425
|
+
const candidates = [];
|
|
1426
|
+
for (const candidate of input.candidates) {
|
|
1427
|
+
if (resolveCandidateRepositoryPath(candidate) === null) {
|
|
1428
|
+
if (candidate.path === "moldea" || candidate.path.startsWith("moldea/")) return createLogicalPathFailure();
|
|
1429
|
+
continue;
|
|
1430
|
+
}
|
|
1431
|
+
candidates.push(candidate);
|
|
1432
|
+
}
|
|
1433
|
+
return Object.freeze({
|
|
1434
|
+
candidates: Object.freeze(candidates),
|
|
1435
|
+
kind: "filtered"
|
|
1436
|
+
});
|
|
1427
1437
|
};
|
|
1428
1438
|
/**
|
|
1429
1439
|
* Converts Git-relative inventory entries into exact repository logical paths.
|
|
@@ -2007,11 +2017,10 @@ var createGitInventoryProbe = (processExecutor = executeGitStreamingProcess, own
|
|
|
2007
2017
|
if (untrackedProcessResult.stderr.byteLength > 0) return createProbeFailure("GIT_OUTPUT_INVALID");
|
|
2008
2018
|
const untrackedCandidates = resolveParserResult(untrackedParser.finish());
|
|
2009
2019
|
if (isProbeFailure(untrackedCandidates)) return untrackedCandidates;
|
|
2010
|
-
const
|
|
2011
|
-
|
|
2012
|
-
if (logicalPathValidationResult.kind === "failed") return logicalPathValidationResult;
|
|
2020
|
+
const logicalPathFilterResult = filterGitInventoryCandidateLogicalPaths({ candidates: Object.freeze([...trackedCandidates, ...untrackedCandidates]) });
|
|
2021
|
+
if (logicalPathFilterResult.kind === "failed") return logicalPathFilterResult;
|
|
2013
2022
|
const ownershipResult = await ownershipFilter({
|
|
2014
|
-
candidates,
|
|
2023
|
+
candidates: logicalPathFilterResult.candidates,
|
|
2015
2024
|
maxMetadataBytes: input.maxMetadataBytes - trackedProcessResult.stdoutBytes - untrackedProcessResult.stdoutBytes,
|
|
2016
2025
|
repositoryRoot: input.repositoryRoot,
|
|
2017
2026
|
...input.signal === void 0 ? {} : { signal: input.signal }
|
|
@@ -2513,11 +2522,11 @@ var createMoldeaCliContentExecutionResult = (pageResult, cliVersion, isJson, cur
|
|
|
2513
2522
|
//#region src/cli-execution/command-executor.ts
|
|
2514
2523
|
/** Loads isolated Core inspection only for commands that need it. */
|
|
2515
2524
|
var executeLazyCoreInspection = async (input) => {
|
|
2516
|
-
const { executeMoldeaCliCoreInspection } = await import("./chunks/core-composition-
|
|
2525
|
+
const { executeMoldeaCliCoreInspection } = await import("./chunks/core-composition-SPqzv6Kz.js");
|
|
2517
2526
|
return executeMoldeaCliCoreInspection(input);
|
|
2518
2527
|
};
|
|
2519
2528
|
var loadInstalledComposition = async (input) => {
|
|
2520
|
-
const { resolveInstalledMoldeaCliComposition } = await import("./chunks/composition-
|
|
2529
|
+
const { resolveInstalledMoldeaCliComposition } = await import("./chunks/composition-BkoXoPOQ.js");
|
|
2521
2530
|
return resolveInstalledMoldeaCliComposition(input);
|
|
2522
2531
|
};
|
|
2523
2532
|
/** Creates one operational error result without exposing caught failure details. */
|