@moldea.ai/cli 14.0.0 → 14.0.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.
Files changed (32) hide show
  1. package/README.md +1 -1
  2. package/dist/portable/SHA256SUMS +16 -16
  3. package/dist/portable/analysis-worker.mjs +110 -133
  4. package/dist/portable/chunk-1306b995.mjs +2 -0
  5. package/dist/portable/chunk-24ea7c23.mjs +328 -0
  6. package/dist/portable/chunk-2cc3bf5c.mjs +399 -0
  7. package/dist/portable/chunk-2e9d4c63.mjs +95 -0
  8. package/dist/portable/chunk-43b8574a.mjs +1837 -0
  9. package/dist/portable/chunk-517c6bfb.mjs +2 -0
  10. package/dist/portable/chunk-8f198616.mjs +4414 -0
  11. package/dist/portable/chunk-936e5d09.mjs +112519 -0
  12. package/dist/portable/chunk-98d84174.mjs +422 -0
  13. package/dist/portable/chunk-9e42770a.mjs +3114 -0
  14. package/dist/portable/chunk-cea1378f.mjs +50 -0
  15. package/dist/portable/chunk-d6656fa6.mjs +14 -0
  16. package/dist/portable/chunk-d9e49acd.mjs +302 -0
  17. package/dist/portable/moldea.mjs +1995 -2868
  18. package/dist/portable/node-runner.mjs +77 -106
  19. package/package.json +1 -1
  20. package/dist/portable/chunk-131f8005.mjs +0 -115
  21. package/dist/portable/chunk-2ba7e89e.mjs +0 -26
  22. package/dist/portable/chunk-459da9cf.mjs +0 -4138
  23. package/dist/portable/chunk-728df961.mjs +0 -544
  24. package/dist/portable/chunk-8d6114d2.mjs +0 -588
  25. package/dist/portable/chunk-90403e67.mjs +0 -2
  26. package/dist/portable/chunk-94b5ac22.mjs +0 -59
  27. package/dist/portable/chunk-a5514957.mjs +0 -5870
  28. package/dist/portable/chunk-b98ca669.mjs +0 -2
  29. package/dist/portable/chunk-c13db66a.mjs +0 -380
  30. package/dist/portable/chunk-d5af3eda.mjs +0 -2926
  31. package/dist/portable/chunk-ec3f49d3.mjs +0 -367
  32. package/dist/portable/chunk-fcbcf4e3.mjs +0 -147458
package/README.md CHANGED
@@ -8,7 +8,7 @@ The version 14 executable exposes one schema 8 JSON contract. `validate` and `in
8
8
 
9
9
  The CLI is optional for repositories using the moldea skill. To run it on its own from a Git checkout, use `npx @moldea.ai/cli@14 validate` or add `@moldea.ai/cli` as a development dependency.
10
10
 
11
- The tarball also contains `dist/portable/`. Run `node <path-to-portable>/moldea.mjs validate` with Node.js and Git. The complete directory, including its adjacent runner, worker, chunks, `SHA256SUMS`, and licenses, can move as one unit. The skill ships this build.
11
+ The tarball also contains a minified, source-map-free CLI under `dist/portable/`. Run `node <path-to-portable>/moldea.mjs validate` with Node.js and Git. The complete directory, including its adjacent runner, worker, chunks, `SHA256SUMS`, and `LICENSES.md`, can move as one unit. The skill ships this build.
12
12
 
13
13
  ## Commands
14
14
 
@@ -1,17 +1,17 @@
1
1
  0205722958a215e7ce78cb29148273f0a6fde98348e75eccc109cac640025d85 LICENSES.md
2
- a17295f897c35f217fee537d1593ec2199b48f6898dffbca6199c7b5eca9f43e analysis-worker.mjs
3
- 023a752a563b843ca3aca521d0ed723d3a83b793ad35da0b2c7125141cbb9786 chunk-131f8005.mjs
4
- 7701236556da36a7b40fe775fb59996a67b252fc5fab24727069628f0b57d783 chunk-2ba7e89e.mjs
5
- 012cfc140c97daad6ec22f7a4beb60232fffebdd3111fd6f7e1856938f085ec0 chunk-459da9cf.mjs
6
- 127703a717cd1554a7e2d8f2de607dda34566fede0fbd1564907707586be6461 chunk-728df961.mjs
7
- 89528781474a5b1a002ed3573003049332b5d88f2a15e891d07df47479393c62 chunk-8d6114d2.mjs
8
- c6bc726e2d175028a6258d700b9f85af0834b06764734c932c1d1ca22d5a1d92 chunk-90403e67.mjs
9
- 16f734780ee62174adf98d9e918bd08285d9b7788abc516c69a1b19180948f20 chunk-94b5ac22.mjs
10
- e777329a736ebac3c8352d995c4b5578054f463dcda641e472ffa7c64136f20d chunk-a5514957.mjs
11
- 19ec5e7a41f8deaf0f722f415fa33cf2ef525f56fd6267511d36be237023f389 chunk-b98ca669.mjs
12
- b13aa3082c3bd846829a1e432bc563f070c8340214baf462de77266c54c42001 chunk-c13db66a.mjs
13
- c66f4c808c3b0c7e1cdf81668aedbffab1861a10b4af1f5650b96d9c69a40fa9 chunk-d5af3eda.mjs
14
- e6d37f11a658f4d0a6166e473d16f6fb397d5e50b65e343c8d8a5fce36626bec chunk-ec3f49d3.mjs
15
- 947bbd54bcf0d4b61b74470afb76d9c0c7eaaf5ff7b4f354e095f5fba9579b16 chunk-fcbcf4e3.mjs
16
- 81f142a1cc9f27a195231bc893aa96e77d48297a8123a99fa8df1e0ee8328c45 moldea.mjs
17
- ed6a1553ffbc369270fe8ed7d262fa931edfdbcec469cf786a263c42ea38cf60 node-runner.mjs
2
+ 05ab037ca65d8550312a75283e232b59c1be2f1d121e204b21e4b5f3dd63c4be analysis-worker.mjs
3
+ f91f79307b1fb82de07b5de1322ccfeb16f541fc0de70edd0dc70edec7b215f4 chunk-1306b995.mjs
4
+ 309270827f3c8c03fcc10faab12496c0406d3cebd4c88095bf363a91c3d0cf2b chunk-24ea7c23.mjs
5
+ ab01914500c78d3e80476a31f6a391a2f71dcaa90ffb51957e755b405888f46f chunk-2cc3bf5c.mjs
6
+ 6467b7f8899d34dd5bb33220e374b3374c9ceecd7287a8b636d5ba6ff3660236 chunk-2e9d4c63.mjs
7
+ 6a1fdb326ff17eb78c2677e2d60e7bb556ec74581929eaa9fec2f8e5ed4b5dd2 chunk-43b8574a.mjs
8
+ ed4ae51c156a9ec81e404d9d9e2fb817fc377c84acab445e697dac6b56dd898f chunk-517c6bfb.mjs
9
+ ee0158f7c33a6d7bc02daaaa765ef563f9e7933a4348d51b835225593b4012be chunk-8f198616.mjs
10
+ 752a9d6ac664c3e9dd6dfd48353a2492b40d1ba2765e3dcdfbc9cabc96831ee5 chunk-936e5d09.mjs
11
+ 43b23d20df294cd54bdaf82185b69dc2d8053a68c03638e3e04325fda54a899e chunk-98d84174.mjs
12
+ 95ab84c2eb6d083b164ecabbc152c9ddd68781f05fe5b5e2bf7dae373ac9863b chunk-9e42770a.mjs
13
+ 2b77dd4cfa61ef00ff17dc38743b25e35a75cdbae9c8bf1ba6558f9cc6b3213e chunk-cea1378f.mjs
14
+ a44ec936d7894b899d5129c48a864eb4bbf72a20c2780e8e5b5187eb108a85f5 chunk-d6656fa6.mjs
15
+ c4a75882d621cf32c6a4b0a38680dc3a77b279718c96688d279e61fe8d241d3a chunk-d9e49acd.mjs
16
+ 82844c19f16287b369e98a382da39330307083e3584e3bd4a015dee40fb66b33 moldea.mjs
17
+ 9de4371650b271b2ee753581e52540a5481e9bdb8aa7742e1252550f475e7123 node-runner.mjs
@@ -1,193 +1,170 @@
1
- import { n as CoreOperationException } from "./chunk-728df961.mjs";
2
- import { u as normalizeCoreOptions } from "./chunk-a5514957.mjs";
3
- import { i as RepositorySourceException } from "./chunk-8d6114d2.mjs";
4
- import { a as createInspectionProcessFailure, c as encodeInspectionMessage, i as NODE_INSPECTION_TRANSPORT_BYTES, l as serializeInspectionFailure, o as decodeInspectionMessage, s as deserializeInspectionFailure, t as NODE_INSPECTION_FILE_PAGE_BYTES } from "./chunk-ec3f49d3.mjs";
5
- import { a as parseRpcLinkText, i as parseRpcFilePage, n as parseRpcEntry, r as parseRpcEntryPage } from "./chunk-131f8005.mjs";
6
- import { parentPort, workerData } from "node:worker_threads";
7
- import { getHeapStatistics } from "node:v8";
1
+ import { n as e } from "./chunk-2cc3bf5c.mjs";
2
+ import { u as t } from "./chunk-8f198616.mjs";
3
+ import { i as n } from "./chunk-98d84174.mjs";
4
+ import { a as r, c as i, i as a, l as o, o as s, s as c, t as l } from "./chunk-24ea7c23.mjs";
5
+ import { a as u, i as d, n as f, r as p } from "./chunk-2e9d4c63.mjs";
6
+ import { parentPort as m, workerData as h } from "node:worker_threads";
7
+ import { getHeapStatistics as g } from "node:v8";
8
8
  //#region ../core/dist/analysis-worker.js
9
- var port = parentPort;
10
- if (port === null) throw createInspectionProcessFailure();
11
- var start = decodeInspectionMessage(workerData);
12
- if (start.kind !== "start") throw createInspectionProcessFailure();
13
- var attemptId = start.attemptId;
14
- var maxAnalysisHeapBytes = getHeapStatistics().heap_size_limit;
15
- var inspection;
16
- var hasRun = false;
17
- var isReadingPage = false;
18
- var nextRequestId = 0;
19
- var pending = new Map();
20
- var send = (message) => {
21
- port.postMessage(encodeInspectionMessage(message));
22
- };
23
- var requestReader = (request) => {
24
- if (pending.size >= 4) return Promise.reject(new CoreOperationException({
9
+ var _ = m;
10
+ if (_ === null) throw r();
11
+ var v = s(h);
12
+ if (v.kind !== "start") throw r();
13
+ var y = v.attemptId, b = g().heap_size_limit, x, S = !1, C = !1, w = 0, T = new Map(), E = (e) => {
14
+ _.postMessage(i(e));
15
+ }, D = (t) => {
16
+ if (T.size >= 4) return Promise.reject(new e({
25
17
  code: "RESOURCE_LIMIT_EXCEEDED",
26
18
  operation: "create-project-inspection",
27
19
  limit: "maxReaderRequests",
28
20
  limitMaximum: 4,
29
- observedUsage: pending.size + 1,
21
+ observedUsage: T.size + 1,
30
22
  nextAction: null
31
23
  }));
32
- const requestId = nextRequestId++;
33
- return new Promise((resolve, reject) => {
34
- pending.set(requestId, {
35
- resolve,
36
- reject
24
+ let n = w++;
25
+ return new Promise((e, i) => {
26
+ T.set(n, {
27
+ resolve: e,
28
+ reject: i
37
29
  });
38
30
  try {
39
- send({
40
- attemptId,
31
+ E({
32
+ attemptId: y,
41
33
  kind: "reader-request",
42
- requestId,
43
- request
34
+ requestId: n,
35
+ request: t
44
36
  });
45
- } catch (cause) {
46
- pending.delete(requestId);
47
- reject(cause instanceof Error ? cause : createInspectionProcessFailure(cause));
37
+ } catch (e) {
38
+ T.delete(n), i(e instanceof Error ? e : r(e));
48
39
  }
49
40
  });
50
- };
51
- var createProxyReader = (source, snapshot) => ({
52
- snapshot,
53
- getEntry: async (path) => parseRpcEntry(await requestReader({
41
+ }, O = (e, t) => ({
42
+ snapshot: t,
43
+ getEntry: async (t) => f(await D({
54
44
  method: "getEntry",
55
- path,
56
- source
45
+ path: t,
46
+ source: e
57
47
  })),
58
- listEntriesPage: async (options) => source === "repository" ? parseRpcEntryPage(await requestReader({
48
+ listEntriesPage: async (t) => e === "repository" ? p(await D({
59
49
  method: "listEntriesPage",
60
- maxEntries: Math.min(128, options.maxEntries),
61
- ...options.cursor === void 0 ? {} : { cursor: options.cursor },
62
- ...options.prefix === void 0 ? {} : { prefix: options.prefix }
63
- })) : Promise.reject(new RepositorySourceException({
50
+ maxEntries: Math.min(128, t.maxEntries),
51
+ ...t.cursor === void 0 ? {} : { cursor: t.cursor },
52
+ ...t.prefix === void 0 ? {} : { prefix: t.prefix }
53
+ })) : Promise.reject(new n({
64
54
  code: "SOURCE_UNAVAILABLE",
65
55
  operation: "list-entries-page",
66
56
  path: null,
67
- retryable: false
57
+ retryable: !1
68
58
  })),
69
- readFilePage: async (path, options) => parseRpcFilePage(await requestReader({
59
+ readFilePage: async (t, n) => d(await D({
70
60
  method: "readFilePage",
71
- path,
72
- offset: options.offset,
73
- maxBytes: Math.min(NODE_INSPECTION_FILE_PAGE_BYTES, options.maxBytes),
74
- source
61
+ path: t,
62
+ offset: n.offset,
63
+ maxBytes: Math.min(l, n.maxBytes),
64
+ source: e
75
65
  })),
76
- readLinkText: async (path) => parseRpcLinkText(await requestReader({
66
+ readLinkText: async (t) => u(await D({
77
67
  method: "readLinkText",
78
- path,
79
- source
68
+ path: t,
69
+ source: e
80
70
  })),
81
- compare: () => Promise.reject(new RepositorySourceException({
71
+ compare: () => Promise.reject(new n({
82
72
  code: "SOURCE_UNAVAILABLE",
83
73
  operation: "create-comparison",
84
74
  path: null,
85
- retryable: false
75
+ retryable: !1
86
76
  }))
87
- });
88
- var repository = createProxyReader("repository", start.snapshot);
89
- var instructions = start.instructions === null ? null : createProxyReader("instructions", start.instructions.snapshot);
90
- var prepare = async () => {
91
- const { createCore } = await import("./chunk-b98ca669.mjs").then((n) => n.t);
92
- inspection = await createCore(normalizeCoreOptions({ limits: {
93
- ...start.limits,
94
- maxRetainedBytes: start.limits.maxRetainedBytes - NODE_INSPECTION_TRANSPORT_BYTES
77
+ }), k = O("repository", v.snapshot), A = v.instructions === null ? null : O("instructions", v.instructions.snapshot), j = async () => {
78
+ let { createCore: e } = await import("./chunk-1306b995.mjs").then((e) => e.t);
79
+ x = await e(t({ limits: {
80
+ ...v.limits,
81
+ maxRetainedBytes: v.limits.maxRetainedBytes - a
95
82
  } })).createProjectInspection({
96
- repository,
97
- ...instructions === null ? {} : { instructions }
83
+ repository: k,
84
+ ...A === null ? {} : { instructions: A }
98
85
  });
99
- const metadata = {
100
- source: inspection.source,
101
- formatVersion: inspection.formatVersion,
102
- valid: inspection.valid,
103
- counts: inspection.counts,
104
- coverageCounts: inspection.coverageCounts,
105
- summary: inspection.summary,
106
- resourceUsage: inspection.resourceUsage,
107
- inspectionDigest: inspection.inspectionDigest
86
+ let n = {
87
+ source: x.source,
88
+ formatVersion: x.formatVersion,
89
+ valid: x.valid,
90
+ counts: x.counts,
91
+ coverageCounts: x.coverageCounts,
92
+ summary: x.summary,
93
+ resourceUsage: x.resourceUsage,
94
+ inspectionDigest: x.inspectionDigest
108
95
  };
109
- send({
110
- attemptId,
96
+ E({
97
+ attemptId: y,
111
98
  kind: "prepared",
112
99
  inspection: {
113
- ...metadata,
114
- maxAnalysisHeapBytes,
100
+ ...n,
101
+ maxAnalysisHeapBytes: b,
115
102
  resourceUsage: {
116
- ...metadata.resourceUsage,
117
- retainedBytes: metadata.resourceUsage.retainedBytes + NODE_INSPECTION_TRANSPORT_BYTES,
118
- peakRetainedBytes: metadata.resourceUsage.peakRetainedBytes + NODE_INSPECTION_TRANSPORT_BYTES
103
+ ...n.resourceUsage,
104
+ retainedBytes: n.resourceUsage.retainedBytes + a,
105
+ peakRetainedBytes: n.resourceUsage.peakRetainedBytes + a
119
106
  }
120
107
  }
121
108
  });
122
- };
123
- var fail = (cause) => {
109
+ }, M = (t) => {
124
110
  try {
125
- const failure = serializeInspectionFailure(cause);
126
- if (cause instanceof CoreOperationException && cause.code === "RESOURCE_LIMIT_EXCEEDED" && cause.limit === "maxRetainedBytes" && cause.observedUsage !== null) {
127
- failure.options["limitMaximum"] = start.limits.maxRetainedBytes;
128
- failure.options["observedUsage"] = cause.observedUsage + NODE_INSPECTION_TRANSPORT_BYTES;
129
- }
130
- send({
131
- attemptId,
111
+ let n = o(t);
112
+ t instanceof e && t.code === "RESOURCE_LIMIT_EXCEEDED" && t.limit === "maxRetainedBytes" && t.observedUsage !== null && (n.options.limitMaximum = v.limits.maxRetainedBytes, n.options.observedUsage = t.observedUsage + a), E({
113
+ attemptId: y,
132
114
  kind: "failure",
133
- failure
115
+ failure: n
134
116
  });
135
117
  } catch {
136
- port.close();
118
+ _.close();
137
119
  }
138
120
  };
139
- port.on("message", (frame) => {
121
+ _.on("message", (t) => {
140
122
  try {
141
- const message = decodeInspectionMessage(frame);
142
- if (message.attemptId !== attemptId) throw createInspectionProcessFailure();
143
- if (message.kind === "run") {
144
- if (hasRun) throw createInspectionProcessFailure();
145
- hasRun = true;
146
- prepare().catch(fail);
147
- } else if (message.kind === "reader-response" || message.kind === "reader-failure") {
148
- const request = pending.get(message.requestId);
149
- if (request === void 0) throw createInspectionProcessFailure();
150
- pending.delete(message.requestId);
151
- if (message.kind === "reader-failure") request.reject(deserializeInspectionFailure(message.failure));
152
- else request.resolve(message.result);
153
- } else if (message.kind === "read-page") {
154
- if (inspection === void 0 || isReadingPage) throw createInspectionProcessFailure();
155
- isReadingPage = true;
123
+ let n = s(t);
124
+ if (n.attemptId !== y) throw r();
125
+ if (n.kind === "run") {
126
+ if (S) throw r();
127
+ S = !0, j().catch(M);
128
+ } else if (n.kind === "reader-response" || n.kind === "reader-failure") {
129
+ let e = T.get(n.requestId);
130
+ if (e === void 0) throw r();
131
+ T.delete(n.requestId), n.kind === "reader-failure" ? e.reject(c(n.failure)) : e.resolve(n.result);
132
+ } else if (n.kind === "read-page") {
133
+ if (x === void 0 || C) throw r();
134
+ C = !0;
156
135
  try {
157
- if (message.input.maxItems > start.limits.maxEntries) throw new CoreOperationException({
136
+ if (n.input.maxItems > v.limits.maxEntries) throw new e({
158
137
  code: "INVALID_ARGUMENT",
159
138
  operation: "create-project-inspection"
160
139
  });
161
- let maxItems = Math.min(256, message.input.maxItems);
162
- while (true) try {
163
- const frame = encodeInspectionMessage({
164
- attemptId,
140
+ let t = Math.min(256, n.input.maxItems);
141
+ for (;;) try {
142
+ let e = i({
143
+ attemptId: y,
165
144
  kind: "page",
166
- requestId: message.requestId,
167
- result: inspection.readPage({
168
- ...message.input,
169
- maxItems
145
+ requestId: n.requestId,
146
+ result: x.readPage({
147
+ ...n.input,
148
+ maxItems: t
170
149
  })
171
150
  });
172
- port.postMessage(frame);
151
+ _.postMessage(e);
173
152
  break;
174
- } catch (cause) {
175
- if (!(cause instanceof CoreOperationException) || cause.code !== "RESOURCE_LIMIT_EXCEEDED" || cause.limit !== "maxInspectionMessageBytes" || maxItems === 1) throw cause;
176
- maxItems = Math.max(1, Math.floor(maxItems / 2));
153
+ } catch (n) {
154
+ if (!(n instanceof e) || n.code !== "RESOURCE_LIMIT_EXCEEDED" || n.limit !== "maxInspectionMessageBytes" || t === 1) throw n;
155
+ t = Math.max(1, Math.floor(t / 2));
177
156
  }
178
157
  } finally {
179
- isReadingPage = false;
158
+ C = !1;
180
159
  }
181
- } else throw createInspectionProcessFailure();
182
- } catch (cause) {
183
- fail(cause);
160
+ } else throw r();
161
+ } catch (e) {
162
+ M(e);
184
163
  }
185
- });
186
- port.on("messageerror", fail);
187
- send({
188
- attemptId,
164
+ }), _.on("messageerror", M), E({
165
+ attemptId: y,
189
166
  kind: "ready",
190
- maxAnalysisHeapBytes
167
+ maxAnalysisHeapBytes: b
191
168
  });
192
169
  //#endregion
193
170
  export {};
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./chunk-9e42770a.mjs";
2
+ export { e as t };