@contentful/experience-design-system-cli 2.39.1-dev-build-66a06016.0 → 2.39.1-dev-build-eee35c0c.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 +598 -586
- package/dist/index.js +601 -606
- package/dist/package.json +1 -1
- package/package.json +3 -3
package/dist/index.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-backend-pipeline/dist/src/persistence/src/session/helpers/config-root.js
|
|
@@ -26,17 +26,17 @@ var init_config_root = __esm({
|
|
|
26
26
|
function escapeForRegExp(value) {
|
|
27
27
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
28
28
|
}
|
|
29
|
-
function identifierPattern(
|
|
30
|
-
return new RegExp(`(?<![A-Za-z0-9_$])${escapeForRegExp(
|
|
29
|
+
function identifierPattern(name2) {
|
|
30
|
+
return new RegExp(`(?<![A-Za-z0-9_$])${escapeForRegExp(name2)}(?![A-Za-z0-9_$])`);
|
|
31
31
|
}
|
|
32
32
|
function excerptAroundNames(text, names, maxChars, contextLines = 6) {
|
|
33
33
|
if (text.length <= maxChars)
|
|
34
34
|
return { content: text, usesNotShown: [] };
|
|
35
|
-
const patterns = names.filter((
|
|
35
|
+
const patterns = names.filter((name2) => name2.length > 0).map((name2) => ({ name: name2, pattern: identifierPattern(name2) }));
|
|
36
36
|
const lines = text.split("\n");
|
|
37
37
|
const windows = [];
|
|
38
38
|
lines.forEach((line, index) => {
|
|
39
|
-
const mentioned = patterns.filter(({ pattern }) => pattern.test(line)).map(({ name }) =>
|
|
39
|
+
const mentioned = patterns.filter(({ pattern }) => pattern.test(line)).map(({ name: name2 }) => name2);
|
|
40
40
|
if (mentioned.length === 0)
|
|
41
41
|
return;
|
|
42
42
|
const start = Math.max(0, index - contextLines);
|
|
@@ -44,8 +44,8 @@ function excerptAroundNames(text, names, maxChars, contextLines = 6) {
|
|
|
44
44
|
const last = windows[windows.length - 1];
|
|
45
45
|
if (last && start <= last.end + 1) {
|
|
46
46
|
last.end = Math.max(last.end, end);
|
|
47
|
-
for (const
|
|
48
|
-
last.names.add(
|
|
47
|
+
for (const name2 of mentioned)
|
|
48
|
+
last.names.add(name2);
|
|
49
49
|
} else {
|
|
50
50
|
windows.push({ start, end, names: new Set(mentioned) });
|
|
51
51
|
}
|
|
@@ -56,8 +56,8 @@ ${TRUNCATED_MARKER}`, usesNotShown: [] };
|
|
|
56
56
|
}
|
|
57
57
|
const lastWindowFor = /* @__PURE__ */ new Map();
|
|
58
58
|
for (const window of windows)
|
|
59
|
-
for (const
|
|
60
|
-
lastWindowFor.set(
|
|
59
|
+
for (const name2 of window.names)
|
|
60
|
+
lastWindowFor.set(name2, window);
|
|
61
61
|
const kept = [];
|
|
62
62
|
const cut = /* @__PURE__ */ new Set();
|
|
63
63
|
let used = 0;
|
|
@@ -71,15 +71,15 @@ ${ELLIPSIS_MARKER}
|
|
|
71
71
|
const head = chunk.slice(0, maxChars);
|
|
72
72
|
kept.push({ window, text: head });
|
|
73
73
|
used += head.length;
|
|
74
|
-
for (const
|
|
75
|
-
if (lastWindowFor.get(
|
|
76
|
-
cut.add(
|
|
74
|
+
for (const name2 of window.names) {
|
|
75
|
+
if (lastWindowFor.get(name2) === window && !identifierPattern(name2).test(head))
|
|
76
|
+
cut.add(name2);
|
|
77
77
|
}
|
|
78
78
|
continue;
|
|
79
79
|
}
|
|
80
|
-
for (const
|
|
81
|
-
if (lastWindowFor.get(
|
|
82
|
-
cut.add(
|
|
80
|
+
for (const name2 of window.names) {
|
|
81
|
+
if (lastWindowFor.get(name2) === window)
|
|
82
|
+
cut.add(name2);
|
|
83
83
|
}
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
@@ -90,7 +90,7 @@ ${ELLIPSIS_MARKER}
|
|
|
90
90
|
const parts = kept.map((entry, index) => (index > 0 ? `
|
|
91
91
|
${ELLIPSIS_MARKER}
|
|
92
92
|
` : "") + entry.text);
|
|
93
|
-
const usesNotShown = names.filter((
|
|
93
|
+
const usesNotShown = names.filter((name2, index) => cut.has(name2) && names.indexOf(name2) === index);
|
|
94
94
|
return { content: `${parts.join("")}
|
|
95
95
|
${TRUNCATED_MARKER}`, usesNotShown };
|
|
96
96
|
}
|
|
@@ -105,8 +105,8 @@ var init_source_excerpt = __esm({
|
|
|
105
105
|
|
|
106
106
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/components/derive-component-id.js
|
|
107
107
|
import { createHash } from "node:crypto";
|
|
108
|
-
function deriveComponentId(
|
|
109
|
-
return createHash("sha256").update(`${
|
|
108
|
+
function deriveComponentId(name2, source) {
|
|
109
|
+
return createHash("sha256").update(`${name2}:${source}`).digest("hex").slice(0, 12);
|
|
110
110
|
}
|
|
111
111
|
var init_derive_component_id = __esm({
|
|
112
112
|
"packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/components/derive-component-id.js"() {
|
|
@@ -195,8 +195,8 @@ var init_read = __esm({
|
|
|
195
195
|
});
|
|
196
196
|
|
|
197
197
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/sessions/write.js
|
|
198
|
-
function createSession(db, id,
|
|
199
|
-
db.prepare("INSERT INTO sessions (id, name, created_at, updated_at) VALUES (?, ?, ?, ?)").run(id,
|
|
198
|
+
function createSession(db, id, name2, timestamp) {
|
|
199
|
+
db.prepare("INSERT INTO sessions (id, name, created_at, updated_at) VALUES (?, ?, ?, ?)").run(id, name2, timestamp, timestamp);
|
|
200
200
|
}
|
|
201
201
|
function updateSessionTimestamp(db, sessionId, timestamp) {
|
|
202
202
|
db.prepare("UPDATE sessions SET updated_at = ? WHERE id = ?").run(timestamp, sessionId);
|
|
@@ -1031,8 +1031,8 @@ var init_extract_sentinel_output = __esm({
|
|
|
1031
1031
|
});
|
|
1032
1032
|
|
|
1033
1033
|
// packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js
|
|
1034
|
-
function formatGenerateProgressLine(done, total,
|
|
1035
|
-
return `progress=generate:${done}/${total}:${
|
|
1034
|
+
function formatGenerateProgressLine(done, total, name2) {
|
|
1035
|
+
return `progress=generate:${done}/${total}:${name2}`;
|
|
1036
1036
|
}
|
|
1037
1037
|
var init_format_generate_progress_line = __esm({
|
|
1038
1038
|
"packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js"() {
|
|
@@ -1718,14 +1718,14 @@ function formatToolCall(obj) {
|
|
|
1718
1718
|
return ` ${ansi.cyan("\u25C8")} ${slot}${req} ${ansi.dim(desc)}`;
|
|
1719
1719
|
}
|
|
1720
1720
|
case "select_component": {
|
|
1721
|
-
const
|
|
1721
|
+
const name2 = String(obj["name"] ?? "");
|
|
1722
1722
|
const reason = typeof obj["reason"] === "string" ? obj["reason"] : "";
|
|
1723
|
-
return ` ${ansi.green("+")} ${
|
|
1723
|
+
return ` ${ansi.green("+")} ${name2} ${ansi.dim(reason)}`;
|
|
1724
1724
|
}
|
|
1725
1725
|
case "reject_component": {
|
|
1726
|
-
const
|
|
1726
|
+
const name2 = String(obj["name"] ?? "");
|
|
1727
1727
|
const reason = typeof obj["reason"] === "string" ? obj["reason"] : "";
|
|
1728
|
-
return ` ${ansi.dim("\u2013")} ${
|
|
1728
|
+
return ` ${ansi.dim("\u2013")} ${name2} ${ansi.dim(reason)}`;
|
|
1729
1729
|
}
|
|
1730
1730
|
default:
|
|
1731
1731
|
return null;
|
|
@@ -3445,7 +3445,7 @@ function identifiersIn(propTypes) {
|
|
|
3445
3445
|
return [...names];
|
|
3446
3446
|
}
|
|
3447
3447
|
function declaresAnyType(text, typeNames) {
|
|
3448
|
-
return typeNames.some((
|
|
3448
|
+
return typeNames.some((name2) => new RegExp(`\\b(?:type|interface|enum|const|class)\\s+${escapeForRegExp(name2)}\\b`).test(text));
|
|
3449
3449
|
}
|
|
3450
3450
|
function extractRelativeImportPaths(sourceText) {
|
|
3451
3451
|
const specifiers = /* @__PURE__ */ new Set();
|
|
@@ -3510,7 +3510,7 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
3510
3510
|
frontier = nextFrontier;
|
|
3511
3511
|
}
|
|
3512
3512
|
const inHand = [sourceText, ...discovered.map((d) => d.content)];
|
|
3513
|
-
const declaredTypeNames = candidateTypeNames.filter((
|
|
3513
|
+
const declaredTypeNames = candidateTypeNames.filter((name2) => inHand.some((text) => declaresAnyType(text, [name2])));
|
|
3514
3514
|
const usesNotShown = /* @__PURE__ */ new Set();
|
|
3515
3515
|
const searchNames = [.../* @__PURE__ */ new Set([...propNames, ...declaredTypeNames])];
|
|
3516
3516
|
let enlarged = 0;
|
|
@@ -3520,19 +3520,19 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
3520
3520
|
enlarged++;
|
|
3521
3521
|
const budget = enlarge ? MAX_TYPE_DECLARING_SIBLING_CHARS : MAX_SIBLING_SNIPPET_CHARS;
|
|
3522
3522
|
const excerpt = excerptAroundNames(d.content, searchNames, budget);
|
|
3523
|
-
for (const
|
|
3524
|
-
usesNotShown.add(
|
|
3523
|
+
for (const name2 of excerpt.usesNotShown)
|
|
3524
|
+
usesNotShown.add(name2);
|
|
3525
3525
|
return { path: d.path, content: excerpt.content };
|
|
3526
3526
|
});
|
|
3527
3527
|
const truncatedCount = Math.max(0, discovered.length - MAX_SIBLING_FILES);
|
|
3528
3528
|
return {
|
|
3529
3529
|
siblings,
|
|
3530
3530
|
truncatedCount,
|
|
3531
|
-
usesNotShown: propNames.filter((
|
|
3531
|
+
usesNotShown: propNames.filter((name2) => usesNotShown.has(name2)),
|
|
3532
3532
|
declaredTypeNames
|
|
3533
3533
|
};
|
|
3534
3534
|
}
|
|
3535
|
-
async function loadComponentSourceRef(
|
|
3535
|
+
async function loadComponentSourceRef(name2, sourcePath, propNames = [], propTypes = []) {
|
|
3536
3536
|
let content = null;
|
|
3537
3537
|
let siblingFiles = [];
|
|
3538
3538
|
let truncatedSiblingCount = 0;
|
|
@@ -3549,18 +3549,18 @@ async function loadComponentSourceRef(name, sourcePath, propNames = [], propType
|
|
|
3549
3549
|
} = await loadSiblingFiles(rawText, sourcePath, propNames, identifiersIn(propTypes)));
|
|
3550
3550
|
const mainExcerpt = excerptAroundNames(rawText, [.../* @__PURE__ */ new Set([...propNames, ...declaredTypeNames])], MAX_COMPONENT_SOURCE_CHARS);
|
|
3551
3551
|
content = mainExcerpt.content;
|
|
3552
|
-
for (const
|
|
3553
|
-
usesNotShown.add(
|
|
3554
|
-
for (const
|
|
3555
|
-
usesNotShown.add(
|
|
3552
|
+
for (const name3 of mainExcerpt.usesNotShown)
|
|
3553
|
+
usesNotShown.add(name3);
|
|
3554
|
+
for (const name3 of siblingUsesNotShown)
|
|
3555
|
+
usesNotShown.add(name3);
|
|
3556
3556
|
} catch {
|
|
3557
3557
|
}
|
|
3558
|
-
const ref = { component:
|
|
3558
|
+
const ref = { component: name2, sourcePath, content };
|
|
3559
3559
|
if (siblingFiles.length > 0)
|
|
3560
3560
|
ref.siblingFiles = siblingFiles;
|
|
3561
3561
|
if (truncatedSiblingCount > 0)
|
|
3562
3562
|
ref.truncatedSiblingCount = truncatedSiblingCount;
|
|
3563
|
-
const notShown = propNames.filter((
|
|
3563
|
+
const notShown = propNames.filter((name3) => usesNotShown.has(name3));
|
|
3564
3564
|
if (notShown.length > 0)
|
|
3565
3565
|
ref.usesNotShown = notShown;
|
|
3566
3566
|
return ref;
|
|
@@ -3713,7 +3713,7 @@ function loadCDFComponents(db, sessionId) {
|
|
|
3713
3713
|
const allowedComponentsBySlot = indexRowsByKey(allowedComponents, (ac) => `${ac.component_id}::${ac.slot_name}`);
|
|
3714
3714
|
const tokenPathsByProp = indexRowsByKey(tokenPaths, (t) => `${t.component_id}::${t.prop_name}`);
|
|
3715
3715
|
const toTokenPaths = (rows) => rows === void 0 ? void 0 : rows.map((r) => r.path);
|
|
3716
|
-
return components.map(({ component_id, name, description }) => {
|
|
3716
|
+
return components.map(({ component_id, name: name2, description }) => {
|
|
3717
3717
|
const compProps = propsByComponent.get(component_id) ?? [];
|
|
3718
3718
|
const $properties = {};
|
|
3719
3719
|
for (const p of compProps) {
|
|
@@ -3770,7 +3770,7 @@ function loadCDFComponents(db, sessionId) {
|
|
|
3770
3770
|
entry.$description = description;
|
|
3771
3771
|
if (Object.keys($slots).length > 0)
|
|
3772
3772
|
entry.$slots = $slots;
|
|
3773
|
-
return { key:
|
|
3773
|
+
return { key: name2, entry };
|
|
3774
3774
|
});
|
|
3775
3775
|
}
|
|
3776
3776
|
function loadScopeComponents(db, sessionId) {
|
|
@@ -4648,29 +4648,29 @@ function extractTsxComponents(filePaths, componentFilePattern, extract) {
|
|
|
4648
4648
|
}
|
|
4649
4649
|
function resolveDefaultExportName(declarations, exported, allowVariableDeclaration = false) {
|
|
4650
4650
|
const declaration = declarations[0];
|
|
4651
|
-
const
|
|
4652
|
-
if (!
|
|
4651
|
+
const name2 = Node.isFunctionDeclaration(declaration) ? declaration.getName() : allowVariableDeclaration && Node.isVariableDeclaration(declaration) ? declaration.getName() : void 0;
|
|
4652
|
+
if (!name2 || !/^[A-Z]/.test(name2) || exported.has(name2))
|
|
4653
4653
|
return void 0;
|
|
4654
|
-
return
|
|
4654
|
+
return name2;
|
|
4655
4655
|
}
|
|
4656
4656
|
function getRenderableExports(sourceFile, exclusions, options) {
|
|
4657
4657
|
const renderable = [];
|
|
4658
4658
|
const exported = sourceFile.getExportedDeclarations();
|
|
4659
4659
|
for (const [exportKey, declarations] of exported) {
|
|
4660
|
-
const
|
|
4661
|
-
if (!
|
|
4660
|
+
const name2 = exportKey === "default" ? resolveDefaultExportName(declarations, exported, options.allowVariableDeclaration) : exportKey;
|
|
4661
|
+
if (!name2 || !/^[A-Z]/.test(name2))
|
|
4662
4662
|
continue;
|
|
4663
|
-
if (
|
|
4663
|
+
if (name2.startsWith("use")) {
|
|
4664
4664
|
exclusions.push({
|
|
4665
4665
|
itemType: "component",
|
|
4666
|
-
name,
|
|
4666
|
+
name: name2,
|
|
4667
4667
|
source: sourceFile.getFilePath(),
|
|
4668
4668
|
reason: options.hookReason,
|
|
4669
4669
|
stage: "component-filter"
|
|
4670
4670
|
});
|
|
4671
4671
|
continue;
|
|
4672
4672
|
}
|
|
4673
|
-
renderable.push({ name, declarations });
|
|
4673
|
+
renderable.push({ name: name2, declarations });
|
|
4674
4674
|
}
|
|
4675
4675
|
return renderable;
|
|
4676
4676
|
}
|
|
@@ -5069,7 +5069,7 @@ function extractProps(classDecl) {
|
|
|
5069
5069
|
for (const property of classDecl.getProperties()) {
|
|
5070
5070
|
if (!hasDecorator(property, "Prop"))
|
|
5071
5071
|
continue;
|
|
5072
|
-
const
|
|
5072
|
+
const name2 = property.getName();
|
|
5073
5073
|
const typeNode = property.getTypeNode();
|
|
5074
5074
|
const typeText = typeNode ? typeNode.getText() : "unknown";
|
|
5075
5075
|
const hasQuestionToken = property.hasQuestionToken();
|
|
@@ -5107,21 +5107,21 @@ function extractProps(classDecl) {
|
|
|
5107
5107
|
}
|
|
5108
5108
|
const allowedValues = extractAllowedValues2(typeText);
|
|
5109
5109
|
props.push({
|
|
5110
|
-
name,
|
|
5110
|
+
name: name2,
|
|
5111
5111
|
type: typeText,
|
|
5112
5112
|
required: isRequired,
|
|
5113
5113
|
...defaultValue !== void 0 && { defaultValue },
|
|
5114
5114
|
...description && { description },
|
|
5115
5115
|
...allowedValues && { allowedValues },
|
|
5116
|
-
...intrinsicDomAttributeProps.has(
|
|
5116
|
+
...intrinsicDomAttributeProps.has(name2) && { domAttribute: true },
|
|
5117
5117
|
sourceStartLine: property.getStartLineNumber(),
|
|
5118
5118
|
sourceEndLine: property.getEndLineNumber()
|
|
5119
5119
|
});
|
|
5120
5120
|
}
|
|
5121
5121
|
return props.sort((a, b) => a.name.localeCompare(b.name));
|
|
5122
5122
|
}
|
|
5123
|
-
function normalizeSlotName(
|
|
5124
|
-
const normalizedName =
|
|
5123
|
+
function normalizeSlotName(name2) {
|
|
5124
|
+
const normalizedName = name2 && name2.length > 0 ? name2 : "default";
|
|
5125
5125
|
return {
|
|
5126
5126
|
name: normalizedName,
|
|
5127
5127
|
isDefault: normalizedName === "default"
|
|
@@ -5191,9 +5191,9 @@ function extractSlots(classDecl, warnings, componentName) {
|
|
|
5191
5191
|
if (tagName === "slot") {
|
|
5192
5192
|
const nameAttribute = openingElement.getAttributes().find((attribute) => Node2.isJsxAttribute(attribute) && attribute.getNameNode().getText() === "name");
|
|
5193
5193
|
const initializer2 = Node2.isJsxAttribute(nameAttribute) ? nameAttribute.getInitializer() : void 0;
|
|
5194
|
-
const
|
|
5194
|
+
const name3 = initializer2 && Node2.isStringLiteral(initializer2) ? initializer2.getLiteralValue() : initializer2 && Node2.isJsxExpression(initializer2) ? initializer2.getExpression()?.getText() ?? "" : "";
|
|
5195
5195
|
upsertSlot({
|
|
5196
|
-
...normalizeSlotName(
|
|
5196
|
+
...normalizeSlotName(name3)
|
|
5197
5197
|
});
|
|
5198
5198
|
return;
|
|
5199
5199
|
}
|
|
@@ -5202,11 +5202,11 @@ function extractSlots(classDecl, warnings, componentName) {
|
|
|
5202
5202
|
const initializer = slotAttribute.getInitializer();
|
|
5203
5203
|
if (!initializer || !Node2.isStringLiteral(initializer))
|
|
5204
5204
|
return;
|
|
5205
|
-
const
|
|
5206
|
-
if (!
|
|
5205
|
+
const name2 = initializer.getLiteralValue();
|
|
5206
|
+
if (!name2)
|
|
5207
5207
|
return;
|
|
5208
5208
|
upsertSlot({
|
|
5209
|
-
name,
|
|
5209
|
+
name: name2,
|
|
5210
5210
|
isDefault: false
|
|
5211
5211
|
});
|
|
5212
5212
|
});
|
|
@@ -5228,15 +5228,15 @@ function extractFromSourceFile(sourceFile, warnings) {
|
|
|
5228
5228
|
const tag = getComponentTag(classDecl);
|
|
5229
5229
|
if (!tag)
|
|
5230
5230
|
continue;
|
|
5231
|
-
const
|
|
5231
|
+
const name2 = kebabToPascal(tag);
|
|
5232
5232
|
const props = extractProps(classDecl);
|
|
5233
|
-
const slots = extractSlots(classDecl, warnings,
|
|
5233
|
+
const slots = extractSlots(classDecl, warnings, name2);
|
|
5234
5234
|
const eventNames = detectEvents(classDecl);
|
|
5235
5235
|
if (eventNames.length > 0) {
|
|
5236
|
-
warnings.push(`Component ${
|
|
5236
|
+
warnings.push(`Component ${name2} has ${eventNames.length} events not captured: ${eventNames.join(", ")}`);
|
|
5237
5237
|
}
|
|
5238
5238
|
components.push({
|
|
5239
|
-
name,
|
|
5239
|
+
name: name2,
|
|
5240
5240
|
source: sourceFile.getFilePath(),
|
|
5241
5241
|
sourcePath: sourceFile.getFilePath(),
|
|
5242
5242
|
framework: "stencil",
|
|
@@ -5403,9 +5403,9 @@ function extractAllowedComponentsFromJsdoc(jsdocText, componentNames) {
|
|
|
5403
5403
|
return [];
|
|
5404
5404
|
const found = /* @__PURE__ */ new Set();
|
|
5405
5405
|
for (const raw of m[1].split(",")) {
|
|
5406
|
-
const
|
|
5407
|
-
if (
|
|
5408
|
-
found.add(
|
|
5406
|
+
const name2 = raw.trim();
|
|
5407
|
+
if (name2 && componentNames.has(name2))
|
|
5408
|
+
found.add(name2);
|
|
5409
5409
|
}
|
|
5410
5410
|
return [...found].sort();
|
|
5411
5411
|
}
|
|
@@ -5453,8 +5453,8 @@ function collectTypePredicateComponentReferences(sourceFile, ctx) {
|
|
|
5453
5453
|
const assertedTypeNode = returnTypeNode.getTypeNode();
|
|
5454
5454
|
if (!assertedTypeNode)
|
|
5455
5455
|
continue;
|
|
5456
|
-
for (const
|
|
5457
|
-
found.add(
|
|
5456
|
+
for (const name2 of extractAllowedComponentsFromTypeText(assertedTypeNode.getText(), ctx)) {
|
|
5457
|
+
found.add(name2);
|
|
5458
5458
|
}
|
|
5459
5459
|
}
|
|
5460
5460
|
return [...found].sort();
|
|
@@ -5473,13 +5473,13 @@ function collectRuntimeTypeCheckComponentReferences(sourceFile, componentNames)
|
|
|
5473
5473
|
return void 0;
|
|
5474
5474
|
if (!Node3.isIdentifier(otherSide) && !Node3.isPropertyAccessExpression(otherSide))
|
|
5475
5475
|
return void 0;
|
|
5476
|
-
const
|
|
5477
|
-
if (!
|
|
5476
|
+
const name2 = otherSide.getText().split(".").pop();
|
|
5477
|
+
if (!name2 || !componentNames.has(name2))
|
|
5478
5478
|
return void 0;
|
|
5479
5479
|
const baseIdentifier = Node3.isPropertyAccessExpression(otherSide) ? otherSide.getExpression() : otherSide;
|
|
5480
5480
|
if (!Node3.isIdentifier(baseIdentifier) || !localBindings.has(baseIdentifier.getText()))
|
|
5481
5481
|
return void 0;
|
|
5482
|
-
return
|
|
5482
|
+
return name2;
|
|
5483
5483
|
};
|
|
5484
5484
|
const match2 = candidateFromTypeAccess(left, right) ?? candidateFromTypeAccess(right, left);
|
|
5485
5485
|
if (match2)
|
|
@@ -5531,8 +5531,8 @@ function collectArrayMapRenderComponentReferences(funcNode, componentNames, ownC
|
|
|
5531
5531
|
const found = /* @__PURE__ */ new Set();
|
|
5532
5532
|
const propNames = new Set(propTypesByName.keys());
|
|
5533
5533
|
const renderCountByComponent = /* @__PURE__ */ new Map();
|
|
5534
|
-
const bumpRenderCount = (
|
|
5535
|
-
renderCountByComponent.set(
|
|
5534
|
+
const bumpRenderCount = (name2) => {
|
|
5535
|
+
renderCountByComponent.set(name2, (renderCountByComponent.get(name2) ?? 0) + 1);
|
|
5536
5536
|
};
|
|
5537
5537
|
for (const jsxElement of [
|
|
5538
5538
|
...funcNode.getDescendantsOfKind(SyntaxKind3.JsxSelfClosingElement),
|
|
@@ -5695,7 +5695,7 @@ function sourceFileUsesCreateContext(sourceFile) {
|
|
|
5695
5695
|
function isNextJsComponent(filePath, exportedNames) {
|
|
5696
5696
|
const normalized = filePath.replace(/\\/g, "/");
|
|
5697
5697
|
const isAppRouterFile = /\/app\/.*\/(page|layout)\.[jt]sx?$/.test(normalized);
|
|
5698
|
-
const hasNextExports = exportedNames.some((
|
|
5698
|
+
const hasNextExports = exportedNames.some((name2) => name2 === "generateMetadata" || name2 === "generateStaticParams");
|
|
5699
5699
|
return isAppRouterFile || hasNextExports;
|
|
5700
5700
|
}
|
|
5701
5701
|
function isRepoLocalTransparentPolymorphicWrapperDeclaration(declaration, typeName) {
|
|
@@ -5877,8 +5877,8 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
5877
5877
|
const props = [];
|
|
5878
5878
|
let hasChildren = false;
|
|
5879
5879
|
for (const property of type.getProperties()) {
|
|
5880
|
-
const
|
|
5881
|
-
if (
|
|
5880
|
+
const name2 = property.getName();
|
|
5881
|
+
if (name2 === "children") {
|
|
5882
5882
|
if (suppressNeverChildrenSlot) {
|
|
5883
5883
|
const declaration2 = property.getValueDeclaration() ?? property.getDeclarations()[0];
|
|
5884
5884
|
if (declaration2 && property.getTypeAtLocation(declaration2).isNever()) {
|
|
@@ -5888,7 +5888,7 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
5888
5888
|
hasChildren = true;
|
|
5889
5889
|
continue;
|
|
5890
5890
|
}
|
|
5891
|
-
if (slotNames.has(
|
|
5891
|
+
if (slotNames.has(name2))
|
|
5892
5892
|
continue;
|
|
5893
5893
|
const declaration = property.getValueDeclaration() ?? property.getDeclarations()[0];
|
|
5894
5894
|
if (!declaration)
|
|
@@ -5899,7 +5899,7 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
5899
5899
|
const required = !property.isOptional();
|
|
5900
5900
|
const allowedValues = extractAllowedValues(propType);
|
|
5901
5901
|
props.push({
|
|
5902
|
-
name,
|
|
5902
|
+
name: name2,
|
|
5903
5903
|
type: typeText,
|
|
5904
5904
|
required,
|
|
5905
5905
|
...allowedValues && { allowedValues },
|
|
@@ -5930,19 +5930,19 @@ function extractPropsFromInterfaceDeclaration(declaration, slotNames, seen, excl
|
|
|
5930
5930
|
return acc;
|
|
5931
5931
|
const propType = symbol.getTypeAtLocation(decl);
|
|
5932
5932
|
const typeText = propType.isAny() ? ("getTypeNode" in decl && typeof decl.getTypeNode === "function" ? decl.getTypeNode()?.getText() : void 0) ?? propType.getText(decl) : propType.getText(decl);
|
|
5933
|
-
const
|
|
5934
|
-
if (
|
|
5933
|
+
const name2 = symbol.getName();
|
|
5934
|
+
if (name2 === "children") {
|
|
5935
5935
|
if (suppressNeverChildrenSlot && propType.isNever())
|
|
5936
5936
|
return acc;
|
|
5937
5937
|
acc.hasChildren = true;
|
|
5938
5938
|
return acc;
|
|
5939
5939
|
}
|
|
5940
|
-
if (slotNames.has(
|
|
5940
|
+
if (slotNames.has(name2))
|
|
5941
5941
|
return acc;
|
|
5942
5942
|
const required = !symbol.isOptional();
|
|
5943
5943
|
const allowedValues = extractAllowedValues(propType);
|
|
5944
5944
|
acc.props.push({
|
|
5945
|
-
name,
|
|
5945
|
+
name: name2,
|
|
5946
5946
|
type: typeText,
|
|
5947
5947
|
required,
|
|
5948
5948
|
...allowedValues && { allowedValues },
|
|
@@ -6275,7 +6275,7 @@ function collectReboundDeclarations(body) {
|
|
|
6275
6275
|
function collectPropDataflow(func, param, availablePropNames) {
|
|
6276
6276
|
const valueAliases = /* @__PURE__ */ new Map();
|
|
6277
6277
|
const objectAliases = /* @__PURE__ */ new Map();
|
|
6278
|
-
const fullPropsShape = new Map([...availablePropNames].map((
|
|
6278
|
+
const fullPropsShape = new Map([...availablePropNames].map((name2) => [name2, name2]));
|
|
6279
6279
|
const belongsToComponentFunction = (node) => node.getFirstAncestor((ancestor) => Node4.isFunctionDeclaration(ancestor) || Node4.isArrowFunction(ancestor) || Node4.isFunctionExpression(ancestor)) === func;
|
|
6280
6280
|
const resolveValue = (expression) => {
|
|
6281
6281
|
if (!expression)
|
|
@@ -6469,12 +6469,12 @@ function extractSlots2(type, hasChildren) {
|
|
|
6469
6469
|
slots.push({ name: "children", isDefault: true });
|
|
6470
6470
|
}
|
|
6471
6471
|
for (const property of type.getProperties()) {
|
|
6472
|
-
const
|
|
6473
|
-
if (
|
|
6472
|
+
const name2 = property.getName();
|
|
6473
|
+
if (name2 === "children")
|
|
6474
6474
|
continue;
|
|
6475
6475
|
if (!getRenderPropType(property))
|
|
6476
6476
|
continue;
|
|
6477
|
-
const slotName =
|
|
6477
|
+
const slotName = name2.replace(/^render/, "");
|
|
6478
6478
|
slots.push({
|
|
6479
6479
|
name: slotName.charAt(0).toLowerCase() + slotName.slice(1),
|
|
6480
6480
|
isDefault: false
|
|
@@ -6487,9 +6487,9 @@ function isExpandableDomAttributeWrapperName(typeName) {
|
|
|
6487
6487
|
}
|
|
6488
6488
|
function getStringLiteralTypeValues(typeNode) {
|
|
6489
6489
|
if (Node4.isLiteralTypeNode(typeNode)) {
|
|
6490
|
-
const
|
|
6491
|
-
if (Node4.isStringLiteral(
|
|
6492
|
-
return [
|
|
6490
|
+
const literal4 = typeNode.getLiteral();
|
|
6491
|
+
if (Node4.isStringLiteral(literal4)) {
|
|
6492
|
+
return [literal4.getLiteralText()];
|
|
6493
6493
|
}
|
|
6494
6494
|
}
|
|
6495
6495
|
if (!Node4.isUnionTypeNode(typeNode))
|
|
@@ -6730,17 +6730,17 @@ function getSyntheticDomAttributeProps(typeNode) {
|
|
|
6730
6730
|
}
|
|
6731
6731
|
return [...propsByName.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
6732
6732
|
}
|
|
6733
|
-
function getDomAttributeSurface(
|
|
6734
|
-
if (seen.has(
|
|
6733
|
+
function getDomAttributeSurface(name2, seen = /* @__PURE__ */ new Set()) {
|
|
6734
|
+
if (seen.has(name2))
|
|
6735
6735
|
return [];
|
|
6736
|
-
seen.add(
|
|
6736
|
+
seen.add(name2);
|
|
6737
6737
|
const propsByName = /* @__PURE__ */ new Map();
|
|
6738
|
-
for (const parentName of DOM_ATTRIBUTE_WRAPPER_PARENTS[
|
|
6738
|
+
for (const parentName of DOM_ATTRIBUTE_WRAPPER_PARENTS[name2] ?? []) {
|
|
6739
6739
|
for (const prop of getDomAttributeSurface(parentName, seen)) {
|
|
6740
6740
|
propsByName.set(prop.name, prop);
|
|
6741
6741
|
}
|
|
6742
6742
|
}
|
|
6743
|
-
for (const prop of DOM_ATTRIBUTE_PROP_SURFACES[
|
|
6743
|
+
for (const prop of DOM_ATTRIBUTE_PROP_SURFACES[name2]) {
|
|
6744
6744
|
propsByName.set(prop.name, prop);
|
|
6745
6745
|
}
|
|
6746
6746
|
return [...propsByName.values()].map((prop) => ({
|
|
@@ -6837,12 +6837,12 @@ function extractPickedPropsFromTypeNode(typeNode, slotNames, excludedProps = /*
|
|
|
6837
6837
|
}
|
|
6838
6838
|
const pickedKeys = getStringLiteralTypeValues(pickedKeysNode);
|
|
6839
6839
|
const props = [];
|
|
6840
|
-
for (const
|
|
6841
|
-
if (slotNames.has(
|
|
6840
|
+
for (const name2 of pickedKeys) {
|
|
6841
|
+
if (slotNames.has(name2))
|
|
6842
6842
|
continue;
|
|
6843
|
-
if (excludedProps.has(
|
|
6843
|
+
if (excludedProps.has(name2))
|
|
6844
6844
|
continue;
|
|
6845
|
-
const pickedProp = sourcePropsByName.get(
|
|
6845
|
+
const pickedProp = sourcePropsByName.get(name2);
|
|
6846
6846
|
if (pickedProp) {
|
|
6847
6847
|
props.push(pickedProp);
|
|
6848
6848
|
}
|
|
@@ -7071,7 +7071,7 @@ async function extractReactComponents(filePaths) {
|
|
|
7071
7071
|
function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
7072
7072
|
const components = [];
|
|
7073
7073
|
const usesCreateContext = sourceFileUsesCreateContext(sourceFile);
|
|
7074
|
-
for (const { name, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
7074
|
+
for (const { name: name2, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
7075
7075
|
allowVariableDeclaration: true,
|
|
7076
7076
|
hookReason: "React hook names are not renderable components"
|
|
7077
7077
|
})) {
|
|
@@ -7083,7 +7083,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
7083
7083
|
const params = funcNode.getParameters();
|
|
7084
7084
|
if (params.length === 0) {
|
|
7085
7085
|
components.push({
|
|
7086
|
-
name,
|
|
7086
|
+
name: name2,
|
|
7087
7087
|
source: sourceFile.getFilePath(),
|
|
7088
7088
|
sourcePath: sourceFile.getFilePath(),
|
|
7089
7089
|
framework: isNext ? "next" : "react",
|
|
@@ -7127,7 +7127,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
7127
7127
|
}
|
|
7128
7128
|
const resolvedProps = [...mergedPropsByName.values()];
|
|
7129
7129
|
const noUsefulTypes = resolvedProps.length === 0 || resolvedProps.every((p) => p.type === "any");
|
|
7130
|
-
const finalProps = noUsefulTypes ? extractPropTypes(sourceFile,
|
|
7130
|
+
const finalProps = noUsefulTypes ? extractPropTypes(sourceFile, name2) ?? resolvedProps : resolvedProps;
|
|
7131
7131
|
const propsWithDefaults = finalProps.map((p) => {
|
|
7132
7132
|
if (!defaults.has(p.name))
|
|
7133
7133
|
return p;
|
|
@@ -7160,7 +7160,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
7160
7160
|
const propsTypeName = firstParamTypeNode?.getText?.().trim();
|
|
7161
7161
|
const propsTypeNameCapture = propsTypeName && /^[A-Za-z_$][\w$]*$/.test(propsTypeName) ? propsTypeName : void 0;
|
|
7162
7162
|
components.push({
|
|
7163
|
-
name,
|
|
7163
|
+
name: name2,
|
|
7164
7164
|
source: sourceFile.getFilePath(),
|
|
7165
7165
|
sourcePath: sourceFile.getFilePath(),
|
|
7166
7166
|
framework: isNext ? "next" : "react",
|
|
@@ -7561,10 +7561,10 @@ async function extractVueTsxComponents(filePaths) {
|
|
|
7561
7561
|
}
|
|
7562
7562
|
function extractFromSourceFile3(sourceFile, exclusions) {
|
|
7563
7563
|
const components = [];
|
|
7564
|
-
for (const { name, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
7564
|
+
for (const { name: name2, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
7565
7565
|
hookReason: "Vue composition hook names are not renderable components"
|
|
7566
7566
|
})) {
|
|
7567
|
-
const component = extractVueTsxComponent(declarations,
|
|
7567
|
+
const component = extractVueTsxComponent(declarations, name2, sourceFile);
|
|
7568
7568
|
if (component) {
|
|
7569
7569
|
components.push(component);
|
|
7570
7570
|
}
|
|
@@ -7580,11 +7580,11 @@ function extractVueTsxComponent(declarations, exportName, sourceFile) {
|
|
|
7580
7580
|
const resolved = resolveVueComponentOptions(declaration.getInitializer());
|
|
7581
7581
|
if (!resolved)
|
|
7582
7582
|
continue;
|
|
7583
|
-
const
|
|
7583
|
+
const name2 = extractVueGenericComponentName(resolved.options) ?? exportName;
|
|
7584
7584
|
const props = extractVueGenericComponentProps(resolved.options);
|
|
7585
7585
|
const slots = extractVueGenericComponentSlots(resolved.options, resolved.slotsTypeNode);
|
|
7586
7586
|
return {
|
|
7587
|
-
name,
|
|
7587
|
+
name: name2,
|
|
7588
7588
|
source: sourceFile.getFilePath(),
|
|
7589
7589
|
framework: "vue",
|
|
7590
7590
|
props,
|
|
@@ -7758,16 +7758,16 @@ function extractVueObjectPropDefinition(propName, initializer) {
|
|
|
7758
7758
|
for (const property of initializer.getProperties()) {
|
|
7759
7759
|
if (!Node5.isPropertyAssignment(property))
|
|
7760
7760
|
continue;
|
|
7761
|
-
const
|
|
7761
|
+
const name2 = property.getName();
|
|
7762
7762
|
const value = property.getInitializer();
|
|
7763
7763
|
if (!value)
|
|
7764
7764
|
continue;
|
|
7765
|
-
if (
|
|
7765
|
+
if (name2 === "type") {
|
|
7766
7766
|
type = getVuePropTypeText(value);
|
|
7767
7767
|
allowedValues = extractAllowedValues(value.getType());
|
|
7768
|
-
} else if (
|
|
7768
|
+
} else if (name2 === "required") {
|
|
7769
7769
|
required = value.getText() === "true";
|
|
7770
|
-
} else if (
|
|
7770
|
+
} else if (name2 === "default") {
|
|
7771
7771
|
defaultValue = value.getText();
|
|
7772
7772
|
}
|
|
7773
7773
|
}
|
|
@@ -8063,20 +8063,20 @@ async function extractVueComponents(filePaths, onProgress) {
|
|
|
8063
8063
|
async function extractFromVueSFC(filePath, source) {
|
|
8064
8064
|
const { descriptor, errors } = parseSFC(source);
|
|
8065
8065
|
const fileWarnings = errors.map((e) => `Parse error in ${filePath}: ${e instanceof Error ? e.message : String(e)}`);
|
|
8066
|
-
const
|
|
8066
|
+
const name2 = getVueComponentName(filePath);
|
|
8067
8067
|
let props = [];
|
|
8068
8068
|
const setupProps = descriptor.scriptSetup ? await extractSetupProps(filePath, descriptor.scriptSetup.content) : null;
|
|
8069
8069
|
if (setupProps !== null) {
|
|
8070
8070
|
props = setupProps;
|
|
8071
8071
|
} else if (descriptor.script) {
|
|
8072
|
-
return extractOptionsComponent(filePath, descriptor.script.content, fileWarnings,
|
|
8072
|
+
return extractOptionsComponent(filePath, descriptor.script.content, fileWarnings, name2, descriptor.template?.ast, source);
|
|
8073
8073
|
}
|
|
8074
8074
|
let slots = descriptor.template?.ast ? extractSlotsFromTemplate(descriptor.template.ast) : [];
|
|
8075
8075
|
const runtimeSlots = extractSlotsFromRuntimeAccess(source);
|
|
8076
8076
|
slots = mergeSlotsDedup(slots, runtimeSlots);
|
|
8077
8077
|
return {
|
|
8078
8078
|
component: {
|
|
8079
|
-
name,
|
|
8079
|
+
name: name2,
|
|
8080
8080
|
source: filePath,
|
|
8081
8081
|
sourcePath: filePath,
|
|
8082
8082
|
framework: "vue",
|
|
@@ -8094,7 +8094,7 @@ function getVueComponentName(filePath) {
|
|
|
8094
8094
|
const parentDirName = basename(dirname6(filePath));
|
|
8095
8095
|
return parentDirName || fileName;
|
|
8096
8096
|
}
|
|
8097
|
-
async function extractOptionsComponent(filePath, scriptContent, fileWarnings,
|
|
8097
|
+
async function extractOptionsComponent(filePath, scriptContent, fileWarnings, name2, templateAst, sfcSource) {
|
|
8098
8098
|
const props = await extractOptionsProps(filePath, scriptContent);
|
|
8099
8099
|
let slots = templateAst ? extractSlotsFromTemplate(templateAst) : [];
|
|
8100
8100
|
if (sfcSource) {
|
|
@@ -8103,7 +8103,7 @@ async function extractOptionsComponent(filePath, scriptContent, fileWarnings, na
|
|
|
8103
8103
|
}
|
|
8104
8104
|
return {
|
|
8105
8105
|
component: {
|
|
8106
|
-
name,
|
|
8106
|
+
name: name2,
|
|
8107
8107
|
source: filePath,
|
|
8108
8108
|
sourcePath: filePath,
|
|
8109
8109
|
framework: "vue",
|
|
@@ -8176,13 +8176,13 @@ function extractGenericProps(typeText) {
|
|
|
8176
8176
|
const resolved = resolveTypeProperty(property);
|
|
8177
8177
|
if (!resolved)
|
|
8178
8178
|
continue;
|
|
8179
|
-
const { name, typeText: resolvedTypeText, required } = resolved;
|
|
8179
|
+
const { name: name2, typeText: resolvedTypeText, required } = resolved;
|
|
8180
8180
|
let typeText2 = resolvedTypeText;
|
|
8181
8181
|
if (!required) {
|
|
8182
8182
|
typeText2 = typeText2.replace(/\s*\|\s*undefined$/, "").replace(/^undefined\s*\|\s*/, "");
|
|
8183
8183
|
}
|
|
8184
8184
|
props.push({
|
|
8185
|
-
name,
|
|
8185
|
+
name: name2,
|
|
8186
8186
|
type: typeText2,
|
|
8187
8187
|
required
|
|
8188
8188
|
});
|
|
@@ -8478,14 +8478,14 @@ function parseObjectProps(obj) {
|
|
|
8478
8478
|
for (const prop of obj.getProperties()) {
|
|
8479
8479
|
if (!Node6.isPropertyAssignment(prop))
|
|
8480
8480
|
continue;
|
|
8481
|
-
const
|
|
8482
|
-
if (!isPublicVuePropName(
|
|
8481
|
+
const name2 = prop.getName();
|
|
8482
|
+
if (!isPublicVuePropName(name2))
|
|
8483
8483
|
continue;
|
|
8484
8484
|
const init = prop.getInitializer();
|
|
8485
8485
|
if (!init || !Node6.isObjectLiteralExpression(init)) {
|
|
8486
8486
|
const initText = init?.getText() ?? "any";
|
|
8487
8487
|
result.push({
|
|
8488
|
-
name,
|
|
8488
|
+
name: name2,
|
|
8489
8489
|
type: VUE_TYPE_MAP[initText] ?? "any",
|
|
8490
8490
|
required: false,
|
|
8491
8491
|
sourceStartLine: prop.getStartLineNumber(),
|
|
@@ -8518,7 +8518,7 @@ function parseObjectProps(obj) {
|
|
|
8518
8518
|
}
|
|
8519
8519
|
}
|
|
8520
8520
|
result.push({
|
|
8521
|
-
name,
|
|
8521
|
+
name: name2,
|
|
8522
8522
|
type,
|
|
8523
8523
|
required,
|
|
8524
8524
|
...defaultValue !== void 0 && { defaultValue },
|
|
@@ -8528,8 +8528,8 @@ function parseObjectProps(obj) {
|
|
|
8528
8528
|
}
|
|
8529
8529
|
return result;
|
|
8530
8530
|
}
|
|
8531
|
-
function isPublicVuePropName(
|
|
8532
|
-
return !/^[_$]/.test(
|
|
8531
|
+
function isPublicVuePropName(name2) {
|
|
8532
|
+
return !/^[_$]/.test(name2);
|
|
8533
8533
|
}
|
|
8534
8534
|
function extractSlotsFromTemplate(ast) {
|
|
8535
8535
|
const slots = [];
|
|
@@ -8561,10 +8561,10 @@ function extractSlotsFromRuntimeAccess(source) {
|
|
|
8561
8561
|
for (const pattern of [dotPattern, bracketPattern]) {
|
|
8562
8562
|
let match2;
|
|
8563
8563
|
while ((match2 = pattern.exec(source)) !== null) {
|
|
8564
|
-
const
|
|
8565
|
-
if (!seen.has(
|
|
8566
|
-
seen.add(
|
|
8567
|
-
slots.push({ name, isDefault:
|
|
8564
|
+
const name2 = match2[1];
|
|
8565
|
+
if (!seen.has(name2)) {
|
|
8566
|
+
seen.add(name2);
|
|
8567
|
+
slots.push({ name: name2, isDefault: name2 === "default" });
|
|
8568
8568
|
}
|
|
8569
8569
|
}
|
|
8570
8570
|
}
|
|
@@ -8696,12 +8696,12 @@ function extractPropsFromFrontmatter(frontmatter) {
|
|
|
8696
8696
|
const propsTypeAlias = sf.getTypeAlias("Props");
|
|
8697
8697
|
if (propsInterface) {
|
|
8698
8698
|
for (const member of propsInterface.getProperties()) {
|
|
8699
|
-
const
|
|
8699
|
+
const name2 = member.getName();
|
|
8700
8700
|
const typeText = member.getTypeNode()?.getText() ?? "any";
|
|
8701
8701
|
const required = !member.hasQuestionToken();
|
|
8702
8702
|
const allowedValues = extractAllowedValues3(typeText);
|
|
8703
8703
|
props.push({
|
|
8704
|
-
name,
|
|
8704
|
+
name: name2,
|
|
8705
8705
|
type: typeText,
|
|
8706
8706
|
required,
|
|
8707
8707
|
...allowedValues && { allowedValues },
|
|
@@ -8715,10 +8715,10 @@ function extractPropsFromFrontmatter(frontmatter) {
|
|
|
8715
8715
|
const resolved = resolveTypeProperty(property);
|
|
8716
8716
|
if (!resolved)
|
|
8717
8717
|
continue;
|
|
8718
|
-
const { name, declaration: decl, typeText, required } = resolved;
|
|
8718
|
+
const { name: name2, declaration: decl, typeText, required } = resolved;
|
|
8719
8719
|
const allowedValues = extractAllowedValues3(typeText);
|
|
8720
8720
|
props.push({
|
|
8721
|
-
name,
|
|
8721
|
+
name: name2,
|
|
8722
8722
|
type: typeText,
|
|
8723
8723
|
required,
|
|
8724
8724
|
...allowedValues && { allowedValues },
|
|
@@ -8784,7 +8784,7 @@ function mergeSlots(...slotGroups) {
|
|
|
8784
8784
|
return merged;
|
|
8785
8785
|
}
|
|
8786
8786
|
function extractFromAstroFile(filePath, source) {
|
|
8787
|
-
const
|
|
8787
|
+
const name2 = basename2(filePath, ".astro");
|
|
8788
8788
|
const fenceIndex = source.startsWith("---") ? 0 : -1;
|
|
8789
8789
|
let frontmatter = "";
|
|
8790
8790
|
let template = source;
|
|
@@ -8803,7 +8803,7 @@ function extractFromAstroFile(filePath, source) {
|
|
|
8803
8803
|
});
|
|
8804
8804
|
const slots = mergeSlots(extractSlotsFromTemplate2(template), extractSlotsFromFrontmatter(frontmatter));
|
|
8805
8805
|
return {
|
|
8806
|
-
name,
|
|
8806
|
+
name: name2,
|
|
8807
8807
|
source: filePath,
|
|
8808
8808
|
sourcePath: filePath,
|
|
8809
8809
|
framework: "astro",
|
|
@@ -9023,10 +9023,10 @@ function extractSlotsFromTemplate3(templateContent) {
|
|
|
9023
9023
|
for (const match2 of templateContent.matchAll(slotRegex)) {
|
|
9024
9024
|
const attrs = match2[1] ?? "";
|
|
9025
9025
|
const nameMatch = attrs.match(/\bname=["']([^"']+)["']/);
|
|
9026
|
-
const
|
|
9027
|
-
slots.set(
|
|
9026
|
+
const name2 = nameMatch?.[1] ?? "default";
|
|
9027
|
+
slots.set(name2, name2 === "default");
|
|
9028
9028
|
}
|
|
9029
|
-
return [...slots.entries()].map(([
|
|
9029
|
+
return [...slots.entries()].map(([name2, isDefault]) => ({ name: name2, isDefault })).sort((a, b) => a.name.localeCompare(b.name));
|
|
9030
9030
|
}
|
|
9031
9031
|
function mergeSlotLists(...slotLists) {
|
|
9032
9032
|
const merged = /* @__PURE__ */ new Map();
|
|
@@ -9055,20 +9055,20 @@ function extractJsDocSlots(classDecl) {
|
|
|
9055
9055
|
const comment = tag.getCommentText()?.trim();
|
|
9056
9056
|
if (!comment)
|
|
9057
9057
|
continue;
|
|
9058
|
-
let
|
|
9058
|
+
let name2 = "default";
|
|
9059
9059
|
let description = comment;
|
|
9060
9060
|
if (comment.startsWith("-")) {
|
|
9061
9061
|
description = comment.slice(1).trim();
|
|
9062
9062
|
} else {
|
|
9063
9063
|
const match2 = comment.match(/^(\S+)\s*-\s*(.*)$/s);
|
|
9064
9064
|
if (match2) {
|
|
9065
|
-
|
|
9065
|
+
name2 = match2[1];
|
|
9066
9066
|
description = match2[2].trim();
|
|
9067
9067
|
}
|
|
9068
9068
|
}
|
|
9069
9069
|
slots.push({
|
|
9070
|
-
name,
|
|
9071
|
-
isDefault:
|
|
9070
|
+
name: name2,
|
|
9071
|
+
isDefault: name2 === "default",
|
|
9072
9072
|
...description && { description }
|
|
9073
9073
|
});
|
|
9074
9074
|
}
|
|
@@ -9111,8 +9111,8 @@ function isNonPublicLitMember(member) {
|
|
|
9111
9111
|
function hasShoelaceRuntimeBookkeepingField(classDecl) {
|
|
9112
9112
|
return classDecl.getProperties().some((property) => property.getName() === "initialReflectedProperties");
|
|
9113
9113
|
}
|
|
9114
|
-
function isInternalRuntimeField(
|
|
9115
|
-
return applyRuntimeFieldDenylist && INTERNAL_RUNTIME_FIELD_NAMES.has(
|
|
9114
|
+
function isInternalRuntimeField(name2, applyRuntimeFieldDenylist) {
|
|
9115
|
+
return applyRuntimeFieldDenylist && INTERNAL_RUNTIME_FIELD_NAMES.has(name2);
|
|
9116
9116
|
}
|
|
9117
9117
|
function getExplicitLitPropertyAttributeName(property) {
|
|
9118
9118
|
const decorator = property.getDecorators().find((candidate) => candidate.getName() === "property");
|
|
@@ -9139,8 +9139,8 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
9139
9139
|
continue;
|
|
9140
9140
|
if (isNonPublicLitMember(property))
|
|
9141
9141
|
continue;
|
|
9142
|
-
const
|
|
9143
|
-
if (
|
|
9142
|
+
const name2 = property.getName();
|
|
9143
|
+
if (name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
9144
9144
|
continue;
|
|
9145
9145
|
const scope = property.getScope();
|
|
9146
9146
|
if (scope === "private" || scope === "protected")
|
|
@@ -9155,7 +9155,7 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
9155
9155
|
}
|
|
9156
9156
|
const typeNode = property.getTypeNode();
|
|
9157
9157
|
const type = typeNode ? typeNode.getText() : "any";
|
|
9158
|
-
const publicName =
|
|
9158
|
+
const publicName = name2.startsWith("_") && hasDecorators ? getExplicitLitPropertyAttributeName(property) : null;
|
|
9159
9159
|
let defaultValue;
|
|
9160
9160
|
if (initializer) {
|
|
9161
9161
|
if (Node8.isStringLiteral(initializer)) {
|
|
@@ -9165,7 +9165,7 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
9165
9165
|
}
|
|
9166
9166
|
}
|
|
9167
9167
|
props.push({
|
|
9168
|
-
name: publicName ? kebabToCamel(publicName) :
|
|
9168
|
+
name: publicName ? kebabToCamel(publicName) : name2,
|
|
9169
9169
|
type,
|
|
9170
9170
|
required: false,
|
|
9171
9171
|
...defaultValue !== void 0 && { defaultValue },
|
|
@@ -9185,15 +9185,15 @@ function extractAccessorProperties(classDecl, applyRuntimeFieldDenylist = false)
|
|
|
9185
9185
|
continue;
|
|
9186
9186
|
if (isNonPublicLitMember(getter))
|
|
9187
9187
|
continue;
|
|
9188
|
-
const
|
|
9189
|
-
if (
|
|
9188
|
+
const name2 = getter.getName();
|
|
9189
|
+
if (name2 === "observedAttributes" || name2 === "template" || name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
9190
9190
|
continue;
|
|
9191
9191
|
const scope = getter.getScope();
|
|
9192
9192
|
if (scope === "private" || scope === "protected")
|
|
9193
9193
|
continue;
|
|
9194
|
-
const entry = accessors.get(
|
|
9194
|
+
const entry = accessors.get(name2) ?? {};
|
|
9195
9195
|
entry.getter = getter;
|
|
9196
|
-
accessors.set(
|
|
9196
|
+
accessors.set(name2, entry);
|
|
9197
9197
|
}
|
|
9198
9198
|
for (const setter of classDecl.getSetAccessors()) {
|
|
9199
9199
|
if (setter.isStatic())
|
|
@@ -9202,24 +9202,24 @@ function extractAccessorProperties(classDecl, applyRuntimeFieldDenylist = false)
|
|
|
9202
9202
|
continue;
|
|
9203
9203
|
if (isNonPublicLitMember(setter))
|
|
9204
9204
|
continue;
|
|
9205
|
-
const
|
|
9206
|
-
if (
|
|
9205
|
+
const name2 = setter.getName();
|
|
9206
|
+
if (name2 === "observedAttributes" || name2 === "template" || name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
9207
9207
|
continue;
|
|
9208
9208
|
const scope = setter.getScope();
|
|
9209
9209
|
if (scope === "private" || scope === "protected")
|
|
9210
9210
|
continue;
|
|
9211
|
-
const entry = accessors.get(
|
|
9211
|
+
const entry = accessors.get(name2) ?? {};
|
|
9212
9212
|
entry.setter = setter;
|
|
9213
|
-
accessors.set(
|
|
9213
|
+
accessors.set(name2, entry);
|
|
9214
9214
|
}
|
|
9215
|
-
for (const [
|
|
9215
|
+
for (const [name2, { getter, setter }] of accessors) {
|
|
9216
9216
|
const hasPropertyDecorator = getter?.getDecorators().some((decorator) => decorator.getName() === "property") || setter?.getDecorators().some((decorator) => decorator.getName() === "property");
|
|
9217
9217
|
if (!hasPropertyDecorator && !(getter && setter))
|
|
9218
9218
|
continue;
|
|
9219
9219
|
const type = getter?.getReturnTypeNode()?.getText() ?? setter?.getParameters()[0]?.getTypeNode()?.getText() ?? "any";
|
|
9220
9220
|
const accessorNode = getter ?? setter;
|
|
9221
9221
|
props.push({
|
|
9222
|
-
name,
|
|
9222
|
+
name: name2,
|
|
9223
9223
|
type,
|
|
9224
9224
|
required: false,
|
|
9225
9225
|
...accessorNode ? {
|
|
@@ -9241,11 +9241,11 @@ function extractJsDocAttributeProps(classDecl) {
|
|
|
9241
9241
|
const match2 = normalizedComment?.match(/(?:\{([^}]+)\}\s+)?([^\s]+)(?:\s*-\s*([\s\S]*))?/);
|
|
9242
9242
|
if (!match2)
|
|
9243
9243
|
continue;
|
|
9244
|
-
const [, type,
|
|
9245
|
-
if (!
|
|
9244
|
+
const [, type, name2, description] = match2;
|
|
9245
|
+
if (!name2 || name2.startsWith("#"))
|
|
9246
9246
|
continue;
|
|
9247
9247
|
props.push({
|
|
9248
|
-
name,
|
|
9248
|
+
name: name2,
|
|
9249
9249
|
type: type?.trim() || "any",
|
|
9250
9250
|
required: false,
|
|
9251
9251
|
...description ? { description: description.replace(/\s+/g, " ").trim() } : {}
|
|
@@ -9597,7 +9597,7 @@ function extractFromSourceFile4(sourceFile, project) {
|
|
|
9597
9597
|
const tagName = tagNameMap.get(className) ?? siblingDefinedTagName ?? decoratorTagName ?? jsDocTagName ?? fastDefinitionTagName ?? void 0;
|
|
9598
9598
|
if (!tagName)
|
|
9599
9599
|
continue;
|
|
9600
|
-
const
|
|
9600
|
+
const name2 = chooseComponentName(classDecl, className, tagName);
|
|
9601
9601
|
const observedAttrs = extractObservedAttributes(classDecl);
|
|
9602
9602
|
const inheritedProps = extractInheritedClassProperties(classDecl, project);
|
|
9603
9603
|
const classProps = mergePropLists(extractJsDocAttributeProps(classDecl), extractAccessorProperties(classDecl), extractClassProperties(classDecl));
|
|
@@ -9605,7 +9605,7 @@ function extractFromSourceFile4(sourceFile, project) {
|
|
|
9605
9605
|
const templateContent = extractTemplateContent(classDecl, project);
|
|
9606
9606
|
const slots = mergeSlotLists(extractInheritedSlots(classDecl, project), extractJsDocSlots(classDecl), extractSlotsFromTemplate3(templateContent), extractFastTemplateSlots(classDecl, project));
|
|
9607
9607
|
components.push({
|
|
9608
|
-
name,
|
|
9608
|
+
name: name2,
|
|
9609
9609
|
source: sourceFile.getFilePath(),
|
|
9610
9610
|
sourcePath: sourceFile.getFilePath(),
|
|
9611
9611
|
framework: "web-component",
|
|
@@ -9931,8 +9931,8 @@ async function retryComponentWithProject(component, ctx, project, warnings) {
|
|
|
9931
9931
|
}
|
|
9932
9932
|
function addImportedDeclarationsToProject(project, ctx) {
|
|
9933
9933
|
const importedNames = collectReferencedTypeNames(ctx.annotation);
|
|
9934
|
-
for (const
|
|
9935
|
-
const localDecl = findLocalTypeDeclaration(ctx.instance,
|
|
9934
|
+
for (const name2 of [...importedNames]) {
|
|
9935
|
+
const localDecl = findLocalTypeDeclaration(ctx.instance, name2, ctx.moduleScript) ?? (ctx.moduleScript ? findLocalTypeDeclaration(ctx.moduleScript, name2, ctx.instance) : null);
|
|
9936
9936
|
if (localDecl) {
|
|
9937
9937
|
for (const referenced of collectReferencedTypeNames(localDecl))
|
|
9938
9938
|
importedNames.add(referenced);
|
|
@@ -10113,21 +10113,21 @@ function collapseUnresolvedTypeWarnings(warnings) {
|
|
|
10113
10113
|
}
|
|
10114
10114
|
async function extractFromSvelteFile(filePath, source) {
|
|
10115
10115
|
const warnings = [];
|
|
10116
|
-
const
|
|
10116
|
+
const name2 = getSvelteComponentName(filePath);
|
|
10117
10117
|
let ast;
|
|
10118
10118
|
try {
|
|
10119
10119
|
ast = parseSvelte(source, { modern: true });
|
|
10120
10120
|
} catch (e) {
|
|
10121
10121
|
return {
|
|
10122
10122
|
component: null,
|
|
10123
|
-
warnings: [`${
|
|
10123
|
+
warnings: [`${name2}: parse error in ${filePath}: ${e instanceof Error ? e.message : String(e)}`]
|
|
10124
10124
|
};
|
|
10125
10125
|
}
|
|
10126
10126
|
const instance = ast["instance"];
|
|
10127
10127
|
const moduleScript = ast["module"];
|
|
10128
10128
|
const fragment = ast["fragment"];
|
|
10129
10129
|
if (instance && hasV4ExportLetProps(instance)) {
|
|
10130
|
-
warnings.push(`${
|
|
10130
|
+
warnings.push(`${name2}: Svelte 4 export let syntax not yet supported (${filePath}); see INTEG-4267 for v5-only scope and follow-up`);
|
|
10131
10131
|
return { component: null, warnings };
|
|
10132
10132
|
}
|
|
10133
10133
|
const propsCall = instance ? findPropsCall(instance) : null;
|
|
@@ -10142,7 +10142,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
10142
10142
|
instance,
|
|
10143
10143
|
moduleScript,
|
|
10144
10144
|
filePath,
|
|
10145
|
-
componentName:
|
|
10145
|
+
componentName: name2,
|
|
10146
10146
|
source,
|
|
10147
10147
|
snippetLocals
|
|
10148
10148
|
});
|
|
@@ -10154,12 +10154,12 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
10154
10154
|
extractionReasons.push(...result.additionalReasons);
|
|
10155
10155
|
} else if (instance) {
|
|
10156
10156
|
} else {
|
|
10157
|
-
warnings.push(`${
|
|
10157
|
+
warnings.push(`${name2}: no instance script block (${filePath}); no props extracted`);
|
|
10158
10158
|
}
|
|
10159
10159
|
const templateSlots = fragment ? extractTemplateSlots(fragment) : [];
|
|
10160
10160
|
const { slots, mixedWarning } = mergeSlots2(snippetSlotsFromProps, templateSlots);
|
|
10161
10161
|
if (mixedWarning) {
|
|
10162
|
-
warnings.push(`${
|
|
10162
|
+
warnings.push(`${name2}: mixed Snippet and <slot> usage detected (${filePath}); preferring Snippet entries`);
|
|
10163
10163
|
}
|
|
10164
10164
|
let propsTypeNameCapture;
|
|
10165
10165
|
if (propsCall) {
|
|
@@ -10172,7 +10172,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
10172
10172
|
}
|
|
10173
10173
|
}
|
|
10174
10174
|
const component = {
|
|
10175
|
-
name,
|
|
10175
|
+
name: name2,
|
|
10176
10176
|
source: filePath,
|
|
10177
10177
|
framework: "svelte",
|
|
10178
10178
|
props,
|
|
@@ -10198,7 +10198,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
10198
10198
|
instance,
|
|
10199
10199
|
moduleScript,
|
|
10200
10200
|
annotation,
|
|
10201
|
-
componentName:
|
|
10201
|
+
componentName: name2
|
|
10202
10202
|
};
|
|
10203
10203
|
}
|
|
10204
10204
|
}
|
|
@@ -10340,8 +10340,8 @@ function describeAnnotationForUser(annotation) {
|
|
|
10340
10340
|
if (!annotation)
|
|
10341
10341
|
return "<unknown>";
|
|
10342
10342
|
if (annotation.type === "TSTypeReference") {
|
|
10343
|
-
const
|
|
10344
|
-
return
|
|
10343
|
+
const name2 = annotation["typeName"]?.["name"] ?? null;
|
|
10344
|
+
return name2 ? `'${name2}'` : "<unnamed reference>";
|
|
10345
10345
|
}
|
|
10346
10346
|
if (annotation.type === "TSIntersectionType")
|
|
10347
10347
|
return "<intersection>";
|
|
@@ -10416,7 +10416,7 @@ async function resolveViaTypeChecker(annotation, instance, moduleScript, filePat
|
|
|
10416
10416
|
return null;
|
|
10417
10417
|
const members = [];
|
|
10418
10418
|
for (const symbol of properties) {
|
|
10419
|
-
const
|
|
10419
|
+
const name2 = symbol.getName();
|
|
10420
10420
|
const declaration = symbol.getValueDeclaration() ?? symbol.getDeclarations()[0];
|
|
10421
10421
|
if (!declaration)
|
|
10422
10422
|
continue;
|
|
@@ -10431,7 +10431,7 @@ async function resolveViaTypeChecker(annotation, instance, moduleScript, filePat
|
|
|
10431
10431
|
const declaredTypeText = readDeclaredTypeNodeText(declaration);
|
|
10432
10432
|
const isSnippet = declaredTypeText !== null && isSnippetTypeText(declaredTypeText, snippetLocals) || typeRefersToSnippet(propType) || isSnippetTypeText(typeText, snippetLocals);
|
|
10433
10433
|
members.push({
|
|
10434
|
-
name,
|
|
10434
|
+
name: name2,
|
|
10435
10435
|
optional: optional5,
|
|
10436
10436
|
typeText,
|
|
10437
10437
|
...declaredTypeText ? { declaredTypeText } : {},
|
|
@@ -10519,7 +10519,7 @@ function mergeSets(a, b) {
|
|
|
10519
10519
|
out.add(v);
|
|
10520
10520
|
return out;
|
|
10521
10521
|
}
|
|
10522
|
-
function findLocalTypeDeclaration(instance,
|
|
10522
|
+
function findLocalTypeDeclaration(instance, name2, module) {
|
|
10523
10523
|
for (const script of [instance, module]) {
|
|
10524
10524
|
const body = script?.["content"]?.["body"];
|
|
10525
10525
|
if (!body)
|
|
@@ -10528,7 +10528,7 @@ function findLocalTypeDeclaration(instance, name, module) {
|
|
|
10528
10528
|
const decl = stmt.type === "ExportNamedDeclaration" ? stmt["declaration"] ?? stmt : stmt;
|
|
10529
10529
|
if (decl.type === "TSInterfaceDeclaration" || decl.type === "TSTypeAliasDeclaration") {
|
|
10530
10530
|
const id = decl["id"];
|
|
10531
|
-
if (id?.["name"] ===
|
|
10531
|
+
if (id?.["name"] === name2)
|
|
10532
10532
|
return decl;
|
|
10533
10533
|
}
|
|
10534
10534
|
}
|
|
@@ -10549,8 +10549,8 @@ function readMembersFromInterfaceOrAlias(decl, snippetLocals) {
|
|
|
10549
10549
|
}
|
|
10550
10550
|
return [];
|
|
10551
10551
|
}
|
|
10552
|
-
function readMembersFromTypeLiteral(
|
|
10553
|
-
const members =
|
|
10552
|
+
function readMembersFromTypeLiteral(literal4, snippetLocals) {
|
|
10553
|
+
const members = literal4["members"];
|
|
10554
10554
|
if (!members)
|
|
10555
10555
|
return [];
|
|
10556
10556
|
return members.map((m) => readPropertySignature(m, snippetLocals)).filter((m) => !!m);
|
|
@@ -10559,8 +10559,8 @@ function readPropertySignature(member, snippetLocals) {
|
|
|
10559
10559
|
if (member.type !== "TSPropertySignature")
|
|
10560
10560
|
return null;
|
|
10561
10561
|
const key = member["key"];
|
|
10562
|
-
const
|
|
10563
|
-
if (!
|
|
10562
|
+
const name2 = key?.["name"] ?? null;
|
|
10563
|
+
if (!name2)
|
|
10564
10564
|
return null;
|
|
10565
10565
|
const optional5 = !!member["optional"];
|
|
10566
10566
|
const typeNode = member["typeAnnotation"]?.["typeAnnotation"];
|
|
@@ -10570,7 +10570,7 @@ function readPropertySignature(member, snippetLocals) {
|
|
|
10570
10570
|
const leading = member["leadingComments"] ?? [];
|
|
10571
10571
|
const description = extractJsdocText(leading);
|
|
10572
10572
|
return {
|
|
10573
|
-
name,
|
|
10573
|
+
name: name2,
|
|
10574
10574
|
optional: optional5,
|
|
10575
10575
|
typeText,
|
|
10576
10576
|
isSnippet,
|
|
@@ -10709,19 +10709,19 @@ function extractFromDestructure(propsCall, _ctx, typeMembers, warnings, addition
|
|
|
10709
10709
|
if (p.type !== "Property")
|
|
10710
10710
|
continue;
|
|
10711
10711
|
const key = p["key"];
|
|
10712
|
-
const
|
|
10713
|
-
if (!
|
|
10712
|
+
const name2 = key?.["name"] ?? null;
|
|
10713
|
+
if (!name2)
|
|
10714
10714
|
continue;
|
|
10715
|
-
seenInDestructure.add(
|
|
10715
|
+
seenInDestructure.add(name2);
|
|
10716
10716
|
const value = p["value"];
|
|
10717
10717
|
const hasDefault = value?.type === "AssignmentPattern";
|
|
10718
10718
|
const defaultValueRaw = hasDefault ? renderLiteral(value["right"]) : void 0;
|
|
10719
|
-
const typeMember = typeByName.get(
|
|
10719
|
+
const typeMember = typeByName.get(name2);
|
|
10720
10720
|
if (typeMember?.isSnippet) {
|
|
10721
|
-
snippetNames.add(
|
|
10721
|
+
snippetNames.add(name2);
|
|
10722
10722
|
const slot = {
|
|
10723
|
-
name,
|
|
10724
|
-
isDefault:
|
|
10723
|
+
name: name2,
|
|
10724
|
+
isDefault: name2 === "children",
|
|
10725
10725
|
...typeMember.description ? { description: typeMember.description } : {}
|
|
10726
10726
|
};
|
|
10727
10727
|
const authorText = typeMember.declaredTypeText ?? typeMember.typeText;
|
|
@@ -10732,7 +10732,7 @@ function extractFromDestructure(propsCall, _ctx, typeMembers, warnings, addition
|
|
|
10732
10732
|
}
|
|
10733
10733
|
const required = typeMember ? !typeMember.optional && !hasDefault : !hasDefault;
|
|
10734
10734
|
const propDef = {
|
|
10735
|
-
name,
|
|
10735
|
+
name: name2,
|
|
10736
10736
|
type: typeMember?.typeText ?? "unknown",
|
|
10737
10737
|
required
|
|
10738
10738
|
};
|
|
@@ -10790,9 +10790,9 @@ function propertyOrder(properties) {
|
|
|
10790
10790
|
for (const p of properties) {
|
|
10791
10791
|
if (p.type !== "Property")
|
|
10792
10792
|
continue;
|
|
10793
|
-
const
|
|
10794
|
-
if (
|
|
10795
|
-
m.set(
|
|
10793
|
+
const name2 = p["key"]?.["name"] ?? null;
|
|
10794
|
+
if (name2)
|
|
10795
|
+
m.set(name2, i++);
|
|
10796
10796
|
}
|
|
10797
10797
|
return m;
|
|
10798
10798
|
}
|
|
@@ -10971,10 +10971,10 @@ function extractTemplateSlots(fragment) {
|
|
|
10971
10971
|
if (!node)
|
|
10972
10972
|
return;
|
|
10973
10973
|
if (node.type === "SlotElement") {
|
|
10974
|
-
const
|
|
10975
|
-
if (!seen.has(
|
|
10976
|
-
seen.add(
|
|
10977
|
-
slots.push({ name, isDefault:
|
|
10974
|
+
const name2 = readSlotName(node);
|
|
10975
|
+
if (!seen.has(name2)) {
|
|
10976
|
+
seen.add(name2);
|
|
10977
|
+
slots.push({ name: name2, isDefault: name2 === "default" });
|
|
10978
10978
|
}
|
|
10979
10979
|
}
|
|
10980
10980
|
const children = node["nodes"] ?? node["children"] ?? [];
|
|
@@ -11188,9 +11188,9 @@ function extractDecoratorInput(field) {
|
|
|
11188
11188
|
}
|
|
11189
11189
|
const resolved = resolvePropType(typeNode);
|
|
11190
11190
|
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
11191
|
-
const
|
|
11191
|
+
const name2 = alias ?? fieldName;
|
|
11192
11192
|
const prop = {
|
|
11193
|
-
name,
|
|
11193
|
+
name: name2,
|
|
11194
11194
|
type: typeText,
|
|
11195
11195
|
required,
|
|
11196
11196
|
sourceStartLine: field.getStartLineNumber(),
|
|
@@ -11266,9 +11266,9 @@ function extractSignalInput(field) {
|
|
|
11266
11266
|
const typeArg = init.getTypeArguments()[0];
|
|
11267
11267
|
const resolved = resolvePropType(typeArg);
|
|
11268
11268
|
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
11269
|
-
const
|
|
11269
|
+
const name2 = alias ?? fieldName;
|
|
11270
11270
|
const prop = {
|
|
11271
|
-
name,
|
|
11271
|
+
name: name2,
|
|
11272
11272
|
type: typeText,
|
|
11273
11273
|
required,
|
|
11274
11274
|
sourceStartLine: field.getStartLineNumber(),
|
|
@@ -11361,10 +11361,10 @@ function extractProps2(cls, meta) {
|
|
|
11361
11361
|
const parsed = parseInputsArrayEntry(entry);
|
|
11362
11362
|
if (!parsed)
|
|
11363
11363
|
continue;
|
|
11364
|
-
const
|
|
11365
|
-
if (byName.has(
|
|
11364
|
+
const name2 = parsed.alias ?? parsed.fieldName;
|
|
11365
|
+
if (byName.has(name2))
|
|
11366
11366
|
continue;
|
|
11367
|
-
byName.set(
|
|
11367
|
+
byName.set(name2, { name: name2, type: "any", required: false });
|
|
11368
11368
|
}
|
|
11369
11369
|
return [...byName.values()];
|
|
11370
11370
|
}
|
|
@@ -11513,16 +11513,16 @@ var init_resolve_template_source = __esm({
|
|
|
11513
11513
|
});
|
|
11514
11514
|
|
|
11515
11515
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/strip-library-prefix.js
|
|
11516
|
-
function stripLibraryPrefix(
|
|
11516
|
+
function stripLibraryPrefix(name2) {
|
|
11517
11517
|
for (const prefix of KNOWN_PREFIXES) {
|
|
11518
|
-
if (
|
|
11519
|
-
const rest =
|
|
11518
|
+
if (name2.startsWith(prefix) && name2.length > prefix.length) {
|
|
11519
|
+
const rest = name2.slice(prefix.length);
|
|
11520
11520
|
if (rest[0] && rest[0] === rest[0].toUpperCase()) {
|
|
11521
11521
|
return rest;
|
|
11522
11522
|
}
|
|
11523
11523
|
}
|
|
11524
11524
|
}
|
|
11525
|
-
return
|
|
11525
|
+
return name2;
|
|
11526
11526
|
}
|
|
11527
11527
|
var KNOWN_PREFIXES;
|
|
11528
11528
|
var init_strip_library_prefix = __esm({
|
|
@@ -11603,8 +11603,8 @@ function extractContentChildQueries(cls) {
|
|
|
11603
11603
|
if (init && Node15.isCallExpression(init)) {
|
|
11604
11604
|
const callee = init.getExpression();
|
|
11605
11605
|
if (Node15.isIdentifier(callee)) {
|
|
11606
|
-
const
|
|
11607
|
-
if (
|
|
11606
|
+
const name2 = callee.getText();
|
|
11607
|
+
if (name2 === "contentChild" || name2 === "contentChildren") {
|
|
11608
11608
|
const first = init.getArguments()[0];
|
|
11609
11609
|
const allowed = resolveClassIdentifierArg(first);
|
|
11610
11610
|
out.push(buildSlot(fieldName, allowed));
|
|
@@ -11633,9 +11633,9 @@ function resolveClassIdentifierArg(arg) {
|
|
|
11633
11633
|
return [arg.getText()];
|
|
11634
11634
|
return [];
|
|
11635
11635
|
}
|
|
11636
|
-
function buildSlot(
|
|
11636
|
+
function buildSlot(name2, allowed) {
|
|
11637
11637
|
const slot = {
|
|
11638
|
-
name,
|
|
11638
|
+
name: name2,
|
|
11639
11639
|
isDefault: false
|
|
11640
11640
|
};
|
|
11641
11641
|
if (allowed.length > 0)
|
|
@@ -11679,11 +11679,11 @@ async function extractSlots3(cls, meta, props) {
|
|
|
11679
11679
|
const template = await resolveTemplateSource(meta);
|
|
11680
11680
|
if (template) {
|
|
11681
11681
|
for (const el of parseNgContentElements(template)) {
|
|
11682
|
-
const
|
|
11683
|
-
if (byName.has(
|
|
11682
|
+
const name2 = deriveSlotName(el.rawSelect, meta.normalizedName);
|
|
11683
|
+
if (byName.has(name2))
|
|
11684
11684
|
continue;
|
|
11685
|
-
byName.set(
|
|
11686
|
-
name,
|
|
11685
|
+
byName.set(name2, {
|
|
11686
|
+
name: name2,
|
|
11687
11687
|
isDefault: el.rawSelect === null
|
|
11688
11688
|
});
|
|
11689
11689
|
}
|
|
@@ -11777,9 +11777,9 @@ function normalizeSlots(slots) {
|
|
|
11777
11777
|
return slots.map((slot) => {
|
|
11778
11778
|
if (slot.name.trim())
|
|
11779
11779
|
return slot;
|
|
11780
|
-
const
|
|
11780
|
+
const name2 = fallbackIndex === 0 ? "children" : `slot_${fallbackIndex}`;
|
|
11781
11781
|
fallbackIndex++;
|
|
11782
|
-
return { ...slot, name };
|
|
11782
|
+
return { ...slot, name: name2 };
|
|
11783
11783
|
});
|
|
11784
11784
|
}
|
|
11785
11785
|
var init_extract_angular_components = __esm({
|
|
@@ -12596,8 +12596,8 @@ var init_composition_cache_key = __esm({
|
|
|
12596
12596
|
|
|
12597
12597
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/edges/manifest-doc-evidence.js
|
|
12598
12598
|
import { dirname as dirname11 } from "node:path";
|
|
12599
|
-
function kebabToPascal3(
|
|
12600
|
-
return
|
|
12599
|
+
function kebabToPascal3(name2) {
|
|
12600
|
+
return name2.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
|
|
12601
12601
|
}
|
|
12602
12602
|
function collectManifestEdges(files, componentNames) {
|
|
12603
12603
|
const edges = [];
|
|
@@ -13293,9 +13293,9 @@ var init_validate3 = __esm({
|
|
|
13293
13293
|
|
|
13294
13294
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/create-component-id.js
|
|
13295
13295
|
import { createHash as createHash7 } from "node:crypto";
|
|
13296
|
-
function createComponentId(
|
|
13297
|
-
const sourceHash = createHash7("sha256").update(`${
|
|
13298
|
-
return `${
|
|
13296
|
+
function createComponentId(name2, resolvedSourcePath) {
|
|
13297
|
+
const sourceHash = createHash7("sha256").update(`${name2}:${resolvedSourcePath}`).digest("hex").slice(0, 12);
|
|
13298
|
+
return `${name2}-${sourceHash}`;
|
|
13299
13299
|
}
|
|
13300
13300
|
var init_create_component_id = __esm({
|
|
13301
13301
|
"packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/create-component-id.js"() {
|
|
@@ -13673,10 +13673,10 @@ var init_file_categories = __esm({
|
|
|
13673
13673
|
|
|
13674
13674
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/categorize-file.js
|
|
13675
13675
|
import path from "node:path";
|
|
13676
|
-
function categorizeFile(
|
|
13677
|
-
if (
|
|
13676
|
+
function categorizeFile(name2) {
|
|
13677
|
+
if (name2.endsWith(".d.ts"))
|
|
13678
13678
|
return "other";
|
|
13679
|
-
const ext = path.extname(
|
|
13679
|
+
const ext = path.extname(name2);
|
|
13680
13680
|
return CATEGORY_BY_EXTENSION[ext] ?? "other";
|
|
13681
13681
|
}
|
|
13682
13682
|
var init_categorize_file = __esm({
|
|
@@ -13687,8 +13687,8 @@ var init_categorize_file = __esm({
|
|
|
13687
13687
|
});
|
|
13688
13688
|
|
|
13689
13689
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-noise-config-file.js
|
|
13690
|
-
function isNoiseConfigFile(
|
|
13691
|
-
return DENYLISTED_EXACT_FILE_NAMES.has(
|
|
13690
|
+
function isNoiseConfigFile(name2) {
|
|
13691
|
+
return DENYLISTED_EXACT_FILE_NAMES.has(name2) || DENYLISTED_FILE_NAME_PATTERNS.some((pattern) => pattern.test(name2));
|
|
13692
13692
|
}
|
|
13693
13693
|
var init_is_noise_config_file = __esm({
|
|
13694
13694
|
"packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-noise-config-file.js"() {
|
|
@@ -13699,15 +13699,15 @@ var init_is_noise_config_file = __esm({
|
|
|
13699
13699
|
|
|
13700
13700
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-source-file.js
|
|
13701
13701
|
import path2 from "node:path";
|
|
13702
|
-
function isSourceFile(
|
|
13703
|
-
if (
|
|
13702
|
+
function isSourceFile(name2) {
|
|
13703
|
+
if (name2.endsWith(".d.ts"))
|
|
13704
13704
|
return false;
|
|
13705
|
-
if (EXCLUDED_SUFFIXES.some((suffix) =>
|
|
13705
|
+
if (EXCLUDED_SUFFIXES.some((suffix) => name2.endsWith(suffix)))
|
|
13706
13706
|
return false;
|
|
13707
|
-
const ext = path2.extname(
|
|
13707
|
+
const ext = path2.extname(name2);
|
|
13708
13708
|
if (INCLUDED_EXTENSIONS.has(ext))
|
|
13709
13709
|
return true;
|
|
13710
|
-
if (DENYLIST_GATED_EXTENSIONS.has(ext) && !isNoiseConfigFile(
|
|
13710
|
+
if (DENYLIST_GATED_EXTENSIONS.has(ext) && !isNoiseConfigFile(name2))
|
|
13711
13711
|
return true;
|
|
13712
13712
|
return false;
|
|
13713
13713
|
}
|
|
@@ -14023,7 +14023,7 @@ async function buildSourceFingerprint(opts) {
|
|
|
14023
14023
|
const seen = /* @__PURE__ */ new Set();
|
|
14024
14024
|
for (const row of rows) {
|
|
14025
14025
|
const sourcePath = rowField(row, "source_path");
|
|
14026
|
-
const
|
|
14026
|
+
const name2 = rowField(row, "name");
|
|
14027
14027
|
if (!sourcePath)
|
|
14028
14028
|
continue;
|
|
14029
14029
|
const abs = resolve17(sourcePath);
|
|
@@ -14033,8 +14033,8 @@ async function buildSourceFingerprint(opts) {
|
|
|
14033
14033
|
try {
|
|
14034
14034
|
const st = await stat(abs);
|
|
14035
14035
|
const entry = { mtime: st.mtime.toISOString() };
|
|
14036
|
-
if (
|
|
14037
|
-
entry.componentName =
|
|
14036
|
+
if (name2)
|
|
14037
|
+
entry.componentName = name2;
|
|
14038
14038
|
files[abs] = entry;
|
|
14039
14039
|
} catch {
|
|
14040
14040
|
}
|
|
@@ -14075,10 +14075,10 @@ import { access as access4 } from "node:fs/promises";
|
|
|
14075
14075
|
import { join as join9 } from "node:path";
|
|
14076
14076
|
async function listConflictingFiles(path5) {
|
|
14077
14077
|
const conflicts = [];
|
|
14078
|
-
for (const
|
|
14078
|
+
for (const name2 of SAVE_FILES) {
|
|
14079
14079
|
try {
|
|
14080
|
-
await access4(join9(path5,
|
|
14081
|
-
conflicts.push(
|
|
14080
|
+
await access4(join9(path5, name2));
|
|
14081
|
+
conflicts.push(name2);
|
|
14082
14082
|
} catch {
|
|
14083
14083
|
}
|
|
14084
14084
|
}
|
|
@@ -14584,18 +14584,18 @@ var init_pathSerializer_gen = __esm({
|
|
|
14584
14584
|
return "&";
|
|
14585
14585
|
}
|
|
14586
14586
|
};
|
|
14587
|
-
serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
|
|
14587
|
+
serializeArrayParam = ({ allowReserved, explode, name: name2, style, value }) => {
|
|
14588
14588
|
if (!explode) {
|
|
14589
14589
|
const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
|
|
14590
14590
|
switch (style) {
|
|
14591
14591
|
case "label":
|
|
14592
14592
|
return `.${joinedValues2}`;
|
|
14593
14593
|
case "matrix":
|
|
14594
|
-
return `;${
|
|
14594
|
+
return `;${name2}=${joinedValues2}`;
|
|
14595
14595
|
case "simple":
|
|
14596
14596
|
return joinedValues2;
|
|
14597
14597
|
default:
|
|
14598
|
-
return `${
|
|
14598
|
+
return `${name2}=${joinedValues2}`;
|
|
14599
14599
|
}
|
|
14600
14600
|
}
|
|
14601
14601
|
const separator = separatorArrayExplode(style);
|
|
@@ -14605,24 +14605,24 @@ var init_pathSerializer_gen = __esm({
|
|
|
14605
14605
|
}
|
|
14606
14606
|
return serializePrimitiveParam({
|
|
14607
14607
|
allowReserved,
|
|
14608
|
-
name,
|
|
14608
|
+
name: name2,
|
|
14609
14609
|
value: v
|
|
14610
14610
|
});
|
|
14611
14611
|
}).join(separator);
|
|
14612
14612
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
14613
14613
|
};
|
|
14614
|
-
serializePrimitiveParam = ({ allowReserved, name, value }) => {
|
|
14614
|
+
serializePrimitiveParam = ({ allowReserved, name: name2, value }) => {
|
|
14615
14615
|
if (value === void 0 || value === null) {
|
|
14616
14616
|
return "";
|
|
14617
14617
|
}
|
|
14618
14618
|
if (typeof value === "object") {
|
|
14619
14619
|
throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
|
|
14620
14620
|
}
|
|
14621
|
-
return `${
|
|
14621
|
+
return `${name2}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
14622
14622
|
};
|
|
14623
|
-
serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly }) => {
|
|
14623
|
+
serializeObjectParam = ({ allowReserved, explode, name: name2, style, value, valueOnly }) => {
|
|
14624
14624
|
if (value instanceof Date) {
|
|
14625
|
-
return valueOnly ? value.toISOString() : `${
|
|
14625
|
+
return valueOnly ? value.toISOString() : `${name2}=${value.toISOString()}`;
|
|
14626
14626
|
}
|
|
14627
14627
|
if (style !== "deepObject" && !explode) {
|
|
14628
14628
|
let values = [];
|
|
@@ -14636,11 +14636,11 @@ var init_pathSerializer_gen = __esm({
|
|
|
14636
14636
|
const joinedValues2 = values.join(",");
|
|
14637
14637
|
switch (style) {
|
|
14638
14638
|
case "form":
|
|
14639
|
-
return `${
|
|
14639
|
+
return `${name2}=${joinedValues2}`;
|
|
14640
14640
|
case "label":
|
|
14641
14641
|
return `.${joinedValues2}`;
|
|
14642
14642
|
case "matrix":
|
|
14643
|
-
return `;${
|
|
14643
|
+
return `;${name2}=${joinedValues2}`;
|
|
14644
14644
|
default:
|
|
14645
14645
|
return joinedValues2;
|
|
14646
14646
|
}
|
|
@@ -14648,7 +14648,7 @@ var init_pathSerializer_gen = __esm({
|
|
|
14648
14648
|
const separator = separatorObjectExplode(style);
|
|
14649
14649
|
const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
|
|
14650
14650
|
allowReserved,
|
|
14651
|
-
name: style === "deepObject" ? `${
|
|
14651
|
+
name: style === "deepObject" ? `${name2}[${key}]` : key,
|
|
14652
14652
|
value: v
|
|
14653
14653
|
})).join(separator);
|
|
14654
14654
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
@@ -14671,31 +14671,31 @@ var init_utils_gen = __esm({
|
|
|
14671
14671
|
if (matches) {
|
|
14672
14672
|
for (const match2 of matches) {
|
|
14673
14673
|
let explode = false;
|
|
14674
|
-
let
|
|
14674
|
+
let name2 = match2.substring(1, match2.length - 1);
|
|
14675
14675
|
let style = "simple";
|
|
14676
|
-
if (
|
|
14676
|
+
if (name2.endsWith("*")) {
|
|
14677
14677
|
explode = true;
|
|
14678
|
-
|
|
14678
|
+
name2 = name2.substring(0, name2.length - 1);
|
|
14679
14679
|
}
|
|
14680
|
-
if (
|
|
14681
|
-
|
|
14680
|
+
if (name2.startsWith(".")) {
|
|
14681
|
+
name2 = name2.substring(1);
|
|
14682
14682
|
style = "label";
|
|
14683
|
-
} else if (
|
|
14684
|
-
|
|
14683
|
+
} else if (name2.startsWith(";")) {
|
|
14684
|
+
name2 = name2.substring(1);
|
|
14685
14685
|
style = "matrix";
|
|
14686
14686
|
}
|
|
14687
|
-
const value = path5[
|
|
14687
|
+
const value = path5[name2];
|
|
14688
14688
|
if (value === void 0 || value === null) {
|
|
14689
14689
|
continue;
|
|
14690
14690
|
}
|
|
14691
14691
|
if (Array.isArray(value)) {
|
|
14692
|
-
url = url.replace(match2, serializeArrayParam({ explode, name, style, value }));
|
|
14692
|
+
url = url.replace(match2, serializeArrayParam({ explode, name: name2, style, value }));
|
|
14693
14693
|
continue;
|
|
14694
14694
|
}
|
|
14695
14695
|
if (typeof value === "object") {
|
|
14696
14696
|
url = url.replace(match2, serializeObjectParam({
|
|
14697
14697
|
explode,
|
|
14698
|
-
name,
|
|
14698
|
+
name: name2,
|
|
14699
14699
|
style,
|
|
14700
14700
|
value,
|
|
14701
14701
|
valueOnly: true
|
|
@@ -14704,7 +14704,7 @@ var init_utils_gen = __esm({
|
|
|
14704
14704
|
}
|
|
14705
14705
|
if (style === "matrix") {
|
|
14706
14706
|
url = url.replace(match2, `;${serializePrimitiveParam({
|
|
14707
|
-
name,
|
|
14707
|
+
name: name2,
|
|
14708
14708
|
value
|
|
14709
14709
|
})}`);
|
|
14710
14710
|
continue;
|
|
@@ -14715,12 +14715,12 @@ var init_utils_gen = __esm({
|
|
|
14715
14715
|
}
|
|
14716
14716
|
return url;
|
|
14717
14717
|
};
|
|
14718
|
-
createQuerySerializer = ({ allowReserved, array:
|
|
14718
|
+
createQuerySerializer = ({ allowReserved, array: array4, object } = {}) => {
|
|
14719
14719
|
const querySerializer = (queryParams) => {
|
|
14720
14720
|
const search = [];
|
|
14721
14721
|
if (queryParams && typeof queryParams === "object") {
|
|
14722
|
-
for (const
|
|
14723
|
-
const value = queryParams[
|
|
14722
|
+
for (const name2 in queryParams) {
|
|
14723
|
+
const value = queryParams[name2];
|
|
14724
14724
|
if (value === void 0 || value === null) {
|
|
14725
14725
|
continue;
|
|
14726
14726
|
}
|
|
@@ -14728,10 +14728,10 @@ var init_utils_gen = __esm({
|
|
|
14728
14728
|
const serializedArray = serializeArrayParam({
|
|
14729
14729
|
allowReserved,
|
|
14730
14730
|
explode: true,
|
|
14731
|
-
name,
|
|
14731
|
+
name: name2,
|
|
14732
14732
|
style: "form",
|
|
14733
14733
|
value,
|
|
14734
|
-
...
|
|
14734
|
+
...array4
|
|
14735
14735
|
});
|
|
14736
14736
|
if (serializedArray)
|
|
14737
14737
|
search.push(serializedArray);
|
|
@@ -14739,7 +14739,7 @@ var init_utils_gen = __esm({
|
|
|
14739
14739
|
const serializedObject = serializeObjectParam({
|
|
14740
14740
|
allowReserved,
|
|
14741
14741
|
explode: true,
|
|
14742
|
-
name,
|
|
14742
|
+
name: name2,
|
|
14743
14743
|
style: "deepObject",
|
|
14744
14744
|
value,
|
|
14745
14745
|
...object
|
|
@@ -14749,7 +14749,7 @@ var init_utils_gen = __esm({
|
|
|
14749
14749
|
} else {
|
|
14750
14750
|
const serializedPrimitive = serializePrimitiveParam({
|
|
14751
14751
|
allowReserved,
|
|
14752
|
-
name,
|
|
14752
|
+
name: name2,
|
|
14753
14753
|
value
|
|
14754
14754
|
});
|
|
14755
14755
|
if (serializedPrimitive)
|
|
@@ -14783,11 +14783,11 @@ var init_utils_gen = __esm({
|
|
|
14783
14783
|
}
|
|
14784
14784
|
return;
|
|
14785
14785
|
};
|
|
14786
|
-
checkForExistence = (options,
|
|
14787
|
-
if (!
|
|
14786
|
+
checkForExistence = (options, name2) => {
|
|
14787
|
+
if (!name2) {
|
|
14788
14788
|
return false;
|
|
14789
14789
|
}
|
|
14790
|
-
if (options.headers.has(
|
|
14790
|
+
if (options.headers.has(name2) || options.query?.[name2] || options.headers.get("Cookie")?.includes(`${name2}=`)) {
|
|
14791
14791
|
return true;
|
|
14792
14792
|
}
|
|
14793
14793
|
return false;
|
|
@@ -14801,20 +14801,20 @@ var init_utils_gen = __esm({
|
|
|
14801
14801
|
if (!token) {
|
|
14802
14802
|
continue;
|
|
14803
14803
|
}
|
|
14804
|
-
const
|
|
14804
|
+
const name2 = auth.name ?? "Authorization";
|
|
14805
14805
|
switch (auth.in) {
|
|
14806
14806
|
case "query":
|
|
14807
14807
|
if (!options.query) {
|
|
14808
14808
|
options.query = {};
|
|
14809
14809
|
}
|
|
14810
|
-
options.query[
|
|
14810
|
+
options.query[name2] = token;
|
|
14811
14811
|
break;
|
|
14812
14812
|
case "cookie":
|
|
14813
|
-
options.headers.append("Cookie", `${
|
|
14813
|
+
options.headers.append("Cookie", `${name2}=${token}`);
|
|
14814
14814
|
break;
|
|
14815
14815
|
case "header":
|
|
14816
14816
|
default:
|
|
14817
|
-
options.headers.set(
|
|
14817
|
+
options.headers.set(name2, token);
|
|
14818
14818
|
break;
|
|
14819
14819
|
}
|
|
14820
14820
|
}
|
|
@@ -15972,11 +15972,11 @@ function parseEdsiError(rawInput) {
|
|
|
15972
15972
|
...binding.diagnostics ? { diagnostics: binding.diagnostics } : {}
|
|
15973
15973
|
};
|
|
15974
15974
|
}
|
|
15975
|
-
const
|
|
15976
|
-
if (
|
|
15975
|
+
const literal4 = parseObjectLiteralTail(cleaned);
|
|
15976
|
+
if (literal4 && (literal4.code || literal4.cycle)) {
|
|
15977
15977
|
const braceStart = cleaned.lastIndexOf("{");
|
|
15978
15978
|
const head = braceStart === -1 ? cleaned : cleaned.slice(0, braceStart).trim();
|
|
15979
|
-
return { code:
|
|
15979
|
+
return { code: literal4.code ?? null, message: head || cleaned, cycle: literal4.cycle ?? null, raw: false };
|
|
15980
15980
|
}
|
|
15981
15981
|
return { code: null, message: cleaned || prefix || rawInput, cycle: null, raw: true };
|
|
15982
15982
|
}
|
|
@@ -16382,8 +16382,8 @@ var init_count_character_edits = __esm({
|
|
|
16382
16382
|
});
|
|
16383
16383
|
|
|
16384
16384
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/helpers/existing-entities/simplify-name-for-comparison.js
|
|
16385
|
-
function simplifyNameForComparison(
|
|
16386
|
-
const stripped =
|
|
16385
|
+
function simplifyNameForComparison(name2) {
|
|
16386
|
+
const stripped = name2.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
16387
16387
|
return stripped.endsWith("s") && stripped.length > 1 ? stripped.slice(0, -1) : stripped;
|
|
16388
16388
|
}
|
|
16389
16389
|
var init_simplify_name_for_comparison = __esm({
|
|
@@ -16774,9 +16774,9 @@ var init_apply_map_token_prop_calls = __esm({
|
|
|
16774
16774
|
// packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/binary-exists.js
|
|
16775
16775
|
import { execFile } from "node:child_process";
|
|
16776
16776
|
import { promisify } from "node:util";
|
|
16777
|
-
async function binaryExists(
|
|
16777
|
+
async function binaryExists(name2) {
|
|
16778
16778
|
try {
|
|
16779
|
-
await execFileAsync(process.platform === "win32" ? "where" : "which", [
|
|
16779
|
+
await execFileAsync(process.platform === "win32" ? "where" : "which", [name2]);
|
|
16780
16780
|
return true;
|
|
16781
16781
|
} catch {
|
|
16782
16782
|
return false;
|
|
@@ -17474,20 +17474,20 @@ function collectSiblingRendererImports(sourceText) {
|
|
|
17474
17474
|
continue;
|
|
17475
17475
|
if (/-g(?:ql|gl)(?:$|\.)/i.test(importPath))
|
|
17476
17476
|
continue;
|
|
17477
|
-
for (const
|
|
17478
|
-
if (
|
|
17479
|
-
names.add(
|
|
17477
|
+
for (const name2 of parseImportedNames(importClause)) {
|
|
17478
|
+
if (name2)
|
|
17479
|
+
names.add(name2);
|
|
17480
17480
|
}
|
|
17481
17481
|
}
|
|
17482
17482
|
return [...names];
|
|
17483
17483
|
}
|
|
17484
17484
|
function hasSiblingForwardRender(sourceText, siblingImports) {
|
|
17485
|
-
return siblingImports.some((
|
|
17486
|
-
const renderPattern = new RegExp(`<${escapeRegExp(
|
|
17485
|
+
return siblingImports.some((name2) => {
|
|
17486
|
+
const renderPattern = new RegExp(`<${escapeRegExp(name2)}\\b[\\s\\S]*?(?:/>|</${escapeRegExp(name2)}>)`);
|
|
17487
17487
|
if (!renderPattern.test(sourceText))
|
|
17488
17488
|
return false;
|
|
17489
|
-
const siblingSpreadPattern = new RegExp(`<${escapeRegExp(
|
|
17490
|
-
const propsPlusSiblingSpreadPattern = new RegExp(`<${escapeRegExp(
|
|
17489
|
+
const siblingSpreadPattern = new RegExp(`<${escapeRegExp(name2)}\\b[^>]*\\{\\.\\.\\.(?!props\\b)[^}]+\\}`);
|
|
17490
|
+
const propsPlusSiblingSpreadPattern = new RegExp(`<${escapeRegExp(name2)}\\b[^>]*\\{\\.\\.\\.props\\}[^>]*\\{\\.\\.\\.(?!props\\b)[^}]+\\}`);
|
|
17491
17491
|
return siblingSpreadPattern.test(sourceText) || propsPlusSiblingSpreadPattern.test(sourceText);
|
|
17492
17492
|
});
|
|
17493
17493
|
}
|
|
@@ -17704,34 +17704,34 @@ function isNumberType(type) {
|
|
|
17704
17704
|
function isComplexType(type) {
|
|
17705
17705
|
return !isSimpleType(type);
|
|
17706
17706
|
}
|
|
17707
|
-
function isDomPassThroughProp(
|
|
17708
|
-
if (DOM_PASS_THROUGH_PROPS.has(
|
|
17707
|
+
function isDomPassThroughProp(name2) {
|
|
17708
|
+
if (DOM_PASS_THROUGH_PROPS.has(name2))
|
|
17709
17709
|
return true;
|
|
17710
|
-
if (/^aria[-A-Z]/.test(
|
|
17710
|
+
if (/^aria[-A-Z]/.test(name2))
|
|
17711
17711
|
return true;
|
|
17712
|
-
return
|
|
17712
|
+
return name2.startsWith("data-");
|
|
17713
17713
|
}
|
|
17714
17714
|
function preClassifyProp(prop) {
|
|
17715
|
-
const { name, type } = prop;
|
|
17716
|
-
if (/^on[A-Z]/.test(
|
|
17715
|
+
const { name: name2, type } = prop;
|
|
17716
|
+
if (/^on[A-Z]/.test(name2) || type.includes("=> void") || type.includes("EventHandler")) {
|
|
17717
17717
|
return { category: "exclude" };
|
|
17718
17718
|
}
|
|
17719
|
-
if (
|
|
17719
|
+
if (name2 === "ref" || name2 === "innerRef" || type.includes("Ref<") || type.includes("RefObject<")) {
|
|
17720
17720
|
return { category: "exclude" };
|
|
17721
17721
|
}
|
|
17722
|
-
if (
|
|
17722
|
+
if (name2 === "testId" || name2 === "data-testid" || name2 === "dataTestId") {
|
|
17723
17723
|
return { category: "exclude" };
|
|
17724
17724
|
}
|
|
17725
|
-
if (
|
|
17725
|
+
if (name2 === "key") {
|
|
17726
17726
|
return { category: "exclude" };
|
|
17727
17727
|
}
|
|
17728
17728
|
if (type.includes("Dispatch<") || type.includes("SetStateAction")) {
|
|
17729
17729
|
return { category: "exclude" };
|
|
17730
17730
|
}
|
|
17731
|
-
if (isDomPassThroughProp(
|
|
17731
|
+
if (isDomPassThroughProp(name2)) {
|
|
17732
17732
|
return { category: "exclude" };
|
|
17733
17733
|
}
|
|
17734
|
-
if (
|
|
17734
|
+
if (name2 === "name" && prop.domAttribute) {
|
|
17735
17735
|
return { category: "exclude" };
|
|
17736
17736
|
}
|
|
17737
17737
|
if (isStringLiteralUnion(type)) {
|
|
@@ -17740,36 +17740,36 @@ function preClassifyProp(prop) {
|
|
|
17740
17740
|
if (!isComplexType(type)) {
|
|
17741
17741
|
const designNameStart = /^(variant|size|spacing|gap|color|bg|theme|align|layout|orientation|position)/i;
|
|
17742
17742
|
const designNameEnd = /(Color|Size|Variant|Style)$/;
|
|
17743
|
-
if (designNameStart.test(
|
|
17743
|
+
if (designNameStart.test(name2) || designNameEnd.test(name2)) {
|
|
17744
17744
|
return { category: "design", cdfTypeHint: "string" };
|
|
17745
17745
|
}
|
|
17746
17746
|
}
|
|
17747
17747
|
if (isBooleanType(type)) {
|
|
17748
17748
|
const stateNames = ["disabled", "loading", "expanded", "isOpen", "selected", "checked", "active", "preview"];
|
|
17749
|
-
if (stateNames.includes(
|
|
17749
|
+
if (stateNames.includes(name2)) {
|
|
17750
17750
|
return { category: "state", cdfTypeHint: "boolean" };
|
|
17751
17751
|
}
|
|
17752
17752
|
}
|
|
17753
17753
|
if (isBooleanType(type)) {
|
|
17754
17754
|
const visualToggle = /^(hide|show|enable|disable|vertical|horizontal|reverse|bold|italic|imageOn|with)/i;
|
|
17755
|
-
if (visualToggle.test(
|
|
17755
|
+
if (visualToggle.test(name2)) {
|
|
17756
17756
|
return { category: "design", cdfTypeHint: "boolean" };
|
|
17757
17757
|
}
|
|
17758
17758
|
}
|
|
17759
|
-
if (
|
|
17759
|
+
if (name2 === "componentId" || name2 === "sectionKey" || name2 === "locale" || name2 === "variantIndex") {
|
|
17760
17760
|
return { category: "state", cdfTypeHint: "string" };
|
|
17761
17761
|
}
|
|
17762
17762
|
if (isStringType(type)) {
|
|
17763
17763
|
const urlNameStart = /^(href|url|link|src)/i;
|
|
17764
17764
|
const urlNameEnd = /(Url|Href|Link|Src)$/;
|
|
17765
|
-
if (urlNameStart.test(
|
|
17765
|
+
if (urlNameStart.test(name2) || urlNameEnd.test(name2)) {
|
|
17766
17766
|
return { category: "content", cdfTypeHint: "string" };
|
|
17767
17767
|
}
|
|
17768
17768
|
}
|
|
17769
17769
|
if (isStringType(type)) {
|
|
17770
17770
|
const textNameStart = /^(label|title|text|description|caption|heading|subheading|body|alt|name|placeholder|summary)/i;
|
|
17771
17771
|
const textNameEnd = /(Text|Label|Title|Name)$/;
|
|
17772
|
-
if (textNameStart.test(
|
|
17772
|
+
if (textNameStart.test(name2) || textNameEnd.test(name2)) {
|
|
17773
17773
|
return { category: "content", cdfTypeHint: "string" };
|
|
17774
17774
|
}
|
|
17775
17775
|
}
|
|
@@ -18085,7 +18085,7 @@ async function resolveComposition(request) {
|
|
|
18085
18085
|
timeoutMs: 12e4,
|
|
18086
18086
|
promptViaStdin: true,
|
|
18087
18087
|
bedrock,
|
|
18088
|
-
onDebugEvent: (
|
|
18088
|
+
onDebugEvent: (name2, payload) => onDebugEvent?.("agent", { event: name2, ...payload })
|
|
18089
18089
|
});
|
|
18090
18090
|
lastAgentExitCode = res.exitCode;
|
|
18091
18091
|
if (res.exitCode !== 0 && res.stderr.trim()) {
|
|
@@ -18397,7 +18397,7 @@ function collectDuplicateNames(components) {
|
|
|
18397
18397
|
sources.push(c2.source);
|
|
18398
18398
|
nameCounts.set(c2.name, sources);
|
|
18399
18399
|
}
|
|
18400
|
-
return [...nameCounts.entries()].filter(([, srcs]) => srcs.length > 1).map(([
|
|
18400
|
+
return [...nameCounts.entries()].filter(([, srcs]) => srcs.length > 1).map(([name2, sources]) => ({ name: name2, sources }));
|
|
18401
18401
|
}
|
|
18402
18402
|
var init_collect_duplicate_names = __esm({
|
|
18403
18403
|
"packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/collect-duplicate-names.js"() {
|
|
@@ -18512,7 +18512,7 @@ async function runOneGenerateComponent(options, component, index, total) {
|
|
|
18512
18512
|
});
|
|
18513
18513
|
}
|
|
18514
18514
|
}
|
|
18515
|
-
effectiveSlots = effectiveSlots.map((slot) => slot.allowedComponents ? { ...slot, allowedComponents: slot.allowedComponents.filter((
|
|
18515
|
+
effectiveSlots = effectiveSlots.map((slot) => slot.allowedComponents ? { ...slot, allowedComponents: slot.allowedComponents.filter((name2) => allowedComponentNames2.has(name2)) } : slot);
|
|
18516
18516
|
const cacheComponent = normalizeComponentForCache(component);
|
|
18517
18517
|
if (!noCache && precomputedCachedNames.has(component.name)) {
|
|
18518
18518
|
onProgress?.({ kind: "component:cached", index, total, name: component.name, pinned: false });
|
|
@@ -19020,7 +19020,7 @@ var init_v1_store = __esm({
|
|
|
19020
19020
|
|
|
19021
19021
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-store.ts
|
|
19022
19022
|
function emptyAgents() {
|
|
19023
|
-
return Object.fromEntries(AGENT_NAMES.map((
|
|
19023
|
+
return Object.fromEntries(AGENT_NAMES.map((name2) => [name2, { model: "", binary: "" }]));
|
|
19024
19024
|
}
|
|
19025
19025
|
async function readAgentConfig() {
|
|
19026
19026
|
const store = await readV1Store();
|
|
@@ -19030,11 +19030,11 @@ async function readAgentConfig() {
|
|
|
19030
19030
|
const agents = emptyAgents();
|
|
19031
19031
|
const saved = store["agents"];
|
|
19032
19032
|
if (saved && typeof saved === "object") {
|
|
19033
|
-
for (const
|
|
19034
|
-
const entry = saved[
|
|
19033
|
+
for (const name2 of AGENT_NAMES) {
|
|
19034
|
+
const entry = saved[name2];
|
|
19035
19035
|
if (entry && typeof entry === "object") {
|
|
19036
19036
|
const fields2 = entry;
|
|
19037
|
-
agents[
|
|
19037
|
+
agents[name2] = { model: asString(fields2["model"]), binary: asString(fields2["binary"]) };
|
|
19038
19038
|
}
|
|
19039
19039
|
}
|
|
19040
19040
|
}
|
|
@@ -19047,10 +19047,10 @@ async function writeAgentConfig(config) {
|
|
|
19047
19047
|
const existing = await readV1Store();
|
|
19048
19048
|
const merged = { ...existing };
|
|
19049
19049
|
const agents = {};
|
|
19050
|
-
for (const
|
|
19051
|
-
const model = config.agents[
|
|
19052
|
-
const binary = config.agents[
|
|
19053
|
-
if (model || binary) agents[
|
|
19050
|
+
for (const name2 of AGENT_NAMES) {
|
|
19051
|
+
const model = config.agents[name2].model.trim();
|
|
19052
|
+
const binary = config.agents[name2].binary.trim();
|
|
19053
|
+
if (model || binary) agents[name2] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
19054
19054
|
}
|
|
19055
19055
|
const defaultModel = config.defaultChosen ? agents[config.defaultAgent]?.model : void 0;
|
|
19056
19056
|
if (config.defaultChosen) merged["agent"] = config.defaultAgent;
|
|
@@ -19080,9 +19080,9 @@ var init_agent_store = __esm({
|
|
|
19080
19080
|
|
|
19081
19081
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/apply-binary-overrides.ts
|
|
19082
19082
|
function applyBinaryOverrides(config) {
|
|
19083
|
-
for (const
|
|
19084
|
-
const key = `EDS_AGENT_BINARY_${
|
|
19085
|
-
const binary = config.agents[
|
|
19083
|
+
for (const name2 of AGENT_NAMES) {
|
|
19084
|
+
const key = `EDS_AGENT_BINARY_${name2.toUpperCase()}`;
|
|
19085
|
+
const binary = config.agents[name2].binary.trim();
|
|
19086
19086
|
if (binary) {
|
|
19087
19087
|
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
19088
19088
|
process.env[key] = binary;
|
|
@@ -19465,7 +19465,7 @@ async function pruneExpiredLogs(base, retentionDays, now = Date.now()) {
|
|
|
19465
19465
|
const contentfulDir = join18(base, ".contentful");
|
|
19466
19466
|
const result = { logs: 0, folders: 0 };
|
|
19467
19467
|
try {
|
|
19468
|
-
const sessions = (await readdir2(contentfulDir)).filter((
|
|
19468
|
+
const sessions = (await readdir2(contentfulDir)).filter((name2) => SESSION_FOLDER.test(name2));
|
|
19469
19469
|
for (const session of sessions) {
|
|
19470
19470
|
const files = await logFilesIn(join18(contentfulDir, session, "debug")).catch(() => []);
|
|
19471
19471
|
for (const file of files) {
|
|
@@ -22399,7 +22399,7 @@ function collectDependents(components) {
|
|
|
22399
22399
|
function findRoots(components, selected) {
|
|
22400
22400
|
const scope = selected ? components.filter((c2) => selected.has(c2.name)) : components;
|
|
22401
22401
|
const dependents = collectDependents(scope);
|
|
22402
|
-
return scope.map((c2) => c2.name).filter((
|
|
22402
|
+
return scope.map((c2) => c2.name).filter((name2) => !dependents.has(name2)).sort();
|
|
22403
22403
|
}
|
|
22404
22404
|
function findCycleInClosure(root, reachable, components) {
|
|
22405
22405
|
const scopedComponents = components.filter((c2) => reachable.has(c2.name)).map((c2) => ({ name: c2.name, slots: c2.slots }));
|
|
@@ -22435,9 +22435,9 @@ function computeClosure(root, components) {
|
|
|
22435
22435
|
const reachable = walkReachable2(root, byName, known);
|
|
22436
22436
|
const cyclePath = findCycleInClosure(root, reachable, components);
|
|
22437
22437
|
if (cyclePath) {
|
|
22438
|
-
const nodes2 = [...reachable].sort().map((
|
|
22439
|
-
name,
|
|
22440
|
-
depth:
|
|
22438
|
+
const nodes2 = [...reachable].sort().map((name2) => ({
|
|
22439
|
+
name: name2,
|
|
22440
|
+
depth: name2 === root ? 0 : 1,
|
|
22441
22441
|
path: [root],
|
|
22442
22442
|
parents: []
|
|
22443
22443
|
}));
|
|
@@ -22473,12 +22473,12 @@ function computeClosure(root, components) {
|
|
|
22473
22473
|
}
|
|
22474
22474
|
}
|
|
22475
22475
|
const nodes = [];
|
|
22476
|
-
for (const [
|
|
22476
|
+
for (const [name2, d] of depth.entries()) {
|
|
22477
22477
|
nodes.push({
|
|
22478
|
-
name,
|
|
22478
|
+
name: name2,
|
|
22479
22479
|
depth: d,
|
|
22480
|
-
path: parentPath.get(
|
|
22481
|
-
parents: [...parents.get(
|
|
22480
|
+
path: parentPath.get(name2),
|
|
22481
|
+
parents: [...parents.get(name2) ?? /* @__PURE__ */ new Set()].sort()
|
|
22482
22482
|
});
|
|
22483
22483
|
}
|
|
22484
22484
|
nodes.sort((a, b) => a.depth - b.depth || a.name.localeCompare(b.name));
|
|
@@ -22501,8 +22501,8 @@ function findSharedDeps(closures) {
|
|
|
22501
22501
|
}
|
|
22502
22502
|
}
|
|
22503
22503
|
const out = /* @__PURE__ */ new Map();
|
|
22504
|
-
for (const [
|
|
22505
|
-
if (roots.length >= 2) out.set(
|
|
22504
|
+
for (const [name2, roots] of counts.entries()) {
|
|
22505
|
+
if (roots.length >= 2) out.set(name2, [...roots].sort());
|
|
22506
22506
|
}
|
|
22507
22507
|
return out;
|
|
22508
22508
|
}
|
|
@@ -22713,13 +22713,13 @@ function buildVisibleRows(props) {
|
|
|
22713
22713
|
...findRoots(subgraph),
|
|
22714
22714
|
...subgraph.filter((n) => hasDirectChild(n)).map((n) => n.name)
|
|
22715
22715
|
]);
|
|
22716
|
-
for (const
|
|
22717
|
-
const full = computeClosure(
|
|
22718
|
-
closures.set(
|
|
22716
|
+
for (const name2 of [...parentNames].sort()) {
|
|
22717
|
+
const full = computeClosure(name2, subgraph);
|
|
22718
|
+
closures.set(name2, { ...full, nodes: full.nodes.filter((n) => n.depth <= 1) });
|
|
22719
22719
|
}
|
|
22720
22720
|
const sharedDeps = findSharedDeps(closures);
|
|
22721
|
-
const hasCycleDepDirect = (
|
|
22722
|
-
const it = itemByKey.get(
|
|
22721
|
+
const hasCycleDepDirect = (name2) => {
|
|
22722
|
+
const it = itemByKey.get(name2)?.it;
|
|
22723
22723
|
if (!it) return false;
|
|
22724
22724
|
for (const target of allowedComponentNames(it.entry)) {
|
|
22725
22725
|
if (cycleParticipants.has(target)) return true;
|
|
@@ -22824,28 +22824,28 @@ function buildVisibleRows(props) {
|
|
|
22824
22824
|
});
|
|
22825
22825
|
});
|
|
22826
22826
|
}
|
|
22827
|
-
for (const
|
|
22828
|
-
const rec = itemByKey.get(
|
|
22827
|
+
for (const name2 of standaloneRoots) {
|
|
22828
|
+
const rec = itemByKey.get(name2);
|
|
22829
22829
|
if (!rec) continue;
|
|
22830
22830
|
rows.push({
|
|
22831
22831
|
kind: "standalone",
|
|
22832
|
-
key: `stand:${
|
|
22833
|
-
label:
|
|
22832
|
+
key: `stand:${name2}`,
|
|
22833
|
+
label: name2,
|
|
22834
22834
|
indent: 0,
|
|
22835
22835
|
itemIdx: rec.idx
|
|
22836
22836
|
});
|
|
22837
22837
|
}
|
|
22838
22838
|
const nodeByName = new Map(subgraph.map((n) => [n.name, n]));
|
|
22839
|
-
const sharedLeafNames = [...sharedDeps.keys()].filter((
|
|
22839
|
+
const sharedLeafNames = [...sharedDeps.keys()].filter((name2) => (nodeByName.get(name2)?.slots.length ?? 0) === 0).sort();
|
|
22840
22840
|
const seenStandaloneNames = new Set(standaloneRoots);
|
|
22841
|
-
for (const
|
|
22842
|
-
if (seenStandaloneNames.has(
|
|
22843
|
-
const rec = itemByKey.get(
|
|
22841
|
+
for (const name2 of sharedLeafNames) {
|
|
22842
|
+
if (seenStandaloneNames.has(name2)) continue;
|
|
22843
|
+
const rec = itemByKey.get(name2);
|
|
22844
22844
|
if (!rec) continue;
|
|
22845
22845
|
rows.push({
|
|
22846
22846
|
kind: "standalone",
|
|
22847
|
-
key: `shared-standalone:${
|
|
22848
|
-
label: `${
|
|
22847
|
+
key: `shared-standalone:${name2}`,
|
|
22848
|
+
label: `${name2} (shared)`,
|
|
22849
22849
|
indent: 0,
|
|
22850
22850
|
sharedSuffix: true,
|
|
22851
22851
|
itemIdx: rec.idx
|
|
@@ -22861,13 +22861,13 @@ function buildVisibleRows(props) {
|
|
|
22861
22861
|
indent: 0,
|
|
22862
22862
|
itemIdx: -1
|
|
22863
22863
|
});
|
|
22864
|
-
for (const
|
|
22865
|
-
const rec = itemByKey.get(
|
|
22864
|
+
for (const name2 of flatNames) {
|
|
22865
|
+
const rec = itemByKey.get(name2);
|
|
22866
22866
|
if (!rec) continue;
|
|
22867
22867
|
rows.push({
|
|
22868
22868
|
kind: "flat",
|
|
22869
|
-
key: `flat:${
|
|
22870
|
-
label:
|
|
22869
|
+
key: `flat:${name2}`,
|
|
22870
|
+
label: name2,
|
|
22871
22871
|
indent: 0,
|
|
22872
22872
|
itemIdx: rec.idx
|
|
22873
22873
|
});
|
|
@@ -22877,9 +22877,9 @@ function buildVisibleRows(props) {
|
|
|
22877
22877
|
if (filterVisibleKeys !== void 0) {
|
|
22878
22878
|
return rows.filter((row) => {
|
|
22879
22879
|
if (row.itemIdx < 0) return true;
|
|
22880
|
-
const
|
|
22881
|
-
if (
|
|
22882
|
-
return filterVisibleKeys.has(
|
|
22880
|
+
const name2 = items[row.itemIdx]?.key;
|
|
22881
|
+
if (name2 === void 0) return true;
|
|
22882
|
+
return filterVisibleKeys.has(name2);
|
|
22883
22883
|
});
|
|
22884
22884
|
}
|
|
22885
22885
|
return rows;
|
|
@@ -23601,11 +23601,11 @@ function computeCycleAwareAcceptCascade(target, components, cycleUnits) {
|
|
|
23601
23601
|
const byName = new Map(components.map((c2) => [c2.name, c2]));
|
|
23602
23602
|
const visited = /* @__PURE__ */ new Set();
|
|
23603
23603
|
const queue = [];
|
|
23604
|
-
const enqueue = (
|
|
23605
|
-
if (visited.has(
|
|
23606
|
-
visited.add(
|
|
23607
|
-
queue.push(
|
|
23608
|
-
const unit = cycleUnits.get(
|
|
23604
|
+
const enqueue = (name2) => {
|
|
23605
|
+
if (visited.has(name2)) return;
|
|
23606
|
+
visited.add(name2);
|
|
23607
|
+
queue.push(name2);
|
|
23608
|
+
const unit = cycleUnits.get(name2);
|
|
23609
23609
|
if (unit) {
|
|
23610
23610
|
for (const member of unit) {
|
|
23611
23611
|
if (!visited.has(member)) {
|
|
@@ -23742,7 +23742,7 @@ function buildScopeGraph(components) {
|
|
|
23742
23742
|
cycles = [];
|
|
23743
23743
|
}
|
|
23744
23744
|
const cycleParticipants = /* @__PURE__ */ new Set();
|
|
23745
|
-
for (const cycle of cycles) for (const
|
|
23745
|
+
for (const cycle of cycles) for (const name2 of cycle.path) cycleParticipants.add(name2);
|
|
23746
23746
|
return {
|
|
23747
23747
|
nodes,
|
|
23748
23748
|
cycles,
|
|
@@ -23967,10 +23967,10 @@ var init_lineage_layout = __esm({
|
|
|
23967
23967
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/sidebar-navigation.ts
|
|
23968
23968
|
function collectExpandedGroupRoots(closures, cycleParticipants) {
|
|
23969
23969
|
const roots = /* @__PURE__ */ new Set();
|
|
23970
|
-
for (const [
|
|
23971
|
-
if (closure.nodes.length > 1) roots.add(
|
|
23970
|
+
for (const [name2, closure] of closures.entries()) {
|
|
23971
|
+
if (closure.nodes.length > 1) roots.add(name2);
|
|
23972
23972
|
}
|
|
23973
|
-
for (const
|
|
23973
|
+
for (const name2 of cycleParticipants) roots.add(name2);
|
|
23974
23974
|
return roots;
|
|
23975
23975
|
}
|
|
23976
23976
|
function computeSidebarViewToggle({
|
|
@@ -24042,9 +24042,9 @@ function buildFlatDimPredicate(input) {
|
|
|
24042
24042
|
const isFlat = input.viewMode === "flat";
|
|
24043
24043
|
const keys = isFlat ? input.filterVisibleKeys : void 0;
|
|
24044
24044
|
if (!hasSearch && keys === void 0) return void 0;
|
|
24045
|
-
return (
|
|
24046
|
-
if (hasSearch && !fuzzyMatches(input.searchQuery,
|
|
24047
|
-
if (keys !== void 0 && !keys.has(
|
|
24045
|
+
return (name2) => {
|
|
24046
|
+
if (hasSearch && !fuzzyMatches(input.searchQuery, name2)) return true;
|
|
24047
|
+
if (keys !== void 0 && !keys.has(name2)) return true;
|
|
24048
24048
|
return false;
|
|
24049
24049
|
};
|
|
24050
24050
|
}
|
|
@@ -24064,7 +24064,7 @@ var init_step_filters = __esm({
|
|
|
24064
24064
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/state.ts
|
|
24065
24065
|
function apply(state2, entries) {
|
|
24066
24066
|
const next = new Map(state2);
|
|
24067
|
-
for (const [
|
|
24067
|
+
for (const [name2, decision] of entries) next.set(name2, decision);
|
|
24068
24068
|
return next;
|
|
24069
24069
|
}
|
|
24070
24070
|
function reduceDecisions(state2, action, components, graph) {
|
|
@@ -24073,44 +24073,44 @@ function reduceDecisions(state2, action, components, graph) {
|
|
|
24073
24073
|
if (state2.get(action.name) === "accepted") return state2;
|
|
24074
24074
|
return apply(
|
|
24075
24075
|
state2,
|
|
24076
|
-
acceptCascade(graph, action.name).map((
|
|
24076
|
+
acceptCascade(graph, action.name).map((name2) => [name2, "accepted"])
|
|
24077
24077
|
);
|
|
24078
24078
|
}
|
|
24079
24079
|
case "reject": {
|
|
24080
24080
|
if (state2.get(action.name) === "rejected") return state2;
|
|
24081
24081
|
const { toReject, toDeselect } = rejectCascade(graph, action.name);
|
|
24082
24082
|
return apply(state2, [
|
|
24083
|
-
...toReject.map((
|
|
24084
|
-
...toDeselect.map((
|
|
24083
|
+
...toReject.map((name2) => [name2, "rejected"]),
|
|
24084
|
+
...toDeselect.map((name2) => [name2, "undecided"])
|
|
24085
24085
|
]);
|
|
24086
24086
|
}
|
|
24087
24087
|
case "toggle-all": {
|
|
24088
24088
|
const nonCycle = components.filter((c2) => !graph.cycleParticipants.has(c2.name)).map((c2) => c2.name);
|
|
24089
|
-
const anyNotAccepted = nonCycle.some((
|
|
24089
|
+
const anyNotAccepted = nonCycle.some((name2) => state2.get(name2) !== "accepted");
|
|
24090
24090
|
if (anyNotAccepted) {
|
|
24091
24091
|
return apply(state2, [
|
|
24092
|
-
...nonCycle.map((
|
|
24093
|
-
...reachableCycleMembers(graph, nonCycle).map((
|
|
24092
|
+
...nonCycle.map((name2) => [name2, "accepted"]),
|
|
24093
|
+
...reachableCycleMembers(graph, nonCycle).map((name2) => [name2, "accepted"])
|
|
24094
24094
|
]);
|
|
24095
24095
|
}
|
|
24096
24096
|
return apply(state2, [
|
|
24097
|
-
...nonCycle.map((
|
|
24097
|
+
...nonCycle.map((name2) => [name2, "rejected"]),
|
|
24098
24098
|
...components.filter((c2) => graph.cycleParticipants.has(c2.name) && state2.get(c2.name) === "accepted").map((c2) => [c2.name, "undecided"])
|
|
24099
24099
|
]);
|
|
24100
24100
|
}
|
|
24101
24101
|
case "accept-unflagged": {
|
|
24102
24102
|
const seeds = components.filter((c2) => !graph.cycleParticipants.has(c2.name) && !isAiFlagged(c2)).map((c2) => c2.name);
|
|
24103
24103
|
return apply(state2, [
|
|
24104
|
-
...seeds.map((
|
|
24105
|
-
...reachableCycleMembers(graph, seeds).map((
|
|
24104
|
+
...seeds.map((name2) => [name2, "accepted"]),
|
|
24105
|
+
...reachableCycleMembers(graph, seeds).map((name2) => [name2, "accepted"])
|
|
24106
24106
|
]);
|
|
24107
24107
|
}
|
|
24108
24108
|
}
|
|
24109
24109
|
}
|
|
24110
|
-
function rejectNeedsConfirmation(graph,
|
|
24111
|
-
if (state2.get(
|
|
24112
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
24113
|
-
const ancestors = toReject.filter((n) => n !==
|
|
24110
|
+
function rejectNeedsConfirmation(graph, name2, state2) {
|
|
24111
|
+
if (state2.get(name2) === "rejected") return false;
|
|
24112
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
24113
|
+
const ancestors = toReject.filter((n) => n !== name2);
|
|
24114
24114
|
return ancestors.length + toDeselect.length >= 2;
|
|
24115
24115
|
}
|
|
24116
24116
|
function partitionDecisions(components, state2) {
|
|
@@ -24208,8 +24208,8 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24208
24208
|
for (const node of closure.nodes) keys.add(node.name);
|
|
24209
24209
|
}
|
|
24210
24210
|
for (const unit of cycleUnits.values()) {
|
|
24211
|
-
if (![...unit].some((
|
|
24212
|
-
for (const
|
|
24211
|
+
if (![...unit].some((name2) => decisions.get(name2) === "accepted")) continue;
|
|
24212
|
+
for (const name2 of unit) keys.add(name2);
|
|
24213
24213
|
}
|
|
24214
24214
|
return keys;
|
|
24215
24215
|
}, [closures, cycleUnits, showDependencies, decisions]);
|
|
@@ -24307,12 +24307,12 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24307
24307
|
return void 0;
|
|
24308
24308
|
}
|
|
24309
24309
|
};
|
|
24310
|
-
const jumpCursorTo = (
|
|
24310
|
+
const jumpCursorTo = (name2) => {
|
|
24311
24311
|
let idx = -1;
|
|
24312
24312
|
for (let i = 0; i < visibleRows.length; i++) {
|
|
24313
24313
|
const row = visibleRows[i];
|
|
24314
24314
|
if (row.itemIdx < 0) continue;
|
|
24315
|
-
if (groupedItems[row.itemIdx]?.key ===
|
|
24315
|
+
if (groupedItems[row.itemIdx]?.key === name2) {
|
|
24316
24316
|
idx = i;
|
|
24317
24317
|
break;
|
|
24318
24318
|
}
|
|
@@ -24326,18 +24326,18 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24326
24326
|
});
|
|
24327
24327
|
};
|
|
24328
24328
|
const decide = (action) => setDecisions((prev) => reduceDecisions(prev, action, components, graph));
|
|
24329
|
-
const requestReject = (
|
|
24330
|
-
if (decisions.get(
|
|
24331
|
-
if (rejectNeedsConfirmation(graph,
|
|
24332
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
24329
|
+
const requestReject = (name2) => {
|
|
24330
|
+
if (decisions.get(name2) === "rejected") return;
|
|
24331
|
+
if (rejectNeedsConfirmation(graph, name2, decisions)) {
|
|
24332
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
24333
24333
|
setPendingRejectCascade({
|
|
24334
|
-
target:
|
|
24335
|
-
ancestors: toReject.filter((n) => n !==
|
|
24334
|
+
target: name2,
|
|
24335
|
+
ancestors: toReject.filter((n) => n !== name2).sort(),
|
|
24336
24336
|
descendants: [...toDeselect].sort()
|
|
24337
24337
|
});
|
|
24338
24338
|
return;
|
|
24339
24339
|
}
|
|
24340
|
-
decide({ type: "reject", name });
|
|
24340
|
+
decide({ type: "reject", name: name2 });
|
|
24341
24341
|
};
|
|
24342
24342
|
const mode = showHelp ? "help" : pendingRejectCascade ? "reject-prompt" : searchOpen ? "search" : cyclesPanelOpen ? "cycles" : aiRationalePanel.isOpen ? "flags" : "main";
|
|
24343
24343
|
const context = {
|
|
@@ -24886,18 +24886,18 @@ function describeGeneration(input) {
|
|
|
24886
24886
|
${agent} is reading each selected component and writing a Contentful component definition for it.${input.hasTokens ? "\nUsing your design tokens for prop resolution." : ""}`;
|
|
24887
24887
|
}
|
|
24888
24888
|
function progressRows2(progress, agent) {
|
|
24889
|
-
const
|
|
24889
|
+
const name2 = capitalize(agent);
|
|
24890
24890
|
const { components, mapTokens } = progress;
|
|
24891
24891
|
const rows = [
|
|
24892
24892
|
{
|
|
24893
|
-
text: components ? components.current : `Starting up ${
|
|
24893
|
+
text: components ? components.current : `Starting up ${name2}...`,
|
|
24894
24894
|
complete: false,
|
|
24895
24895
|
...components ? { progress: { done: components.done, total: components.total } } : {}
|
|
24896
24896
|
}
|
|
24897
24897
|
];
|
|
24898
24898
|
if (mapTokens !== "idle") {
|
|
24899
24899
|
rows.push({
|
|
24900
|
-
text: mapTokens === "running" ? `Mapping token restrictions via ${
|
|
24900
|
+
text: mapTokens === "running" ? `Mapping token restrictions via ${name2}...` : "Token restrictions ready",
|
|
24901
24901
|
complete: mapTokens === "complete"
|
|
24902
24902
|
});
|
|
24903
24903
|
}
|
|
@@ -24907,7 +24907,7 @@ var capitalize;
|
|
|
24907
24907
|
var init_logic11 = __esm({
|
|
24908
24908
|
"packages/experience-design-system-cli/src/tui/import/steps/08-generation/logic.ts"() {
|
|
24909
24909
|
"use strict";
|
|
24910
|
-
capitalize = (
|
|
24910
|
+
capitalize = (name2) => name2.charAt(0).toUpperCase() + name2.slice(1);
|
|
24911
24911
|
}
|
|
24912
24912
|
});
|
|
24913
24913
|
|
|
@@ -25182,24 +25182,21 @@ var init_build_flow_start = __esm({
|
|
|
25182
25182
|
}
|
|
25183
25183
|
});
|
|
25184
25184
|
|
|
25185
|
-
// packages/experience-design-system-types/dist/src/
|
|
25186
|
-
|
|
25187
|
-
|
|
25188
|
-
|
|
25189
|
-
|
|
25190
|
-
});
|
|
25191
|
-
|
|
25192
|
-
// packages/experience-design-system-types/dist/src/agent-prompt-artifact.js
|
|
25193
|
-
var init_agent_prompt_artifact = __esm({
|
|
25194
|
-
"packages/experience-design-system-types/dist/src/agent-prompt-artifact.js"() {
|
|
25195
|
-
"use strict";
|
|
25196
|
-
}
|
|
25197
|
-
});
|
|
25198
|
-
|
|
25199
|
-
// packages/experience-design-system-types/dist/src/agent-process-lifecycle.js
|
|
25200
|
-
var init_agent_process_lifecycle = __esm({
|
|
25201
|
-
"packages/experience-design-system-types/dist/src/agent-process-lifecycle.js"() {
|
|
25185
|
+
// packages/experience-design-system-types/dist/src/source-input-association.js
|
|
25186
|
+
import * as z3 from "zod/mini";
|
|
25187
|
+
var name, SourceInputAssociationSchema;
|
|
25188
|
+
var init_source_input_association = __esm({
|
|
25189
|
+
"packages/experience-design-system-types/dist/src/source-input-association.js"() {
|
|
25202
25190
|
"use strict";
|
|
25191
|
+
name = z3.string().check(z3.refine((value) => value.trim().length > 0));
|
|
25192
|
+
SourceInputAssociationSchema = z3.strictObject({
|
|
25193
|
+
schemaVersion: z3.literal(1),
|
|
25194
|
+
componentId: name,
|
|
25195
|
+
componentDeclarationId: name,
|
|
25196
|
+
rootSymbolId: name,
|
|
25197
|
+
inputName: name,
|
|
25198
|
+
inputPath: z3.array(name).check(z3.minLength(1))
|
|
25199
|
+
}).check(z3.refine((value) => value.inputPath[0] === value.inputName));
|
|
25203
25200
|
}
|
|
25204
25201
|
});
|
|
25205
25202
|
|
|
@@ -25397,38 +25394,38 @@ var init_validate5 = __esm({
|
|
|
25397
25394
|
});
|
|
25398
25395
|
|
|
25399
25396
|
// packages/experience-design-system-types/dist/src/cdf/types.js
|
|
25400
|
-
import * as
|
|
25397
|
+
import * as z4 from "zod/mini";
|
|
25401
25398
|
var CDFPropertySchema2, CDFSlotSchema2, CDFComponentSchema2, CDFTokenSchema2;
|
|
25402
25399
|
var init_types7 = __esm({
|
|
25403
25400
|
"packages/experience-design-system-types/dist/src/cdf/types.js"() {
|
|
25404
25401
|
"use strict";
|
|
25405
25402
|
init_vocabularies2();
|
|
25406
25403
|
init_token_types2();
|
|
25407
|
-
CDFPropertySchema2 =
|
|
25408
|
-
$type:
|
|
25409
|
-
$category:
|
|
25410
|
-
$description:
|
|
25411
|
-
$required:
|
|
25412
|
-
$default:
|
|
25413
|
-
$values:
|
|
25414
|
-
"$token.kind":
|
|
25415
|
-
"$token.allowed":
|
|
25404
|
+
CDFPropertySchema2 = z4.strictObject({
|
|
25405
|
+
$type: z4.enum(CDF_PROPERTY_TYPES2),
|
|
25406
|
+
$category: z4.enum(CDF_PROPERTY_CATEGORIES2),
|
|
25407
|
+
$description: z4.optional(z4.string()),
|
|
25408
|
+
$required: z4.optional(z4.boolean()),
|
|
25409
|
+
$default: z4.optional(z4.any()),
|
|
25410
|
+
$values: z4.optional(z4.array(z4.string())),
|
|
25411
|
+
"$token.kind": z4.optional(z4.string()),
|
|
25412
|
+
"$token.allowed": z4.optional(z4.array(z4.string()))
|
|
25416
25413
|
});
|
|
25417
|
-
CDFSlotSchema2 =
|
|
25418
|
-
$description:
|
|
25419
|
-
$allowedComponents:
|
|
25420
|
-
$required:
|
|
25414
|
+
CDFSlotSchema2 = z4.strictObject({
|
|
25415
|
+
$description: z4.optional(z4.string()),
|
|
25416
|
+
$allowedComponents: z4.optional(z4.array(z4.string())),
|
|
25417
|
+
$required: z4.optional(z4.boolean())
|
|
25421
25418
|
});
|
|
25422
|
-
CDFComponentSchema2 =
|
|
25423
|
-
$type:
|
|
25424
|
-
$description:
|
|
25425
|
-
$properties:
|
|
25426
|
-
$slots:
|
|
25419
|
+
CDFComponentSchema2 = z4.strictObject({
|
|
25420
|
+
$type: z4.literal("component"),
|
|
25421
|
+
$description: z4.optional(z4.string()),
|
|
25422
|
+
$properties: z4.record(z4.string(), CDFPropertySchema2),
|
|
25423
|
+
$slots: z4.optional(z4.record(z4.string(), CDFSlotSchema2))
|
|
25427
25424
|
});
|
|
25428
|
-
CDFTokenSchema2 =
|
|
25429
|
-
$type:
|
|
25430
|
-
$value:
|
|
25431
|
-
$description:
|
|
25425
|
+
CDFTokenSchema2 = z4.strictObject({
|
|
25426
|
+
$type: z4.enum(DESIGN_TOKEN_TYPES2),
|
|
25427
|
+
$value: z4.unknown(),
|
|
25428
|
+
$description: z4.optional(z4.string())
|
|
25432
25429
|
});
|
|
25433
25430
|
}
|
|
25434
25431
|
});
|
|
@@ -25438,9 +25435,9 @@ function stripUnsupportedSlotFields(entry) {
|
|
|
25438
25435
|
if (!entry.$slots)
|
|
25439
25436
|
return entry;
|
|
25440
25437
|
const cleaned = {};
|
|
25441
|
-
for (const [
|
|
25438
|
+
for (const [name2, slot] of Object.entries(entry.$slots)) {
|
|
25442
25439
|
const { $required: _required, ...rest } = slot;
|
|
25443
|
-
cleaned[
|
|
25440
|
+
cleaned[name2] = rest;
|
|
25444
25441
|
}
|
|
25445
25442
|
return { ...entry, $slots: cleaned };
|
|
25446
25443
|
}
|
|
@@ -25482,7 +25479,7 @@ function validateSlotReferences2(components) {
|
|
|
25482
25479
|
const slots = entry.$slots ?? {};
|
|
25483
25480
|
for (const [slotKey, slot] of Object.entries(slots)) {
|
|
25484
25481
|
const allowed = slot?.$allowedComponents ?? [];
|
|
25485
|
-
const unresolved = allowed.filter((
|
|
25482
|
+
const unresolved = allowed.filter((name2) => !componentKeys.has(name2));
|
|
25486
25483
|
if (unresolved.length === 0)
|
|
25487
25484
|
continue;
|
|
25488
25485
|
errors.push({
|
|
@@ -25528,17 +25525,17 @@ var init_cdf2 = __esm({
|
|
|
25528
25525
|
});
|
|
25529
25526
|
|
|
25530
25527
|
// packages/experience-design-system-types/dist/src/dtcg/types.js
|
|
25531
|
-
import * as
|
|
25528
|
+
import * as z5 from "zod/mini";
|
|
25532
25529
|
var DTCGTokenSchema2;
|
|
25533
25530
|
var init_types8 = __esm({
|
|
25534
25531
|
"packages/experience-design-system-types/dist/src/dtcg/types.js"() {
|
|
25535
25532
|
"use strict";
|
|
25536
25533
|
init_token_types2();
|
|
25537
|
-
DTCGTokenSchema2 =
|
|
25538
|
-
path:
|
|
25539
|
-
$type:
|
|
25540
|
-
$value:
|
|
25541
|
-
$description:
|
|
25534
|
+
DTCGTokenSchema2 = z5.strictObject({
|
|
25535
|
+
path: z5.string(),
|
|
25536
|
+
$type: z5.enum(DESIGN_TOKEN_TYPES2),
|
|
25537
|
+
$value: z5.unknown(),
|
|
25538
|
+
$description: z5.optional(z5.string())
|
|
25542
25539
|
});
|
|
25543
25540
|
}
|
|
25544
25541
|
});
|
|
@@ -25576,9 +25573,7 @@ var init_dtcg2 = __esm({
|
|
|
25576
25573
|
var init_src4 = __esm({
|
|
25577
25574
|
"packages/experience-design-system-types/dist/src/index.js"() {
|
|
25578
25575
|
"use strict";
|
|
25579
|
-
|
|
25580
|
-
init_agent_prompt_artifact();
|
|
25581
|
-
init_agent_process_lifecycle();
|
|
25576
|
+
init_source_input_association();
|
|
25582
25577
|
init_cdf2();
|
|
25583
25578
|
init_dtcg2();
|
|
25584
25579
|
}
|
|
@@ -25589,7 +25584,7 @@ function failedComponentNames(errors) {
|
|
|
25589
25584
|
return [...new Set(errors.map((error) => error.componentName))];
|
|
25590
25585
|
}
|
|
25591
25586
|
function matchedComponentNames(errors, missingNames) {
|
|
25592
|
-
return failedComponentNames(errors).filter((
|
|
25587
|
+
return failedComponentNames(errors).filter((name2) => !missingNames.includes(name2));
|
|
25593
25588
|
}
|
|
25594
25589
|
function formatErrorLine(error) {
|
|
25595
25590
|
const context = [`Component: ${error.componentName}`, error.path ? `Path: ${error.path}` : null].filter(Boolean);
|
|
@@ -25735,11 +25730,11 @@ function computeRenderStatuses(closure, directIssues) {
|
|
|
25735
25730
|
inheritedSources.get(ancestor).set(node.name, ownStatus);
|
|
25736
25731
|
}
|
|
25737
25732
|
}
|
|
25738
|
-
for (const [
|
|
25739
|
-
out.set(
|
|
25733
|
+
for (const [name2, status] of own.entries()) {
|
|
25734
|
+
out.set(name2, {
|
|
25740
25735
|
status,
|
|
25741
25736
|
isOwn: true,
|
|
25742
|
-
sourceComponents: [
|
|
25737
|
+
sourceComponents: [name2]
|
|
25743
25738
|
});
|
|
25744
25739
|
}
|
|
25745
25740
|
for (const [ancestor, sources] of inheritedSources.entries()) {
|
|
@@ -26057,7 +26052,7 @@ function parseToState(json) {
|
|
|
26057
26052
|
}
|
|
26058
26053
|
const componentDescription = typeof component.$description === "string" ? component.$description : "";
|
|
26059
26054
|
const rawProps = component.$properties ?? {};
|
|
26060
|
-
const props = Object.entries(rawProps).map(([
|
|
26055
|
+
const props = Object.entries(rawProps).map(([name2, raw]) => {
|
|
26061
26056
|
const p = raw ?? {};
|
|
26062
26057
|
const type = CDF_PROPERTY_TYPES2.includes(p.$type) ? p.$type : "string";
|
|
26063
26058
|
let defaultValue = null;
|
|
@@ -26069,7 +26064,7 @@ function parseToState(json) {
|
|
|
26069
26064
|
}
|
|
26070
26065
|
}
|
|
26071
26066
|
return {
|
|
26072
|
-
name,
|
|
26067
|
+
name: name2,
|
|
26073
26068
|
type,
|
|
26074
26069
|
category: CDF_PROPERTY_CATEGORIES2.includes(p.$category) ? p.$category : "content",
|
|
26075
26070
|
required: p.$required === true,
|
|
@@ -26081,10 +26076,10 @@ function parseToState(json) {
|
|
|
26081
26076
|
};
|
|
26082
26077
|
});
|
|
26083
26078
|
const rawSlots = component.$slots ?? {};
|
|
26084
|
-
const slots = Object.entries(rawSlots).map(([
|
|
26079
|
+
const slots = Object.entries(rawSlots).map(([name2, raw]) => {
|
|
26085
26080
|
const s = raw ?? {};
|
|
26086
26081
|
return {
|
|
26087
|
-
name,
|
|
26082
|
+
name: name2,
|
|
26088
26083
|
description: typeof s.$description === "string" ? s.$description : "",
|
|
26089
26084
|
required: s.$required === true,
|
|
26090
26085
|
allowedComponents: Array.isArray(s.$allowedComponents) ? s.$allowedComponents.filter((v) => typeof v === "string") : []
|
|
@@ -26192,7 +26187,7 @@ function DefaultValueRow({
|
|
|
26192
26187
|
] });
|
|
26193
26188
|
}
|
|
26194
26189
|
function RowLabel({
|
|
26195
|
-
name,
|
|
26190
|
+
name: name2,
|
|
26196
26191
|
selected,
|
|
26197
26192
|
trailing = true
|
|
26198
26193
|
}) {
|
|
@@ -26205,7 +26200,7 @@ function RowLabel({
|
|
|
26205
26200
|
wrap: "truncate-end",
|
|
26206
26201
|
children: [
|
|
26207
26202
|
" ",
|
|
26208
|
-
|
|
26203
|
+
name2,
|
|
26209
26204
|
trailing ? " " : ""
|
|
26210
26205
|
]
|
|
26211
26206
|
}
|
|
@@ -26557,10 +26552,10 @@ function SlotRow({
|
|
|
26557
26552
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
26558
26553
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
26559
26554
|
/* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
26560
|
-
slice.map((
|
|
26555
|
+
slice.map((name2, i) => {
|
|
26561
26556
|
const absIdx = start + i;
|
|
26562
26557
|
const isCursor = absIdx === cursor;
|
|
26563
|
-
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${
|
|
26558
|
+
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${name2}` : ` ${name2}` }, name2);
|
|
26564
26559
|
})
|
|
26565
26560
|
] });
|
|
26566
26561
|
})() })
|
|
@@ -27456,8 +27451,8 @@ function FieldEditor({
|
|
|
27456
27451
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
27457
27452
|
const modeLabel = (() => {
|
|
27458
27453
|
if (pendingDelete) {
|
|
27459
|
-
const
|
|
27460
|
-
return `Delete ${pendingDelete.kind} "${
|
|
27454
|
+
const name2 = pendingDelete.kind === "prop" ? props[pendingDelete.idx]?.name : slots[pendingDelete.idx]?.name;
|
|
27455
|
+
return `Delete ${pendingDelete.kind} "${name2}"? [y] delete \xB7 any other key cancels`;
|
|
27461
27456
|
}
|
|
27462
27457
|
if (editingValue) {
|
|
27463
27458
|
return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
|
|
@@ -28682,7 +28677,7 @@ function finalizeReviewSession(extractSessionId, components) {
|
|
|
28682
28677
|
);
|
|
28683
28678
|
db.exec("BEGIN");
|
|
28684
28679
|
try {
|
|
28685
|
-
for (const
|
|
28680
|
+
for (const name2 of toReject) statement.run(extractSessionId, name2);
|
|
28686
28681
|
db.exec("COMMIT");
|
|
28687
28682
|
} catch (error) {
|
|
28688
28683
|
db.exec("ROLLBACK");
|
|
@@ -29666,13 +29661,13 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
29666
29661
|
const unchanged = new Set(preview.components.unchanged);
|
|
29667
29662
|
const changedNames = /* @__PURE__ */ new Set();
|
|
29668
29663
|
for (const item of preview.components.changed) {
|
|
29669
|
-
const
|
|
29670
|
-
if (typeof
|
|
29671
|
-
changedNames.add(
|
|
29664
|
+
const name2 = item.current?.name;
|
|
29665
|
+
if (typeof name2 !== "string") continue;
|
|
29666
|
+
changedNames.add(name2);
|
|
29672
29667
|
if (item.changeClassification?.classification === "breaking") {
|
|
29673
|
-
out.set(
|
|
29668
|
+
out.set(name2, "breaking");
|
|
29674
29669
|
} else {
|
|
29675
|
-
out.set(
|
|
29670
|
+
out.set(name2, "changed");
|
|
29676
29671
|
}
|
|
29677
29672
|
}
|
|
29678
29673
|
const removedNames = /* @__PURE__ */ new Set();
|
|
@@ -29682,12 +29677,12 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
29682
29677
|
out.set(entity.name, "removed");
|
|
29683
29678
|
}
|
|
29684
29679
|
}
|
|
29685
|
-
for (const
|
|
29686
|
-
if (unchanged.has(
|
|
29687
|
-
if (changedNames.has(
|
|
29688
|
-
if (removedNames.has(
|
|
29689
|
-
if (out.has(
|
|
29690
|
-
out.set(
|
|
29680
|
+
for (const name2 of localNames) {
|
|
29681
|
+
if (unchanged.has(name2)) continue;
|
|
29682
|
+
if (changedNames.has(name2)) continue;
|
|
29683
|
+
if (removedNames.has(name2)) continue;
|
|
29684
|
+
if (out.has(name2)) continue;
|
|
29685
|
+
out.set(name2, "new");
|
|
29691
29686
|
}
|
|
29692
29687
|
return out;
|
|
29693
29688
|
}
|
|
@@ -30412,10 +30407,10 @@ function GenerateReviewStepView({
|
|
|
30412
30407
|
const merged = /* @__PURE__ */ new Map();
|
|
30413
30408
|
for (const closure of closures.values()) {
|
|
30414
30409
|
const per = computeRenderStatuses(closure, directIssues);
|
|
30415
|
-
for (const [
|
|
30416
|
-
const existing = merged.get(
|
|
30410
|
+
for (const [name2, rs] of per.entries()) {
|
|
30411
|
+
const existing = merged.get(name2);
|
|
30417
30412
|
if (!existing || !existing.isOwn && rs.isOwn) {
|
|
30418
|
-
merged.set(
|
|
30413
|
+
merged.set(name2, rs);
|
|
30419
30414
|
}
|
|
30420
30415
|
}
|
|
30421
30416
|
}
|
|
@@ -30470,11 +30465,11 @@ function GenerateReviewStepView({
|
|
|
30470
30465
|
reviewEditor.setSaveError(null);
|
|
30471
30466
|
setPendingEditorFocus(null);
|
|
30472
30467
|
};
|
|
30473
|
-
const jumpCursorToName = (
|
|
30468
|
+
const jumpCursorToName = (name2) => {
|
|
30474
30469
|
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
30475
30470
|
const row = visibleRowsMemo[i];
|
|
30476
30471
|
if (row.itemIdx < 0) continue;
|
|
30477
|
-
if (components[row.itemIdx]?.key ===
|
|
30472
|
+
if (components[row.itemIdx]?.key === name2) {
|
|
30478
30473
|
jumpCursorToRow(i);
|
|
30479
30474
|
return;
|
|
30480
30475
|
}
|
|
@@ -31002,8 +30997,8 @@ function GenerateReviewStepView({
|
|
|
31002
30997
|
}
|
|
31003
30998
|
),
|
|
31004
30999
|
!dialogOpen && autoRejected.length > 0 && (() => {
|
|
31005
|
-
const stillRejected = autoRejected.filter((
|
|
31006
|
-
const c2 = components.find((x) => x.key ===
|
|
31000
|
+
const stillRejected = autoRejected.filter((name2) => {
|
|
31001
|
+
const c2 = components.find((x) => x.key === name2);
|
|
31007
31002
|
return c2?.status === "rejected";
|
|
31008
31003
|
});
|
|
31009
31004
|
if (stillRejected.length === 0) return null;
|
|
@@ -31685,31 +31680,31 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
31685
31680
|
const proposedProperties = proposed["$properties"] ?? {};
|
|
31686
31681
|
const proposedProps = new Set(Object.keys(proposedProperties));
|
|
31687
31682
|
const oldProps = current.fullProperties;
|
|
31688
|
-
for (const
|
|
31689
|
-
if (!currentProps.has(
|
|
31690
|
-
const def = proposedProperties[
|
|
31691
|
-
lines.push({ key: `${
|
|
31683
|
+
for (const name2 of [...proposedProps].sort()) {
|
|
31684
|
+
if (!currentProps.has(name2)) {
|
|
31685
|
+
const def = proposedProperties[name2];
|
|
31686
|
+
lines.push({ key: `${name2}-add`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(def)}` });
|
|
31692
31687
|
}
|
|
31693
31688
|
}
|
|
31694
|
-
for (const
|
|
31695
|
-
if (!proposedProps.has(
|
|
31696
|
-
if (oldProps?.[
|
|
31697
|
-
lines.push({ key: `${
|
|
31689
|
+
for (const name2 of [...currentProps].sort()) {
|
|
31690
|
+
if (!proposedProps.has(name2)) {
|
|
31691
|
+
if (oldProps?.[name2]) {
|
|
31692
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(oldProps[name2])}` });
|
|
31698
31693
|
} else {
|
|
31699
|
-
const cat = current.contentProperties.includes(
|
|
31700
|
-
lines.push({ key: `${
|
|
31694
|
+
const cat = current.contentProperties.includes(name2) ? "content" : "design";
|
|
31695
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2} (${cat})` });
|
|
31701
31696
|
}
|
|
31702
31697
|
}
|
|
31703
31698
|
}
|
|
31704
31699
|
const handledProps = /* @__PURE__ */ new Set();
|
|
31705
|
-
for (const
|
|
31706
|
-
if (!proposedProps.has(
|
|
31707
|
-
const newDef = proposedProperties[
|
|
31708
|
-
const oldDef = oldProps?.[
|
|
31700
|
+
for (const name2 of [...currentProps].sort()) {
|
|
31701
|
+
if (!proposedProps.has(name2)) continue;
|
|
31702
|
+
const newDef = proposedProperties[name2];
|
|
31703
|
+
const oldDef = oldProps?.[name2];
|
|
31709
31704
|
if (!oldDef) continue;
|
|
31710
|
-
const diffs = diffProperty(
|
|
31705
|
+
const diffs = diffProperty(name2, oldDef, newDef);
|
|
31711
31706
|
if (diffs.length > 0) {
|
|
31712
|
-
handledProps.add(
|
|
31707
|
+
handledProps.add(name2);
|
|
31713
31708
|
for (const d of diffs) lines.push(d);
|
|
31714
31709
|
}
|
|
31715
31710
|
}
|
|
@@ -31732,40 +31727,40 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
31732
31727
|
const proposedSlots = proposed["$slots"] ?? {};
|
|
31733
31728
|
const proposedSlotNames = new Set(Object.keys(proposedSlots));
|
|
31734
31729
|
const currentSlotAllowed = current.currentSlotAllowed ?? {};
|
|
31735
|
-
for (const
|
|
31736
|
-
if (!currentSlots.has(
|
|
31737
|
-
lines.push({ key: `slot-${
|
|
31730
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
31731
|
+
if (!currentSlots.has(name2)) {
|
|
31732
|
+
lines.push({ key: `slot-${name2}-add`, color: PALETTE.success, text: `+ slot: ${name2}` });
|
|
31738
31733
|
}
|
|
31739
31734
|
}
|
|
31740
|
-
for (const
|
|
31741
|
-
if (!proposedSlotNames.has(
|
|
31742
|
-
lines.push({ key: `slot-${
|
|
31735
|
+
for (const name2 of [...currentSlots].sort()) {
|
|
31736
|
+
if (!proposedSlotNames.has(name2)) {
|
|
31737
|
+
lines.push({ key: `slot-${name2}-rm`, color: PALETTE.error, text: `- slot: ${name2}` });
|
|
31743
31738
|
}
|
|
31744
31739
|
}
|
|
31745
|
-
for (const
|
|
31746
|
-
const nextAllowed = normalizeAllowedComponents(proposedSlots[
|
|
31747
|
-
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[
|
|
31748
|
-
const prevExists = currentSlots.has(
|
|
31740
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
31741
|
+
const nextAllowed = normalizeAllowedComponents(proposedSlots[name2]?.["$allowedComponents"]);
|
|
31742
|
+
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[name2]);
|
|
31743
|
+
const prevExists = currentSlots.has(name2);
|
|
31749
31744
|
if (!prevExists) {
|
|
31750
31745
|
if (nextAllowed.length > 0) {
|
|
31751
31746
|
lines.push({
|
|
31752
|
-
key: `slot-${
|
|
31747
|
+
key: `slot-${name2}-allow-new`,
|
|
31753
31748
|
color: PALETTE.success,
|
|
31754
|
-
text: `+ slot ${
|
|
31749
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
31755
31750
|
});
|
|
31756
31751
|
}
|
|
31757
31752
|
continue;
|
|
31758
31753
|
}
|
|
31759
31754
|
if (arraysEqual(prevAllowed, nextAllowed)) continue;
|
|
31760
31755
|
lines.push({
|
|
31761
|
-
key: `slot-${
|
|
31756
|
+
key: `slot-${name2}-allow-old`,
|
|
31762
31757
|
color: PALETTE.error,
|
|
31763
|
-
text: `- slot ${
|
|
31758
|
+
text: `- slot ${name2} allowedComponents: [${prevAllowed.join(", ")}]`
|
|
31764
31759
|
});
|
|
31765
31760
|
lines.push({
|
|
31766
|
-
key: `slot-${
|
|
31761
|
+
key: `slot-${name2}-allow-new`,
|
|
31767
31762
|
color: PALETTE.success,
|
|
31768
|
-
text: `+ slot ${
|
|
31763
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
31769
31764
|
});
|
|
31770
31765
|
}
|
|
31771
31766
|
return lines;
|
|
@@ -31801,7 +31796,7 @@ function normalizeType(type) {
|
|
|
31801
31796
|
return type.toLowerCase();
|
|
31802
31797
|
}
|
|
31803
31798
|
}
|
|
31804
|
-
function diffProperty(
|
|
31799
|
+
function diffProperty(name2, old, newDef) {
|
|
31805
31800
|
const diffs = [];
|
|
31806
31801
|
const newType = newDef["$type"] ?? "";
|
|
31807
31802
|
const newCategory = newDef["$category"] ?? "";
|
|
@@ -31812,15 +31807,15 @@ function diffProperty(name, old, newDef) {
|
|
|
31812
31807
|
const requiredChanged = old.required !== newRequired;
|
|
31813
31808
|
const defaultChanged = JSON.stringify(old.default) !== JSON.stringify(newDefault);
|
|
31814
31809
|
if (!typeChanged && !categoryChanged && !requiredChanged && !defaultChanged) return [];
|
|
31815
|
-
diffs.push({ key: `${
|
|
31816
|
-
diffs.push({ key: `${
|
|
31810
|
+
diffs.push({ key: `${name2}-old`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(old)}` });
|
|
31811
|
+
diffs.push({ key: `${name2}-new`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(newDef)}` });
|
|
31817
31812
|
return diffs;
|
|
31818
31813
|
}
|
|
31819
31814
|
function formatDefault(value) {
|
|
31820
31815
|
const sys = value?.sys;
|
|
31821
31816
|
if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
|
|
31822
|
-
const
|
|
31823
|
-
if (
|
|
31817
|
+
const name2 = sys.urn.split("/designTokens/")[1];
|
|
31818
|
+
if (name2) return name2;
|
|
31824
31819
|
}
|
|
31825
31820
|
return JSON.stringify(value);
|
|
31826
31821
|
}
|
|
@@ -31886,8 +31881,8 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31886
31881
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
31887
31882
|
});
|
|
31888
31883
|
for (const [index, item] of components.new.entries()) {
|
|
31889
|
-
const
|
|
31890
|
-
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${
|
|
31884
|
+
const name2 = item.key ?? item.$name ?? "unknown";
|
|
31885
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
31891
31886
|
}
|
|
31892
31887
|
}
|
|
31893
31888
|
if (components.changed.length > 0) {
|
|
@@ -31980,27 +31975,27 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
31980
31975
|
}
|
|
31981
31976
|
return void 0;
|
|
31982
31977
|
}
|
|
31983
|
-
function appendChangedPreviewLine(lines, keyPrefix,
|
|
31978
|
+
function appendChangedPreviewLine(lines, keyPrefix, name2, hasPendingDraftChanges, changeClassification) {
|
|
31984
31979
|
lines.push({
|
|
31985
|
-
key: `${keyPrefix}-h-${
|
|
31980
|
+
key: `${keyPrefix}-h-${name2}`,
|
|
31986
31981
|
color: PALETTE.warning,
|
|
31987
|
-
text: ` ~ ${
|
|
31982
|
+
text: ` ~ ${name2}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
31988
31983
|
});
|
|
31989
31984
|
if (changeClassification?.classification !== "breaking") return;
|
|
31990
31985
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
31991
|
-
lines.push({ key: `${keyPrefix}-b-${
|
|
31986
|
+
lines.push({ key: `${keyPrefix}-b-${name2}`, color: PALETTE.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
31992
31987
|
}
|
|
31993
31988
|
function buildPreviewDiffLines(preview) {
|
|
31994
31989
|
const lines = [];
|
|
31995
31990
|
const { components, tokens } = preview;
|
|
31996
31991
|
for (const item of components.new) {
|
|
31997
31992
|
const raw = item;
|
|
31998
|
-
const
|
|
31999
|
-
lines.push({ key: `comp-new-${
|
|
31993
|
+
const name2 = raw.key ?? raw.$name ?? "unknown";
|
|
31994
|
+
lines.push({ key: `comp-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
32000
31995
|
const slots = raw.$slots ?? {};
|
|
32001
31996
|
for (const slotName of Object.keys(slots).sort()) {
|
|
32002
31997
|
lines.push({
|
|
32003
|
-
key: `comp-new-${
|
|
31998
|
+
key: `comp-new-${name2}-slot-${slotName}`,
|
|
32004
31999
|
color: PALETTE.success,
|
|
32005
32000
|
text: ` slot: ${slotName}`
|
|
32006
32001
|
});
|
|
@@ -32008,7 +32003,7 @@ function buildPreviewDiffLines(preview) {
|
|
|
32008
32003
|
if (Array.isArray(allowed) && allowed.length > 0) {
|
|
32009
32004
|
const names = allowed.filter((n) => typeof n === "string");
|
|
32010
32005
|
lines.push({
|
|
32011
|
-
key: `comp-new-${
|
|
32006
|
+
key: `comp-new-${name2}-slot-${slotName}-allow`,
|
|
32012
32007
|
color: PALETTE.success,
|
|
32013
32008
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
32014
32009
|
});
|
|
@@ -32046,8 +32041,8 @@ function buildPreviewDiffLines(preview) {
|
|
|
32046
32041
|
}
|
|
32047
32042
|
for (const item of tokens.new) {
|
|
32048
32043
|
const raw = item;
|
|
32049
|
-
const
|
|
32050
|
-
lines.push({ key: `tok-new-${
|
|
32044
|
+
const name2 = raw.name ?? raw.path ?? "unknown";
|
|
32045
|
+
lines.push({ key: `tok-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
32051
32046
|
}
|
|
32052
32047
|
for (const item of tokens.removed) {
|
|
32053
32048
|
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
|
|
@@ -33355,7 +33350,7 @@ var init_PageContainer3 = __esm({
|
|
|
33355
33350
|
import { existsSync as existsSync11 } from "node:fs";
|
|
33356
33351
|
function diffSnapshots(before, after) {
|
|
33357
33352
|
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])];
|
|
33358
|
-
const changed_fields = names.filter((
|
|
33353
|
+
const changed_fields = names.filter((name2) => before[name2] !== after[name2]);
|
|
33359
33354
|
return { changed: changed_fields.length > 0, changed_fields };
|
|
33360
33355
|
}
|
|
33361
33356
|
function createTrail(limit = DEFAULT_TRAIL_LIMIT) {
|
|
@@ -33393,11 +33388,11 @@ var init_debug_trail = __esm({
|
|
|
33393
33388
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-status.ts
|
|
33394
33389
|
import { execFile as execFile2 } from "node:child_process";
|
|
33395
33390
|
import { access as access5, constants } from "node:fs/promises";
|
|
33396
|
-
function effectiveBinary(
|
|
33397
|
-
return savedBinary.trim() || AGENT_BINARIES[
|
|
33391
|
+
function effectiveBinary(name2, savedBinary) {
|
|
33392
|
+
return savedBinary.trim() || AGENT_BINARIES[name2];
|
|
33398
33393
|
}
|
|
33399
|
-
function defaultModelLabel(
|
|
33400
|
-
const model = DEFAULT_MODELS[
|
|
33394
|
+
function defaultModelLabel(name2) {
|
|
33395
|
+
const model = DEFAULT_MODELS[name2];
|
|
33401
33396
|
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
33402
33397
|
}
|
|
33403
33398
|
function resolveOnPath(binary) {
|
|
@@ -33424,32 +33419,32 @@ function readVersion(binary) {
|
|
|
33424
33419
|
});
|
|
33425
33420
|
});
|
|
33426
33421
|
}
|
|
33427
|
-
async function inspect(
|
|
33428
|
-
const target = effectiveBinary(
|
|
33422
|
+
async function inspect(name2, binary) {
|
|
33423
|
+
const target = effectiveBinary(name2, binary);
|
|
33429
33424
|
const found = await resolveOnPath(target);
|
|
33430
33425
|
if (!found) return { checks: [fail3("path", `\`${target}\` was not found or is not executable`)], found: null };
|
|
33431
33426
|
const checks = [pass("path", found)];
|
|
33432
33427
|
checks.push(await readVersion(found));
|
|
33433
|
-
if (
|
|
33434
|
-
const auth = await withBinaryEnv(
|
|
33428
|
+
if (name2 === "claude") {
|
|
33429
|
+
const auth = await withBinaryEnv(name2, found, () => checkAgentAuth(name2));
|
|
33435
33430
|
checks.push(
|
|
33436
33431
|
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
33437
33432
|
);
|
|
33438
33433
|
}
|
|
33439
33434
|
return { checks, found };
|
|
33440
33435
|
}
|
|
33441
|
-
async function inspectAgent(
|
|
33442
|
-
return (await inspect(
|
|
33436
|
+
async function inspectAgent(name2, binary) {
|
|
33437
|
+
return (await inspect(name2, binary)).checks;
|
|
33443
33438
|
}
|
|
33444
|
-
async function testAgent(
|
|
33445
|
-
const { checks, found } = await inspect(
|
|
33439
|
+
async function testAgent(name2, binary, model) {
|
|
33440
|
+
const { checks, found } = await inspect(name2, binary);
|
|
33446
33441
|
if (!found || !checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
33447
33442
|
const started = Date.now();
|
|
33448
33443
|
const result = await withBinaryEnv(
|
|
33449
|
-
|
|
33444
|
+
name2,
|
|
33450
33445
|
found,
|
|
33451
33446
|
() => createLocalCliAgentInvoker().invoke({
|
|
33452
|
-
agent:
|
|
33447
|
+
agent: name2,
|
|
33453
33448
|
...model.trim() ? { model: model.trim() } : {},
|
|
33454
33449
|
prompt: TEST_PROMPT,
|
|
33455
33450
|
timeoutMs: PROMPT_TIMEOUT_MS
|
|
@@ -33465,7 +33460,7 @@ async function testAgent(name, binary, model) {
|
|
|
33465
33460
|
}
|
|
33466
33461
|
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
33467
33462
|
}
|
|
33468
|
-
function statusFromChecks(
|
|
33463
|
+
function statusFromChecks(name2, checks, savedBinary) {
|
|
33469
33464
|
if (checks.length === 0) return "checking";
|
|
33470
33465
|
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
33471
33466
|
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
@@ -33477,13 +33472,13 @@ function statusFromChecks(name, checks, savedBinary) {
|
|
|
33477
33472
|
}
|
|
33478
33473
|
const login = checks.find((check) => check.step === "login");
|
|
33479
33474
|
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
33480
|
-
return
|
|
33475
|
+
return name2 === "claude" ? "ready" : "unknown";
|
|
33481
33476
|
}
|
|
33482
|
-
function setupHint(
|
|
33483
|
-
if (status === "not-configured") return `${INSTALL_HINTS[
|
|
33484
|
-
if (status === "not-found") return `${INSTALL_HINTS[
|
|
33485
|
-
if (status === "not-logged-in") return LOGIN_HINTS[
|
|
33486
|
-
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[
|
|
33477
|
+
function setupHint(name2, status) {
|
|
33478
|
+
if (status === "not-configured") return `${INSTALL_HINTS[name2]}, or set its command path in settings`;
|
|
33479
|
+
if (status === "not-found") return `${INSTALL_HINTS[name2]}, or correct the command path in settings`;
|
|
33480
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name2];
|
|
33481
|
+
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[name2]}`;
|
|
33487
33482
|
if (status === "timed-out") return "it may be slow or waiting for input; run the test again, or try it in a terminal";
|
|
33488
33483
|
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
33489
33484
|
return "";
|
|
@@ -33495,14 +33490,14 @@ function testOutcome(checks) {
|
|
|
33495
33490
|
if (prompt.timedOut) return { ok: false, text: `Test timed out: ${prompt.detail}` };
|
|
33496
33491
|
return { ok: false, text: `Test failed: ${prompt.detail}` };
|
|
33497
33492
|
}
|
|
33498
|
-
function modelLine(
|
|
33493
|
+
function modelLine(name2, savedModel) {
|
|
33499
33494
|
const model = savedModel.trim();
|
|
33500
|
-
return model ? model : `${defaultModelLabel(
|
|
33495
|
+
return model ? model : `${defaultModelLabel(name2)} (built-in default)`;
|
|
33501
33496
|
}
|
|
33502
|
-
function baseRows(
|
|
33497
|
+
function baseRows(name2, checks, savedBinary) {
|
|
33503
33498
|
const path5 = checks.find((check) => check.step === "path");
|
|
33504
33499
|
const version2 = checks.find((check) => check.step === "version");
|
|
33505
|
-
const hint = setupHint(
|
|
33500
|
+
const hint = setupHint(name2, statusFromChecks(name2, checks, savedBinary));
|
|
33506
33501
|
const setup = hint ? { label: "Setup", value: hint, tone: "muted" } : void 0;
|
|
33507
33502
|
if (!path5?.ok) {
|
|
33508
33503
|
const saved = savedBinary.trim() !== "";
|
|
@@ -33524,15 +33519,15 @@ function baseRows(name, checks, savedBinary) {
|
|
|
33524
33519
|
found: true
|
|
33525
33520
|
};
|
|
33526
33521
|
}
|
|
33527
|
-
function panelRows(
|
|
33522
|
+
function panelRows(name2, checks, settings) {
|
|
33528
33523
|
if (!checks) return checking;
|
|
33529
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
33530
|
-
const model = { label: "Model", value: modelLine(
|
|
33524
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, settings.binary);
|
|
33525
|
+
const model = { label: "Model", value: modelLine(name2, settings.model), tone: "muted" };
|
|
33531
33526
|
return [command, ...found ? [...version2?.tone === "ok" ? [version2] : [], model] : [], ...setup ? [setup] : []];
|
|
33532
33527
|
}
|
|
33533
|
-
function statusRows(
|
|
33528
|
+
function statusRows(name2, checks, savedBinary) {
|
|
33534
33529
|
if (!checks) return checking;
|
|
33535
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
33530
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, savedBinary);
|
|
33536
33531
|
if (!found) return [command];
|
|
33537
33532
|
const login = checks.find((check) => check.step === "login");
|
|
33538
33533
|
const prompt = checks.find((check) => check.step === "prompt");
|
|
@@ -33551,8 +33546,8 @@ function statusRows(name, checks, savedBinary) {
|
|
|
33551
33546
|
const testRow = prompt ? [{ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" }] : [];
|
|
33552
33547
|
return [command, ...version2 ? [version2] : [], loginRow, ...testRow, ...setup ? [setup] : []];
|
|
33553
33548
|
}
|
|
33554
|
-
async function withBinaryEnv(
|
|
33555
|
-
const key = `EDS_AGENT_BINARY_${
|
|
33549
|
+
async function withBinaryEnv(name2, binary, run) {
|
|
33550
|
+
const key = `EDS_AGENT_BINARY_${name2.toUpperCase()}`;
|
|
33556
33551
|
const previous = process.env[key];
|
|
33557
33552
|
process.env[key] = binary;
|
|
33558
33553
|
try {
|
|
@@ -33603,9 +33598,9 @@ var init_agent_status = __esm({
|
|
|
33603
33598
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-debug.ts
|
|
33604
33599
|
function agentSnapshot(config) {
|
|
33605
33600
|
const snapshot = { default_agent: config.defaultAgent };
|
|
33606
|
-
for (const
|
|
33607
|
-
snapshot[`${
|
|
33608
|
-
snapshot[`${
|
|
33601
|
+
for (const name2 of AGENT_NAMES) {
|
|
33602
|
+
snapshot[`${name2}.model`] = config.agents[name2].model;
|
|
33603
|
+
snapshot[`${name2}.binary`] = config.agents[name2].binary;
|
|
33609
33604
|
}
|
|
33610
33605
|
return snapshot;
|
|
33611
33606
|
}
|
|
@@ -33622,10 +33617,10 @@ function environmentFrom(checks, savedBinary, envValue) {
|
|
|
33622
33617
|
}
|
|
33623
33618
|
async function describeAgents(config) {
|
|
33624
33619
|
const entries = await Promise.all(
|
|
33625
|
-
AGENT_NAMES.map(async (
|
|
33626
|
-
const saved = config.agents[
|
|
33627
|
-
const checks = await inspectAgent(
|
|
33628
|
-
return [
|
|
33620
|
+
AGENT_NAMES.map(async (name2) => {
|
|
33621
|
+
const saved = config.agents[name2].binary;
|
|
33622
|
+
const checks = await inspectAgent(name2, saved);
|
|
33623
|
+
return [name2, environmentFrom(checks, saved, process.env[`EDS_AGENT_BINARY_${name2.toUpperCase()}`])];
|
|
33629
33624
|
})
|
|
33630
33625
|
);
|
|
33631
33626
|
return Object.fromEntries(entries);
|
|
@@ -33642,11 +33637,11 @@ var init_agent_debug = __esm({
|
|
|
33642
33637
|
import { Text as Text49 } from "ink";
|
|
33643
33638
|
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
33644
33639
|
function AgentStatusBadge({
|
|
33645
|
-
name,
|
|
33640
|
+
name: name2,
|
|
33646
33641
|
checks,
|
|
33647
33642
|
binary
|
|
33648
33643
|
}) {
|
|
33649
|
-
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(
|
|
33644
|
+
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name2, checks, binary) : "checking"];
|
|
33650
33645
|
return /* @__PURE__ */ jsx59(Text49, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
33651
33646
|
}
|
|
33652
33647
|
var TONE_COLOR;
|
|
@@ -33674,13 +33669,13 @@ function StatusHeading() {
|
|
|
33674
33669
|
] });
|
|
33675
33670
|
}
|
|
33676
33671
|
function AgentDetail({
|
|
33677
|
-
name,
|
|
33672
|
+
name: name2,
|
|
33678
33673
|
config,
|
|
33679
33674
|
setConfig,
|
|
33680
33675
|
onBack,
|
|
33681
33676
|
record: record3
|
|
33682
33677
|
}) {
|
|
33683
|
-
const settings = config.agents[
|
|
33678
|
+
const settings = config.agents[name2];
|
|
33684
33679
|
const [saving, setSaving] = useState33(false);
|
|
33685
33680
|
const [testing, setTesting] = useState33(false);
|
|
33686
33681
|
const [notice, setNotice] = useState33(null);
|
|
@@ -33689,38 +33684,38 @@ function AgentDetail({
|
|
|
33689
33684
|
let active = true;
|
|
33690
33685
|
setChecks(void 0);
|
|
33691
33686
|
const timer = setTimeout(() => {
|
|
33692
|
-
void inspectAgent(
|
|
33687
|
+
void inspectAgent(name2, settings.binary).then((result) => active && setChecks(result));
|
|
33693
33688
|
}, INSPECT_DELAY_MS);
|
|
33694
33689
|
return () => {
|
|
33695
33690
|
active = false;
|
|
33696
33691
|
clearTimeout(timer);
|
|
33697
33692
|
};
|
|
33698
|
-
}, [
|
|
33693
|
+
}, [name2, settings.binary]);
|
|
33699
33694
|
const save = () => {
|
|
33700
33695
|
setSaving(true);
|
|
33701
33696
|
setNotice(null);
|
|
33702
33697
|
writeAgentConfig(config).then(() => {
|
|
33703
33698
|
applyBinaryOverrides(config);
|
|
33704
|
-
record3(`saved ${
|
|
33705
|
-
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[
|
|
33699
|
+
record3(`saved ${name2}`);
|
|
33700
|
+
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[name2]} settings are written to config.json` });
|
|
33706
33701
|
}).catch((err) => {
|
|
33707
|
-
record3(`saving ${
|
|
33702
|
+
record3(`saving ${name2} failed`, err);
|
|
33708
33703
|
setNotice({ kind: "error", text: `Not saved: ${err instanceof Error ? err.message : String(err)}` });
|
|
33709
33704
|
}).finally(() => setSaving(false));
|
|
33710
33705
|
};
|
|
33711
33706
|
const runTest = () => {
|
|
33712
33707
|
setTesting(true);
|
|
33713
33708
|
setNotice(null);
|
|
33714
|
-
testAgent(
|
|
33709
|
+
testAgent(name2, settings.binary, settings.model).then((result) => {
|
|
33715
33710
|
setChecks(result);
|
|
33716
33711
|
const outcome = testOutcome(result);
|
|
33717
33712
|
if (!outcome || !outcome.ok)
|
|
33718
|
-
record3(`test of ${
|
|
33713
|
+
record3(`test of ${name2} failed: ${outcome?.text ?? "the agent could not be started"}`);
|
|
33719
33714
|
setNotice(
|
|
33720
33715
|
outcome ? { kind: outcome.ok ? "success" : "error", text: outcome.text } : { kind: "error", text: "Test not run: the agent could not be started (see Status)" }
|
|
33721
33716
|
);
|
|
33722
33717
|
}).catch((err) => {
|
|
33723
|
-
record3(`test of ${
|
|
33718
|
+
record3(`test of ${name2} could not run`, err);
|
|
33724
33719
|
setNotice({ kind: "error", text: `Test could not run: ${err instanceof Error ? err.message : String(err)}` });
|
|
33725
33720
|
}).finally(() => setTesting(false));
|
|
33726
33721
|
};
|
|
@@ -33731,19 +33726,19 @@ function AgentDetail({
|
|
|
33731
33726
|
hint: "run test",
|
|
33732
33727
|
onRun: runTest
|
|
33733
33728
|
};
|
|
33734
|
-
const formFields = fields(
|
|
33729
|
+
const formFields = fields(name2);
|
|
33735
33730
|
const labelWidth = formLabelWidth([...formFields, action]);
|
|
33736
33731
|
return /* @__PURE__ */ jsx60(
|
|
33737
33732
|
FieldForm,
|
|
33738
33733
|
{
|
|
33739
|
-
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[
|
|
33740
|
-
subtitle: config.defaultAgent ===
|
|
33734
|
+
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[name2]}`,
|
|
33735
|
+
subtitle: config.defaultAgent === name2 ? "This is the default agent." : `Runs the \`${AGENT_BINARIES[name2]}\` command.`,
|
|
33741
33736
|
fields: formFields,
|
|
33742
33737
|
values: { binary: settings.binary, model: settings.model },
|
|
33743
33738
|
onChange: (key, value) => {
|
|
33744
|
-
setConfig({ ...config, agents: { ...config.agents, [
|
|
33739
|
+
setConfig({ ...config, agents: { ...config.agents, [name2]: { ...settings, [key]: value } } });
|
|
33745
33740
|
setNotice(null);
|
|
33746
|
-
record3(`edited ${
|
|
33741
|
+
record3(`edited ${name2}.${key}`);
|
|
33747
33742
|
},
|
|
33748
33743
|
onSave: save,
|
|
33749
33744
|
onQuit: onBack,
|
|
@@ -33752,7 +33747,7 @@ function AgentDetail({
|
|
|
33752
33747
|
busy: saving || testing,
|
|
33753
33748
|
children: /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
33754
33749
|
/* @__PURE__ */ jsx60(StatusHeading, {}),
|
|
33755
|
-
statusRows(
|
|
33750
|
+
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))
|
|
33756
33751
|
] })
|
|
33757
33752
|
}
|
|
33758
33753
|
);
|
|
@@ -33768,9 +33763,9 @@ var init_AgentDetail = __esm({
|
|
|
33768
33763
|
init_agent_status();
|
|
33769
33764
|
init_AgentStatusBadge();
|
|
33770
33765
|
init_apply_binary_overrides();
|
|
33771
|
-
fields = (
|
|
33772
|
-
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[
|
|
33773
|
-
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(
|
|
33766
|
+
fields = (name2) => [
|
|
33767
|
+
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[name2]}\` from the PATH)` },
|
|
33768
|
+
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name2)})` }
|
|
33774
33769
|
];
|
|
33775
33770
|
INSPECT_DELAY_MS = 400;
|
|
33776
33771
|
}
|
|
@@ -33795,9 +33790,9 @@ function AgentsScreen({ onDone }) {
|
|
|
33795
33790
|
error: ""
|
|
33796
33791
|
}).current;
|
|
33797
33792
|
const inspectAll = (loaded) => {
|
|
33798
|
-
for (const
|
|
33799
|
-
void inspectAgent(
|
|
33800
|
-
(result) => setChecks((previous) => ({ ...previous, [
|
|
33793
|
+
for (const name2 of AGENT_NAMES) {
|
|
33794
|
+
void inspectAgent(name2, loaded.agents[name2].binary).then(
|
|
33795
|
+
(result) => setChecks((previous) => ({ ...previous, [name2]: result }))
|
|
33801
33796
|
);
|
|
33802
33797
|
}
|
|
33803
33798
|
};
|
|
@@ -33837,21 +33832,21 @@ function AgentsScreen({ onDone }) {
|
|
|
33837
33832
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
33838
33833
|
});
|
|
33839
33834
|
};
|
|
33840
|
-
const makeDefault = (
|
|
33835
|
+
const makeDefault = (name2) => {
|
|
33841
33836
|
if (!config || saving) return;
|
|
33842
|
-
if (
|
|
33843
|
-
setNotice({ kind: "success", text: `${AGENT_LABELS[
|
|
33837
|
+
if (name2 === config.defaultAgent) {
|
|
33838
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name2]} is already the default agent` });
|
|
33844
33839
|
return;
|
|
33845
33840
|
}
|
|
33846
33841
|
setSaving(true);
|
|
33847
33842
|
setNotice(null);
|
|
33848
|
-
writeAgentConfig({ ...config, defaultAgent:
|
|
33849
|
-
setConfig((current) => current ? { ...current, defaultAgent:
|
|
33850
|
-
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[
|
|
33851
|
-
visit.trail.record(`made ${
|
|
33843
|
+
writeAgentConfig({ ...config, defaultAgent: name2, defaultChosen: true }).then(() => {
|
|
33844
|
+
setConfig((current) => current ? { ...current, defaultAgent: name2, defaultChosen: true } : current);
|
|
33845
|
+
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name2]}` });
|
|
33846
|
+
visit.trail.record(`made ${name2} the default`);
|
|
33852
33847
|
}).catch((err) => {
|
|
33853
33848
|
visit.error = scrubError(err, []);
|
|
33854
|
-
visit.trail.record(`making ${
|
|
33849
|
+
visit.trail.record(`making ${name2} the default failed`);
|
|
33855
33850
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
33856
33851
|
}).finally(() => setSaving(false));
|
|
33857
33852
|
};
|
|
@@ -33938,14 +33933,14 @@ function AgentsScreen({ onDone }) {
|
|
|
33938
33933
|
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
33939
33934
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "STATUS" })
|
|
33940
33935
|
] }),
|
|
33941
|
-
AGENT_NAMES.map((
|
|
33942
|
-
const isFocused = focusedAgent ===
|
|
33936
|
+
AGENT_NAMES.map((name2) => {
|
|
33937
|
+
const isFocused = focusedAgent === name2;
|
|
33943
33938
|
return /* @__PURE__ */ jsxs49(Box49, { gap: 1, children: [
|
|
33944
33939
|
/* @__PURE__ */ jsx61(Text51, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
33945
|
-
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children:
|
|
33946
|
-
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[
|
|
33947
|
-
/* @__PURE__ */ jsx61(AgentStatusBadge, { name, checks: checks[
|
|
33948
|
-
] },
|
|
33940
|
+
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children: name2 === config.defaultAgent ? "\u2605" : " " }),
|
|
33941
|
+
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name2] }) }),
|
|
33942
|
+
/* @__PURE__ */ jsx61(AgentStatusBadge, { name: name2, checks: checks[name2], binary: config.agents[name2].binary })
|
|
33943
|
+
] }, name2);
|
|
33949
33944
|
}),
|
|
33950
33945
|
/* @__PURE__ */ jsxs49(Box49, { flexDirection: "column", marginTop: 1, children: [
|
|
33951
33946
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|