@moldea.ai/cli 11.0.1 → 11.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.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { t as resolveInstalledMoldeaCliComposition } from "./composition-plpY2VTL.js";
2
+ import { t as resolveInstalledMoldeaCliComposition } from "./composition-BwxzXbxO.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-plpY2VTL.js";
2
+ import { o as MoldeaCliCompositionException, t as resolveInstalledMoldeaCliComposition } from "./composition-BwxzXbxO.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-vn2fp5zf.js.map
93
+ //# sourceMappingURL=core-composition-DJWI0RN6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-composition-vn2fp5zf.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,IAA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O,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-DJWI0RN6.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,8B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liOwnedError, 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-plpY2VTL.js";
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-BwxzXbxO.js";
3
3
  import path from "node:path";
4
4
  import process from "node:process";
5
5
  import { fileURLToPath } from "node:url";
@@ -840,7 +840,6 @@ var EMPTY_ERROR_DETAILS = Object.freeze({});
840
840
  var createCoreErrorDetails = (error) => {
841
841
  const details = { operation: error.operation };
842
842
  if (error instanceof CoreOperationException) {
843
- if (error.agentId !== null) details["agentId"] = error.agentId;
844
843
  if (error.limit !== null) details["limit"] = error.limit;
845
844
  if (error.limitMaximum !== null) details["limitMaximum"] = error.limitMaximum;
846
845
  if (error.nextAction !== null) details["nextAction"] = error.nextAction;
@@ -2514,11 +2513,11 @@ var createMoldeaCliContentExecutionResult = (pageResult, cliVersion, isJson, cur
2514
2513
  //#region src/cli-execution/command-executor.ts
2515
2514
  /** Loads isolated Core inspection only for commands that need it. */
2516
2515
  var executeLazyCoreInspection = async (input) => {
2517
- const { executeMoldeaCliCoreInspection } = await import("./chunks/core-composition-vn2fp5zf.js");
2516
+ const { executeMoldeaCliCoreInspection } = await import("./chunks/core-composition-DJWI0RN6.js");
2518
2517
  return executeMoldeaCliCoreInspection(input);
2519
2518
  };
2520
2519
  var loadInstalledComposition = async (input) => {
2521
- const { resolveInstalledMoldeaCliComposition } = await import("./chunks/composition-qEC_umal.js");
2520
+ const { resolveInstalledMoldeaCliComposition } = await import("./chunks/composition-Iz0HsV-0.js");
2522
2521
  return resolveInstalledMoldeaCliComposition(input);
2523
2522
  };
2524
2523
  /** Creates one operational error result without exposing caught failure details. */