@moldea.ai/cli 14.0.0 → 14.0.2

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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{composition-_3bygS_a.js → composition-BzwNJ346.js} +2 -2
  3. package/dist/chunks/{composition-_3bygS_a.js.map → composition-BzwNJ346.js.map} +1 -1
  4. package/dist/chunks/{composition-D1OYuZ5d.js → composition-aJXeA6un.js} +1 -1
  5. package/dist/chunks/{core-composition-BKcJ--NX.js → core-composition-CzdeqYS9.js} +2 -2
  6. package/dist/chunks/{core-composition-BKcJ--NX.js.map → core-composition-CzdeqYS9.js.map} +1 -1
  7. package/dist/moldea.js +3 -3
  8. package/dist/portable/SHA256SUMS +16 -16
  9. package/dist/portable/analysis-worker.mjs +110 -133
  10. package/dist/portable/chunk-1b3c5f05.mjs +1837 -0
  11. package/dist/portable/chunk-24ea7c23.mjs +328 -0
  12. package/dist/portable/chunk-2cc3bf5c.mjs +399 -0
  13. package/dist/portable/chunk-2e9d4c63.mjs +95 -0
  14. package/dist/portable/chunk-8a1dadf9.mjs +2 -0
  15. package/dist/portable/chunk-8f198616.mjs +4414 -0
  16. package/dist/portable/chunk-936e5d09.mjs +112519 -0
  17. package/dist/portable/chunk-98d84174.mjs +422 -0
  18. package/dist/portable/chunk-a6007228.mjs +302 -0
  19. package/dist/portable/chunk-b1f86976.mjs +2 -0
  20. package/dist/portable/chunk-cea1378f.mjs +50 -0
  21. package/dist/portable/chunk-d372f5e0.mjs +3120 -0
  22. package/dist/portable/chunk-d6656fa6.mjs +14 -0
  23. package/dist/portable/moldea.mjs +1997 -2870
  24. package/dist/portable/node-runner.mjs +77 -106
  25. package/package.json +2 -2
  26. package/dist/portable/chunk-131f8005.mjs +0 -115
  27. package/dist/portable/chunk-2ba7e89e.mjs +0 -26
  28. package/dist/portable/chunk-459da9cf.mjs +0 -4138
  29. package/dist/portable/chunk-728df961.mjs +0 -544
  30. package/dist/portable/chunk-8d6114d2.mjs +0 -588
  31. package/dist/portable/chunk-90403e67.mjs +0 -2
  32. package/dist/portable/chunk-94b5ac22.mjs +0 -59
  33. package/dist/portable/chunk-a5514957.mjs +0 -5870
  34. package/dist/portable/chunk-b98ca669.mjs +0 -2
  35. package/dist/portable/chunk-c13db66a.mjs +0 -380
  36. package/dist/portable/chunk-d5af3eda.mjs +0 -2926
  37. package/dist/portable/chunk-ec3f49d3.mjs +0 -367
  38. package/dist/portable/chunk-fcbcf4e3.mjs +0 -147458
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { t as resolveInstalledMoldeaCliComposition } from "./composition-_3bygS_a.js";
2
+ import { t as resolveInstalledMoldeaCliComposition } from "./composition-BzwNJ346.js";
3
3
  export { resolveInstalledMoldeaCliComposition };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { o as MoldeaCliCompositionException, t as resolveInstalledMoldeaCliComposition } from "./composition-_3bygS_a.js";
2
+ import { o as MoldeaCliCompositionException, t as resolveInstalledMoldeaCliComposition } from "./composition-BzwNJ346.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;
@@ -91,4 +91,4 @@ var executeMoldeaCliCoreInspection = createMoldeaCliCoreInspectionExecutor();
91
91
  //#endregion
92
92
  export { executeMoldeaCliCoreInspection };
93
93
 
94
- //# sourceMappingURL=core-composition-BKcJ--NX.js.map
94
+ //# sourceMappingURL=core-composition-CzdeqYS9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-composition-BKcJ--NX.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 ...(input.instructions === undefined ? {} : { instructions: input.instructions }),\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,GAAI,MAAM,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,cAAc,MAAM,aAAa;EAC/E,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"}
1
+ {"version":3,"file":"core-composition-CzdeqYS9.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 ...(input.instructions === undefined ? {} : { instructions: input.instructions }),\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,GAAI,MAAM,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,cAAc,MAAM,aAAa;EAC/E,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 createMoldeaCliOutputPage, C as formatMoldeaCliJsonInspectResult, D as MOLDEA_CLI_GIT_WORKING_TREE_SOURCE, E as createMoldeaCliOwnedError, F as MOLDEA_CLI_COMMANDS, M as decodeMoldeaCliCursor, N as encodeMoldeaCliCursor, O as parseMoldeaCliArguments, P as MoldeaCliOutputPageException, S as formatMoldeaCliJsonError, T as formatMoldeaCliJsonValidateResult, _ as formatMoldeaCliHumanInspectResult, a as require_semver, b as formatMoldeaCliJsonCompositionResult, c as runGitCommand, d as createMoldeaCliInspectProjection, f as createMoldeaCliValidateProjection, g as formatMoldeaCliHumanError, h as formatMoldeaCliHumanContentResult, j as calculateMoldeaCliJsonDigest, k as isRepositoryDirectoryInputValid, l as readGit, m as formatMoldeaCliHumanCompositionResult, o as MoldeaCliCompositionException, p as formatMoldeaCliHelp, s as createGitVersionPreflight, u as createMoldeaCliDiagnosticRecord, v as formatMoldeaCliHumanScopeResult, w as formatMoldeaCliJsonScopeResult, x as formatMoldeaCliJsonContentResult, y as formatMoldeaCliHumanValidateResult } from "./chunks/composition-_3bygS_a.js";
2
+ import { A as createMoldeaCliOutputPage, C as formatMoldeaCliJsonInspectResult, D as MOLDEA_CLI_GIT_WORKING_TREE_SOURCE, E as createMoldeaCliOwnedError, F as MOLDEA_CLI_COMMANDS, M as decodeMoldeaCliCursor, N as encodeMoldeaCliCursor, O as parseMoldeaCliArguments, P as MoldeaCliOutputPageException, S as formatMoldeaCliJsonError, T as formatMoldeaCliJsonValidateResult, _ as formatMoldeaCliHumanInspectResult, a as require_semver, b as formatMoldeaCliJsonCompositionResult, c as runGitCommand, d as createMoldeaCliInspectProjection, f as createMoldeaCliValidateProjection, g as formatMoldeaCliHumanError, h as formatMoldeaCliHumanContentResult, j as calculateMoldeaCliJsonDigest, k as isRepositoryDirectoryInputValid, l as readGit, m as formatMoldeaCliHumanCompositionResult, o as MoldeaCliCompositionException, p as formatMoldeaCliHelp, s as createGitVersionPreflight, u as createMoldeaCliDiagnosticRecord, v as formatMoldeaCliHumanScopeResult, w as formatMoldeaCliJsonScopeResult, x as formatMoldeaCliJsonContentResult, y as formatMoldeaCliHumanValidateResult } from "./chunks/composition-BzwNJ346.js";
3
3
  import path from "node:path";
4
4
  import process from "node:process";
5
5
  import { fileURLToPath } from "node:url";
@@ -2593,11 +2593,11 @@ var createMoldeaCliContentExecutionResult = (pageResult, cliVersion, isJson, cur
2593
2593
  //#region src/cli-execution/command-executor.ts
2594
2594
  /** Loads isolated Core inspection only for commands that need it. */
2595
2595
  var executeLazyCoreInspection = async (input) => {
2596
- const { executeMoldeaCliCoreInspection } = await import("./chunks/core-composition-BKcJ--NX.js");
2596
+ const { executeMoldeaCliCoreInspection } = await import("./chunks/core-composition-CzdeqYS9.js");
2597
2597
  return executeMoldeaCliCoreInspection(input);
2598
2598
  };
2599
2599
  var loadInstalledComposition = async (input) => {
2600
- const { resolveInstalledMoldeaCliComposition } = await import("./chunks/composition-D1OYuZ5d.js");
2600
+ const { resolveInstalledMoldeaCliComposition } = await import("./chunks/composition-aJXeA6un.js");
2601
2601
  return resolveInstalledMoldeaCliComposition(input);
2602
2602
  };
2603
2603
  /** Creates one operational error result without exposing caught failure details. */
@@ -1,17 +1,17 @@
1
1
  0205722958a215e7ce78cb29148273f0a6fde98348e75eccc109cac640025d85 LICENSES.md
2
- a17295f897c35f217fee537d1593ec2199b48f6898dffbca6199c7b5eca9f43e analysis-worker.mjs
3
- 023a752a563b843ca3aca521d0ed723d3a83b793ad35da0b2c7125141cbb9786 chunk-131f8005.mjs
4
- 7701236556da36a7b40fe775fb59996a67b252fc5fab24727069628f0b57d783 chunk-2ba7e89e.mjs
5
- 012cfc140c97daad6ec22f7a4beb60232fffebdd3111fd6f7e1856938f085ec0 chunk-459da9cf.mjs
6
- 127703a717cd1554a7e2d8f2de607dda34566fede0fbd1564907707586be6461 chunk-728df961.mjs
7
- 89528781474a5b1a002ed3573003049332b5d88f2a15e891d07df47479393c62 chunk-8d6114d2.mjs
8
- c6bc726e2d175028a6258d700b9f85af0834b06764734c932c1d1ca22d5a1d92 chunk-90403e67.mjs
9
- 16f734780ee62174adf98d9e918bd08285d9b7788abc516c69a1b19180948f20 chunk-94b5ac22.mjs
10
- e777329a736ebac3c8352d995c4b5578054f463dcda641e472ffa7c64136f20d chunk-a5514957.mjs
11
- 19ec5e7a41f8deaf0f722f415fa33cf2ef525f56fd6267511d36be237023f389 chunk-b98ca669.mjs
12
- b13aa3082c3bd846829a1e432bc563f070c8340214baf462de77266c54c42001 chunk-c13db66a.mjs
13
- c66f4c808c3b0c7e1cdf81668aedbffab1861a10b4af1f5650b96d9c69a40fa9 chunk-d5af3eda.mjs
14
- e6d37f11a658f4d0a6166e473d16f6fb397d5e50b65e343c8d8a5fce36626bec chunk-ec3f49d3.mjs
15
- 947bbd54bcf0d4b61b74470afb76d9c0c7eaaf5ff7b4f354e095f5fba9579b16 chunk-fcbcf4e3.mjs
16
- 81f142a1cc9f27a195231bc893aa96e77d48297a8123a99fa8df1e0ee8328c45 moldea.mjs
17
- ed6a1553ffbc369270fe8ed7d262fa931edfdbcec469cf786a263c42ea38cf60 node-runner.mjs
2
+ 597ebd3f09ff1fe91b97f59284af80f42685862d601fce18e044bc5b1298ad82 analysis-worker.mjs
3
+ b117b1b1a38b3e730a13f68c9360853d22581c904ef7d6941e19caeef988ad93 chunk-1b3c5f05.mjs
4
+ 309270827f3c8c03fcc10faab12496c0406d3cebd4c88095bf363a91c3d0cf2b chunk-24ea7c23.mjs
5
+ ab01914500c78d3e80476a31f6a391a2f71dcaa90ffb51957e755b405888f46f chunk-2cc3bf5c.mjs
6
+ 6467b7f8899d34dd5bb33220e374b3374c9ceecd7287a8b636d5ba6ff3660236 chunk-2e9d4c63.mjs
7
+ fd397a9f15a991883a78f2302b814d535c45bf6a13856a40769786384c204a9e chunk-8a1dadf9.mjs
8
+ ee0158f7c33a6d7bc02daaaa765ef563f9e7933a4348d51b835225593b4012be chunk-8f198616.mjs
9
+ 752a9d6ac664c3e9dd6dfd48353a2492b40d1ba2765e3dcdfbc9cabc96831ee5 chunk-936e5d09.mjs
10
+ 43b23d20df294cd54bdaf82185b69dc2d8053a68c03638e3e04325fda54a899e chunk-98d84174.mjs
11
+ 97c635d48e674192082fe159c739aef436689547db948d4b10c2e102054e9f2c chunk-a6007228.mjs
12
+ ea0c29115dbbd2acce912907e9e3082e03d2611e618b05caf6f551c7e084b97b chunk-b1f86976.mjs
13
+ 2b77dd4cfa61ef00ff17dc38743b25e35a75cdbae9c8bf1ba6558f9cc6b3213e chunk-cea1378f.mjs
14
+ e005d8286f5a53518328372ecfb2835e2a516b0bce4e4b2d893387952cd614a1 chunk-d372f5e0.mjs
15
+ a44ec936d7894b899d5129c48a864eb4bbf72a20c2780e8e5b5187eb108a85f5 chunk-d6656fa6.mjs
16
+ e5232995a28d919fb1dd7975bc35ad7770f258835e3267ac7371475a354cbed8 moldea.mjs
17
+ 9de4371650b271b2ee753581e52540a5481e9bdb8aa7742e1252550f475e7123 node-runner.mjs
@@ -1,193 +1,170 @@
1
- import { n as CoreOperationException } from "./chunk-728df961.mjs";
2
- import { u as normalizeCoreOptions } from "./chunk-a5514957.mjs";
3
- import { i as RepositorySourceException } from "./chunk-8d6114d2.mjs";
4
- import { a as createInspectionProcessFailure, c as encodeInspectionMessage, i as NODE_INSPECTION_TRANSPORT_BYTES, l as serializeInspectionFailure, o as decodeInspectionMessage, s as deserializeInspectionFailure, t as NODE_INSPECTION_FILE_PAGE_BYTES } from "./chunk-ec3f49d3.mjs";
5
- import { a as parseRpcLinkText, i as parseRpcFilePage, n as parseRpcEntry, r as parseRpcEntryPage } from "./chunk-131f8005.mjs";
6
- import { parentPort, workerData } from "node:worker_threads";
7
- import { getHeapStatistics } from "node:v8";
1
+ import { n as e } from "./chunk-2cc3bf5c.mjs";
2
+ import { u as t } from "./chunk-8f198616.mjs";
3
+ import { i as n } from "./chunk-98d84174.mjs";
4
+ import { a as r, c as i, i as a, l as o, o as s, s as c, t as l } from "./chunk-24ea7c23.mjs";
5
+ import { a as u, i as d, n as f, r as p } from "./chunk-2e9d4c63.mjs";
6
+ import { parentPort as m, workerData as h } from "node:worker_threads";
7
+ import { getHeapStatistics as g } from "node:v8";
8
8
  //#region ../core/dist/analysis-worker.js
9
- var port = parentPort;
10
- if (port === null) throw createInspectionProcessFailure();
11
- var start = decodeInspectionMessage(workerData);
12
- if (start.kind !== "start") throw createInspectionProcessFailure();
13
- var attemptId = start.attemptId;
14
- var maxAnalysisHeapBytes = getHeapStatistics().heap_size_limit;
15
- var inspection;
16
- var hasRun = false;
17
- var isReadingPage = false;
18
- var nextRequestId = 0;
19
- var pending = new Map();
20
- var send = (message) => {
21
- port.postMessage(encodeInspectionMessage(message));
22
- };
23
- var requestReader = (request) => {
24
- if (pending.size >= 4) return Promise.reject(new CoreOperationException({
9
+ var _ = m;
10
+ if (_ === null) throw r();
11
+ var v = s(h);
12
+ if (v.kind !== "start") throw r();
13
+ var y = v.attemptId, b = g().heap_size_limit, x, S = !1, C = !1, w = 0, T = new Map(), E = (e) => {
14
+ _.postMessage(i(e));
15
+ }, D = (t) => {
16
+ if (T.size >= 4) return Promise.reject(new e({
25
17
  code: "RESOURCE_LIMIT_EXCEEDED",
26
18
  operation: "create-project-inspection",
27
19
  limit: "maxReaderRequests",
28
20
  limitMaximum: 4,
29
- observedUsage: pending.size + 1,
21
+ observedUsage: T.size + 1,
30
22
  nextAction: null
31
23
  }));
32
- const requestId = nextRequestId++;
33
- return new Promise((resolve, reject) => {
34
- pending.set(requestId, {
35
- resolve,
36
- reject
24
+ let n = w++;
25
+ return new Promise((e, i) => {
26
+ T.set(n, {
27
+ resolve: e,
28
+ reject: i
37
29
  });
38
30
  try {
39
- send({
40
- attemptId,
31
+ E({
32
+ attemptId: y,
41
33
  kind: "reader-request",
42
- requestId,
43
- request
34
+ requestId: n,
35
+ request: t
44
36
  });
45
- } catch (cause) {
46
- pending.delete(requestId);
47
- reject(cause instanceof Error ? cause : createInspectionProcessFailure(cause));
37
+ } catch (e) {
38
+ T.delete(n), i(e instanceof Error ? e : r(e));
48
39
  }
49
40
  });
50
- };
51
- var createProxyReader = (source, snapshot) => ({
52
- snapshot,
53
- getEntry: async (path) => parseRpcEntry(await requestReader({
41
+ }, O = (e, t) => ({
42
+ snapshot: t,
43
+ getEntry: async (t) => f(await D({
54
44
  method: "getEntry",
55
- path,
56
- source
45
+ path: t,
46
+ source: e
57
47
  })),
58
- listEntriesPage: async (options) => source === "repository" ? parseRpcEntryPage(await requestReader({
48
+ listEntriesPage: async (t) => e === "repository" ? p(await D({
59
49
  method: "listEntriesPage",
60
- maxEntries: Math.min(128, options.maxEntries),
61
- ...options.cursor === void 0 ? {} : { cursor: options.cursor },
62
- ...options.prefix === void 0 ? {} : { prefix: options.prefix }
63
- })) : Promise.reject(new RepositorySourceException({
50
+ maxEntries: Math.min(128, t.maxEntries),
51
+ ...t.cursor === void 0 ? {} : { cursor: t.cursor },
52
+ ...t.prefix === void 0 ? {} : { prefix: t.prefix }
53
+ })) : Promise.reject(new n({
64
54
  code: "SOURCE_UNAVAILABLE",
65
55
  operation: "list-entries-page",
66
56
  path: null,
67
- retryable: false
57
+ retryable: !1
68
58
  })),
69
- readFilePage: async (path, options) => parseRpcFilePage(await requestReader({
59
+ readFilePage: async (t, n) => d(await D({
70
60
  method: "readFilePage",
71
- path,
72
- offset: options.offset,
73
- maxBytes: Math.min(NODE_INSPECTION_FILE_PAGE_BYTES, options.maxBytes),
74
- source
61
+ path: t,
62
+ offset: n.offset,
63
+ maxBytes: Math.min(l, n.maxBytes),
64
+ source: e
75
65
  })),
76
- readLinkText: async (path) => parseRpcLinkText(await requestReader({
66
+ readLinkText: async (t) => u(await D({
77
67
  method: "readLinkText",
78
- path,
79
- source
68
+ path: t,
69
+ source: e
80
70
  })),
81
- compare: () => Promise.reject(new RepositorySourceException({
71
+ compare: () => Promise.reject(new n({
82
72
  code: "SOURCE_UNAVAILABLE",
83
73
  operation: "create-comparison",
84
74
  path: null,
85
- retryable: false
75
+ retryable: !1
86
76
  }))
87
- });
88
- var repository = createProxyReader("repository", start.snapshot);
89
- var instructions = start.instructions === null ? null : createProxyReader("instructions", start.instructions.snapshot);
90
- var prepare = async () => {
91
- const { createCore } = await import("./chunk-b98ca669.mjs").then((n) => n.t);
92
- inspection = await createCore(normalizeCoreOptions({ limits: {
93
- ...start.limits,
94
- maxRetainedBytes: start.limits.maxRetainedBytes - NODE_INSPECTION_TRANSPORT_BYTES
77
+ }), k = O("repository", v.snapshot), A = v.instructions === null ? null : O("instructions", v.instructions.snapshot), j = async () => {
78
+ let { createCore: e } = await import("./chunk-b1f86976.mjs").then((e) => e.t);
79
+ x = await e(t({ limits: {
80
+ ...v.limits,
81
+ maxRetainedBytes: v.limits.maxRetainedBytes - a
95
82
  } })).createProjectInspection({
96
- repository,
97
- ...instructions === null ? {} : { instructions }
83
+ repository: k,
84
+ ...A === null ? {} : { instructions: A }
98
85
  });
99
- const metadata = {
100
- source: inspection.source,
101
- formatVersion: inspection.formatVersion,
102
- valid: inspection.valid,
103
- counts: inspection.counts,
104
- coverageCounts: inspection.coverageCounts,
105
- summary: inspection.summary,
106
- resourceUsage: inspection.resourceUsage,
107
- inspectionDigest: inspection.inspectionDigest
86
+ let n = {
87
+ source: x.source,
88
+ formatVersion: x.formatVersion,
89
+ valid: x.valid,
90
+ counts: x.counts,
91
+ coverageCounts: x.coverageCounts,
92
+ summary: x.summary,
93
+ resourceUsage: x.resourceUsage,
94
+ inspectionDigest: x.inspectionDigest
108
95
  };
109
- send({
110
- attemptId,
96
+ E({
97
+ attemptId: y,
111
98
  kind: "prepared",
112
99
  inspection: {
113
- ...metadata,
114
- maxAnalysisHeapBytes,
100
+ ...n,
101
+ maxAnalysisHeapBytes: b,
115
102
  resourceUsage: {
116
- ...metadata.resourceUsage,
117
- retainedBytes: metadata.resourceUsage.retainedBytes + NODE_INSPECTION_TRANSPORT_BYTES,
118
- peakRetainedBytes: metadata.resourceUsage.peakRetainedBytes + NODE_INSPECTION_TRANSPORT_BYTES
103
+ ...n.resourceUsage,
104
+ retainedBytes: n.resourceUsage.retainedBytes + a,
105
+ peakRetainedBytes: n.resourceUsage.peakRetainedBytes + a
119
106
  }
120
107
  }
121
108
  });
122
- };
123
- var fail = (cause) => {
109
+ }, M = (t) => {
124
110
  try {
125
- const failure = serializeInspectionFailure(cause);
126
- if (cause instanceof CoreOperationException && cause.code === "RESOURCE_LIMIT_EXCEEDED" && cause.limit === "maxRetainedBytes" && cause.observedUsage !== null) {
127
- failure.options["limitMaximum"] = start.limits.maxRetainedBytes;
128
- failure.options["observedUsage"] = cause.observedUsage + NODE_INSPECTION_TRANSPORT_BYTES;
129
- }
130
- send({
131
- attemptId,
111
+ let n = o(t);
112
+ t instanceof e && t.code === "RESOURCE_LIMIT_EXCEEDED" && t.limit === "maxRetainedBytes" && t.observedUsage !== null && (n.options.limitMaximum = v.limits.maxRetainedBytes, n.options.observedUsage = t.observedUsage + a), E({
113
+ attemptId: y,
132
114
  kind: "failure",
133
- failure
115
+ failure: n
134
116
  });
135
117
  } catch {
136
- port.close();
118
+ _.close();
137
119
  }
138
120
  };
139
- port.on("message", (frame) => {
121
+ _.on("message", (t) => {
140
122
  try {
141
- const message = decodeInspectionMessage(frame);
142
- if (message.attemptId !== attemptId) throw createInspectionProcessFailure();
143
- if (message.kind === "run") {
144
- if (hasRun) throw createInspectionProcessFailure();
145
- hasRun = true;
146
- prepare().catch(fail);
147
- } else if (message.kind === "reader-response" || message.kind === "reader-failure") {
148
- const request = pending.get(message.requestId);
149
- if (request === void 0) throw createInspectionProcessFailure();
150
- pending.delete(message.requestId);
151
- if (message.kind === "reader-failure") request.reject(deserializeInspectionFailure(message.failure));
152
- else request.resolve(message.result);
153
- } else if (message.kind === "read-page") {
154
- if (inspection === void 0 || isReadingPage) throw createInspectionProcessFailure();
155
- isReadingPage = true;
123
+ let n = s(t);
124
+ if (n.attemptId !== y) throw r();
125
+ if (n.kind === "run") {
126
+ if (S) throw r();
127
+ S = !0, j().catch(M);
128
+ } else if (n.kind === "reader-response" || n.kind === "reader-failure") {
129
+ let e = T.get(n.requestId);
130
+ if (e === void 0) throw r();
131
+ T.delete(n.requestId), n.kind === "reader-failure" ? e.reject(c(n.failure)) : e.resolve(n.result);
132
+ } else if (n.kind === "read-page") {
133
+ if (x === void 0 || C) throw r();
134
+ C = !0;
156
135
  try {
157
- if (message.input.maxItems > start.limits.maxEntries) throw new CoreOperationException({
136
+ if (n.input.maxItems > v.limits.maxEntries) throw new e({
158
137
  code: "INVALID_ARGUMENT",
159
138
  operation: "create-project-inspection"
160
139
  });
161
- let maxItems = Math.min(256, message.input.maxItems);
162
- while (true) try {
163
- const frame = encodeInspectionMessage({
164
- attemptId,
140
+ let t = Math.min(256, n.input.maxItems);
141
+ for (;;) try {
142
+ let e = i({
143
+ attemptId: y,
165
144
  kind: "page",
166
- requestId: message.requestId,
167
- result: inspection.readPage({
168
- ...message.input,
169
- maxItems
145
+ requestId: n.requestId,
146
+ result: x.readPage({
147
+ ...n.input,
148
+ maxItems: t
170
149
  })
171
150
  });
172
- port.postMessage(frame);
151
+ _.postMessage(e);
173
152
  break;
174
- } catch (cause) {
175
- if (!(cause instanceof CoreOperationException) || cause.code !== "RESOURCE_LIMIT_EXCEEDED" || cause.limit !== "maxInspectionMessageBytes" || maxItems === 1) throw cause;
176
- maxItems = Math.max(1, Math.floor(maxItems / 2));
153
+ } catch (n) {
154
+ if (!(n instanceof e) || n.code !== "RESOURCE_LIMIT_EXCEEDED" || n.limit !== "maxInspectionMessageBytes" || t === 1) throw n;
155
+ t = Math.max(1, Math.floor(t / 2));
177
156
  }
178
157
  } finally {
179
- isReadingPage = false;
158
+ C = !1;
180
159
  }
181
- } else throw createInspectionProcessFailure();
182
- } catch (cause) {
183
- fail(cause);
160
+ } else throw r();
161
+ } catch (e) {
162
+ M(e);
184
163
  }
185
- });
186
- port.on("messageerror", fail);
187
- send({
188
- attemptId,
164
+ }), _.on("messageerror", M), E({
165
+ attemptId: y,
189
166
  kind: "ready",
190
- maxAnalysisHeapBytes
167
+ maxAnalysisHeapBytes: b
191
168
  });
192
169
  //#endregion
193
170
  export {};