@moldea.ai/core 5.0.1 → 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.
- package/README.md +11 -4
- package/dist/adapter/index.d.ts +16 -4
- package/dist/adapter/index.d.ts.map +1 -1
- package/dist/adapter-execution/index.d.ts +12 -9
- package/dist/adapter-execution/index.d.ts.map +1 -1
- package/dist/adapter-result-collection/collection.d.ts +13 -0
- package/dist/adapter-result-collection/collection.d.ts.map +1 -0
- package/dist/adapter-result-collection/index.d.ts +3 -0
- package/dist/adapter-result-collection/index.d.ts.map +1 -0
- package/dist/adapter-result-collection/types.d.ts +31 -0
- package/dist/adapter-result-collection/types.d.ts.map +1 -0
- package/dist/adapter.js +3 -2
- package/dist/adapter.js.map +1 -1
- package/dist/analysis-worker.js +190 -0
- package/dist/analysis-worker.js.map +1 -0
- package/dist/chunks/collection-CvbjjLf2.js +73 -0
- package/dist/chunks/collection-CvbjjLf2.js.map +1 -0
- package/dist/chunks/core-DchheNDz.js +5305 -0
- package/dist/chunks/core-DchheNDz.js.map +1 -0
- package/dist/chunks/errors-BQI1DEqf.js +446 -0
- package/dist/chunks/errors-BQI1DEqf.js.map +1 -0
- package/dist/chunks/{exceptions-HS9ofVy2.js → exceptions-lzD3buFw.js} +26 -15
- package/dist/chunks/exceptions-lzD3buFw.js.map +1 -0
- package/dist/chunks/lifecycle-4EkWgEHm.js +67 -0
- package/dist/chunks/lifecycle-4EkWgEHm.js.map +1 -0
- package/dist/chunks/options-CxCT3dZU.js +617 -0
- package/dist/chunks/options-CxCT3dZU.js.map +1 -0
- package/dist/chunks/repository-rpc-BWi6X1la.js +124 -0
- package/dist/chunks/repository-rpc-BWi6X1la.js.map +1 -0
- package/dist/contracts/index.d.ts +28 -18
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/custom-runtime-inspection/index.d.ts +2 -0
- package/dist/custom-runtime-inspection/index.d.ts.map +1 -0
- package/dist/custom-runtime-inspection/inspection.d.ts +11 -0
- package/dist/custom-runtime-inspection/inspection.d.ts.map +1 -0
- package/dist/exceptions/index.d.ts +23 -4
- package/dist/exceptions/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5775
- package/dist/node/index.d.ts +4 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node-inspection/analysis-worker.d.ts +2 -0
- package/dist/node-inspection/analysis-worker.d.ts.map +1 -0
- package/dist/node-inspection/client.d.ts +32 -0
- package/dist/node-inspection/client.d.ts.map +1 -0
- package/dist/node-inspection/constants.d.ts +21 -0
- package/dist/node-inspection/constants.d.ts.map +1 -0
- package/dist/node-inspection/errors.d.ts +11 -0
- package/dist/node-inspection/errors.d.ts.map +1 -0
- package/dist/node-inspection/lifecycle.d.ts +15 -0
- package/dist/node-inspection/lifecycle.d.ts.map +1 -0
- package/dist/node-inspection/protocol.d.ts +20 -0
- package/dist/node-inspection/protocol.d.ts.map +1 -0
- package/dist/node-inspection/repository-rpc.d.ts +28 -0
- package/dist/node-inspection/repository-rpc.d.ts.map +1 -0
- package/dist/node-inspection/runner.d.ts +2 -0
- package/dist/node-inspection/runner.d.ts.map +1 -0
- package/dist/node-inspection/types.d.ts +99 -0
- package/dist/node-inspection/types.d.ts.map +1 -0
- package/dist/node-runner.js +149 -0
- package/dist/node-runner.js.map +1 -0
- package/dist/node.js +325 -0
- package/dist/node.js.map +1 -0
- package/dist/project-inspection/index.d.ts +22 -1
- package/dist/project-inspection/index.d.ts.map +1 -1
- package/dist/project-validation/index.d.ts +34 -10
- package/dist/project-validation/index.d.ts.map +1 -1
- package/package.json +9 -1
- package/dist/chunks/exceptions-HS9ofVy2.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import { n as CoreOperationException, t as CoreConfigurationException } from "./exceptions-lzD3buFw.js";
|
|
2
|
+
import { isRepositoryPath, parseRepositoryPath } from "@moldea.ai/repository";
|
|
3
|
+
//#region src/constants/index.ts
|
|
4
|
+
var RECOGNIZED_RUNTIME_ADAPTER_IDS = Object.freeze([
|
|
5
|
+
"anthropic",
|
|
6
|
+
"claude-agent-sdk",
|
|
7
|
+
"cloudflare-agents",
|
|
8
|
+
"custom",
|
|
9
|
+
"eve",
|
|
10
|
+
"google-genai",
|
|
11
|
+
"langchain",
|
|
12
|
+
"langgraph",
|
|
13
|
+
"openai",
|
|
14
|
+
"openai-agents-sdk",
|
|
15
|
+
"vercel-ai-sdk"
|
|
16
|
+
]);
|
|
17
|
+
var SUPPORTED_REPOSITORY_FORMAT_VERSIONS = Object.freeze([1]);
|
|
18
|
+
var DEFAULT_CORE_RESOURCE_LIMITS = Object.freeze({
|
|
19
|
+
maxDiagnostics: 1e4,
|
|
20
|
+
maxEntries: 1e5,
|
|
21
|
+
maxEvidence: 1e4,
|
|
22
|
+
maxFileBytes: 8388608,
|
|
23
|
+
maxManifestBytes: 2097152,
|
|
24
|
+
maxRetainedBytes: 536870912,
|
|
25
|
+
maxTotalBytesRead: 134217728
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/immutable/index.ts
|
|
29
|
+
/**
|
|
30
|
+
* Recursively freezes a Core-owned value without cloning it.
|
|
31
|
+
* @param value The detached acyclic value whose already-frozen objects are deeply frozen.
|
|
32
|
+
* @returns The same value with every mutable reachable object frozen.
|
|
33
|
+
*/
|
|
34
|
+
var freezeRecursively = (value) => {
|
|
35
|
+
if (typeof value !== "object" || value === null || Object.isFrozen(value)) return value;
|
|
36
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
37
|
+
const child = value[key];
|
|
38
|
+
freezeRecursively(child);
|
|
39
|
+
}
|
|
40
|
+
return Object.freeze(value);
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Creates a record that cannot collide with prototype-chain properties.
|
|
44
|
+
* @param entries The own string-keyed entries to assign.
|
|
45
|
+
* @returns A mutable null-prototype record for later normalization and freezing.
|
|
46
|
+
*/
|
|
47
|
+
var createNullPrototypeRecord = (entries) => {
|
|
48
|
+
const record = Object.create(null);
|
|
49
|
+
for (const [key, value] of entries) record[key] = value;
|
|
50
|
+
return record;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/format-validation/index.ts
|
|
54
|
+
var STABLE_ID_PATTERN$1 = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
55
|
+
var VARIABLE_ID_PATTERN = /^[A-Z][A-Z0-9_]*$/u;
|
|
56
|
+
var WINDOWS_RESERVED_ID_PATTERN$1 = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])$/u;
|
|
57
|
+
var LINE_BREAK_CHARACTERS = [
|
|
58
|
+
"\n",
|
|
59
|
+
"\r",
|
|
60
|
+
"
",
|
|
61
|
+
"\u2028",
|
|
62
|
+
"\u2029"
|
|
63
|
+
];
|
|
64
|
+
var UNSUPPORTED_GLOB_PATTERN = /[!?[\]{}]/u;
|
|
65
|
+
var hasLineBreak = (value) => {
|
|
66
|
+
return LINE_BREAK_CHARACTERS.some((lineBreak) => value.includes(lineBreak));
|
|
67
|
+
};
|
|
68
|
+
/** Determines whether a code point belongs to the Repository Format version 1 whitespace set. */
|
|
69
|
+
var isRepositoryFormatWhitespace = (codePoint) => {
|
|
70
|
+
return codePoint >= 9 && codePoint <= 13 || codePoint === 32 || codePoint === 133 || codePoint === 160 || codePoint === 5760 || codePoint >= 8192 && codePoint <= 8202 || codePoint === 8232 || codePoint === 8233 || codePoint === 8239 || codePoint === 8287 || codePoint === 12288;
|
|
71
|
+
};
|
|
72
|
+
/** Compares strings by exact Unicode code-point order without locale behavior. */
|
|
73
|
+
var compareExactStrings = (left, right) => {
|
|
74
|
+
const leftScalars = left[Symbol.iterator]();
|
|
75
|
+
const rightScalars = right[Symbol.iterator]();
|
|
76
|
+
while (true) {
|
|
77
|
+
const leftScalar = leftScalars.next();
|
|
78
|
+
const rightScalar = rightScalars.next();
|
|
79
|
+
if (leftScalar.done === true) return rightScalar.done === true ? 0 : -1;
|
|
80
|
+
if (rightScalar.done === true) return 1;
|
|
81
|
+
const leftCodePoint = leftScalar.value.codePointAt(0) ?? 0;
|
|
82
|
+
const rightCodePoint = rightScalar.value.codePointAt(0) ?? 0;
|
|
83
|
+
if (leftCodePoint !== rightCodePoint) return leftCodePoint < rightCodePoint ? -1 : 1;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
/** Counts Unicode scalar values in valid JavaScript text. */
|
|
87
|
+
var countUnicodeScalars = (value) => {
|
|
88
|
+
const scalars = value[Symbol.iterator]();
|
|
89
|
+
let count = 0;
|
|
90
|
+
while (scalars.next().done !== true) count += 1;
|
|
91
|
+
return count;
|
|
92
|
+
};
|
|
93
|
+
/** Determines whether a JavaScript string contains only Unicode scalar values. */
|
|
94
|
+
var isUnicodeScalarText = (value) => {
|
|
95
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
96
|
+
const codeUnit = value.charCodeAt(index);
|
|
97
|
+
if (codeUnit >= 55296 && codeUnit <= 56319) {
|
|
98
|
+
if (index + 1 >= value.length) return false;
|
|
99
|
+
const nextCodeUnit = value.charCodeAt(index + 1);
|
|
100
|
+
if (nextCodeUnit < 56320 || nextCodeUnit > 57343) return false;
|
|
101
|
+
index += 1;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (codeUnit >= 56320 && codeUnit <= 57343) return false;
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
};
|
|
108
|
+
/** Determines whether a value contains at least one non-whitespace scalar. */
|
|
109
|
+
var hasNonWhitespace = (value) => {
|
|
110
|
+
for (const scalar of value) if (!isRepositoryFormatWhitespace(scalar.codePointAt(0) ?? 0)) return true;
|
|
111
|
+
return false;
|
|
112
|
+
};
|
|
113
|
+
/** Determines whether a value begins or ends with version 1 whitespace. */
|
|
114
|
+
var hasSurroundingWhitespace = (value) => {
|
|
115
|
+
const firstCodePoint = value.codePointAt(0);
|
|
116
|
+
const lastCodePoint = value.codePointAt(value.length - 1);
|
|
117
|
+
return firstCodePoint !== void 0 && isRepositoryFormatWhitespace(firstCodePoint) || lastCodePoint !== void 0 && isRepositoryFormatWhitespace(lastCodePoint);
|
|
118
|
+
};
|
|
119
|
+
/** Removes only Repository Format version 1 whitespace from both edges. */
|
|
120
|
+
var trimRepositoryFormatWhitespace = (value) => {
|
|
121
|
+
let start = 0;
|
|
122
|
+
let end = value.length;
|
|
123
|
+
while (start < end) {
|
|
124
|
+
const codePoint = value.codePointAt(start);
|
|
125
|
+
if (codePoint === void 0 || !isRepositoryFormatWhitespace(codePoint)) break;
|
|
126
|
+
start += codePoint > 65535 ? 2 : 1;
|
|
127
|
+
}
|
|
128
|
+
while (end > start) {
|
|
129
|
+
const codePoint = value.codePointAt(end - 1);
|
|
130
|
+
if (codePoint === void 0 || !isRepositoryFormatWhitespace(codePoint)) break;
|
|
131
|
+
end -= 1;
|
|
132
|
+
}
|
|
133
|
+
return value.slice(start, end);
|
|
134
|
+
};
|
|
135
|
+
/** Determines whether a string is non-empty and contains no line break. */
|
|
136
|
+
var isNonEmptySingleLine = (value) => {
|
|
137
|
+
return value.length > 0 && !hasLineBreak(value);
|
|
138
|
+
};
|
|
139
|
+
/** Determines whether a value satisfies stable moldea ID syntax. */
|
|
140
|
+
var isStableId$1 = (value) => {
|
|
141
|
+
return value.length <= 64 && STABLE_ID_PATTERN$1.test(value);
|
|
142
|
+
};
|
|
143
|
+
/** Determines whether an otherwise valid stable ID is filesystem-reserved. */
|
|
144
|
+
var isReservedId = (value) => WINDOWS_RESERVED_ID_PATTERN$1.test(value);
|
|
145
|
+
/** Determines whether a value satisfies runtime-variable ID syntax. */
|
|
146
|
+
var isVariableId = (value) => {
|
|
147
|
+
return value.length <= 64 && VARIABLE_ID_PATTERN.test(value);
|
|
148
|
+
};
|
|
149
|
+
/** Determines whether a parsed capability description satisfies version 1 limits. */
|
|
150
|
+
var isCapabilityDescription = (value) => {
|
|
151
|
+
const scalarLength = countUnicodeScalars(value);
|
|
152
|
+
return scalarLength >= 1 && scalarLength <= 1e3 && !hasSurroundingWhitespace(value) && !hasLineBreak(value) && !value.includes("\0") && !value.includes("{{") && !value.includes("}}");
|
|
153
|
+
};
|
|
154
|
+
/** Parses a non-root repository-format logical path without throwing. */
|
|
155
|
+
var parseManifestPath = (value) => {
|
|
156
|
+
return value !== "/" && isRepositoryPath(value) ? parseRepositoryPath(value) : null;
|
|
157
|
+
};
|
|
158
|
+
/** Determines whether a path is the canonical manifest path. */
|
|
159
|
+
var isCanonicalManifestPath = (path) => {
|
|
160
|
+
return path === "/moldea/moldea.yaml";
|
|
161
|
+
};
|
|
162
|
+
/** Extracts the stable millisecond ID from one canonical immediate decision path. */
|
|
163
|
+
var parseDecisionIdFromPath = (path) => {
|
|
164
|
+
const match = /^\/moldea\/decisions\/(\d{13})-([a-z0-9]+(?:-[a-z0-9]+)*)\.md$/u.exec(path);
|
|
165
|
+
const id = match?.[1];
|
|
166
|
+
const slug = match?.[2];
|
|
167
|
+
return id !== void 0 && slug !== void 0 && isStableId$1(slug) ? id : null;
|
|
168
|
+
};
|
|
169
|
+
/** Determines whether a path is an allowed focused-context relationship key. */
|
|
170
|
+
var isContextPath = (path, allowProject) => {
|
|
171
|
+
if (allowProject && path === "/moldea/project.md") return true;
|
|
172
|
+
return path.startsWith("/moldea/context/") && path.endsWith(".md");
|
|
173
|
+
};
|
|
174
|
+
/** Determines whether a path has the canonical immediate decision filename shape. */
|
|
175
|
+
var isDecisionPath = (path) => {
|
|
176
|
+
return parseDecisionIdFromPath(path) !== null;
|
|
177
|
+
};
|
|
178
|
+
/** Determines whether a path is canonical runtime guidance. */
|
|
179
|
+
var isRuntimeGuidancePath = (path) => {
|
|
180
|
+
return path.startsWith("/moldea/runtimes/") && path.endsWith(".md");
|
|
181
|
+
};
|
|
182
|
+
/** Determines whether a mirror path is outside canonical moldea content. */
|
|
183
|
+
var isMirrorPath = (path) => {
|
|
184
|
+
return path !== "/moldea" && !path.startsWith("/moldea/");
|
|
185
|
+
};
|
|
186
|
+
/** Determines whether an impact path contains prohibited glob metacharacters. */
|
|
187
|
+
var hasUnsupportedGlobMetacharacter = (value) => {
|
|
188
|
+
return UNSUPPORTED_GLOB_PATTERN.test(value);
|
|
189
|
+
};
|
|
190
|
+
/** Determines whether a string satisfies the version 1 simple-glob grammar. */
|
|
191
|
+
var isSimpleGlob = (value) => {
|
|
192
|
+
if (hasUnsupportedGlobMetacharacter(value) || value.includes("***")) return false;
|
|
193
|
+
if (value.slice(1).split("/").some((segment) => segment.includes("**") && segment !== "**")) return false;
|
|
194
|
+
return value.includes("*") && isRepositoryPath(value.replaceAll("*", "x"));
|
|
195
|
+
};
|
|
196
|
+
/** Determines whether a repository-reference symbol has the common safe shape. */
|
|
197
|
+
var isRepositorySymbol = (value) => {
|
|
198
|
+
return isNonEmptySingleLine(value) && !value.includes("\0");
|
|
199
|
+
};
|
|
200
|
+
/** Determines whether a canonical moldea reference incorrectly carries a symbol. */
|
|
201
|
+
var isCanonicalMoldeaPath = (path) => {
|
|
202
|
+
return path === "/moldea" || path.startsWith("/moldea/");
|
|
203
|
+
};
|
|
204
|
+
/** Sorts repository references by path and then optional symbol. */
|
|
205
|
+
var sortRepositoryReferences = (references) => {
|
|
206
|
+
return [...references].sort((left, right) => {
|
|
207
|
+
return compareExactStrings(left.path, right.path) || compareExactStrings(left.symbol ?? "", right.symbol ?? "");
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/diagnostic-utilities/index.ts
|
|
212
|
+
var CORE_DIAGNOSTIC_MESSAGES = {
|
|
213
|
+
MOLDEA_AGENT_DESCRIPTION_INVALID: "The agent description is invalid.",
|
|
214
|
+
MOLDEA_AGENT_DESCRIPTION_MISSING: "The agent description is missing.",
|
|
215
|
+
MOLDEA_AGENT_DIRECTORY_MISSING: "The registered agent directory is missing.",
|
|
216
|
+
MOLDEA_AGENT_DIRECTORY_UNREGISTERED: "The agent directory is not registered.",
|
|
217
|
+
MOLDEA_AGENT_HANDOFF_DESCRIPTION_INVALID: "The agent handoff description is invalid.",
|
|
218
|
+
MOLDEA_AGENT_IDENTITY_INVALID: "The agent instruction identity is invalid.",
|
|
219
|
+
MOLDEA_AGENT_INSTRUCTION_EMPTY: "The agent instruction is empty.",
|
|
220
|
+
MOLDEA_AGENT_INSTRUCTION_MISSING: "The agent instruction is missing.",
|
|
221
|
+
MOLDEA_CANONICAL_ASSET_SYMLINK: "The canonical asset is a symlink.",
|
|
222
|
+
MOLDEA_CANONICAL_PATH_UNRECOGNIZED: "The canonical path is unrecognized.",
|
|
223
|
+
MOLDEA_CAPABILITY_DESCRIPTION_INVALID: "The capability description is invalid.",
|
|
224
|
+
MOLDEA_CAPABILITY_DESCRIPTION_MISSING: "The capability description is missing.",
|
|
225
|
+
MOLDEA_CONTEXT_FILE_EMPTY: "The focused context file is empty.",
|
|
226
|
+
MOLDEA_CONTEXT_PATH_INVALID: "The context relationship path is invalid.",
|
|
227
|
+
MOLDEA_CONTEXT_RELATIONSHIP_EMPTY: "The declared relationship has no bindings or impact paths.",
|
|
228
|
+
MOLDEA_DECISION_BODY_EMPTY: "The decision Markdown body is empty.",
|
|
229
|
+
MOLDEA_DECISION_CREATED_AT_INVALID: "The decision createdAt value is invalid.",
|
|
230
|
+
MOLDEA_DECISION_FILENAME_INVALID: "The decision path or filename is invalid.",
|
|
231
|
+
MOLDEA_DECISION_FRONTMATTER_INVALID: "The decision frontmatter is invalid.",
|
|
232
|
+
MOLDEA_DECISION_FRONTMATTER_MISSING: "The decision frontmatter or its delimiters are missing.",
|
|
233
|
+
MOLDEA_DECISION_ID_DUPLICATE: "The decision ID is duplicated.",
|
|
234
|
+
MOLDEA_DECISION_PROPERTY_UNKNOWN: "The decision frontmatter contains an unknown property.",
|
|
235
|
+
MOLDEA_DECISION_REFERENCE_MISSING: "The referenced decision does not exist.",
|
|
236
|
+
MOLDEA_DECISION_RELATIONSHIP_INACTIVE: "The referenced decision is not accepted.",
|
|
237
|
+
MOLDEA_DECISION_SELF_SUPERSESSION: "The decision supersedes itself.",
|
|
238
|
+
MOLDEA_DECISION_STATUS_INVALID: "The decision status is invalid.",
|
|
239
|
+
MOLDEA_DECISION_SUPERSEDED_ORPHAN: "The superseded decision has no active supersession relationship.",
|
|
240
|
+
MOLDEA_DECISION_SUPERSESSION_CYCLE: "The decision supersession graph contains a cycle.",
|
|
241
|
+
MOLDEA_DECISION_SUPERSESSION_STATUS_INVALID: "The decision supersession relationship has inconsistent statuses.",
|
|
242
|
+
MOLDEA_DECISION_TIMESTAMP_MISMATCH: "The decision filename timestamp and createdAt value do not match.",
|
|
243
|
+
MOLDEA_ENTRY_TYPE_INVALID: "The repository entry type is invalid.",
|
|
244
|
+
MOLDEA_RUNTIME_ADAPTER_FORMAT_UNSUPPORTED: "The configured runtime adapter does not support the repository format version.",
|
|
245
|
+
MOLDEA_RUNTIME_ADAPTER_UNAVAILABLE: "The declared runtime adapter is unavailable.",
|
|
246
|
+
MOLDEA_RUNTIME_ID_INVALID: "The runtime adapter ID is invalid.",
|
|
247
|
+
MOLDEA_GLOB_INVALID: "The impact pattern is invalid.",
|
|
248
|
+
MOLDEA_ID_DUPLICATE: "An ID is duplicated within its required scope.",
|
|
249
|
+
MOLDEA_ID_INVALID: "The ID is invalid.",
|
|
250
|
+
MOLDEA_ID_RESERVED: "The ID uses a reserved filesystem name.",
|
|
251
|
+
MOLDEA_IMPACT_PATH_MISSING: "The exact impact path does not exist.",
|
|
252
|
+
MOLDEA_IMPACT_PATH_NOT_FILE: "The exact impact path is not a regular file.",
|
|
253
|
+
MOLDEA_MANIFEST_MISSING: "The project manifest is missing.",
|
|
254
|
+
MOLDEA_MANIFEST_PATH_INVALID: "The manifest path is not the canonical manifest path.",
|
|
255
|
+
MOLDEA_MANIFEST_PROPERTY_UNKNOWN: "The manifest contains an unknown property.",
|
|
256
|
+
MOLDEA_MANIFEST_ROOT_INVALID: "The manifest root is not a mapping.",
|
|
257
|
+
MOLDEA_MANIFEST_VALUE_INVALID: "The manifest value is invalid.",
|
|
258
|
+
MOLDEA_MANIFEST_VERSION_INVALID: "The manifest version is not a valid integer major version.",
|
|
259
|
+
MOLDEA_MANIFEST_VERSION_MISSING: "The manifest version is missing.",
|
|
260
|
+
MOLDEA_MANIFEST_VERSION_UNSUPPORTED: "The manifest version is unsupported.",
|
|
261
|
+
MOLDEA_MIRROR_PATH_DUPLICATE: "The mirror path is assigned more than once.",
|
|
262
|
+
MOLDEA_MIRROR_PATH_INSIDE_MOLDEA: "The mirror path is inside /moldea.",
|
|
263
|
+
MOLDEA_MIRROR_PATH_INVALID: "The mirror path is invalid.",
|
|
264
|
+
MOLDEA_MIRROR_MISSING: "The declared mirror does not exist.",
|
|
265
|
+
MOLDEA_MIRROR_NOT_FILE: "The declared mirror is not a regular file.",
|
|
266
|
+
MOLDEA_MIRROR_STALE: "The declared mirror differs from its canonical instruction.",
|
|
267
|
+
MOLDEA_MIRROR_SYMLINK: "The declared mirror is a symlink.",
|
|
268
|
+
MOLDEA_PATH_DUPLICATE: "The path is duplicated.",
|
|
269
|
+
MOLDEA_PATH_INVALID: "The manifest logical path is invalid.",
|
|
270
|
+
MOLDEA_PATTERN_DUPLICATE: "The impact pattern is duplicated.",
|
|
271
|
+
MOLDEA_PROJECT_FILE_EMPTY: "The project file is empty.",
|
|
272
|
+
MOLDEA_PROJECT_FILE_MISSING: "The project file is missing.",
|
|
273
|
+
MOLDEA_REFERENCE_MISSING: "The referenced repository path does not exist.",
|
|
274
|
+
MOLDEA_REFERENCE_NOT_FILE: "The referenced repository path is not a regular file.",
|
|
275
|
+
MOLDEA_REFERENCE_SYMLINK: "The referenced repository path is a symlink.",
|
|
276
|
+
MOLDEA_RUNTIME_GUIDANCE_EMPTY: "The runtime guidance is empty.",
|
|
277
|
+
MOLDEA_RUNTIME_GUIDANCE_MISSING: "The referenced runtime guidance does not exist.",
|
|
278
|
+
MOLDEA_SKILL_IMPLEMENTATION_MISSING: "The registered skill implementation is missing.",
|
|
279
|
+
MOLDEA_SYMBOL_FORBIDDEN: "A canonical moldea reference must not include a symbol.",
|
|
280
|
+
MOLDEA_SYMBOL_INVALID: "The repository-reference symbol is invalid.",
|
|
281
|
+
MOLDEA_TEXT_EMPTY: "The required text document is empty.",
|
|
282
|
+
MOLDEA_TEXT_INVALID_UNICODE: "The text document contains an invalid Unicode scalar representation.",
|
|
283
|
+
MOLDEA_TEXT_INVALID_UTF8: "The text document is not valid UTF-8.",
|
|
284
|
+
MOLDEA_TEXT_NUL_FORBIDDEN: "The text document contains a forbidden NUL character.",
|
|
285
|
+
MOLDEA_TOOL_IMPLEMENTATION_MISSING: "The registered tool implementation is missing.",
|
|
286
|
+
MOLDEA_VARIABLE_ID_INVALID: "The runtime-variable ID is invalid.",
|
|
287
|
+
MOLDEA_VARIABLE_PLACEHOLDER_MALFORMED: "The agent instruction contains a malformed runtime-variable placeholder.",
|
|
288
|
+
MOLDEA_VARIABLE_PROVIDER_UNDECLARED: "A variable-provider binding exists for an undeclared variable.",
|
|
289
|
+
MOLDEA_VARIABLE_UNDECLARED: "The agent instruction references an undeclared runtime variable.",
|
|
290
|
+
MOLDEA_VARIABLE_UNUSED: "The declared runtime variable is unused by the agent instruction.",
|
|
291
|
+
MOLDEA_YAML_DUPLICATE_KEY: "The YAML document contains a duplicate mapping key.",
|
|
292
|
+
MOLDEA_YAML_FEATURE_UNSUPPORTED: "The YAML document uses an unsupported feature.",
|
|
293
|
+
MOLDEA_YAML_MALFORMED: "The YAML document is malformed.",
|
|
294
|
+
MOLDEA_YAML_MULTIPLE_DOCUMENTS: "The YAML stream contains more than one document."
|
|
295
|
+
};
|
|
296
|
+
var ENTITY_KEYS = [
|
|
297
|
+
"agentId",
|
|
298
|
+
"capabilityKind",
|
|
299
|
+
"capabilityId",
|
|
300
|
+
"decisionId",
|
|
301
|
+
"variableId",
|
|
302
|
+
"adapterId"
|
|
303
|
+
];
|
|
304
|
+
var CORE_DIAGNOSTIC_BUDGET = Symbol("core-diagnostic-budget");
|
|
305
|
+
/** Creates a detached limits view with one diagnostic budget for a complete Core operation. */
|
|
306
|
+
var createCoreOperationResourceLimits = (limits) => {
|
|
307
|
+
if (limits[CORE_DIAGNOSTIC_BUDGET] !== void 0) return limits;
|
|
308
|
+
return Object.freeze({
|
|
309
|
+
...limits,
|
|
310
|
+
[CORE_DIAGNOSTIC_BUDGET]: { count: 0 }
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
/** Registers raw diagnostics against the shared operation budget before normalization. */
|
|
314
|
+
var registerCoreDiagnosticCandidates = (limits, amount, operation, fallbackCount = 0, adapterId) => {
|
|
315
|
+
const budget = limits[CORE_DIAGNOSTIC_BUDGET];
|
|
316
|
+
const currentCount = budget?.count ?? fallbackCount;
|
|
317
|
+
if (amount > limits.maxDiagnostics - currentCount) throw new CoreOperationException({
|
|
318
|
+
...adapterId === void 0 ? {} : { adapterId },
|
|
319
|
+
code: "RESOURCE_LIMIT_EXCEEDED",
|
|
320
|
+
limit: "maxDiagnostics",
|
|
321
|
+
limitMaximum: limits.maxDiagnostics,
|
|
322
|
+
nextAction: "reduce-input-or-increase-limit",
|
|
323
|
+
observedUsage: currentCount + amount,
|
|
324
|
+
operation
|
|
325
|
+
});
|
|
326
|
+
if (budget !== void 0) budget.count += amount;
|
|
327
|
+
return fallbackCount + amount;
|
|
328
|
+
};
|
|
329
|
+
var compareNullableStrings = (left, right) => {
|
|
330
|
+
if (left === null) return right === null ? 0 : -1;
|
|
331
|
+
return right === null ? 1 : compareExactStrings(left, right);
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* Normalizes trusted JSON-scalar diagnostic metadata.
|
|
335
|
+
* @param details The optional detached metadata record.
|
|
336
|
+
* @returns A frozen null-prototype record with canonical key order.
|
|
337
|
+
*/
|
|
338
|
+
var normalizeDiagnosticDetails = (details) => {
|
|
339
|
+
return freezeRecursively(createNullPrototypeRecord(Object.entries(details ?? {}).sort(([left], [right]) => compareExactStrings(left, right)).map(([key, value]) => [key, typeof value === "number" && Object.is(value, -0) ? 0 : value])));
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Normalizes a trusted diagnostic entity into canonical key order.
|
|
343
|
+
* @param entity The optional diagnostic entity.
|
|
344
|
+
* @returns The frozen normalized entity or `null`.
|
|
345
|
+
*/
|
|
346
|
+
var normalizeDiagnosticEntity = (entity) => {
|
|
347
|
+
if (entity === void 0 || entity === null) return null;
|
|
348
|
+
return freezeRecursively(createNullPrototypeRecord(ENTITY_KEYS.flatMap((key) => {
|
|
349
|
+
const value = entity[key];
|
|
350
|
+
return value === void 0 ? [] : [[key, value]];
|
|
351
|
+
})));
|
|
352
|
+
};
|
|
353
|
+
/** Serializes unordered diagnostic details with explicit exact-code-point key ordering. */
|
|
354
|
+
var serializeDiagnosticDetails = (details) => {
|
|
355
|
+
const entries = Object.entries(details).sort(([left], [right]) => compareExactStrings(left, right));
|
|
356
|
+
return JSON.stringify(entries);
|
|
357
|
+
};
|
|
358
|
+
var serializeDiagnostic = (diagnostic) => {
|
|
359
|
+
const entity = diagnostic.entity === null ? null : ENTITY_KEYS.map((key) => [key, diagnostic.entity?.[key] ?? null]);
|
|
360
|
+
const range = diagnostic.range === null ? null : [
|
|
361
|
+
diagnostic.range.start.line,
|
|
362
|
+
diagnostic.range.start.column,
|
|
363
|
+
diagnostic.range.start.offset,
|
|
364
|
+
diagnostic.range.end.line,
|
|
365
|
+
diagnostic.range.end.column,
|
|
366
|
+
diagnostic.range.end.offset
|
|
367
|
+
];
|
|
368
|
+
return JSON.stringify([
|
|
369
|
+
diagnostic.code,
|
|
370
|
+
diagnostic.severity,
|
|
371
|
+
serializeDiagnosticDetails(diagnostic.details),
|
|
372
|
+
entity,
|
|
373
|
+
diagnostic.message,
|
|
374
|
+
diagnostic.path,
|
|
375
|
+
diagnostic.pointer,
|
|
376
|
+
range,
|
|
377
|
+
diagnostic.source
|
|
378
|
+
]);
|
|
379
|
+
};
|
|
380
|
+
var compareRanges = (left, right) => {
|
|
381
|
+
if (left === null) return right === null ? 0 : -1;
|
|
382
|
+
if (right === null) return 1;
|
|
383
|
+
return left.start.line - right.start.line || left.start.column - right.start.column || left.start.offset - right.start.offset || left.end.line - right.end.line || left.end.column - right.end.column || left.end.offset - right.end.offset;
|
|
384
|
+
};
|
|
385
|
+
var readEntityValue = (entity, key) => {
|
|
386
|
+
return entity?.[key] ?? "";
|
|
387
|
+
};
|
|
388
|
+
var compareDiagnostics = (left, right) => {
|
|
389
|
+
return compareNullableStrings(left.path, right.path) || compareRanges(left.range, right.range) || compareNullableStrings(left.pointer, right.pointer) || compareExactStrings(left.source, right.source) || compareExactStrings(left.code, right.code) || compareExactStrings(left.severity, right.severity) || compareExactStrings(readEntityValue(left.entity, "agentId"), readEntityValue(right.entity, "agentId")) || compareExactStrings(readEntityValue(left.entity, "capabilityKind"), readEntityValue(right.entity, "capabilityKind")) || compareExactStrings(readEntityValue(left.entity, "capabilityId"), readEntityValue(right.entity, "capabilityId")) || compareExactStrings(readEntityValue(left.entity, "decisionId"), readEntityValue(right.entity, "decisionId")) || compareExactStrings(readEntityValue(left.entity, "variableId"), readEntityValue(right.entity, "variableId")) || compareExactStrings(readEntityValue(left.entity, "adapterId"), readEntityValue(right.entity, "adapterId")) || compareExactStrings(serializeDiagnosticDetails(left.details), serializeDiagnosticDetails(right.details)) || compareExactStrings(left.message, right.message);
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* Creates one normalized, immutable Core diagnostic.
|
|
393
|
+
* @param input The trusted Core-owned diagnostic fields to normalize.
|
|
394
|
+
* @returns A deeply immutable public diagnostic value.
|
|
395
|
+
*/
|
|
396
|
+
var createCoreDiagnostic = (input) => {
|
|
397
|
+
const message = CORE_DIAGNOSTIC_MESSAGES[input.code];
|
|
398
|
+
if (message === void 0) throw new TypeError("The requested Core diagnostic is not implemented.");
|
|
399
|
+
return freezeRecursively({
|
|
400
|
+
code: input.code,
|
|
401
|
+
details: normalizeDiagnosticDetails(input.details),
|
|
402
|
+
entity: normalizeDiagnosticEntity(input.entity),
|
|
403
|
+
message,
|
|
404
|
+
path: input.path,
|
|
405
|
+
pointer: input.pointer ?? null,
|
|
406
|
+
range: input.range ?? null,
|
|
407
|
+
severity: "error",
|
|
408
|
+
source: "core"
|
|
409
|
+
});
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* Deduplicates and sorts already-normalized Core and adapter diagnostics.
|
|
413
|
+
* @param candidates The immutable diagnostics to combine.
|
|
414
|
+
* @returns A frozen deterministic diagnostic collection.
|
|
415
|
+
*/
|
|
416
|
+
var normalizeDiagnostics = (candidates) => {
|
|
417
|
+
const diagnostics = /* @__PURE__ */ new Map();
|
|
418
|
+
for (const diagnostic of candidates) {
|
|
419
|
+
const key = serializeDiagnostic(diagnostic);
|
|
420
|
+
if (diagnostics.has(key)) continue;
|
|
421
|
+
diagnostics.set(key, diagnostic);
|
|
422
|
+
}
|
|
423
|
+
return freezeRecursively([...diagnostics.values()].sort(compareDiagnostics));
|
|
424
|
+
};
|
|
425
|
+
/** Counts the complete normalized diagnostic result by severity once. */
|
|
426
|
+
var countDiagnosticsBySeverity = (diagnostics) => {
|
|
427
|
+
let errorCount = 0;
|
|
428
|
+
let warningCount = 0;
|
|
429
|
+
for (const diagnostic of diagnostics) if (diagnostic.severity === "error") errorCount += 1;
|
|
430
|
+
else warningCount += 1;
|
|
431
|
+
return {
|
|
432
|
+
errorCount,
|
|
433
|
+
warningCount
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* Creates a deterministic, deduplicating diagnostic collector for one operation.
|
|
438
|
+
* @param limits The Core resource limits governing diagnostic output.
|
|
439
|
+
* @param operation The operation reported by resource failures.
|
|
440
|
+
* @returns A collector that freezes and sorts its final diagnostic array.
|
|
441
|
+
*/
|
|
442
|
+
var createCoreDiagnosticCollector = (limits, operation) => {
|
|
443
|
+
const diagnostics = /* @__PURE__ */ new Map();
|
|
444
|
+
let proposalCount = 0;
|
|
445
|
+
let fallbackRawCount = 0;
|
|
446
|
+
const retain = (input) => {
|
|
447
|
+
const diagnostic = createCoreDiagnostic(input);
|
|
448
|
+
const key = serializeDiagnostic(diagnostic);
|
|
449
|
+
proposalCount += 1;
|
|
450
|
+
if (!diagnostics.has(key)) diagnostics.set(key, diagnostic);
|
|
451
|
+
};
|
|
452
|
+
return {
|
|
453
|
+
add: (input) => {
|
|
454
|
+
fallbackRawCount = registerCoreDiagnosticCandidates(limits, 1, operation, fallbackRawCount);
|
|
455
|
+
retain(input);
|
|
456
|
+
},
|
|
457
|
+
merge: retain,
|
|
458
|
+
finalize: () => normalizeDiagnostics([...diagnostics.values()]),
|
|
459
|
+
get size() {
|
|
460
|
+
return proposalCount;
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* Escapes one JSON Pointer reference token.
|
|
466
|
+
* @param value The decoded mapping key or array index token.
|
|
467
|
+
* @returns The RFC 6901 escaped token.
|
|
468
|
+
*/
|
|
469
|
+
var escapeJsonPointerSegment = (value) => {
|
|
470
|
+
return value.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
471
|
+
};
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/options/index.ts
|
|
474
|
+
/** Creates an operation-local options view with one shared raw-diagnostic budget. */
|
|
475
|
+
var createCoreOperationOptionsSnapshot = (options) => {
|
|
476
|
+
return Object.freeze({
|
|
477
|
+
adapters: options.adapters,
|
|
478
|
+
limits: createCoreOperationResourceLimits(options.limits)
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
var RESOURCE_LIMIT_KEYS = [
|
|
482
|
+
"maxEntries",
|
|
483
|
+
"maxTotalBytesRead",
|
|
484
|
+
"maxFileBytes",
|
|
485
|
+
"maxManifestBytes",
|
|
486
|
+
"maxRetainedBytes",
|
|
487
|
+
"maxDiagnostics",
|
|
488
|
+
"maxEvidence"
|
|
489
|
+
];
|
|
490
|
+
var STABLE_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
491
|
+
var WINDOWS_RESERVED_ID_PATTERN = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])$/u;
|
|
492
|
+
var compareStrings = (left, right) => {
|
|
493
|
+
if (left < right) return -1;
|
|
494
|
+
if (left > right) return 1;
|
|
495
|
+
return 0;
|
|
496
|
+
};
|
|
497
|
+
var invalidAdapter = (adapterId) => {
|
|
498
|
+
throw new CoreConfigurationException({
|
|
499
|
+
...adapterId === void 0 ? {} : { adapterId },
|
|
500
|
+
code: "INVALID_ADAPTER_DEFINITION",
|
|
501
|
+
operation: "create-core"
|
|
502
|
+
});
|
|
503
|
+
};
|
|
504
|
+
var isRecord = (value) => {
|
|
505
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
506
|
+
};
|
|
507
|
+
var isStableId = (value) => {
|
|
508
|
+
return value.length >= 1 && value.length <= 64 && STABLE_ID_PATTERN.test(value);
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* Validates, copies, fills, and freezes all configured resource limits.
|
|
512
|
+
* @param candidate The untrusted optional limit overrides.
|
|
513
|
+
* @returns The complete frozen resource limits.
|
|
514
|
+
* @throws
|
|
515
|
+
* - INVALID_RESOURCE_LIMIT: A Core resource limit is invalid.
|
|
516
|
+
*/
|
|
517
|
+
var normalizeLimits = (candidate) => {
|
|
518
|
+
if (candidate === void 0) return DEFAULT_CORE_RESOURCE_LIMITS;
|
|
519
|
+
if (!isRecord(candidate)) throw new CoreConfigurationException({
|
|
520
|
+
code: "INVALID_RESOURCE_LIMIT",
|
|
521
|
+
operation: "create-core"
|
|
522
|
+
});
|
|
523
|
+
const knownKeys = new Set(RESOURCE_LIMIT_KEYS);
|
|
524
|
+
if (Object.keys(candidate).some((key) => !knownKeys.has(key))) throw new CoreConfigurationException({
|
|
525
|
+
code: "INVALID_RESOURCE_LIMIT",
|
|
526
|
+
operation: "create-core"
|
|
527
|
+
});
|
|
528
|
+
const normalized = { ...DEFAULT_CORE_RESOURCE_LIMITS };
|
|
529
|
+
for (const key of RESOURCE_LIMIT_KEYS) {
|
|
530
|
+
const value = candidate[key];
|
|
531
|
+
if (value === void 0) continue;
|
|
532
|
+
if (!Number.isSafeInteger(value) || value <= 0) throw new CoreConfigurationException({
|
|
533
|
+
code: "INVALID_RESOURCE_LIMIT",
|
|
534
|
+
operation: "create-core"
|
|
535
|
+
});
|
|
536
|
+
normalized[key] = value;
|
|
537
|
+
}
|
|
538
|
+
return freezeRecursively(normalized);
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* Snapshots one adapter definition without freezing caller-owned state.
|
|
542
|
+
* @param candidate The untrusted adapter definition.
|
|
543
|
+
* @returns A frozen detached adapter snapshot.
|
|
544
|
+
* @throws
|
|
545
|
+
* - RESERVED_ADAPTER_ID: A reserved runtime adapter ID was supplied.
|
|
546
|
+
* - INVALID_ADAPTER_DEFINITION: A runtime adapter definition is invalid.
|
|
547
|
+
*/
|
|
548
|
+
var normalizeAdapter = (candidate) => {
|
|
549
|
+
if (!isRecord(candidate)) return invalidAdapter();
|
|
550
|
+
const id = candidate["id"];
|
|
551
|
+
if (typeof id !== "string" || !isStableId(id) || WINDOWS_RESERVED_ID_PATTERN.test(id)) return invalidAdapter();
|
|
552
|
+
if (id === "custom") throw new CoreConfigurationException({
|
|
553
|
+
adapterId: id,
|
|
554
|
+
code: "RESERVED_ADAPTER_ID",
|
|
555
|
+
operation: "create-core"
|
|
556
|
+
});
|
|
557
|
+
if (!RECOGNIZED_RUNTIME_ADAPTER_IDS.includes(id)) return invalidAdapter(id);
|
|
558
|
+
const versions = candidate["supportedRepositoryFormatVersions"];
|
|
559
|
+
const inspect = candidate["inspect"];
|
|
560
|
+
if (!Array.isArray(versions) || versions.length === 0 || typeof inspect !== "function") return invalidAdapter(id);
|
|
561
|
+
const supportedVersions = /* @__PURE__ */ new Set();
|
|
562
|
+
for (const version of versions) {
|
|
563
|
+
if (!SUPPORTED_REPOSITORY_FORMAT_VERSIONS.includes(version) || supportedVersions.has(version)) return invalidAdapter(id);
|
|
564
|
+
supportedVersions.add(version);
|
|
565
|
+
}
|
|
566
|
+
const inspectReference = inspect;
|
|
567
|
+
return freezeRecursively({
|
|
568
|
+
id,
|
|
569
|
+
inspect: async (context) => inspectReference.call(candidate, context),
|
|
570
|
+
supportedRepositoryFormatVersions: [...supportedVersions].sort((left, right) => left - right)
|
|
571
|
+
});
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
574
|
+
* Validates, snapshots, and deterministically sorts the configured adapter registry.
|
|
575
|
+
* @param candidate The untrusted optional adapter definitions.
|
|
576
|
+
* @returns The frozen adapter snapshots in canonical ID order.
|
|
577
|
+
* @throws
|
|
578
|
+
* - DUPLICATE_ADAPTER_ID: A runtime adapter ID is registered more than once.
|
|
579
|
+
* - RESERVED_ADAPTER_ID: A reserved runtime adapter ID was supplied.
|
|
580
|
+
* - INVALID_ADAPTER_DEFINITION: A runtime adapter definition is invalid.
|
|
581
|
+
*/
|
|
582
|
+
var normalizeAdapters = (candidate) => {
|
|
583
|
+
if (candidate === void 0) return Object.freeze([]);
|
|
584
|
+
if (!Array.isArray(candidate)) return invalidAdapter();
|
|
585
|
+
const adapters = Array.from(candidate, (adapter) => normalizeAdapter(adapter));
|
|
586
|
+
const ids = /* @__PURE__ */ new Set();
|
|
587
|
+
for (const adapter of adapters) {
|
|
588
|
+
if (ids.has(adapter.id)) throw new CoreConfigurationException({
|
|
589
|
+
adapterId: adapter.id,
|
|
590
|
+
code: "DUPLICATE_ADAPTER_ID",
|
|
591
|
+
operation: "create-core"
|
|
592
|
+
});
|
|
593
|
+
ids.add(adapter.id);
|
|
594
|
+
}
|
|
595
|
+
return freezeRecursively(adapters.sort((left, right) => compareStrings(left.id, right.id)));
|
|
596
|
+
};
|
|
597
|
+
/**
|
|
598
|
+
* Validates and snapshots caller-owned Core construction options.
|
|
599
|
+
* @param options The optional adapters and resource-limit overrides.
|
|
600
|
+
* @returns A deeply frozen, deterministically ordered configuration snapshot.
|
|
601
|
+
* @throws
|
|
602
|
+
* - DUPLICATE_ADAPTER_ID: A runtime adapter ID is registered more than once.
|
|
603
|
+
* - RESERVED_ADAPTER_ID: A reserved runtime adapter ID was supplied.
|
|
604
|
+
* - INVALID_ADAPTER_DEFINITION: A runtime adapter definition is invalid.
|
|
605
|
+
* - INVALID_RESOURCE_LIMIT: A Core resource limit is invalid.
|
|
606
|
+
*/
|
|
607
|
+
var normalizeCoreOptions = (options) => {
|
|
608
|
+
if (options !== void 0 && !isRecord(options)) return invalidAdapter();
|
|
609
|
+
return freezeRecursively({
|
|
610
|
+
adapters: normalizeAdapters(options?.["adapters"]),
|
|
611
|
+
limits: normalizeLimits(options?.["limits"])
|
|
612
|
+
});
|
|
613
|
+
};
|
|
614
|
+
//#endregion
|
|
615
|
+
export { parseDecisionIdFromPath as A, isRepositorySymbol as C, isStableId$1 as D, isSimpleGlob as E, freezeRecursively as F, DEFAULT_CORE_RESOURCE_LIMITS as I, RECOGNIZED_RUNTIME_ADAPTER_IDS as L, sortRepositoryReferences as M, trimRepositoryFormatWhitespace as N, isUnicodeScalarText as O, createNullPrototypeRecord as P, SUPPORTED_REPOSITORY_FORMAT_VERSIONS as R, isNonEmptySingleLine as S, isRuntimeGuidancePath as T, isCanonicalMoldeaPath as _, escapeJsonPointerSegment as a, isDecisionPath as b, normalizeDiagnostics as c, compareExactStrings as d, countUnicodeScalars as f, isCanonicalManifestPath as g, hasUnsupportedGlobMetacharacter as h, createCoreDiagnosticCollector as i, parseManifestPath as j, isVariableId as k, registerCoreDiagnosticCandidates as l, hasSurroundingWhitespace as m, normalizeCoreOptions as n, normalizeDiagnosticDetails as o, hasNonWhitespace as p, countDiagnosticsBySeverity as r, normalizeDiagnosticEntity as s, createCoreOperationOptionsSnapshot as t, serializeDiagnosticDetails as u, isCapabilityDescription as v, isReservedId as w, isMirrorPath as x, isContextPath as y };
|
|
616
|
+
|
|
617
|
+
//# sourceMappingURL=options-CxCT3dZU.js.map
|