@moldea.ai/core 9.0.1 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/analysis-worker.js +1 -1
- package/dist/chunks/{core-CFmT3SRC.js → core-DuaKbQLI.js} +23 -5
- package/dist/chunks/core-DuaKbQLI.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/integration-validation/agents-inspection.d.ts.map +1 -1
- package/dist/integration-validation/parser.d.ts +3 -1
- package/dist/integration-validation/parser.d.ts.map +1 -1
- package/dist/node-inspection/client.d.ts.map +1 -1
- package/dist/node-inspection/types.d.ts +1 -0
- package/dist/node-inspection/types.d.ts.map +1 -1
- package/dist/node.js +11 -5
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/core-CFmT3SRC.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createCore, r as parseIntegrationBlock } from "./chunks/core-
|
|
1
|
+
import { n as createCore, r as parseIntegrationBlock } from "./chunks/core-DuaKbQLI.js";
|
|
2
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
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 +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":"AAWA,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAE9B,MAAM,YAAY,CAAC;AAuHpB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,6BAA6B,KACrC,OAAO,CAAC,wBAAwB,CAmClC,CAAC"}
|
|
@@ -2,11 +2,13 @@ import { type IMarkedRegion } from 'jg-utilities';
|
|
|
2
2
|
import type { IIntegrationBlockResult } from './types.js';
|
|
3
3
|
/**
|
|
4
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.
|
|
5
|
+
* marker, each on its own line with optional trailing spaces or tabs, the start first.
|
|
6
6
|
* @param text The instruction document.
|
|
7
7
|
* @returns The region, or why the document has none.
|
|
8
8
|
*/
|
|
9
9
|
export declare const parseManagedIntegrationRegion: (text: string) => IMarkedRegion | "block-missing" | "block-invalid";
|
|
10
|
+
/** Removes only managed-envelope formatting differences, preserving all instruction content. */
|
|
11
|
+
export declare const normalizeManagedIntegrationBlock: (text: string) => string;
|
|
10
12
|
/**
|
|
11
13
|
* Extracts the relative installation path from the fixed relevance-gate command without executing it.
|
|
12
14
|
* @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":"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,
|
|
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,eAmBpC,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,gCAAgC,GAAI,MAAM,MAAM,KAAG,MAc/D,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"}
|
|
@@ -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;AA4CpB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,2BAA2B,KACjC,OAAO,CAAC,sBAAsB,
|
|
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,CAoWhC,CAAC"}
|
|
@@ -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,KAAK,EACV,mBAAm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E,GACf;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,uBAAuB,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,2BAA2B,CAAA;CAAE,GAC5E;IAAE,IAAI,EAAE,MAAM,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.js
CHANGED
|
@@ -9,7 +9,7 @@ import { fork } from "node:child_process";
|
|
|
9
9
|
import { randomBytes } from "node:crypto";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
//#region src/node-inspection/client.ts
|
|
12
|
-
var
|
|
12
|
+
var activeInspectionCount = 0;
|
|
13
13
|
/** Stores one completion without an unhandled rejection before its owner begins awaiting it. */
|
|
14
14
|
var createCompletion = () => {
|
|
15
15
|
const completion = Promise.withResolvers();
|
|
@@ -84,8 +84,14 @@ var createNodeProjectInspection = async (input) => {
|
|
|
84
84
|
code: "INVALID_ARGUMENT",
|
|
85
85
|
operation: "create-project-inspection"
|
|
86
86
|
});
|
|
87
|
+
const configuredMaximum = input.maxConcurrentInspections;
|
|
88
|
+
const maxConcurrentInspections = configuredMaximum === void 0 ? 1 : configuredMaximum;
|
|
89
|
+
if (!Number.isSafeInteger(maxConcurrentInspections) || maxConcurrentInspections < 1) throw new CoreOperationException({
|
|
90
|
+
code: "INVALID_ARGUMENT",
|
|
91
|
+
operation: "create-project-inspection"
|
|
92
|
+
});
|
|
87
93
|
if (signal?.aborted === true) throw aborted(signal.reason);
|
|
88
|
-
if (
|
|
94
|
+
if (activeInspectionCount >= maxConcurrentInspections) throw new CoreOperationException({
|
|
89
95
|
code: "INSPECTION_BUSY",
|
|
90
96
|
operation: "create-project-inspection"
|
|
91
97
|
});
|
|
@@ -102,7 +108,7 @@ var createNodeProjectInspection = async (input) => {
|
|
|
102
108
|
code: "INSPECTION_TIMEOUT",
|
|
103
109
|
operation: "create-project-inspection"
|
|
104
110
|
});
|
|
105
|
-
|
|
111
|
+
activeInspectionCount++;
|
|
106
112
|
const controller = new AbortController();
|
|
107
113
|
const attemptId = randomBytes(16).toString("hex");
|
|
108
114
|
const prepared = createCompletion();
|
|
@@ -132,7 +138,7 @@ var createNodeProjectInspection = async (input) => {
|
|
|
132
138
|
]
|
|
133
139
|
});
|
|
134
140
|
} catch (cause) {
|
|
135
|
-
|
|
141
|
+
activeInspectionCount--;
|
|
136
142
|
throw createInspectionProcessFailure(cause);
|
|
137
143
|
}
|
|
138
144
|
})();
|
|
@@ -166,7 +172,7 @@ var createNodeProjectInspection = async (input) => {
|
|
|
166
172
|
child.removeAllListeners("message");
|
|
167
173
|
child.removeAllListeners("error");
|
|
168
174
|
child.stderr?.removeAllListeners("data");
|
|
169
|
-
|
|
175
|
+
activeInspectionCount--;
|
|
170
176
|
})();
|
|
171
177
|
return cleanupPromise;
|
|
172
178
|
};
|
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';\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,SA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AO;MACvE;KACF,CAAC;KACD,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 activeInspectionCount = 0;\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 const configuredMaximum = input.maxConcurrentInspections;\n const maxConcurrentInspections = configuredMaximum === undefined ? 1 : configuredMaximum;\n if (!Number.isSafeInteger(maxConcurrentInspections) || maxConcurrentInspections < 1)\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 (activeInspectionCount >= maxConcurrentInspections)\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 activeInspectionCount++;\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 activeInspectionCount--;\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 activeInspectionCount--;\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,wBAAwB;;AAG5B,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;CAA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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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moldea.ai/core",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"description": "Source-neutral, deterministic interpretation and indexing of moldea repositories.",
|
|
5
5
|
"homepage": "https://github.com/moldea-ai/packages/tree/main/projects/core#readme",
|
|
6
6
|
"bugs": {
|