@moldea.ai/core 7.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/agent-asset-validation/index.d.ts.map +1 -1
- package/dist/agent-assets/index.d.ts.map +1 -1
- package/dist/analysis-worker.js +11 -23
- package/dist/analysis-worker.js.map +1 -1
- package/dist/canonical-content-page/index.d.ts.map +1 -1
- package/dist/canonical-discovery/index.d.ts.map +1 -1
- package/dist/chunks/{core-CMuQrqRI.js → core-CFmT3SRC.js} +170 -231
- package/dist/chunks/core-CFmT3SRC.js.map +1 -0
- package/dist/chunks/{errors-BhiLG9F0.js → errors-Uvb-9X1u.js} +29 -75
- package/dist/chunks/errors-Uvb-9X1u.js.map +1 -0
- package/dist/chunks/{exceptions-CYf1pCKf.js → exceptions-AT654xUL.js} +10 -15
- package/dist/chunks/exceptions-AT654xUL.js.map +1 -0
- package/dist/chunks/{lifecycle-Bdi_ydtH.js → lifecycle-DuAHgnYH.js} +2 -2
- package/dist/chunks/{lifecycle-Bdi_ydtH.js.map → lifecycle-DuAHgnYH.js.map} +1 -1
- package/dist/chunks/{options-BVF3DQHm.js → options-C5360E_N.js} +23 -174
- package/dist/chunks/options-C5360E_N.js.map +1 -0
- package/dist/chunks/repository-rpc-B9YaeLba.js +143 -0
- package/dist/chunks/repository-rpc-B9YaeLba.js.map +1 -0
- package/dist/chunks/{scope-DoNl6LhC.js → scope-CNg6Gnpi.js} +214 -151
- package/dist/chunks/scope-CNg6Gnpi.js.map +1 -0
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +2 -6
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/decision/index.d.ts.map +1 -1
- package/dist/decision-graph/index.d.ts.map +1 -1
- package/dist/decision-graph-validation/index.d.ts.map +1 -1
- package/dist/decision-validation/index.d.ts.map +1 -1
- package/dist/diagnostic-utilities/index.d.ts.map +1 -1
- package/dist/diagnostics/index.d.ts +2 -2
- package/dist/diagnostics/index.d.ts.map +1 -1
- package/dist/exceptions/index.d.ts +1 -1
- package/dist/exceptions/index.d.ts.map +1 -1
- package/dist/format-validation/index.d.ts +0 -4
- package/dist/format-validation/index.d.ts.map +1 -1
- package/dist/immutable/index.d.ts +0 -6
- package/dist/immutable/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/integration-validation/agents-inspection.d.ts +3 -3
- package/dist/integration-validation/agents-inspection.d.ts.map +1 -1
- package/dist/integration-validation/claude-inspection.d.ts +3 -2
- package/dist/integration-validation/claude-inspection.d.ts.map +1 -1
- package/dist/integration-validation/inspection.d.ts +4 -2
- package/dist/integration-validation/inspection.d.ts.map +1 -1
- package/dist/integration-validation/parser.d.ts +9 -3
- package/dist/integration-validation/parser.d.ts.map +1 -1
- package/dist/integration-validation/types.d.ts +3 -8
- package/dist/integration-validation/types.d.ts.map +1 -1
- package/dist/integration-validation/utilities.d.ts +0 -8
- package/dist/integration-validation/utilities.d.ts.map +1 -1
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/manifest-relationship-validation/index.d.ts.map +1 -1
- package/dist/manifest-validation/index.d.ts.map +1 -1
- package/dist/mirrors/index.d.ts.map +1 -1
- package/dist/node-inspection/client.d.ts.map +1 -1
- package/dist/node-inspection/protocol.d.ts.map +1 -1
- package/dist/node-inspection/repository-rpc.d.ts +7 -6
- package/dist/node-inspection/repository-rpc.d.ts.map +1 -1
- package/dist/node-inspection/types.d.ts +7 -12
- package/dist/node-inspection/types.d.ts.map +1 -1
- package/dist/node-runner.js +3 -3
- package/dist/node.js +19 -35
- package/dist/node.js.map +1 -1
- package/dist/options/index.d.ts.map +1 -1
- package/dist/project-assets/index.d.ts.map +1 -1
- package/dist/project-index/index.d.ts.map +1 -1
- package/dist/project-inspection/index.d.ts.map +1 -1
- package/dist/project-validation/index.d.ts +1 -1
- package/dist/project-validation/index.d.ts.map +1 -1
- package/dist/repository-inspection-session/index.d.ts +5 -8
- package/dist/repository-inspection-session/index.d.ts.map +1 -1
- package/dist/repository-reference-validation/index.d.ts.map +1 -1
- package/dist/repository-text/index.d.ts.map +1 -1
- package/dist/runtime-guidance/index.d.ts.map +1 -1
- package/dist/runtime-placeholder-validation/index.d.ts.map +1 -1
- package/dist/scope-matching/matching.d.ts.map +1 -1
- package/dist/scope-matching/scope.d.ts.map +1 -1
- package/dist/scope-matching/validations.d.ts +0 -2
- package/dist/scope-matching/validations.d.ts.map +1 -1
- package/dist/scope.js +2 -2
- package/dist/text/index.d.ts.map +1 -1
- package/dist/universal-project-inspection/index.d.ts.map +1 -1
- package/dist/warning-acceptance/acceptance.d.ts.map +1 -1
- package/dist/yaml/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/chunks/core-CMuQrqRI.js.map +0 -1
- package/dist/chunks/errors-BhiLG9F0.js.map +0 -1
- package/dist/chunks/exceptions-CYf1pCKf.js.map +0 -1
- package/dist/chunks/options-BVF3DQHm.js.map +0 -1
- package/dist/chunks/repository-rpc-CiKFu86B.js +0 -178
- package/dist/chunks/repository-rpc-CiKFu86B.js.map +0 -1
- package/dist/chunks/scope-DoNl6LhC.js.map +0 -1
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recursively freezes a Core-owned value without cloning it.
|
|
3
|
-
* @param value The detached acyclic value whose already-frozen objects are deeply frozen.
|
|
4
|
-
* @returns The same value with every mutable reachable object frozen.
|
|
5
|
-
*/
|
|
6
|
-
export declare const freezeRecursively: <Value>(value: Value) => Readonly<Value>;
|
|
7
1
|
/**
|
|
8
2
|
* Creates a record that cannot collide with prototype-chain properties.
|
|
9
3
|
* @param entries The own string-keyed entries to assign.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/immutable/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/immutable/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,KAAK,EAC7C,SAAS,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,KAC1C,MAAM,CAAC,MAAM,EAAE,KAAK,CAQtB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { IBindingRelationship, IExportNotCheckedReason, IBindingCoverage, IBindingCoverageCounts, } from './binding-coverage/index.js';
|
|
2
2
|
export { DEFAULT_CORE_RESOURCE_LIMITS, RECOGNIZED_RUNTIME_IDS, ACCEPTABLE_WARNING_CODES, SUPPORTED_REPOSITORY_FORMAT_VERSIONS, } from './constants/index.js';
|
|
3
|
-
export type { IContentDigest, IContentDigestResult, ICanonicalContentPageInput, ICanonicalContentPageResult, ICore, ICoreOptions, ICoreResourceLimits, IDecisionParseResult, IManifestParseResult, INormalizedText, IProjectMetadataItem, IProjectMetadataKind, IProjectAgentAssignmentItem, IProjectInspection, IProjectInspectionItem, IProjectInspectionCounts, IProjectInspectionInput, IProjectInspectionPage, IProjectInspectionPageInput, IProjectInspectionPageRecord, IProjectInspectionPageResult, IProjectInspectionResourceUsage, IProjectInspectionView,
|
|
3
|
+
export type { IContentDigest, IContentDigestResult, ICanonicalContentPageInput, ICanonicalContentPageResult, ICore, ICoreOptions, ICoreResourceLimits, IDecisionParseResult, IManifestParseResult, INormalizedText, IProjectMetadataItem, IProjectMetadataKind, IProjectAgentAssignmentItem, IProjectInspection, IProjectInspectionItem, IProjectInspectionCounts, IProjectInspectionInput, IProjectInspectionPage, IProjectInspectionPageInput, IProjectInspectionPageRecord, IProjectInspectionPageResult, IProjectInspectionResourceUsage, IProjectInspectionView, IProjectSummaryCounts, IProjectValidationInput, IProjectValidationResult, IProjectValidationSummary, ITextDocumentContent, ITextDocumentInput, ITextNormalizationResult, } from './contracts/index.js';
|
|
4
4
|
export type { IExactManifestScopeDeclaration, IGlobManifestScopeDeclaration, IManifestScopeCounts, IManifestScopeDeclaration, IManifestScopeInput, IManifestScopeMatch, IManifestScopeOwner, IManifestScopeOwnerKind, IManifestScopeRelationshipField, IManifestScopeResult, } from './scope-matching/index.js';
|
|
5
5
|
export { createCore } from './core/index.js';
|
|
6
6
|
export type { ICoreDiagnostic, ICoreDiagnosticCode, IDiagnostic, IDiagnosticDetails, IDiagnosticEntity, ISourcePosition, ISourceRange, } from './diagnostics/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,oCAAoC,GACrC,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,EACL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,+BAA+B,EAC/B,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,4BAA4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 -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createCore, r as parseIntegrationBlock } from "./chunks/core-
|
|
2
|
-
import {
|
|
3
|
-
import { n as CoreOperationException, t as CoreConfigurationException } from "./chunks/exceptions-
|
|
1
|
+
import { n as createCore, r as parseIntegrationBlock } from "./chunks/core-CFmT3SRC.js";
|
|
2
|
+
import { c as ACCEPTABLE_WARNING_CODES, d as SUPPORTED_REPOSITORY_FORMAT_VERSIONS, l as DEFAULT_CORE_RESOURCE_LIMITS, u as RECOGNIZED_RUNTIME_IDS } from "./chunks/options-C5360E_N.js";
|
|
3
|
+
import { n as CoreOperationException, t as CoreConfigurationException } from "./chunks/exceptions-AT654xUL.js";
|
|
4
4
|
export { ACCEPTABLE_WARNING_CODES, CoreConfigurationException, CoreOperationException, DEFAULT_CORE_RESOURCE_LIMITS, RECOGNIZED_RUNTIME_IDS, SUPPORTED_REPOSITORY_FORMAT_VERSIONS, createCore, parseIntegrationBlock };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IAgentsInstructionTarget, IIntegrationInspectionContext } from './types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Checks root AGENTS.md against its referenced skill installation. A symlinked AGENTS.md
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Checks root AGENTS.md against its referenced skill installation. A symlinked AGENTS.md that
|
|
4
|
+
* leads to a regular file in the repository is checked on that file's text; any other link is
|
|
5
|
+
* reported with its reason, without reading anything outside the repository.
|
|
6
6
|
* @param context The instruction view, repository reader, ledger, and warning recorder.
|
|
7
7
|
* @returns What AGENTS.md is, including its link resolution, for the Claude Code check.
|
|
8
8
|
* @throws
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-inspection.d.ts","sourceRoot":"","sources":["../../src/integration-validation/agents-inspection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents-inspection.d.ts","sourceRoot":"","sources":["../../src/integration-validation/agents-inspection.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAE9B,MAAM,YAAY,CAAC;AAqHpB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,6BAA6B,KACrC,OAAO,CAAC,wBAAwB,CAmClC,CAAC"}
|
|
@@ -2,8 +2,9 @@ import type { IAgentsInstructionTarget, IIntegrationInspectionContext } from './
|
|
|
2
2
|
/**
|
|
3
3
|
* Checks whether Claude Code loads AGENTS.md. When `/CLAUDE.md` or `/.claude/CLAUDE.md` exists,
|
|
4
4
|
* only those shared files count; `/CLAUDE.local.md` counts only when neither exists. At most one
|
|
5
|
-
* Claude warning is recorded:
|
|
6
|
-
* loads AGENTS.md, otherwise a missing import for the
|
|
5
|
+
* Claude warning is recorded: an unresolved link for the first counted file whose link doesn't
|
|
6
|
+
* lead to a file in the repository when none loads AGENTS.md, otherwise a missing import for the
|
|
7
|
+
* governing file.
|
|
7
8
|
* @param context The instruction view, ledger, and warning recorder.
|
|
8
9
|
* @param agents What root AGENTS.md is, as the AGENTS.md check observed it.
|
|
9
10
|
* @returns A promise that settles after at most one Claude warning was recorded.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-inspection.d.ts","sourceRoot":"","sources":["../../src/integration-validation/claude-inspection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-inspection.d.ts","sourceRoot":"","sources":["../../src/integration-validation/claude-inspection.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAE9B,MAAM,YAAY,CAAC;AA4FpB;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,6BAA6B,EACtC,QAAQ,wBAAwB,KAC/B,OAAO,CAAC,IAAI,CAmCd,CAAC"}
|
|
@@ -4,9 +4,11 @@ import type { IRepositoryInspectionReader, IRepositoryInstructionView } from '..
|
|
|
4
4
|
/**
|
|
5
5
|
* Checks the coding-agent integration: root AGENTS.md and the Claude Code instruction files
|
|
6
6
|
* through the instruction view, and the referenced skill installation through the repository
|
|
7
|
-
* reader
|
|
7
|
+
* reader. It reads at most four instruction files, follows at most 32 links for each with one
|
|
8
|
+
* lookup and one link-text read per link, and makes at most five bounded reads, all inside the
|
|
9
|
+
* repository.
|
|
8
10
|
* @param reader The repository inspection reader for skill files and the managed asset.
|
|
9
|
-
* @param instructions The instruction view
|
|
11
|
+
* @param instructions The instruction view that routes the four instruction paths and links.
|
|
10
12
|
* @param limits The immutable resource limits for the inspection.
|
|
11
13
|
* @param signal Optional cancellation for repository lookups.
|
|
12
14
|
* @returns Completed content-free integration warnings, never an execution or runtime-wiring claim.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../src/integration-validation/inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,2CAA2C,CAAC;AAOnD
|
|
1
|
+
{"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../src/integration-validation/inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,2CAA2C,CAAC;AAOnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,6BAA6B,GACxC,QAAQ,2BAA2B,EACnC,cAAc,0BAA0B,EACxC,QAAQ,mBAAmB,EAC3B,SAAS,WAAW,KACnB,OAAO,CAAC,SAAS,eAAe,EAAE,CAqBpC,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type IMarkedRegion } from 'jg-utilities';
|
|
2
|
+
import type { IIntegrationBlockResult } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Finds the managed block's region with the skill writer's region semantics: one start and one end
|
|
5
|
+
* marker, each on its own line, the start first.
|
|
6
|
+
* @param text The instruction document.
|
|
7
|
+
* @returns The region, or why the document has none.
|
|
8
|
+
*/
|
|
9
|
+
export declare const parseManagedIntegrationRegion: (text: string) => IMarkedRegion | "block-missing" | "block-invalid";
|
|
4
10
|
/**
|
|
5
11
|
* Extracts the relative installation path from the fixed relevance-gate command without executing it.
|
|
6
12
|
* @returns The safe installation path or the reason it could not be obtained.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/integration-validation/parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/integration-validation/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAK1D;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GACxC,MAAM,MAAM,KACX,aAAa,GAAG,eAAe,GAAG,eAOpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,uBAoBpD,CAAC;AAMF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,UAAU,OAAO,KAAG,OAmBjE,CAAC"}
|
|
@@ -2,11 +2,6 @@ import type { IRepositoryLinkResolution, IRepositoryPath } from '@moldea.ai/repo
|
|
|
2
2
|
import type { ICoreWarningCode } from '../diagnostics/index.js';
|
|
3
3
|
import type { IRepositoryInspectionReader, IRepositoryInstructionView } from '../repository-inspection-session/index.js';
|
|
4
4
|
import type { IRetainedMemory } from '../retained-memory/index.js';
|
|
5
|
-
export interface IManagedIntegrationRegion {
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
lineEnding: '\n' | '\r\n';
|
|
9
|
-
}
|
|
10
5
|
export type IIntegrationBlockResult = {
|
|
11
6
|
kind: 'found';
|
|
12
7
|
skillPath: string;
|
|
@@ -14,18 +9,18 @@ export type IIntegrationBlockResult = {
|
|
|
14
9
|
kind: 'missing';
|
|
15
10
|
reason: 'block-missing' | 'block-invalid' | 'skill-path-missing' | 'skill-path-invalid';
|
|
16
11
|
};
|
|
17
|
-
export type
|
|
12
|
+
export type IUnresolvedLinkState = Exclude<IRepositoryLinkResolution['state'], 'file'>;
|
|
18
13
|
export interface IIntegrationInspectionContext {
|
|
19
14
|
readonly instructions: IRepositoryInstructionView;
|
|
20
15
|
readonly ledger: IRetainedMemory;
|
|
21
16
|
readonly reader: IRepositoryInspectionReader;
|
|
22
|
-
readonly report: (code: ICoreWarningCode, subject: IRepositoryPath, details: Record<string, string
|
|
17
|
+
readonly report: (code: ICoreWarningCode, subject: IRepositoryPath, details: Record<string, string>, qualifier?: IUnresolvedLinkState) => void;
|
|
23
18
|
readonly signal?: AbortSignal;
|
|
24
19
|
}
|
|
25
20
|
export type IAgentsInstructionTarget = {
|
|
26
21
|
readonly kind: 'directory' | 'file' | 'missing';
|
|
27
22
|
} | {
|
|
28
23
|
readonly kind: 'link';
|
|
29
|
-
readonly resolution: IRepositoryLinkResolution
|
|
24
|
+
readonly resolution: IRepositoryLinkResolution;
|
|
30
25
|
};
|
|
31
26
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/integration-validation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,KAAK,EAAE,gBAAgB,E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B;AAGD,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAA;CAAE,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type IRepositoryLinkResolution } from '@moldea.ai/repository';
|
|
2
1
|
import type { IRetainedMemory, IRetainedSource } from '../retained-memory/index.js';
|
|
3
|
-
import type { IInstructionLinkState } from './types.js';
|
|
4
2
|
/**
|
|
5
3
|
* Reads bounded untrusted text with a reservation for decoding and temporary string copies.
|
|
6
4
|
* @param ledger The session ledger that owns the reservation.
|
|
@@ -24,10 +22,4 @@ export declare const readRetainedText: (ledger: IRetainedMemory, load: () => Pro
|
|
|
24
22
|
}>;
|
|
25
23
|
/** Distinguishes missing and non-regular files without an extra entry lookup or following symlinks. */
|
|
26
24
|
export declare const getAbsentKind: (error: unknown) => "missing" | "non-regular" | null;
|
|
27
|
-
/**
|
|
28
|
-
* Explains why a linked instruction file cannot be read, or returns null for a readable link.
|
|
29
|
-
* @param resolution The resolver's classification, or null when no resolver is available.
|
|
30
|
-
* @returns The content-free link state, or null when the final target is a regular file.
|
|
31
|
-
*/
|
|
32
|
-
export declare const getUnreadableLinkState: (resolution: IRepositoryLinkResolution | null) => IInstructionLinkState | null;
|
|
33
25
|
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/integration-validation/utilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/integration-validation/utilities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEpF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,eAAe,EACvB,MAAM,MAAM,OAAO,CAAC,eAAe,CAAC,KACnC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAoBtD,CAAC;AAEF,uGAAuG;AACvG,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,SAAS,GAAG,aAAa,GAAG,IAOjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsC,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,KAAK,EAEV,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQ7D,MAAM,WAAW,iCAAkC,SAAQ,oBAAoB;IAC7E,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC;CAClC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,kBAAkB,EACzB,SAAS,oBAAoB,EAC7B,YAAW,OAAO,CAChB,cAAc,EACd,gBAAgB,GAAG,sBAAsB,GAAG,kBAAkB,CAC5C,KACnB,OAAO,CAAC,iCAAiC,CA0D3C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,kBAAkB,EACzB,SAAS,oBAAoB,EAC7B,YAAW,OAAO,CAAC,cAAc,EAAE,gBAAgB,GAAG,sBAAsB,CAAoB,KAC/F,OAAO,CAAC,oBAAoB,CAS9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest-relationship-validation/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest-relationship-validation/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAMjE,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,yBAAyB,CAAC;AAElF,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAyF7E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,GACxC,cAAc,eAAe,EAC7B,UAAU,iBAAiB,EAC3B,WAAW,yBAAyB,EACpC,WAAW,SAAS,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC,EAAE,EACrE,QAAQ,mBAAmB,KAC1B,SAAS,eAAe,EAqE1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest-validation/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest-validation/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAoB1C,OAAO,KAAK,EAKV,iBAAiB,EAEjB,wBAAwB,EAOzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,SAAS,EAAmB,MAAM,kBAAkB,CAAC;AAy+BnE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GACzC,MAAM,SAAS,KACd,wBAAwB,GAAG,IAQ7B,CAAC;AAqVF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,SAAS,EACf,MAAM,eAAe,EACrB,aAAa,wBAAwB,EACrC,QAAQ,mBAAmB,EAC3B,WAAW,cAAc,KACxB,iBAAiB,GAAG,IAsFtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mirrors/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mirrors/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,uBAAuB,CAAC;AAM/E,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAsC,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAI7F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACzD,QAAQ,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,CAAC;CAClD;AAuHD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,GACzB,YAAY,2BAA2B,EACvC,cAAc,eAAe,EAC7B,QAAQ,SAAS,qBAAqB,EAAE,EACxC,SAAS,oBAAoB,EAC7B,SAAS,WAAW,KACnB,OAAO,CAAC,uBAAuB,CA2CjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/node-inspection/client.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAGV,sBAAsB,EACtB,2BAA2B,EAE5B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/node-inspection/client.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAGV,sBAAsB,EACtB,2BAA2B,EAE5B,MAAM,YAAY,CAAC;AA4CpB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,2BAA2B,KACjC,OAAO,CAAC,sBAAsB,CA6VhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/node-inspection/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/node-inspection/protocol.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,yFAAyF;AACzF,eAAO,MAAM,8BAA8B,GAAI,QAAQ,OAAO,KAAG,sBAK7D,CAAC;AAsPL;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,sBAAsB,KAAG,MAkBzE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,OAAO,KAAG,sBAWxD,CAAC"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { type IRepositoryEntry, type IRepositoryEntryPage, type IRepositoryFilePage
|
|
1
|
+
import { type IRepositoryEntry, type IRepositoryEntryPage, type IRepositoryFilePage } from '@moldea.ai/repository';
|
|
2
2
|
import type { INodeReaderRequest, INodeReaderSources } from './types.js';
|
|
3
3
|
/** Converts one validated metadata-only repository entry. */
|
|
4
4
|
export declare const parseRpcEntry: (input: unknown) => IRepositoryEntry | null;
|
|
5
5
|
/** Converts a bounded listing page while retaining snapshot and continuation contracts. */
|
|
6
6
|
export declare const parseRpcEntryPage: (input: unknown) => IRepositoryEntryPage;
|
|
7
|
-
/** Converts one
|
|
8
|
-
export declare const
|
|
7
|
+
/** Converts one link's stored text, admitting only text within the shared byte limit. */
|
|
8
|
+
export declare const parseRpcLinkText: (input: unknown) => string | null;
|
|
9
9
|
/** Decodes only an admitted 64 KiB binary page, never a complete repository file. */
|
|
10
10
|
export declare const parseRpcFilePage: (input: unknown) => IRepositoryFilePage;
|
|
11
11
|
/**
|
|
12
|
-
* Calls the real reader
|
|
13
|
-
*
|
|
14
|
-
* @returns A metadata value or encoded byte page after actual reader settlement.
|
|
12
|
+
* Calls the real reader with inspection cancellation and returns a bounded transport value.
|
|
13
|
+
* Reader failures propagate unchanged to the parent inspection owner.
|
|
14
|
+
* @returns A metadata value, link text, or encoded byte page after actual reader settlement.
|
|
15
15
|
* @throws
|
|
16
16
|
* - INVALID_REPOSITORY_PATH: The repository path is invalid.
|
|
17
17
|
* - ENTRY_NOT_FOUND: The requested repository entry was not found.
|
|
18
18
|
* - ENTRY_NOT_FILE: The requested repository entry is not a file.
|
|
19
19
|
* - ENTRY_NOT_DIRECTORY: The requested repository entry is not a directory.
|
|
20
|
+
* - ENTRY_NOT_LINK: The requested repository entry is not a symlink.
|
|
20
21
|
* - INVALID_PAGE_REQUEST: The repository page request is invalid.
|
|
21
22
|
* - ACCESS_DENIED: Access to the repository source was denied.
|
|
22
23
|
* - SOURCE_UNAVAILABLE: The repository source is unavailable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-rpc.d.ts","sourceRoot":"","sources":["../../src/node-inspection/repository-rpc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repository-rpc.d.ts","sourceRoot":"","sources":["../../src/node-inspection/repository-rpc.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAGzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA6BzE,6DAA6D;AAC7D,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,gBAAgB,GAAG,IAkBjE,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,oBAuBlD,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,IAQ1D,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,mBAmCjD,CAAC;AAgBF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,kBAAkB,EAC3B,SAAS,kBAAkB,EAC3B,QAAQ,WAAW,KAClB,OAAO,CAAC,OAAO,CA6BjB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IRepositoryReader, IRepositorySnapshot } from '@moldea.ai/repository';
|
|
2
|
-
import type { ICoreResourceLimits, IProjectInspection, IProjectInspectionPageInput, IProjectInspectionPageResult
|
|
2
|
+
import type { ICoreResourceLimits, IProjectInspection, IProjectInspectionPageInput, IProjectInspectionPageResult } from '../contracts/index.js';
|
|
3
3
|
export interface INodeProjectInspectionInput {
|
|
4
4
|
repository: IRepositoryReader;
|
|
5
|
-
instructions?:
|
|
5
|
+
instructions?: IRepositoryReader;
|
|
6
6
|
limits?: Partial<ICoreResourceLimits>;
|
|
7
7
|
signal?: AbortSignal;
|
|
8
8
|
deadline?: number;
|
|
@@ -36,17 +36,20 @@ export interface INodeProjectInspection extends INodeInspectionMetadata {
|
|
|
36
36
|
}
|
|
37
37
|
export type INodeReaderSource = 'instructions' | 'repository';
|
|
38
38
|
export interface INodeReaderSources {
|
|
39
|
-
readonly instructions?:
|
|
39
|
+
readonly instructions?: IRepositoryReader;
|
|
40
40
|
readonly repository: IRepositoryReader;
|
|
41
41
|
}
|
|
42
42
|
export interface INodeInstructionSourceMetadata {
|
|
43
|
-
hasLinkResolver: boolean;
|
|
44
43
|
snapshot: IRepositorySnapshot;
|
|
45
44
|
}
|
|
46
45
|
export type INodeReaderRequest = {
|
|
47
46
|
method: 'getEntry';
|
|
48
47
|
path: string;
|
|
49
48
|
source: INodeReaderSource;
|
|
49
|
+
} | {
|
|
50
|
+
method: 'readLinkText';
|
|
51
|
+
path: string;
|
|
52
|
+
source: INodeReaderSource;
|
|
50
53
|
} | {
|
|
51
54
|
method: 'listEntriesPage';
|
|
52
55
|
maxEntries: number;
|
|
@@ -58,14 +61,6 @@ export type INodeReaderRequest = {
|
|
|
58
61
|
maxBytes: number;
|
|
59
62
|
offset: number;
|
|
60
63
|
source: INodeReaderSource;
|
|
61
|
-
} | {
|
|
62
|
-
method: 'resolveLink';
|
|
63
|
-
path: string;
|
|
64
|
-
} | {
|
|
65
|
-
method: 'readLinkTargetPage';
|
|
66
|
-
path: string;
|
|
67
|
-
maxBytes: number;
|
|
68
|
-
offset: number;
|
|
69
64
|
};
|
|
70
65
|
export interface INodeInspectionFailure {
|
|
71
66
|
family: 'configuration' | 'operation' | 'repository' | 'path';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/node-inspection/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEpF,OAAO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AAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,4BAA4B,CAAA;CAAE,GACzE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,GAC1E;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,sBAAsB,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,sBAAsB,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CACtB,CAAC"}
|
package/dist/node-runner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as CoreOperationException } from "./chunks/exceptions-
|
|
2
|
-
import { a as encodeInspectionMessage, i as decodeInspectionMessage, n as serializeInspectionFailure, r as createInspectionProcessFailure, s as NODE_INSPECTION_LIFETIME_MS } from "./chunks/errors-
|
|
3
|
-
import { n as createInspectionSender } from "./chunks/lifecycle-
|
|
1
|
+
import { n as CoreOperationException } from "./chunks/exceptions-AT654xUL.js";
|
|
2
|
+
import { a as encodeInspectionMessage, i as decodeInspectionMessage, n as serializeInspectionFailure, r as createInspectionProcessFailure, s as NODE_INSPECTION_LIFETIME_MS } from "./chunks/errors-Uvb-9X1u.js";
|
|
3
|
+
import { n as createInspectionSender } from "./chunks/lifecycle-DuAHgnYH.js";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { Worker } from "node:worker_threads";
|
|
6
6
|
//#region src/node-inspection/runner.ts
|
package/dist/node.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as CoreOperationException } from "./chunks/exceptions-
|
|
3
|
-
import { c as NODE_INSPECTION_PROFILE, d as NODE_INSPECTION_TRANSPORT_BYTES, i as decodeInspectionMessage, n as serializeInspectionFailure, r as createInspectionProcessFailure, s as NODE_INSPECTION_LIFETIME_MS, t as deserializeInspectionFailure } from "./chunks/errors-
|
|
4
|
-
import { n as createInspectionSender, r as superviseInspectionChild, t as createInspectionEnvironment } from "./chunks/lifecycle-
|
|
5
|
-
import { t as executeRepositoryRpc } from "./chunks/repository-rpc-
|
|
1
|
+
import { n as normalizeCoreOptions } from "./chunks/options-C5360E_N.js";
|
|
2
|
+
import { n as CoreOperationException } from "./chunks/exceptions-AT654xUL.js";
|
|
3
|
+
import { c as NODE_INSPECTION_PROFILE, d as NODE_INSPECTION_TRANSPORT_BYTES, i as decodeInspectionMessage, n as serializeInspectionFailure, r as createInspectionProcessFailure, s as NODE_INSPECTION_LIFETIME_MS, t as deserializeInspectionFailure } from "./chunks/errors-Uvb-9X1u.js";
|
|
4
|
+
import { n as createInspectionSender, r as superviseInspectionChild, t as createInspectionEnvironment } from "./chunks/lifecycle-DuAHgnYH.js";
|
|
5
|
+
import { t as executeRepositoryRpc } from "./chunks/repository-rpc-B9YaeLba.js";
|
|
6
|
+
import { deepFreeze, isObjectValid } from "jg-utilities";
|
|
6
7
|
import { RepositorySourceException } from "@moldea.ai/repository";
|
|
7
8
|
import { fork } from "node:child_process";
|
|
8
9
|
import { randomBytes } from "node:crypto";
|
|
@@ -11,36 +12,19 @@ import { fileURLToPath } from "node:url";
|
|
|
11
12
|
var isInspectionActive = false;
|
|
12
13
|
/** Stores one completion without an unhandled rejection before its owner begins awaiting it. */
|
|
13
14
|
var createCompletion = () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
resolve = resolveResult;
|
|
18
|
-
reject = rejectResult;
|
|
19
|
-
});
|
|
20
|
-
promise.catch(() => {});
|
|
21
|
-
return {
|
|
22
|
-
promise,
|
|
23
|
-
resolve,
|
|
24
|
-
reject
|
|
25
|
-
};
|
|
15
|
+
const completion = Promise.withResolvers();
|
|
16
|
+
completion.promise.catch(() => {});
|
|
17
|
+
return completion;
|
|
26
18
|
};
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
/** Describes a supplied instruction source for the worker, or rejects one Core could not use. */
|
|
19
|
+
var isSnapshot = (input) => isObjectValid(input, true) && typeof input["id"] === "string" && input["id"].length > 0 && typeof input["sourceKind"] === "string" && input["sourceKind"].length > 0;
|
|
20
|
+
/** Describes a supplied instruction reader for the worker, or rejects one Core could not use. */
|
|
30
21
|
var describeInstructions = (instructions) => {
|
|
31
22
|
if (instructions === void 0) return null;
|
|
32
|
-
if (!
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
hasLinkResolver: linkResolver !== void 0,
|
|
39
|
-
snapshot: {
|
|
40
|
-
id: reader["snapshot"].id,
|
|
41
|
-
sourceKind: reader["snapshot"].sourceKind
|
|
42
|
-
}
|
|
43
|
-
};
|
|
23
|
+
if (!isObjectValid(instructions, true) || typeof instructions["getEntry"] !== "function" || typeof instructions["readFilePage"] !== "function" || typeof instructions["readLinkText"] !== "function" || !isSnapshot(instructions["snapshot"])) return void 0;
|
|
24
|
+
return { snapshot: {
|
|
25
|
+
id: instructions["snapshot"].id,
|
|
26
|
+
sourceKind: instructions["snapshot"].sourceKind
|
|
27
|
+
} };
|
|
44
28
|
};
|
|
45
29
|
var aborted = (cause) => new CoreOperationException({
|
|
46
30
|
code: "ABORTED",
|
|
@@ -73,7 +57,7 @@ var aborted = (cause) => new CoreOperationException({
|
|
|
73
57
|
* - ABORTED: The repository operation was aborted.
|
|
74
58
|
*/
|
|
75
59
|
var createNodeProjectInspection = async (input) => {
|
|
76
|
-
if (input === null || typeof input !== "object" || input.repository === null || typeof input.repository !== "object" || typeof input.repository.getEntry !== "function" || typeof input.repository.listEntriesPage !== "function" || typeof input.repository.readFilePage !== "function" || input.repository.snapshot === null || typeof input.repository.snapshot !== "object" || typeof input.repository.snapshot.id !== "string" || input.repository.snapshot.id.length === 0 || typeof input.repository.snapshot.sourceKind !== "string" || input.repository.snapshot.sourceKind.length === 0) throw new CoreOperationException({
|
|
60
|
+
if (input === null || typeof input !== "object" || input.repository === null || typeof input.repository !== "object" || typeof input.repository.getEntry !== "function" || typeof input.repository.listEntriesPage !== "function" || typeof input.repository.readFilePage !== "function" || typeof input.repository.readLinkText !== "function" || input.repository.snapshot === null || typeof input.repository.snapshot !== "object" || typeof input.repository.snapshot.id !== "string" || input.repository.snapshot.id.length === 0 || typeof input.repository.snapshot.sourceKind !== "string" || input.repository.snapshot.sourceKind.length === 0) throw new CoreOperationException({
|
|
77
61
|
code: "INVALID_ARGUMENT",
|
|
78
62
|
operation: "create-project-inspection"
|
|
79
63
|
});
|
|
@@ -232,7 +216,7 @@ var createNodeProjectInspection = async (input) => {
|
|
|
232
216
|
} else if (message.kind === "prepared") {
|
|
233
217
|
if (!hasAcknowledgedHeap || hasPrepared || message.inspection.maxAnalysisHeapBytes !== heapMaximum || message.inspection.source.id !== snapshot.id || message.inspection.source.sourceKind !== snapshot.sourceKind) throw createInspectionProcessFailure();
|
|
234
218
|
hasPrepared = true;
|
|
235
|
-
prepared.resolve(
|
|
219
|
+
prepared.resolve(deepFreeze(message.inspection));
|
|
236
220
|
} else if (message.kind === "reader-request") {
|
|
237
221
|
if (!hasAcknowledgedHeap || hasPrepared || message.requestId !== lastReaderRequestId + 1 || readerWork.size >= 4) throw createInspectionProcessFailure();
|
|
238
222
|
lastReaderRequestId = message.requestId;
|
|
@@ -275,7 +259,7 @@ var createNodeProjectInspection = async (input) => {
|
|
|
275
259
|
if (!hasPrepared || pendingPage === void 0 || message.requestId !== pageRequestId) throw createInspectionProcessFailure();
|
|
276
260
|
const completion = pendingPage;
|
|
277
261
|
pendingPage = void 0;
|
|
278
|
-
completion.resolve(
|
|
262
|
+
completion.resolve(deepFreeze(message.result));
|
|
279
263
|
} else if (message.kind === "failure") {
|
|
280
264
|
if (message.failure.options["nextAction"] === "review-inspection-capacity" && (heapMaximum === void 0 || message.failure.options["limitMaximum"] !== heapMaximum)) throw createInspectionProcessFailure();
|
|
281
265
|
fail(deserializeInspectionFailure(message.failure));
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","names":[],"sources":["../src/node-inspection/client.ts"],"sourcesContent":["import { fork } from 'node:child_process';\nimport { randomBytes } from 'node:crypto';\nimport { fileURLToPath } from 'node:url';\n\nimport { RepositorySourceException } from '@moldea.ai/repository';\n\nimport { CoreOperationException } from '../exceptions/index.js';\nimport { freezeRecursively } from '../immutable/index.js';\nimport { normalizeCoreOptions } from '../options/index.js';\n\nimport {\n NODE_INSPECTION_LIFETIME_MS,\n NODE_INSPECTION_MAX_REQUESTS,\n NODE_INSPECTION_STDIO_BYTES,\n NODE_INSPECTION_TRANSPORT_BYTES,\n} from './constants.js';\nimport { deserializeInspectionFailure, serializeInspectionFailure } from './errors.js';\nimport {\n createInspectionEnvironment,\n createInspectionSender,\n superviseInspectionChild,\n} from './lifecycle.js';\nimport { createInspectionProcessFailure, decodeInspectionMessage } from './protocol.js';\nimport { executeRepositoryRpc } from './repository-rpc.js';\nimport type {\n INodeInspectionMetadata,\n INodeInstructionSourceMetadata,\n INodeProjectInspection,\n INodeProjectInspectionInput,\n INodeReaderSources,\n} from './types.js';\nimport type { IProjectInspectionPageResult } from '../contracts/index.js';\n\nlet isInspectionActive = false;\n\n/** Stores one completion without an unhandled rejection before its owner begins awaiting it. */\nconst createCompletion = <T>(): {\n promise: Promise<T>;\n resolve: (result: T) => void;\n reject: (cause: unknown) => void;\n} => {\n let resolve!: (result: T) => void;\n let reject!: (cause: unknown) => void;\n const promise = new Promise<T>((resolveResult, rejectResult) => {\n resolve = resolveResult;\n reject = rejectResult;\n });\n void promise.catch(() => {});\n return { promise, resolve, reject };\n};\n\nconst isRecord = (input: unknown): input is Record<string, unknown> =>\n input !== null && typeof input === 'object';\nconst isSnapshot = (input: unknown): input is { id: string; sourceKind: string } =>\n isRecord(input) &&\n typeof input['id'] === 'string' &&\n input['id'].length > 0 &&\n typeof input['sourceKind'] === 'string' &&\n input['sourceKind'].length > 0;\n\n/** Describes a supplied instruction source for the worker, or rejects one Core could not use. */\nconst describeInstructions = (\n instructions: unknown,\n): INodeInstructionSourceMetadata | null | undefined => {\n if (instructions === undefined) return null;\n if (\n !isRecord(instructions) ||\n Reflect.ownKeys(instructions).some((key) => key !== 'reader' && key !== 'linkResolver')\n )\n return undefined;\n const reader = instructions['reader'];\n const linkResolver = instructions['linkResolver'];\n if (\n !isRecord(reader) ||\n typeof reader['getEntry'] !== 'function' ||\n typeof reader['readFilePage'] !== 'function' ||\n !isSnapshot(reader['snapshot'])\n )\n return undefined;\n if (\n linkResolver !== undefined &&\n (!isRecord(linkResolver) ||\n typeof linkResolver['resolveLink'] !== 'function' ||\n typeof linkResolver['readLinkTargetPage'] !== 'function' ||\n !isSnapshot(linkResolver['snapshot']) ||\n linkResolver['snapshot'].id !== reader['snapshot'].id)\n )\n return undefined;\n return {\n hasLinkResolver: linkResolver !== undefined,\n snapshot: { id: reader['snapshot'].id, sourceKind: reader['snapshot'].sourceKind },\n };\n};\n\nconst aborted = (cause?: unknown): CoreOperationException =>\n new CoreOperationException({\n code: 'ABORTED',\n operation: 'create-project-inspection',\n ...(cause === undefined ? {} : { cause }),\n });\n\n/**\n * Prepares content-free inspection inside one supervised subprocess and one analysis worker.\n * The caller owns actual reader work and must dispose the returned handle before publishing success.\n * @returns An async paging handle after the worker reports its actual heap and prepares inspection.\n * @throws\n * - INVALID_ARGUMENT: The Core operation received an invalid argument.\n * - INVALID_RESOURCE_LIMIT: A Core resource limit is invalid.\n * - ABORTED: The Core operation was aborted.\n * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.\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 * - 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 * - ABORTED: The repository operation was aborted.\n */\nexport const createNodeProjectInspection = async (\n input: INodeProjectInspectionInput,\n): Promise<INodeProjectInspection> => {\n if (\n input === null ||\n typeof input !== 'object' ||\n input.repository === null ||\n typeof input.repository !== 'object' ||\n typeof input.repository.getEntry !== 'function' ||\n typeof input.repository.listEntriesPage !== 'function' ||\n typeof input.repository.readFilePage !== 'function' ||\n input.repository.snapshot === null ||\n typeof input.repository.snapshot !== 'object' ||\n typeof input.repository.snapshot.id !== 'string' ||\n input.repository.snapshot.id.length === 0 ||\n typeof input.repository.snapshot.sourceKind !== 'string' ||\n input.repository.snapshot.sourceKind.length === 0\n ) {\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n }\n const instructions = describeInstructions(input.instructions);\n if (instructions === undefined)\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n let sources: INodeReaderSources | undefined = {\n repository: input.repository,\n ...(input.instructions === undefined ? {} : { instructions: input.instructions }),\n };\n const snapshot = {\n id: input.repository.snapshot.id,\n sourceKind: input.repository.snapshot.sourceKind,\n };\n const signal = input.signal;\n if (\n signal !== undefined &&\n (signal === null ||\n typeof signal !== 'object' ||\n typeof signal.aborted !== 'boolean' ||\n typeof signal.addEventListener !== 'function' ||\n typeof signal.removeEventListener !== 'function')\n ) {\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n }\n const { limits } = normalizeCoreOptions({\n ...(input.limits === undefined ? {} : { limits: input.limits }),\n });\n if (input.deadline !== undefined && (!Number.isSafeInteger(input.deadline) || input.deadline < 0))\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n if (signal?.aborted === true) throw aborted(signal.reason);\n if (isInspectionActive)\n throw new CoreOperationException({\n code: 'INSPECTION_BUSY',\n operation: 'create-project-inspection',\n });\n if (limits.maxRetainedBytes <= NODE_INSPECTION_TRANSPORT_BYTES)\n throw new CoreOperationException({\n code: 'RESOURCE_LIMIT_EXCEEDED',\n operation: 'create-project-inspection',\n limit: 'maxRetainedBytes',\n limitMaximum: limits.maxRetainedBytes,\n observedUsage: NODE_INSPECTION_TRANSPORT_BYTES,\n nextAction: 'reduce-input-or-increase-limit',\n });\n const deadline = Math.min(Date.now() + NODE_INSPECTION_LIFETIME_MS, input.deadline ?? Infinity);\n if (deadline <= Date.now())\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n isInspectionActive = true;\n const controller = new AbortController();\n const attemptId = randomBytes(16).toString('hex');\n const prepared = createCompletion<INodeInspectionMetadata>();\n let pendingPage: ReturnType<typeof createCompletion<IProjectInspectionPageResult>> | undefined;\n let pageRequestId = 0;\n let lastReaderRequestId = -1;\n let hasAcknowledgedHeap = false;\n let heapMaximum: number | undefined;\n let hasPrepared = false;\n let isClosing = false;\n let failure: { cause: Error } | undefined;\n let cleanupPromise: Promise<void> | undefined;\n const readerWork = new Set<Promise<unknown>>();\n const relayWork = new Set<Promise<void>>();\n const child = (() => {\n try {\n return fork(fileURLToPath(import.meta.resolve('#moldea-core-runner')), [], {\n execPath: process.execPath,\n execArgv: [],\n env: createInspectionEnvironment(),\n serialization: 'advanced',\n stdio: ['ignore', 'ignore', 'pipe', 'ipc'],\n });\n } catch (cause) {\n isInspectionActive = false;\n throw createInspectionProcessFailure(cause);\n }\n })();\n const send = createInspectionSender((frame, callback) => {\n if (!child.connected) throw createInspectionProcessFailure();\n child.send(frame, callback);\n });\n const supervision = superviseInspectionChild(child, () => {\n void send({ attemptId, kind: 'dispose' }).catch(() => {\n child.kill('SIGKILL');\n });\n });\n\n /** Keeps admission until child closure and every real reader promise has settled. */\n const cleanup = (): Promise<void> => {\n cleanupPromise ??= (async () => {\n isClosing = true;\n controller.abort(failure?.cause);\n supervision.terminate();\n await supervision.closed;\n await Promise.allSettled([...readerWork, ...relayWork]);\n sources = undefined;\n clearTimeout(timer);\n if (failure === undefined && Date.now() >= deadline) {\n fail(\n new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n }),\n );\n }\n signal?.removeEventListener('abort', handleAbort);\n child.removeAllListeners('message');\n child.removeAllListeners('error');\n child.stderr?.removeAllListeners('data');\n isInspectionActive = false;\n })();\n return cleanupPromise;\n };\n const fail = (cause: unknown): void => {\n if (failure === undefined)\n failure = { cause: cause instanceof Error ? cause : createInspectionProcessFailure(cause) };\n prepared.reject(failure.cause);\n pendingPage?.reject(failure.cause);\n void cleanup();\n };\n const getFailureCause = (): Error | undefined => failure?.cause;\n const handleAbort = (): void => {\n fail(aborted(signal?.reason));\n };\n const timer = setTimeout(\n () => {\n fail(\n new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n }),\n );\n },\n Math.max(1, deadline - Date.now()),\n );\n signal?.addEventListener('abort', handleAbort, { once: true });\n // Re-read through a function because cancellation can change during listener registration.\n const isCallerAborted = (): boolean => signal?.aborted === true;\n if (isCallerAborted()) handleAbort();\n child.once('error', (cause: unknown) => {\n fail(createInspectionProcessFailure(cause));\n });\n void supervision.closed.then(() => {\n if (!isClosing) fail(createInspectionProcessFailure());\n });\n let stderrBytes = 0;\n child.stderr?.on('data', (chunk: Buffer) => {\n stderrBytes += chunk.byteLength;\n if (stderrBytes > NODE_INSPECTION_STDIO_BYTES) fail(createInspectionProcessFailure());\n });\n child.on('message', (frame: unknown) => {\n if (isClosing) return;\n try {\n const message = decodeInspectionMessage(frame);\n if (message.attemptId !== attemptId) throw createInspectionProcessFailure();\n if (message.kind === 'ready') {\n if (hasAcknowledgedHeap) throw createInspectionProcessFailure();\n heapMaximum = message.maxAnalysisHeapBytes;\n hasAcknowledgedHeap = true;\n void send({ attemptId, kind: 'run' }).catch(fail);\n } else if (message.kind === 'prepared') {\n if (\n !hasAcknowledgedHeap ||\n hasPrepared ||\n message.inspection.maxAnalysisHeapBytes !== heapMaximum ||\n message.inspection.source.id !== snapshot.id ||\n message.inspection.source.sourceKind !== snapshot.sourceKind\n )\n throw createInspectionProcessFailure();\n hasPrepared = true;\n prepared.resolve(freezeRecursively(message.inspection));\n } else if (message.kind === 'reader-request') {\n if (\n !hasAcknowledgedHeap ||\n hasPrepared ||\n message.requestId !== lastReaderRequestId + 1 ||\n readerWork.size >= NODE_INSPECTION_MAX_REQUESTS\n )\n throw createInspectionProcessFailure();\n lastReaderRequestId = message.requestId;\n if (sources === undefined) throw createInspectionProcessFailure();\n const work = executeRepositoryRpc(sources, message.request, controller.signal);\n readerWork.add(work);\n const relay = (async () => {\n try {\n const result = await work;\n readerWork.delete(work);\n if (!isClosing)\n await send({\n attemptId,\n kind: 'reader-response',\n requestId: message.requestId,\n result,\n });\n } catch (cause) {\n // Core decides whether absence or a reader resource refusal is recoverable at this check.\n if (\n cause instanceof RepositorySourceException &&\n ['ENTRY_NOT_FOUND', 'ENTRY_NOT_FILE', 'RESOURCE_LIMIT_EXCEEDED'].includes(cause.code)\n ) {\n try {\n if (!isClosing)\n await send({\n attemptId,\n kind: 'reader-failure',\n requestId: message.requestId,\n failure: serializeInspectionFailure(cause),\n });\n } catch (transportFailure) {\n fail(transportFailure);\n }\n } else fail(cause);\n } finally {\n readerWork.delete(work);\n }\n })();\n relayWork.add(relay);\n void relay.finally(() => relayWork.delete(relay));\n } else if (message.kind === 'page') {\n if (!hasPrepared || pendingPage === undefined || message.requestId !== pageRequestId)\n throw createInspectionProcessFailure();\n const completion = pendingPage;\n pendingPage = undefined;\n completion.resolve(freezeRecursively(message.result));\n } else if (message.kind === 'failure') {\n if (\n message.failure.options['nextAction'] === 'review-inspection-capacity' &&\n (heapMaximum === undefined || message.failure.options['limitMaximum'] !== heapMaximum)\n )\n throw createInspectionProcessFailure();\n fail(deserializeInspectionFailure(message.failure));\n } else throw createInspectionProcessFailure();\n } catch (cause) {\n fail(cause);\n }\n });\n try {\n await send({\n attemptId,\n kind: 'start',\n snapshot,\n instructions,\n limits,\n deadline,\n });\n const metadata = await prepared.promise;\n if (Date.now() >= deadline)\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n return Object.freeze({\n ...metadata,\n readPage: async (pageInput): Promise<IProjectInspectionPageResult> => {\n if (failure !== undefined || isClosing) throw failure?.cause ?? aborted();\n if (\n pendingPage !== undefined ||\n pageInput === null ||\n typeof pageInput !== 'object' ||\n Reflect.ownKeys(pageInput).some(\n (key) => key !== 'cursor' && key !== 'maxItems' && key !== 'view',\n ) ||\n !Number.isSafeInteger(pageInput.maxItems) ||\n pageInput.maxItems < 1 ||\n pageInput.maxItems > limits.maxEntries ||\n !['all', 'diagnostics', 'coverage', 'metadata'].includes(pageInput.view) ||\n (pageInput.cursor !== undefined && typeof pageInput.cursor !== 'string')\n )\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n const completion = createCompletion<IProjectInspectionPageResult>();\n pendingPage = completion;\n pageRequestId++;\n try {\n if (Date.now() >= deadline)\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n await send({\n attemptId,\n kind: 'read-page',\n requestId: pageRequestId,\n input: {\n maxItems: pageInput.maxItems,\n view: pageInput.view,\n ...(pageInput.cursor === undefined ? {} : { cursor: pageInput.cursor }),\n },\n });\n const result = await completion.promise;\n if (Date.now() >= deadline)\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n return result;\n } catch (cause) {\n fail(cause);\n await cleanup();\n throw getFailureCause() ?? createInspectionProcessFailure(cause);\n } finally {\n if (pendingPage === completion) pendingPage = undefined;\n }\n },\n dispose: async (): Promise<void> => {\n pendingPage?.reject(failure?.cause ?? aborted());\n await cleanup();\n const cause = getFailureCause();\n if (cause !== undefined) throw cause;\n },\n } satisfies INodeProjectInspection);\n } catch (cause) {\n fail(cause);\n await cleanup();\n throw getFailureCause() ?? createInspectionProcessFailure(cause);\n }\n};\n"],"mappings":";;;;;;;;;;AAiCA,IAAI,qBAAqB;;AAGzB,IAAM,yBAID;CACH,IAAI;CACJ,IAAI;CACJ,MAAM,UAAU,IAAI,SAAY,eAAe,iBAAiB;EAC9D,UAAU;EACV,SAAS;CACX,CAAC;CACD,QAAa,YAAY,CAAC,CAAC;CAC3B,OAAO;EAAE;EAAS;EAAS;CAAO;AACpC;AAEA,IAAM,YAAY,UAChB,UAAU,QAAQ,OAAO,UAAU;AACrC,IAAM,cAAc,UAClB,SAAS,KAAK,KACd,OAAO,MAAM,UAAU,YACvB,MAAM,KAAK,CAAC,SAAS,KACrB,OAAO,MAAM,kBAAkB,YAC/B,MAAM,aAAa,CAAC,SAAS;;AAG/B,IAAM,wBACJ,iBACsD;CACtD,IAAI,iBAAiB,KAAA,GAAW,OAAO;CACvC,IACE,CAAC,SAAS,YAAY,KACtB,QAAQ,QAAQ,YAAY,CAAC,CAAC,MAAM,QAAQ,QAAQ,YAAY,QAAQ,cAAc,GAEtF,OAAO,KAAA;CACT,MAAM,SAAS,aAAa;CAC5B,MAAM,eAAe,aAAa;CAClC,IACE,CAAC,SAAS,MAAM,KAChB,OAAO,OAAO,gBAAgB,cAC9B,OAAO,OAAO,oBAAoB,cAClC,CAAC,WAAW,OAAO,WAAW,GAE9B,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MAAM,SAAS,MAAM,WAAW;KAChC,IAAI,KAAK,IAAI,KAAK,UAChB,MAAM,IAAI,uBAAuB;MAC/B,MAAM;MACN,WAAW;KACb,CAAC;KACH,OAAO;IACT,SAAS,OAAO;KACd,KAAK,KAAK;KACV,MAAM,QAAQ;KACd,MAAM,gBAAgB,KAAK,+BAA+B,KAAK;IACjE,UAAU;KACR,IAAI,gBAAgB,YAAY,cAAc,KAAA;IAChD;GACF;GACA,SAAS,YAA2B;IAClC,aAAa,OAAO,SAAS,SAAS,QAAQ,CAAC;IAC/C,MAAM,QAAQ;IACd,MAAM,QAAQ,gBAAgB;IAC9B,IAAI,UAAU,KAAA,GAAW,MAAM;GACjC;EACF,CAAkC;CACpC,SAAS,OAAO;EACd,KAAK,KAAK;EACV,MAAM,QAAQ;EACd,MAAM,gBAAgB,KAAK,+BAA+B,KAAK;CACjE;AACF"}
|
|
1
|
+
{"version":3,"file":"node.js","names":[],"sources":["../src/node-inspection/client.ts"],"sourcesContent":["import { fork } from 'node:child_process';\nimport { randomBytes } from 'node:crypto';\nimport { fileURLToPath } from 'node:url';\nimport { deepFreeze, isObjectValid } from 'jg-utilities';\n\nimport { RepositorySourceException } from '@moldea.ai/repository';\n\nimport { CoreOperationException } from '../exceptions/index.js';\nimport { normalizeCoreOptions } from '../options/index.js';\n\nimport {\n NODE_INSPECTION_LIFETIME_MS,\n NODE_INSPECTION_MAX_REQUESTS,\n NODE_INSPECTION_STDIO_BYTES,\n NODE_INSPECTION_TRANSPORT_BYTES,\n} from './constants.js';\nimport { deserializeInspectionFailure, serializeInspectionFailure } from './errors.js';\nimport {\n createInspectionEnvironment,\n createInspectionSender,\n superviseInspectionChild,\n} from './lifecycle.js';\nimport { createInspectionProcessFailure, decodeInspectionMessage } from './protocol.js';\nimport { executeRepositoryRpc } from './repository-rpc.js';\nimport type {\n INodeInspectionMetadata,\n INodeInstructionSourceMetadata,\n INodeProjectInspection,\n INodeProjectInspectionInput,\n INodeReaderSources,\n} from './types.js';\nimport type { IProjectInspectionPageResult } from '../contracts/index.js';\n\nlet isInspectionActive = false;\n\n/** Stores one completion without an unhandled rejection before its owner begins awaiting it. */\nconst createCompletion = <T>(): PromiseWithResolvers<T> => {\n const completion = Promise.withResolvers<T>();\n void completion.promise.catch(() => {});\n return completion;\n};\n\nconst isSnapshot = (input: unknown): input is { id: string; sourceKind: string } =>\n isObjectValid(input, true) &&\n typeof input['id'] === 'string' &&\n input['id'].length > 0 &&\n typeof input['sourceKind'] === 'string' &&\n input['sourceKind'].length > 0;\n\n/** Describes a supplied instruction reader for the worker, or rejects one Core could not use. */\nconst describeInstructions = (\n instructions: unknown,\n): INodeInstructionSourceMetadata | null | undefined => {\n if (instructions === undefined) return null;\n if (\n !isObjectValid(instructions, true) ||\n typeof instructions['getEntry'] !== 'function' ||\n typeof instructions['readFilePage'] !== 'function' ||\n typeof instructions['readLinkText'] !== 'function' ||\n !isSnapshot(instructions['snapshot'])\n )\n return undefined;\n return {\n snapshot: { id: instructions['snapshot'].id, sourceKind: instructions['snapshot'].sourceKind },\n };\n};\n\nconst aborted = (cause?: unknown): CoreOperationException =>\n new CoreOperationException({\n code: 'ABORTED',\n operation: 'create-project-inspection',\n ...(cause === undefined ? {} : { cause }),\n });\n\n/**\n * Prepares content-free inspection inside one supervised subprocess and one analysis worker.\n * The caller owns actual reader work and must dispose the returned handle before publishing success.\n * @returns An async paging handle after the worker reports its actual heap and prepares inspection.\n * @throws\n * - INVALID_ARGUMENT: The Core operation received an invalid argument.\n * - INVALID_RESOURCE_LIMIT: A Core resource limit is invalid.\n * - ABORTED: The Core operation was aborted.\n * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.\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 * - 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 * - ABORTED: The repository operation was aborted.\n */\nexport const createNodeProjectInspection = async (\n input: INodeProjectInspectionInput,\n): Promise<INodeProjectInspection> => {\n if (\n input === null ||\n typeof input !== 'object' ||\n input.repository === null ||\n typeof input.repository !== 'object' ||\n typeof input.repository.getEntry !== 'function' ||\n typeof input.repository.listEntriesPage !== 'function' ||\n typeof input.repository.readFilePage !== 'function' ||\n typeof input.repository.readLinkText !== 'function' ||\n input.repository.snapshot === null ||\n typeof input.repository.snapshot !== 'object' ||\n typeof input.repository.snapshot.id !== 'string' ||\n input.repository.snapshot.id.length === 0 ||\n typeof input.repository.snapshot.sourceKind !== 'string' ||\n input.repository.snapshot.sourceKind.length === 0\n ) {\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n }\n const instructions = describeInstructions(input.instructions);\n if (instructions === undefined)\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n let sources: INodeReaderSources | undefined = {\n repository: input.repository,\n ...(input.instructions === undefined ? {} : { instructions: input.instructions }),\n };\n const snapshot = {\n id: input.repository.snapshot.id,\n sourceKind: input.repository.snapshot.sourceKind,\n };\n const signal = input.signal;\n if (\n signal !== undefined &&\n (signal === null ||\n typeof signal !== 'object' ||\n typeof signal.aborted !== 'boolean' ||\n typeof signal.addEventListener !== 'function' ||\n typeof signal.removeEventListener !== 'function')\n ) {\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n }\n const { limits } = normalizeCoreOptions({\n ...(input.limits === undefined ? {} : { limits: input.limits }),\n });\n if (input.deadline !== undefined && (!Number.isSafeInteger(input.deadline) || input.deadline < 0))\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n if (signal?.aborted === true) throw aborted(signal.reason);\n if (isInspectionActive)\n throw new CoreOperationException({\n code: 'INSPECTION_BUSY',\n operation: 'create-project-inspection',\n });\n if (limits.maxRetainedBytes <= NODE_INSPECTION_TRANSPORT_BYTES)\n throw new CoreOperationException({\n code: 'RESOURCE_LIMIT_EXCEEDED',\n operation: 'create-project-inspection',\n limit: 'maxRetainedBytes',\n limitMaximum: limits.maxRetainedBytes,\n observedUsage: NODE_INSPECTION_TRANSPORT_BYTES,\n nextAction: 'reduce-input-or-increase-limit',\n });\n const deadline = Math.min(Date.now() + NODE_INSPECTION_LIFETIME_MS, input.deadline ?? Infinity);\n if (deadline <= Date.now())\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n isInspectionActive = true;\n const controller = new AbortController();\n const attemptId = randomBytes(16).toString('hex');\n const prepared = createCompletion<INodeInspectionMetadata>();\n let pendingPage: ReturnType<typeof createCompletion<IProjectInspectionPageResult>> | undefined;\n let pageRequestId = 0;\n let lastReaderRequestId = -1;\n let hasAcknowledgedHeap = false;\n let heapMaximum: number | undefined;\n let hasPrepared = false;\n let isClosing = false;\n let failure: { cause: Error } | undefined;\n let cleanupPromise: Promise<void> | undefined;\n const readerWork = new Set<Promise<unknown>>();\n const relayWork = new Set<Promise<void>>();\n const child = (() => {\n try {\n return fork(fileURLToPath(import.meta.resolve('#moldea-core-runner')), [], {\n execPath: process.execPath,\n execArgv: [],\n env: createInspectionEnvironment(),\n serialization: 'advanced',\n stdio: ['ignore', 'ignore', 'pipe', 'ipc'],\n });\n } catch (cause) {\n isInspectionActive = false;\n throw createInspectionProcessFailure(cause);\n }\n })();\n const send = createInspectionSender((frame, callback) => {\n if (!child.connected) throw createInspectionProcessFailure();\n child.send(frame, callback);\n });\n const supervision = superviseInspectionChild(child, () => {\n void send({ attemptId, kind: 'dispose' }).catch(() => {\n child.kill('SIGKILL');\n });\n });\n\n /** Keeps admission until child closure and every real reader promise has settled. */\n const cleanup = (): Promise<void> => {\n cleanupPromise ??= (async () => {\n isClosing = true;\n controller.abort(failure?.cause);\n supervision.terminate();\n await supervision.closed;\n await Promise.allSettled([...readerWork, ...relayWork]);\n sources = undefined;\n clearTimeout(timer);\n if (failure === undefined && Date.now() >= deadline) {\n fail(\n new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n }),\n );\n }\n signal?.removeEventListener('abort', handleAbort);\n child.removeAllListeners('message');\n child.removeAllListeners('error');\n child.stderr?.removeAllListeners('data');\n isInspectionActive = false;\n })();\n return cleanupPromise;\n };\n const fail = (cause: unknown): void => {\n if (failure === undefined)\n failure = { cause: cause instanceof Error ? cause : createInspectionProcessFailure(cause) };\n prepared.reject(failure.cause);\n pendingPage?.reject(failure.cause);\n void cleanup();\n };\n const getFailureCause = (): Error | undefined => failure?.cause;\n const handleAbort = (): void => {\n fail(aborted(signal?.reason));\n };\n const timer = setTimeout(\n () => {\n fail(\n new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n }),\n );\n },\n Math.max(1, deadline - Date.now()),\n );\n signal?.addEventListener('abort', handleAbort, { once: true });\n // Re-read through a function because cancellation can change during listener registration.\n const isCallerAborted = (): boolean => signal?.aborted === true;\n if (isCallerAborted()) handleAbort();\n child.once('error', (cause: unknown) => {\n fail(createInspectionProcessFailure(cause));\n });\n void supervision.closed.then(() => {\n if (!isClosing) fail(createInspectionProcessFailure());\n });\n let stderrBytes = 0;\n child.stderr?.on('data', (chunk: Buffer) => {\n stderrBytes += chunk.byteLength;\n if (stderrBytes > NODE_INSPECTION_STDIO_BYTES) fail(createInspectionProcessFailure());\n });\n child.on('message', (frame: unknown) => {\n if (isClosing) return;\n try {\n const message = decodeInspectionMessage(frame);\n if (message.attemptId !== attemptId) throw createInspectionProcessFailure();\n if (message.kind === 'ready') {\n if (hasAcknowledgedHeap) throw createInspectionProcessFailure();\n heapMaximum = message.maxAnalysisHeapBytes;\n hasAcknowledgedHeap = true;\n void send({ attemptId, kind: 'run' }).catch(fail);\n } else if (message.kind === 'prepared') {\n if (\n !hasAcknowledgedHeap ||\n hasPrepared ||\n message.inspection.maxAnalysisHeapBytes !== heapMaximum ||\n message.inspection.source.id !== snapshot.id ||\n message.inspection.source.sourceKind !== snapshot.sourceKind\n )\n throw createInspectionProcessFailure();\n hasPrepared = true;\n prepared.resolve(deepFreeze(message.inspection));\n } else if (message.kind === 'reader-request') {\n if (\n !hasAcknowledgedHeap ||\n hasPrepared ||\n message.requestId !== lastReaderRequestId + 1 ||\n readerWork.size >= NODE_INSPECTION_MAX_REQUESTS\n )\n throw createInspectionProcessFailure();\n lastReaderRequestId = message.requestId;\n if (sources === undefined) throw createInspectionProcessFailure();\n const work = executeRepositoryRpc(sources, message.request, controller.signal);\n readerWork.add(work);\n const relay = (async () => {\n try {\n const result = await work;\n readerWork.delete(work);\n if (!isClosing)\n await send({\n attemptId,\n kind: 'reader-response',\n requestId: message.requestId,\n result,\n });\n } catch (cause) {\n // Core decides whether absence or a reader resource refusal is recoverable at this check.\n if (\n cause instanceof RepositorySourceException &&\n ['ENTRY_NOT_FOUND', 'ENTRY_NOT_FILE', 'RESOURCE_LIMIT_EXCEEDED'].includes(cause.code)\n ) {\n try {\n if (!isClosing)\n await send({\n attemptId,\n kind: 'reader-failure',\n requestId: message.requestId,\n failure: serializeInspectionFailure(cause),\n });\n } catch (transportFailure) {\n fail(transportFailure);\n }\n } else fail(cause);\n } finally {\n readerWork.delete(work);\n }\n })();\n relayWork.add(relay);\n void relay.finally(() => relayWork.delete(relay));\n } else if (message.kind === 'page') {\n if (!hasPrepared || pendingPage === undefined || message.requestId !== pageRequestId)\n throw createInspectionProcessFailure();\n const completion = pendingPage;\n pendingPage = undefined;\n completion.resolve(deepFreeze(message.result));\n } else if (message.kind === 'failure') {\n if (\n message.failure.options['nextAction'] === 'review-inspection-capacity' &&\n (heapMaximum === undefined || message.failure.options['limitMaximum'] !== heapMaximum)\n )\n throw createInspectionProcessFailure();\n fail(deserializeInspectionFailure(message.failure));\n } else throw createInspectionProcessFailure();\n } catch (cause) {\n fail(cause);\n }\n });\n try {\n await send({\n attemptId,\n kind: 'start',\n snapshot,\n instructions,\n limits,\n deadline,\n });\n const metadata = await prepared.promise;\n if (Date.now() >= deadline)\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n return Object.freeze({\n ...metadata,\n readPage: async (pageInput): Promise<IProjectInspectionPageResult> => {\n if (failure !== undefined || isClosing) throw failure?.cause ?? aborted();\n if (\n pendingPage !== undefined ||\n pageInput === null ||\n typeof pageInput !== 'object' ||\n Reflect.ownKeys(pageInput).some(\n (key) => key !== 'cursor' && key !== 'maxItems' && key !== 'view',\n ) ||\n !Number.isSafeInteger(pageInput.maxItems) ||\n pageInput.maxItems < 1 ||\n pageInput.maxItems > limits.maxEntries ||\n !['all', 'diagnostics', 'coverage', 'metadata'].includes(pageInput.view) ||\n (pageInput.cursor !== undefined && typeof pageInput.cursor !== 'string')\n )\n throw new CoreOperationException({\n code: 'INVALID_ARGUMENT',\n operation: 'create-project-inspection',\n });\n const completion = createCompletion<IProjectInspectionPageResult>();\n pendingPage = completion;\n pageRequestId++;\n try {\n if (Date.now() >= deadline)\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n await send({\n attemptId,\n kind: 'read-page',\n requestId: pageRequestId,\n input: {\n maxItems: pageInput.maxItems,\n view: pageInput.view,\n ...(pageInput.cursor === undefined ? {} : { cursor: pageInput.cursor }),\n },\n });\n const result = await completion.promise;\n if (Date.now() >= deadline)\n throw new CoreOperationException({\n code: 'INSPECTION_TIMEOUT',\n operation: 'create-project-inspection',\n });\n return result;\n } catch (cause) {\n fail(cause);\n await cleanup();\n throw getFailureCause() ?? createInspectionProcessFailure(cause);\n } finally {\n if (pendingPage === completion) pendingPage = undefined;\n }\n },\n dispose: async (): Promise<void> => {\n pendingPage?.reject(failure?.cause ?? aborted());\n await cleanup();\n const cause = getFailureCause();\n if (cause !== undefined) throw cause;\n },\n } satisfies INodeProjectInspection);\n } catch (cause) {\n fail(cause);\n await cleanup();\n throw getFailureCause() ?? createInspectionProcessFailure(cause);\n }\n};\n"],"mappings":";;;;;;;;;;;AAiCA,IAAI,qBAAqB;;AAGzB,IAAM,yBAAqD;CACzD,MAAM,aAAa,QAAQ,cAAiB;CAC5C,WAAgB,QAAQ,YAAY,CAAC,CAAC;CACtC,OAAO;AACT;AAEA,IAAM,cAAc,UAClB,cAAc,OAAO,IAAI,KACzB,OAAO,MAAM,UAAU,YACvB,MAAM,KAAK,CAAC,SAAS,KACrB,OAAO,MAAM,kBAAkB,YAC/B,MAAM,aAAa,CAAC,SAAS;;AAG/B,IAAM,wBACJ,iBACsD;CACtD,IAAI,iBAAiB,KAAA,GAAW,OAAO;CACvC,IACE,CAAC,cAAc,cAAc,IAAI,KACjC,OAAO,aAAa,gBAAgB,cACpC,OAAO,aAAa,oBAAoB,cACxC,OAAO,aAAa,oBAAoB,cACxC,CAAC,WAAW,aAAa,WAAW,GAEpC,OAAO,KAAA;CACT,OAAO,EACL,UAAU;EAAE,IAAI,aAAa,WAAW,CAAC;EAAI,YAAY,aAAa,WAAW,CAAC;CAAW,EAC/F;AACF;AAEA,IAAM,WAAW,UACf,IAAI,uBAAuB;CACzB,MAAM;CACN,WAAW;CACX,GAAI,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM;AACzC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,IAAa,8BAA8B,OACzC,UACoC;CACpC,IACE,UAAU,QACV,OAAO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+B,KAAK;CACjE;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/options/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/options/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK/E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACtC;AAED,qFAAqF;AACrF,eAAO,MAAM,kCAAkC,GAC7C,SAAS,oBAAoB,KAC5B,oBAIF,CAAC;AAiEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,YAAY,GAAG,SAAS,KAAG,oBAWxE,CAAC"}
|