@moldea.ai/core 9.1.0 → 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 +2 -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/package.json +1 -1
- package/dist/chunks/core-CFmT3SRC.js.map +0 -1
package/README.md
CHANGED
|
@@ -88,6 +88,8 @@ Core checks each declared binding's file and, when a symbol is named, its syntax
|
|
|
88
88
|
|
|
89
89
|
Every diagnostic has `severity`, `group`, and stable `source: 'core'`. The groups are `discovery`, `manifest`, `references`, `agents`, `mirrors`, and `integration`. The result reports complete `errorCount`, unaccepted `warningCount`, `acceptedWarningCount`, and `diagnosticCount`; warnings do not invalidate a project. Manifest `acceptedWarnings` match a warning's code, subject, and qualifier and require a non-empty reason. Accepted findings remain visible. Unmatched impact patterns are best-effort warnings; a skipped check never makes an acceptance obsolete. Validation and inspection also check the root `/AGENTS.md` managed block against its referenced skill installation, reporting missing blocks, missing installation files, drift, or a link that doesn't lead to a file in the repository, with its reason as qualifier, as acceptable integration warnings. They also check whether `/CLAUDE.md`, `/.claude/CLAUDE.md`, or, without shared files, `/CLAUDE.local.md` loads AGENTS.md through an import line or a link, reporting `MOLDEA_INTEGRATION_CLAUDE_IMPORT_MISSING` when it does not. An optional `instructions` reader supplies the four instruction files; links are followed inside the repository with Repository's `resolveRepositoryLink`, and link targets, the skill installation, and every other check read `repository`. `parseIntegrationBlock(text)` extracts the safe relative installation path or a reason it could not be found. Manifest-only operations and `scope` do not read the integration.
|
|
90
90
|
|
|
91
|
+
Managed-block comparison tolerates LF/CRLF differences, an optional final line break, empty lines immediately inside the markers, and spaces or tabs after marker comments. It preserves exact instruction text and internal whitespace; duplicate, reversed, missing, or otherwise malformed markers still produce diagnostics.
|
|
92
|
+
|
|
91
93
|
## Resource and trust boundaries
|
|
92
94
|
|
|
93
95
|
Core uses independent limits for distinct entries, total bytes read, per-file bytes, manifest bytes, logical retained bytes, diagnostics, and coverage records. The default logical retained-memory ceiling is 512 MiB. Before reading a supported source for export analysis, Core checks `maxFileBytes`, confirms read-buffer headroom, and reserves `65536 + sourceBytes * (8 + 512)` bytes for text and syntax nodes. An oversized source or reservation miss records `resource-limit` without a source read; a subsequent failed read, cancellation, or operation budget failure rejects the whole operation. Each distinct source is parsed at most once per operation. Source buffers and syntax reservations are released after analysis; only export names remain in the inventory cache. Core executes no repository code, follows instruction links only inside the snapshot, receives no host path or source credential, and returns logical paths only.
|
package/dist/analysis-worker.js
CHANGED
|
@@ -91,7 +91,7 @@ var repository = createProxyReader("repository", start.snapshot);
|
|
|
91
91
|
var instructions = start.instructions === null ? null : createProxyReader("instructions", start.instructions.snapshot);
|
|
92
92
|
/** Prepares the fixed Core implementation after the parent acknowledges the heap. */
|
|
93
93
|
var prepare = async () => {
|
|
94
|
-
const { createCore } = await import("./chunks/core-
|
|
94
|
+
const { createCore } = await import("./chunks/core-DuaKbQLI.js").then((n) => n.t);
|
|
95
95
|
inspection = await createCore(normalizeCoreOptions({ limits: {
|
|
96
96
|
...start.limits,
|
|
97
97
|
maxRetainedBytes: start.limits.maxRetainedBytes - NODE_INSPECTION_TRANSPORT_BYTES
|
|
@@ -1884,18 +1884,36 @@ var MARKERS = {
|
|
|
1884
1884
|
};
|
|
1885
1885
|
/**
|
|
1886
1886
|
* Finds the managed block's region with the skill writer's region semantics: one start and one end
|
|
1887
|
-
* marker, each on its own line, the start first.
|
|
1887
|
+
* marker, each on its own line with optional trailing spaces or tabs, the start first.
|
|
1888
1888
|
* @param text The instruction document.
|
|
1889
1889
|
* @returns The region, or why the document has none.
|
|
1890
1890
|
*/
|
|
1891
1891
|
var parseManagedIntegrationRegion = (text) => {
|
|
1892
1892
|
try {
|
|
1893
|
-
|
|
1893
|
+
const region = findMarkedRegion(text.replace(/(<!-- moldea:(?:start|end) -->)[ \t]+(?=\r?$)/gmu, "$1"), MARKERS);
|
|
1894
|
+
if (region === null) return "block-missing";
|
|
1895
|
+
const start = text.indexOf(MARKERS.start);
|
|
1896
|
+
const closingLineBreak = text.indexOf("\n", text.indexOf(MARKERS.end));
|
|
1897
|
+
return {
|
|
1898
|
+
start,
|
|
1899
|
+
end: closingLineBreak === -1 ? text.length : closingLineBreak + 1,
|
|
1900
|
+
lineEnding: region.lineEnding
|
|
1901
|
+
};
|
|
1894
1902
|
} catch (error) {
|
|
1895
1903
|
if (hasErrorCode(error, ERRORS.INVALID_MARKED_REGION)) return "block-invalid";
|
|
1896
1904
|
throw error;
|
|
1897
1905
|
}
|
|
1898
1906
|
};
|
|
1907
|
+
/** Removes only managed-envelope formatting differences, preserving all instruction content. */
|
|
1908
|
+
var normalizeManagedIntegrationBlock = (text) => {
|
|
1909
|
+
const normalized = text.replaceAll("\r\n", "\n").replace(/(<!-- moldea:(?:start|end) -->)[ \t]+(?=\n|$)/gu, "$1");
|
|
1910
|
+
if (!normalized.startsWith(`${MARKERS.start}\n`) || !(normalized.endsWith(MARKERS.end) || normalized.endsWith(`${MARKERS.end}\n`))) return normalized;
|
|
1911
|
+
let start = MARKERS.start.length;
|
|
1912
|
+
let end = normalized.lastIndexOf(MARKERS.end);
|
|
1913
|
+
while (start < end && normalized[start] === "\n") start++;
|
|
1914
|
+
while (end > start && normalized[end - 1] === "\n") end--;
|
|
1915
|
+
return `${MARKERS.start}\n${normalized.slice(start, end)}\n${MARKERS.end}`;
|
|
1916
|
+
};
|
|
1899
1917
|
/**
|
|
1900
1918
|
* Extracts the relative installation path from the fixed relevance-gate command without executing it.
|
|
1901
1919
|
* @returns The safe installation path or the reason it could not be obtained.
|
|
@@ -2068,8 +2086,8 @@ var checkAgentsDocument = async (context, report, load, entryDetails) => {
|
|
|
2068
2086
|
const renderedReservation = (asset.text.length + occurrences * skillPath.length) * 8;
|
|
2069
2087
|
ledger.reserve(renderedReservation);
|
|
2070
2088
|
try {
|
|
2071
|
-
const expected = asset.text.replaceAll("{{skill-path}}", skillPath).replace(/\r\n?/
|
|
2072
|
-
if (document.text.slice(region.start, region.end) !== expected) return report("MOLDEA_INTEGRATION_BLOCK_STALE", { referencedPath: `/${skillPath}` });
|
|
2089
|
+
const expected = normalizeManagedIntegrationBlock(asset.text.replaceAll("{{skill-path}}", skillPath).replace(/\r\n?/gu, "\n"));
|
|
2090
|
+
if (normalizeManagedIntegrationBlock(document.text.slice(region.start, region.end)) !== expected) return report("MOLDEA_INTEGRATION_BLOCK_STALE", { referencedPath: `/${skillPath}` });
|
|
2073
2091
|
} finally {
|
|
2074
2092
|
ledger.release(renderedReservation);
|
|
2075
2093
|
}
|
|
@@ -3633,4 +3651,4 @@ var createCore = (options) => {
|
|
|
3633
3651
|
//#endregion
|
|
3634
3652
|
export { createCore as n, parseIntegrationBlock as r, core_exports as t };
|
|
3635
3653
|
|
|
3636
|
-
//# sourceMappingURL=core-
|
|
3654
|
+
//# sourceMappingURL=core-DuaKbQLI.js.map
|