@moldea.ai/core 5.0.0 → 6.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.
Files changed (72) hide show
  1. package/README.md +11 -4
  2. package/dist/adapter/index.d.ts +16 -4
  3. package/dist/adapter/index.d.ts.map +1 -1
  4. package/dist/adapter-execution/index.d.ts +12 -9
  5. package/dist/adapter-execution/index.d.ts.map +1 -1
  6. package/dist/adapter-result-collection/collection.d.ts +13 -0
  7. package/dist/adapter-result-collection/collection.d.ts.map +1 -0
  8. package/dist/adapter-result-collection/index.d.ts +3 -0
  9. package/dist/adapter-result-collection/index.d.ts.map +1 -0
  10. package/dist/adapter-result-collection/types.d.ts +31 -0
  11. package/dist/adapter-result-collection/types.d.ts.map +1 -0
  12. package/dist/adapter.js +3 -2
  13. package/dist/adapter.js.map +1 -1
  14. package/dist/analysis-worker.js +190 -0
  15. package/dist/analysis-worker.js.map +1 -0
  16. package/dist/chunks/collection-CvbjjLf2.js +73 -0
  17. package/dist/chunks/collection-CvbjjLf2.js.map +1 -0
  18. package/dist/chunks/core-DchheNDz.js +5305 -0
  19. package/dist/chunks/core-DchheNDz.js.map +1 -0
  20. package/dist/chunks/errors-BQI1DEqf.js +446 -0
  21. package/dist/chunks/errors-BQI1DEqf.js.map +1 -0
  22. package/dist/chunks/{exceptions-HS9ofVy2.js → exceptions-lzD3buFw.js} +26 -15
  23. package/dist/chunks/exceptions-lzD3buFw.js.map +1 -0
  24. package/dist/chunks/lifecycle-4EkWgEHm.js +67 -0
  25. package/dist/chunks/lifecycle-4EkWgEHm.js.map +1 -0
  26. package/dist/chunks/options-CxCT3dZU.js +617 -0
  27. package/dist/chunks/options-CxCT3dZU.js.map +1 -0
  28. package/dist/chunks/repository-rpc-BWi6X1la.js +124 -0
  29. package/dist/chunks/repository-rpc-BWi6X1la.js.map +1 -0
  30. package/dist/contracts/index.d.ts +28 -18
  31. package/dist/contracts/index.d.ts.map +1 -1
  32. package/dist/custom-runtime-inspection/index.d.ts +2 -0
  33. package/dist/custom-runtime-inspection/index.d.ts.map +1 -0
  34. package/dist/custom-runtime-inspection/inspection.d.ts +11 -0
  35. package/dist/custom-runtime-inspection/inspection.d.ts.map +1 -0
  36. package/dist/exceptions/index.d.ts +23 -4
  37. package/dist/exceptions/index.d.ts.map +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +3 -5775
  41. package/dist/node/index.d.ts +4 -0
  42. package/dist/node/index.d.ts.map +1 -0
  43. package/dist/node-inspection/analysis-worker.d.ts +2 -0
  44. package/dist/node-inspection/analysis-worker.d.ts.map +1 -0
  45. package/dist/node-inspection/client.d.ts +32 -0
  46. package/dist/node-inspection/client.d.ts.map +1 -0
  47. package/dist/node-inspection/constants.d.ts +21 -0
  48. package/dist/node-inspection/constants.d.ts.map +1 -0
  49. package/dist/node-inspection/errors.d.ts +11 -0
  50. package/dist/node-inspection/errors.d.ts.map +1 -0
  51. package/dist/node-inspection/lifecycle.d.ts +15 -0
  52. package/dist/node-inspection/lifecycle.d.ts.map +1 -0
  53. package/dist/node-inspection/protocol.d.ts +20 -0
  54. package/dist/node-inspection/protocol.d.ts.map +1 -0
  55. package/dist/node-inspection/repository-rpc.d.ts +28 -0
  56. package/dist/node-inspection/repository-rpc.d.ts.map +1 -0
  57. package/dist/node-inspection/runner.d.ts +2 -0
  58. package/dist/node-inspection/runner.d.ts.map +1 -0
  59. package/dist/node-inspection/types.d.ts +99 -0
  60. package/dist/node-inspection/types.d.ts.map +1 -0
  61. package/dist/node-runner.js +149 -0
  62. package/dist/node-runner.js.map +1 -0
  63. package/dist/node.js +325 -0
  64. package/dist/node.js.map +1 -0
  65. package/dist/project-inspection/index.d.ts +22 -1
  66. package/dist/project-inspection/index.d.ts.map +1 -1
  67. package/dist/project-metadata/index.d.ts.map +1 -1
  68. package/dist/project-validation/index.d.ts +34 -10
  69. package/dist/project-validation/index.d.ts.map +1 -1
  70. package/package.json +9 -1
  71. package/dist/chunks/exceptions-HS9ofVy2.js.map +0 -1
  72. package/dist/index.js.map +0 -1
package/dist/node.js ADDED
@@ -0,0 +1,325 @@
1
+ import { n as CoreOperationException } from "./chunks/exceptions-lzD3buFw.js";
2
+ import { F as freezeRecursively, n as normalizeCoreOptions } from "./chunks/options-CxCT3dZU.js";
3
+ import { c as NODE_INSPECTION_PROFILE, d as NODE_INSPECTION_TRANSPORT_BYTES, i as decodeInspectionMessage, r as createInspectionProcessFailure, s as NODE_INSPECTION_LIFETIME_MS, t as deserializeInspectionFailure } from "./chunks/errors-BQI1DEqf.js";
4
+ import { n as createInspectionSender, r as superviseInspectionChild, t as createInspectionEnvironment } from "./chunks/lifecycle-4EkWgEHm.js";
5
+ import { t as executeRepositoryRpc } from "./chunks/repository-rpc-BWi6X1la.js";
6
+ import { fork } from "node:child_process";
7
+ import { randomBytes } from "node:crypto";
8
+ import { fileURLToPath } from "node:url";
9
+ //#region src/node-inspection/client.ts
10
+ var isInspectionActive = false;
11
+ /** Stores one completion without an unhandled rejection before its owner begins awaiting it. */
12
+ var createCompletion = () => {
13
+ let resolve;
14
+ let reject;
15
+ const promise = new Promise((resolveResult, rejectResult) => {
16
+ resolve = resolveResult;
17
+ reject = rejectResult;
18
+ });
19
+ promise.catch(() => {});
20
+ return {
21
+ promise,
22
+ resolve,
23
+ reject
24
+ };
25
+ };
26
+ var aborted = (cause) => new CoreOperationException({
27
+ code: "ABORTED",
28
+ operation: "create-project-inspection",
29
+ ...cause === void 0 ? {} : { cause }
30
+ });
31
+ /**
32
+ * Prepares content-free inspection inside one supervised subprocess and one analysis worker.
33
+ * The caller owns actual reader work and must dispose the returned handle before publishing success.
34
+ * @returns An async paging handle after the worker reports its actual heap and prepares inspection.
35
+ * @throws
36
+ * - INVALID_ARGUMENT: The Core operation received an invalid argument.
37
+ * - INVALID_RESOURCE_LIMIT: A Core resource limit is invalid.
38
+ * - DUPLICATE_ADAPTER_ID: A runtime adapter ID is registered more than once.
39
+ * - RESERVED_ADAPTER_ID: A reserved runtime adapter ID was supplied.
40
+ * - INVALID_ADAPTER_DEFINITION: A runtime adapter definition is invalid.
41
+ * - ABORTED: The Core operation was aborted.
42
+ * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
43
+ * - ADAPTER_EXECUTION_FAILED: A runtime adapter failed during inspection.
44
+ * - INSPECTION_BUSY: Project inspection capacity is busy. Try again shortly.
45
+ * - INSPECTION_TIMEOUT: The isolated project inspection timed out.
46
+ * - INSPECTION_PROCESS_FAILED: The isolated project inspection failed.
47
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
48
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
49
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
50
+ * - ENTRY_NOT_DIRECTORY: The requested repository entry is not a directory.
51
+ * - INVALID_PAGE_REQUEST: The repository page request is invalid.
52
+ * - ACCESS_DENIED: Access to the repository source was denied.
53
+ * - SOURCE_UNAVAILABLE: The repository source is unavailable.
54
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
55
+ * - PROVIDER_INCOMPLETE: The repository provider cannot expose a complete result.
56
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
57
+ * - RESOURCE_LIMIT_EXCEEDED: A named repository resource limit was exceeded.
58
+ * - ABORTED: The repository operation was aborted.
59
+ */
60
+ var createNodeProjectInspection = async (input) => {
61
+ 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({
62
+ code: "INVALID_ARGUMENT",
63
+ operation: "create-project-inspection"
64
+ });
65
+ let repository = input.repository;
66
+ const snapshot = {
67
+ id: repository.snapshot.id,
68
+ sourceKind: repository.snapshot.sourceKind
69
+ };
70
+ const signal = input.signal;
71
+ if (signal !== void 0 && (signal === null || typeof signal !== "object" || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function" || typeof signal.removeEventListener !== "function")) throw new CoreOperationException({
72
+ code: "INVALID_ARGUMENT",
73
+ operation: "create-project-inspection"
74
+ });
75
+ const { limits } = normalizeCoreOptions({ ...input.limits === void 0 ? {} : { limits: input.limits } });
76
+ if (!(input.adapterRegistryUrl instanceof URL) || input.adapterRegistryUrl.protocol !== "file:" || input.adapterRegistryUrl.search !== "" || input.adapterRegistryUrl.hash !== "" || input.deadline !== void 0 && (!Number.isSafeInteger(input.deadline) || input.deadline < 0)) throw new CoreOperationException({
77
+ code: "INVALID_ARGUMENT",
78
+ operation: "create-project-inspection"
79
+ });
80
+ if (signal?.aborted === true) throw aborted(signal.reason);
81
+ if (isInspectionActive) throw new CoreOperationException({
82
+ code: "INSPECTION_BUSY",
83
+ operation: "create-project-inspection"
84
+ });
85
+ if (limits.maxRetainedBytes <= 50331648) throw new CoreOperationException({
86
+ code: "RESOURCE_LIMIT_EXCEEDED",
87
+ operation: "create-project-inspection",
88
+ limit: "maxRetainedBytes",
89
+ limitMaximum: limits.maxRetainedBytes,
90
+ observedUsage: NODE_INSPECTION_TRANSPORT_BYTES,
91
+ nextAction: "reduce-input-or-increase-limit"
92
+ });
93
+ const deadline = Math.min(Date.now() + NODE_INSPECTION_LIFETIME_MS, input.deadline ?? Infinity);
94
+ if (deadline <= Date.now()) throw new CoreOperationException({
95
+ code: "INSPECTION_TIMEOUT",
96
+ operation: "create-project-inspection"
97
+ });
98
+ isInspectionActive = true;
99
+ const controller = new AbortController();
100
+ const attemptId = randomBytes(16).toString("hex");
101
+ const prepared = createCompletion();
102
+ let pendingPage;
103
+ let pageRequestId = 0;
104
+ let lastReaderRequestId = -1;
105
+ let hasAcknowledgedHeap = false;
106
+ let heapMaximum;
107
+ let hasPrepared = false;
108
+ let isClosing = false;
109
+ let failure;
110
+ let cleanupPromise;
111
+ const readerWork = /* @__PURE__ */ new Set();
112
+ const relayWork = /* @__PURE__ */ new Set();
113
+ const child = (() => {
114
+ try {
115
+ return fork(fileURLToPath(import.meta.resolve("#moldea-core-runner")), [], {
116
+ execPath: process.execPath,
117
+ execArgv: [],
118
+ env: createInspectionEnvironment(),
119
+ serialization: "advanced",
120
+ stdio: [
121
+ "ignore",
122
+ "ignore",
123
+ "pipe",
124
+ "ipc"
125
+ ]
126
+ });
127
+ } catch (cause) {
128
+ isInspectionActive = false;
129
+ throw createInspectionProcessFailure(cause);
130
+ }
131
+ })();
132
+ const send = createInspectionSender((frame, callback) => {
133
+ if (!child.connected) throw createInspectionProcessFailure();
134
+ child.send(frame, callback);
135
+ });
136
+ const supervision = superviseInspectionChild(child, () => {
137
+ send({
138
+ attemptId,
139
+ kind: "dispose"
140
+ }).catch(() => {
141
+ child.kill("SIGKILL");
142
+ });
143
+ });
144
+ /** Keeps admission until child closure and every real reader promise has settled. */
145
+ const cleanup = () => {
146
+ cleanupPromise ??= (async () => {
147
+ isClosing = true;
148
+ controller.abort(failure?.cause);
149
+ supervision.terminate();
150
+ await supervision.closed;
151
+ await Promise.allSettled([...readerWork, ...relayWork]);
152
+ repository = void 0;
153
+ clearTimeout(timer);
154
+ if (failure === void 0 && Date.now() >= deadline) fail(new CoreOperationException({
155
+ code: "INSPECTION_TIMEOUT",
156
+ operation: "create-project-inspection"
157
+ }));
158
+ signal?.removeEventListener("abort", handleAbort);
159
+ child.removeAllListeners("message");
160
+ child.removeAllListeners("error");
161
+ child.stderr?.removeAllListeners("data");
162
+ isInspectionActive = false;
163
+ })();
164
+ return cleanupPromise;
165
+ };
166
+ const fail = (cause) => {
167
+ if (failure === void 0) failure = { cause: cause instanceof Error ? cause : createInspectionProcessFailure(cause) };
168
+ prepared.reject(failure.cause);
169
+ pendingPage?.reject(failure.cause);
170
+ cleanup();
171
+ };
172
+ const getFailureCause = () => failure?.cause;
173
+ const handleAbort = () => {
174
+ fail(aborted(signal?.reason));
175
+ };
176
+ const timer = setTimeout(() => {
177
+ fail(new CoreOperationException({
178
+ code: "INSPECTION_TIMEOUT",
179
+ operation: "create-project-inspection"
180
+ }));
181
+ }, Math.max(1, deadline - Date.now()));
182
+ signal?.addEventListener("abort", handleAbort, { once: true });
183
+ const isCallerAborted = () => signal?.aborted === true;
184
+ if (isCallerAborted()) handleAbort();
185
+ child.once("error", (cause) => {
186
+ fail(createInspectionProcessFailure(cause));
187
+ });
188
+ supervision.closed.then(() => {
189
+ if (!isClosing) fail(createInspectionProcessFailure());
190
+ });
191
+ let stderrBytes = 0;
192
+ child.stderr?.on("data", (chunk) => {
193
+ stderrBytes += chunk.byteLength;
194
+ if (stderrBytes > 32768) fail(createInspectionProcessFailure());
195
+ });
196
+ child.on("message", (frame) => {
197
+ if (isClosing) return;
198
+ try {
199
+ const message = decodeInspectionMessage(frame);
200
+ if (message.attemptId !== attemptId) throw createInspectionProcessFailure();
201
+ if (message.kind === "ready") {
202
+ if (hasAcknowledgedHeap) throw createInspectionProcessFailure();
203
+ heapMaximum = message.maxAnalysisHeapBytes;
204
+ hasAcknowledgedHeap = true;
205
+ send({
206
+ attemptId,
207
+ kind: "run"
208
+ }).catch(fail);
209
+ } else if (message.kind === "prepared") {
210
+ if (!hasAcknowledgedHeap || hasPrepared || message.inspection.maxAnalysisHeapBytes !== heapMaximum || message.inspection.source.id !== snapshot.id || message.inspection.source.sourceKind !== snapshot.sourceKind) throw createInspectionProcessFailure();
211
+ hasPrepared = true;
212
+ prepared.resolve(freezeRecursively(message.inspection));
213
+ } else if (message.kind === "reader-request") {
214
+ if (!hasAcknowledgedHeap || hasPrepared || message.requestId !== lastReaderRequestId + 1 || readerWork.size >= 4) throw createInspectionProcessFailure();
215
+ lastReaderRequestId = message.requestId;
216
+ if (repository === void 0) throw createInspectionProcessFailure();
217
+ const work = executeRepositoryRpc(repository, message.request, controller.signal);
218
+ readerWork.add(work);
219
+ const relay = (async () => {
220
+ try {
221
+ const result = await work;
222
+ readerWork.delete(work);
223
+ if (!isClosing) await send({
224
+ attemptId,
225
+ kind: "reader-response",
226
+ requestId: message.requestId,
227
+ result
228
+ });
229
+ } catch (cause) {
230
+ fail(cause);
231
+ } finally {
232
+ readerWork.delete(work);
233
+ }
234
+ })();
235
+ relayWork.add(relay);
236
+ relay.finally(() => relayWork.delete(relay));
237
+ } else if (message.kind === "page") {
238
+ if (!hasPrepared || pendingPage === void 0 || message.requestId !== pageRequestId) throw createInspectionProcessFailure();
239
+ const completion = pendingPage;
240
+ pendingPage = void 0;
241
+ completion.resolve(freezeRecursively(message.result));
242
+ } else if (message.kind === "failure") {
243
+ if (message.failure.options["nextAction"] === "review-inspection-capacity" && (heapMaximum === void 0 || message.failure.options["limitMaximum"] !== heapMaximum)) throw createInspectionProcessFailure();
244
+ fail(deserializeInspectionFailure(message.failure));
245
+ } else throw createInspectionProcessFailure();
246
+ } catch (cause) {
247
+ fail(cause);
248
+ }
249
+ });
250
+ try {
251
+ await send({
252
+ attemptId,
253
+ kind: "start",
254
+ registryUrl: input.adapterRegistryUrl.href,
255
+ snapshot,
256
+ limits,
257
+ deadline
258
+ });
259
+ const metadata = await prepared.promise;
260
+ if (Date.now() >= deadline) throw new CoreOperationException({
261
+ code: "INSPECTION_TIMEOUT",
262
+ operation: "create-project-inspection"
263
+ });
264
+ return Object.freeze({
265
+ ...metadata,
266
+ readPage: async (pageInput) => {
267
+ if (failure !== void 0 || isClosing) throw failure?.cause ?? aborted();
268
+ if (pendingPage !== void 0 || pageInput === null || typeof pageInput !== "object" || Reflect.ownKeys(pageInput).some((key) => key !== "cursor" && key !== "maxItems" && key !== "view") || !Number.isSafeInteger(pageInput.maxItems) || pageInput.maxItems < 1 || pageInput.maxItems > limits.maxEntries || ![
269
+ "all",
270
+ "diagnostics",
271
+ "evidence",
272
+ "metadata"
273
+ ].includes(pageInput.view) || pageInput.cursor !== void 0 && typeof pageInput.cursor !== "string") throw new CoreOperationException({
274
+ code: "INVALID_ARGUMENT",
275
+ operation: "create-project-inspection"
276
+ });
277
+ const completion = createCompletion();
278
+ pendingPage = completion;
279
+ pageRequestId++;
280
+ try {
281
+ if (Date.now() >= deadline) throw new CoreOperationException({
282
+ code: "INSPECTION_TIMEOUT",
283
+ operation: "create-project-inspection"
284
+ });
285
+ await send({
286
+ attemptId,
287
+ kind: "read-page",
288
+ requestId: pageRequestId,
289
+ input: {
290
+ maxItems: pageInput.maxItems,
291
+ view: pageInput.view,
292
+ ...pageInput.cursor === void 0 ? {} : { cursor: pageInput.cursor }
293
+ }
294
+ });
295
+ const result = await completion.promise;
296
+ if (Date.now() >= deadline) throw new CoreOperationException({
297
+ code: "INSPECTION_TIMEOUT",
298
+ operation: "create-project-inspection"
299
+ });
300
+ return result;
301
+ } catch (cause) {
302
+ fail(cause);
303
+ await cleanup();
304
+ throw getFailureCause() ?? createInspectionProcessFailure(cause);
305
+ } finally {
306
+ if (pendingPage === completion) pendingPage = void 0;
307
+ }
308
+ },
309
+ dispose: async () => {
310
+ pendingPage?.reject(failure?.cause ?? aborted());
311
+ await cleanup();
312
+ const cause = getFailureCause();
313
+ if (cause !== void 0) throw cause;
314
+ }
315
+ });
316
+ } catch (cause) {
317
+ fail(cause);
318
+ await cleanup();
319
+ throw getFailureCause() ?? createInspectionProcessFailure(cause);
320
+ }
321
+ };
322
+ //#endregion
323
+ export { NODE_INSPECTION_PROFILE, createNodeProjectInspection };
324
+
325
+ //# sourceMappingURL=node.js.map
@@ -0,0 +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 { 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 } 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 INodeProjectInspection,\n INodeProjectInspectionInput,\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 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 * - DUPLICATE_ADAPTER_ID: A runtime adapter ID is registered more than once.\n * - RESERVED_ADAPTER_ID: A reserved runtime adapter ID was supplied.\n * - INVALID_ADAPTER_DEFINITION: A runtime adapter definition is invalid.\n * - ABORTED: The Core operation was aborted.\n * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.\n * - ADAPTER_EXECUTION_FAILED: A runtime adapter failed during inspection.\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 let repository: INodeProjectInspectionInput['repository'] | undefined = input.repository;\n const snapshot = { id: repository.snapshot.id, sourceKind: repository.snapshot.sourceKind };\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 (\n !(input.adapterRegistryUrl instanceof URL) ||\n input.adapterRegistryUrl.protocol !== 'file:' ||\n input.adapterRegistryUrl.search !== '' ||\n input.adapterRegistryUrl.hash !== '' ||\n (input.deadline !== undefined && (!Number.isSafeInteger(input.deadline) || input.deadline < 0))\n )\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 repository = 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 (repository === undefined) throw createInspectionProcessFailure();\n const work = executeRepositoryRpc(repository, 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 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 registryUrl: input.adapterRegistryUrl.href,\n snapshot,\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', 'evidence', '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":";;;;;;;;;AA6BA,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,WAAW,UACf,IAAI,uBAAuB;CACzB,MAAM;CACN,WAAW;CACX,GAAI,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM;AACzC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BH,IAAa,8BAA8B,OACzC,UACoC;CACpC,IACE,UAAU,QACV,OAAO,UAAU,YACjB,MAAM,eAAe,QACrB,OAAO,MAAM,eAAe,YAC5B,OAAO,MAAM,WAAW,aAAa,cACrC,OAAO,MAAM,WAAW,oBAAoB,cAC5C,OAAO,MAAM,WAAW,iBAAiB,cACzC,MAAM,WAAW,aAAa,QAC9B,OAAO,MAAM,WAAW,aAAa,YACrC,OAAO,MAAM,WAAW,SAAS,OAAO,YACxC,MAAM,WAAW,SAAS,GAAG,WAAW,KACxC,OAAO,MAAM,WAAW,SAAS,eAAe,YAChD,MAAM,WAAW,SAAS,WAAW,WAAW,GAEhD,MAAM,IAAI,uBAAuB;EAC/B,MAAM;EACN,WAAW;CACb,CAAC;CAEH,IAAI,aAAoE,MAAM;CAC9E,MAAM,WAAW;EAAE,IAAI,WAAW,SAAS;EAAI,YAAY,WAAW,SAAS;CAAW;CAC1F,MAAM,SAAS,MAAM;CACrB,IACE,WAAW,KAAA,MACV,WA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AI,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,5 +1,26 @@
1
1
  import type { IProjectInspection, IProjectInspectionInput } from '../contracts/index.js';
2
2
  import type { ICoreOptionsSnapshot } from '../options/index.js';
3
- /** Prepares one immutable content-free inspection for synchronous bounded page reads. */
3
+ /**
4
+ * Prepares one immutable content-free inspection for synchronous bounded page reads.
5
+ * @param input The source-neutral reader and optional cancellation signal.
6
+ * @param options The immutable adapter registry and operation limits.
7
+ * @returns A promise resolving to the complete prepared inspection.
8
+ * @throws
9
+ * - INVALID_ARGUMENT: The Core operation received an invalid argument.
10
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
11
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
12
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
13
+ * - ENTRY_NOT_DIRECTORY: The requested repository entry is not a directory.
14
+ * - ACCESS_DENIED: Access to the repository source was denied.
15
+ * - SOURCE_UNAVAILABLE: The repository source is unavailable.
16
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
17
+ * - PROVIDER_INCOMPLETE: The repository provider cannot expose a complete result.
18
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
19
+ * - RESOURCE_LIMIT_EXCEEDED: A named repository resource limit was exceeded.
20
+ * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
21
+ * - ABORTED: The repository operation was aborted.
22
+ * - ABORTED: The Core operation was aborted.
23
+ * - ADAPTER_EXECUTION_FAILED: A runtime adapter failed during inspection.
24
+ */
4
25
  export declare const createProjectInspection: (input: IProjectInspectionInput, options: ICoreOptionsSnapshot) => Promise<IProjectInspection>;
5
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project-inspection/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EAOxB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAmchE,yFAAyF;AACzF,eAAO,MAAM,uBAAuB,GAClC,OAAO,uBAAuB,EAC9B,SAAS,oBAAoB,KAC5B,OAAO,CAAC,kBAAkB,CAiC5B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project-inspection/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EAOxB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAsdhE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,uBAAuB,EAC9B,SAAS,oBAAoB,KAC5B,OAAO,CAAC,kBAAkB,CAkC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAkB/B,gGAAgG;AAChG,eAAO,MAAM,sBAAsB,GACjC,SAAS,mBAAmB,KAC3B,gBAAgB,CAAC,oBAAoB,CAqCvC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,GAAI,SAAS,mBAAmB,KAAG,yBAc5B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project-metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAkB/B,gGAAgG;AAChG,eAAO,MAAM,sBAAsB,GACjC,SAAS,mBAAmB,KAC3B,gBAAgB,CAAC,oBAAoB,CAqCvC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,GAAI,SAAS,mBAAmB,KAAG,yBAiB5B,CAAC"}
@@ -13,19 +13,43 @@ export interface IProjectValidationState {
13
13
  * @returns A promise resolving to the frozen all-or-nothing project inspection result.
14
14
  * @throws
15
15
  * - INVALID_ARGUMENT: The Core operation received an invalid argument.
16
- * - INVALID_REPOSITORY_PATH: A repository path is invalid.
17
- * - ENTRY_NOT_FOUND: A discovered file disappeared from the reader snapshot.
18
- * - ENTRY_NOT_FILE: A discovered file changed type during inspection.
19
- * - ENTRY_NOT_DIRECTORY: A discovered directory changed type during inspection.
16
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
17
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
18
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
19
+ * - ENTRY_NOT_DIRECTORY: The requested repository entry is not a directory.
20
20
  * - ACCESS_DENIED: Access to the repository source was denied.
21
21
  * - SOURCE_UNAVAILABLE: The repository source is unavailable.
22
- * - SNAPSHOT_CHANGED: The repository snapshot changed during inspection.
23
- * - INVALID_SOURCE_DATA: The repository reader returned invalid contract data.
24
- * - RESOURCE_LIMIT_EXCEEDED: A Core or repository resource limit was exceeded.
25
- * - ABORTED: Project inspection or a repository operation was aborted.
26
- * - ADAPTER_EXECUTION_FAILED: A runtime adapter failed or returned an invalid result.
22
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
23
+ * - PROVIDER_INCOMPLETE: The repository provider cannot expose a complete result.
24
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
25
+ * - RESOURCE_LIMIT_EXCEEDED: A named repository resource limit was exceeded.
26
+ * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
27
+ * - ABORTED: The repository operation was aborted.
28
+ * - ABORTED: The Core operation was aborted.
29
+ * - ADAPTER_EXECUTION_FAILED: A runtime adapter failed during inspection.
27
30
  */
28
31
  export declare const validateProjectState: (input: IProjectValidationInput, options: ICoreOptionsSnapshot) => Promise<IProjectValidationState>;
29
- /** Validates one project without returning canonical document bodies. */
32
+ /**
33
+ * Validates one project without returning canonical document bodies.
34
+ * @param input The source-neutral reader and optional cancellation signal.
35
+ * @param options The immutable adapter registry and operation limits.
36
+ * @returns A promise resolving to the complete validation result.
37
+ * @throws
38
+ * - INVALID_ARGUMENT: The Core operation received an invalid argument.
39
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
40
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
41
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
42
+ * - ENTRY_NOT_DIRECTORY: The requested repository entry is not a directory.
43
+ * - ACCESS_DENIED: Access to the repository source was denied.
44
+ * - SOURCE_UNAVAILABLE: The repository source is unavailable.
45
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
46
+ * - PROVIDER_INCOMPLETE: The repository provider cannot expose a complete result.
47
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
48
+ * - RESOURCE_LIMIT_EXCEEDED: A named repository resource limit was exceeded.
49
+ * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
50
+ * - ABORTED: The repository operation was aborted.
51
+ * - ABORTED: The Core operation was aborted.
52
+ * - ADAPTER_EXECUTION_FAILED: A runtime adapter failed during inspection.
53
+ */
30
54
  export declare const validateProject: (input: IProjectValidationInput, options: ICoreOptionsSnapshot) => Promise<IProjectValidationResult>;
31
55
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project-validation/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAC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AC,uBAAuB,CAqFjC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,uBAAuB,EAC9B,SAAS,oBAAoB,KAC5B,OAAO,CAAC,wBAAwB,CAAwD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moldea.ai/core",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
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": {
@@ -30,12 +30,20 @@
30
30
  "types": "./dist/format/index.d.ts",
31
31
  "import": "./dist/format.js"
32
32
  },
33
+ "./node": {
34
+ "types": "./dist/node/index.d.ts",
35
+ "import": "./dist/node.js"
36
+ },
33
37
  "./adapter": {
34
38
  "types": "./dist/adapter/index.d.ts",
35
39
  "import": "./dist/adapter.js"
36
40
  }
37
41
  },
38
42
  "main": "./dist/index.js",
43
+ "imports": {
44
+ "#moldea-core-runner": "./dist/node-runner.js",
45
+ "#moldea-core-analysis-worker": "./dist/analysis-worker.js"
46
+ },
39
47
  "types": "./dist/index.d.ts",
40
48
  "dependencies": {
41
49
  "@moldea.ai/repository": "^2.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"exceptions-HS9ofVy2.js","names":[],"sources":["../../src/adapter-retained-memory/index.ts","../../src/exceptions/index.ts"],"sourcesContent":["import type { IRuntimeAdapterRepository } from '../adapter/index.js';\ntype IRetainedByteReservation = (byteLength: number) => void;\n\n// reservations belong to Core-created adapter repositories and remain private to the session\nconst retainedByteReservations = new WeakMap<IRuntimeAdapterRepository, IRetainedByteReservation>();\n\n/** Registers the retained-memory reservation owned by one inspection session. */\nexport const registerRuntimeAdapterRetainedByteReservation = (\n repository: IRuntimeAdapterRepository,\n reserve: IRetainedByteReservation,\n): void => {\n if (retainedByteReservations.has(repository)) {\n throw new TypeError('The runtime adapter repository is already registered.');\n }\n\n retainedByteReservations.set(repository, reserve);\n};\n\n/** Reserves a complete adapter-owned buffer when Core owns the repository session. */\nexport const reserveRuntimeAdapterRetainedBytesIfTracked = (\n repository: IRuntimeAdapterRepository,\n byteLength: number,\n): void => {\n const reserve = retainedByteReservations.get(repository);\n\n if (reserve !== undefined) {\n reserve(byteLength);\n }\n};\n","import { Exception } from 'error-message-utils';\n\n// stable configuration and operation failure codes\nexport type ICoreConfigurationErrorCode =\n | 'DUPLICATE_ADAPTER_ID'\n | 'RESERVED_ADAPTER_ID'\n | 'INVALID_ADAPTER_DEFINITION'\n | 'INVALID_RESOURCE_LIMIT';\n\nexport type ICoreOperationErrorCode =\n | 'INVALID_ARGUMENT'\n | 'ABORTED'\n | 'RESOURCE_LIMIT_EXCEEDED'\n | 'ADAPTER_EXECUTION_FAILED'\n | 'CONTENT_INVALID';\n\nexport type ICoreOperation =\n | 'create-core'\n | 'normalize-text'\n | 'calculate-content-digest'\n | 'parse-manifest'\n | 'match-manifest-scope'\n | 'parse-decision'\n | 'create-project-inspection'\n | 'read-canonical-content-page'\n | 'validate-project'\n | 'validate-adapter';\n\n// safe construction options for exported Core exceptions\nexport interface ICoreConfigurationExceptionOptions {\n readonly code: ICoreConfigurationErrorCode;\n readonly operation: ICoreOperation;\n readonly adapterId?: string;\n readonly cause?: unknown;\n}\n\ninterface ICoreOperationExceptionOptionsBase {\n readonly operation: ICoreOperation;\n readonly adapterId?: string;\n readonly agentId?: string;\n readonly cause?: unknown;\n}\n\n// complete resource-refusal metadata required by Core 5\nexport type ICoreResourceLimitNextAction = 'reduce-input-or-increase-limit';\n\nexport type ICoreOperationExceptionOptions = ICoreOperationExceptionOptionsBase &\n (\n | {\n readonly code: 'RESOURCE_LIMIT_EXCEEDED';\n readonly limit: string;\n readonly limitMaximum: number;\n readonly nextAction: ICoreResourceLimitNextAction;\n readonly observedUsage: number;\n }\n | {\n readonly code: Exclude<ICoreOperationErrorCode, 'RESOURCE_LIMIT_EXCEEDED'>;\n readonly limit?: never;\n readonly limitMaximum?: never;\n readonly nextAction?: never;\n readonly observedUsage?: never;\n }\n );\n\nconst CONFIGURATION_ERROR_MESSAGES = {\n DUPLICATE_ADAPTER_ID: 'A runtime adapter ID is registered more than once.',\n INVALID_ADAPTER_DEFINITION: 'A runtime adapter definition is invalid.',\n INVALID_RESOURCE_LIMIT: 'A Core resource limit is invalid.',\n RESERVED_ADAPTER_ID: 'A reserved runtime adapter ID was supplied.',\n} as const satisfies Readonly<Record<ICoreConfigurationErrorCode, string>>;\n\nconst OPERATION_ERROR_MESSAGES = {\n ABORTED: 'The Core operation was aborted.',\n ADAPTER_EXECUTION_FAILED: 'A runtime adapter failed during inspection.',\n CONTENT_INVALID: 'The canonical content is not valid UTF-8 text.',\n INVALID_ARGUMENT: 'The Core operation received an invalid argument.',\n RESOURCE_LIMIT_EXCEEDED: 'A Core resource limit was exceeded.',\n} as const satisfies Readonly<Record<ICoreOperationErrorCode, string>>;\n\nconst OPERATION_ERROR_RETRYABILITY = {\n ABORTED: true,\n ADAPTER_EXECUTION_FAILED: false,\n CONTENT_INVALID: false,\n INVALID_ARGUMENT: false,\n RESOURCE_LIMIT_EXCEEDED: false,\n} as const satisfies Readonly<Record<ICoreOperationErrorCode, boolean>>;\n\nconst attachCause = (exception: Error, cause: unknown): void => {\n if (cause === undefined) {\n return;\n }\n\n Object.defineProperty(exception, 'cause', {\n configurable: true,\n enumerable: false,\n value: cause,\n writable: false,\n });\n};\n\n/** Represents invalid immutable Core configuration. */\nexport class CoreConfigurationException extends Exception {\n public override readonly code: ICoreConfigurationErrorCode;\n\n public readonly operation: ICoreOperation;\n\n public readonly adapterId: string | null;\n\n /** Creates a configuration exception with safe adapter metadata. */\n public constructor(options: ICoreConfigurationExceptionOptions) {\n super(CONFIGURATION_ERROR_MESSAGES[options.code], options.code);\n this.code = options.code;\n this.name = 'CoreConfigurationException';\n this.operation = options.operation;\n this.adapterId = options.adapterId ?? null;\n attachCause(this, options.cause);\n }\n}\n\n/** Represents an operational failure that prevented Core from completing. */\nexport class CoreOperationException extends Exception {\n public override readonly code: ICoreOperationErrorCode;\n\n public readonly operation: ICoreOperation;\n\n public readonly retryable: boolean;\n\n public readonly adapterId: string | null;\n\n public readonly agentId: string | null;\n\n public readonly limit: string | null;\n\n public readonly limitMaximum: number | null;\n\n public readonly nextAction: ICoreResourceLimitNextAction | null;\n\n public readonly observedUsage: number | null;\n\n /** Creates an operation exception with derived retry and safe scope metadata. */\n public constructor(options: ICoreOperationExceptionOptions) {\n super(OPERATION_ERROR_MESSAGES[options.code], options.code);\n this.code = options.code;\n this.name = 'CoreOperationException';\n this.operation = options.operation;\n this.retryable = OPERATION_ERROR_RETRYABILITY[options.code];\n this.adapterId = options.adapterId ?? null;\n this.agentId = options.agentId ?? null;\n this.limit = options.limit ?? null;\n this.limitMaximum = options.limitMaximum ?? null;\n this.nextAction = options.nextAction ?? null;\n this.observedUsage = options.observedUsage ?? null;\n attachCause(this, options.cause);\n }\n}\n"],"mappings":";;AAIA,IAAM,2CAA2B,IAAI,QAA6D;;AAGlG,IAAa,iDACX,YACA,YACS;CACT,IAAI,yBAAyB,IAAI,UAAU,GACzC,MAAM,IAAI,UAAU,uDAAuD;CAG7E,yBAAyB,IAAI,YAAY,OAAO;AAClD;;AAGA,IAAa,+CACX,YACA,eACS;CACT,MAAM,UAAU,yBAAyB,IAAI,UAAU;CAEvD,IAAI,YAAY,KAAA,GACd,QAAQ,UAAU;AAEtB;;;ACoCA,IAAM,+BAA+B;CACnC,sBAAsB;CACtB,4BAA4B;CAC5B,wBAAwB;CACxB,qBAAqB;AACvB;AAEA,IAAM,2BAA2B;CAC/B,SAAS;CACT,0BAA0B;CAC1B,iBAAiB;CACjB,kBAAkB;CAClB,yBAAyB;AAC3B;AAEA,IAAM,+BAA+B;CACnC,SAAS;CACT,0BAA0B;CAC1B,iBAAiB;CACjB,kBAAkB;CAClB,yBAAyB;AAC3B;AAEA,IAAM,eAAe,WAAkB,UAAyB;CA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