@contentful/experience-design-system-cli 2.40.1-dev-build-54dd0c33.0 → 2.40.1-dev-build-1691fb91.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/dist/app.js +600 -588
- package/dist/index.js +637 -588
- package/dist/package.json +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -4,8 +4,8 @@ var __esm = (fn, res) => function __init() {
|
|
|
4
4
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
5
|
};
|
|
6
6
|
var __export = (target, all) => {
|
|
7
|
-
for (var
|
|
8
|
-
__defProp(target,
|
|
7
|
+
for (var name2 in all)
|
|
8
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
// packages/experience-design-system-cli/src/tui/package-root.ts
|
|
@@ -165,7 +165,7 @@ async function pruneExpiredLogs(base, retentionDays, now = Date.now()) {
|
|
|
165
165
|
const contentfulDir = join4(base, ".contentful");
|
|
166
166
|
const result = { logs: 0, folders: 0 };
|
|
167
167
|
try {
|
|
168
|
-
const sessions = (await readdir(contentfulDir)).filter((
|
|
168
|
+
const sessions = (await readdir(contentfulDir)).filter((name2) => SESSION_FOLDER.test(name2));
|
|
169
169
|
for (const session of sessions) {
|
|
170
170
|
const files = await logFilesIn(join4(contentfulDir, session, "debug")).catch(() => []);
|
|
171
171
|
for (const file of files) {
|
|
@@ -721,8 +721,8 @@ var init_extract_sentinel_output = __esm({
|
|
|
721
721
|
});
|
|
722
722
|
|
|
723
723
|
// packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js
|
|
724
|
-
function formatGenerateProgressLine(done, total,
|
|
725
|
-
return `progress=generate:${done}/${total}:${
|
|
724
|
+
function formatGenerateProgressLine(done, total, name2) {
|
|
725
|
+
return `progress=generate:${done}/${total}:${name2}`;
|
|
726
726
|
}
|
|
727
727
|
var init_format_generate_progress_line = __esm({
|
|
728
728
|
"packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js"() {
|
|
@@ -1408,14 +1408,14 @@ function formatToolCall(obj) {
|
|
|
1408
1408
|
return ` ${ansi.cyan("\u25C8")} ${slot}${req} ${ansi.dim(desc)}`;
|
|
1409
1409
|
}
|
|
1410
1410
|
case "select_component": {
|
|
1411
|
-
const
|
|
1411
|
+
const name2 = String(obj["name"] ?? "");
|
|
1412
1412
|
const reason = typeof obj["reason"] === "string" ? obj["reason"] : "";
|
|
1413
|
-
return ` ${ansi.green("+")} ${
|
|
1413
|
+
return ` ${ansi.green("+")} ${name2} ${ansi.dim(reason)}`;
|
|
1414
1414
|
}
|
|
1415
1415
|
case "reject_component": {
|
|
1416
|
-
const
|
|
1416
|
+
const name2 = String(obj["name"] ?? "");
|
|
1417
1417
|
const reason = typeof obj["reason"] === "string" ? obj["reason"] : "";
|
|
1418
|
-
return ` ${ansi.dim("\u2013")} ${
|
|
1418
|
+
return ` ${ansi.dim("\u2013")} ${name2} ${ansi.dim(reason)}`;
|
|
1419
1419
|
}
|
|
1420
1420
|
default:
|
|
1421
1421
|
return null;
|
|
@@ -3573,17 +3573,17 @@ var TRUNCATED_MARKER = "/* truncated */";
|
|
|
3573
3573
|
function escapeForRegExp(value) {
|
|
3574
3574
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3575
3575
|
}
|
|
3576
|
-
function identifierPattern(
|
|
3577
|
-
return new RegExp(`(?<![A-Za-z0-9_$])${escapeForRegExp(
|
|
3576
|
+
function identifierPattern(name2) {
|
|
3577
|
+
return new RegExp(`(?<![A-Za-z0-9_$])${escapeForRegExp(name2)}(?![A-Za-z0-9_$])`);
|
|
3578
3578
|
}
|
|
3579
3579
|
function excerptAroundNames(text, names, maxChars, contextLines = 6) {
|
|
3580
3580
|
if (text.length <= maxChars)
|
|
3581
3581
|
return { content: text, usesNotShown: [] };
|
|
3582
|
-
const patterns = names.filter((
|
|
3582
|
+
const patterns = names.filter((name2) => name2.length > 0).map((name2) => ({ name: name2, pattern: identifierPattern(name2) }));
|
|
3583
3583
|
const lines = text.split("\n");
|
|
3584
3584
|
const windows = [];
|
|
3585
3585
|
lines.forEach((line, index) => {
|
|
3586
|
-
const mentioned = patterns.filter(({ pattern }) => pattern.test(line)).map(({ name }) =>
|
|
3586
|
+
const mentioned = patterns.filter(({ pattern }) => pattern.test(line)).map(({ name: name2 }) => name2);
|
|
3587
3587
|
if (mentioned.length === 0)
|
|
3588
3588
|
return;
|
|
3589
3589
|
const start = Math.max(0, index - contextLines);
|
|
@@ -3591,8 +3591,8 @@ function excerptAroundNames(text, names, maxChars, contextLines = 6) {
|
|
|
3591
3591
|
const last = windows[windows.length - 1];
|
|
3592
3592
|
if (last && start <= last.end + 1) {
|
|
3593
3593
|
last.end = Math.max(last.end, end);
|
|
3594
|
-
for (const
|
|
3595
|
-
last.names.add(
|
|
3594
|
+
for (const name2 of mentioned)
|
|
3595
|
+
last.names.add(name2);
|
|
3596
3596
|
} else {
|
|
3597
3597
|
windows.push({ start, end, names: new Set(mentioned) });
|
|
3598
3598
|
}
|
|
@@ -3603,8 +3603,8 @@ ${TRUNCATED_MARKER}`, usesNotShown: [] };
|
|
|
3603
3603
|
}
|
|
3604
3604
|
const lastWindowFor = /* @__PURE__ */ new Map();
|
|
3605
3605
|
for (const window of windows)
|
|
3606
|
-
for (const
|
|
3607
|
-
lastWindowFor.set(
|
|
3606
|
+
for (const name2 of window.names)
|
|
3607
|
+
lastWindowFor.set(name2, window);
|
|
3608
3608
|
const kept = [];
|
|
3609
3609
|
const cut = /* @__PURE__ */ new Set();
|
|
3610
3610
|
let used = 0;
|
|
@@ -3618,15 +3618,15 @@ ${ELLIPSIS_MARKER}
|
|
|
3618
3618
|
const head = chunk.slice(0, maxChars);
|
|
3619
3619
|
kept.push({ window, text: head });
|
|
3620
3620
|
used += head.length;
|
|
3621
|
-
for (const
|
|
3622
|
-
if (lastWindowFor.get(
|
|
3623
|
-
cut.add(
|
|
3621
|
+
for (const name2 of window.names) {
|
|
3622
|
+
if (lastWindowFor.get(name2) === window && !identifierPattern(name2).test(head))
|
|
3623
|
+
cut.add(name2);
|
|
3624
3624
|
}
|
|
3625
3625
|
continue;
|
|
3626
3626
|
}
|
|
3627
|
-
for (const
|
|
3628
|
-
if (lastWindowFor.get(
|
|
3629
|
-
cut.add(
|
|
3627
|
+
for (const name2 of window.names) {
|
|
3628
|
+
if (lastWindowFor.get(name2) === window)
|
|
3629
|
+
cut.add(name2);
|
|
3630
3630
|
}
|
|
3631
3631
|
continue;
|
|
3632
3632
|
}
|
|
@@ -3637,15 +3637,15 @@ ${ELLIPSIS_MARKER}
|
|
|
3637
3637
|
const parts = kept.map((entry, index) => (index > 0 ? `
|
|
3638
3638
|
${ELLIPSIS_MARKER}
|
|
3639
3639
|
` : "") + entry.text);
|
|
3640
|
-
const usesNotShown = names.filter((
|
|
3640
|
+
const usesNotShown = names.filter((name2, index) => cut.has(name2) && names.indexOf(name2) === index);
|
|
3641
3641
|
return { content: `${parts.join("")}
|
|
3642
3642
|
${TRUNCATED_MARKER}`, usesNotShown };
|
|
3643
3643
|
}
|
|
3644
3644
|
|
|
3645
3645
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/components/derive-component-id.js
|
|
3646
3646
|
import { createHash } from "node:crypto";
|
|
3647
|
-
function deriveComponentId(
|
|
3648
|
-
return createHash("sha256").update(`${
|
|
3647
|
+
function deriveComponentId(name2, source) {
|
|
3648
|
+
return createHash("sha256").update(`${name2}:${source}`).digest("hex").slice(0, 12);
|
|
3649
3649
|
}
|
|
3650
3650
|
|
|
3651
3651
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/cdf/cdf-mappers.js
|
|
@@ -3713,8 +3713,8 @@ function getLatestCompletedSessionForCommand(db, command) {
|
|
|
3713
3713
|
}
|
|
3714
3714
|
|
|
3715
3715
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/sessions/write.js
|
|
3716
|
-
function createSession(db, id,
|
|
3717
|
-
db.prepare("INSERT INTO sessions (id, name, created_at, updated_at) VALUES (?, ?, ?, ?)").run(id,
|
|
3716
|
+
function createSession(db, id, name2, timestamp) {
|
|
3717
|
+
db.prepare("INSERT INTO sessions (id, name, created_at, updated_at) VALUES (?, ?, ?, ?)").run(id, name2, timestamp, timestamp);
|
|
3718
3718
|
}
|
|
3719
3719
|
function updateSessionTimestamp(db, sessionId, timestamp) {
|
|
3720
3720
|
db.prepare("UPDATE sessions SET updated_at = ? WHERE id = ?").run(timestamp, sessionId);
|
|
@@ -4996,7 +4996,7 @@ function identifiersIn(propTypes) {
|
|
|
4996
4996
|
return [...names];
|
|
4997
4997
|
}
|
|
4998
4998
|
function declaresAnyType(text, typeNames) {
|
|
4999
|
-
return typeNames.some((
|
|
4999
|
+
return typeNames.some((name2) => new RegExp(`\\b(?:type|interface|enum|const|class)\\s+${escapeForRegExp(name2)}\\b`).test(text));
|
|
5000
5000
|
}
|
|
5001
5001
|
function extractRelativeImportPaths(sourceText) {
|
|
5002
5002
|
const specifiers = /* @__PURE__ */ new Set();
|
|
@@ -5061,7 +5061,7 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
5061
5061
|
frontier = nextFrontier;
|
|
5062
5062
|
}
|
|
5063
5063
|
const inHand = [sourceText, ...discovered.map((d) => d.content)];
|
|
5064
|
-
const declaredTypeNames = candidateTypeNames.filter((
|
|
5064
|
+
const declaredTypeNames = candidateTypeNames.filter((name2) => inHand.some((text) => declaresAnyType(text, [name2])));
|
|
5065
5065
|
const usesNotShown = /* @__PURE__ */ new Set();
|
|
5066
5066
|
const searchNames = [.../* @__PURE__ */ new Set([...propNames, ...declaredTypeNames])];
|
|
5067
5067
|
let enlarged = 0;
|
|
@@ -5071,19 +5071,19 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
5071
5071
|
enlarged++;
|
|
5072
5072
|
const budget = enlarge ? MAX_TYPE_DECLARING_SIBLING_CHARS : MAX_SIBLING_SNIPPET_CHARS;
|
|
5073
5073
|
const excerpt = excerptAroundNames(d.content, searchNames, budget);
|
|
5074
|
-
for (const
|
|
5075
|
-
usesNotShown.add(
|
|
5074
|
+
for (const name2 of excerpt.usesNotShown)
|
|
5075
|
+
usesNotShown.add(name2);
|
|
5076
5076
|
return { path: d.path, content: excerpt.content };
|
|
5077
5077
|
});
|
|
5078
5078
|
const truncatedCount = Math.max(0, discovered.length - MAX_SIBLING_FILES);
|
|
5079
5079
|
return {
|
|
5080
5080
|
siblings,
|
|
5081
5081
|
truncatedCount,
|
|
5082
|
-
usesNotShown: propNames.filter((
|
|
5082
|
+
usesNotShown: propNames.filter((name2) => usesNotShown.has(name2)),
|
|
5083
5083
|
declaredTypeNames
|
|
5084
5084
|
};
|
|
5085
5085
|
}
|
|
5086
|
-
async function loadComponentSourceRef(
|
|
5086
|
+
async function loadComponentSourceRef(name2, sourcePath, propNames = [], propTypes = []) {
|
|
5087
5087
|
let content = null;
|
|
5088
5088
|
let siblingFiles = [];
|
|
5089
5089
|
let truncatedSiblingCount = 0;
|
|
@@ -5100,18 +5100,18 @@ async function loadComponentSourceRef(name, sourcePath, propNames = [], propType
|
|
|
5100
5100
|
} = await loadSiblingFiles(rawText, sourcePath, propNames, identifiersIn(propTypes)));
|
|
5101
5101
|
const mainExcerpt = excerptAroundNames(rawText, [.../* @__PURE__ */ new Set([...propNames, ...declaredTypeNames])], MAX_COMPONENT_SOURCE_CHARS);
|
|
5102
5102
|
content = mainExcerpt.content;
|
|
5103
|
-
for (const
|
|
5104
|
-
usesNotShown.add(
|
|
5105
|
-
for (const
|
|
5106
|
-
usesNotShown.add(
|
|
5103
|
+
for (const name3 of mainExcerpt.usesNotShown)
|
|
5104
|
+
usesNotShown.add(name3);
|
|
5105
|
+
for (const name3 of siblingUsesNotShown)
|
|
5106
|
+
usesNotShown.add(name3);
|
|
5107
5107
|
} catch {
|
|
5108
5108
|
}
|
|
5109
|
-
const ref = { component:
|
|
5109
|
+
const ref = { component: name2, sourcePath, content };
|
|
5110
5110
|
if (siblingFiles.length > 0)
|
|
5111
5111
|
ref.siblingFiles = siblingFiles;
|
|
5112
5112
|
if (truncatedSiblingCount > 0)
|
|
5113
5113
|
ref.truncatedSiblingCount = truncatedSiblingCount;
|
|
5114
|
-
const notShown = propNames.filter((
|
|
5114
|
+
const notShown = propNames.filter((name3) => usesNotShown.has(name3));
|
|
5115
5115
|
if (notShown.length > 0)
|
|
5116
5116
|
ref.usesNotShown = notShown;
|
|
5117
5117
|
return ref;
|
|
@@ -5264,7 +5264,7 @@ function loadCDFComponents(db, sessionId) {
|
|
|
5264
5264
|
const allowedComponentsBySlot = indexRowsByKey(allowedComponents, (ac) => `${ac.component_id}::${ac.slot_name}`);
|
|
5265
5265
|
const tokenPathsByProp = indexRowsByKey(tokenPaths, (t) => `${t.component_id}::${t.prop_name}`);
|
|
5266
5266
|
const toTokenPaths = (rows) => rows === void 0 ? void 0 : rows.map((r) => r.path);
|
|
5267
|
-
return components.map(({ component_id, name, description }) => {
|
|
5267
|
+
return components.map(({ component_id, name: name2, description }) => {
|
|
5268
5268
|
const compProps = propsByComponent.get(component_id) ?? [];
|
|
5269
5269
|
const $properties = {};
|
|
5270
5270
|
for (const p of compProps) {
|
|
@@ -5321,7 +5321,7 @@ function loadCDFComponents(db, sessionId) {
|
|
|
5321
5321
|
entry.$description = description;
|
|
5322
5322
|
if (Object.keys($slots).length > 0)
|
|
5323
5323
|
entry.$slots = $slots;
|
|
5324
|
-
return { key:
|
|
5324
|
+
return { key: name2, entry };
|
|
5325
5325
|
});
|
|
5326
5326
|
}
|
|
5327
5327
|
function loadScopeComponents(db, sessionId) {
|
|
@@ -5910,29 +5910,29 @@ function extractTsxComponents(filePaths, componentFilePattern, extract) {
|
|
|
5910
5910
|
}
|
|
5911
5911
|
function resolveDefaultExportName(declarations, exported, allowVariableDeclaration = false) {
|
|
5912
5912
|
const declaration = declarations[0];
|
|
5913
|
-
const
|
|
5914
|
-
if (!
|
|
5913
|
+
const name2 = Node.isFunctionDeclaration(declaration) ? declaration.getName() : allowVariableDeclaration && Node.isVariableDeclaration(declaration) ? declaration.getName() : void 0;
|
|
5914
|
+
if (!name2 || !/^[A-Z]/.test(name2) || exported.has(name2))
|
|
5915
5915
|
return void 0;
|
|
5916
|
-
return
|
|
5916
|
+
return name2;
|
|
5917
5917
|
}
|
|
5918
5918
|
function getRenderableExports(sourceFile, exclusions, options) {
|
|
5919
5919
|
const renderable = [];
|
|
5920
5920
|
const exported = sourceFile.getExportedDeclarations();
|
|
5921
5921
|
for (const [exportKey, declarations] of exported) {
|
|
5922
|
-
const
|
|
5923
|
-
if (!
|
|
5922
|
+
const name2 = exportKey === "default" ? resolveDefaultExportName(declarations, exported, options.allowVariableDeclaration) : exportKey;
|
|
5923
|
+
if (!name2 || !/^[A-Z]/.test(name2))
|
|
5924
5924
|
continue;
|
|
5925
|
-
if (
|
|
5925
|
+
if (name2.startsWith("use")) {
|
|
5926
5926
|
exclusions.push({
|
|
5927
5927
|
itemType: "component",
|
|
5928
|
-
name,
|
|
5928
|
+
name: name2,
|
|
5929
5929
|
source: sourceFile.getFilePath(),
|
|
5930
5930
|
reason: options.hookReason,
|
|
5931
5931
|
stage: "component-filter"
|
|
5932
5932
|
});
|
|
5933
5933
|
continue;
|
|
5934
5934
|
}
|
|
5935
|
-
renderable.push({ name, declarations });
|
|
5935
|
+
renderable.push({ name: name2, declarations });
|
|
5936
5936
|
}
|
|
5937
5937
|
return renderable;
|
|
5938
5938
|
}
|
|
@@ -6315,7 +6315,7 @@ function extractProps(classDecl) {
|
|
|
6315
6315
|
for (const property of classDecl.getProperties()) {
|
|
6316
6316
|
if (!hasDecorator(property, "Prop"))
|
|
6317
6317
|
continue;
|
|
6318
|
-
const
|
|
6318
|
+
const name2 = property.getName();
|
|
6319
6319
|
const typeNode = property.getTypeNode();
|
|
6320
6320
|
const typeText = typeNode ? typeNode.getText() : "unknown";
|
|
6321
6321
|
const hasQuestionToken = property.hasQuestionToken();
|
|
@@ -6353,21 +6353,21 @@ function extractProps(classDecl) {
|
|
|
6353
6353
|
}
|
|
6354
6354
|
const allowedValues = extractAllowedValues2(typeText);
|
|
6355
6355
|
props.push({
|
|
6356
|
-
name,
|
|
6356
|
+
name: name2,
|
|
6357
6357
|
type: typeText,
|
|
6358
6358
|
required: isRequired,
|
|
6359
6359
|
...defaultValue !== void 0 && { defaultValue },
|
|
6360
6360
|
...description && { description },
|
|
6361
6361
|
...allowedValues && { allowedValues },
|
|
6362
|
-
...intrinsicDomAttributeProps.has(
|
|
6362
|
+
...intrinsicDomAttributeProps.has(name2) && { domAttribute: true },
|
|
6363
6363
|
sourceStartLine: property.getStartLineNumber(),
|
|
6364
6364
|
sourceEndLine: property.getEndLineNumber()
|
|
6365
6365
|
});
|
|
6366
6366
|
}
|
|
6367
6367
|
return props.sort((a, b) => a.name.localeCompare(b.name));
|
|
6368
6368
|
}
|
|
6369
|
-
function normalizeSlotName(
|
|
6370
|
-
const normalizedName =
|
|
6369
|
+
function normalizeSlotName(name2) {
|
|
6370
|
+
const normalizedName = name2 && name2.length > 0 ? name2 : "default";
|
|
6371
6371
|
return {
|
|
6372
6372
|
name: normalizedName,
|
|
6373
6373
|
isDefault: normalizedName === "default"
|
|
@@ -6437,9 +6437,9 @@ function extractSlots(classDecl, warnings, componentName) {
|
|
|
6437
6437
|
if (tagName === "slot") {
|
|
6438
6438
|
const nameAttribute = openingElement.getAttributes().find((attribute) => Node2.isJsxAttribute(attribute) && attribute.getNameNode().getText() === "name");
|
|
6439
6439
|
const initializer2 = Node2.isJsxAttribute(nameAttribute) ? nameAttribute.getInitializer() : void 0;
|
|
6440
|
-
const
|
|
6440
|
+
const name3 = initializer2 && Node2.isStringLiteral(initializer2) ? initializer2.getLiteralValue() : initializer2 && Node2.isJsxExpression(initializer2) ? initializer2.getExpression()?.getText() ?? "" : "";
|
|
6441
6441
|
upsertSlot({
|
|
6442
|
-
...normalizeSlotName(
|
|
6442
|
+
...normalizeSlotName(name3)
|
|
6443
6443
|
});
|
|
6444
6444
|
return;
|
|
6445
6445
|
}
|
|
@@ -6448,11 +6448,11 @@ function extractSlots(classDecl, warnings, componentName) {
|
|
|
6448
6448
|
const initializer = slotAttribute.getInitializer();
|
|
6449
6449
|
if (!initializer || !Node2.isStringLiteral(initializer))
|
|
6450
6450
|
return;
|
|
6451
|
-
const
|
|
6452
|
-
if (!
|
|
6451
|
+
const name2 = initializer.getLiteralValue();
|
|
6452
|
+
if (!name2)
|
|
6453
6453
|
return;
|
|
6454
6454
|
upsertSlot({
|
|
6455
|
-
name,
|
|
6455
|
+
name: name2,
|
|
6456
6456
|
isDefault: false
|
|
6457
6457
|
});
|
|
6458
6458
|
});
|
|
@@ -6474,15 +6474,15 @@ function extractFromSourceFile(sourceFile, warnings) {
|
|
|
6474
6474
|
const tag = getComponentTag(classDecl);
|
|
6475
6475
|
if (!tag)
|
|
6476
6476
|
continue;
|
|
6477
|
-
const
|
|
6477
|
+
const name2 = kebabToPascal(tag);
|
|
6478
6478
|
const props = extractProps(classDecl);
|
|
6479
|
-
const slots = extractSlots(classDecl, warnings,
|
|
6479
|
+
const slots = extractSlots(classDecl, warnings, name2);
|
|
6480
6480
|
const eventNames = detectEvents(classDecl);
|
|
6481
6481
|
if (eventNames.length > 0) {
|
|
6482
|
-
warnings.push(`Component ${
|
|
6482
|
+
warnings.push(`Component ${name2} has ${eventNames.length} events not captured: ${eventNames.join(", ")}`);
|
|
6483
6483
|
}
|
|
6484
6484
|
components.push({
|
|
6485
|
-
name,
|
|
6485
|
+
name: name2,
|
|
6486
6486
|
source: sourceFile.getFilePath(),
|
|
6487
6487
|
sourcePath: sourceFile.getFilePath(),
|
|
6488
6488
|
framework: "stencil",
|
|
@@ -6634,9 +6634,9 @@ function extractAllowedComponentsFromJsdoc(jsdocText, componentNames) {
|
|
|
6634
6634
|
return [];
|
|
6635
6635
|
const found = /* @__PURE__ */ new Set();
|
|
6636
6636
|
for (const raw of m[1].split(",")) {
|
|
6637
|
-
const
|
|
6638
|
-
if (
|
|
6639
|
-
found.add(
|
|
6637
|
+
const name2 = raw.trim();
|
|
6638
|
+
if (name2 && componentNames.has(name2))
|
|
6639
|
+
found.add(name2);
|
|
6640
6640
|
}
|
|
6641
6641
|
return [...found].sort();
|
|
6642
6642
|
}
|
|
@@ -6671,8 +6671,8 @@ function collectTypePredicateComponentReferences(sourceFile, ctx) {
|
|
|
6671
6671
|
const assertedTypeNode = returnTypeNode.getTypeNode();
|
|
6672
6672
|
if (!assertedTypeNode)
|
|
6673
6673
|
continue;
|
|
6674
|
-
for (const
|
|
6675
|
-
found.add(
|
|
6674
|
+
for (const name2 of extractAllowedComponentsFromTypeText(assertedTypeNode.getText(), ctx)) {
|
|
6675
|
+
found.add(name2);
|
|
6676
6676
|
}
|
|
6677
6677
|
}
|
|
6678
6678
|
return [...found].sort();
|
|
@@ -6691,13 +6691,13 @@ function collectRuntimeTypeCheckComponentReferences(sourceFile, componentNames)
|
|
|
6691
6691
|
return void 0;
|
|
6692
6692
|
if (!Node3.isIdentifier(otherSide) && !Node3.isPropertyAccessExpression(otherSide))
|
|
6693
6693
|
return void 0;
|
|
6694
|
-
const
|
|
6695
|
-
if (!
|
|
6694
|
+
const name2 = otherSide.getText().split(".").pop();
|
|
6695
|
+
if (!name2 || !componentNames.has(name2))
|
|
6696
6696
|
return void 0;
|
|
6697
6697
|
const baseIdentifier = Node3.isPropertyAccessExpression(otherSide) ? otherSide.getExpression() : otherSide;
|
|
6698
6698
|
if (!Node3.isIdentifier(baseIdentifier) || !localBindings.has(baseIdentifier.getText()))
|
|
6699
6699
|
return void 0;
|
|
6700
|
-
return
|
|
6700
|
+
return name2;
|
|
6701
6701
|
};
|
|
6702
6702
|
const match2 = candidateFromTypeAccess(left, right) ?? candidateFromTypeAccess(right, left);
|
|
6703
6703
|
if (match2)
|
|
@@ -6749,8 +6749,8 @@ function collectArrayMapRenderComponentReferences(funcNode, componentNames, ownC
|
|
|
6749
6749
|
const found = /* @__PURE__ */ new Set();
|
|
6750
6750
|
const propNames = new Set(propTypesByName.keys());
|
|
6751
6751
|
const renderCountByComponent = /* @__PURE__ */ new Map();
|
|
6752
|
-
const bumpRenderCount = (
|
|
6753
|
-
renderCountByComponent.set(
|
|
6752
|
+
const bumpRenderCount = (name2) => {
|
|
6753
|
+
renderCountByComponent.set(name2, (renderCountByComponent.get(name2) ?? 0) + 1);
|
|
6754
6754
|
};
|
|
6755
6755
|
for (const jsxElement of [
|
|
6756
6756
|
...funcNode.getDescendantsOfKind(SyntaxKind3.JsxSelfClosingElement),
|
|
@@ -7078,7 +7078,7 @@ function sourceFileUsesCreateContext(sourceFile) {
|
|
|
7078
7078
|
function isNextJsComponent(filePath, exportedNames) {
|
|
7079
7079
|
const normalized = filePath.replace(/\\/g, "/");
|
|
7080
7080
|
const isAppRouterFile = /\/app\/.*\/(page|layout)\.[jt]sx?$/.test(normalized);
|
|
7081
|
-
const hasNextExports = exportedNames.some((
|
|
7081
|
+
const hasNextExports = exportedNames.some((name2) => name2 === "generateMetadata" || name2 === "generateStaticParams");
|
|
7082
7082
|
return isAppRouterFile || hasNextExports;
|
|
7083
7083
|
}
|
|
7084
7084
|
function isRepoLocalTransparentPolymorphicWrapperDeclaration(declaration, typeName) {
|
|
@@ -7260,8 +7260,8 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
7260
7260
|
const props = [];
|
|
7261
7261
|
let hasChildren = false;
|
|
7262
7262
|
for (const property of type.getProperties()) {
|
|
7263
|
-
const
|
|
7264
|
-
if (
|
|
7263
|
+
const name2 = property.getName();
|
|
7264
|
+
if (name2 === "children") {
|
|
7265
7265
|
if (suppressNeverChildrenSlot) {
|
|
7266
7266
|
const declaration2 = property.getValueDeclaration() ?? property.getDeclarations()[0];
|
|
7267
7267
|
if (declaration2 && property.getTypeAtLocation(declaration2).isNever()) {
|
|
@@ -7271,7 +7271,7 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
7271
7271
|
hasChildren = true;
|
|
7272
7272
|
continue;
|
|
7273
7273
|
}
|
|
7274
|
-
if (slotNames.has(
|
|
7274
|
+
if (slotNames.has(name2))
|
|
7275
7275
|
continue;
|
|
7276
7276
|
const declaration = property.getValueDeclaration() ?? property.getDeclarations()[0];
|
|
7277
7277
|
if (!declaration)
|
|
@@ -7282,7 +7282,7 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
7282
7282
|
const required = !property.isOptional();
|
|
7283
7283
|
const allowedValues = extractAllowedValues(propType);
|
|
7284
7284
|
props.push({
|
|
7285
|
-
name,
|
|
7285
|
+
name: name2,
|
|
7286
7286
|
type: typeText,
|
|
7287
7287
|
required,
|
|
7288
7288
|
...allowedValues && { allowedValues },
|
|
@@ -7313,19 +7313,19 @@ function extractPropsFromInterfaceDeclaration(declaration, slotNames, seen, excl
|
|
|
7313
7313
|
return acc;
|
|
7314
7314
|
const propType = symbol.getTypeAtLocation(decl);
|
|
7315
7315
|
const typeText = propType.isAny() ? ("getTypeNode" in decl && typeof decl.getTypeNode === "function" ? decl.getTypeNode()?.getText() : void 0) ?? propType.getText(decl) : propType.getText(decl);
|
|
7316
|
-
const
|
|
7317
|
-
if (
|
|
7316
|
+
const name2 = symbol.getName();
|
|
7317
|
+
if (name2 === "children") {
|
|
7318
7318
|
if (suppressNeverChildrenSlot && propType.isNever())
|
|
7319
7319
|
return acc;
|
|
7320
7320
|
acc.hasChildren = true;
|
|
7321
7321
|
return acc;
|
|
7322
7322
|
}
|
|
7323
|
-
if (slotNames.has(
|
|
7323
|
+
if (slotNames.has(name2))
|
|
7324
7324
|
return acc;
|
|
7325
7325
|
const required = !symbol.isOptional();
|
|
7326
7326
|
const allowedValues = extractAllowedValues(propType);
|
|
7327
7327
|
acc.props.push({
|
|
7328
|
-
name,
|
|
7328
|
+
name: name2,
|
|
7329
7329
|
type: typeText,
|
|
7330
7330
|
required,
|
|
7331
7331
|
...allowedValues && { allowedValues },
|
|
@@ -7658,7 +7658,7 @@ function collectReboundDeclarations(body) {
|
|
|
7658
7658
|
function collectPropDataflow(func, param, availablePropNames) {
|
|
7659
7659
|
const valueAliases = /* @__PURE__ */ new Map();
|
|
7660
7660
|
const objectAliases = /* @__PURE__ */ new Map();
|
|
7661
|
-
const fullPropsShape = new Map([...availablePropNames].map((
|
|
7661
|
+
const fullPropsShape = new Map([...availablePropNames].map((name2) => [name2, name2]));
|
|
7662
7662
|
const belongsToComponentFunction = (node) => node.getFirstAncestor((ancestor) => Node4.isFunctionDeclaration(ancestor) || Node4.isArrowFunction(ancestor) || Node4.isFunctionExpression(ancestor)) === func;
|
|
7663
7663
|
const resolveValue = (expression) => {
|
|
7664
7664
|
if (!expression)
|
|
@@ -7852,12 +7852,12 @@ function extractSlots2(type, hasChildren) {
|
|
|
7852
7852
|
slots.push({ name: "children", isDefault: true });
|
|
7853
7853
|
}
|
|
7854
7854
|
for (const property of type.getProperties()) {
|
|
7855
|
-
const
|
|
7856
|
-
if (
|
|
7855
|
+
const name2 = property.getName();
|
|
7856
|
+
if (name2 === "children")
|
|
7857
7857
|
continue;
|
|
7858
7858
|
if (!getRenderPropType(property))
|
|
7859
7859
|
continue;
|
|
7860
|
-
const slotName =
|
|
7860
|
+
const slotName = name2.replace(/^render/, "");
|
|
7861
7861
|
slots.push({
|
|
7862
7862
|
name: slotName.charAt(0).toLowerCase() + slotName.slice(1),
|
|
7863
7863
|
isDefault: false
|
|
@@ -7870,9 +7870,9 @@ function isExpandableDomAttributeWrapperName(typeName) {
|
|
|
7870
7870
|
}
|
|
7871
7871
|
function getStringLiteralTypeValues(typeNode) {
|
|
7872
7872
|
if (Node4.isLiteralTypeNode(typeNode)) {
|
|
7873
|
-
const
|
|
7874
|
-
if (Node4.isStringLiteral(
|
|
7875
|
-
return [
|
|
7873
|
+
const literal4 = typeNode.getLiteral();
|
|
7874
|
+
if (Node4.isStringLiteral(literal4)) {
|
|
7875
|
+
return [literal4.getLiteralText()];
|
|
7876
7876
|
}
|
|
7877
7877
|
}
|
|
7878
7878
|
if (!Node4.isUnionTypeNode(typeNode))
|
|
@@ -8113,17 +8113,17 @@ function getSyntheticDomAttributeProps(typeNode) {
|
|
|
8113
8113
|
}
|
|
8114
8114
|
return [...propsByName.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
8115
8115
|
}
|
|
8116
|
-
function getDomAttributeSurface(
|
|
8117
|
-
if (seen.has(
|
|
8116
|
+
function getDomAttributeSurface(name2, seen = /* @__PURE__ */ new Set()) {
|
|
8117
|
+
if (seen.has(name2))
|
|
8118
8118
|
return [];
|
|
8119
|
-
seen.add(
|
|
8119
|
+
seen.add(name2);
|
|
8120
8120
|
const propsByName = /* @__PURE__ */ new Map();
|
|
8121
|
-
for (const parentName of DOM_ATTRIBUTE_WRAPPER_PARENTS[
|
|
8121
|
+
for (const parentName of DOM_ATTRIBUTE_WRAPPER_PARENTS[name2] ?? []) {
|
|
8122
8122
|
for (const prop of getDomAttributeSurface(parentName, seen)) {
|
|
8123
8123
|
propsByName.set(prop.name, prop);
|
|
8124
8124
|
}
|
|
8125
8125
|
}
|
|
8126
|
-
for (const prop of DOM_ATTRIBUTE_PROP_SURFACES[
|
|
8126
|
+
for (const prop of DOM_ATTRIBUTE_PROP_SURFACES[name2]) {
|
|
8127
8127
|
propsByName.set(prop.name, prop);
|
|
8128
8128
|
}
|
|
8129
8129
|
return [...propsByName.values()].map((prop) => ({
|
|
@@ -8220,12 +8220,12 @@ function extractPickedPropsFromTypeNode(typeNode, slotNames, excludedProps = /*
|
|
|
8220
8220
|
}
|
|
8221
8221
|
const pickedKeys = getStringLiteralTypeValues(pickedKeysNode);
|
|
8222
8222
|
const props = [];
|
|
8223
|
-
for (const
|
|
8224
|
-
if (slotNames.has(
|
|
8223
|
+
for (const name2 of pickedKeys) {
|
|
8224
|
+
if (slotNames.has(name2))
|
|
8225
8225
|
continue;
|
|
8226
|
-
if (excludedProps.has(
|
|
8226
|
+
if (excludedProps.has(name2))
|
|
8227
8227
|
continue;
|
|
8228
|
-
const pickedProp = sourcePropsByName.get(
|
|
8228
|
+
const pickedProp = sourcePropsByName.get(name2);
|
|
8229
8229
|
if (pickedProp) {
|
|
8230
8230
|
props.push(pickedProp);
|
|
8231
8231
|
}
|
|
@@ -8455,7 +8455,7 @@ async function extractReactComponents(filePaths) {
|
|
|
8455
8455
|
function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
8456
8456
|
const components = [];
|
|
8457
8457
|
const usesCreateContext = sourceFileUsesCreateContext(sourceFile);
|
|
8458
|
-
for (const { name, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8458
|
+
for (const { name: name2, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8459
8459
|
allowVariableDeclaration: true,
|
|
8460
8460
|
hookReason: "React hook names are not renderable components"
|
|
8461
8461
|
})) {
|
|
@@ -8467,7 +8467,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
8467
8467
|
const params = funcNode.getParameters();
|
|
8468
8468
|
if (params.length === 0) {
|
|
8469
8469
|
components.push({
|
|
8470
|
-
name,
|
|
8470
|
+
name: name2,
|
|
8471
8471
|
source: sourceFile.getFilePath(),
|
|
8472
8472
|
sourcePath: sourceFile.getFilePath(),
|
|
8473
8473
|
framework: isNext ? "next" : "react",
|
|
@@ -8511,7 +8511,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
8511
8511
|
}
|
|
8512
8512
|
const resolvedProps = [...mergedPropsByName.values()];
|
|
8513
8513
|
const noUsefulTypes = resolvedProps.length === 0 || resolvedProps.every((p) => p.type === "any");
|
|
8514
|
-
const finalProps = noUsefulTypes ? extractPropTypes(sourceFile,
|
|
8514
|
+
const finalProps = noUsefulTypes ? extractPropTypes(sourceFile, name2) ?? resolvedProps : resolvedProps;
|
|
8515
8515
|
const propsWithDefaults = finalProps.map((p) => {
|
|
8516
8516
|
if (!defaults.has(p.name))
|
|
8517
8517
|
return p;
|
|
@@ -8544,7 +8544,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
8544
8544
|
const propsTypeName = firstParamTypeNode?.getText?.().trim();
|
|
8545
8545
|
const propsTypeNameCapture = propsTypeName && /^[A-Za-z_$][\w$]*$/.test(propsTypeName) ? propsTypeName : void 0;
|
|
8546
8546
|
components.push({
|
|
8547
|
-
name,
|
|
8547
|
+
name: name2,
|
|
8548
8548
|
source: sourceFile.getFilePath(),
|
|
8549
8549
|
sourcePath: sourceFile.getFilePath(),
|
|
8550
8550
|
framework: isNext ? "next" : "react",
|
|
@@ -8759,10 +8759,10 @@ async function extractVueTsxComponents(filePaths) {
|
|
|
8759
8759
|
}
|
|
8760
8760
|
function extractFromSourceFile3(sourceFile, exclusions) {
|
|
8761
8761
|
const components = [];
|
|
8762
|
-
for (const { name, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8762
|
+
for (const { name: name2, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8763
8763
|
hookReason: "Vue composition hook names are not renderable components"
|
|
8764
8764
|
})) {
|
|
8765
|
-
const component = extractVueTsxComponent(declarations,
|
|
8765
|
+
const component = extractVueTsxComponent(declarations, name2, sourceFile);
|
|
8766
8766
|
if (component) {
|
|
8767
8767
|
components.push(component);
|
|
8768
8768
|
}
|
|
@@ -8778,11 +8778,11 @@ function extractVueTsxComponent(declarations, exportName, sourceFile) {
|
|
|
8778
8778
|
const resolved = resolveVueComponentOptions(declaration.getInitializer());
|
|
8779
8779
|
if (!resolved)
|
|
8780
8780
|
continue;
|
|
8781
|
-
const
|
|
8781
|
+
const name2 = extractVueGenericComponentName(resolved.options) ?? exportName;
|
|
8782
8782
|
const props = extractVueGenericComponentProps(resolved.options);
|
|
8783
8783
|
const slots = extractVueGenericComponentSlots(resolved.options, resolved.slotsTypeNode);
|
|
8784
8784
|
return {
|
|
8785
|
-
name,
|
|
8785
|
+
name: name2,
|
|
8786
8786
|
source: sourceFile.getFilePath(),
|
|
8787
8787
|
framework: "vue",
|
|
8788
8788
|
props,
|
|
@@ -8956,16 +8956,16 @@ function extractVueObjectPropDefinition(propName, initializer) {
|
|
|
8956
8956
|
for (const property of initializer.getProperties()) {
|
|
8957
8957
|
if (!Node5.isPropertyAssignment(property))
|
|
8958
8958
|
continue;
|
|
8959
|
-
const
|
|
8959
|
+
const name2 = property.getName();
|
|
8960
8960
|
const value = property.getInitializer();
|
|
8961
8961
|
if (!value)
|
|
8962
8962
|
continue;
|
|
8963
|
-
if (
|
|
8963
|
+
if (name2 === "type") {
|
|
8964
8964
|
type = getVuePropTypeText(value);
|
|
8965
8965
|
allowedValues = extractAllowedValues(value.getType());
|
|
8966
|
-
} else if (
|
|
8966
|
+
} else if (name2 === "required") {
|
|
8967
8967
|
required = value.getText() === "true";
|
|
8968
|
-
} else if (
|
|
8968
|
+
} else if (name2 === "default") {
|
|
8969
8969
|
defaultValue = value.getText();
|
|
8970
8970
|
}
|
|
8971
8971
|
}
|
|
@@ -9258,20 +9258,20 @@ async function extractVueComponents(filePaths, onProgress) {
|
|
|
9258
9258
|
async function extractFromVueSFC(filePath, source) {
|
|
9259
9259
|
const { descriptor, errors } = parseSFC(source);
|
|
9260
9260
|
const fileWarnings = errors.map((e) => `Parse error in ${filePath}: ${e instanceof Error ? e.message : String(e)}`);
|
|
9261
|
-
const
|
|
9261
|
+
const name2 = getVueComponentName(filePath);
|
|
9262
9262
|
let props = [];
|
|
9263
9263
|
const setupProps = descriptor.scriptSetup ? await extractSetupProps(filePath, descriptor.scriptSetup.content) : null;
|
|
9264
9264
|
if (setupProps !== null) {
|
|
9265
9265
|
props = setupProps;
|
|
9266
9266
|
} else if (descriptor.script) {
|
|
9267
|
-
return extractOptionsComponent(filePath, descriptor.script.content, fileWarnings,
|
|
9267
|
+
return extractOptionsComponent(filePath, descriptor.script.content, fileWarnings, name2, descriptor.template?.ast, source);
|
|
9268
9268
|
}
|
|
9269
9269
|
let slots = descriptor.template?.ast ? extractSlotsFromTemplate(descriptor.template.ast) : [];
|
|
9270
9270
|
const runtimeSlots = extractSlotsFromRuntimeAccess(source);
|
|
9271
9271
|
slots = mergeSlotsDedup(slots, runtimeSlots);
|
|
9272
9272
|
return {
|
|
9273
9273
|
component: {
|
|
9274
|
-
name,
|
|
9274
|
+
name: name2,
|
|
9275
9275
|
source: filePath,
|
|
9276
9276
|
sourcePath: filePath,
|
|
9277
9277
|
framework: "vue",
|
|
@@ -9289,7 +9289,7 @@ function getVueComponentName(filePath) {
|
|
|
9289
9289
|
const parentDirName = basename(dirname9(filePath));
|
|
9290
9290
|
return parentDirName || fileName;
|
|
9291
9291
|
}
|
|
9292
|
-
async function extractOptionsComponent(filePath, scriptContent, fileWarnings,
|
|
9292
|
+
async function extractOptionsComponent(filePath, scriptContent, fileWarnings, name2, templateAst, sfcSource) {
|
|
9293
9293
|
const props = await extractOptionsProps(filePath, scriptContent);
|
|
9294
9294
|
let slots = templateAst ? extractSlotsFromTemplate(templateAst) : [];
|
|
9295
9295
|
if (sfcSource) {
|
|
@@ -9298,7 +9298,7 @@ async function extractOptionsComponent(filePath, scriptContent, fileWarnings, na
|
|
|
9298
9298
|
}
|
|
9299
9299
|
return {
|
|
9300
9300
|
component: {
|
|
9301
|
-
name,
|
|
9301
|
+
name: name2,
|
|
9302
9302
|
source: filePath,
|
|
9303
9303
|
sourcePath: filePath,
|
|
9304
9304
|
framework: "vue",
|
|
@@ -9371,13 +9371,13 @@ function extractGenericProps(typeText) {
|
|
|
9371
9371
|
const resolved = resolveTypeProperty(property);
|
|
9372
9372
|
if (!resolved)
|
|
9373
9373
|
continue;
|
|
9374
|
-
const { name, typeText: resolvedTypeText, required } = resolved;
|
|
9374
|
+
const { name: name2, typeText: resolvedTypeText, required } = resolved;
|
|
9375
9375
|
let typeText2 = resolvedTypeText;
|
|
9376
9376
|
if (!required) {
|
|
9377
9377
|
typeText2 = typeText2.replace(/\s*\|\s*undefined$/, "").replace(/^undefined\s*\|\s*/, "");
|
|
9378
9378
|
}
|
|
9379
9379
|
props.push({
|
|
9380
|
-
name,
|
|
9380
|
+
name: name2,
|
|
9381
9381
|
type: typeText2,
|
|
9382
9382
|
required
|
|
9383
9383
|
});
|
|
@@ -9675,14 +9675,14 @@ function parseObjectProps(obj) {
|
|
|
9675
9675
|
for (const prop of obj.getProperties()) {
|
|
9676
9676
|
if (!Node6.isPropertyAssignment(prop))
|
|
9677
9677
|
continue;
|
|
9678
|
-
const
|
|
9679
|
-
if (!isPublicVuePropName(
|
|
9678
|
+
const name2 = prop.getName();
|
|
9679
|
+
if (!isPublicVuePropName(name2))
|
|
9680
9680
|
continue;
|
|
9681
9681
|
const init = prop.getInitializer();
|
|
9682
9682
|
if (!init || !Node6.isObjectLiteralExpression(init)) {
|
|
9683
9683
|
const initText = init?.getText() ?? "any";
|
|
9684
9684
|
result.push({
|
|
9685
|
-
name,
|
|
9685
|
+
name: name2,
|
|
9686
9686
|
type: VUE_TYPE_MAP[initText] ?? "any",
|
|
9687
9687
|
required: false,
|
|
9688
9688
|
sourceStartLine: prop.getStartLineNumber(),
|
|
@@ -9715,7 +9715,7 @@ function parseObjectProps(obj) {
|
|
|
9715
9715
|
}
|
|
9716
9716
|
}
|
|
9717
9717
|
result.push({
|
|
9718
|
-
name,
|
|
9718
|
+
name: name2,
|
|
9719
9719
|
type,
|
|
9720
9720
|
required,
|
|
9721
9721
|
...defaultValue !== void 0 && { defaultValue },
|
|
@@ -9725,8 +9725,8 @@ function parseObjectProps(obj) {
|
|
|
9725
9725
|
}
|
|
9726
9726
|
return result;
|
|
9727
9727
|
}
|
|
9728
|
-
function isPublicVuePropName(
|
|
9729
|
-
return !/^[_$]/.test(
|
|
9728
|
+
function isPublicVuePropName(name2) {
|
|
9729
|
+
return !/^[_$]/.test(name2);
|
|
9730
9730
|
}
|
|
9731
9731
|
function extractSlotsFromTemplate(ast) {
|
|
9732
9732
|
const slots = [];
|
|
@@ -9758,10 +9758,10 @@ function extractSlotsFromRuntimeAccess(source) {
|
|
|
9758
9758
|
for (const pattern of [dotPattern, bracketPattern]) {
|
|
9759
9759
|
let match2;
|
|
9760
9760
|
while ((match2 = pattern.exec(source)) !== null) {
|
|
9761
|
-
const
|
|
9762
|
-
if (!seen.has(
|
|
9763
|
-
seen.add(
|
|
9764
|
-
slots.push({ name, isDefault:
|
|
9761
|
+
const name2 = match2[1];
|
|
9762
|
+
if (!seen.has(name2)) {
|
|
9763
|
+
seen.add(name2);
|
|
9764
|
+
slots.push({ name: name2, isDefault: name2 === "default" });
|
|
9765
9765
|
}
|
|
9766
9766
|
}
|
|
9767
9767
|
}
|
|
@@ -9870,12 +9870,12 @@ function extractPropsFromFrontmatter(frontmatter) {
|
|
|
9870
9870
|
const propsTypeAlias = sf.getTypeAlias("Props");
|
|
9871
9871
|
if (propsInterface) {
|
|
9872
9872
|
for (const member of propsInterface.getProperties()) {
|
|
9873
|
-
const
|
|
9873
|
+
const name2 = member.getName();
|
|
9874
9874
|
const typeText = member.getTypeNode()?.getText() ?? "any";
|
|
9875
9875
|
const required = !member.hasQuestionToken();
|
|
9876
9876
|
const allowedValues = extractAllowedValues3(typeText);
|
|
9877
9877
|
props.push({
|
|
9878
|
-
name,
|
|
9878
|
+
name: name2,
|
|
9879
9879
|
type: typeText,
|
|
9880
9880
|
required,
|
|
9881
9881
|
...allowedValues && { allowedValues },
|
|
@@ -9889,10 +9889,10 @@ function extractPropsFromFrontmatter(frontmatter) {
|
|
|
9889
9889
|
const resolved = resolveTypeProperty(property);
|
|
9890
9890
|
if (!resolved)
|
|
9891
9891
|
continue;
|
|
9892
|
-
const { name, declaration: decl, typeText, required } = resolved;
|
|
9892
|
+
const { name: name2, declaration: decl, typeText, required } = resolved;
|
|
9893
9893
|
const allowedValues = extractAllowedValues3(typeText);
|
|
9894
9894
|
props.push({
|
|
9895
|
-
name,
|
|
9895
|
+
name: name2,
|
|
9896
9896
|
type: typeText,
|
|
9897
9897
|
required,
|
|
9898
9898
|
...allowedValues && { allowedValues },
|
|
@@ -9958,7 +9958,7 @@ function mergeSlots(...slotGroups) {
|
|
|
9958
9958
|
return merged;
|
|
9959
9959
|
}
|
|
9960
9960
|
function extractFromAstroFile(filePath, source) {
|
|
9961
|
-
const
|
|
9961
|
+
const name2 = basename2(filePath, ".astro");
|
|
9962
9962
|
const fenceIndex = source.startsWith("---") ? 0 : -1;
|
|
9963
9963
|
let frontmatter = "";
|
|
9964
9964
|
let template = source;
|
|
@@ -9977,7 +9977,7 @@ function extractFromAstroFile(filePath, source) {
|
|
|
9977
9977
|
});
|
|
9978
9978
|
const slots = mergeSlots(extractSlotsFromTemplate2(template), extractSlotsFromFrontmatter(frontmatter));
|
|
9979
9979
|
return {
|
|
9980
|
-
name,
|
|
9980
|
+
name: name2,
|
|
9981
9981
|
source: filePath,
|
|
9982
9982
|
sourcePath: filePath,
|
|
9983
9983
|
framework: "astro",
|
|
@@ -10189,10 +10189,10 @@ function extractSlotsFromTemplate3(templateContent) {
|
|
|
10189
10189
|
for (const match2 of templateContent.matchAll(slotRegex)) {
|
|
10190
10190
|
const attrs = match2[1] ?? "";
|
|
10191
10191
|
const nameMatch = attrs.match(/\bname=["']([^"']+)["']/);
|
|
10192
|
-
const
|
|
10193
|
-
slots.set(
|
|
10192
|
+
const name2 = nameMatch?.[1] ?? "default";
|
|
10193
|
+
slots.set(name2, name2 === "default");
|
|
10194
10194
|
}
|
|
10195
|
-
return [...slots.entries()].map(([
|
|
10195
|
+
return [...slots.entries()].map(([name2, isDefault]) => ({ name: name2, isDefault })).sort((a, b) => a.name.localeCompare(b.name));
|
|
10196
10196
|
}
|
|
10197
10197
|
function mergeSlotLists(...slotLists) {
|
|
10198
10198
|
const merged = /* @__PURE__ */ new Map();
|
|
@@ -10221,20 +10221,20 @@ function extractJsDocSlots(classDecl) {
|
|
|
10221
10221
|
const comment = tag.getCommentText()?.trim();
|
|
10222
10222
|
if (!comment)
|
|
10223
10223
|
continue;
|
|
10224
|
-
let
|
|
10224
|
+
let name2 = "default";
|
|
10225
10225
|
let description = comment;
|
|
10226
10226
|
if (comment.startsWith("-")) {
|
|
10227
10227
|
description = comment.slice(1).trim();
|
|
10228
10228
|
} else {
|
|
10229
10229
|
const match2 = comment.match(/^(\S+)\s*-\s*(.*)$/s);
|
|
10230
10230
|
if (match2) {
|
|
10231
|
-
|
|
10231
|
+
name2 = match2[1];
|
|
10232
10232
|
description = match2[2].trim();
|
|
10233
10233
|
}
|
|
10234
10234
|
}
|
|
10235
10235
|
slots.push({
|
|
10236
|
-
name,
|
|
10237
|
-
isDefault:
|
|
10236
|
+
name: name2,
|
|
10237
|
+
isDefault: name2 === "default",
|
|
10238
10238
|
...description && { description }
|
|
10239
10239
|
});
|
|
10240
10240
|
}
|
|
@@ -10279,8 +10279,8 @@ function isNonPublicLitMember(member) {
|
|
|
10279
10279
|
function hasShoelaceRuntimeBookkeepingField(classDecl) {
|
|
10280
10280
|
return classDecl.getProperties().some((property) => property.getName() === "initialReflectedProperties");
|
|
10281
10281
|
}
|
|
10282
|
-
function isInternalRuntimeField(
|
|
10283
|
-
return applyRuntimeFieldDenylist && INTERNAL_RUNTIME_FIELD_NAMES.has(
|
|
10282
|
+
function isInternalRuntimeField(name2, applyRuntimeFieldDenylist) {
|
|
10283
|
+
return applyRuntimeFieldDenylist && INTERNAL_RUNTIME_FIELD_NAMES.has(name2);
|
|
10284
10284
|
}
|
|
10285
10285
|
function getExplicitLitPropertyAttributeName(property) {
|
|
10286
10286
|
const decorator = property.getDecorators().find((candidate) => candidate.getName() === "property");
|
|
@@ -10307,8 +10307,8 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
10307
10307
|
continue;
|
|
10308
10308
|
if (isNonPublicLitMember(property))
|
|
10309
10309
|
continue;
|
|
10310
|
-
const
|
|
10311
|
-
if (
|
|
10310
|
+
const name2 = property.getName();
|
|
10311
|
+
if (name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
10312
10312
|
continue;
|
|
10313
10313
|
const scope = property.getScope();
|
|
10314
10314
|
if (scope === "private" || scope === "protected")
|
|
@@ -10323,7 +10323,7 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
10323
10323
|
}
|
|
10324
10324
|
const typeNode = property.getTypeNode();
|
|
10325
10325
|
const type = typeNode ? typeNode.getText() : "any";
|
|
10326
|
-
const publicName =
|
|
10326
|
+
const publicName = name2.startsWith("_") && hasDecorators ? getExplicitLitPropertyAttributeName(property) : null;
|
|
10327
10327
|
let defaultValue;
|
|
10328
10328
|
if (initializer) {
|
|
10329
10329
|
if (Node8.isStringLiteral(initializer)) {
|
|
@@ -10333,7 +10333,7 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
10333
10333
|
}
|
|
10334
10334
|
}
|
|
10335
10335
|
props.push({
|
|
10336
|
-
name: publicName ? kebabToCamel(publicName) :
|
|
10336
|
+
name: publicName ? kebabToCamel(publicName) : name2,
|
|
10337
10337
|
type,
|
|
10338
10338
|
required: false,
|
|
10339
10339
|
...defaultValue !== void 0 && { defaultValue },
|
|
@@ -10353,15 +10353,15 @@ function extractAccessorProperties(classDecl, applyRuntimeFieldDenylist = false)
|
|
|
10353
10353
|
continue;
|
|
10354
10354
|
if (isNonPublicLitMember(getter))
|
|
10355
10355
|
continue;
|
|
10356
|
-
const
|
|
10357
|
-
if (
|
|
10356
|
+
const name2 = getter.getName();
|
|
10357
|
+
if (name2 === "observedAttributes" || name2 === "template" || name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
10358
10358
|
continue;
|
|
10359
10359
|
const scope = getter.getScope();
|
|
10360
10360
|
if (scope === "private" || scope === "protected")
|
|
10361
10361
|
continue;
|
|
10362
|
-
const entry = accessors.get(
|
|
10362
|
+
const entry = accessors.get(name2) ?? {};
|
|
10363
10363
|
entry.getter = getter;
|
|
10364
|
-
accessors.set(
|
|
10364
|
+
accessors.set(name2, entry);
|
|
10365
10365
|
}
|
|
10366
10366
|
for (const setter of classDecl.getSetAccessors()) {
|
|
10367
10367
|
if (setter.isStatic())
|
|
@@ -10370,24 +10370,24 @@ function extractAccessorProperties(classDecl, applyRuntimeFieldDenylist = false)
|
|
|
10370
10370
|
continue;
|
|
10371
10371
|
if (isNonPublicLitMember(setter))
|
|
10372
10372
|
continue;
|
|
10373
|
-
const
|
|
10374
|
-
if (
|
|
10373
|
+
const name2 = setter.getName();
|
|
10374
|
+
if (name2 === "observedAttributes" || name2 === "template" || name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
10375
10375
|
continue;
|
|
10376
10376
|
const scope = setter.getScope();
|
|
10377
10377
|
if (scope === "private" || scope === "protected")
|
|
10378
10378
|
continue;
|
|
10379
|
-
const entry = accessors.get(
|
|
10379
|
+
const entry = accessors.get(name2) ?? {};
|
|
10380
10380
|
entry.setter = setter;
|
|
10381
|
-
accessors.set(
|
|
10381
|
+
accessors.set(name2, entry);
|
|
10382
10382
|
}
|
|
10383
|
-
for (const [
|
|
10383
|
+
for (const [name2, { getter, setter }] of accessors) {
|
|
10384
10384
|
const hasPropertyDecorator = getter?.getDecorators().some((decorator) => decorator.getName() === "property") || setter?.getDecorators().some((decorator) => decorator.getName() === "property");
|
|
10385
10385
|
if (!hasPropertyDecorator && !(getter && setter))
|
|
10386
10386
|
continue;
|
|
10387
10387
|
const type = getter?.getReturnTypeNode()?.getText() ?? setter?.getParameters()[0]?.getTypeNode()?.getText() ?? "any";
|
|
10388
10388
|
const accessorNode = getter ?? setter;
|
|
10389
10389
|
props.push({
|
|
10390
|
-
name,
|
|
10390
|
+
name: name2,
|
|
10391
10391
|
type,
|
|
10392
10392
|
required: false,
|
|
10393
10393
|
...accessorNode ? {
|
|
@@ -10409,11 +10409,11 @@ function extractJsDocAttributeProps(classDecl) {
|
|
|
10409
10409
|
const match2 = normalizedComment?.match(/(?:\{([^}]+)\}\s+)?([^\s]+)(?:\s*-\s*([\s\S]*))?/);
|
|
10410
10410
|
if (!match2)
|
|
10411
10411
|
continue;
|
|
10412
|
-
const [, type,
|
|
10413
|
-
if (!
|
|
10412
|
+
const [, type, name2, description] = match2;
|
|
10413
|
+
if (!name2 || name2.startsWith("#"))
|
|
10414
10414
|
continue;
|
|
10415
10415
|
props.push({
|
|
10416
|
-
name,
|
|
10416
|
+
name: name2,
|
|
10417
10417
|
type: type?.trim() || "any",
|
|
10418
10418
|
required: false,
|
|
10419
10419
|
...description ? { description: description.replace(/\s+/g, " ").trim() } : {}
|
|
@@ -10765,7 +10765,7 @@ function extractFromSourceFile4(sourceFile, project) {
|
|
|
10765
10765
|
const tagName = tagNameMap.get(className) ?? siblingDefinedTagName ?? decoratorTagName ?? jsDocTagName ?? fastDefinitionTagName ?? void 0;
|
|
10766
10766
|
if (!tagName)
|
|
10767
10767
|
continue;
|
|
10768
|
-
const
|
|
10768
|
+
const name2 = chooseComponentName(classDecl, className, tagName);
|
|
10769
10769
|
const observedAttrs = extractObservedAttributes(classDecl);
|
|
10770
10770
|
const inheritedProps = extractInheritedClassProperties(classDecl, project);
|
|
10771
10771
|
const classProps = mergePropLists(extractJsDocAttributeProps(classDecl), extractAccessorProperties(classDecl), extractClassProperties(classDecl));
|
|
@@ -10773,7 +10773,7 @@ function extractFromSourceFile4(sourceFile, project) {
|
|
|
10773
10773
|
const templateContent = extractTemplateContent(classDecl, project);
|
|
10774
10774
|
const slots = mergeSlotLists(extractInheritedSlots(classDecl, project), extractJsDocSlots(classDecl), extractSlotsFromTemplate3(templateContent), extractFastTemplateSlots(classDecl, project));
|
|
10775
10775
|
components.push({
|
|
10776
|
-
name,
|
|
10776
|
+
name: name2,
|
|
10777
10777
|
source: sourceFile.getFilePath(),
|
|
10778
10778
|
sourcePath: sourceFile.getFilePath(),
|
|
10779
10779
|
framework: "web-component",
|
|
@@ -11085,8 +11085,8 @@ async function retryComponentWithProject(component, ctx, project, warnings) {
|
|
|
11085
11085
|
}
|
|
11086
11086
|
function addImportedDeclarationsToProject(project, ctx) {
|
|
11087
11087
|
const importedNames = collectReferencedTypeNames(ctx.annotation);
|
|
11088
|
-
for (const
|
|
11089
|
-
const localDecl = findLocalTypeDeclaration(ctx.instance,
|
|
11088
|
+
for (const name2 of [...importedNames]) {
|
|
11089
|
+
const localDecl = findLocalTypeDeclaration(ctx.instance, name2, ctx.moduleScript) ?? (ctx.moduleScript ? findLocalTypeDeclaration(ctx.moduleScript, name2, ctx.instance) : null);
|
|
11090
11090
|
if (localDecl) {
|
|
11091
11091
|
for (const referenced of collectReferencedTypeNames(localDecl))
|
|
11092
11092
|
importedNames.add(referenced);
|
|
@@ -11267,21 +11267,21 @@ function collapseUnresolvedTypeWarnings(warnings) {
|
|
|
11267
11267
|
}
|
|
11268
11268
|
async function extractFromSvelteFile(filePath, source) {
|
|
11269
11269
|
const warnings = [];
|
|
11270
|
-
const
|
|
11270
|
+
const name2 = getSvelteComponentName(filePath);
|
|
11271
11271
|
let ast;
|
|
11272
11272
|
try {
|
|
11273
11273
|
ast = parseSvelte(source, { modern: true });
|
|
11274
11274
|
} catch (e) {
|
|
11275
11275
|
return {
|
|
11276
11276
|
component: null,
|
|
11277
|
-
warnings: [`${
|
|
11277
|
+
warnings: [`${name2}: parse error in ${filePath}: ${e instanceof Error ? e.message : String(e)}`]
|
|
11278
11278
|
};
|
|
11279
11279
|
}
|
|
11280
11280
|
const instance = ast["instance"];
|
|
11281
11281
|
const moduleScript = ast["module"];
|
|
11282
11282
|
const fragment = ast["fragment"];
|
|
11283
11283
|
if (instance && hasV4ExportLetProps(instance)) {
|
|
11284
|
-
warnings.push(`${
|
|
11284
|
+
warnings.push(`${name2}: Svelte 4 export let syntax not yet supported (${filePath}); see INTEG-4267 for v5-only scope and follow-up`);
|
|
11285
11285
|
return { component: null, warnings };
|
|
11286
11286
|
}
|
|
11287
11287
|
const propsCall = instance ? findPropsCall(instance) : null;
|
|
@@ -11296,7 +11296,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11296
11296
|
instance,
|
|
11297
11297
|
moduleScript,
|
|
11298
11298
|
filePath,
|
|
11299
|
-
componentName:
|
|
11299
|
+
componentName: name2,
|
|
11300
11300
|
source,
|
|
11301
11301
|
snippetLocals
|
|
11302
11302
|
});
|
|
@@ -11308,12 +11308,12 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11308
11308
|
extractionReasons.push(...result.additionalReasons);
|
|
11309
11309
|
} else if (instance) {
|
|
11310
11310
|
} else {
|
|
11311
|
-
warnings.push(`${
|
|
11311
|
+
warnings.push(`${name2}: no instance script block (${filePath}); no props extracted`);
|
|
11312
11312
|
}
|
|
11313
11313
|
const templateSlots = fragment ? extractTemplateSlots(fragment) : [];
|
|
11314
11314
|
const { slots, mixedWarning } = mergeSlots2(snippetSlotsFromProps, templateSlots);
|
|
11315
11315
|
if (mixedWarning) {
|
|
11316
|
-
warnings.push(`${
|
|
11316
|
+
warnings.push(`${name2}: mixed Snippet and <slot> usage detected (${filePath}); preferring Snippet entries`);
|
|
11317
11317
|
}
|
|
11318
11318
|
let propsTypeNameCapture;
|
|
11319
11319
|
if (propsCall) {
|
|
@@ -11326,7 +11326,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11326
11326
|
}
|
|
11327
11327
|
}
|
|
11328
11328
|
const component = {
|
|
11329
|
-
name,
|
|
11329
|
+
name: name2,
|
|
11330
11330
|
source: filePath,
|
|
11331
11331
|
framework: "svelte",
|
|
11332
11332
|
props,
|
|
@@ -11352,7 +11352,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11352
11352
|
instance,
|
|
11353
11353
|
moduleScript,
|
|
11354
11354
|
annotation,
|
|
11355
|
-
componentName:
|
|
11355
|
+
componentName: name2
|
|
11356
11356
|
};
|
|
11357
11357
|
}
|
|
11358
11358
|
}
|
|
@@ -11495,8 +11495,8 @@ function describeAnnotationForUser(annotation) {
|
|
|
11495
11495
|
if (!annotation)
|
|
11496
11496
|
return "<unknown>";
|
|
11497
11497
|
if (annotation.type === "TSTypeReference") {
|
|
11498
|
-
const
|
|
11499
|
-
return
|
|
11498
|
+
const name2 = annotation["typeName"]?.["name"] ?? null;
|
|
11499
|
+
return name2 ? `'${name2}'` : "<unnamed reference>";
|
|
11500
11500
|
}
|
|
11501
11501
|
if (annotation.type === "TSIntersectionType")
|
|
11502
11502
|
return "<intersection>";
|
|
@@ -11571,7 +11571,7 @@ async function resolveViaTypeChecker(annotation, instance, moduleScript, filePat
|
|
|
11571
11571
|
return null;
|
|
11572
11572
|
const members = [];
|
|
11573
11573
|
for (const symbol of properties) {
|
|
11574
|
-
const
|
|
11574
|
+
const name2 = symbol.getName();
|
|
11575
11575
|
const declaration = symbol.getValueDeclaration() ?? symbol.getDeclarations()[0];
|
|
11576
11576
|
if (!declaration)
|
|
11577
11577
|
continue;
|
|
@@ -11586,7 +11586,7 @@ async function resolveViaTypeChecker(annotation, instance, moduleScript, filePat
|
|
|
11586
11586
|
const declaredTypeText = readDeclaredTypeNodeText(declaration);
|
|
11587
11587
|
const isSnippet = declaredTypeText !== null && isSnippetTypeText(declaredTypeText, snippetLocals) || typeRefersToSnippet(propType) || isSnippetTypeText(typeText, snippetLocals);
|
|
11588
11588
|
members.push({
|
|
11589
|
-
name,
|
|
11589
|
+
name: name2,
|
|
11590
11590
|
optional: optional5,
|
|
11591
11591
|
typeText,
|
|
11592
11592
|
...declaredTypeText ? { declaredTypeText } : {},
|
|
@@ -11674,7 +11674,7 @@ function mergeSets(a, b) {
|
|
|
11674
11674
|
out.add(v);
|
|
11675
11675
|
return out;
|
|
11676
11676
|
}
|
|
11677
|
-
function findLocalTypeDeclaration(instance,
|
|
11677
|
+
function findLocalTypeDeclaration(instance, name2, module) {
|
|
11678
11678
|
for (const script of [instance, module]) {
|
|
11679
11679
|
const body = script?.["content"]?.["body"];
|
|
11680
11680
|
if (!body)
|
|
@@ -11683,7 +11683,7 @@ function findLocalTypeDeclaration(instance, name, module) {
|
|
|
11683
11683
|
const decl = stmt.type === "ExportNamedDeclaration" ? stmt["declaration"] ?? stmt : stmt;
|
|
11684
11684
|
if (decl.type === "TSInterfaceDeclaration" || decl.type === "TSTypeAliasDeclaration") {
|
|
11685
11685
|
const id = decl["id"];
|
|
11686
|
-
if (id?.["name"] ===
|
|
11686
|
+
if (id?.["name"] === name2)
|
|
11687
11687
|
return decl;
|
|
11688
11688
|
}
|
|
11689
11689
|
}
|
|
@@ -11704,8 +11704,8 @@ function readMembersFromInterfaceOrAlias(decl, snippetLocals) {
|
|
|
11704
11704
|
}
|
|
11705
11705
|
return [];
|
|
11706
11706
|
}
|
|
11707
|
-
function readMembersFromTypeLiteral(
|
|
11708
|
-
const members =
|
|
11707
|
+
function readMembersFromTypeLiteral(literal4, snippetLocals) {
|
|
11708
|
+
const members = literal4["members"];
|
|
11709
11709
|
if (!members)
|
|
11710
11710
|
return [];
|
|
11711
11711
|
return members.map((m) => readPropertySignature(m, snippetLocals)).filter((m) => !!m);
|
|
@@ -11714,8 +11714,8 @@ function readPropertySignature(member, snippetLocals) {
|
|
|
11714
11714
|
if (member.type !== "TSPropertySignature")
|
|
11715
11715
|
return null;
|
|
11716
11716
|
const key = member["key"];
|
|
11717
|
-
const
|
|
11718
|
-
if (!
|
|
11717
|
+
const name2 = key?.["name"] ?? null;
|
|
11718
|
+
if (!name2)
|
|
11719
11719
|
return null;
|
|
11720
11720
|
const optional5 = !!member["optional"];
|
|
11721
11721
|
const typeNode = member["typeAnnotation"]?.["typeAnnotation"];
|
|
@@ -11725,7 +11725,7 @@ function readPropertySignature(member, snippetLocals) {
|
|
|
11725
11725
|
const leading = member["leadingComments"] ?? [];
|
|
11726
11726
|
const description = extractJsdocText(leading);
|
|
11727
11727
|
return {
|
|
11728
|
-
name,
|
|
11728
|
+
name: name2,
|
|
11729
11729
|
optional: optional5,
|
|
11730
11730
|
typeText,
|
|
11731
11731
|
isSnippet,
|
|
@@ -11864,19 +11864,19 @@ function extractFromDestructure(propsCall, _ctx, typeMembers, warnings, addition
|
|
|
11864
11864
|
if (p.type !== "Property")
|
|
11865
11865
|
continue;
|
|
11866
11866
|
const key = p["key"];
|
|
11867
|
-
const
|
|
11868
|
-
if (!
|
|
11867
|
+
const name2 = key?.["name"] ?? null;
|
|
11868
|
+
if (!name2)
|
|
11869
11869
|
continue;
|
|
11870
|
-
seenInDestructure.add(
|
|
11870
|
+
seenInDestructure.add(name2);
|
|
11871
11871
|
const value = p["value"];
|
|
11872
11872
|
const hasDefault = value?.type === "AssignmentPattern";
|
|
11873
11873
|
const defaultValueRaw = hasDefault ? renderLiteral(value["right"]) : void 0;
|
|
11874
|
-
const typeMember = typeByName.get(
|
|
11874
|
+
const typeMember = typeByName.get(name2);
|
|
11875
11875
|
if (typeMember?.isSnippet) {
|
|
11876
|
-
snippetNames.add(
|
|
11876
|
+
snippetNames.add(name2);
|
|
11877
11877
|
const slot = {
|
|
11878
|
-
name,
|
|
11879
|
-
isDefault:
|
|
11878
|
+
name: name2,
|
|
11879
|
+
isDefault: name2 === "children",
|
|
11880
11880
|
...typeMember.description ? { description: typeMember.description } : {}
|
|
11881
11881
|
};
|
|
11882
11882
|
const authorText = typeMember.declaredTypeText ?? typeMember.typeText;
|
|
@@ -11887,7 +11887,7 @@ function extractFromDestructure(propsCall, _ctx, typeMembers, warnings, addition
|
|
|
11887
11887
|
}
|
|
11888
11888
|
const required = typeMember ? !typeMember.optional && !hasDefault : !hasDefault;
|
|
11889
11889
|
const propDef = {
|
|
11890
|
-
name,
|
|
11890
|
+
name: name2,
|
|
11891
11891
|
type: typeMember?.typeText ?? "unknown",
|
|
11892
11892
|
required
|
|
11893
11893
|
};
|
|
@@ -11945,9 +11945,9 @@ function propertyOrder(properties) {
|
|
|
11945
11945
|
for (const p of properties) {
|
|
11946
11946
|
if (p.type !== "Property")
|
|
11947
11947
|
continue;
|
|
11948
|
-
const
|
|
11949
|
-
if (
|
|
11950
|
-
m.set(
|
|
11948
|
+
const name2 = p["key"]?.["name"] ?? null;
|
|
11949
|
+
if (name2)
|
|
11950
|
+
m.set(name2, i++);
|
|
11951
11951
|
}
|
|
11952
11952
|
return m;
|
|
11953
11953
|
}
|
|
@@ -12126,10 +12126,10 @@ function extractTemplateSlots(fragment) {
|
|
|
12126
12126
|
if (!node)
|
|
12127
12127
|
return;
|
|
12128
12128
|
if (node.type === "SlotElement") {
|
|
12129
|
-
const
|
|
12130
|
-
if (!seen.has(
|
|
12131
|
-
seen.add(
|
|
12132
|
-
slots.push({ name, isDefault:
|
|
12129
|
+
const name2 = readSlotName(node);
|
|
12130
|
+
if (!seen.has(name2)) {
|
|
12131
|
+
seen.add(name2);
|
|
12132
|
+
slots.push({ name: name2, isDefault: name2 === "default" });
|
|
12133
12133
|
}
|
|
12134
12134
|
}
|
|
12135
12135
|
const children = node["nodes"] ?? node["children"] ?? [];
|
|
@@ -12328,9 +12328,9 @@ function extractDecoratorInput(field) {
|
|
|
12328
12328
|
}
|
|
12329
12329
|
const resolved = resolvePropType(typeNode);
|
|
12330
12330
|
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
12331
|
-
const
|
|
12331
|
+
const name2 = alias ?? fieldName;
|
|
12332
12332
|
const prop = {
|
|
12333
|
-
name,
|
|
12333
|
+
name: name2,
|
|
12334
12334
|
type: typeText,
|
|
12335
12335
|
required,
|
|
12336
12336
|
sourceStartLine: field.getStartLineNumber(),
|
|
@@ -12400,9 +12400,9 @@ function extractSignalInput(field) {
|
|
|
12400
12400
|
const typeArg = init.getTypeArguments()[0];
|
|
12401
12401
|
const resolved = resolvePropType(typeArg);
|
|
12402
12402
|
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
12403
|
-
const
|
|
12403
|
+
const name2 = alias ?? fieldName;
|
|
12404
12404
|
const prop = {
|
|
12405
|
-
name,
|
|
12405
|
+
name: name2,
|
|
12406
12406
|
type: typeText,
|
|
12407
12407
|
required,
|
|
12408
12408
|
sourceStartLine: field.getStartLineNumber(),
|
|
@@ -12485,10 +12485,10 @@ function extractProps2(cls, meta) {
|
|
|
12485
12485
|
const parsed = parseInputsArrayEntry(entry);
|
|
12486
12486
|
if (!parsed)
|
|
12487
12487
|
continue;
|
|
12488
|
-
const
|
|
12489
|
-
if (byName.has(
|
|
12488
|
+
const name2 = parsed.alias ?? parsed.fieldName;
|
|
12489
|
+
if (byName.has(name2))
|
|
12490
12490
|
continue;
|
|
12491
|
-
byName.set(
|
|
12491
|
+
byName.set(name2, { name: name2, type: "any", required: false });
|
|
12492
12492
|
}
|
|
12493
12493
|
return [...byName.values()];
|
|
12494
12494
|
}
|
|
@@ -12601,16 +12601,16 @@ async function resolveTemplateSource(meta) {
|
|
|
12601
12601
|
|
|
12602
12602
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/strip-library-prefix.js
|
|
12603
12603
|
var KNOWN_PREFIXES = ["Mat", "Cdk", "Nz", "Cds", "Ibm", "Clr", "Hlm", "Brn", "Tui", "Nb", "Fd", "P", "Ng"];
|
|
12604
|
-
function stripLibraryPrefix(
|
|
12604
|
+
function stripLibraryPrefix(name2) {
|
|
12605
12605
|
for (const prefix of KNOWN_PREFIXES) {
|
|
12606
|
-
if (
|
|
12607
|
-
const rest =
|
|
12606
|
+
if (name2.startsWith(prefix) && name2.length > prefix.length) {
|
|
12607
|
+
const rest = name2.slice(prefix.length);
|
|
12608
12608
|
if (rest[0] && rest[0] === rest[0].toUpperCase()) {
|
|
12609
12609
|
return rest;
|
|
12610
12610
|
}
|
|
12611
12611
|
}
|
|
12612
12612
|
}
|
|
12613
|
-
return
|
|
12613
|
+
return name2;
|
|
12614
12614
|
}
|
|
12615
12615
|
|
|
12616
12616
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/derive-slot-name.js
|
|
@@ -12678,8 +12678,8 @@ function extractContentChildQueries(cls) {
|
|
|
12678
12678
|
if (init && Node15.isCallExpression(init)) {
|
|
12679
12679
|
const callee = init.getExpression();
|
|
12680
12680
|
if (Node15.isIdentifier(callee)) {
|
|
12681
|
-
const
|
|
12682
|
-
if (
|
|
12681
|
+
const name2 = callee.getText();
|
|
12682
|
+
if (name2 === "contentChild" || name2 === "contentChildren") {
|
|
12683
12683
|
const first = init.getArguments()[0];
|
|
12684
12684
|
const allowed = resolveClassIdentifierArg(first);
|
|
12685
12685
|
out.push(buildSlot(fieldName, allowed));
|
|
@@ -12708,9 +12708,9 @@ function resolveClassIdentifierArg(arg) {
|
|
|
12708
12708
|
return [arg.getText()];
|
|
12709
12709
|
return [];
|
|
12710
12710
|
}
|
|
12711
|
-
function buildSlot(
|
|
12711
|
+
function buildSlot(name2, allowed) {
|
|
12712
12712
|
const slot = {
|
|
12713
|
-
name,
|
|
12713
|
+
name: name2,
|
|
12714
12714
|
isDefault: false
|
|
12715
12715
|
};
|
|
12716
12716
|
if (allowed.length > 0)
|
|
@@ -12744,11 +12744,11 @@ async function extractSlots3(cls, meta, props) {
|
|
|
12744
12744
|
const template = await resolveTemplateSource(meta);
|
|
12745
12745
|
if (template) {
|
|
12746
12746
|
for (const el of parseNgContentElements(template)) {
|
|
12747
|
-
const
|
|
12748
|
-
if (byName.has(
|
|
12747
|
+
const name2 = deriveSlotName(el.rawSelect, meta.normalizedName);
|
|
12748
|
+
if (byName.has(name2))
|
|
12749
12749
|
continue;
|
|
12750
|
-
byName.set(
|
|
12751
|
-
name,
|
|
12750
|
+
byName.set(name2, {
|
|
12751
|
+
name: name2,
|
|
12752
12752
|
isDefault: el.rawSelect === null
|
|
12753
12753
|
});
|
|
12754
12754
|
}
|
|
@@ -12830,9 +12830,9 @@ function normalizeSlots(slots) {
|
|
|
12830
12830
|
return slots.map((slot) => {
|
|
12831
12831
|
if (slot.name.trim())
|
|
12832
12832
|
return slot;
|
|
12833
|
-
const
|
|
12833
|
+
const name2 = fallbackIndex === 0 ? "children" : `slot_${fallbackIndex}`;
|
|
12834
12834
|
fallbackIndex++;
|
|
12835
|
-
return { ...slot, name };
|
|
12835
|
+
return { ...slot, name: name2 };
|
|
12836
12836
|
});
|
|
12837
12837
|
}
|
|
12838
12838
|
|
|
@@ -13547,8 +13547,8 @@ ${fileDigest}`);
|
|
|
13547
13547
|
|
|
13548
13548
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/edges/manifest-doc-evidence.js
|
|
13549
13549
|
import { dirname as dirname14 } from "node:path";
|
|
13550
|
-
function kebabToPascal3(
|
|
13551
|
-
return
|
|
13550
|
+
function kebabToPascal3(name2) {
|
|
13551
|
+
return name2.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
|
|
13552
13552
|
}
|
|
13553
13553
|
function collectManifestEdges(files, componentNames) {
|
|
13554
13554
|
const edges = [];
|
|
@@ -13940,9 +13940,9 @@ import { resolve as resolve16 } from "node:path";
|
|
|
13940
13940
|
|
|
13941
13941
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/create-component-id.js
|
|
13942
13942
|
import { createHash as createHash7 } from "node:crypto";
|
|
13943
|
-
function createComponentId(
|
|
13944
|
-
const sourceHash = createHash7("sha256").update(`${
|
|
13945
|
-
return `${
|
|
13943
|
+
function createComponentId(name2, resolvedSourcePath) {
|
|
13944
|
+
const sourceHash = createHash7("sha256").update(`${name2}:${resolvedSourcePath}`).digest("hex").slice(0, 12);
|
|
13945
|
+
return `${name2}-${sourceHash}`;
|
|
13946
13946
|
}
|
|
13947
13947
|
|
|
13948
13948
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/resolve-component-source-path.js
|
|
@@ -14239,10 +14239,10 @@ var CATEGORY_BY_EXTENSION = {
|
|
|
14239
14239
|
};
|
|
14240
14240
|
|
|
14241
14241
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/categorize-file.js
|
|
14242
|
-
function categorizeFile(
|
|
14243
|
-
if (
|
|
14242
|
+
function categorizeFile(name2) {
|
|
14243
|
+
if (name2.endsWith(".d.ts"))
|
|
14244
14244
|
return "other";
|
|
14245
|
-
const ext = path.extname(
|
|
14245
|
+
const ext = path.extname(name2);
|
|
14246
14246
|
return CATEGORY_BY_EXTENSION[ext] ?? "other";
|
|
14247
14247
|
}
|
|
14248
14248
|
|
|
@@ -14250,20 +14250,20 @@ function categorizeFile(name) {
|
|
|
14250
14250
|
import path2 from "node:path";
|
|
14251
14251
|
|
|
14252
14252
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-noise-config-file.js
|
|
14253
|
-
function isNoiseConfigFile(
|
|
14254
|
-
return DENYLISTED_EXACT_FILE_NAMES.has(
|
|
14253
|
+
function isNoiseConfigFile(name2) {
|
|
14254
|
+
return DENYLISTED_EXACT_FILE_NAMES.has(name2) || DENYLISTED_FILE_NAME_PATTERNS.some((pattern) => pattern.test(name2));
|
|
14255
14255
|
}
|
|
14256
14256
|
|
|
14257
14257
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-source-file.js
|
|
14258
|
-
function isSourceFile(
|
|
14259
|
-
if (
|
|
14258
|
+
function isSourceFile(name2) {
|
|
14259
|
+
if (name2.endsWith(".d.ts"))
|
|
14260
14260
|
return false;
|
|
14261
|
-
if (EXCLUDED_SUFFIXES.some((suffix) =>
|
|
14261
|
+
if (EXCLUDED_SUFFIXES.some((suffix) => name2.endsWith(suffix)))
|
|
14262
14262
|
return false;
|
|
14263
|
-
const ext = path2.extname(
|
|
14263
|
+
const ext = path2.extname(name2);
|
|
14264
14264
|
if (INCLUDED_EXTENSIONS.has(ext))
|
|
14265
14265
|
return true;
|
|
14266
|
-
if (DENYLIST_GATED_EXTENSIONS.has(ext) && !isNoiseConfigFile(
|
|
14266
|
+
if (DENYLIST_GATED_EXTENSIONS.has(ext) && !isNoiseConfigFile(name2))
|
|
14267
14267
|
return true;
|
|
14268
14268
|
return false;
|
|
14269
14269
|
}
|
|
@@ -14469,7 +14469,7 @@ async function buildSourceFingerprint(opts) {
|
|
|
14469
14469
|
const seen = /* @__PURE__ */ new Set();
|
|
14470
14470
|
for (const row of rows) {
|
|
14471
14471
|
const sourcePath = rowField(row, "source_path");
|
|
14472
|
-
const
|
|
14472
|
+
const name2 = rowField(row, "name");
|
|
14473
14473
|
if (!sourcePath)
|
|
14474
14474
|
continue;
|
|
14475
14475
|
const abs = resolve19(sourcePath);
|
|
@@ -14479,8 +14479,8 @@ async function buildSourceFingerprint(opts) {
|
|
|
14479
14479
|
try {
|
|
14480
14480
|
const st = await stat2(abs);
|
|
14481
14481
|
const entry = { mtime: st.mtime.toISOString() };
|
|
14482
|
-
if (
|
|
14483
|
-
entry.componentName =
|
|
14482
|
+
if (name2)
|
|
14483
|
+
entry.componentName = name2;
|
|
14484
14484
|
files[abs] = entry;
|
|
14485
14485
|
} catch {
|
|
14486
14486
|
}
|
|
@@ -14511,10 +14511,10 @@ var SAVE_FILES = ["components.json", "tokens.json"];
|
|
|
14511
14511
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/list-conflicting-files.js
|
|
14512
14512
|
async function listConflictingFiles(path5) {
|
|
14513
14513
|
const conflicts = [];
|
|
14514
|
-
for (const
|
|
14514
|
+
for (const name2 of SAVE_FILES) {
|
|
14515
14515
|
try {
|
|
14516
|
-
await access4(join14(path5,
|
|
14517
|
-
conflicts.push(
|
|
14516
|
+
await access4(join14(path5, name2));
|
|
14517
|
+
conflicts.push(name2);
|
|
14518
14518
|
} catch {
|
|
14519
14519
|
}
|
|
14520
14520
|
}
|
|
@@ -14731,18 +14731,18 @@ var separatorObjectExplode = (style) => {
|
|
|
14731
14731
|
return "&";
|
|
14732
14732
|
}
|
|
14733
14733
|
};
|
|
14734
|
-
var serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
|
|
14734
|
+
var serializeArrayParam = ({ allowReserved, explode, name: name2, style, value }) => {
|
|
14735
14735
|
if (!explode) {
|
|
14736
14736
|
const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
|
|
14737
14737
|
switch (style) {
|
|
14738
14738
|
case "label":
|
|
14739
14739
|
return `.${joinedValues2}`;
|
|
14740
14740
|
case "matrix":
|
|
14741
|
-
return `;${
|
|
14741
|
+
return `;${name2}=${joinedValues2}`;
|
|
14742
14742
|
case "simple":
|
|
14743
14743
|
return joinedValues2;
|
|
14744
14744
|
default:
|
|
14745
|
-
return `${
|
|
14745
|
+
return `${name2}=${joinedValues2}`;
|
|
14746
14746
|
}
|
|
14747
14747
|
}
|
|
14748
14748
|
const separator = separatorArrayExplode(style);
|
|
@@ -14752,24 +14752,24 @@ var serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
|
|
|
14752
14752
|
}
|
|
14753
14753
|
return serializePrimitiveParam({
|
|
14754
14754
|
allowReserved,
|
|
14755
|
-
name,
|
|
14755
|
+
name: name2,
|
|
14756
14756
|
value: v
|
|
14757
14757
|
});
|
|
14758
14758
|
}).join(separator);
|
|
14759
14759
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
14760
14760
|
};
|
|
14761
|
-
var serializePrimitiveParam = ({ allowReserved, name, value }) => {
|
|
14761
|
+
var serializePrimitiveParam = ({ allowReserved, name: name2, value }) => {
|
|
14762
14762
|
if (value === void 0 || value === null) {
|
|
14763
14763
|
return "";
|
|
14764
14764
|
}
|
|
14765
14765
|
if (typeof value === "object") {
|
|
14766
14766
|
throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
|
|
14767
14767
|
}
|
|
14768
|
-
return `${
|
|
14768
|
+
return `${name2}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
14769
14769
|
};
|
|
14770
|
-
var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly }) => {
|
|
14770
|
+
var serializeObjectParam = ({ allowReserved, explode, name: name2, style, value, valueOnly }) => {
|
|
14771
14771
|
if (value instanceof Date) {
|
|
14772
|
-
return valueOnly ? value.toISOString() : `${
|
|
14772
|
+
return valueOnly ? value.toISOString() : `${name2}=${value.toISOString()}`;
|
|
14773
14773
|
}
|
|
14774
14774
|
if (style !== "deepObject" && !explode) {
|
|
14775
14775
|
let values = [];
|
|
@@ -14783,11 +14783,11 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
14783
14783
|
const joinedValues2 = values.join(",");
|
|
14784
14784
|
switch (style) {
|
|
14785
14785
|
case "form":
|
|
14786
|
-
return `${
|
|
14786
|
+
return `${name2}=${joinedValues2}`;
|
|
14787
14787
|
case "label":
|
|
14788
14788
|
return `.${joinedValues2}`;
|
|
14789
14789
|
case "matrix":
|
|
14790
|
-
return `;${
|
|
14790
|
+
return `;${name2}=${joinedValues2}`;
|
|
14791
14791
|
default:
|
|
14792
14792
|
return joinedValues2;
|
|
14793
14793
|
}
|
|
@@ -14795,7 +14795,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
14795
14795
|
const separator = separatorObjectExplode(style);
|
|
14796
14796
|
const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
|
|
14797
14797
|
allowReserved,
|
|
14798
|
-
name: style === "deepObject" ? `${
|
|
14798
|
+
name: style === "deepObject" ? `${name2}[${key}]` : key,
|
|
14799
14799
|
value: v
|
|
14800
14800
|
})).join(separator);
|
|
14801
14801
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
@@ -14809,31 +14809,31 @@ var defaultPathSerializer = ({ path: path5, url: _url }) => {
|
|
|
14809
14809
|
if (matches) {
|
|
14810
14810
|
for (const match2 of matches) {
|
|
14811
14811
|
let explode = false;
|
|
14812
|
-
let
|
|
14812
|
+
let name2 = match2.substring(1, match2.length - 1);
|
|
14813
14813
|
let style = "simple";
|
|
14814
|
-
if (
|
|
14814
|
+
if (name2.endsWith("*")) {
|
|
14815
14815
|
explode = true;
|
|
14816
|
-
|
|
14816
|
+
name2 = name2.substring(0, name2.length - 1);
|
|
14817
14817
|
}
|
|
14818
|
-
if (
|
|
14819
|
-
|
|
14818
|
+
if (name2.startsWith(".")) {
|
|
14819
|
+
name2 = name2.substring(1);
|
|
14820
14820
|
style = "label";
|
|
14821
|
-
} else if (
|
|
14822
|
-
|
|
14821
|
+
} else if (name2.startsWith(";")) {
|
|
14822
|
+
name2 = name2.substring(1);
|
|
14823
14823
|
style = "matrix";
|
|
14824
14824
|
}
|
|
14825
|
-
const value = path5[
|
|
14825
|
+
const value = path5[name2];
|
|
14826
14826
|
if (value === void 0 || value === null) {
|
|
14827
14827
|
continue;
|
|
14828
14828
|
}
|
|
14829
14829
|
if (Array.isArray(value)) {
|
|
14830
|
-
url = url.replace(match2, serializeArrayParam({ explode, name, style, value }));
|
|
14830
|
+
url = url.replace(match2, serializeArrayParam({ explode, name: name2, style, value }));
|
|
14831
14831
|
continue;
|
|
14832
14832
|
}
|
|
14833
14833
|
if (typeof value === "object") {
|
|
14834
14834
|
url = url.replace(match2, serializeObjectParam({
|
|
14835
14835
|
explode,
|
|
14836
|
-
name,
|
|
14836
|
+
name: name2,
|
|
14837
14837
|
style,
|
|
14838
14838
|
value,
|
|
14839
14839
|
valueOnly: true
|
|
@@ -14842,7 +14842,7 @@ var defaultPathSerializer = ({ path: path5, url: _url }) => {
|
|
|
14842
14842
|
}
|
|
14843
14843
|
if (style === "matrix") {
|
|
14844
14844
|
url = url.replace(match2, `;${serializePrimitiveParam({
|
|
14845
|
-
name,
|
|
14845
|
+
name: name2,
|
|
14846
14846
|
value
|
|
14847
14847
|
})}`);
|
|
14848
14848
|
continue;
|
|
@@ -14853,12 +14853,12 @@ var defaultPathSerializer = ({ path: path5, url: _url }) => {
|
|
|
14853
14853
|
}
|
|
14854
14854
|
return url;
|
|
14855
14855
|
};
|
|
14856
|
-
var createQuerySerializer = ({ allowReserved, array:
|
|
14856
|
+
var createQuerySerializer = ({ allowReserved, array: array4, object } = {}) => {
|
|
14857
14857
|
const querySerializer = (queryParams) => {
|
|
14858
14858
|
const search = [];
|
|
14859
14859
|
if (queryParams && typeof queryParams === "object") {
|
|
14860
|
-
for (const
|
|
14861
|
-
const value = queryParams[
|
|
14860
|
+
for (const name2 in queryParams) {
|
|
14861
|
+
const value = queryParams[name2];
|
|
14862
14862
|
if (value === void 0 || value === null) {
|
|
14863
14863
|
continue;
|
|
14864
14864
|
}
|
|
@@ -14866,10 +14866,10 @@ var createQuerySerializer = ({ allowReserved, array: array3, object } = {}) => {
|
|
|
14866
14866
|
const serializedArray = serializeArrayParam({
|
|
14867
14867
|
allowReserved,
|
|
14868
14868
|
explode: true,
|
|
14869
|
-
name,
|
|
14869
|
+
name: name2,
|
|
14870
14870
|
style: "form",
|
|
14871
14871
|
value,
|
|
14872
|
-
...
|
|
14872
|
+
...array4
|
|
14873
14873
|
});
|
|
14874
14874
|
if (serializedArray)
|
|
14875
14875
|
search.push(serializedArray);
|
|
@@ -14877,7 +14877,7 @@ var createQuerySerializer = ({ allowReserved, array: array3, object } = {}) => {
|
|
|
14877
14877
|
const serializedObject = serializeObjectParam({
|
|
14878
14878
|
allowReserved,
|
|
14879
14879
|
explode: true,
|
|
14880
|
-
name,
|
|
14880
|
+
name: name2,
|
|
14881
14881
|
style: "deepObject",
|
|
14882
14882
|
value,
|
|
14883
14883
|
...object
|
|
@@ -14887,7 +14887,7 @@ var createQuerySerializer = ({ allowReserved, array: array3, object } = {}) => {
|
|
|
14887
14887
|
} else {
|
|
14888
14888
|
const serializedPrimitive = serializePrimitiveParam({
|
|
14889
14889
|
allowReserved,
|
|
14890
|
-
name,
|
|
14890
|
+
name: name2,
|
|
14891
14891
|
value
|
|
14892
14892
|
});
|
|
14893
14893
|
if (serializedPrimitive)
|
|
@@ -14921,11 +14921,11 @@ var getParseAs = (contentType) => {
|
|
|
14921
14921
|
}
|
|
14922
14922
|
return;
|
|
14923
14923
|
};
|
|
14924
|
-
var checkForExistence = (options,
|
|
14925
|
-
if (!
|
|
14924
|
+
var checkForExistence = (options, name2) => {
|
|
14925
|
+
if (!name2) {
|
|
14926
14926
|
return false;
|
|
14927
14927
|
}
|
|
14928
|
-
if (options.headers.has(
|
|
14928
|
+
if (options.headers.has(name2) || options.query?.[name2] || options.headers.get("Cookie")?.includes(`${name2}=`)) {
|
|
14929
14929
|
return true;
|
|
14930
14930
|
}
|
|
14931
14931
|
return false;
|
|
@@ -14939,20 +14939,20 @@ var setAuthParams = async ({ security, ...options }) => {
|
|
|
14939
14939
|
if (!token) {
|
|
14940
14940
|
continue;
|
|
14941
14941
|
}
|
|
14942
|
-
const
|
|
14942
|
+
const name2 = auth.name ?? "Authorization";
|
|
14943
14943
|
switch (auth.in) {
|
|
14944
14944
|
case "query":
|
|
14945
14945
|
if (!options.query) {
|
|
14946
14946
|
options.query = {};
|
|
14947
14947
|
}
|
|
14948
|
-
options.query[
|
|
14948
|
+
options.query[name2] = token;
|
|
14949
14949
|
break;
|
|
14950
14950
|
case "cookie":
|
|
14951
|
-
options.headers.append("Cookie", `${
|
|
14951
|
+
options.headers.append("Cookie", `${name2}=${token}`);
|
|
14952
14952
|
break;
|
|
14953
14953
|
case "header":
|
|
14954
14954
|
default:
|
|
14955
|
-
options.headers.set(
|
|
14955
|
+
options.headers.set(name2, token);
|
|
14956
14956
|
break;
|
|
14957
14957
|
}
|
|
14958
14958
|
}
|
|
@@ -15811,11 +15811,11 @@ function parseEdsiError(rawInput) {
|
|
|
15811
15811
|
...binding.diagnostics ? { diagnostics: binding.diagnostics } : {}
|
|
15812
15812
|
};
|
|
15813
15813
|
}
|
|
15814
|
-
const
|
|
15815
|
-
if (
|
|
15814
|
+
const literal4 = parseObjectLiteralTail(cleaned);
|
|
15815
|
+
if (literal4 && (literal4.code || literal4.cycle)) {
|
|
15816
15816
|
const braceStart = cleaned.lastIndexOf("{");
|
|
15817
15817
|
const head = braceStart === -1 ? cleaned : cleaned.slice(0, braceStart).trim();
|
|
15818
|
-
return { code:
|
|
15818
|
+
return { code: literal4.code ?? null, message: head || cleaned, cycle: literal4.cycle ?? null, raw: false };
|
|
15819
15819
|
}
|
|
15820
15820
|
return { code: null, message: cleaned || prefix || rawInput, cycle: null, raw: true };
|
|
15821
15821
|
}
|
|
@@ -16118,8 +16118,8 @@ function countCharacterEdits(a, b) {
|
|
|
16118
16118
|
}
|
|
16119
16119
|
|
|
16120
16120
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/helpers/existing-entities/simplify-name-for-comparison.js
|
|
16121
|
-
function simplifyNameForComparison(
|
|
16122
|
-
const stripped =
|
|
16121
|
+
function simplifyNameForComparison(name2) {
|
|
16122
|
+
const stripped = name2.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
16123
16123
|
return stripped.endsWith("s") && stripped.length > 1 ? stripped.slice(0, -1) : stripped;
|
|
16124
16124
|
}
|
|
16125
16125
|
|
|
@@ -16421,9 +16421,9 @@ init_cache_keys();
|
|
|
16421
16421
|
import { execFile } from "node:child_process";
|
|
16422
16422
|
import { promisify } from "node:util";
|
|
16423
16423
|
var execFileAsync = promisify(execFile);
|
|
16424
|
-
async function binaryExists(
|
|
16424
|
+
async function binaryExists(name2) {
|
|
16425
16425
|
try {
|
|
16426
|
-
await execFileAsync(process.platform === "win32" ? "where" : "which", [
|
|
16426
|
+
await execFileAsync(process.platform === "win32" ? "where" : "which", [name2]);
|
|
16427
16427
|
return true;
|
|
16428
16428
|
} catch {
|
|
16429
16429
|
return false;
|
|
@@ -16893,20 +16893,20 @@ function collectSiblingRendererImports(sourceText) {
|
|
|
16893
16893
|
continue;
|
|
16894
16894
|
if (/-g(?:ql|gl)(?:$|\.)/i.test(importPath))
|
|
16895
16895
|
continue;
|
|
16896
|
-
for (const
|
|
16897
|
-
if (
|
|
16898
|
-
names.add(
|
|
16896
|
+
for (const name2 of parseImportedNames(importClause)) {
|
|
16897
|
+
if (name2)
|
|
16898
|
+
names.add(name2);
|
|
16899
16899
|
}
|
|
16900
16900
|
}
|
|
16901
16901
|
return [...names];
|
|
16902
16902
|
}
|
|
16903
16903
|
function hasSiblingForwardRender(sourceText, siblingImports) {
|
|
16904
|
-
return siblingImports.some((
|
|
16905
|
-
const renderPattern = new RegExp(`<${escapeRegExp(
|
|
16904
|
+
return siblingImports.some((name2) => {
|
|
16905
|
+
const renderPattern = new RegExp(`<${escapeRegExp(name2)}\\b[\\s\\S]*?(?:/>|</${escapeRegExp(name2)}>)`);
|
|
16906
16906
|
if (!renderPattern.test(sourceText))
|
|
16907
16907
|
return false;
|
|
16908
|
-
const siblingSpreadPattern = new RegExp(`<${escapeRegExp(
|
|
16909
|
-
const propsPlusSiblingSpreadPattern = new RegExp(`<${escapeRegExp(
|
|
16908
|
+
const siblingSpreadPattern = new RegExp(`<${escapeRegExp(name2)}\\b[^>]*\\{\\.\\.\\.(?!props\\b)[^}]+\\}`);
|
|
16909
|
+
const propsPlusSiblingSpreadPattern = new RegExp(`<${escapeRegExp(name2)}\\b[^>]*\\{\\.\\.\\.props\\}[^>]*\\{\\.\\.\\.(?!props\\b)[^}]+\\}`);
|
|
16910
16910
|
return siblingSpreadPattern.test(sourceText) || propsPlusSiblingSpreadPattern.test(sourceText);
|
|
16911
16911
|
});
|
|
16912
16912
|
}
|
|
@@ -17153,34 +17153,34 @@ var DOM_PASS_THROUGH_PROPS = /* @__PURE__ */ new Set([
|
|
|
17153
17153
|
"modelValue",
|
|
17154
17154
|
"modelModifiers"
|
|
17155
17155
|
]);
|
|
17156
|
-
function isDomPassThroughProp(
|
|
17157
|
-
if (DOM_PASS_THROUGH_PROPS.has(
|
|
17156
|
+
function isDomPassThroughProp(name2) {
|
|
17157
|
+
if (DOM_PASS_THROUGH_PROPS.has(name2))
|
|
17158
17158
|
return true;
|
|
17159
|
-
if (/^aria[-A-Z]/.test(
|
|
17159
|
+
if (/^aria[-A-Z]/.test(name2))
|
|
17160
17160
|
return true;
|
|
17161
|
-
return
|
|
17161
|
+
return name2.startsWith("data-");
|
|
17162
17162
|
}
|
|
17163
17163
|
function preClassifyProp(prop) {
|
|
17164
|
-
const { name, type } = prop;
|
|
17165
|
-
if (/^on[A-Z]/.test(
|
|
17164
|
+
const { name: name2, type } = prop;
|
|
17165
|
+
if (/^on[A-Z]/.test(name2) || type.includes("=> void") || type.includes("EventHandler")) {
|
|
17166
17166
|
return { category: "exclude" };
|
|
17167
17167
|
}
|
|
17168
|
-
if (
|
|
17168
|
+
if (name2 === "ref" || name2 === "innerRef" || type.includes("Ref<") || type.includes("RefObject<")) {
|
|
17169
17169
|
return { category: "exclude" };
|
|
17170
17170
|
}
|
|
17171
|
-
if (
|
|
17171
|
+
if (name2 === "testId" || name2 === "data-testid" || name2 === "dataTestId") {
|
|
17172
17172
|
return { category: "exclude" };
|
|
17173
17173
|
}
|
|
17174
|
-
if (
|
|
17174
|
+
if (name2 === "key") {
|
|
17175
17175
|
return { category: "exclude" };
|
|
17176
17176
|
}
|
|
17177
17177
|
if (type.includes("Dispatch<") || type.includes("SetStateAction")) {
|
|
17178
17178
|
return { category: "exclude" };
|
|
17179
17179
|
}
|
|
17180
|
-
if (isDomPassThroughProp(
|
|
17180
|
+
if (isDomPassThroughProp(name2)) {
|
|
17181
17181
|
return { category: "exclude" };
|
|
17182
17182
|
}
|
|
17183
|
-
if (
|
|
17183
|
+
if (name2 === "name" && prop.domAttribute) {
|
|
17184
17184
|
return { category: "exclude" };
|
|
17185
17185
|
}
|
|
17186
17186
|
if (isStringLiteralUnion(type)) {
|
|
@@ -17189,36 +17189,36 @@ function preClassifyProp(prop) {
|
|
|
17189
17189
|
if (!isComplexType(type)) {
|
|
17190
17190
|
const designNameStart = /^(variant|size|spacing|gap|color|bg|theme|align|layout|orientation|position)/i;
|
|
17191
17191
|
const designNameEnd = /(Color|Size|Variant|Style)$/;
|
|
17192
|
-
if (designNameStart.test(
|
|
17192
|
+
if (designNameStart.test(name2) || designNameEnd.test(name2)) {
|
|
17193
17193
|
return { category: "design", cdfTypeHint: "string" };
|
|
17194
17194
|
}
|
|
17195
17195
|
}
|
|
17196
17196
|
if (isBooleanType(type)) {
|
|
17197
17197
|
const stateNames = ["disabled", "loading", "expanded", "isOpen", "selected", "checked", "active", "preview"];
|
|
17198
|
-
if (stateNames.includes(
|
|
17198
|
+
if (stateNames.includes(name2)) {
|
|
17199
17199
|
return { category: "state", cdfTypeHint: "boolean" };
|
|
17200
17200
|
}
|
|
17201
17201
|
}
|
|
17202
17202
|
if (isBooleanType(type)) {
|
|
17203
17203
|
const visualToggle = /^(hide|show|enable|disable|vertical|horizontal|reverse|bold|italic|imageOn|with)/i;
|
|
17204
|
-
if (visualToggle.test(
|
|
17204
|
+
if (visualToggle.test(name2)) {
|
|
17205
17205
|
return { category: "design", cdfTypeHint: "boolean" };
|
|
17206
17206
|
}
|
|
17207
17207
|
}
|
|
17208
|
-
if (
|
|
17208
|
+
if (name2 === "componentId" || name2 === "sectionKey" || name2 === "locale" || name2 === "variantIndex") {
|
|
17209
17209
|
return { category: "state", cdfTypeHint: "string" };
|
|
17210
17210
|
}
|
|
17211
17211
|
if (isStringType(type)) {
|
|
17212
17212
|
const urlNameStart = /^(href|url|link|src)/i;
|
|
17213
17213
|
const urlNameEnd = /(Url|Href|Link|Src)$/;
|
|
17214
|
-
if (urlNameStart.test(
|
|
17214
|
+
if (urlNameStart.test(name2) || urlNameEnd.test(name2)) {
|
|
17215
17215
|
return { category: "content", cdfTypeHint: "string" };
|
|
17216
17216
|
}
|
|
17217
17217
|
}
|
|
17218
17218
|
if (isStringType(type)) {
|
|
17219
17219
|
const textNameStart = /^(label|title|text|description|caption|heading|subheading|body|alt|name|placeholder|summary)/i;
|
|
17220
17220
|
const textNameEnd = /(Text|Label|Title|Name)$/;
|
|
17221
|
-
if (textNameStart.test(
|
|
17221
|
+
if (textNameStart.test(name2) || textNameEnd.test(name2)) {
|
|
17222
17222
|
return { category: "content", cdfTypeHint: "string" };
|
|
17223
17223
|
}
|
|
17224
17224
|
}
|
|
@@ -17427,7 +17427,7 @@ async function resolveComposition(request) {
|
|
|
17427
17427
|
timeoutMs: 12e4,
|
|
17428
17428
|
promptViaStdin: true,
|
|
17429
17429
|
bedrock,
|
|
17430
|
-
onDebugEvent: (
|
|
17430
|
+
onDebugEvent: (name2, payload) => onDebugEvent?.("agent", { event: name2, ...payload })
|
|
17431
17431
|
});
|
|
17432
17432
|
lastAgentExitCode = res.exitCode;
|
|
17433
17433
|
if (res.exitCode !== 0 && res.stderr.trim()) {
|
|
@@ -17688,7 +17688,7 @@ function collectDuplicateNames(components) {
|
|
|
17688
17688
|
sources.push(c2.source);
|
|
17689
17689
|
nameCounts.set(c2.name, sources);
|
|
17690
17690
|
}
|
|
17691
|
-
return [...nameCounts.entries()].filter(([, srcs]) => srcs.length > 1).map(([
|
|
17691
|
+
return [...nameCounts.entries()].filter(([, srcs]) => srcs.length > 1).map(([name2, sources]) => ({ name: name2, sources }));
|
|
17692
17692
|
}
|
|
17693
17693
|
|
|
17694
17694
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/filter-dropped-allowed-components.js
|
|
@@ -17779,7 +17779,7 @@ async function runOneGenerateComponent(options, component, index, total) {
|
|
|
17779
17779
|
});
|
|
17780
17780
|
}
|
|
17781
17781
|
}
|
|
17782
|
-
effectiveSlots = effectiveSlots.map((slot) => slot.allowedComponents ? { ...slot, allowedComponents: slot.allowedComponents.filter((
|
|
17782
|
+
effectiveSlots = effectiveSlots.map((slot) => slot.allowedComponents ? { ...slot, allowedComponents: slot.allowedComponents.filter((name2) => allowedComponentNames2.has(name2)) } : slot);
|
|
17783
17783
|
const cacheComponent = normalizeComponentForCache(component);
|
|
17784
17784
|
if (!noCache && precomputedCachedNames.has(component.name)) {
|
|
17785
17785
|
onProgress?.({ kind: "component:cached", index, total, name: component.name, pinned: false });
|
|
@@ -19618,7 +19618,7 @@ function collectDependents(components) {
|
|
|
19618
19618
|
function findRoots(components, selected) {
|
|
19619
19619
|
const scope = selected ? components.filter((c2) => selected.has(c2.name)) : components;
|
|
19620
19620
|
const dependents = collectDependents(scope);
|
|
19621
|
-
return scope.map((c2) => c2.name).filter((
|
|
19621
|
+
return scope.map((c2) => c2.name).filter((name2) => !dependents.has(name2)).sort();
|
|
19622
19622
|
}
|
|
19623
19623
|
function findCycleInClosure(root, reachable, components) {
|
|
19624
19624
|
const scopedComponents = components.filter((c2) => reachable.has(c2.name)).map((c2) => ({ name: c2.name, slots: c2.slots }));
|
|
@@ -19654,9 +19654,9 @@ function computeClosure(root, components) {
|
|
|
19654
19654
|
const reachable = walkReachable2(root, byName, known);
|
|
19655
19655
|
const cyclePath = findCycleInClosure(root, reachable, components);
|
|
19656
19656
|
if (cyclePath) {
|
|
19657
|
-
const nodes2 = [...reachable].sort().map((
|
|
19658
|
-
name,
|
|
19659
|
-
depth:
|
|
19657
|
+
const nodes2 = [...reachable].sort().map((name2) => ({
|
|
19658
|
+
name: name2,
|
|
19659
|
+
depth: name2 === root ? 0 : 1,
|
|
19660
19660
|
path: [root],
|
|
19661
19661
|
parents: []
|
|
19662
19662
|
}));
|
|
@@ -19692,12 +19692,12 @@ function computeClosure(root, components) {
|
|
|
19692
19692
|
}
|
|
19693
19693
|
}
|
|
19694
19694
|
const nodes = [];
|
|
19695
|
-
for (const [
|
|
19695
|
+
for (const [name2, d] of depth.entries()) {
|
|
19696
19696
|
nodes.push({
|
|
19697
|
-
name,
|
|
19697
|
+
name: name2,
|
|
19698
19698
|
depth: d,
|
|
19699
|
-
path: parentPath.get(
|
|
19700
|
-
parents: [...parents.get(
|
|
19699
|
+
path: parentPath.get(name2),
|
|
19700
|
+
parents: [...parents.get(name2) ?? /* @__PURE__ */ new Set()].sort()
|
|
19701
19701
|
});
|
|
19702
19702
|
}
|
|
19703
19703
|
nodes.sort((a, b) => a.depth - b.depth || a.name.localeCompare(b.name));
|
|
@@ -19720,8 +19720,8 @@ function findSharedDeps(closures) {
|
|
|
19720
19720
|
}
|
|
19721
19721
|
}
|
|
19722
19722
|
const out = /* @__PURE__ */ new Map();
|
|
19723
|
-
for (const [
|
|
19724
|
-
if (roots.length >= 2) out.set(
|
|
19723
|
+
for (const [name2, roots] of counts.entries()) {
|
|
19724
|
+
if (roots.length >= 2) out.set(name2, [...roots].sort());
|
|
19725
19725
|
}
|
|
19726
19726
|
return out;
|
|
19727
19727
|
}
|
|
@@ -19924,13 +19924,13 @@ function buildVisibleRows(props) {
|
|
|
19924
19924
|
...findRoots(subgraph),
|
|
19925
19925
|
...subgraph.filter((n) => hasDirectChild(n)).map((n) => n.name)
|
|
19926
19926
|
]);
|
|
19927
|
-
for (const
|
|
19928
|
-
const full = computeClosure(
|
|
19929
|
-
closures.set(
|
|
19927
|
+
for (const name2 of [...parentNames].sort()) {
|
|
19928
|
+
const full = computeClosure(name2, subgraph);
|
|
19929
|
+
closures.set(name2, { ...full, nodes: full.nodes.filter((n) => n.depth <= 1) });
|
|
19930
19930
|
}
|
|
19931
19931
|
const sharedDeps = findSharedDeps(closures);
|
|
19932
|
-
const hasCycleDepDirect = (
|
|
19933
|
-
const it = itemByKey.get(
|
|
19932
|
+
const hasCycleDepDirect = (name2) => {
|
|
19933
|
+
const it = itemByKey.get(name2)?.it;
|
|
19934
19934
|
if (!it) return false;
|
|
19935
19935
|
for (const target of allowedComponentNames(it.entry)) {
|
|
19936
19936
|
if (cycleParticipants.has(target)) return true;
|
|
@@ -20035,28 +20035,28 @@ function buildVisibleRows(props) {
|
|
|
20035
20035
|
});
|
|
20036
20036
|
});
|
|
20037
20037
|
}
|
|
20038
|
-
for (const
|
|
20039
|
-
const rec = itemByKey.get(
|
|
20038
|
+
for (const name2 of standaloneRoots) {
|
|
20039
|
+
const rec = itemByKey.get(name2);
|
|
20040
20040
|
if (!rec) continue;
|
|
20041
20041
|
rows.push({
|
|
20042
20042
|
kind: "standalone",
|
|
20043
|
-
key: `stand:${
|
|
20044
|
-
label:
|
|
20043
|
+
key: `stand:${name2}`,
|
|
20044
|
+
label: name2,
|
|
20045
20045
|
indent: 0,
|
|
20046
20046
|
itemIdx: rec.idx
|
|
20047
20047
|
});
|
|
20048
20048
|
}
|
|
20049
20049
|
const nodeByName = new Map(subgraph.map((n) => [n.name, n]));
|
|
20050
|
-
const sharedLeafNames = [...sharedDeps.keys()].filter((
|
|
20050
|
+
const sharedLeafNames = [...sharedDeps.keys()].filter((name2) => (nodeByName.get(name2)?.slots.length ?? 0) === 0).sort();
|
|
20051
20051
|
const seenStandaloneNames = new Set(standaloneRoots);
|
|
20052
|
-
for (const
|
|
20053
|
-
if (seenStandaloneNames.has(
|
|
20054
|
-
const rec = itemByKey.get(
|
|
20052
|
+
for (const name2 of sharedLeafNames) {
|
|
20053
|
+
if (seenStandaloneNames.has(name2)) continue;
|
|
20054
|
+
const rec = itemByKey.get(name2);
|
|
20055
20055
|
if (!rec) continue;
|
|
20056
20056
|
rows.push({
|
|
20057
20057
|
kind: "standalone",
|
|
20058
|
-
key: `shared-standalone:${
|
|
20059
|
-
label: `${
|
|
20058
|
+
key: `shared-standalone:${name2}`,
|
|
20059
|
+
label: `${name2} (shared)`,
|
|
20060
20060
|
indent: 0,
|
|
20061
20061
|
sharedSuffix: true,
|
|
20062
20062
|
itemIdx: rec.idx
|
|
@@ -20072,13 +20072,13 @@ function buildVisibleRows(props) {
|
|
|
20072
20072
|
indent: 0,
|
|
20073
20073
|
itemIdx: -1
|
|
20074
20074
|
});
|
|
20075
|
-
for (const
|
|
20076
|
-
const rec = itemByKey.get(
|
|
20075
|
+
for (const name2 of flatNames) {
|
|
20076
|
+
const rec = itemByKey.get(name2);
|
|
20077
20077
|
if (!rec) continue;
|
|
20078
20078
|
rows.push({
|
|
20079
20079
|
kind: "flat",
|
|
20080
|
-
key: `flat:${
|
|
20081
|
-
label:
|
|
20080
|
+
key: `flat:${name2}`,
|
|
20081
|
+
label: name2,
|
|
20082
20082
|
indent: 0,
|
|
20083
20083
|
itemIdx: rec.idx
|
|
20084
20084
|
});
|
|
@@ -20088,9 +20088,9 @@ function buildVisibleRows(props) {
|
|
|
20088
20088
|
if (filterVisibleKeys !== void 0) {
|
|
20089
20089
|
return rows.filter((row) => {
|
|
20090
20090
|
if (row.itemIdx < 0) return true;
|
|
20091
|
-
const
|
|
20092
|
-
if (
|
|
20093
|
-
return filterVisibleKeys.has(
|
|
20091
|
+
const name2 = items[row.itemIdx]?.key;
|
|
20092
|
+
if (name2 === void 0) return true;
|
|
20093
|
+
return filterVisibleKeys.has(name2);
|
|
20094
20094
|
});
|
|
20095
20095
|
}
|
|
20096
20096
|
return rows;
|
|
@@ -20735,11 +20735,11 @@ function computeCycleAwareAcceptCascade(target, components, cycleUnits) {
|
|
|
20735
20735
|
const byName = new Map(components.map((c2) => [c2.name, c2]));
|
|
20736
20736
|
const visited = /* @__PURE__ */ new Set();
|
|
20737
20737
|
const queue = [];
|
|
20738
|
-
const enqueue = (
|
|
20739
|
-
if (visited.has(
|
|
20740
|
-
visited.add(
|
|
20741
|
-
queue.push(
|
|
20742
|
-
const unit = cycleUnits.get(
|
|
20738
|
+
const enqueue = (name2) => {
|
|
20739
|
+
if (visited.has(name2)) return;
|
|
20740
|
+
visited.add(name2);
|
|
20741
|
+
queue.push(name2);
|
|
20742
|
+
const unit = cycleUnits.get(name2);
|
|
20743
20743
|
if (unit) {
|
|
20744
20744
|
for (const member of unit) {
|
|
20745
20745
|
if (!visited.has(member)) {
|
|
@@ -20864,7 +20864,7 @@ function buildScopeGraph(components) {
|
|
|
20864
20864
|
cycles = [];
|
|
20865
20865
|
}
|
|
20866
20866
|
const cycleParticipants = /* @__PURE__ */ new Set();
|
|
20867
|
-
for (const cycle of cycles) for (const
|
|
20867
|
+
for (const cycle of cycles) for (const name2 of cycle.path) cycleParticipants.add(name2);
|
|
20868
20868
|
return {
|
|
20869
20869
|
nodes,
|
|
20870
20870
|
cycles,
|
|
@@ -21052,10 +21052,10 @@ function computeSidebarBudget({ rows, panelOpen, entryCount }) {
|
|
|
21052
21052
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/sidebar-navigation.ts
|
|
21053
21053
|
function collectExpandedGroupRoots(closures, cycleParticipants) {
|
|
21054
21054
|
const roots = /* @__PURE__ */ new Set();
|
|
21055
|
-
for (const [
|
|
21056
|
-
if (closure.nodes.length > 1) roots.add(
|
|
21055
|
+
for (const [name2, closure] of closures.entries()) {
|
|
21056
|
+
if (closure.nodes.length > 1) roots.add(name2);
|
|
21057
21057
|
}
|
|
21058
|
-
for (const
|
|
21058
|
+
for (const name2 of cycleParticipants) roots.add(name2);
|
|
21059
21059
|
return roots;
|
|
21060
21060
|
}
|
|
21061
21061
|
function computeSidebarViewToggle({
|
|
@@ -21126,9 +21126,9 @@ function buildFlatDimPredicate(input) {
|
|
|
21126
21126
|
const isFlat = input.viewMode === "flat";
|
|
21127
21127
|
const keys = isFlat ? input.filterVisibleKeys : void 0;
|
|
21128
21128
|
if (!hasSearch && keys === void 0) return void 0;
|
|
21129
|
-
return (
|
|
21130
|
-
if (hasSearch && !fuzzyMatches(input.searchQuery,
|
|
21131
|
-
if (keys !== void 0 && !keys.has(
|
|
21129
|
+
return (name2) => {
|
|
21130
|
+
if (hasSearch && !fuzzyMatches(input.searchQuery, name2)) return true;
|
|
21131
|
+
if (keys !== void 0 && !keys.has(name2)) return true;
|
|
21132
21132
|
return false;
|
|
21133
21133
|
};
|
|
21134
21134
|
}
|
|
@@ -21136,7 +21136,7 @@ function buildFlatDimPredicate(input) {
|
|
|
21136
21136
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/state.ts
|
|
21137
21137
|
function apply(state2, entries) {
|
|
21138
21138
|
const next = new Map(state2);
|
|
21139
|
-
for (const [
|
|
21139
|
+
for (const [name2, decision] of entries) next.set(name2, decision);
|
|
21140
21140
|
return next;
|
|
21141
21141
|
}
|
|
21142
21142
|
function reduceDecisions(state2, action, components, graph) {
|
|
@@ -21145,44 +21145,44 @@ function reduceDecisions(state2, action, components, graph) {
|
|
|
21145
21145
|
if (state2.get(action.name) === "accepted") return state2;
|
|
21146
21146
|
return apply(
|
|
21147
21147
|
state2,
|
|
21148
|
-
acceptCascade(graph, action.name).map((
|
|
21148
|
+
acceptCascade(graph, action.name).map((name2) => [name2, "accepted"])
|
|
21149
21149
|
);
|
|
21150
21150
|
}
|
|
21151
21151
|
case "reject": {
|
|
21152
21152
|
if (state2.get(action.name) === "rejected") return state2;
|
|
21153
21153
|
const { toReject, toDeselect } = rejectCascade(graph, action.name);
|
|
21154
21154
|
return apply(state2, [
|
|
21155
|
-
...toReject.map((
|
|
21156
|
-
...toDeselect.map((
|
|
21155
|
+
...toReject.map((name2) => [name2, "rejected"]),
|
|
21156
|
+
...toDeselect.map((name2) => [name2, "undecided"])
|
|
21157
21157
|
]);
|
|
21158
21158
|
}
|
|
21159
21159
|
case "toggle-all": {
|
|
21160
21160
|
const nonCycle = components.filter((c2) => !graph.cycleParticipants.has(c2.name)).map((c2) => c2.name);
|
|
21161
|
-
const anyNotAccepted = nonCycle.some((
|
|
21161
|
+
const anyNotAccepted = nonCycle.some((name2) => state2.get(name2) !== "accepted");
|
|
21162
21162
|
if (anyNotAccepted) {
|
|
21163
21163
|
return apply(state2, [
|
|
21164
|
-
...nonCycle.map((
|
|
21165
|
-
...reachableCycleMembers(graph, nonCycle).map((
|
|
21164
|
+
...nonCycle.map((name2) => [name2, "accepted"]),
|
|
21165
|
+
...reachableCycleMembers(graph, nonCycle).map((name2) => [name2, "accepted"])
|
|
21166
21166
|
]);
|
|
21167
21167
|
}
|
|
21168
21168
|
return apply(state2, [
|
|
21169
|
-
...nonCycle.map((
|
|
21169
|
+
...nonCycle.map((name2) => [name2, "rejected"]),
|
|
21170
21170
|
...components.filter((c2) => graph.cycleParticipants.has(c2.name) && state2.get(c2.name) === "accepted").map((c2) => [c2.name, "undecided"])
|
|
21171
21171
|
]);
|
|
21172
21172
|
}
|
|
21173
21173
|
case "accept-unflagged": {
|
|
21174
21174
|
const seeds = components.filter((c2) => !graph.cycleParticipants.has(c2.name) && !isAiFlagged(c2)).map((c2) => c2.name);
|
|
21175
21175
|
return apply(state2, [
|
|
21176
|
-
...seeds.map((
|
|
21177
|
-
...reachableCycleMembers(graph, seeds).map((
|
|
21176
|
+
...seeds.map((name2) => [name2, "accepted"]),
|
|
21177
|
+
...reachableCycleMembers(graph, seeds).map((name2) => [name2, "accepted"])
|
|
21178
21178
|
]);
|
|
21179
21179
|
}
|
|
21180
21180
|
}
|
|
21181
21181
|
}
|
|
21182
|
-
function rejectNeedsConfirmation(graph,
|
|
21183
|
-
if (state2.get(
|
|
21184
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
21185
|
-
const ancestors = toReject.filter((n) => n !==
|
|
21182
|
+
function rejectNeedsConfirmation(graph, name2, state2) {
|
|
21183
|
+
if (state2.get(name2) === "rejected") return false;
|
|
21184
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
21185
|
+
const ancestors = toReject.filter((n) => n !== name2);
|
|
21186
21186
|
return ancestors.length + toDeselect.length >= 2;
|
|
21187
21187
|
}
|
|
21188
21188
|
function partitionDecisions(components, state2) {
|
|
@@ -21272,8 +21272,8 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21272
21272
|
for (const node of closure.nodes) keys.add(node.name);
|
|
21273
21273
|
}
|
|
21274
21274
|
for (const unit of cycleUnits.values()) {
|
|
21275
|
-
if (![...unit].some((
|
|
21276
|
-
for (const
|
|
21275
|
+
if (![...unit].some((name2) => decisions.get(name2) === "accepted")) continue;
|
|
21276
|
+
for (const name2 of unit) keys.add(name2);
|
|
21277
21277
|
}
|
|
21278
21278
|
return keys;
|
|
21279
21279
|
}, [closures, cycleUnits, showDependencies, decisions]);
|
|
@@ -21371,12 +21371,12 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21371
21371
|
return void 0;
|
|
21372
21372
|
}
|
|
21373
21373
|
};
|
|
21374
|
-
const jumpCursorTo = (
|
|
21374
|
+
const jumpCursorTo = (name2) => {
|
|
21375
21375
|
let idx = -1;
|
|
21376
21376
|
for (let i = 0; i < visibleRows.length; i++) {
|
|
21377
21377
|
const row = visibleRows[i];
|
|
21378
21378
|
if (row.itemIdx < 0) continue;
|
|
21379
|
-
if (groupedItems[row.itemIdx]?.key ===
|
|
21379
|
+
if (groupedItems[row.itemIdx]?.key === name2) {
|
|
21380
21380
|
idx = i;
|
|
21381
21381
|
break;
|
|
21382
21382
|
}
|
|
@@ -21390,18 +21390,18 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21390
21390
|
});
|
|
21391
21391
|
};
|
|
21392
21392
|
const decide = (action) => setDecisions((prev) => reduceDecisions(prev, action, components, graph));
|
|
21393
|
-
const requestReject = (
|
|
21394
|
-
if (decisions.get(
|
|
21395
|
-
if (rejectNeedsConfirmation(graph,
|
|
21396
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
21393
|
+
const requestReject = (name2) => {
|
|
21394
|
+
if (decisions.get(name2) === "rejected") return;
|
|
21395
|
+
if (rejectNeedsConfirmation(graph, name2, decisions)) {
|
|
21396
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
21397
21397
|
setPendingRejectCascade({
|
|
21398
|
-
target:
|
|
21399
|
-
ancestors: toReject.filter((n) => n !==
|
|
21398
|
+
target: name2,
|
|
21399
|
+
ancestors: toReject.filter((n) => n !== name2).sort(),
|
|
21400
21400
|
descendants: [...toDeselect].sort()
|
|
21401
21401
|
});
|
|
21402
21402
|
return;
|
|
21403
21403
|
}
|
|
21404
|
-
decide({ type: "reject", name });
|
|
21404
|
+
decide({ type: "reject", name: name2 });
|
|
21405
21405
|
};
|
|
21406
21406
|
const mode = showHelp ? "help" : pendingRejectCascade ? "reject-prompt" : searchOpen ? "search" : cyclesPanelOpen ? "cycles" : aiRationalePanel.isOpen ? "flags" : "main";
|
|
21407
21407
|
const context = {
|
|
@@ -21880,25 +21880,25 @@ function formatAcceptanceSummary(counts) {
|
|
|
21880
21880
|
if (counts.autoRejected === 0) return `${accepted}.`;
|
|
21881
21881
|
return `${accepted}, ${counts.autoRejected} excluded due to validation errors.`;
|
|
21882
21882
|
}
|
|
21883
|
-
var capitalize = (
|
|
21883
|
+
var capitalize = (name2) => name2.charAt(0).toUpperCase() + name2.slice(1);
|
|
21884
21884
|
function describeGeneration(input) {
|
|
21885
21885
|
const agent = capitalize(input.agent);
|
|
21886
21886
|
return `${formatAcceptanceSummary({ accepted: input.acceptedCount, autoRejected: 0 })}
|
|
21887
21887
|
${agent} is reading each selected component and writing a Contentful component definition for it.${input.hasTokens ? "\nUsing your design tokens for prop resolution." : ""}`;
|
|
21888
21888
|
}
|
|
21889
21889
|
function progressRows2(progress, agent) {
|
|
21890
|
-
const
|
|
21890
|
+
const name2 = capitalize(agent);
|
|
21891
21891
|
const { components, mapTokens } = progress;
|
|
21892
21892
|
const rows = [
|
|
21893
21893
|
{
|
|
21894
|
-
text: components ? components.current : `Starting up ${
|
|
21894
|
+
text: components ? components.current : `Starting up ${name2}...`,
|
|
21895
21895
|
complete: false,
|
|
21896
21896
|
...components ? { progress: { done: components.done, total: components.total } } : {}
|
|
21897
21897
|
}
|
|
21898
21898
|
];
|
|
21899
21899
|
if (mapTokens !== "idle") {
|
|
21900
21900
|
rows.push({
|
|
21901
|
-
text: mapTokens === "running" ? `Mapping token restrictions via ${
|
|
21901
|
+
text: mapTokens === "running" ? `Mapping token restrictions via ${name2}...` : "Token restrictions ready",
|
|
21902
21902
|
complete: mapTokens === "complete"
|
|
21903
21903
|
});
|
|
21904
21904
|
}
|
|
@@ -22139,6 +22139,18 @@ function buildFlowStart(input) {
|
|
|
22139
22139
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
22140
22140
|
import { Box as Box45 } from "ink";
|
|
22141
22141
|
|
|
22142
|
+
// packages/experience-design-system-types/dist/src/source-input-association.js
|
|
22143
|
+
import * as z3 from "zod/mini";
|
|
22144
|
+
var name = z3.string().check(z3.refine((value) => value.trim().length > 0));
|
|
22145
|
+
var SourceInputAssociationSchema = z3.strictObject({
|
|
22146
|
+
schemaVersion: z3.literal(1),
|
|
22147
|
+
componentId: name,
|
|
22148
|
+
componentDeclarationId: name,
|
|
22149
|
+
rootSymbolId: name,
|
|
22150
|
+
inputName: name,
|
|
22151
|
+
inputPath: z3.array(name).check(z3.minLength(1))
|
|
22152
|
+
}).check(z3.refine((value) => value.inputPath[0] === value.inputName));
|
|
22153
|
+
|
|
22142
22154
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
22143
22155
|
import { Ajv as Ajv2 } from "ajv";
|
|
22144
22156
|
|
|
@@ -22307,32 +22319,32 @@ function validateCDF2(input) {
|
|
|
22307
22319
|
}
|
|
22308
22320
|
|
|
22309
22321
|
// packages/experience-design-system-types/dist/src/cdf/types.js
|
|
22310
|
-
import * as
|
|
22311
|
-
var CDFPropertySchema2 =
|
|
22312
|
-
$type:
|
|
22313
|
-
$category:
|
|
22314
|
-
$description:
|
|
22315
|
-
$required:
|
|
22316
|
-
$default:
|
|
22317
|
-
$values:
|
|
22318
|
-
"$token.kind":
|
|
22319
|
-
"$token.allowed":
|
|
22322
|
+
import * as z4 from "zod/mini";
|
|
22323
|
+
var CDFPropertySchema2 = z4.strictObject({
|
|
22324
|
+
$type: z4.enum(CDF_PROPERTY_TYPES2),
|
|
22325
|
+
$category: z4.enum(CDF_PROPERTY_CATEGORIES2),
|
|
22326
|
+
$description: z4.optional(z4.string()),
|
|
22327
|
+
$required: z4.optional(z4.boolean()),
|
|
22328
|
+
$default: z4.optional(z4.any()),
|
|
22329
|
+
$values: z4.optional(z4.array(z4.string())),
|
|
22330
|
+
"$token.kind": z4.optional(z4.string()),
|
|
22331
|
+
"$token.allowed": z4.optional(z4.array(z4.string()))
|
|
22320
22332
|
});
|
|
22321
|
-
var CDFSlotSchema2 =
|
|
22322
|
-
$description:
|
|
22323
|
-
$allowedComponents:
|
|
22324
|
-
$required:
|
|
22333
|
+
var CDFSlotSchema2 = z4.strictObject({
|
|
22334
|
+
$description: z4.optional(z4.string()),
|
|
22335
|
+
$allowedComponents: z4.optional(z4.array(z4.string())),
|
|
22336
|
+
$required: z4.optional(z4.boolean())
|
|
22325
22337
|
});
|
|
22326
|
-
var CDFComponentSchema2 =
|
|
22327
|
-
$type:
|
|
22328
|
-
$description:
|
|
22329
|
-
$properties:
|
|
22330
|
-
$slots:
|
|
22338
|
+
var CDFComponentSchema2 = z4.strictObject({
|
|
22339
|
+
$type: z4.literal("component"),
|
|
22340
|
+
$description: z4.optional(z4.string()),
|
|
22341
|
+
$properties: z4.record(z4.string(), CDFPropertySchema2),
|
|
22342
|
+
$slots: z4.optional(z4.record(z4.string(), CDFSlotSchema2))
|
|
22331
22343
|
});
|
|
22332
|
-
var CDFTokenSchema2 =
|
|
22333
|
-
$type:
|
|
22334
|
-
$value:
|
|
22335
|
-
$description:
|
|
22344
|
+
var CDFTokenSchema2 = z4.strictObject({
|
|
22345
|
+
$type: z4.enum(DESIGN_TOKEN_TYPES2),
|
|
22346
|
+
$value: z4.unknown(),
|
|
22347
|
+
$description: z4.optional(z4.string())
|
|
22336
22348
|
});
|
|
22337
22349
|
|
|
22338
22350
|
// packages/experience-design-system-types/dist/src/cdf/build.js
|
|
@@ -22340,9 +22352,9 @@ function stripUnsupportedSlotFields(entry) {
|
|
|
22340
22352
|
if (!entry.$slots)
|
|
22341
22353
|
return entry;
|
|
22342
22354
|
const cleaned = {};
|
|
22343
|
-
for (const [
|
|
22355
|
+
for (const [name2, slot] of Object.entries(entry.$slots)) {
|
|
22344
22356
|
const { $required: _required, ...rest } = slot;
|
|
22345
|
-
cleaned[
|
|
22357
|
+
cleaned[name2] = rest;
|
|
22346
22358
|
}
|
|
22347
22359
|
return { ...entry, $slots: cleaned };
|
|
22348
22360
|
}
|
|
@@ -22385,7 +22397,7 @@ function validateSlotReferences2(components) {
|
|
|
22385
22397
|
const slots = entry.$slots ?? {};
|
|
22386
22398
|
for (const [slotKey, slot] of Object.entries(slots)) {
|
|
22387
22399
|
const allowed = slot?.$allowedComponents ?? [];
|
|
22388
|
-
const unresolved = allowed.filter((
|
|
22400
|
+
const unresolved = allowed.filter((name2) => !componentKeys.has(name2));
|
|
22389
22401
|
if (unresolved.length === 0)
|
|
22390
22402
|
continue;
|
|
22391
22403
|
errors.push({
|
|
@@ -22411,12 +22423,12 @@ function setAtPath(root, dottedPath, value) {
|
|
|
22411
22423
|
}
|
|
22412
22424
|
|
|
22413
22425
|
// packages/experience-design-system-types/dist/src/dtcg/types.js
|
|
22414
|
-
import * as
|
|
22415
|
-
var DTCGTokenSchema2 =
|
|
22416
|
-
path:
|
|
22417
|
-
$type:
|
|
22418
|
-
$value:
|
|
22419
|
-
$description:
|
|
22426
|
+
import * as z5 from "zod/mini";
|
|
22427
|
+
var DTCGTokenSchema2 = z5.strictObject({
|
|
22428
|
+
path: z5.string(),
|
|
22429
|
+
$type: z5.enum(DESIGN_TOKEN_TYPES2),
|
|
22430
|
+
$value: z5.unknown(),
|
|
22431
|
+
$description: z5.optional(z5.string())
|
|
22420
22432
|
});
|
|
22421
22433
|
|
|
22422
22434
|
// packages/experience-design-system-types/dist/src/dtcg/validate.js
|
|
@@ -22426,8 +22438,8 @@ var TOKEN_TYPE_SET4 = new Set(DESIGN_TOKEN_TYPES2);
|
|
|
22426
22438
|
var nodeTypes = globalThis.process?.getBuiltinModule?.("node:util")?.types;
|
|
22427
22439
|
|
|
22428
22440
|
// packages/experience-design-system-types/dist/src/property-contract/date-time-value.js
|
|
22429
|
-
import * as
|
|
22430
|
-
var dateTimeValueSchema =
|
|
22441
|
+
import * as z6 from "zod/mini";
|
|
22442
|
+
var dateTimeValueSchema = z6.iso.datetime({ offset: true });
|
|
22431
22443
|
|
|
22432
22444
|
// packages/experience-design-system-types/dist/src/property-contract/target-definition.js
|
|
22433
22445
|
var TARGET_PROPERTY_TYPES = [
|
|
@@ -22515,7 +22527,7 @@ function failedComponentNames(errors) {
|
|
|
22515
22527
|
return [...new Set(errors.map((error) => error.componentName))];
|
|
22516
22528
|
}
|
|
22517
22529
|
function matchedComponentNames(errors, missingNames) {
|
|
22518
|
-
return failedComponentNames(errors).filter((
|
|
22530
|
+
return failedComponentNames(errors).filter((name2) => !missingNames.includes(name2));
|
|
22519
22531
|
}
|
|
22520
22532
|
function formatErrorLine(error) {
|
|
22521
22533
|
const context = [`Component: ${error.componentName}`, error.path ? `Path: ${error.path}` : null].filter(Boolean);
|
|
@@ -22645,11 +22657,11 @@ function computeRenderStatuses(closure, directIssues) {
|
|
|
22645
22657
|
inheritedSources.get(ancestor).set(node.name, ownStatus);
|
|
22646
22658
|
}
|
|
22647
22659
|
}
|
|
22648
|
-
for (const [
|
|
22649
|
-
out.set(
|
|
22660
|
+
for (const [name2, status] of own2.entries()) {
|
|
22661
|
+
out.set(name2, {
|
|
22650
22662
|
status,
|
|
22651
22663
|
isOwn: true,
|
|
22652
|
-
sourceComponents: [
|
|
22664
|
+
sourceComponents: [name2]
|
|
22653
22665
|
});
|
|
22654
22666
|
}
|
|
22655
22667
|
for (const [ancestor, sources] of inheritedSources.entries()) {
|
|
@@ -22914,7 +22926,7 @@ function parseToState(json) {
|
|
|
22914
22926
|
}
|
|
22915
22927
|
const componentDescription = typeof component.$description === "string" ? component.$description : "";
|
|
22916
22928
|
const rawProps = component.$properties ?? {};
|
|
22917
|
-
const props = Object.entries(rawProps).map(([
|
|
22929
|
+
const props = Object.entries(rawProps).map(([name2, raw]) => {
|
|
22918
22930
|
const p = raw ?? {};
|
|
22919
22931
|
const type = CDF_PROPERTY_TYPES2.includes(p.$type) ? p.$type : "string";
|
|
22920
22932
|
let defaultValue = null;
|
|
@@ -22926,7 +22938,7 @@ function parseToState(json) {
|
|
|
22926
22938
|
}
|
|
22927
22939
|
}
|
|
22928
22940
|
return {
|
|
22929
|
-
name,
|
|
22941
|
+
name: name2,
|
|
22930
22942
|
type,
|
|
22931
22943
|
category: CDF_PROPERTY_CATEGORIES2.includes(p.$category) ? p.$category : "content",
|
|
22932
22944
|
required: p.$required === true,
|
|
@@ -22938,10 +22950,10 @@ function parseToState(json) {
|
|
|
22938
22950
|
};
|
|
22939
22951
|
});
|
|
22940
22952
|
const rawSlots = component.$slots ?? {};
|
|
22941
|
-
const slots = Object.entries(rawSlots).map(([
|
|
22953
|
+
const slots = Object.entries(rawSlots).map(([name2, raw]) => {
|
|
22942
22954
|
const s = raw ?? {};
|
|
22943
22955
|
return {
|
|
22944
|
-
name,
|
|
22956
|
+
name: name2,
|
|
22945
22957
|
description: typeof s.$description === "string" ? s.$description : "",
|
|
22946
22958
|
required: s.$required === true,
|
|
22947
22959
|
allowedComponents: Array.isArray(s.$allowedComponents) ? s.$allowedComponents.filter((v) => typeof v === "string") : []
|
|
@@ -23049,7 +23061,7 @@ function DefaultValueRow({
|
|
|
23049
23061
|
] });
|
|
23050
23062
|
}
|
|
23051
23063
|
function RowLabel({
|
|
23052
|
-
name,
|
|
23064
|
+
name: name2,
|
|
23053
23065
|
selected,
|
|
23054
23066
|
trailing = true
|
|
23055
23067
|
}) {
|
|
@@ -23062,7 +23074,7 @@ function RowLabel({
|
|
|
23062
23074
|
wrap: "truncate-end",
|
|
23063
23075
|
children: [
|
|
23064
23076
|
" ",
|
|
23065
|
-
|
|
23077
|
+
name2,
|
|
23066
23078
|
trailing ? " " : ""
|
|
23067
23079
|
]
|
|
23068
23080
|
}
|
|
@@ -23414,10 +23426,10 @@ function SlotRow({
|
|
|
23414
23426
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
23415
23427
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
23416
23428
|
/* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
23417
|
-
slice.map((
|
|
23429
|
+
slice.map((name2, i) => {
|
|
23418
23430
|
const absIdx = start + i;
|
|
23419
23431
|
const isCursor = absIdx === cursor;
|
|
23420
|
-
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${
|
|
23432
|
+
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${name2}` : ` ${name2}` }, name2);
|
|
23421
23433
|
})
|
|
23422
23434
|
] });
|
|
23423
23435
|
})() })
|
|
@@ -24314,8 +24326,8 @@ function FieldEditor({
|
|
|
24314
24326
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
24315
24327
|
const modeLabel = (() => {
|
|
24316
24328
|
if (pendingDelete) {
|
|
24317
|
-
const
|
|
24318
|
-
return `Delete ${pendingDelete.kind} "${
|
|
24329
|
+
const name2 = pendingDelete.kind === "prop" ? props[pendingDelete.idx]?.name : slots[pendingDelete.idx]?.name;
|
|
24330
|
+
return `Delete ${pendingDelete.kind} "${name2}"? [y] delete \xB7 any other key cancels`;
|
|
24319
24331
|
}
|
|
24320
24332
|
if (editingValue) {
|
|
24321
24333
|
return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
|
|
@@ -25444,7 +25456,7 @@ function finalizeReviewSession(extractSessionId, components) {
|
|
|
25444
25456
|
);
|
|
25445
25457
|
db.exec("BEGIN");
|
|
25446
25458
|
try {
|
|
25447
|
-
for (const
|
|
25459
|
+
for (const name2 of toReject) statement.run(extractSessionId, name2);
|
|
25448
25460
|
db.exec("COMMIT");
|
|
25449
25461
|
} catch (error) {
|
|
25450
25462
|
db.exec("ROLLBACK");
|
|
@@ -26350,13 +26362,13 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
26350
26362
|
const unchanged = new Set(preview.components.unchanged);
|
|
26351
26363
|
const changedNames = /* @__PURE__ */ new Set();
|
|
26352
26364
|
for (const item of preview.components.changed) {
|
|
26353
|
-
const
|
|
26354
|
-
if (typeof
|
|
26355
|
-
changedNames.add(
|
|
26365
|
+
const name2 = item.current?.name;
|
|
26366
|
+
if (typeof name2 !== "string") continue;
|
|
26367
|
+
changedNames.add(name2);
|
|
26356
26368
|
if (item.changeClassification?.classification === "breaking") {
|
|
26357
|
-
out.set(
|
|
26369
|
+
out.set(name2, "breaking");
|
|
26358
26370
|
} else {
|
|
26359
|
-
out.set(
|
|
26371
|
+
out.set(name2, "changed");
|
|
26360
26372
|
}
|
|
26361
26373
|
}
|
|
26362
26374
|
const removedNames = /* @__PURE__ */ new Set();
|
|
@@ -26366,12 +26378,12 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
26366
26378
|
out.set(entity.name, "removed");
|
|
26367
26379
|
}
|
|
26368
26380
|
}
|
|
26369
|
-
for (const
|
|
26370
|
-
if (unchanged.has(
|
|
26371
|
-
if (changedNames.has(
|
|
26372
|
-
if (removedNames.has(
|
|
26373
|
-
if (out.has(
|
|
26374
|
-
out.set(
|
|
26381
|
+
for (const name2 of localNames) {
|
|
26382
|
+
if (unchanged.has(name2)) continue;
|
|
26383
|
+
if (changedNames.has(name2)) continue;
|
|
26384
|
+
if (removedNames.has(name2)) continue;
|
|
26385
|
+
if (out.has(name2)) continue;
|
|
26386
|
+
out.set(name2, "new");
|
|
26375
26387
|
}
|
|
26376
26388
|
return out;
|
|
26377
26389
|
}
|
|
@@ -27125,10 +27137,10 @@ function GenerateReviewStepView({
|
|
|
27125
27137
|
const merged = /* @__PURE__ */ new Map();
|
|
27126
27138
|
for (const closure of closures.values()) {
|
|
27127
27139
|
const per = computeRenderStatuses(closure, directIssues);
|
|
27128
|
-
for (const [
|
|
27129
|
-
const existing = merged.get(
|
|
27140
|
+
for (const [name2, rs] of per.entries()) {
|
|
27141
|
+
const existing = merged.get(name2);
|
|
27130
27142
|
if (!existing || !existing.isOwn && rs.isOwn) {
|
|
27131
|
-
merged.set(
|
|
27143
|
+
merged.set(name2, rs);
|
|
27132
27144
|
}
|
|
27133
27145
|
}
|
|
27134
27146
|
}
|
|
@@ -27183,11 +27195,11 @@ function GenerateReviewStepView({
|
|
|
27183
27195
|
reviewEditor.setSaveError(null);
|
|
27184
27196
|
setPendingEditorFocus(null);
|
|
27185
27197
|
};
|
|
27186
|
-
const jumpCursorToName = (
|
|
27198
|
+
const jumpCursorToName = (name2) => {
|
|
27187
27199
|
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
27188
27200
|
const row = visibleRowsMemo[i];
|
|
27189
27201
|
if (row.itemIdx < 0) continue;
|
|
27190
|
-
if (components[row.itemIdx]?.key ===
|
|
27202
|
+
if (components[row.itemIdx]?.key === name2) {
|
|
27191
27203
|
jumpCursorToRow(i);
|
|
27192
27204
|
return;
|
|
27193
27205
|
}
|
|
@@ -27715,8 +27727,8 @@ function GenerateReviewStepView({
|
|
|
27715
27727
|
}
|
|
27716
27728
|
),
|
|
27717
27729
|
!dialogOpen && autoRejected.length > 0 && (() => {
|
|
27718
|
-
const stillRejected = autoRejected.filter((
|
|
27719
|
-
const c2 = components.find((x) => x.key ===
|
|
27730
|
+
const stillRejected = autoRejected.filter((name2) => {
|
|
27731
|
+
const c2 = components.find((x) => x.key === name2);
|
|
27720
27732
|
return c2?.status === "rejected";
|
|
27721
27733
|
});
|
|
27722
27734
|
if (stillRejected.length === 0) return null;
|
|
@@ -28227,31 +28239,31 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
28227
28239
|
const proposedProperties = proposed["$properties"] ?? {};
|
|
28228
28240
|
const proposedProps = new Set(Object.keys(proposedProperties));
|
|
28229
28241
|
const oldProps = current.fullProperties;
|
|
28230
|
-
for (const
|
|
28231
|
-
if (!currentProps.has(
|
|
28232
|
-
const def = proposedProperties[
|
|
28233
|
-
lines.push({ key: `${
|
|
28242
|
+
for (const name2 of [...proposedProps].sort()) {
|
|
28243
|
+
if (!currentProps.has(name2)) {
|
|
28244
|
+
const def = proposedProperties[name2];
|
|
28245
|
+
lines.push({ key: `${name2}-add`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(def)}` });
|
|
28234
28246
|
}
|
|
28235
28247
|
}
|
|
28236
|
-
for (const
|
|
28237
|
-
if (!proposedProps.has(
|
|
28238
|
-
if (oldProps?.[
|
|
28239
|
-
lines.push({ key: `${
|
|
28248
|
+
for (const name2 of [...currentProps].sort()) {
|
|
28249
|
+
if (!proposedProps.has(name2)) {
|
|
28250
|
+
if (oldProps?.[name2]) {
|
|
28251
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(oldProps[name2])}` });
|
|
28240
28252
|
} else {
|
|
28241
|
-
const cat = current.contentProperties.includes(
|
|
28242
|
-
lines.push({ key: `${
|
|
28253
|
+
const cat = current.contentProperties.includes(name2) ? "content" : "design";
|
|
28254
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2} (${cat})` });
|
|
28243
28255
|
}
|
|
28244
28256
|
}
|
|
28245
28257
|
}
|
|
28246
28258
|
const handledProps = /* @__PURE__ */ new Set();
|
|
28247
|
-
for (const
|
|
28248
|
-
if (!proposedProps.has(
|
|
28249
|
-
const newDef = proposedProperties[
|
|
28250
|
-
const oldDef = oldProps?.[
|
|
28259
|
+
for (const name2 of [...currentProps].sort()) {
|
|
28260
|
+
if (!proposedProps.has(name2)) continue;
|
|
28261
|
+
const newDef = proposedProperties[name2];
|
|
28262
|
+
const oldDef = oldProps?.[name2];
|
|
28251
28263
|
if (!oldDef) continue;
|
|
28252
|
-
const diffs = diffProperty(
|
|
28264
|
+
const diffs = diffProperty(name2, oldDef, newDef);
|
|
28253
28265
|
if (diffs.length > 0) {
|
|
28254
|
-
handledProps.add(
|
|
28266
|
+
handledProps.add(name2);
|
|
28255
28267
|
for (const d of diffs) lines.push(d);
|
|
28256
28268
|
}
|
|
28257
28269
|
}
|
|
@@ -28274,40 +28286,40 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
28274
28286
|
const proposedSlots = proposed["$slots"] ?? {};
|
|
28275
28287
|
const proposedSlotNames = new Set(Object.keys(proposedSlots));
|
|
28276
28288
|
const currentSlotAllowed = current.currentSlotAllowed ?? {};
|
|
28277
|
-
for (const
|
|
28278
|
-
if (!currentSlots.has(
|
|
28279
|
-
lines.push({ key: `slot-${
|
|
28289
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
28290
|
+
if (!currentSlots.has(name2)) {
|
|
28291
|
+
lines.push({ key: `slot-${name2}-add`, color: PALETTE.success, text: `+ slot: ${name2}` });
|
|
28280
28292
|
}
|
|
28281
28293
|
}
|
|
28282
|
-
for (const
|
|
28283
|
-
if (!proposedSlotNames.has(
|
|
28284
|
-
lines.push({ key: `slot-${
|
|
28294
|
+
for (const name2 of [...currentSlots].sort()) {
|
|
28295
|
+
if (!proposedSlotNames.has(name2)) {
|
|
28296
|
+
lines.push({ key: `slot-${name2}-rm`, color: PALETTE.error, text: `- slot: ${name2}` });
|
|
28285
28297
|
}
|
|
28286
28298
|
}
|
|
28287
|
-
for (const
|
|
28288
|
-
const nextAllowed = normalizeAllowedComponents(proposedSlots[
|
|
28289
|
-
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[
|
|
28290
|
-
const prevExists = currentSlots.has(
|
|
28299
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
28300
|
+
const nextAllowed = normalizeAllowedComponents(proposedSlots[name2]?.["$allowedComponents"]);
|
|
28301
|
+
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[name2]);
|
|
28302
|
+
const prevExists = currentSlots.has(name2);
|
|
28291
28303
|
if (!prevExists) {
|
|
28292
28304
|
if (nextAllowed.length > 0) {
|
|
28293
28305
|
lines.push({
|
|
28294
|
-
key: `slot-${
|
|
28306
|
+
key: `slot-${name2}-allow-new`,
|
|
28295
28307
|
color: PALETTE.success,
|
|
28296
|
-
text: `+ slot ${
|
|
28308
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
28297
28309
|
});
|
|
28298
28310
|
}
|
|
28299
28311
|
continue;
|
|
28300
28312
|
}
|
|
28301
28313
|
if (arraysEqual(prevAllowed, nextAllowed)) continue;
|
|
28302
28314
|
lines.push({
|
|
28303
|
-
key: `slot-${
|
|
28315
|
+
key: `slot-${name2}-allow-old`,
|
|
28304
28316
|
color: PALETTE.error,
|
|
28305
|
-
text: `- slot ${
|
|
28317
|
+
text: `- slot ${name2} allowedComponents: [${prevAllowed.join(", ")}]`
|
|
28306
28318
|
});
|
|
28307
28319
|
lines.push({
|
|
28308
|
-
key: `slot-${
|
|
28320
|
+
key: `slot-${name2}-allow-new`,
|
|
28309
28321
|
color: PALETTE.success,
|
|
28310
|
-
text: `+ slot ${
|
|
28322
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
28311
28323
|
});
|
|
28312
28324
|
}
|
|
28313
28325
|
return lines;
|
|
@@ -28343,7 +28355,7 @@ function normalizeType(type) {
|
|
|
28343
28355
|
return type.toLowerCase();
|
|
28344
28356
|
}
|
|
28345
28357
|
}
|
|
28346
|
-
function diffProperty(
|
|
28358
|
+
function diffProperty(name2, old, newDef) {
|
|
28347
28359
|
const diffs = [];
|
|
28348
28360
|
const newType = newDef["$type"] ?? "";
|
|
28349
28361
|
const newCategory = newDef["$category"] ?? "";
|
|
@@ -28354,15 +28366,15 @@ function diffProperty(name, old, newDef) {
|
|
|
28354
28366
|
const requiredChanged = old.required !== newRequired;
|
|
28355
28367
|
const defaultChanged = JSON.stringify(old.default) !== JSON.stringify(newDefault);
|
|
28356
28368
|
if (!typeChanged && !categoryChanged && !requiredChanged && !defaultChanged) return [];
|
|
28357
|
-
diffs.push({ key: `${
|
|
28358
|
-
diffs.push({ key: `${
|
|
28369
|
+
diffs.push({ key: `${name2}-old`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(old)}` });
|
|
28370
|
+
diffs.push({ key: `${name2}-new`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(newDef)}` });
|
|
28359
28371
|
return diffs;
|
|
28360
28372
|
}
|
|
28361
28373
|
function formatDefault(value) {
|
|
28362
28374
|
const sys = value?.sys;
|
|
28363
28375
|
if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
|
|
28364
|
-
const
|
|
28365
|
-
if (
|
|
28376
|
+
const name2 = sys.urn.split("/designTokens/")[1];
|
|
28377
|
+
if (name2) return name2;
|
|
28366
28378
|
}
|
|
28367
28379
|
return JSON.stringify(value);
|
|
28368
28380
|
}
|
|
@@ -28415,8 +28427,8 @@ function buildPreviewSummaryLines(preview) {
|
|
|
28415
28427
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
28416
28428
|
});
|
|
28417
28429
|
for (const [index, item] of components.new.entries()) {
|
|
28418
|
-
const
|
|
28419
|
-
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${
|
|
28430
|
+
const name2 = item.key ?? item.$name ?? "unknown";
|
|
28431
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
28420
28432
|
}
|
|
28421
28433
|
}
|
|
28422
28434
|
if (components.changed.length > 0) {
|
|
@@ -28509,27 +28521,27 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
28509
28521
|
}
|
|
28510
28522
|
return void 0;
|
|
28511
28523
|
}
|
|
28512
|
-
function appendChangedPreviewLine(lines, keyPrefix,
|
|
28524
|
+
function appendChangedPreviewLine(lines, keyPrefix, name2, hasPendingDraftChanges, changeClassification) {
|
|
28513
28525
|
lines.push({
|
|
28514
|
-
key: `${keyPrefix}-h-${
|
|
28526
|
+
key: `${keyPrefix}-h-${name2}`,
|
|
28515
28527
|
color: PALETTE.warning,
|
|
28516
|
-
text: ` ~ ${
|
|
28528
|
+
text: ` ~ ${name2}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
28517
28529
|
});
|
|
28518
28530
|
if (changeClassification?.classification !== "breaking") return;
|
|
28519
28531
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
28520
|
-
lines.push({ key: `${keyPrefix}-b-${
|
|
28532
|
+
lines.push({ key: `${keyPrefix}-b-${name2}`, color: PALETTE.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
28521
28533
|
}
|
|
28522
28534
|
function buildPreviewDiffLines(preview) {
|
|
28523
28535
|
const lines = [];
|
|
28524
28536
|
const { components, tokens } = preview;
|
|
28525
28537
|
for (const item of components.new) {
|
|
28526
28538
|
const raw = item;
|
|
28527
|
-
const
|
|
28528
|
-
lines.push({ key: `comp-new-${
|
|
28539
|
+
const name2 = raw.key ?? raw.$name ?? "unknown";
|
|
28540
|
+
lines.push({ key: `comp-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
28529
28541
|
const slots = raw.$slots ?? {};
|
|
28530
28542
|
for (const slotName of Object.keys(slots).sort()) {
|
|
28531
28543
|
lines.push({
|
|
28532
|
-
key: `comp-new-${
|
|
28544
|
+
key: `comp-new-${name2}-slot-${slotName}`,
|
|
28533
28545
|
color: PALETTE.success,
|
|
28534
28546
|
text: ` slot: ${slotName}`
|
|
28535
28547
|
});
|
|
@@ -28537,7 +28549,7 @@ function buildPreviewDiffLines(preview) {
|
|
|
28537
28549
|
if (Array.isArray(allowed) && allowed.length > 0) {
|
|
28538
28550
|
const names = allowed.filter((n) => typeof n === "string");
|
|
28539
28551
|
lines.push({
|
|
28540
|
-
key: `comp-new-${
|
|
28552
|
+
key: `comp-new-${name2}-slot-${slotName}-allow`,
|
|
28541
28553
|
color: PALETTE.success,
|
|
28542
28554
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
28543
28555
|
});
|
|
@@ -28575,8 +28587,8 @@ function buildPreviewDiffLines(preview) {
|
|
|
28575
28587
|
}
|
|
28576
28588
|
for (const item of tokens.new) {
|
|
28577
28589
|
const raw = item;
|
|
28578
|
-
const
|
|
28579
|
-
lines.push({ key: `tok-new-${
|
|
28590
|
+
const name2 = raw.name ?? raw.path ?? "unknown";
|
|
28591
|
+
lines.push({ key: `tok-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
28580
28592
|
}
|
|
28581
28593
|
for (const item of tokens.removed) {
|
|
28582
28594
|
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
|
|
@@ -29776,7 +29788,7 @@ init_config();
|
|
|
29776
29788
|
import { existsSync as existsSync10 } from "node:fs";
|
|
29777
29789
|
function diffSnapshots(before, after) {
|
|
29778
29790
|
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])];
|
|
29779
|
-
const changed_fields = names.filter((
|
|
29791
|
+
const changed_fields = names.filter((name2) => before[name2] !== after[name2]);
|
|
29780
29792
|
return { changed: changed_fields.length > 0, changed_fields };
|
|
29781
29793
|
}
|
|
29782
29794
|
var DEFAULT_TRAIL_LIMIT = 30;
|
|
@@ -29824,11 +29836,11 @@ var LOGIN_HINTS = {
|
|
|
29824
29836
|
cursor: "sign in from Cursor",
|
|
29825
29837
|
copilot: "run `copilot` and sign in"
|
|
29826
29838
|
};
|
|
29827
|
-
function effectiveBinary(
|
|
29828
|
-
return savedBinary.trim() || AGENT_BINARIES[
|
|
29839
|
+
function effectiveBinary(name2, savedBinary) {
|
|
29840
|
+
return savedBinary.trim() || AGENT_BINARIES[name2];
|
|
29829
29841
|
}
|
|
29830
|
-
function defaultModelLabel(
|
|
29831
|
-
const model = DEFAULT_MODELS[
|
|
29842
|
+
function defaultModelLabel(name2) {
|
|
29843
|
+
const model = DEFAULT_MODELS[name2];
|
|
29832
29844
|
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
29833
29845
|
}
|
|
29834
29846
|
var fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
@@ -29857,32 +29869,32 @@ function readVersion(binary) {
|
|
|
29857
29869
|
});
|
|
29858
29870
|
});
|
|
29859
29871
|
}
|
|
29860
|
-
async function inspect(
|
|
29861
|
-
const target = effectiveBinary(
|
|
29872
|
+
async function inspect(name2, binary) {
|
|
29873
|
+
const target = effectiveBinary(name2, binary);
|
|
29862
29874
|
const found = await resolveOnPath(target);
|
|
29863
29875
|
if (!found) return { checks: [fail3("path", `\`${target}\` was not found or is not executable`)], found: null };
|
|
29864
29876
|
const checks = [pass("path", found)];
|
|
29865
29877
|
checks.push(await readVersion(found));
|
|
29866
|
-
if (
|
|
29867
|
-
const auth = await withBinaryEnv(
|
|
29878
|
+
if (name2 === "claude") {
|
|
29879
|
+
const auth = await withBinaryEnv(name2, found, () => checkAgentAuth(name2));
|
|
29868
29880
|
checks.push(
|
|
29869
29881
|
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
29870
29882
|
);
|
|
29871
29883
|
}
|
|
29872
29884
|
return { checks, found };
|
|
29873
29885
|
}
|
|
29874
|
-
async function inspectAgent(
|
|
29875
|
-
return (await inspect(
|
|
29886
|
+
async function inspectAgent(name2, binary) {
|
|
29887
|
+
return (await inspect(name2, binary)).checks;
|
|
29876
29888
|
}
|
|
29877
|
-
async function testAgent(
|
|
29878
|
-
const { checks, found } = await inspect(
|
|
29889
|
+
async function testAgent(name2, binary, model) {
|
|
29890
|
+
const { checks, found } = await inspect(name2, binary);
|
|
29879
29891
|
if (!found || !checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
29880
29892
|
const started = Date.now();
|
|
29881
29893
|
const result = await withBinaryEnv(
|
|
29882
|
-
|
|
29894
|
+
name2,
|
|
29883
29895
|
found,
|
|
29884
29896
|
() => createLocalCliAgentInvoker().invoke({
|
|
29885
|
-
agent:
|
|
29897
|
+
agent: name2,
|
|
29886
29898
|
...model.trim() ? { model: model.trim() } : {},
|
|
29887
29899
|
prompt: TEST_PROMPT,
|
|
29888
29900
|
timeoutMs: PROMPT_TIMEOUT_MS
|
|
@@ -29898,7 +29910,7 @@ async function testAgent(name, binary, model) {
|
|
|
29898
29910
|
}
|
|
29899
29911
|
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
29900
29912
|
}
|
|
29901
|
-
function statusFromChecks(
|
|
29913
|
+
function statusFromChecks(name2, checks, savedBinary) {
|
|
29902
29914
|
if (checks.length === 0) return "checking";
|
|
29903
29915
|
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
29904
29916
|
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
@@ -29910,13 +29922,13 @@ function statusFromChecks(name, checks, savedBinary) {
|
|
|
29910
29922
|
}
|
|
29911
29923
|
const login = checks.find((check) => check.step === "login");
|
|
29912
29924
|
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
29913
|
-
return
|
|
29925
|
+
return name2 === "claude" ? "ready" : "unknown";
|
|
29914
29926
|
}
|
|
29915
|
-
function setupHint(
|
|
29916
|
-
if (status === "not-configured") return `${INSTALL_HINTS[
|
|
29917
|
-
if (status === "not-found") return `${INSTALL_HINTS[
|
|
29918
|
-
if (status === "not-logged-in") return LOGIN_HINTS[
|
|
29919
|
-
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[
|
|
29927
|
+
function setupHint(name2, status) {
|
|
29928
|
+
if (status === "not-configured") return `${INSTALL_HINTS[name2]}, or set its command path in settings`;
|
|
29929
|
+
if (status === "not-found") return `${INSTALL_HINTS[name2]}, or correct the command path in settings`;
|
|
29930
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name2];
|
|
29931
|
+
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[name2]}`;
|
|
29920
29932
|
if (status === "timed-out") return "it may be slow or waiting for input; run the test again, or try it in a terminal";
|
|
29921
29933
|
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
29922
29934
|
return "";
|
|
@@ -29938,14 +29950,14 @@ var LIST_STATUS = {
|
|
|
29938
29950
|
"timed-out": { symbol: "\u2717", text: "test timed out", tone: "bad" },
|
|
29939
29951
|
unknown: { symbol: "\u25D0", text: "installed, login unknown", tone: "muted" }
|
|
29940
29952
|
};
|
|
29941
|
-
function modelLine(
|
|
29953
|
+
function modelLine(name2, savedModel) {
|
|
29942
29954
|
const model = savedModel.trim();
|
|
29943
|
-
return model ? model : `${defaultModelLabel(
|
|
29955
|
+
return model ? model : `${defaultModelLabel(name2)} (built-in default)`;
|
|
29944
29956
|
}
|
|
29945
|
-
function baseRows(
|
|
29957
|
+
function baseRows(name2, checks, savedBinary) {
|
|
29946
29958
|
const path5 = checks.find((check) => check.step === "path");
|
|
29947
29959
|
const version2 = checks.find((check) => check.step === "version");
|
|
29948
|
-
const hint = setupHint(
|
|
29960
|
+
const hint = setupHint(name2, statusFromChecks(name2, checks, savedBinary));
|
|
29949
29961
|
const setup = hint ? { label: "Setup", value: hint, tone: "muted" } : void 0;
|
|
29950
29962
|
if (!path5?.ok) {
|
|
29951
29963
|
const saved = savedBinary.trim() !== "";
|
|
@@ -29968,15 +29980,15 @@ function baseRows(name, checks, savedBinary) {
|
|
|
29968
29980
|
};
|
|
29969
29981
|
}
|
|
29970
29982
|
var checking = [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
29971
|
-
function panelRows(
|
|
29983
|
+
function panelRows(name2, checks, settings) {
|
|
29972
29984
|
if (!checks) return checking;
|
|
29973
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
29974
|
-
const model = { label: "Model", value: modelLine(
|
|
29985
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, settings.binary);
|
|
29986
|
+
const model = { label: "Model", value: modelLine(name2, settings.model), tone: "muted" };
|
|
29975
29987
|
return [command, ...found ? [...version2?.tone === "ok" ? [version2] : [], model] : [], ...setup ? [setup] : []];
|
|
29976
29988
|
}
|
|
29977
|
-
function statusRows(
|
|
29989
|
+
function statusRows(name2, checks, savedBinary) {
|
|
29978
29990
|
if (!checks) return checking;
|
|
29979
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
29991
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, savedBinary);
|
|
29980
29992
|
if (!found) return [command];
|
|
29981
29993
|
const login = checks.find((check) => check.step === "login");
|
|
29982
29994
|
const prompt = checks.find((check) => check.step === "prompt");
|
|
@@ -29995,8 +30007,8 @@ function statusRows(name, checks, savedBinary) {
|
|
|
29995
30007
|
const testRow = prompt ? [{ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" }] : [];
|
|
29996
30008
|
return [command, ...version2 ? [version2] : [], loginRow, ...testRow, ...setup ? [setup] : []];
|
|
29997
30009
|
}
|
|
29998
|
-
async function withBinaryEnv(
|
|
29999
|
-
const key = `EDS_AGENT_BINARY_${
|
|
30010
|
+
async function withBinaryEnv(name2, binary, run) {
|
|
30011
|
+
const key = `EDS_AGENT_BINARY_${name2.toUpperCase()}`;
|
|
30000
30012
|
const previous = process.env[key];
|
|
30001
30013
|
process.env[key] = binary;
|
|
30002
30014
|
try {
|
|
@@ -30010,9 +30022,9 @@ async function withBinaryEnv(name, binary, run) {
|
|
|
30010
30022
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-debug.ts
|
|
30011
30023
|
function agentSnapshot(config) {
|
|
30012
30024
|
const snapshot = { default_agent: config.defaultAgent };
|
|
30013
|
-
for (const
|
|
30014
|
-
snapshot[`${
|
|
30015
|
-
snapshot[`${
|
|
30025
|
+
for (const name2 of AGENT_NAMES) {
|
|
30026
|
+
snapshot[`${name2}.model`] = config.agents[name2].model;
|
|
30027
|
+
snapshot[`${name2}.binary`] = config.agents[name2].binary;
|
|
30016
30028
|
}
|
|
30017
30029
|
return snapshot;
|
|
30018
30030
|
}
|
|
@@ -30029,10 +30041,10 @@ function environmentFrom(checks, savedBinary, envValue) {
|
|
|
30029
30041
|
}
|
|
30030
30042
|
async function describeAgents(config) {
|
|
30031
30043
|
const entries = await Promise.all(
|
|
30032
|
-
AGENT_NAMES.map(async (
|
|
30033
|
-
const saved = config.agents[
|
|
30034
|
-
const checks = await inspectAgent(
|
|
30035
|
-
return [
|
|
30044
|
+
AGENT_NAMES.map(async (name2) => {
|
|
30045
|
+
const saved = config.agents[name2].binary;
|
|
30046
|
+
const checks = await inspectAgent(name2, saved);
|
|
30047
|
+
return [name2, environmentFrom(checks, saved, process.env[`EDS_AGENT_BINARY_${name2.toUpperCase()}`])];
|
|
30036
30048
|
})
|
|
30037
30049
|
);
|
|
30038
30050
|
return Object.fromEntries(entries);
|
|
@@ -30053,7 +30065,7 @@ var AGENT_LABELS = {
|
|
|
30053
30065
|
};
|
|
30054
30066
|
var asString = (value) => typeof value === "string" ? value : "";
|
|
30055
30067
|
function emptyAgents() {
|
|
30056
|
-
return Object.fromEntries(AGENT_NAMES.map((
|
|
30068
|
+
return Object.fromEntries(AGENT_NAMES.map((name2) => [name2, { model: "", binary: "" }]));
|
|
30057
30069
|
}
|
|
30058
30070
|
async function readAgentConfig() {
|
|
30059
30071
|
const store = await readV1Store();
|
|
@@ -30063,11 +30075,11 @@ async function readAgentConfig() {
|
|
|
30063
30075
|
const agents = emptyAgents();
|
|
30064
30076
|
const saved = store["agents"];
|
|
30065
30077
|
if (saved && typeof saved === "object") {
|
|
30066
|
-
for (const
|
|
30067
|
-
const entry = saved[
|
|
30078
|
+
for (const name2 of AGENT_NAMES) {
|
|
30079
|
+
const entry = saved[name2];
|
|
30068
30080
|
if (entry && typeof entry === "object") {
|
|
30069
30081
|
const fields2 = entry;
|
|
30070
|
-
agents[
|
|
30082
|
+
agents[name2] = { model: asString(fields2["model"]), binary: asString(fields2["binary"]) };
|
|
30071
30083
|
}
|
|
30072
30084
|
}
|
|
30073
30085
|
}
|
|
@@ -30080,10 +30092,10 @@ async function writeAgentConfig(config) {
|
|
|
30080
30092
|
const existing = await readV1Store();
|
|
30081
30093
|
const merged = { ...existing };
|
|
30082
30094
|
const agents = {};
|
|
30083
|
-
for (const
|
|
30084
|
-
const model = config.agents[
|
|
30085
|
-
const binary = config.agents[
|
|
30086
|
-
if (model || binary) agents[
|
|
30095
|
+
for (const name2 of AGENT_NAMES) {
|
|
30096
|
+
const model = config.agents[name2].model.trim();
|
|
30097
|
+
const binary = config.agents[name2].binary.trim();
|
|
30098
|
+
if (model || binary) agents[name2] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
30087
30099
|
}
|
|
30088
30100
|
const defaultModel = config.defaultChosen ? agents[config.defaultAgent]?.model : void 0;
|
|
30089
30101
|
if (config.defaultChosen) merged["agent"] = config.defaultAgent;
|
|
@@ -30108,20 +30120,20 @@ var TONE_COLOR = {
|
|
|
30108
30120
|
muted: PALETTE.muted
|
|
30109
30121
|
};
|
|
30110
30122
|
function AgentStatusBadge({
|
|
30111
|
-
name,
|
|
30123
|
+
name: name2,
|
|
30112
30124
|
checks,
|
|
30113
30125
|
binary
|
|
30114
30126
|
}) {
|
|
30115
|
-
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(
|
|
30127
|
+
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name2, checks, binary) : "checking"];
|
|
30116
30128
|
return /* @__PURE__ */ jsx59(Text49, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
30117
30129
|
}
|
|
30118
30130
|
|
|
30119
30131
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/apply-binary-overrides.ts
|
|
30120
30132
|
var shellValues = /* @__PURE__ */ new Map();
|
|
30121
30133
|
function applyBinaryOverrides(config) {
|
|
30122
|
-
for (const
|
|
30123
|
-
const key = `EDS_AGENT_BINARY_${
|
|
30124
|
-
const binary = config.agents[
|
|
30134
|
+
for (const name2 of AGENT_NAMES) {
|
|
30135
|
+
const key = `EDS_AGENT_BINARY_${name2.toUpperCase()}`;
|
|
30136
|
+
const binary = config.agents[name2].binary.trim();
|
|
30125
30137
|
if (binary) {
|
|
30126
30138
|
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
30127
30139
|
process.env[key] = binary;
|
|
@@ -30136,9 +30148,9 @@ function applyBinaryOverrides(config) {
|
|
|
30136
30148
|
|
|
30137
30149
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
30138
30150
|
import { jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
30139
|
-
var fields = (
|
|
30140
|
-
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[
|
|
30141
|
-
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(
|
|
30151
|
+
var fields = (name2) => [
|
|
30152
|
+
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[name2]}\` from the PATH)` },
|
|
30153
|
+
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name2)})` }
|
|
30142
30154
|
];
|
|
30143
30155
|
var INSPECT_DELAY_MS = 400;
|
|
30144
30156
|
function StatusHeading() {
|
|
@@ -30148,13 +30160,13 @@ function StatusHeading() {
|
|
|
30148
30160
|
] });
|
|
30149
30161
|
}
|
|
30150
30162
|
function AgentDetail({
|
|
30151
|
-
name,
|
|
30163
|
+
name: name2,
|
|
30152
30164
|
config,
|
|
30153
30165
|
setConfig,
|
|
30154
30166
|
onBack,
|
|
30155
30167
|
record: record3
|
|
30156
30168
|
}) {
|
|
30157
|
-
const settings = config.agents[
|
|
30169
|
+
const settings = config.agents[name2];
|
|
30158
30170
|
const [saving, setSaving] = useState33(false);
|
|
30159
30171
|
const [testing, setTesting] = useState33(false);
|
|
30160
30172
|
const [notice, setNotice] = useState33(null);
|
|
@@ -30163,38 +30175,38 @@ function AgentDetail({
|
|
|
30163
30175
|
let active = true;
|
|
30164
30176
|
setChecks(void 0);
|
|
30165
30177
|
const timer = setTimeout(() => {
|
|
30166
|
-
void inspectAgent(
|
|
30178
|
+
void inspectAgent(name2, settings.binary).then((result) => active && setChecks(result));
|
|
30167
30179
|
}, INSPECT_DELAY_MS);
|
|
30168
30180
|
return () => {
|
|
30169
30181
|
active = false;
|
|
30170
30182
|
clearTimeout(timer);
|
|
30171
30183
|
};
|
|
30172
|
-
}, [
|
|
30184
|
+
}, [name2, settings.binary]);
|
|
30173
30185
|
const save = () => {
|
|
30174
30186
|
setSaving(true);
|
|
30175
30187
|
setNotice(null);
|
|
30176
30188
|
writeAgentConfig(config).then(() => {
|
|
30177
30189
|
applyBinaryOverrides(config);
|
|
30178
|
-
record3(`saved ${
|
|
30179
|
-
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[
|
|
30190
|
+
record3(`saved ${name2}`);
|
|
30191
|
+
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[name2]} settings are written to config.json` });
|
|
30180
30192
|
}).catch((err) => {
|
|
30181
|
-
record3(`saving ${
|
|
30193
|
+
record3(`saving ${name2} failed`, err);
|
|
30182
30194
|
setNotice({ kind: "error", text: `Not saved: ${err instanceof Error ? err.message : String(err)}` });
|
|
30183
30195
|
}).finally(() => setSaving(false));
|
|
30184
30196
|
};
|
|
30185
30197
|
const runTest = () => {
|
|
30186
30198
|
setTesting(true);
|
|
30187
30199
|
setNotice(null);
|
|
30188
|
-
testAgent(
|
|
30200
|
+
testAgent(name2, settings.binary, settings.model).then((result) => {
|
|
30189
30201
|
setChecks(result);
|
|
30190
30202
|
const outcome = testOutcome(result);
|
|
30191
30203
|
if (!outcome || !outcome.ok)
|
|
30192
|
-
record3(`test of ${
|
|
30204
|
+
record3(`test of ${name2} failed: ${outcome?.text ?? "the agent could not be started"}`);
|
|
30193
30205
|
setNotice(
|
|
30194
30206
|
outcome ? { kind: outcome.ok ? "success" : "error", text: outcome.text } : { kind: "error", text: "Test not run: the agent could not be started (see Status)" }
|
|
30195
30207
|
);
|
|
30196
30208
|
}).catch((err) => {
|
|
30197
|
-
record3(`test of ${
|
|
30209
|
+
record3(`test of ${name2} could not run`, err);
|
|
30198
30210
|
setNotice({ kind: "error", text: `Test could not run: ${err instanceof Error ? err.message : String(err)}` });
|
|
30199
30211
|
}).finally(() => setTesting(false));
|
|
30200
30212
|
};
|
|
@@ -30205,19 +30217,19 @@ function AgentDetail({
|
|
|
30205
30217
|
hint: "run test",
|
|
30206
30218
|
onRun: runTest
|
|
30207
30219
|
};
|
|
30208
|
-
const formFields = fields(
|
|
30220
|
+
const formFields = fields(name2);
|
|
30209
30221
|
const labelWidth = formLabelWidth([...formFields, action]);
|
|
30210
30222
|
return /* @__PURE__ */ jsx60(
|
|
30211
30223
|
FieldForm,
|
|
30212
30224
|
{
|
|
30213
|
-
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[
|
|
30214
|
-
subtitle: config.defaultAgent ===
|
|
30225
|
+
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[name2]}`,
|
|
30226
|
+
subtitle: config.defaultAgent === name2 ? "This is the default agent." : `Runs the \`${AGENT_BINARIES[name2]}\` command.`,
|
|
30215
30227
|
fields: formFields,
|
|
30216
30228
|
values: { binary: settings.binary, model: settings.model },
|
|
30217
30229
|
onChange: (key, value) => {
|
|
30218
|
-
setConfig({ ...config, agents: { ...config.agents, [
|
|
30230
|
+
setConfig({ ...config, agents: { ...config.agents, [name2]: { ...settings, [key]: value } } });
|
|
30219
30231
|
setNotice(null);
|
|
30220
|
-
record3(`edited ${
|
|
30232
|
+
record3(`edited ${name2}.${key}`);
|
|
30221
30233
|
},
|
|
30222
30234
|
onSave: save,
|
|
30223
30235
|
onQuit: onBack,
|
|
@@ -30226,7 +30238,7 @@ function AgentDetail({
|
|
|
30226
30238
|
busy: saving || testing,
|
|
30227
30239
|
children: /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
30228
30240
|
/* @__PURE__ */ jsx60(StatusHeading, {}),
|
|
30229
|
-
statusRows(
|
|
30241
|
+
statusRows(name2, checks, settings.binary).map((row) => /* @__PURE__ */ jsx60(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx60(Text50, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
30230
30242
|
] })
|
|
30231
30243
|
}
|
|
30232
30244
|
);
|
|
@@ -30251,9 +30263,9 @@ function AgentsScreen({ onDone }) {
|
|
|
30251
30263
|
error: ""
|
|
30252
30264
|
}).current;
|
|
30253
30265
|
const inspectAll = (loaded) => {
|
|
30254
|
-
for (const
|
|
30255
|
-
void inspectAgent(
|
|
30256
|
-
(result) => setChecks((previous) => ({ ...previous, [
|
|
30266
|
+
for (const name2 of AGENT_NAMES) {
|
|
30267
|
+
void inspectAgent(name2, loaded.agents[name2].binary).then(
|
|
30268
|
+
(result) => setChecks((previous) => ({ ...previous, [name2]: result }))
|
|
30257
30269
|
);
|
|
30258
30270
|
}
|
|
30259
30271
|
};
|
|
@@ -30293,21 +30305,21 @@ function AgentsScreen({ onDone }) {
|
|
|
30293
30305
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
30294
30306
|
});
|
|
30295
30307
|
};
|
|
30296
|
-
const makeDefault = (
|
|
30308
|
+
const makeDefault = (name2) => {
|
|
30297
30309
|
if (!config || saving) return;
|
|
30298
|
-
if (
|
|
30299
|
-
setNotice({ kind: "success", text: `${AGENT_LABELS[
|
|
30310
|
+
if (name2 === config.defaultAgent) {
|
|
30311
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name2]} is already the default agent` });
|
|
30300
30312
|
return;
|
|
30301
30313
|
}
|
|
30302
30314
|
setSaving(true);
|
|
30303
30315
|
setNotice(null);
|
|
30304
|
-
writeAgentConfig({ ...config, defaultAgent:
|
|
30305
|
-
setConfig((current) => current ? { ...current, defaultAgent:
|
|
30306
|
-
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[
|
|
30307
|
-
visit.trail.record(`made ${
|
|
30316
|
+
writeAgentConfig({ ...config, defaultAgent: name2, defaultChosen: true }).then(() => {
|
|
30317
|
+
setConfig((current) => current ? { ...current, defaultAgent: name2, defaultChosen: true } : current);
|
|
30318
|
+
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name2]}` });
|
|
30319
|
+
visit.trail.record(`made ${name2} the default`);
|
|
30308
30320
|
}).catch((err) => {
|
|
30309
30321
|
visit.error = scrubError(err, []);
|
|
30310
|
-
visit.trail.record(`making ${
|
|
30322
|
+
visit.trail.record(`making ${name2} the default failed`);
|
|
30311
30323
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
30312
30324
|
}).finally(() => setSaving(false));
|
|
30313
30325
|
};
|
|
@@ -30394,14 +30406,14 @@ function AgentsScreen({ onDone }) {
|
|
|
30394
30406
|
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
30395
30407
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "STATUS" })
|
|
30396
30408
|
] }),
|
|
30397
|
-
AGENT_NAMES.map((
|
|
30398
|
-
const isFocused = focusedAgent ===
|
|
30409
|
+
AGENT_NAMES.map((name2) => {
|
|
30410
|
+
const isFocused = focusedAgent === name2;
|
|
30399
30411
|
return /* @__PURE__ */ jsxs49(Box49, { gap: 1, children: [
|
|
30400
30412
|
/* @__PURE__ */ jsx61(Text51, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
30401
|
-
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children:
|
|
30402
|
-
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[
|
|
30403
|
-
/* @__PURE__ */ jsx61(AgentStatusBadge, { name, checks: checks[
|
|
30404
|
-
] },
|
|
30413
|
+
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children: name2 === config.defaultAgent ? "\u2605" : " " }),
|
|
30414
|
+
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name2] }) }),
|
|
30415
|
+
/* @__PURE__ */ jsx61(AgentStatusBadge, { name: name2, checks: checks[name2], binary: config.agents[name2].binary })
|
|
30416
|
+
] }, name2);
|
|
30405
30417
|
}),
|
|
30406
30418
|
/* @__PURE__ */ jsxs49(Box49, { flexDirection: "column", marginTop: 1, children: [
|
|
30407
30419
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|