@moldea.ai/cli 14.0.0 → 14.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{composition-_3bygS_a.js → composition-BzwNJ346.js} +2 -2
  3. package/dist/chunks/{composition-_3bygS_a.js.map → composition-BzwNJ346.js.map} +1 -1
  4. package/dist/chunks/{composition-D1OYuZ5d.js → composition-aJXeA6un.js} +1 -1
  5. package/dist/chunks/{core-composition-BKcJ--NX.js → core-composition-CzdeqYS9.js} +2 -2
  6. package/dist/chunks/{core-composition-BKcJ--NX.js.map → core-composition-CzdeqYS9.js.map} +1 -1
  7. package/dist/moldea.js +3 -3
  8. package/dist/portable/SHA256SUMS +16 -16
  9. package/dist/portable/analysis-worker.mjs +110 -133
  10. package/dist/portable/chunk-1b3c5f05.mjs +1837 -0
  11. package/dist/portable/chunk-24ea7c23.mjs +328 -0
  12. package/dist/portable/chunk-2cc3bf5c.mjs +399 -0
  13. package/dist/portable/chunk-2e9d4c63.mjs +95 -0
  14. package/dist/portable/chunk-8a1dadf9.mjs +2 -0
  15. package/dist/portable/chunk-8f198616.mjs +4414 -0
  16. package/dist/portable/chunk-936e5d09.mjs +112519 -0
  17. package/dist/portable/chunk-98d84174.mjs +422 -0
  18. package/dist/portable/chunk-a6007228.mjs +302 -0
  19. package/dist/portable/chunk-b1f86976.mjs +2 -0
  20. package/dist/portable/chunk-cea1378f.mjs +50 -0
  21. package/dist/portable/chunk-d372f5e0.mjs +3120 -0
  22. package/dist/portable/chunk-d6656fa6.mjs +14 -0
  23. package/dist/portable/moldea.mjs +1997 -2870
  24. package/dist/portable/node-runner.mjs +77 -106
  25. package/package.json +2 -2
  26. package/dist/portable/chunk-131f8005.mjs +0 -115
  27. package/dist/portable/chunk-2ba7e89e.mjs +0 -26
  28. package/dist/portable/chunk-459da9cf.mjs +0 -4138
  29. package/dist/portable/chunk-728df961.mjs +0 -544
  30. package/dist/portable/chunk-8d6114d2.mjs +0 -588
  31. package/dist/portable/chunk-90403e67.mjs +0 -2
  32. package/dist/portable/chunk-94b5ac22.mjs +0 -59
  33. package/dist/portable/chunk-a5514957.mjs +0 -5870
  34. package/dist/portable/chunk-b98ca669.mjs +0 -2
  35. package/dist/portable/chunk-c13db66a.mjs +0 -380
  36. package/dist/portable/chunk-d5af3eda.mjs +0 -2926
  37. package/dist/portable/chunk-ec3f49d3.mjs +0 -367
  38. package/dist/portable/chunk-fcbcf4e3.mjs +0 -147458
@@ -0,0 +1,328 @@
1
+ import { a as e, i as t, n, o as r, r as i, t as a, u as o } from "./chunk-2cc3bf5c.mjs";
2
+ import { c as s, i as c, r as l } from "./chunk-98d84174.mjs";
3
+ import { Buffer as u } from "node:buffer";
4
+ //#region ../core/dist/chunks/errors-C5qcq3E0.js
5
+ var d = 12e4, f = 1e3, p = 65536, m = 1048576, h = 32768, g = 4 * m * 2 * 2 * 3;
6
+ Object.freeze({
7
+ lifetimeMs: d,
8
+ terminationGraceMs: f,
9
+ maxReaderRequests: 4,
10
+ maxFilePageBytes: p,
11
+ maxMessageBytes: m,
12
+ maxStdioBytes: h,
13
+ transportBytes: g,
14
+ oldGenerationMiB: 512,
15
+ youngGenerationMiB: 24
16
+ });
17
+ var _ = (e) => new n({
18
+ code: "INSPECTION_PROCESS_FAILED",
19
+ operation: "create-project-inspection",
20
+ ...e === void 0 ? {} : { cause: e }
21
+ }), v = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= 0, y = (e, t, n = []) => t.every((t) => Object.hasOwn(e, t)) && Object.keys(e).every((e) => t.includes(e) || n.includes(e)), b = (e) => o(e, !0) && y(e, ["id", "sourceKind"]) && typeof e.id == "string" && e.id.length > 0 && typeof e.sourceKind == "string" && e.sourceKind.length > 0, x = (e, t) => !Object.hasOwn(e, t) || typeof e[t] == "string", S = (e) => o(e, !0) && y(e, ["maxItems", "view"], ["cursor"]) && v(e.maxItems) && e.maxItems > 0 && [
22
+ "all",
23
+ "diagnostics",
24
+ "coverage",
25
+ "metadata"
26
+ ].includes(String(e.view)) && x(e, "cursor"), C = (e) => o(e, !0) && y(e, [
27
+ "maxEntries",
28
+ "maxTotalBytesRead",
29
+ "maxFileBytes",
30
+ "maxManifestBytes",
31
+ "maxRetainedBytes",
32
+ "maxDiagnostics",
33
+ "maxCoverage",
34
+ "maxAcceptedWarnings"
35
+ ]) && Object.values(e).every((e) => v(e) && e > 0), w = (e) => o(e, !0) && y(e, [
36
+ "agents",
37
+ "context",
38
+ "decisions",
39
+ "mirrors",
40
+ "diagnostics",
41
+ "errors",
42
+ "warnings",
43
+ "acceptedWarnings",
44
+ "coverage",
45
+ "metadata"
46
+ ]) && Object.values(e).every(v), T = (e) => e === null || o(e, !0) && y(e, [
47
+ "counts",
48
+ "manifestDigest",
49
+ "manifestPath",
50
+ "projectDigest",
51
+ "projectPath"
52
+ ]) && o(e.counts, !0) && y(e.counts, [
53
+ "agents",
54
+ "context",
55
+ "decisions",
56
+ "mirrors"
57
+ ]) && Object.values(e.counts).every(v) && typeof e.manifestDigest == "string" && typeof e.projectDigest == "string" && s(e.manifestPath) && s(e.projectPath), E = (e) => w(e.counts) && o(e.coverageCounts, !0) && y(e.coverageCounts, [
58
+ "bindings",
59
+ "exportsPassed",
60
+ "exportsFailed",
61
+ "exportsNotChecked"
62
+ ]) && Object.values(e.coverageCounts).every(v) && typeof e.valid == "boolean" && (e.formatVersion === null || e.formatVersion === 1) && typeof e.inspectionDigest == "string" && b(e.source) && T(e.summary), D = [
63
+ "counts",
64
+ "coverageCounts",
65
+ "valid",
66
+ "formatVersion",
67
+ "inspectionDigest",
68
+ "source",
69
+ "summary"
70
+ ], O = (e) => o(e, !0) && y(e, [
71
+ ...D,
72
+ "resourceUsage",
73
+ "maxAnalysisHeapBytes"
74
+ ]) && E(e) && v(e.maxAnalysisHeapBytes) && e.maxAnalysisHeapBytes > 0 && o(e.resourceUsage, !0) && y(e.resourceUsage, [
75
+ "canonicalBytes",
76
+ "peakRetainedBytes",
77
+ "preparedBytes",
78
+ "retainedBytes",
79
+ "totalBytesRead"
80
+ ]) && Object.values(e.resourceUsage).every(v), k = (e) => o(e, !0) && y(e, [
81
+ ...D,
82
+ "page",
83
+ "view"
84
+ ]) && E(e) && [
85
+ "all",
86
+ "diagnostics",
87
+ "coverage",
88
+ "metadata"
89
+ ].includes(String(e.view)) && o(e.page, !0) && y(e.page, [
90
+ "isComplete",
91
+ "records",
92
+ "nextCursor",
93
+ "totalItems"
94
+ ]) && typeof e.page.isComplete == "boolean" && v(e.page.totalItems) && (e.page.nextCursor === null || typeof e.page.nextCursor == "string") && Array.isArray(e.page.records) && e.page.records.every((e) => o(e, !0) && y(e, ["item", "nextCursor"]) && (e.nextCursor === null || typeof e.nextCursor == "string") && o(e.item, !0) && typeof e.item.kind == "string" && [
95
+ "agent",
96
+ "diagnostic",
97
+ "coverage",
98
+ "metadata"
99
+ ].includes(e.item.kind) && y(e.item, ["kind", e.item.kind]) && o(e.item[e.item.kind], !0)), A = (e) => e === "instructions" || e === "repository", j = (e) => s(e.path) && v(e.offset) && v(e.maxBytes) && e.maxBytes > 0 && e.maxBytes <= 65536, M = (e) => e === null || o(e, !0) && y(e, ["snapshot"]) && b(e.snapshot), N = (e) => {
100
+ if (!o(e, !0)) return !1;
101
+ switch (e.method) {
102
+ case "getEntry":
103
+ case "readLinkText": return y(e, [
104
+ "method",
105
+ "path",
106
+ "source"
107
+ ]) && s(e.path) && A(e.source);
108
+ case "listEntriesPage": return y(e, ["method", "maxEntries"], ["cursor", "prefix"]) && v(e.maxEntries) && e.maxEntries > 0 && e.maxEntries <= 128 && x(e, "cursor") && (!Object.hasOwn(e, "prefix") || s(e.prefix));
109
+ case "readFilePage": return y(e, [
110
+ "method",
111
+ "path",
112
+ "maxBytes",
113
+ "offset",
114
+ "source"
115
+ ]) && A(e.source) && j(e);
116
+ default: return !1;
117
+ }
118
+ }, P = (e) => {
119
+ if (!o(e, !0) || typeof e.attemptId != "string" || !/^[a-f0-9]{32}$/.test(e.attemptId)) return !1;
120
+ let t = ["attemptId", "kind"];
121
+ switch (e.kind) {
122
+ case "start": return y(e, [
123
+ ...t,
124
+ "snapshot",
125
+ "instructions",
126
+ "limits",
127
+ "deadline"
128
+ ]) && b(e.snapshot) && M(e.instructions) && C(e.limits) && v(e.deadline);
129
+ case "ready": return y(e, [...t, "maxAnalysisHeapBytes"]) && v(e.maxAnalysisHeapBytes) && e.maxAnalysisHeapBytes > 0;
130
+ case "run":
131
+ case "dispose": return y(e, t);
132
+ case "prepared": return y(e, [...t, "inspection"]) && O(e.inspection);
133
+ case "read-page": return y(e, [
134
+ ...t,
135
+ "requestId",
136
+ "input"
137
+ ]) && v(e.requestId) && S(e.input);
138
+ case "page": return y(e, [
139
+ ...t,
140
+ "requestId",
141
+ "result"
142
+ ]) && v(e.requestId) && k(e.result);
143
+ case "reader-request": return y(e, [
144
+ ...t,
145
+ "requestId",
146
+ "request"
147
+ ]) && v(e.requestId) && N(e.request);
148
+ case "reader-response": return y(e, [
149
+ ...t,
150
+ "requestId",
151
+ "result"
152
+ ]) && v(e.requestId);
153
+ case "reader-failure":
154
+ case "failure": return y(e, [
155
+ ...t,
156
+ "failure",
157
+ ...e.kind === "reader-failure" ? ["requestId"] : []
158
+ ]) && (e.kind !== "reader-failure" || v(e.requestId)) && o(e.failure, !0) && y(e.failure, ["family", "options"]) && [
159
+ "configuration",
160
+ "operation",
161
+ "repository",
162
+ "path"
163
+ ].includes(String(e.failure.family)) && o(e.failure.options, !0);
164
+ default: return !1;
165
+ }
166
+ }, F = (e) => {
167
+ let t;
168
+ try {
169
+ t = r(e, m);
170
+ } catch (e) {
171
+ throw _(e);
172
+ }
173
+ if (t > 1048576) throw new n({
174
+ code: "RESOURCE_LIMIT_EXCEEDED",
175
+ limit: "maxInspectionMessageBytes",
176
+ limitMaximum: m,
177
+ observedUsage: t,
178
+ nextAction: null,
179
+ operation: "create-project-inspection"
180
+ });
181
+ if (!P(e)) throw _();
182
+ return JSON.stringify(e);
183
+ }, I = (e) => {
184
+ if (typeof e != "string" || u.byteLength(e) > 1048576) throw _();
185
+ let t;
186
+ try {
187
+ t = JSON.parse(e);
188
+ } catch (e) {
189
+ throw _(e);
190
+ }
191
+ if (!P(t)) throw _();
192
+ return t;
193
+ }, L = (e) => e instanceof a ? {
194
+ family: "configuration",
195
+ options: {
196
+ code: e.code,
197
+ operation: e.operation
198
+ }
199
+ } : e instanceof n ? {
200
+ family: "operation",
201
+ options: {
202
+ code: e.code,
203
+ operation: e.operation,
204
+ ...e.code === "RESOURCE_LIMIT_EXCEEDED" ? {
205
+ limit: e.limit,
206
+ limitMaximum: e.limitMaximum,
207
+ nextAction: e.nextAction,
208
+ observedUsage: e.observedUsage
209
+ } : {}
210
+ }
211
+ } : e instanceof l ? {
212
+ family: "path",
213
+ options: {}
214
+ } : e instanceof c ? {
215
+ family: "repository",
216
+ options: {
217
+ code: e.code,
218
+ operation: e.operation,
219
+ path: e.path,
220
+ retryable: e.retryable,
221
+ ...e.resource === null ? {} : { resource: e.resource }
222
+ }
223
+ } : {
224
+ family: "operation",
225
+ options: {
226
+ code: "INSPECTION_PROCESS_FAILED",
227
+ operation: "create-project-inspection"
228
+ }
229
+ }, R = [
230
+ "ENTRY_NOT_FOUND",
231
+ "ENTRY_NOT_FILE",
232
+ "ENTRY_NOT_DIRECTORY",
233
+ "INVALID_PAGE_REQUEST",
234
+ "ACCESS_DENIED",
235
+ "SOURCE_UNAVAILABLE",
236
+ "SNAPSHOT_CHANGED",
237
+ "PROVIDER_INCOMPLETE",
238
+ "INVALID_SOURCE_DATA",
239
+ "RESOURCE_LIMIT_EXCEEDED",
240
+ "ABORTED"
241
+ ], z = [
242
+ "create-reader",
243
+ "create-comparison",
244
+ "get-entry",
245
+ "read-file-page",
246
+ "list-entries-page",
247
+ "list-changes-page"
248
+ ], B = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= 0, V = (r) => {
249
+ let o = r.options, u = r.family === "configuration" ? ["code", "operation"] : r.family === "operation" ? [
250
+ "code",
251
+ "operation",
252
+ "limit",
253
+ "limitMaximum",
254
+ "nextAction",
255
+ "observedUsage"
256
+ ] : r.family === "repository" ? [
257
+ "code",
258
+ "operation",
259
+ "path",
260
+ "retryable",
261
+ "resource"
262
+ ] : [];
263
+ if (Object.keys(o).some((e) => !u.includes(e)) || (r.family === "operation" || r.family === "configuration") && !t(o.operation)) throw _();
264
+ let d = { operation: t(o.operation) ? o.operation : "create-project-inspection" };
265
+ if (r.family === "path" && Object.keys(o).length === 0) return new l();
266
+ if (r.family === "configuration") {
267
+ let e = o.code;
268
+ if (i(e)) return new a({
269
+ ...d,
270
+ code: e
271
+ });
272
+ }
273
+ if (r.family === "operation") {
274
+ let t = o.code;
275
+ if (e(t) && t !== "RESOURCE_LIMIT_EXCEEDED" && ![
276
+ "limit",
277
+ "limitMaximum",
278
+ "nextAction",
279
+ "observedUsage"
280
+ ].some((e) => Object.hasOwn(o, e))) return new n({
281
+ ...d,
282
+ code: t
283
+ });
284
+ if (o.code === "RESOURCE_LIMIT_EXCEEDED" && B(o.limitMaximum) && o.limitMaximum > 0) {
285
+ if (o.limit === "maxAnalysisHeapBytes" && o.nextAction === "review-inspection-capacity" && o.observedUsage === null) return new n({
286
+ ...d,
287
+ code: "RESOURCE_LIMIT_EXCEEDED",
288
+ limit: "maxAnalysisHeapBytes",
289
+ limitMaximum: o.limitMaximum,
290
+ observedUsage: null,
291
+ nextAction: "review-inspection-capacity"
292
+ });
293
+ if ((o.limit === "maxInspectionMessageBytes" || o.limit === "maxReaderRequests") && o.nextAction === null && B(o.observedUsage)) return new n({
294
+ ...d,
295
+ code: "RESOURCE_LIMIT_EXCEEDED",
296
+ limit: o.limit,
297
+ limitMaximum: o.limitMaximum,
298
+ nextAction: null,
299
+ observedUsage: o.observedUsage
300
+ });
301
+ if (typeof o.limit == "string" && ![
302
+ "maxAnalysisHeapBytes",
303
+ "maxInspectionMessageBytes",
304
+ "maxReaderRequests"
305
+ ].includes(o.limit) && o.nextAction === "reduce-input-or-increase-limit" && B(o.observedUsage)) return new n({
306
+ ...d,
307
+ code: "RESOURCE_LIMIT_EXCEEDED",
308
+ limit: o.limit,
309
+ limitMaximum: o.limitMaximum,
310
+ nextAction: "reduce-input-or-increase-limit",
311
+ observedUsage: o.observedUsage
312
+ });
313
+ }
314
+ }
315
+ if (r.family === "repository") {
316
+ let e = R.find((e) => e === o.code), t = z.find((e) => e === o.operation), n = o.resource;
317
+ if (e !== void 0 && t !== void 0 && typeof o.retryable == "boolean" && (o.path === null || s(o.path)) && (n === void 0 || typeof n == "object" && n && Object.keys(n).length === 3 && "dimension" in n && typeof n.dimension == "string" && "limit" in n && B(n.limit) && "observed" in n && B(n.observed))) return new c({
318
+ code: e,
319
+ operation: t,
320
+ path: o.path,
321
+ retryable: o.retryable,
322
+ ...n === void 0 ? {} : { resource: n }
323
+ });
324
+ }
325
+ throw _();
326
+ };
327
+ //#endregion
328
+ export { _ as a, F as c, g as i, L as l, d as n, I as o, f as r, V as s, p as t };