@contentful/experience-design-system-cli 2.40.1-dev-build-58bdf9b8.0 → 2.40.1-dev-build-1691fb91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +704 -767
- package/dist/index.js +748 -775
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/04-credentials/logic.d.ts +1 -23
- package/dist/src/tui/import/steps/04-credentials/screen.d.ts +1 -4
- package/dist/src/tui/settings/configuration/agents/agent-debug.d.ts +1 -1
- package/package.json +3 -3
- /package/dist/src/tui/{shared → settings/shared}/debug-trail.d.ts +0 -0
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) {
|
|
@@ -21077,45 +21077,6 @@ var init_FieldForm = __esm({
|
|
|
21077
21077
|
}
|
|
21078
21078
|
});
|
|
21079
21079
|
|
|
21080
|
-
// packages/experience-design-system-cli/src/tui/shared/debug-trail.ts
|
|
21081
|
-
import { existsSync as existsSync10 } from "node:fs";
|
|
21082
|
-
function diffSnapshots(before, after) {
|
|
21083
|
-
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])];
|
|
21084
|
-
const changed_fields = names.filter((name) => before[name] !== after[name]);
|
|
21085
|
-
return { changed: changed_fields.length > 0, changed_fields };
|
|
21086
|
-
}
|
|
21087
|
-
function createTrail(limit = DEFAULT_TRAIL_LIMIT) {
|
|
21088
|
-
const actions = [];
|
|
21089
|
-
return {
|
|
21090
|
-
record(action) {
|
|
21091
|
-
actions.push(action);
|
|
21092
|
-
if (actions.length > limit) actions.shift();
|
|
21093
|
-
},
|
|
21094
|
-
entries: () => [...actions]
|
|
21095
|
-
};
|
|
21096
|
-
}
|
|
21097
|
-
function scrubError(error, secrets) {
|
|
21098
|
-
let message = error instanceof Error ? error.message : String(error);
|
|
21099
|
-
for (const secret of secrets) {
|
|
21100
|
-
if (secret.length < MIN_SECRET_LENGTH) continue;
|
|
21101
|
-
for (const form of /* @__PURE__ */ new Set([secret, encodeURIComponent(secret)])) message = message.split(form).join("[redacted]");
|
|
21102
|
-
}
|
|
21103
|
-
return message;
|
|
21104
|
-
}
|
|
21105
|
-
function describeSettingsFile() {
|
|
21106
|
-
const path5 = configFilePath2();
|
|
21107
|
-
return { path: path5, eds_home_set: Boolean(process.env["EDS_HOME"]), exists: existsSync10(path5) };
|
|
21108
|
-
}
|
|
21109
|
-
var DEFAULT_TRAIL_LIMIT, MIN_SECRET_LENGTH;
|
|
21110
|
-
var init_debug_trail = __esm({
|
|
21111
|
-
"packages/experience-design-system-cli/src/tui/shared/debug-trail.ts"() {
|
|
21112
|
-
"use strict";
|
|
21113
|
-
init_config();
|
|
21114
|
-
DEFAULT_TRAIL_LIMIT = 30;
|
|
21115
|
-
MIN_SECRET_LENGTH = 6;
|
|
21116
|
-
}
|
|
21117
|
-
});
|
|
21118
|
-
|
|
21119
21080
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/logic.ts
|
|
21120
21081
|
function credentialsPurpose(tokensOnly) {
|
|
21121
21082
|
const use = tokensOnly ? "We use it to push your design tokens" : "We use it to check what components already exist and to push your import";
|
|
@@ -21129,42 +21090,17 @@ function normalize(values) {
|
|
|
21129
21090
|
host: toConfiguredHost2(values.host) ?? DEFAULT_CONFIGURED_HOST
|
|
21130
21091
|
};
|
|
21131
21092
|
}
|
|
21132
|
-
function
|
|
21133
|
-
return
|
|
21093
|
+
function missingField(values) {
|
|
21094
|
+
return values.spaceId === "" || values.environmentId === "" || values.cmaToken === "";
|
|
21134
21095
|
}
|
|
21135
21096
|
function isUnchanged(current, initial) {
|
|
21136
21097
|
return FIELDS.every((field) => current[field] === initial[field]);
|
|
21137
21098
|
}
|
|
21138
|
-
function rejectedAttempt(reason, credentials) {
|
|
21139
|
-
return { host: credentials.host, reason: scrubError(reason, [credentials.cmaToken]) };
|
|
21140
|
-
}
|
|
21141
|
-
function credentialsLog(credentials) {
|
|
21142
|
-
return {
|
|
21143
|
-
space_id: credentials.spaceId,
|
|
21144
|
-
environment_id: credentials.environmentId,
|
|
21145
|
-
host: credentials.host,
|
|
21146
|
-
cma_token: credentials.cmaToken
|
|
21147
|
-
};
|
|
21148
|
-
}
|
|
21149
|
-
function credentialsOutputs({
|
|
21150
|
-
outcome,
|
|
21151
|
-
credentials,
|
|
21152
|
-
initial,
|
|
21153
|
-
attempts
|
|
21154
|
-
}) {
|
|
21155
|
-
return {
|
|
21156
|
-
outcome,
|
|
21157
|
-
...credentialsLog(credentials),
|
|
21158
|
-
changed_fields: diffSnapshots(initial, credentials).changed_fields,
|
|
21159
|
-
rejected_attempts: attempts
|
|
21160
|
-
};
|
|
21161
|
-
}
|
|
21162
21099
|
var FIELDS;
|
|
21163
21100
|
var init_logic8 = __esm({
|
|
21164
21101
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/logic.ts"() {
|
|
21165
21102
|
"use strict";
|
|
21166
21103
|
init_src3();
|
|
21167
|
-
init_debug_trail();
|
|
21168
21104
|
FIELDS = ["spaceId", "environmentId", "cmaToken", "host"];
|
|
21169
21105
|
}
|
|
21170
21106
|
});
|
|
@@ -21217,11 +21153,10 @@ var init_validate4 = __esm({
|
|
|
21217
21153
|
});
|
|
21218
21154
|
|
|
21219
21155
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
21220
|
-
import {
|
|
21156
|
+
import { useRef as useRef5, useState as useState9 } from "react";
|
|
21221
21157
|
import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
|
|
21222
21158
|
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
21223
21159
|
function CredentialsScreen({
|
|
21224
|
-
mode,
|
|
21225
21160
|
onDone,
|
|
21226
21161
|
onBack,
|
|
21227
21162
|
initial = {},
|
|
@@ -21244,64 +21179,17 @@ function CredentialsScreen({
|
|
|
21244
21179
|
const [focus, setFocus] = useState9(0);
|
|
21245
21180
|
const [active, setActive] = useState9(0);
|
|
21246
21181
|
const [beforeEdit, setBeforeEdit] = useState9(initialValues);
|
|
21247
|
-
const visit = useRef5({ attempts: [], lastReason: "" }).current;
|
|
21248
|
-
useEffect8(() => {
|
|
21249
|
-
startDebugRun({
|
|
21250
|
-
flow: "import/credentials",
|
|
21251
|
-
step: "04-credentials",
|
|
21252
|
-
menuOption: "Credentials",
|
|
21253
|
-
inputs: { import_mode: mode, prefilled, ...credentialsLog(initialValues) }
|
|
21254
|
-
});
|
|
21255
|
-
}, []);
|
|
21256
|
-
const reject = (attempt, text) => {
|
|
21257
|
-
if (visit.attempts.length < MAX_LOGGED_ATTEMPTS2) visit.attempts.push(attempt);
|
|
21258
|
-
visit.lastReason = attempt.reason;
|
|
21259
|
-
setNotice({ kind: "error", text });
|
|
21260
|
-
};
|
|
21261
|
-
const leave = () => {
|
|
21262
|
-
void finishDebugRun({
|
|
21263
|
-
outputs: {
|
|
21264
|
-
...credentialsOutputs({
|
|
21265
|
-
outcome: "back",
|
|
21266
|
-
credentials: normalize(values),
|
|
21267
|
-
initial: initialValues,
|
|
21268
|
-
attempts: visit.attempts
|
|
21269
|
-
}),
|
|
21270
|
-
...notice ? { error: visit.lastReason } : {}
|
|
21271
|
-
},
|
|
21272
|
-
status: notice ? "error" : "success",
|
|
21273
|
-
exitMethod: "discarded"
|
|
21274
|
-
});
|
|
21275
|
-
onBack();
|
|
21276
|
-
};
|
|
21277
21182
|
const submit = async () => {
|
|
21278
21183
|
const credentials = normalize(values);
|
|
21279
|
-
|
|
21280
|
-
|
|
21281
|
-
reject(
|
|
21282
|
-
rejectedAttempt(`Missing required fields: ${missing.join(", ")}`, credentials),
|
|
21283
|
-
"Space ID, environment and CMA token are all required."
|
|
21284
|
-
);
|
|
21184
|
+
if (missingField(credentials)) {
|
|
21185
|
+
setNotice({ kind: "error", text: "Space ID, environment and CMA token are all required." });
|
|
21285
21186
|
return;
|
|
21286
21187
|
}
|
|
21287
21188
|
setValidating(true);
|
|
21288
21189
|
const result = await validate3(credentials);
|
|
21289
21190
|
setValidating(false);
|
|
21290
|
-
if (
|
|
21291
|
-
|
|
21292
|
-
return;
|
|
21293
|
-
}
|
|
21294
|
-
void finishDebugRun({
|
|
21295
|
-
outputs: credentialsOutputs({
|
|
21296
|
-
outcome: "validated",
|
|
21297
|
-
credentials,
|
|
21298
|
-
initial: initialValues,
|
|
21299
|
-
attempts: visit.attempts
|
|
21300
|
-
}),
|
|
21301
|
-
status: "success",
|
|
21302
|
-
exitMethod: "saved"
|
|
21303
|
-
});
|
|
21304
|
-
onDone({ skipped: false, credentials });
|
|
21191
|
+
if (result.ok) onDone({ skipped: false, credentials });
|
|
21192
|
+
else setNotice({ kind: "error", text: result.error });
|
|
21305
21193
|
};
|
|
21306
21194
|
const choose = (choice) => {
|
|
21307
21195
|
if (choice === "continue") void submit();
|
|
@@ -21310,7 +21198,7 @@ function CredentialsScreen({
|
|
|
21310
21198
|
setBeforeEdit(values);
|
|
21311
21199
|
setActive(0);
|
|
21312
21200
|
setEditing(true);
|
|
21313
|
-
} else
|
|
21201
|
+
} else onBack();
|
|
21314
21202
|
};
|
|
21315
21203
|
const stopEditing = () => {
|
|
21316
21204
|
setEditing(false);
|
|
@@ -21320,7 +21208,7 @@ function CredentialsScreen({
|
|
|
21320
21208
|
if (validating) return;
|
|
21321
21209
|
if (editing) {
|
|
21322
21210
|
if (key.escape) {
|
|
21323
|
-
if (!prefilled)
|
|
21211
|
+
if (!prefilled) onBack();
|
|
21324
21212
|
else {
|
|
21325
21213
|
setValues(beforeEdit);
|
|
21326
21214
|
setNotice(null);
|
|
@@ -21426,12 +21314,11 @@ function CredentialsScreen({
|
|
|
21426
21314
|
] })
|
|
21427
21315
|
] });
|
|
21428
21316
|
}
|
|
21429
|
-
var FIELDS2, MENU
|
|
21317
|
+
var FIELDS2, MENU;
|
|
21430
21318
|
var init_screen5 = __esm({
|
|
21431
21319
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx"() {
|
|
21432
21320
|
"use strict";
|
|
21433
21321
|
init_theme();
|
|
21434
|
-
init_debug_store();
|
|
21435
21322
|
init_FieldForm();
|
|
21436
21323
|
init_ClearableTextInput();
|
|
21437
21324
|
init_ControlHints();
|
|
@@ -21448,7 +21335,6 @@ var init_screen5 = __esm({
|
|
|
21448
21335
|
{ choice: "continue", label: "Continue", description: "Check the credentials and go on" },
|
|
21449
21336
|
{ choice: "edit", label: "Edit", description: "Change the credentials" }
|
|
21450
21337
|
];
|
|
21451
|
-
MAX_LOGGED_ATTEMPTS2 = 10;
|
|
21452
21338
|
}
|
|
21453
21339
|
});
|
|
21454
21340
|
|
|
@@ -21725,7 +21611,7 @@ var init_steps = __esm({
|
|
|
21725
21611
|
});
|
|
21726
21612
|
|
|
21727
21613
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
|
|
21728
|
-
import { existsSync as
|
|
21614
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
21729
21615
|
import { dirname as dirname16, join as join20, resolve as resolve22 } from "node:path";
|
|
21730
21616
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
21731
21617
|
function findSkillPath(fileName) {
|
|
@@ -21733,7 +21619,7 @@ function findSkillPath(fileName) {
|
|
|
21733
21619
|
let dir = thisDir;
|
|
21734
21620
|
for (; ; ) {
|
|
21735
21621
|
const candidate = join20(dir, "skills", fileName);
|
|
21736
|
-
if (
|
|
21622
|
+
if (existsSync10(candidate)) return candidate;
|
|
21737
21623
|
const parent = resolve22(dir, "..");
|
|
21738
21624
|
if (parent === dir) {
|
|
21739
21625
|
throw new Error(`skill file not found (looked for skills/${fileName} from ${thisDir})`);
|
|
@@ -21997,11 +21883,11 @@ var init_run = __esm({
|
|
|
21997
21883
|
});
|
|
21998
21884
|
|
|
21999
21885
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
|
|
22000
|
-
import { useEffect as
|
|
21886
|
+
import { useEffect as useEffect8, useRef as useRef6, useState as useState11 } from "react";
|
|
22001
21887
|
function useExtraction(input) {
|
|
22002
21888
|
const [state2, setState] = useState11();
|
|
22003
21889
|
const current = useRef6();
|
|
22004
|
-
|
|
21890
|
+
useEffect8(() => {
|
|
22005
21891
|
current.current = input;
|
|
22006
21892
|
if (!input) {
|
|
22007
21893
|
setState(void 0);
|
|
@@ -22072,11 +21958,11 @@ var init_run_tokens_only = __esm({
|
|
|
22072
21958
|
});
|
|
22073
21959
|
|
|
22074
21960
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
|
|
22075
|
-
import { useEffect as
|
|
21961
|
+
import { useEffect as useEffect9, useRef as useRef7, useState as useState12 } from "react";
|
|
22076
21962
|
function useTokensOnly(input) {
|
|
22077
21963
|
const [state2, setState] = useState12();
|
|
22078
21964
|
const current = useRef7();
|
|
22079
|
-
|
|
21965
|
+
useEffect9(() => {
|
|
22080
21966
|
current.current = input;
|
|
22081
21967
|
if (!input) {
|
|
22082
21968
|
setState(void 0);
|
|
@@ -22633,7 +22519,7 @@ function collectDependents(components) {
|
|
|
22633
22519
|
function findRoots(components, selected) {
|
|
22634
22520
|
const scope = selected ? components.filter((c2) => selected.has(c2.name)) : components;
|
|
22635
22521
|
const dependents = collectDependents(scope);
|
|
22636
|
-
return scope.map((c2) => c2.name).filter((
|
|
22522
|
+
return scope.map((c2) => c2.name).filter((name2) => !dependents.has(name2)).sort();
|
|
22637
22523
|
}
|
|
22638
22524
|
function findCycleInClosure(root, reachable, components) {
|
|
22639
22525
|
const scopedComponents = components.filter((c2) => reachable.has(c2.name)).map((c2) => ({ name: c2.name, slots: c2.slots }));
|
|
@@ -22669,9 +22555,9 @@ function computeClosure(root, components) {
|
|
|
22669
22555
|
const reachable = walkReachable2(root, byName, known);
|
|
22670
22556
|
const cyclePath = findCycleInClosure(root, reachable, components);
|
|
22671
22557
|
if (cyclePath) {
|
|
22672
|
-
const nodes2 = [...reachable].sort().map((
|
|
22673
|
-
name,
|
|
22674
|
-
depth:
|
|
22558
|
+
const nodes2 = [...reachable].sort().map((name2) => ({
|
|
22559
|
+
name: name2,
|
|
22560
|
+
depth: name2 === root ? 0 : 1,
|
|
22675
22561
|
path: [root],
|
|
22676
22562
|
parents: []
|
|
22677
22563
|
}));
|
|
@@ -22707,12 +22593,12 @@ function computeClosure(root, components) {
|
|
|
22707
22593
|
}
|
|
22708
22594
|
}
|
|
22709
22595
|
const nodes = [];
|
|
22710
|
-
for (const [
|
|
22596
|
+
for (const [name2, d] of depth.entries()) {
|
|
22711
22597
|
nodes.push({
|
|
22712
|
-
name,
|
|
22598
|
+
name: name2,
|
|
22713
22599
|
depth: d,
|
|
22714
|
-
path: parentPath.get(
|
|
22715
|
-
parents: [...parents.get(
|
|
22600
|
+
path: parentPath.get(name2),
|
|
22601
|
+
parents: [...parents.get(name2) ?? /* @__PURE__ */ new Set()].sort()
|
|
22716
22602
|
});
|
|
22717
22603
|
}
|
|
22718
22604
|
nodes.sort((a, b) => a.depth - b.depth || a.name.localeCompare(b.name));
|
|
@@ -22735,8 +22621,8 @@ function findSharedDeps(closures) {
|
|
|
22735
22621
|
}
|
|
22736
22622
|
}
|
|
22737
22623
|
const out = /* @__PURE__ */ new Map();
|
|
22738
|
-
for (const [
|
|
22739
|
-
if (roots.length >= 2) out.set(
|
|
22624
|
+
for (const [name2, roots] of counts.entries()) {
|
|
22625
|
+
if (roots.length >= 2) out.set(name2, [...roots].sort());
|
|
22740
22626
|
}
|
|
22741
22627
|
return out;
|
|
22742
22628
|
}
|
|
@@ -22947,13 +22833,13 @@ function buildVisibleRows(props) {
|
|
|
22947
22833
|
...findRoots(subgraph),
|
|
22948
22834
|
...subgraph.filter((n) => hasDirectChild(n)).map((n) => n.name)
|
|
22949
22835
|
]);
|
|
22950
|
-
for (const
|
|
22951
|
-
const full = computeClosure(
|
|
22952
|
-
closures.set(
|
|
22836
|
+
for (const name2 of [...parentNames].sort()) {
|
|
22837
|
+
const full = computeClosure(name2, subgraph);
|
|
22838
|
+
closures.set(name2, { ...full, nodes: full.nodes.filter((n) => n.depth <= 1) });
|
|
22953
22839
|
}
|
|
22954
22840
|
const sharedDeps = findSharedDeps(closures);
|
|
22955
|
-
const hasCycleDepDirect = (
|
|
22956
|
-
const it = itemByKey.get(
|
|
22841
|
+
const hasCycleDepDirect = (name2) => {
|
|
22842
|
+
const it = itemByKey.get(name2)?.it;
|
|
22957
22843
|
if (!it) return false;
|
|
22958
22844
|
for (const target of allowedComponentNames(it.entry)) {
|
|
22959
22845
|
if (cycleParticipants.has(target)) return true;
|
|
@@ -23058,28 +22944,28 @@ function buildVisibleRows(props) {
|
|
|
23058
22944
|
});
|
|
23059
22945
|
});
|
|
23060
22946
|
}
|
|
23061
|
-
for (const
|
|
23062
|
-
const rec = itemByKey.get(
|
|
22947
|
+
for (const name2 of standaloneRoots) {
|
|
22948
|
+
const rec = itemByKey.get(name2);
|
|
23063
22949
|
if (!rec) continue;
|
|
23064
22950
|
rows.push({
|
|
23065
22951
|
kind: "standalone",
|
|
23066
|
-
key: `stand:${
|
|
23067
|
-
label:
|
|
22952
|
+
key: `stand:${name2}`,
|
|
22953
|
+
label: name2,
|
|
23068
22954
|
indent: 0,
|
|
23069
22955
|
itemIdx: rec.idx
|
|
23070
22956
|
});
|
|
23071
22957
|
}
|
|
23072
22958
|
const nodeByName = new Map(subgraph.map((n) => [n.name, n]));
|
|
23073
|
-
const sharedLeafNames = [...sharedDeps.keys()].filter((
|
|
22959
|
+
const sharedLeafNames = [...sharedDeps.keys()].filter((name2) => (nodeByName.get(name2)?.slots.length ?? 0) === 0).sort();
|
|
23074
22960
|
const seenStandaloneNames = new Set(standaloneRoots);
|
|
23075
|
-
for (const
|
|
23076
|
-
if (seenStandaloneNames.has(
|
|
23077
|
-
const rec = itemByKey.get(
|
|
22961
|
+
for (const name2 of sharedLeafNames) {
|
|
22962
|
+
if (seenStandaloneNames.has(name2)) continue;
|
|
22963
|
+
const rec = itemByKey.get(name2);
|
|
23078
22964
|
if (!rec) continue;
|
|
23079
22965
|
rows.push({
|
|
23080
22966
|
kind: "standalone",
|
|
23081
|
-
key: `shared-standalone:${
|
|
23082
|
-
label: `${
|
|
22967
|
+
key: `shared-standalone:${name2}`,
|
|
22968
|
+
label: `${name2} (shared)`,
|
|
23083
22969
|
indent: 0,
|
|
23084
22970
|
sharedSuffix: true,
|
|
23085
22971
|
itemIdx: rec.idx
|
|
@@ -23095,13 +22981,13 @@ function buildVisibleRows(props) {
|
|
|
23095
22981
|
indent: 0,
|
|
23096
22982
|
itemIdx: -1
|
|
23097
22983
|
});
|
|
23098
|
-
for (const
|
|
23099
|
-
const rec = itemByKey.get(
|
|
22984
|
+
for (const name2 of flatNames) {
|
|
22985
|
+
const rec = itemByKey.get(name2);
|
|
23100
22986
|
if (!rec) continue;
|
|
23101
22987
|
rows.push({
|
|
23102
22988
|
kind: "flat",
|
|
23103
|
-
key: `flat:${
|
|
23104
|
-
label:
|
|
22989
|
+
key: `flat:${name2}`,
|
|
22990
|
+
label: name2,
|
|
23105
22991
|
indent: 0,
|
|
23106
22992
|
itemIdx: rec.idx
|
|
23107
22993
|
});
|
|
@@ -23111,9 +22997,9 @@ function buildVisibleRows(props) {
|
|
|
23111
22997
|
if (filterVisibleKeys !== void 0) {
|
|
23112
22998
|
return rows.filter((row) => {
|
|
23113
22999
|
if (row.itemIdx < 0) return true;
|
|
23114
|
-
const
|
|
23115
|
-
if (
|
|
23116
|
-
return filterVisibleKeys.has(
|
|
23000
|
+
const name2 = items[row.itemIdx]?.key;
|
|
23001
|
+
if (name2 === void 0) return true;
|
|
23002
|
+
return filterVisibleKeys.has(name2);
|
|
23117
23003
|
});
|
|
23118
23004
|
}
|
|
23119
23005
|
return rows;
|
|
@@ -23353,7 +23239,7 @@ var init_useImmediateInput = __esm({
|
|
|
23353
23239
|
|
|
23354
23240
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.ts
|
|
23355
23241
|
import { useStdout as useStdout2 } from "ink";
|
|
23356
|
-
import { useEffect as
|
|
23242
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
23357
23243
|
function readTerminalSize(stdout) {
|
|
23358
23244
|
return {
|
|
23359
23245
|
columns: stdout?.columns ?? 80,
|
|
@@ -23363,7 +23249,7 @@ function readTerminalSize(stdout) {
|
|
|
23363
23249
|
function useTerminalSize() {
|
|
23364
23250
|
const { stdout } = useStdout2();
|
|
23365
23251
|
const [size, setSize] = useState13(() => readTerminalSize(stdout));
|
|
23366
|
-
|
|
23252
|
+
useEffect10(() => {
|
|
23367
23253
|
const updateSize = () => setSize(readTerminalSize(stdout));
|
|
23368
23254
|
stdout?.on("resize", updateSize);
|
|
23369
23255
|
updateSize();
|
|
@@ -23835,11 +23721,11 @@ function computeCycleAwareAcceptCascade(target, components, cycleUnits) {
|
|
|
23835
23721
|
const byName = new Map(components.map((c2) => [c2.name, c2]));
|
|
23836
23722
|
const visited = /* @__PURE__ */ new Set();
|
|
23837
23723
|
const queue = [];
|
|
23838
|
-
const enqueue = (
|
|
23839
|
-
if (visited.has(
|
|
23840
|
-
visited.add(
|
|
23841
|
-
queue.push(
|
|
23842
|
-
const unit = cycleUnits.get(
|
|
23724
|
+
const enqueue = (name2) => {
|
|
23725
|
+
if (visited.has(name2)) return;
|
|
23726
|
+
visited.add(name2);
|
|
23727
|
+
queue.push(name2);
|
|
23728
|
+
const unit = cycleUnits.get(name2);
|
|
23843
23729
|
if (unit) {
|
|
23844
23730
|
for (const member of unit) {
|
|
23845
23731
|
if (!visited.has(member)) {
|
|
@@ -23976,7 +23862,7 @@ function buildScopeGraph(components) {
|
|
|
23976
23862
|
cycles = [];
|
|
23977
23863
|
}
|
|
23978
23864
|
const cycleParticipants = /* @__PURE__ */ new Set();
|
|
23979
|
-
for (const cycle of cycles) for (const
|
|
23865
|
+
for (const cycle of cycles) for (const name2 of cycle.path) cycleParticipants.add(name2);
|
|
23980
23866
|
return {
|
|
23981
23867
|
nodes,
|
|
23982
23868
|
cycles,
|
|
@@ -24201,10 +24087,10 @@ var init_lineage_layout = __esm({
|
|
|
24201
24087
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/sidebar-navigation.ts
|
|
24202
24088
|
function collectExpandedGroupRoots(closures, cycleParticipants) {
|
|
24203
24089
|
const roots = /* @__PURE__ */ new Set();
|
|
24204
|
-
for (const [
|
|
24205
|
-
if (closure.nodes.length > 1) roots.add(
|
|
24090
|
+
for (const [name2, closure] of closures.entries()) {
|
|
24091
|
+
if (closure.nodes.length > 1) roots.add(name2);
|
|
24206
24092
|
}
|
|
24207
|
-
for (const
|
|
24093
|
+
for (const name2 of cycleParticipants) roots.add(name2);
|
|
24208
24094
|
return roots;
|
|
24209
24095
|
}
|
|
24210
24096
|
function computeSidebarViewToggle({
|
|
@@ -24276,9 +24162,9 @@ function buildFlatDimPredicate(input) {
|
|
|
24276
24162
|
const isFlat = input.viewMode === "flat";
|
|
24277
24163
|
const keys = isFlat ? input.filterVisibleKeys : void 0;
|
|
24278
24164
|
if (!hasSearch && keys === void 0) return void 0;
|
|
24279
|
-
return (
|
|
24280
|
-
if (hasSearch && !fuzzyMatches(input.searchQuery,
|
|
24281
|
-
if (keys !== void 0 && !keys.has(
|
|
24165
|
+
return (name2) => {
|
|
24166
|
+
if (hasSearch && !fuzzyMatches(input.searchQuery, name2)) return true;
|
|
24167
|
+
if (keys !== void 0 && !keys.has(name2)) return true;
|
|
24282
24168
|
return false;
|
|
24283
24169
|
};
|
|
24284
24170
|
}
|
|
@@ -24298,7 +24184,7 @@ var init_step_filters = __esm({
|
|
|
24298
24184
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/state.ts
|
|
24299
24185
|
function apply(state2, entries) {
|
|
24300
24186
|
const next = new Map(state2);
|
|
24301
|
-
for (const [
|
|
24187
|
+
for (const [name2, decision] of entries) next.set(name2, decision);
|
|
24302
24188
|
return next;
|
|
24303
24189
|
}
|
|
24304
24190
|
function reduceDecisions(state2, action, components, graph) {
|
|
@@ -24307,44 +24193,44 @@ function reduceDecisions(state2, action, components, graph) {
|
|
|
24307
24193
|
if (state2.get(action.name) === "accepted") return state2;
|
|
24308
24194
|
return apply(
|
|
24309
24195
|
state2,
|
|
24310
|
-
acceptCascade(graph, action.name).map((
|
|
24196
|
+
acceptCascade(graph, action.name).map((name2) => [name2, "accepted"])
|
|
24311
24197
|
);
|
|
24312
24198
|
}
|
|
24313
24199
|
case "reject": {
|
|
24314
24200
|
if (state2.get(action.name) === "rejected") return state2;
|
|
24315
24201
|
const { toReject, toDeselect } = rejectCascade(graph, action.name);
|
|
24316
24202
|
return apply(state2, [
|
|
24317
|
-
...toReject.map((
|
|
24318
|
-
...toDeselect.map((
|
|
24203
|
+
...toReject.map((name2) => [name2, "rejected"]),
|
|
24204
|
+
...toDeselect.map((name2) => [name2, "undecided"])
|
|
24319
24205
|
]);
|
|
24320
24206
|
}
|
|
24321
24207
|
case "toggle-all": {
|
|
24322
24208
|
const nonCycle = components.filter((c2) => !graph.cycleParticipants.has(c2.name)).map((c2) => c2.name);
|
|
24323
|
-
const anyNotAccepted = nonCycle.some((
|
|
24209
|
+
const anyNotAccepted = nonCycle.some((name2) => state2.get(name2) !== "accepted");
|
|
24324
24210
|
if (anyNotAccepted) {
|
|
24325
24211
|
return apply(state2, [
|
|
24326
|
-
...nonCycle.map((
|
|
24327
|
-
...reachableCycleMembers(graph, nonCycle).map((
|
|
24212
|
+
...nonCycle.map((name2) => [name2, "accepted"]),
|
|
24213
|
+
...reachableCycleMembers(graph, nonCycle).map((name2) => [name2, "accepted"])
|
|
24328
24214
|
]);
|
|
24329
24215
|
}
|
|
24330
24216
|
return apply(state2, [
|
|
24331
|
-
...nonCycle.map((
|
|
24217
|
+
...nonCycle.map((name2) => [name2, "rejected"]),
|
|
24332
24218
|
...components.filter((c2) => graph.cycleParticipants.has(c2.name) && state2.get(c2.name) === "accepted").map((c2) => [c2.name, "undecided"])
|
|
24333
24219
|
]);
|
|
24334
24220
|
}
|
|
24335
24221
|
case "accept-unflagged": {
|
|
24336
24222
|
const seeds = components.filter((c2) => !graph.cycleParticipants.has(c2.name) && !isAiFlagged(c2)).map((c2) => c2.name);
|
|
24337
24223
|
return apply(state2, [
|
|
24338
|
-
...seeds.map((
|
|
24339
|
-
...reachableCycleMembers(graph, seeds).map((
|
|
24224
|
+
...seeds.map((name2) => [name2, "accepted"]),
|
|
24225
|
+
...reachableCycleMembers(graph, seeds).map((name2) => [name2, "accepted"])
|
|
24340
24226
|
]);
|
|
24341
24227
|
}
|
|
24342
24228
|
}
|
|
24343
24229
|
}
|
|
24344
|
-
function rejectNeedsConfirmation(graph,
|
|
24345
|
-
if (state2.get(
|
|
24346
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
24347
|
-
const ancestors = toReject.filter((n) => n !==
|
|
24230
|
+
function rejectNeedsConfirmation(graph, name2, state2) {
|
|
24231
|
+
if (state2.get(name2) === "rejected") return false;
|
|
24232
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
24233
|
+
const ancestors = toReject.filter((n) => n !== name2);
|
|
24348
24234
|
return ancestors.length + toDeselect.length >= 2;
|
|
24349
24235
|
}
|
|
24350
24236
|
function partitionDecisions(components, state2) {
|
|
@@ -24365,7 +24251,7 @@ var init_state = __esm({
|
|
|
24365
24251
|
});
|
|
24366
24252
|
|
|
24367
24253
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
|
|
24368
|
-
import { useEffect as
|
|
24254
|
+
import { useEffect as useEffect11, useMemo as useMemo3, useRef as useRef9, useState as useState16 } from "react";
|
|
24369
24255
|
function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }) {
|
|
24370
24256
|
const { columns: totalWidth, rows: terminalRows } = useTerminalSize();
|
|
24371
24257
|
const columnPlan = useMemo3(
|
|
@@ -24412,7 +24298,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24412
24298
|
return seed;
|
|
24413
24299
|
});
|
|
24414
24300
|
const seededGroupsRef = useRef9(closures.size > 0 || cycleParticipants.size > 0);
|
|
24415
|
-
|
|
24301
|
+
useEffect11(() => {
|
|
24416
24302
|
if (seededGroupsRef.current) return;
|
|
24417
24303
|
if (closures.size === 0 && cycleParticipants.size === 0) return;
|
|
24418
24304
|
seededGroupsRef.current = true;
|
|
@@ -24442,8 +24328,8 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24442
24328
|
for (const node of closure.nodes) keys.add(node.name);
|
|
24443
24329
|
}
|
|
24444
24330
|
for (const unit of cycleUnits.values()) {
|
|
24445
|
-
if (![...unit].some((
|
|
24446
|
-
for (const
|
|
24331
|
+
if (![...unit].some((name2) => decisions.get(name2) === "accepted")) continue;
|
|
24332
|
+
for (const name2 of unit) keys.add(name2);
|
|
24447
24333
|
}
|
|
24448
24334
|
return keys;
|
|
24449
24335
|
}, [closures, cycleUnits, showDependencies, decisions]);
|
|
@@ -24503,7 +24389,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24503
24389
|
entryCount: 0
|
|
24504
24390
|
});
|
|
24505
24391
|
const panelLayout = useMemo3(() => computePanelLayout(visibleCount), [visibleCount]);
|
|
24506
|
-
|
|
24392
|
+
useEffect11(() => {
|
|
24507
24393
|
setNav((prev) => {
|
|
24508
24394
|
const maxIdx = Math.max(0, visibleRows.length - 1);
|
|
24509
24395
|
const nextCursor = Math.min(prev.cursor, maxIdx);
|
|
@@ -24541,12 +24427,12 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24541
24427
|
return void 0;
|
|
24542
24428
|
}
|
|
24543
24429
|
};
|
|
24544
|
-
const jumpCursorTo = (
|
|
24430
|
+
const jumpCursorTo = (name2) => {
|
|
24545
24431
|
let idx = -1;
|
|
24546
24432
|
for (let i = 0; i < visibleRows.length; i++) {
|
|
24547
24433
|
const row = visibleRows[i];
|
|
24548
24434
|
if (row.itemIdx < 0) continue;
|
|
24549
|
-
if (groupedItems[row.itemIdx]?.key ===
|
|
24435
|
+
if (groupedItems[row.itemIdx]?.key === name2) {
|
|
24550
24436
|
idx = i;
|
|
24551
24437
|
break;
|
|
24552
24438
|
}
|
|
@@ -24560,18 +24446,18 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24560
24446
|
});
|
|
24561
24447
|
};
|
|
24562
24448
|
const decide = (action) => setDecisions((prev) => reduceDecisions(prev, action, components, graph));
|
|
24563
|
-
const requestReject = (
|
|
24564
|
-
if (decisions.get(
|
|
24565
|
-
if (rejectNeedsConfirmation(graph,
|
|
24566
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
24449
|
+
const requestReject = (name2) => {
|
|
24450
|
+
if (decisions.get(name2) === "rejected") return;
|
|
24451
|
+
if (rejectNeedsConfirmation(graph, name2, decisions)) {
|
|
24452
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
24567
24453
|
setPendingRejectCascade({
|
|
24568
|
-
target:
|
|
24569
|
-
ancestors: toReject.filter((n) => n !==
|
|
24454
|
+
target: name2,
|
|
24455
|
+
ancestors: toReject.filter((n) => n !== name2).sort(),
|
|
24570
24456
|
descendants: [...toDeselect].sort()
|
|
24571
24457
|
});
|
|
24572
24458
|
return;
|
|
24573
24459
|
}
|
|
24574
|
-
decide({ type: "reject", name });
|
|
24460
|
+
decide({ type: "reject", name: name2 });
|
|
24575
24461
|
};
|
|
24576
24462
|
const mode = showHelp ? "help" : pendingRejectCascade ? "reject-prompt" : searchOpen ? "search" : cyclesPanelOpen ? "cycles" : aiRationalePanel.isOpen ? "flags" : "main";
|
|
24577
24463
|
const context = {
|
|
@@ -25076,13 +24962,13 @@ var init_load2 = __esm({
|
|
|
25076
24962
|
});
|
|
25077
24963
|
|
|
25078
24964
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.ts
|
|
25079
|
-
import { useEffect as
|
|
24965
|
+
import { useEffect as useEffect12, useMemo as useMemo5, useRef as useRef10, useState as useState17 } from "react";
|
|
25080
24966
|
function useScopeGateFlow(input, deps = realDeps3) {
|
|
25081
24967
|
const sessionId = input?.sessionId;
|
|
25082
24968
|
const loaded = useMemo5(() => sessionId ? deps.load(sessionId) : void 0, [sessionId]);
|
|
25083
24969
|
const cacheCheck = useRef10(void 0);
|
|
25084
24970
|
const [confirmed, setConfirmed] = useState17();
|
|
25085
|
-
|
|
24971
|
+
useEffect12(() => {
|
|
25086
24972
|
if (!input || !loaded?.ok || cacheCheck.current) return;
|
|
25087
24973
|
cacheCheck.current = deps.checkCache(input.cache);
|
|
25088
24974
|
}, [input, loaded]);
|
|
@@ -25120,18 +25006,18 @@ function describeGeneration(input) {
|
|
|
25120
25006
|
${agent} is reading each selected component and writing a Contentful component definition for it.${input.hasTokens ? "\nUsing your design tokens for prop resolution." : ""}`;
|
|
25121
25007
|
}
|
|
25122
25008
|
function progressRows2(progress, agent) {
|
|
25123
|
-
const
|
|
25009
|
+
const name2 = capitalize(agent);
|
|
25124
25010
|
const { components, mapTokens } = progress;
|
|
25125
25011
|
const rows = [
|
|
25126
25012
|
{
|
|
25127
|
-
text: components ? components.current : `Starting up ${
|
|
25013
|
+
text: components ? components.current : `Starting up ${name2}...`,
|
|
25128
25014
|
complete: false,
|
|
25129
25015
|
...components ? { progress: { done: components.done, total: components.total } } : {}
|
|
25130
25016
|
}
|
|
25131
25017
|
];
|
|
25132
25018
|
if (mapTokens !== "idle") {
|
|
25133
25019
|
rows.push({
|
|
25134
|
-
text: mapTokens === "running" ? `Mapping token restrictions via ${
|
|
25020
|
+
text: mapTokens === "running" ? `Mapping token restrictions via ${name2}...` : "Token restrictions ready",
|
|
25135
25021
|
complete: mapTokens === "complete"
|
|
25136
25022
|
});
|
|
25137
25023
|
}
|
|
@@ -25141,7 +25027,7 @@ var capitalize;
|
|
|
25141
25027
|
var init_logic11 = __esm({
|
|
25142
25028
|
"packages/experience-design-system-cli/src/tui/import/steps/08-generation/logic.ts"() {
|
|
25143
25029
|
"use strict";
|
|
25144
|
-
capitalize = (
|
|
25030
|
+
capitalize = (name2) => name2.charAt(0).toUpperCase() + name2.slice(1);
|
|
25145
25031
|
}
|
|
25146
25032
|
});
|
|
25147
25033
|
|
|
@@ -25353,11 +25239,11 @@ var init_run2 = __esm({
|
|
|
25353
25239
|
});
|
|
25354
25240
|
|
|
25355
25241
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
|
|
25356
|
-
import { useEffect as
|
|
25242
|
+
import { useEffect as useEffect13, useRef as useRef11, useState as useState18 } from "react";
|
|
25357
25243
|
function useGeneration(input) {
|
|
25358
25244
|
const [state2, setState] = useState18();
|
|
25359
25245
|
const current = useRef11();
|
|
25360
|
-
|
|
25246
|
+
useEffect13(() => {
|
|
25361
25247
|
current.current = input;
|
|
25362
25248
|
if (!input) {
|
|
25363
25249
|
setState(void 0);
|
|
@@ -25416,6 +25302,24 @@ var init_build_flow_start = __esm({
|
|
|
25416
25302
|
}
|
|
25417
25303
|
});
|
|
25418
25304
|
|
|
25305
|
+
// packages/experience-design-system-types/dist/src/source-input-association.js
|
|
25306
|
+
import * as z3 from "zod/mini";
|
|
25307
|
+
var name, SourceInputAssociationSchema;
|
|
25308
|
+
var init_source_input_association = __esm({
|
|
25309
|
+
"packages/experience-design-system-types/dist/src/source-input-association.js"() {
|
|
25310
|
+
"use strict";
|
|
25311
|
+
name = z3.string().check(z3.refine((value) => value.trim().length > 0));
|
|
25312
|
+
SourceInputAssociationSchema = z3.strictObject({
|
|
25313
|
+
schemaVersion: z3.literal(1),
|
|
25314
|
+
componentId: name,
|
|
25315
|
+
componentDeclarationId: name,
|
|
25316
|
+
rootSymbolId: name,
|
|
25317
|
+
inputName: name,
|
|
25318
|
+
inputPath: z3.array(name).check(z3.minLength(1))
|
|
25319
|
+
}).check(z3.refine((value) => value.inputPath[0] === value.inputName));
|
|
25320
|
+
}
|
|
25321
|
+
});
|
|
25322
|
+
|
|
25419
25323
|
// packages/experience-design-system-types/dist/src/cdf/vocabularies.js
|
|
25420
25324
|
var CDF_PROPERTY_TYPES2, CDF_PROPERTY_CATEGORIES2;
|
|
25421
25325
|
var init_vocabularies2 = __esm({
|
|
@@ -25610,38 +25514,38 @@ var init_validate5 = __esm({
|
|
|
25610
25514
|
});
|
|
25611
25515
|
|
|
25612
25516
|
// packages/experience-design-system-types/dist/src/cdf/types.js
|
|
25613
|
-
import * as
|
|
25517
|
+
import * as z4 from "zod/mini";
|
|
25614
25518
|
var CDFPropertySchema2, CDFSlotSchema2, CDFComponentSchema2, CDFTokenSchema2;
|
|
25615
25519
|
var init_types7 = __esm({
|
|
25616
25520
|
"packages/experience-design-system-types/dist/src/cdf/types.js"() {
|
|
25617
25521
|
"use strict";
|
|
25618
25522
|
init_vocabularies2();
|
|
25619
25523
|
init_token_types2();
|
|
25620
|
-
CDFPropertySchema2 =
|
|
25621
|
-
$type:
|
|
25622
|
-
$category:
|
|
25623
|
-
$description:
|
|
25624
|
-
$required:
|
|
25625
|
-
$default:
|
|
25626
|
-
$values:
|
|
25627
|
-
"$token.kind":
|
|
25628
|
-
"$token.allowed":
|
|
25524
|
+
CDFPropertySchema2 = z4.strictObject({
|
|
25525
|
+
$type: z4.enum(CDF_PROPERTY_TYPES2),
|
|
25526
|
+
$category: z4.enum(CDF_PROPERTY_CATEGORIES2),
|
|
25527
|
+
$description: z4.optional(z4.string()),
|
|
25528
|
+
$required: z4.optional(z4.boolean()),
|
|
25529
|
+
$default: z4.optional(z4.any()),
|
|
25530
|
+
$values: z4.optional(z4.array(z4.string())),
|
|
25531
|
+
"$token.kind": z4.optional(z4.string()),
|
|
25532
|
+
"$token.allowed": z4.optional(z4.array(z4.string()))
|
|
25629
25533
|
});
|
|
25630
|
-
CDFSlotSchema2 =
|
|
25631
|
-
$description:
|
|
25632
|
-
$allowedComponents:
|
|
25633
|
-
$required:
|
|
25534
|
+
CDFSlotSchema2 = z4.strictObject({
|
|
25535
|
+
$description: z4.optional(z4.string()),
|
|
25536
|
+
$allowedComponents: z4.optional(z4.array(z4.string())),
|
|
25537
|
+
$required: z4.optional(z4.boolean())
|
|
25634
25538
|
});
|
|
25635
|
-
CDFComponentSchema2 =
|
|
25636
|
-
$type:
|
|
25637
|
-
$description:
|
|
25638
|
-
$properties:
|
|
25639
|
-
$slots:
|
|
25539
|
+
CDFComponentSchema2 = z4.strictObject({
|
|
25540
|
+
$type: z4.literal("component"),
|
|
25541
|
+
$description: z4.optional(z4.string()),
|
|
25542
|
+
$properties: z4.record(z4.string(), CDFPropertySchema2),
|
|
25543
|
+
$slots: z4.optional(z4.record(z4.string(), CDFSlotSchema2))
|
|
25640
25544
|
});
|
|
25641
|
-
CDFTokenSchema2 =
|
|
25642
|
-
$type:
|
|
25643
|
-
$value:
|
|
25644
|
-
$description:
|
|
25545
|
+
CDFTokenSchema2 = z4.strictObject({
|
|
25546
|
+
$type: z4.enum(DESIGN_TOKEN_TYPES2),
|
|
25547
|
+
$value: z4.unknown(),
|
|
25548
|
+
$description: z4.optional(z4.string())
|
|
25645
25549
|
});
|
|
25646
25550
|
}
|
|
25647
25551
|
});
|
|
@@ -25651,9 +25555,9 @@ function stripUnsupportedSlotFields(entry) {
|
|
|
25651
25555
|
if (!entry.$slots)
|
|
25652
25556
|
return entry;
|
|
25653
25557
|
const cleaned = {};
|
|
25654
|
-
for (const [
|
|
25558
|
+
for (const [name2, slot] of Object.entries(entry.$slots)) {
|
|
25655
25559
|
const { $required: _required, ...rest } = slot;
|
|
25656
|
-
cleaned[
|
|
25560
|
+
cleaned[name2] = rest;
|
|
25657
25561
|
}
|
|
25658
25562
|
return { ...entry, $slots: cleaned };
|
|
25659
25563
|
}
|
|
@@ -25695,7 +25599,7 @@ function validateSlotReferences2(components) {
|
|
|
25695
25599
|
const slots = entry.$slots ?? {};
|
|
25696
25600
|
for (const [slotKey, slot] of Object.entries(slots)) {
|
|
25697
25601
|
const allowed = slot?.$allowedComponents ?? [];
|
|
25698
|
-
const unresolved = allowed.filter((
|
|
25602
|
+
const unresolved = allowed.filter((name2) => !componentKeys.has(name2));
|
|
25699
25603
|
if (unresolved.length === 0)
|
|
25700
25604
|
continue;
|
|
25701
25605
|
errors.push({
|
|
@@ -25728,6 +25632,13 @@ var init_build2 = __esm({
|
|
|
25728
25632
|
}
|
|
25729
25633
|
});
|
|
25730
25634
|
|
|
25635
|
+
// packages/experience-design-system-types/dist/src/cdf/finite-values.js
|
|
25636
|
+
var init_finite_values = __esm({
|
|
25637
|
+
"packages/experience-design-system-types/dist/src/cdf/finite-values.js"() {
|
|
25638
|
+
"use strict";
|
|
25639
|
+
}
|
|
25640
|
+
});
|
|
25641
|
+
|
|
25731
25642
|
// packages/experience-design-system-types/dist/src/cdf/index.js
|
|
25732
25643
|
var init_cdf2 = __esm({
|
|
25733
25644
|
"packages/experience-design-system-types/dist/src/cdf/index.js"() {
|
|
@@ -25737,21 +25648,22 @@ var init_cdf2 = __esm({
|
|
|
25737
25648
|
init_vocabularies2();
|
|
25738
25649
|
init_types7();
|
|
25739
25650
|
init_build2();
|
|
25651
|
+
init_finite_values();
|
|
25740
25652
|
}
|
|
25741
25653
|
});
|
|
25742
25654
|
|
|
25743
25655
|
// packages/experience-design-system-types/dist/src/dtcg/types.js
|
|
25744
|
-
import * as
|
|
25656
|
+
import * as z5 from "zod/mini";
|
|
25745
25657
|
var DTCGTokenSchema2;
|
|
25746
25658
|
var init_types8 = __esm({
|
|
25747
25659
|
"packages/experience-design-system-types/dist/src/dtcg/types.js"() {
|
|
25748
25660
|
"use strict";
|
|
25749
25661
|
init_token_types2();
|
|
25750
|
-
DTCGTokenSchema2 =
|
|
25751
|
-
path:
|
|
25752
|
-
$type:
|
|
25753
|
-
$value:
|
|
25754
|
-
$description:
|
|
25662
|
+
DTCGTokenSchema2 = z5.strictObject({
|
|
25663
|
+
path: z5.string(),
|
|
25664
|
+
$type: z5.enum(DESIGN_TOKEN_TYPES2),
|
|
25665
|
+
$value: z5.unknown(),
|
|
25666
|
+
$description: z5.optional(z5.string())
|
|
25755
25667
|
});
|
|
25756
25668
|
}
|
|
25757
25669
|
});
|
|
@@ -25795,12 +25707,12 @@ var init_json_value = __esm({
|
|
|
25795
25707
|
});
|
|
25796
25708
|
|
|
25797
25709
|
// packages/experience-design-system-types/dist/src/property-contract/date-time-value.js
|
|
25798
|
-
import * as
|
|
25710
|
+
import * as z6 from "zod/mini";
|
|
25799
25711
|
var dateTimeValueSchema;
|
|
25800
25712
|
var init_date_time_value = __esm({
|
|
25801
25713
|
"packages/experience-design-system-types/dist/src/property-contract/date-time-value.js"() {
|
|
25802
25714
|
"use strict";
|
|
25803
|
-
dateTimeValueSchema =
|
|
25715
|
+
dateTimeValueSchema = z6.iso.datetime({ offset: true });
|
|
25804
25716
|
}
|
|
25805
25717
|
});
|
|
25806
25718
|
|
|
@@ -25902,6 +25814,14 @@ var init_target_definition = __esm({
|
|
|
25902
25814
|
}
|
|
25903
25815
|
});
|
|
25904
25816
|
|
|
25817
|
+
// packages/experience-design-system-types/dist/src/property-contract/content-digest.js
|
|
25818
|
+
var init_content_digest = __esm({
|
|
25819
|
+
"packages/experience-design-system-types/dist/src/property-contract/content-digest.js"() {
|
|
25820
|
+
"use strict";
|
|
25821
|
+
init_json_value();
|
|
25822
|
+
}
|
|
25823
|
+
});
|
|
25824
|
+
|
|
25905
25825
|
// packages/experience-design-system-types/dist/src/property-contract/index.js
|
|
25906
25826
|
var init_property_contract = __esm({
|
|
25907
25827
|
"packages/experience-design-system-types/dist/src/property-contract/index.js"() {
|
|
@@ -25910,6 +25830,19 @@ var init_property_contract = __esm({
|
|
|
25910
25830
|
init_date_time_value();
|
|
25911
25831
|
init_discriminated_union();
|
|
25912
25832
|
init_target_definition();
|
|
25833
|
+
init_content_digest();
|
|
25834
|
+
}
|
|
25835
|
+
});
|
|
25836
|
+
|
|
25837
|
+
// packages/experience-design-system-types/dist/src/cdf/property-validation.js
|
|
25838
|
+
var init_property_validation = __esm({
|
|
25839
|
+
"packages/experience-design-system-types/dist/src/cdf/property-validation.js"() {
|
|
25840
|
+
"use strict";
|
|
25841
|
+
init_vocabularies2();
|
|
25842
|
+
init_json_value();
|
|
25843
|
+
init_target_definition();
|
|
25844
|
+
init_source_input_association();
|
|
25845
|
+
init_finite_values();
|
|
25913
25846
|
}
|
|
25914
25847
|
});
|
|
25915
25848
|
|
|
@@ -25917,9 +25850,11 @@ var init_property_contract = __esm({
|
|
|
25917
25850
|
var init_src4 = __esm({
|
|
25918
25851
|
"packages/experience-design-system-types/dist/src/index.js"() {
|
|
25919
25852
|
"use strict";
|
|
25853
|
+
init_source_input_association();
|
|
25920
25854
|
init_cdf2();
|
|
25921
25855
|
init_dtcg2();
|
|
25922
25856
|
init_property_contract();
|
|
25857
|
+
init_property_validation();
|
|
25923
25858
|
}
|
|
25924
25859
|
});
|
|
25925
25860
|
|
|
@@ -25928,7 +25863,7 @@ function failedComponentNames(errors) {
|
|
|
25928
25863
|
return [...new Set(errors.map((error) => error.componentName))];
|
|
25929
25864
|
}
|
|
25930
25865
|
function matchedComponentNames(errors, missingNames) {
|
|
25931
|
-
return failedComponentNames(errors).filter((
|
|
25866
|
+
return failedComponentNames(errors).filter((name2) => !missingNames.includes(name2));
|
|
25932
25867
|
}
|
|
25933
25868
|
function formatErrorLine(error) {
|
|
25934
25869
|
const context = [`Component: ${error.componentName}`, error.path ? `Path: ${error.path}` : null].filter(Boolean);
|
|
@@ -26074,11 +26009,11 @@ function computeRenderStatuses(closure, directIssues) {
|
|
|
26074
26009
|
inheritedSources.get(ancestor).set(node.name, ownStatus);
|
|
26075
26010
|
}
|
|
26076
26011
|
}
|
|
26077
|
-
for (const [
|
|
26078
|
-
out.set(
|
|
26012
|
+
for (const [name2, status] of own2.entries()) {
|
|
26013
|
+
out.set(name2, {
|
|
26079
26014
|
status,
|
|
26080
26015
|
isOwn: true,
|
|
26081
|
-
sourceComponents: [
|
|
26016
|
+
sourceComponents: [name2]
|
|
26082
26017
|
});
|
|
26083
26018
|
}
|
|
26084
26019
|
for (const [ancestor, sources] of inheritedSources.entries()) {
|
|
@@ -26344,7 +26279,7 @@ var init_scroll_offset = __esm({
|
|
|
26344
26279
|
});
|
|
26345
26280
|
|
|
26346
26281
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
26347
|
-
import React13, { useEffect as
|
|
26282
|
+
import React13, { useEffect as useEffect14, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
|
|
26348
26283
|
import figures6 from "figures";
|
|
26349
26284
|
import { Box as Box26, measureElement, Text as Text27 } from "ink";
|
|
26350
26285
|
import { Fragment as Fragment6, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
@@ -26396,7 +26331,7 @@ function parseToState(json) {
|
|
|
26396
26331
|
}
|
|
26397
26332
|
const componentDescription = typeof component.$description === "string" ? component.$description : "";
|
|
26398
26333
|
const rawProps = component.$properties ?? {};
|
|
26399
|
-
const props = Object.entries(rawProps).map(([
|
|
26334
|
+
const props = Object.entries(rawProps).map(([name2, raw]) => {
|
|
26400
26335
|
const p = raw ?? {};
|
|
26401
26336
|
const type = CDF_PROPERTY_TYPES2.includes(p.$type) ? p.$type : "string";
|
|
26402
26337
|
let defaultValue = null;
|
|
@@ -26408,7 +26343,7 @@ function parseToState(json) {
|
|
|
26408
26343
|
}
|
|
26409
26344
|
}
|
|
26410
26345
|
return {
|
|
26411
|
-
name,
|
|
26346
|
+
name: name2,
|
|
26412
26347
|
type,
|
|
26413
26348
|
category: CDF_PROPERTY_CATEGORIES2.includes(p.$category) ? p.$category : "content",
|
|
26414
26349
|
required: p.$required === true,
|
|
@@ -26420,10 +26355,10 @@ function parseToState(json) {
|
|
|
26420
26355
|
};
|
|
26421
26356
|
});
|
|
26422
26357
|
const rawSlots = component.$slots ?? {};
|
|
26423
|
-
const slots = Object.entries(rawSlots).map(([
|
|
26358
|
+
const slots = Object.entries(rawSlots).map(([name2, raw]) => {
|
|
26424
26359
|
const s = raw ?? {};
|
|
26425
26360
|
return {
|
|
26426
|
-
name,
|
|
26361
|
+
name: name2,
|
|
26427
26362
|
description: typeof s.$description === "string" ? s.$description : "",
|
|
26428
26363
|
required: s.$required === true,
|
|
26429
26364
|
allowedComponents: Array.isArray(s.$allowedComponents) ? s.$allowedComponents.filter((v) => typeof v === "string") : []
|
|
@@ -26531,7 +26466,7 @@ function DefaultValueRow({
|
|
|
26531
26466
|
] });
|
|
26532
26467
|
}
|
|
26533
26468
|
function RowLabel({
|
|
26534
|
-
name,
|
|
26469
|
+
name: name2,
|
|
26535
26470
|
selected,
|
|
26536
26471
|
trailing = true
|
|
26537
26472
|
}) {
|
|
@@ -26544,7 +26479,7 @@ function RowLabel({
|
|
|
26544
26479
|
wrap: "truncate-end",
|
|
26545
26480
|
children: [
|
|
26546
26481
|
" ",
|
|
26547
|
-
|
|
26482
|
+
name2,
|
|
26548
26483
|
trailing ? " " : ""
|
|
26549
26484
|
]
|
|
26550
26485
|
}
|
|
@@ -26896,10 +26831,10 @@ function SlotRow({
|
|
|
26896
26831
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
26897
26832
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
26898
26833
|
/* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
26899
|
-
slice.map((
|
|
26834
|
+
slice.map((name2, i) => {
|
|
26900
26835
|
const absIdx = start + i;
|
|
26901
26836
|
const isCursor = absIdx === cursor;
|
|
26902
|
-
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${
|
|
26837
|
+
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${name2}` : ` ${name2}` }, name2);
|
|
26903
26838
|
})
|
|
26904
26839
|
] });
|
|
26905
26840
|
})() })
|
|
@@ -27795,8 +27730,8 @@ function FieldEditor({
|
|
|
27795
27730
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
27796
27731
|
const modeLabel = (() => {
|
|
27797
27732
|
if (pendingDelete) {
|
|
27798
|
-
const
|
|
27799
|
-
return `Delete ${pendingDelete.kind} "${
|
|
27733
|
+
const name2 = pendingDelete.kind === "prop" ? props[pendingDelete.idx]?.name : slots[pendingDelete.idx]?.name;
|
|
27734
|
+
return `Delete ${pendingDelete.kind} "${name2}"? [y] delete \xB7 any other key cancels`;
|
|
27800
27735
|
}
|
|
27801
27736
|
if (editingValue) {
|
|
27802
27737
|
return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
|
|
@@ -27871,7 +27806,7 @@ function FieldEditor({
|
|
|
27871
27806
|
}
|
|
27872
27807
|
return Math.max(start + 1, end2);
|
|
27873
27808
|
};
|
|
27874
|
-
|
|
27809
|
+
useEffect14(() => {
|
|
27875
27810
|
if (focusLevel === "field" || selectedRowIdx < 0) return;
|
|
27876
27811
|
setListScrollStart((previous) => {
|
|
27877
27812
|
if (initialFocusTarget && !initialFocusScrollApplied.current) {
|
|
@@ -29021,7 +28956,7 @@ function finalizeReviewSession(extractSessionId, components) {
|
|
|
29021
28956
|
);
|
|
29022
28957
|
db.exec("BEGIN");
|
|
29023
28958
|
try {
|
|
29024
|
-
for (const
|
|
28959
|
+
for (const name2 of toReject) statement.run(extractSessionId, name2);
|
|
29025
28960
|
db.exec("COMMIT");
|
|
29026
28961
|
} catch (error) {
|
|
29027
28962
|
db.exec("ROLLBACK");
|
|
@@ -29266,7 +29201,7 @@ var init_FinalizeDialog = __esm({
|
|
|
29266
29201
|
});
|
|
29267
29202
|
|
|
29268
29203
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-finalize-preview.ts
|
|
29269
|
-
import { useEffect as
|
|
29204
|
+
import { useEffect as useEffect15, useRef as useRef12, useState as useState20 } from "react";
|
|
29270
29205
|
function useReviewFinalizePreview({
|
|
29271
29206
|
components,
|
|
29272
29207
|
...options
|
|
@@ -29283,7 +29218,7 @@ function useFinalizePreview(opts) {
|
|
|
29283
29218
|
const [scrollOffset, setScrollOffset] = useState20(0);
|
|
29284
29219
|
const generationRef = useRef12(0);
|
|
29285
29220
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
29286
|
-
|
|
29221
|
+
useEffect15(() => {
|
|
29287
29222
|
if (!open) {
|
|
29288
29223
|
setStatus("idle");
|
|
29289
29224
|
setRemoved([]);
|
|
@@ -29335,7 +29270,7 @@ var init_use_finalize_preview = __esm({
|
|
|
29335
29270
|
});
|
|
29336
29271
|
|
|
29337
29272
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-session.ts
|
|
29338
|
-
import { useCallback as useCallback2, useEffect as
|
|
29273
|
+
import { useCallback as useCallback2, useEffect as useEffect16, useRef as useRef13, useState as useState21 } from "react";
|
|
29339
29274
|
function useReviewSession({
|
|
29340
29275
|
loadSession,
|
|
29341
29276
|
tokensPath,
|
|
@@ -29354,7 +29289,7 @@ function useReviewSession({
|
|
|
29354
29289
|
}));
|
|
29355
29290
|
return { result, catalog };
|
|
29356
29291
|
}, [loadSession, tokensPath]);
|
|
29357
|
-
|
|
29292
|
+
useEffect16(() => {
|
|
29358
29293
|
let disposed = false;
|
|
29359
29294
|
void (async () => {
|
|
29360
29295
|
try {
|
|
@@ -29407,7 +29342,7 @@ function useReviewSession({
|
|
|
29407
29342
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
29408
29343
|
const [reviewMetadata, setReviewMetadata] = useState21(null);
|
|
29409
29344
|
const [componentRationale, setComponentRationale] = useState21(null);
|
|
29410
|
-
|
|
29345
|
+
useEffect16(() => {
|
|
29411
29346
|
const current = components[selectedIdx];
|
|
29412
29347
|
if (!current) {
|
|
29413
29348
|
setReviewMetadata(null);
|
|
@@ -29439,7 +29374,7 @@ function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
|
29439
29374
|
function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
|
|
29440
29375
|
const historyRef = useRef13(null);
|
|
29441
29376
|
const historySeededRef = useRef13(false);
|
|
29442
|
-
|
|
29377
|
+
useEffect16(() => {
|
|
29443
29378
|
if (loading || historySeededRef.current) return;
|
|
29444
29379
|
historySeededRef.current = true;
|
|
29445
29380
|
historyRef.current = createHistoryStack(createSnapshot(components));
|
|
@@ -29521,7 +29456,7 @@ var init_token_suggestions = __esm({
|
|
|
29521
29456
|
});
|
|
29522
29457
|
|
|
29523
29458
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-editor.ts
|
|
29524
|
-
import { useEffect as
|
|
29459
|
+
import { useEffect as useEffect17, useRef as useRef14, useState as useState22 } from "react";
|
|
29525
29460
|
function parseReviewEntry(draftValue) {
|
|
29526
29461
|
const parsed = JSON.parse(draftValue);
|
|
29527
29462
|
const keys = Object.keys(parsed);
|
|
@@ -29555,7 +29490,7 @@ function useReviewEditor({
|
|
|
29555
29490
|
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState22(/* @__PURE__ */ new Set());
|
|
29556
29491
|
const tokenReviewSuggestedRef = useRef14(/* @__PURE__ */ new Map());
|
|
29557
29492
|
const pendingGRef = useRef14(false);
|
|
29558
|
-
|
|
29493
|
+
useEffect17(() => {
|
|
29559
29494
|
setTokenReviewRow(0);
|
|
29560
29495
|
setTokenReviewEditing(false);
|
|
29561
29496
|
setTokenReviewEditCursor(0);
|
|
@@ -30005,13 +29940,13 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
30005
29940
|
const unchanged = new Set(preview.components.unchanged);
|
|
30006
29941
|
const changedNames = /* @__PURE__ */ new Set();
|
|
30007
29942
|
for (const item of preview.components.changed) {
|
|
30008
|
-
const
|
|
30009
|
-
if (typeof
|
|
30010
|
-
changedNames.add(
|
|
29943
|
+
const name2 = item.current?.name;
|
|
29944
|
+
if (typeof name2 !== "string") continue;
|
|
29945
|
+
changedNames.add(name2);
|
|
30011
29946
|
if (item.changeClassification?.classification === "breaking") {
|
|
30012
|
-
out.set(
|
|
29947
|
+
out.set(name2, "breaking");
|
|
30013
29948
|
} else {
|
|
30014
|
-
out.set(
|
|
29949
|
+
out.set(name2, "changed");
|
|
30015
29950
|
}
|
|
30016
29951
|
}
|
|
30017
29952
|
const removedNames = /* @__PURE__ */ new Set();
|
|
@@ -30021,12 +29956,12 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
30021
29956
|
out.set(entity.name, "removed");
|
|
30022
29957
|
}
|
|
30023
29958
|
}
|
|
30024
|
-
for (const
|
|
30025
|
-
if (unchanged.has(
|
|
30026
|
-
if (changedNames.has(
|
|
30027
|
-
if (removedNames.has(
|
|
30028
|
-
if (out.has(
|
|
30029
|
-
out.set(
|
|
29959
|
+
for (const name2 of localNames) {
|
|
29960
|
+
if (unchanged.has(name2)) continue;
|
|
29961
|
+
if (changedNames.has(name2)) continue;
|
|
29962
|
+
if (removedNames.has(name2)) continue;
|
|
29963
|
+
if (out.has(name2)) continue;
|
|
29964
|
+
out.set(name2, "new");
|
|
30030
29965
|
}
|
|
30031
29966
|
return out;
|
|
30032
29967
|
}
|
|
@@ -30037,7 +29972,7 @@ var init_preview_annotations = __esm({
|
|
|
30037
29972
|
});
|
|
30038
29973
|
|
|
30039
29974
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-live-preview.ts
|
|
30040
|
-
import { useCallback as useCallback3, useEffect as
|
|
29975
|
+
import { useCallback as useCallback3, useEffect as useEffect18, useRef as useRef15, useState as useState24 } from "react";
|
|
30041
29976
|
function useLivePreview(opts) {
|
|
30042
29977
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
30043
29978
|
const [status, setStatus] = useState24("idle");
|
|
@@ -30047,14 +29982,14 @@ function useLivePreview(opts) {
|
|
|
30047
29982
|
const latestRef = useRef15(0);
|
|
30048
29983
|
const inflightRef = useRef15(0);
|
|
30049
29984
|
const optsRef = useRef15(opts);
|
|
30050
|
-
|
|
29985
|
+
useEffect18(() => {
|
|
30051
29986
|
optsRef.current = opts;
|
|
30052
29987
|
});
|
|
30053
29988
|
const disabledRef = useRef15(disabled);
|
|
30054
|
-
|
|
29989
|
+
useEffect18(() => {
|
|
30055
29990
|
disabledRef.current = disabled;
|
|
30056
29991
|
}, [disabled]);
|
|
30057
|
-
|
|
29992
|
+
useEffect18(() => {
|
|
30058
29993
|
return () => {
|
|
30059
29994
|
if (timerRef.current) {
|
|
30060
29995
|
clearTimeout(timerRef.current);
|
|
@@ -30135,7 +30070,7 @@ var init_use_live_preview = __esm({
|
|
|
30135
30070
|
});
|
|
30136
30071
|
|
|
30137
30072
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-preview.ts
|
|
30138
|
-
import { useCallback as useCallback4, useEffect as
|
|
30073
|
+
import { useCallback as useCallback4, useEffect as useEffect19, useState as useState25 } from "react";
|
|
30139
30074
|
function useReviewPreview({
|
|
30140
30075
|
components,
|
|
30141
30076
|
loading,
|
|
@@ -30177,13 +30112,13 @@ function useReviewPreview({
|
|
|
30177
30112
|
deleteAllComponents
|
|
30178
30113
|
});
|
|
30179
30114
|
const [spinnerTick, setSpinnerTick] = useState25(0);
|
|
30180
|
-
|
|
30115
|
+
useEffect19(() => {
|
|
30181
30116
|
if (livePreviewHook.status !== "running") return;
|
|
30182
30117
|
const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
|
|
30183
30118
|
return () => clearInterval(id);
|
|
30184
30119
|
}, [livePreviewHook.status]);
|
|
30185
30120
|
const livePreviewSpinner = SPINNER_FRAMES[spinnerTick % SPINNER_FRAMES.length];
|
|
30186
|
-
|
|
30121
|
+
useEffect19(() => {
|
|
30187
30122
|
if (loading) return;
|
|
30188
30123
|
if (!livePreview) return;
|
|
30189
30124
|
if (components.length === 0) return;
|
|
@@ -30240,7 +30175,7 @@ var init_LivePreviewSummary = __esm({
|
|
|
30240
30175
|
});
|
|
30241
30176
|
|
|
30242
30177
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
30243
|
-
import { useCallback as useCallback5, useEffect as
|
|
30178
|
+
import { useCallback as useCallback5, useEffect as useEffect20, useMemo as useMemo6, useRef as useRef16, useState as useState26 } from "react";
|
|
30244
30179
|
import figures8 from "figures";
|
|
30245
30180
|
import { Box as Box38, Text as Text40 } from "ink";
|
|
30246
30181
|
import { Fragment as Fragment14, jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -30561,7 +30496,7 @@ function GenerateReviewStepView({
|
|
|
30561
30496
|
[components]
|
|
30562
30497
|
);
|
|
30563
30498
|
const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
30564
|
-
|
|
30499
|
+
useEffect20(() => {
|
|
30565
30500
|
if (seededGroupsRef.current) return;
|
|
30566
30501
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
30567
30502
|
seededGroupsRef.current = true;
|
|
@@ -30588,7 +30523,7 @@ function GenerateReviewStepView({
|
|
|
30588
30523
|
suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
|
|
30589
30524
|
}));
|
|
30590
30525
|
}, [slotCycles, cycleView]);
|
|
30591
|
-
|
|
30526
|
+
useEffect20(() => {
|
|
30592
30527
|
const decision = computeAutoRejectDecision({
|
|
30593
30528
|
loading,
|
|
30594
30529
|
autoRejectFired: autoRejectFiredRef.current,
|
|
@@ -30632,7 +30567,7 @@ function GenerateReviewStepView({
|
|
|
30632
30567
|
applySnapshot: applyHistorySnapshot
|
|
30633
30568
|
});
|
|
30634
30569
|
const autoRejectPushedRef = useRef16(false);
|
|
30635
|
-
|
|
30570
|
+
useEffect20(() => {
|
|
30636
30571
|
if (loading) return;
|
|
30637
30572
|
if (!historySeededRef.current) return;
|
|
30638
30573
|
if (!autoRejectFiredRef.current) return;
|
|
@@ -30716,7 +30651,7 @@ function GenerateReviewStepView({
|
|
|
30716
30651
|
const panelHeight = leftPanelHeight + 2;
|
|
30717
30652
|
const panelContentHeight = Math.max(1, panelHeight - 3);
|
|
30718
30653
|
const cycleViewportHeight = Math.max(1, panelHeight - 4);
|
|
30719
|
-
|
|
30654
|
+
useEffect20(() => {
|
|
30720
30655
|
if (selectableRowPositions.length === 0) return;
|
|
30721
30656
|
const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
|
|
30722
30657
|
const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
|
|
@@ -30751,10 +30686,10 @@ function GenerateReviewStepView({
|
|
|
30751
30686
|
const merged = /* @__PURE__ */ new Map();
|
|
30752
30687
|
for (const closure of closures.values()) {
|
|
30753
30688
|
const per = computeRenderStatuses(closure, directIssues);
|
|
30754
|
-
for (const [
|
|
30755
|
-
const existing = merged.get(
|
|
30689
|
+
for (const [name2, rs] of per.entries()) {
|
|
30690
|
+
const existing = merged.get(name2);
|
|
30756
30691
|
if (!existing || !existing.isOwn && rs.isOwn) {
|
|
30757
|
-
merged.set(
|
|
30692
|
+
merged.set(name2, rs);
|
|
30758
30693
|
}
|
|
30759
30694
|
}
|
|
30760
30695
|
}
|
|
@@ -30809,11 +30744,11 @@ function GenerateReviewStepView({
|
|
|
30809
30744
|
reviewEditor.setSaveError(null);
|
|
30810
30745
|
setPendingEditorFocus(null);
|
|
30811
30746
|
};
|
|
30812
|
-
const jumpCursorToName = (
|
|
30747
|
+
const jumpCursorToName = (name2) => {
|
|
30813
30748
|
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
30814
30749
|
const row = visibleRowsMemo[i];
|
|
30815
30750
|
if (row.itemIdx < 0) continue;
|
|
30816
|
-
if (components[row.itemIdx]?.key ===
|
|
30751
|
+
if (components[row.itemIdx]?.key === name2) {
|
|
30817
30752
|
jumpCursorToRow(i);
|
|
30818
30753
|
return;
|
|
30819
30754
|
}
|
|
@@ -31341,8 +31276,8 @@ function GenerateReviewStepView({
|
|
|
31341
31276
|
}
|
|
31342
31277
|
),
|
|
31343
31278
|
!dialogOpen && autoRejected.length > 0 && (() => {
|
|
31344
|
-
const stillRejected = autoRejected.filter((
|
|
31345
|
-
const c2 = components.find((x) => x.key ===
|
|
31279
|
+
const stillRejected = autoRejected.filter((name2) => {
|
|
31280
|
+
const c2 = components.find((x) => x.key === name2);
|
|
31346
31281
|
return c2?.status === "rejected";
|
|
31347
31282
|
});
|
|
31348
31283
|
if (stillRejected.length === 0) return null;
|
|
@@ -31798,10 +31733,10 @@ var init_path_utils = __esm({
|
|
|
31798
31733
|
});
|
|
31799
31734
|
|
|
31800
31735
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
|
|
31801
|
-
import { useEffect as
|
|
31736
|
+
import { useEffect as useEffect21, useState as useState27 } from "react";
|
|
31802
31737
|
function useBlinkingCursor() {
|
|
31803
31738
|
const [visible, setVisible] = useState27(true);
|
|
31804
|
-
|
|
31739
|
+
useEffect21(() => {
|
|
31805
31740
|
const interval = setInterval(() => setVisible((current) => !current), 500);
|
|
31806
31741
|
return () => clearInterval(interval);
|
|
31807
31742
|
}, []);
|
|
@@ -31938,12 +31873,12 @@ var init_produced = __esm({
|
|
|
31938
31873
|
});
|
|
31939
31874
|
|
|
31940
31875
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
31941
|
-
import { useEffect as
|
|
31876
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
31942
31877
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
31943
31878
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
31944
31879
|
function useTimedSpinner() {
|
|
31945
31880
|
const [elapsedSeconds, setElapsedSeconds] = useState29(0);
|
|
31946
|
-
|
|
31881
|
+
useEffect22(() => {
|
|
31947
31882
|
const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
|
|
31948
31883
|
return () => {
|
|
31949
31884
|
clearInterval(timer);
|
|
@@ -32024,31 +31959,31 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
32024
31959
|
const proposedProperties = proposed["$properties"] ?? {};
|
|
32025
31960
|
const proposedProps = new Set(Object.keys(proposedProperties));
|
|
32026
31961
|
const oldProps = current.fullProperties;
|
|
32027
|
-
for (const
|
|
32028
|
-
if (!currentProps.has(
|
|
32029
|
-
const def = proposedProperties[
|
|
32030
|
-
lines.push({ key: `${
|
|
31962
|
+
for (const name2 of [...proposedProps].sort()) {
|
|
31963
|
+
if (!currentProps.has(name2)) {
|
|
31964
|
+
const def = proposedProperties[name2];
|
|
31965
|
+
lines.push({ key: `${name2}-add`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(def)}` });
|
|
32031
31966
|
}
|
|
32032
31967
|
}
|
|
32033
|
-
for (const
|
|
32034
|
-
if (!proposedProps.has(
|
|
32035
|
-
if (oldProps?.[
|
|
32036
|
-
lines.push({ key: `${
|
|
31968
|
+
for (const name2 of [...currentProps].sort()) {
|
|
31969
|
+
if (!proposedProps.has(name2)) {
|
|
31970
|
+
if (oldProps?.[name2]) {
|
|
31971
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(oldProps[name2])}` });
|
|
32037
31972
|
} else {
|
|
32038
|
-
const cat = current.contentProperties.includes(
|
|
32039
|
-
lines.push({ key: `${
|
|
31973
|
+
const cat = current.contentProperties.includes(name2) ? "content" : "design";
|
|
31974
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2} (${cat})` });
|
|
32040
31975
|
}
|
|
32041
31976
|
}
|
|
32042
31977
|
}
|
|
32043
31978
|
const handledProps = /* @__PURE__ */ new Set();
|
|
32044
|
-
for (const
|
|
32045
|
-
if (!proposedProps.has(
|
|
32046
|
-
const newDef = proposedProperties[
|
|
32047
|
-
const oldDef = oldProps?.[
|
|
31979
|
+
for (const name2 of [...currentProps].sort()) {
|
|
31980
|
+
if (!proposedProps.has(name2)) continue;
|
|
31981
|
+
const newDef = proposedProperties[name2];
|
|
31982
|
+
const oldDef = oldProps?.[name2];
|
|
32048
31983
|
if (!oldDef) continue;
|
|
32049
|
-
const diffs = diffProperty(
|
|
31984
|
+
const diffs = diffProperty(name2, oldDef, newDef);
|
|
32050
31985
|
if (diffs.length > 0) {
|
|
32051
|
-
handledProps.add(
|
|
31986
|
+
handledProps.add(name2);
|
|
32052
31987
|
for (const d of diffs) lines.push(d);
|
|
32053
31988
|
}
|
|
32054
31989
|
}
|
|
@@ -32071,40 +32006,40 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
32071
32006
|
const proposedSlots = proposed["$slots"] ?? {};
|
|
32072
32007
|
const proposedSlotNames = new Set(Object.keys(proposedSlots));
|
|
32073
32008
|
const currentSlotAllowed = current.currentSlotAllowed ?? {};
|
|
32074
|
-
for (const
|
|
32075
|
-
if (!currentSlots.has(
|
|
32076
|
-
lines.push({ key: `slot-${
|
|
32009
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
32010
|
+
if (!currentSlots.has(name2)) {
|
|
32011
|
+
lines.push({ key: `slot-${name2}-add`, color: PALETTE.success, text: `+ slot: ${name2}` });
|
|
32077
32012
|
}
|
|
32078
32013
|
}
|
|
32079
|
-
for (const
|
|
32080
|
-
if (!proposedSlotNames.has(
|
|
32081
|
-
lines.push({ key: `slot-${
|
|
32014
|
+
for (const name2 of [...currentSlots].sort()) {
|
|
32015
|
+
if (!proposedSlotNames.has(name2)) {
|
|
32016
|
+
lines.push({ key: `slot-${name2}-rm`, color: PALETTE.error, text: `- slot: ${name2}` });
|
|
32082
32017
|
}
|
|
32083
32018
|
}
|
|
32084
|
-
for (const
|
|
32085
|
-
const nextAllowed = normalizeAllowedComponents(proposedSlots[
|
|
32086
|
-
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[
|
|
32087
|
-
const prevExists = currentSlots.has(
|
|
32019
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
32020
|
+
const nextAllowed = normalizeAllowedComponents(proposedSlots[name2]?.["$allowedComponents"]);
|
|
32021
|
+
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[name2]);
|
|
32022
|
+
const prevExists = currentSlots.has(name2);
|
|
32088
32023
|
if (!prevExists) {
|
|
32089
32024
|
if (nextAllowed.length > 0) {
|
|
32090
32025
|
lines.push({
|
|
32091
|
-
key: `slot-${
|
|
32026
|
+
key: `slot-${name2}-allow-new`,
|
|
32092
32027
|
color: PALETTE.success,
|
|
32093
|
-
text: `+ slot ${
|
|
32028
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
32094
32029
|
});
|
|
32095
32030
|
}
|
|
32096
32031
|
continue;
|
|
32097
32032
|
}
|
|
32098
32033
|
if (arraysEqual(prevAllowed, nextAllowed)) continue;
|
|
32099
32034
|
lines.push({
|
|
32100
|
-
key: `slot-${
|
|
32035
|
+
key: `slot-${name2}-allow-old`,
|
|
32101
32036
|
color: PALETTE.error,
|
|
32102
|
-
text: `- slot ${
|
|
32037
|
+
text: `- slot ${name2} allowedComponents: [${prevAllowed.join(", ")}]`
|
|
32103
32038
|
});
|
|
32104
32039
|
lines.push({
|
|
32105
|
-
key: `slot-${
|
|
32040
|
+
key: `slot-${name2}-allow-new`,
|
|
32106
32041
|
color: PALETTE.success,
|
|
32107
|
-
text: `+ slot ${
|
|
32042
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
32108
32043
|
});
|
|
32109
32044
|
}
|
|
32110
32045
|
return lines;
|
|
@@ -32140,7 +32075,7 @@ function normalizeType(type) {
|
|
|
32140
32075
|
return type.toLowerCase();
|
|
32141
32076
|
}
|
|
32142
32077
|
}
|
|
32143
|
-
function diffProperty(
|
|
32078
|
+
function diffProperty(name2, old, newDef) {
|
|
32144
32079
|
const diffs = [];
|
|
32145
32080
|
const newType = newDef["$type"] ?? "";
|
|
32146
32081
|
const newCategory = newDef["$category"] ?? "";
|
|
@@ -32151,15 +32086,15 @@ function diffProperty(name, old, newDef) {
|
|
|
32151
32086
|
const requiredChanged = old.required !== newRequired;
|
|
32152
32087
|
const defaultChanged = JSON.stringify(old.default) !== JSON.stringify(newDefault);
|
|
32153
32088
|
if (!typeChanged && !categoryChanged && !requiredChanged && !defaultChanged) return [];
|
|
32154
|
-
diffs.push({ key: `${
|
|
32155
|
-
diffs.push({ key: `${
|
|
32089
|
+
diffs.push({ key: `${name2}-old`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(old)}` });
|
|
32090
|
+
diffs.push({ key: `${name2}-new`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(newDef)}` });
|
|
32156
32091
|
return diffs;
|
|
32157
32092
|
}
|
|
32158
32093
|
function formatDefault(value) {
|
|
32159
32094
|
const sys = value?.sys;
|
|
32160
32095
|
if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
|
|
32161
|
-
const
|
|
32162
|
-
if (
|
|
32096
|
+
const name2 = sys.urn.split("/designTokens/")[1];
|
|
32097
|
+
if (name2) return name2;
|
|
32163
32098
|
}
|
|
32164
32099
|
return JSON.stringify(value);
|
|
32165
32100
|
}
|
|
@@ -32212,7 +32147,7 @@ var init_preview_confirmation_input = __esm({
|
|
|
32212
32147
|
});
|
|
32213
32148
|
|
|
32214
32149
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
32215
|
-
import { useEffect as
|
|
32150
|
+
import { useEffect as useEffect23, useState as useState30, useMemo as useMemo7 } from "react";
|
|
32216
32151
|
import { Box as Box44, Text as Text46 } from "ink";
|
|
32217
32152
|
import { Fragment as Fragment16, jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
32218
32153
|
function buildPreviewSummaryLines(preview) {
|
|
@@ -32225,8 +32160,8 @@ function buildPreviewSummaryLines(preview) {
|
|
|
32225
32160
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
32226
32161
|
});
|
|
32227
32162
|
for (const [index, item] of components.new.entries()) {
|
|
32228
|
-
const
|
|
32229
|
-
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${
|
|
32163
|
+
const name2 = item.key ?? item.$name ?? "unknown";
|
|
32164
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
32230
32165
|
}
|
|
32231
32166
|
}
|
|
32232
32167
|
if (components.changed.length > 0) {
|
|
@@ -32319,27 +32254,27 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
32319
32254
|
}
|
|
32320
32255
|
return void 0;
|
|
32321
32256
|
}
|
|
32322
|
-
function appendChangedPreviewLine(lines, keyPrefix,
|
|
32257
|
+
function appendChangedPreviewLine(lines, keyPrefix, name2, hasPendingDraftChanges, changeClassification) {
|
|
32323
32258
|
lines.push({
|
|
32324
|
-
key: `${keyPrefix}-h-${
|
|
32259
|
+
key: `${keyPrefix}-h-${name2}`,
|
|
32325
32260
|
color: PALETTE.warning,
|
|
32326
|
-
text: ` ~ ${
|
|
32261
|
+
text: ` ~ ${name2}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
32327
32262
|
});
|
|
32328
32263
|
if (changeClassification?.classification !== "breaking") return;
|
|
32329
32264
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
32330
|
-
lines.push({ key: `${keyPrefix}-b-${
|
|
32265
|
+
lines.push({ key: `${keyPrefix}-b-${name2}`, color: PALETTE.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
32331
32266
|
}
|
|
32332
32267
|
function buildPreviewDiffLines(preview) {
|
|
32333
32268
|
const lines = [];
|
|
32334
32269
|
const { components, tokens } = preview;
|
|
32335
32270
|
for (const item of components.new) {
|
|
32336
32271
|
const raw = item;
|
|
32337
|
-
const
|
|
32338
|
-
lines.push({ key: `comp-new-${
|
|
32272
|
+
const name2 = raw.key ?? raw.$name ?? "unknown";
|
|
32273
|
+
lines.push({ key: `comp-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
32339
32274
|
const slots = raw.$slots ?? {};
|
|
32340
32275
|
for (const slotName of Object.keys(slots).sort()) {
|
|
32341
32276
|
lines.push({
|
|
32342
|
-
key: `comp-new-${
|
|
32277
|
+
key: `comp-new-${name2}-slot-${slotName}`,
|
|
32343
32278
|
color: PALETTE.success,
|
|
32344
32279
|
text: ` slot: ${slotName}`
|
|
32345
32280
|
});
|
|
@@ -32347,7 +32282,7 @@ function buildPreviewDiffLines(preview) {
|
|
|
32347
32282
|
if (Array.isArray(allowed) && allowed.length > 0) {
|
|
32348
32283
|
const names = allowed.filter((n) => typeof n === "string");
|
|
32349
32284
|
lines.push({
|
|
32350
|
-
key: `comp-new-${
|
|
32285
|
+
key: `comp-new-${name2}-slot-${slotName}-allow`,
|
|
32351
32286
|
color: PALETTE.success,
|
|
32352
32287
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
32353
32288
|
});
|
|
@@ -32385,8 +32320,8 @@ function buildPreviewDiffLines(preview) {
|
|
|
32385
32320
|
}
|
|
32386
32321
|
for (const item of tokens.new) {
|
|
32387
32322
|
const raw = item;
|
|
32388
|
-
const
|
|
32389
|
-
lines.push({ key: `tok-new-${
|
|
32323
|
+
const name2 = raw.name ?? raw.path ?? "unknown";
|
|
32324
|
+
lines.push({ key: `tok-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
32390
32325
|
}
|
|
32391
32326
|
for (const item of tokens.removed) {
|
|
32392
32327
|
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
|
|
@@ -32422,7 +32357,7 @@ function WizardPreviewStep({
|
|
|
32422
32357
|
const activeLines = diffExpanded ? diffLines : summaryLines;
|
|
32423
32358
|
const maxScroll = Math.max(0, activeLines.length - viewportHeight);
|
|
32424
32359
|
const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
|
|
32425
|
-
|
|
32360
|
+
useEffect23(() => {
|
|
32426
32361
|
setScrollOffset((previous) => Math.min(previous, maxScroll));
|
|
32427
32362
|
}, [maxScroll]);
|
|
32428
32363
|
useImmediateInput((input, key) => {
|
|
@@ -33470,7 +33405,7 @@ var init_controller = __esm({
|
|
|
33470
33405
|
});
|
|
33471
33406
|
|
|
33472
33407
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
33473
|
-
import { useEffect as
|
|
33408
|
+
import { useEffect as useEffect24, useRef as useRef17, useSyncExternalStore } from "react";
|
|
33474
33409
|
function useFlow(start, options = {}) {
|
|
33475
33410
|
const controller = useRef17();
|
|
33476
33411
|
if (start && !controller.current) {
|
|
@@ -33489,7 +33424,7 @@ function useFlow(start, options = {}) {
|
|
|
33489
33424
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
33490
33425
|
() => current?.getState()
|
|
33491
33426
|
);
|
|
33492
|
-
|
|
33427
|
+
useEffect24(() => {
|
|
33493
33428
|
if (!start) controller.current = void 0;
|
|
33494
33429
|
}, [start]);
|
|
33495
33430
|
return current && state2 ? { controller: current, state: state2 } : void 0;
|
|
@@ -33568,7 +33503,7 @@ var init_help_info = __esm({
|
|
|
33568
33503
|
});
|
|
33569
33504
|
|
|
33570
33505
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
33571
|
-
import { useEffect as
|
|
33506
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
33572
33507
|
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
33573
33508
|
import { Fragment as Fragment17, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33574
33509
|
function Section({ title, rows }) {
|
|
@@ -33582,7 +33517,7 @@ function Section({ title, rows }) {
|
|
|
33582
33517
|
}
|
|
33583
33518
|
function HelpScreen({ onDone }) {
|
|
33584
33519
|
const [info, setInfo] = useState31();
|
|
33585
|
-
|
|
33520
|
+
useEffect25(() => {
|
|
33586
33521
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
33587
33522
|
void readHelpInfo().then(setInfo);
|
|
33588
33523
|
}, []);
|
|
@@ -33690,14 +33625,53 @@ var init_PageContainer3 = __esm({
|
|
|
33690
33625
|
}
|
|
33691
33626
|
});
|
|
33692
33627
|
|
|
33628
|
+
// packages/experience-design-system-cli/src/tui/settings/shared/debug-trail.ts
|
|
33629
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
33630
|
+
function diffSnapshots(before, after) {
|
|
33631
|
+
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])];
|
|
33632
|
+
const changed_fields = names.filter((name2) => before[name2] !== after[name2]);
|
|
33633
|
+
return { changed: changed_fields.length > 0, changed_fields };
|
|
33634
|
+
}
|
|
33635
|
+
function createTrail(limit = DEFAULT_TRAIL_LIMIT) {
|
|
33636
|
+
const actions = [];
|
|
33637
|
+
return {
|
|
33638
|
+
record(action) {
|
|
33639
|
+
actions.push(action);
|
|
33640
|
+
if (actions.length > limit) actions.shift();
|
|
33641
|
+
},
|
|
33642
|
+
entries: () => [...actions]
|
|
33643
|
+
};
|
|
33644
|
+
}
|
|
33645
|
+
function scrubError(error, secrets) {
|
|
33646
|
+
let message = error instanceof Error ? error.message : String(error);
|
|
33647
|
+
for (const secret of secrets) {
|
|
33648
|
+
if (secret.length < MIN_SECRET_LENGTH) continue;
|
|
33649
|
+
for (const form of /* @__PURE__ */ new Set([secret, encodeURIComponent(secret)])) message = message.split(form).join("[redacted]");
|
|
33650
|
+
}
|
|
33651
|
+
return message;
|
|
33652
|
+
}
|
|
33653
|
+
function describeSettingsFile() {
|
|
33654
|
+
const path5 = configFilePath2();
|
|
33655
|
+
return { path: path5, eds_home_set: Boolean(process.env["EDS_HOME"]), exists: existsSync11(path5) };
|
|
33656
|
+
}
|
|
33657
|
+
var DEFAULT_TRAIL_LIMIT, MIN_SECRET_LENGTH;
|
|
33658
|
+
var init_debug_trail = __esm({
|
|
33659
|
+
"packages/experience-design-system-cli/src/tui/settings/shared/debug-trail.ts"() {
|
|
33660
|
+
"use strict";
|
|
33661
|
+
init_config();
|
|
33662
|
+
DEFAULT_TRAIL_LIMIT = 30;
|
|
33663
|
+
MIN_SECRET_LENGTH = 6;
|
|
33664
|
+
}
|
|
33665
|
+
});
|
|
33666
|
+
|
|
33693
33667
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-status.ts
|
|
33694
33668
|
import { execFile as execFile2 } from "node:child_process";
|
|
33695
33669
|
import { access as access5, constants } from "node:fs/promises";
|
|
33696
|
-
function effectiveBinary(
|
|
33697
|
-
return savedBinary.trim() || AGENT_BINARIES[
|
|
33670
|
+
function effectiveBinary(name2, savedBinary) {
|
|
33671
|
+
return savedBinary.trim() || AGENT_BINARIES[name2];
|
|
33698
33672
|
}
|
|
33699
|
-
function defaultModelLabel(
|
|
33700
|
-
const model = DEFAULT_MODELS[
|
|
33673
|
+
function defaultModelLabel(name2) {
|
|
33674
|
+
const model = DEFAULT_MODELS[name2];
|
|
33701
33675
|
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
33702
33676
|
}
|
|
33703
33677
|
function resolveOnPath(binary) {
|
|
@@ -33724,32 +33698,32 @@ function readVersion(binary) {
|
|
|
33724
33698
|
});
|
|
33725
33699
|
});
|
|
33726
33700
|
}
|
|
33727
|
-
async function inspect(
|
|
33728
|
-
const target = effectiveBinary(
|
|
33701
|
+
async function inspect(name2, binary) {
|
|
33702
|
+
const target = effectiveBinary(name2, binary);
|
|
33729
33703
|
const found = await resolveOnPath(target);
|
|
33730
33704
|
if (!found) return { checks: [fail3("path", `\`${target}\` was not found or is not executable`)], found: null };
|
|
33731
33705
|
const checks = [pass("path", found)];
|
|
33732
33706
|
checks.push(await readVersion(found));
|
|
33733
|
-
if (
|
|
33734
|
-
const auth = await withBinaryEnv(
|
|
33707
|
+
if (name2 === "claude") {
|
|
33708
|
+
const auth = await withBinaryEnv(name2, found, () => checkAgentAuth(name2));
|
|
33735
33709
|
checks.push(
|
|
33736
33710
|
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
33737
33711
|
);
|
|
33738
33712
|
}
|
|
33739
33713
|
return { checks, found };
|
|
33740
33714
|
}
|
|
33741
|
-
async function inspectAgent(
|
|
33742
|
-
return (await inspect(
|
|
33715
|
+
async function inspectAgent(name2, binary) {
|
|
33716
|
+
return (await inspect(name2, binary)).checks;
|
|
33743
33717
|
}
|
|
33744
|
-
async function testAgent(
|
|
33745
|
-
const { checks, found } = await inspect(
|
|
33718
|
+
async function testAgent(name2, binary, model) {
|
|
33719
|
+
const { checks, found } = await inspect(name2, binary);
|
|
33746
33720
|
if (!found || !checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
33747
33721
|
const started = Date.now();
|
|
33748
33722
|
const result = await withBinaryEnv(
|
|
33749
|
-
|
|
33723
|
+
name2,
|
|
33750
33724
|
found,
|
|
33751
33725
|
() => createLocalCliAgentInvoker().invoke({
|
|
33752
|
-
agent:
|
|
33726
|
+
agent: name2,
|
|
33753
33727
|
...model.trim() ? { model: model.trim() } : {},
|
|
33754
33728
|
prompt: TEST_PROMPT,
|
|
33755
33729
|
timeoutMs: PROMPT_TIMEOUT_MS
|
|
@@ -33765,7 +33739,7 @@ async function testAgent(name, binary, model) {
|
|
|
33765
33739
|
}
|
|
33766
33740
|
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
33767
33741
|
}
|
|
33768
|
-
function statusFromChecks(
|
|
33742
|
+
function statusFromChecks(name2, checks, savedBinary) {
|
|
33769
33743
|
if (checks.length === 0) return "checking";
|
|
33770
33744
|
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
33771
33745
|
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
@@ -33777,13 +33751,13 @@ function statusFromChecks(name, checks, savedBinary) {
|
|
|
33777
33751
|
}
|
|
33778
33752
|
const login = checks.find((check) => check.step === "login");
|
|
33779
33753
|
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
33780
|
-
return
|
|
33754
|
+
return name2 === "claude" ? "ready" : "unknown";
|
|
33781
33755
|
}
|
|
33782
|
-
function setupHint(
|
|
33783
|
-
if (status === "not-configured") return `${INSTALL_HINTS[
|
|
33784
|
-
if (status === "not-found") return `${INSTALL_HINTS[
|
|
33785
|
-
if (status === "not-logged-in") return LOGIN_HINTS[
|
|
33786
|
-
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[
|
|
33756
|
+
function setupHint(name2, status) {
|
|
33757
|
+
if (status === "not-configured") return `${INSTALL_HINTS[name2]}, or set its command path in settings`;
|
|
33758
|
+
if (status === "not-found") return `${INSTALL_HINTS[name2]}, or correct the command path in settings`;
|
|
33759
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name2];
|
|
33760
|
+
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[name2]}`;
|
|
33787
33761
|
if (status === "timed-out") return "it may be slow or waiting for input; run the test again, or try it in a terminal";
|
|
33788
33762
|
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
33789
33763
|
return "";
|
|
@@ -33795,14 +33769,14 @@ function testOutcome(checks) {
|
|
|
33795
33769
|
if (prompt.timedOut) return { ok: false, text: `Test timed out: ${prompt.detail}` };
|
|
33796
33770
|
return { ok: false, text: `Test failed: ${prompt.detail}` };
|
|
33797
33771
|
}
|
|
33798
|
-
function modelLine(
|
|
33772
|
+
function modelLine(name2, savedModel) {
|
|
33799
33773
|
const model = savedModel.trim();
|
|
33800
|
-
return model ? model : `${defaultModelLabel(
|
|
33774
|
+
return model ? model : `${defaultModelLabel(name2)} (built-in default)`;
|
|
33801
33775
|
}
|
|
33802
|
-
function baseRows(
|
|
33776
|
+
function baseRows(name2, checks, savedBinary) {
|
|
33803
33777
|
const path5 = checks.find((check) => check.step === "path");
|
|
33804
33778
|
const version2 = checks.find((check) => check.step === "version");
|
|
33805
|
-
const hint = setupHint(
|
|
33779
|
+
const hint = setupHint(name2, statusFromChecks(name2, checks, savedBinary));
|
|
33806
33780
|
const setup = hint ? { label: "Setup", value: hint, tone: "muted" } : void 0;
|
|
33807
33781
|
if (!path5?.ok) {
|
|
33808
33782
|
const saved = savedBinary.trim() !== "";
|
|
@@ -33824,15 +33798,15 @@ function baseRows(name, checks, savedBinary) {
|
|
|
33824
33798
|
found: true
|
|
33825
33799
|
};
|
|
33826
33800
|
}
|
|
33827
|
-
function panelRows(
|
|
33801
|
+
function panelRows(name2, checks, settings) {
|
|
33828
33802
|
if (!checks) return checking;
|
|
33829
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
33830
|
-
const model = { label: "Model", value: modelLine(
|
|
33803
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, settings.binary);
|
|
33804
|
+
const model = { label: "Model", value: modelLine(name2, settings.model), tone: "muted" };
|
|
33831
33805
|
return [command, ...found ? [...version2?.tone === "ok" ? [version2] : [], model] : [], ...setup ? [setup] : []];
|
|
33832
33806
|
}
|
|
33833
|
-
function statusRows(
|
|
33807
|
+
function statusRows(name2, checks, savedBinary) {
|
|
33834
33808
|
if (!checks) return checking;
|
|
33835
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
33809
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, savedBinary);
|
|
33836
33810
|
if (!found) return [command];
|
|
33837
33811
|
const login = checks.find((check) => check.step === "login");
|
|
33838
33812
|
const prompt = checks.find((check) => check.step === "prompt");
|
|
@@ -33851,8 +33825,8 @@ function statusRows(name, checks, savedBinary) {
|
|
|
33851
33825
|
const testRow = prompt ? [{ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" }] : [];
|
|
33852
33826
|
return [command, ...version2 ? [version2] : [], loginRow, ...testRow, ...setup ? [setup] : []];
|
|
33853
33827
|
}
|
|
33854
|
-
async function withBinaryEnv(
|
|
33855
|
-
const key = `EDS_AGENT_BINARY_${
|
|
33828
|
+
async function withBinaryEnv(name2, binary, run) {
|
|
33829
|
+
const key = `EDS_AGENT_BINARY_${name2.toUpperCase()}`;
|
|
33856
33830
|
const previous = process.env[key];
|
|
33857
33831
|
process.env[key] = binary;
|
|
33858
33832
|
try {
|
|
@@ -33903,9 +33877,9 @@ var init_agent_status = __esm({
|
|
|
33903
33877
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-debug.ts
|
|
33904
33878
|
function agentSnapshot(config) {
|
|
33905
33879
|
const snapshot = { default_agent: config.defaultAgent };
|
|
33906
|
-
for (const
|
|
33907
|
-
snapshot[`${
|
|
33908
|
-
snapshot[`${
|
|
33880
|
+
for (const name2 of AGENT_NAMES) {
|
|
33881
|
+
snapshot[`${name2}.model`] = config.agents[name2].model;
|
|
33882
|
+
snapshot[`${name2}.binary`] = config.agents[name2].binary;
|
|
33909
33883
|
}
|
|
33910
33884
|
return snapshot;
|
|
33911
33885
|
}
|
|
@@ -33922,10 +33896,10 @@ function environmentFrom(checks, savedBinary, envValue) {
|
|
|
33922
33896
|
}
|
|
33923
33897
|
async function describeAgents(config) {
|
|
33924
33898
|
const entries = await Promise.all(
|
|
33925
|
-
AGENT_NAMES.map(async (
|
|
33926
|
-
const saved = config.agents[
|
|
33927
|
-
const checks = await inspectAgent(
|
|
33928
|
-
return [
|
|
33899
|
+
AGENT_NAMES.map(async (name2) => {
|
|
33900
|
+
const saved = config.agents[name2].binary;
|
|
33901
|
+
const checks = await inspectAgent(name2, saved);
|
|
33902
|
+
return [name2, environmentFrom(checks, saved, process.env[`EDS_AGENT_BINARY_${name2.toUpperCase()}`])];
|
|
33929
33903
|
})
|
|
33930
33904
|
);
|
|
33931
33905
|
return Object.fromEntries(entries);
|
|
@@ -33942,11 +33916,11 @@ var init_agent_debug = __esm({
|
|
|
33942
33916
|
import { Text as Text49 } from "ink";
|
|
33943
33917
|
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
33944
33918
|
function AgentStatusBadge({
|
|
33945
|
-
name,
|
|
33919
|
+
name: name2,
|
|
33946
33920
|
checks,
|
|
33947
33921
|
binary
|
|
33948
33922
|
}) {
|
|
33949
|
-
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(
|
|
33923
|
+
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name2, checks, binary) : "checking"];
|
|
33950
33924
|
return /* @__PURE__ */ jsx59(Text49, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
33951
33925
|
}
|
|
33952
33926
|
var TONE_COLOR;
|
|
@@ -33964,7 +33938,7 @@ var init_AgentStatusBadge = __esm({
|
|
|
33964
33938
|
});
|
|
33965
33939
|
|
|
33966
33940
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
33967
|
-
import { useEffect as
|
|
33941
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
33968
33942
|
import { Box as Box48, Text as Text50 } from "ink";
|
|
33969
33943
|
import { jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
33970
33944
|
function StatusHeading() {
|
|
@@ -33974,53 +33948,53 @@ function StatusHeading() {
|
|
|
33974
33948
|
] });
|
|
33975
33949
|
}
|
|
33976
33950
|
function AgentDetail({
|
|
33977
|
-
name,
|
|
33951
|
+
name: name2,
|
|
33978
33952
|
config,
|
|
33979
33953
|
setConfig,
|
|
33980
33954
|
onBack,
|
|
33981
33955
|
record: record3
|
|
33982
33956
|
}) {
|
|
33983
|
-
const settings = config.agents[
|
|
33957
|
+
const settings = config.agents[name2];
|
|
33984
33958
|
const [saving, setSaving] = useState33(false);
|
|
33985
33959
|
const [testing, setTesting] = useState33(false);
|
|
33986
33960
|
const [notice, setNotice] = useState33(null);
|
|
33987
33961
|
const [checks, setChecks] = useState33(void 0);
|
|
33988
|
-
|
|
33962
|
+
useEffect26(() => {
|
|
33989
33963
|
let active = true;
|
|
33990
33964
|
setChecks(void 0);
|
|
33991
33965
|
const timer = setTimeout(() => {
|
|
33992
|
-
void inspectAgent(
|
|
33966
|
+
void inspectAgent(name2, settings.binary).then((result) => active && setChecks(result));
|
|
33993
33967
|
}, INSPECT_DELAY_MS);
|
|
33994
33968
|
return () => {
|
|
33995
33969
|
active = false;
|
|
33996
33970
|
clearTimeout(timer);
|
|
33997
33971
|
};
|
|
33998
|
-
}, [
|
|
33972
|
+
}, [name2, settings.binary]);
|
|
33999
33973
|
const save = () => {
|
|
34000
33974
|
setSaving(true);
|
|
34001
33975
|
setNotice(null);
|
|
34002
33976
|
writeAgentConfig(config).then(() => {
|
|
34003
33977
|
applyBinaryOverrides(config);
|
|
34004
|
-
record3(`saved ${
|
|
34005
|
-
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[
|
|
33978
|
+
record3(`saved ${name2}`);
|
|
33979
|
+
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[name2]} settings are written to config.json` });
|
|
34006
33980
|
}).catch((err) => {
|
|
34007
|
-
record3(`saving ${
|
|
33981
|
+
record3(`saving ${name2} failed`, err);
|
|
34008
33982
|
setNotice({ kind: "error", text: `Not saved: ${err instanceof Error ? err.message : String(err)}` });
|
|
34009
33983
|
}).finally(() => setSaving(false));
|
|
34010
33984
|
};
|
|
34011
33985
|
const runTest = () => {
|
|
34012
33986
|
setTesting(true);
|
|
34013
33987
|
setNotice(null);
|
|
34014
|
-
testAgent(
|
|
33988
|
+
testAgent(name2, settings.binary, settings.model).then((result) => {
|
|
34015
33989
|
setChecks(result);
|
|
34016
33990
|
const outcome = testOutcome(result);
|
|
34017
33991
|
if (!outcome || !outcome.ok)
|
|
34018
|
-
record3(`test of ${
|
|
33992
|
+
record3(`test of ${name2} failed: ${outcome?.text ?? "the agent could not be started"}`);
|
|
34019
33993
|
setNotice(
|
|
34020
33994
|
outcome ? { kind: outcome.ok ? "success" : "error", text: outcome.text } : { kind: "error", text: "Test not run: the agent could not be started (see Status)" }
|
|
34021
33995
|
);
|
|
34022
33996
|
}).catch((err) => {
|
|
34023
|
-
record3(`test of ${
|
|
33997
|
+
record3(`test of ${name2} could not run`, err);
|
|
34024
33998
|
setNotice({ kind: "error", text: `Test could not run: ${err instanceof Error ? err.message : String(err)}` });
|
|
34025
33999
|
}).finally(() => setTesting(false));
|
|
34026
34000
|
};
|
|
@@ -34031,19 +34005,19 @@ function AgentDetail({
|
|
|
34031
34005
|
hint: "run test",
|
|
34032
34006
|
onRun: runTest
|
|
34033
34007
|
};
|
|
34034
|
-
const formFields = fields(
|
|
34008
|
+
const formFields = fields(name2);
|
|
34035
34009
|
const labelWidth = formLabelWidth([...formFields, action]);
|
|
34036
34010
|
return /* @__PURE__ */ jsx60(
|
|
34037
34011
|
FieldForm,
|
|
34038
34012
|
{
|
|
34039
|
-
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[
|
|
34040
|
-
subtitle: config.defaultAgent ===
|
|
34013
|
+
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[name2]}`,
|
|
34014
|
+
subtitle: config.defaultAgent === name2 ? "This is the default agent." : `Runs the \`${AGENT_BINARIES[name2]}\` command.`,
|
|
34041
34015
|
fields: formFields,
|
|
34042
34016
|
values: { binary: settings.binary, model: settings.model },
|
|
34043
34017
|
onChange: (key, value) => {
|
|
34044
|
-
setConfig({ ...config, agents: { ...config.agents, [
|
|
34018
|
+
setConfig({ ...config, agents: { ...config.agents, [name2]: { ...settings, [key]: value } } });
|
|
34045
34019
|
setNotice(null);
|
|
34046
|
-
record3(`edited ${
|
|
34020
|
+
record3(`edited ${name2}.${key}`);
|
|
34047
34021
|
},
|
|
34048
34022
|
onSave: save,
|
|
34049
34023
|
onQuit: onBack,
|
|
@@ -34052,7 +34026,7 @@ function AgentDetail({
|
|
|
34052
34026
|
busy: saving || testing,
|
|
34053
34027
|
children: /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
34054
34028
|
/* @__PURE__ */ jsx60(StatusHeading, {}),
|
|
34055
|
-
statusRows(
|
|
34029
|
+
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))
|
|
34056
34030
|
] })
|
|
34057
34031
|
}
|
|
34058
34032
|
);
|
|
@@ -34068,16 +34042,16 @@ var init_AgentDetail = __esm({
|
|
|
34068
34042
|
init_agent_status();
|
|
34069
34043
|
init_AgentStatusBadge();
|
|
34070
34044
|
init_apply_binary_overrides();
|
|
34071
|
-
fields = (
|
|
34072
|
-
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[
|
|
34073
|
-
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(
|
|
34045
|
+
fields = (name2) => [
|
|
34046
|
+
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[name2]}\` from the PATH)` },
|
|
34047
|
+
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name2)})` }
|
|
34074
34048
|
];
|
|
34075
34049
|
INSPECT_DELAY_MS = 400;
|
|
34076
34050
|
}
|
|
34077
34051
|
});
|
|
34078
34052
|
|
|
34079
34053
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
34080
|
-
import { useEffect as
|
|
34054
|
+
import { useEffect as useEffect27, useRef as useRef18, useState as useState34 } from "react";
|
|
34081
34055
|
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
34082
34056
|
import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
34083
34057
|
function AgentsScreen({ onDone }) {
|
|
@@ -34095,13 +34069,13 @@ function AgentsScreen({ onDone }) {
|
|
|
34095
34069
|
error: ""
|
|
34096
34070
|
}).current;
|
|
34097
34071
|
const inspectAll = (loaded) => {
|
|
34098
|
-
for (const
|
|
34099
|
-
void inspectAgent(
|
|
34100
|
-
(result) => setChecks((previous) => ({ ...previous, [
|
|
34072
|
+
for (const name2 of AGENT_NAMES) {
|
|
34073
|
+
void inspectAgent(name2, loaded.agents[name2].binary).then(
|
|
34074
|
+
(result) => setChecks((previous) => ({ ...previous, [name2]: result }))
|
|
34101
34075
|
);
|
|
34102
34076
|
}
|
|
34103
34077
|
};
|
|
34104
|
-
|
|
34078
|
+
useEffect27(() => {
|
|
34105
34079
|
readAgentConfig().then((loaded) => {
|
|
34106
34080
|
setConfig(loaded);
|
|
34107
34081
|
inspectAll(loaded);
|
|
@@ -34137,21 +34111,21 @@ function AgentsScreen({ onDone }) {
|
|
|
34137
34111
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
34138
34112
|
});
|
|
34139
34113
|
};
|
|
34140
|
-
const makeDefault = (
|
|
34114
|
+
const makeDefault = (name2) => {
|
|
34141
34115
|
if (!config || saving) return;
|
|
34142
|
-
if (
|
|
34143
|
-
setNotice({ kind: "success", text: `${AGENT_LABELS[
|
|
34116
|
+
if (name2 === config.defaultAgent) {
|
|
34117
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name2]} is already the default agent` });
|
|
34144
34118
|
return;
|
|
34145
34119
|
}
|
|
34146
34120
|
setSaving(true);
|
|
34147
34121
|
setNotice(null);
|
|
34148
|
-
writeAgentConfig({ ...config, defaultAgent:
|
|
34149
|
-
setConfig((current) => current ? { ...current, defaultAgent:
|
|
34150
|
-
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[
|
|
34151
|
-
visit.trail.record(`made ${
|
|
34122
|
+
writeAgentConfig({ ...config, defaultAgent: name2, defaultChosen: true }).then(() => {
|
|
34123
|
+
setConfig((current) => current ? { ...current, defaultAgent: name2, defaultChosen: true } : current);
|
|
34124
|
+
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name2]}` });
|
|
34125
|
+
visit.trail.record(`made ${name2} the default`);
|
|
34152
34126
|
}).catch((err) => {
|
|
34153
34127
|
visit.error = scrubError(err, []);
|
|
34154
|
-
visit.trail.record(`making ${
|
|
34128
|
+
visit.trail.record(`making ${name2} the default failed`);
|
|
34155
34129
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
34156
34130
|
}).finally(() => setSaving(false));
|
|
34157
34131
|
};
|
|
@@ -34238,14 +34212,14 @@ function AgentsScreen({ onDone }) {
|
|
|
34238
34212
|
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
34239
34213
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "STATUS" })
|
|
34240
34214
|
] }),
|
|
34241
|
-
AGENT_NAMES.map((
|
|
34242
|
-
const isFocused = focusedAgent ===
|
|
34215
|
+
AGENT_NAMES.map((name2) => {
|
|
34216
|
+
const isFocused = focusedAgent === name2;
|
|
34243
34217
|
return /* @__PURE__ */ jsxs49(Box49, { gap: 1, children: [
|
|
34244
34218
|
/* @__PURE__ */ jsx61(Text51, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
34245
|
-
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children:
|
|
34246
|
-
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[
|
|
34247
|
-
/* @__PURE__ */ jsx61(AgentStatusBadge, { name, checks: checks[
|
|
34248
|
-
] },
|
|
34219
|
+
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children: name2 === config.defaultAgent ? "\u2605" : " " }),
|
|
34220
|
+
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name2] }) }),
|
|
34221
|
+
/* @__PURE__ */ jsx61(AgentStatusBadge, { name: name2, checks: checks[name2], binary: config.agents[name2].binary })
|
|
34222
|
+
] }, name2);
|
|
34249
34223
|
}),
|
|
34250
34224
|
/* @__PURE__ */ jsxs49(Box49, { flexDirection: "column", marginTop: 1, children: [
|
|
34251
34225
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
@@ -34327,7 +34301,7 @@ var init_project_store = __esm({
|
|
|
34327
34301
|
});
|
|
34328
34302
|
|
|
34329
34303
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
34330
|
-
import { useEffect as
|
|
34304
|
+
import { useEffect as useEffect28, useRef as useRef19, useState as useState35 } from "react";
|
|
34331
34305
|
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
34332
34306
|
import { Fragment as Fragment19, jsx as jsx62, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
34333
34307
|
function debugFields(config) {
|
|
@@ -34353,7 +34327,7 @@ function ProjectScreen({ onDone }) {
|
|
|
34353
34327
|
error: ""
|
|
34354
34328
|
}).current;
|
|
34355
34329
|
const scrub = (err) => scrubError(err, [config?.cmaToken ?? ""]);
|
|
34356
|
-
|
|
34330
|
+
useEffect28(() => {
|
|
34357
34331
|
readCredentials().then((cfg) => {
|
|
34358
34332
|
setConfig(cfg);
|
|
34359
34333
|
visit.before = snapshotOf(cfg);
|
|
@@ -34540,13 +34514,13 @@ var init_ConfigurationScreen = __esm({
|
|
|
34540
34514
|
});
|
|
34541
34515
|
|
|
34542
34516
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
34543
|
-
import { useEffect as
|
|
34517
|
+
import { useEffect as useEffect29, useState as useState37 } from "react";
|
|
34544
34518
|
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
34545
34519
|
import { Fragment as Fragment20, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
34546
34520
|
function OptInAnalyticsScreen({ onDone }) {
|
|
34547
34521
|
const [loading, setLoading] = useState37(true);
|
|
34548
34522
|
const [enabled, setEnabled] = useState37(true);
|
|
34549
|
-
|
|
34523
|
+
useEffect29(() => {
|
|
34550
34524
|
readAnalyticsSetting().then((setting) => {
|
|
34551
34525
|
setEnabled(setting.enabled);
|
|
34552
34526
|
setLoading(false);
|
|
@@ -34609,7 +34583,7 @@ var init_screen12 = __esm({
|
|
|
34609
34583
|
});
|
|
34610
34584
|
|
|
34611
34585
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
34612
|
-
import { useEffect as
|
|
34586
|
+
import { useEffect as useEffect30, useRef as useRef20, useState as useState38 } from "react";
|
|
34613
34587
|
import { Box as Box53, Text as Text55, useInput as useInput19 } from "ink";
|
|
34614
34588
|
import { Fragment as Fragment21, jsx as jsx65, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
34615
34589
|
function DebugModeScreen({ onDone }) {
|
|
@@ -34620,7 +34594,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
34620
34594
|
);
|
|
34621
34595
|
const [notice, setNotice] = useState38(null);
|
|
34622
34596
|
const visit = useRef20({ trail: createTrail(), before: void 0, error: "" }).current;
|
|
34623
|
-
|
|
34597
|
+
useEffect30(() => {
|
|
34624
34598
|
readDebugModeSetting().then((loaded) => {
|
|
34625
34599
|
setSetting(loaded);
|
|
34626
34600
|
setPending(loaded.retentionDays);
|
|
@@ -34761,7 +34735,7 @@ var app_exports = {};
|
|
|
34761
34735
|
__export(app_exports, {
|
|
34762
34736
|
runApp: () => runApp
|
|
34763
34737
|
});
|
|
34764
|
-
import { useEffect as
|
|
34738
|
+
import { useEffect as useEffect31, useState as useState39 } from "react";
|
|
34765
34739
|
import { Fragment as Fragment22, jsx as jsx66 } from "react/jsx-runtime";
|
|
34766
34740
|
function App({ importOptions, inkClear }) {
|
|
34767
34741
|
const [screen, setScreen] = useState39("start");
|
|
@@ -34795,7 +34769,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34795
34769
|
const [flowStart, setFlowStart] = useState39();
|
|
34796
34770
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
34797
34771
|
const [importDefaults, setImportDefaults] = useState39();
|
|
34798
|
-
|
|
34772
|
+
useEffect31(() => {
|
|
34799
34773
|
if (screen !== "import") {
|
|
34800
34774
|
setImportDefaults(void 0);
|
|
34801
34775
|
return;
|
|
@@ -34868,7 +34842,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34868
34842
|
}
|
|
34869
34843
|
});
|
|
34870
34844
|
};
|
|
34871
|
-
|
|
34845
|
+
useEffect31(() => {
|
|
34872
34846
|
if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
|
|
34873
34847
|
const { credentialsSkipped, input, tokens } = tokensOnlyRun;
|
|
34874
34848
|
const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
|
|
@@ -34890,12 +34864,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34890
34864
|
}
|
|
34891
34865
|
});
|
|
34892
34866
|
}, [tokensOnly, tokensOnlyRun]);
|
|
34893
|
-
|
|
34867
|
+
useEffect31(() => {
|
|
34894
34868
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
34895
34869
|
setExtractionRun(void 0);
|
|
34896
34870
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
34897
34871
|
}, [extraction, extractionRun]);
|
|
34898
|
-
|
|
34872
|
+
useEffect31(() => {
|
|
34899
34873
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
34900
34874
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34901
34875
|
setGenerationInput({
|
|
@@ -34913,7 +34887,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34913
34887
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
34914
34888
|
});
|
|
34915
34889
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
34916
|
-
|
|
34890
|
+
useEffect31(() => {
|
|
34917
34891
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
34918
34892
|
const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34919
34893
|
inkClear();
|
|
@@ -35082,7 +35056,6 @@ function App({ importOptions, inkClear }) {
|
|
|
35082
35056
|
return /* @__PURE__ */ jsx66(
|
|
35083
35057
|
CredentialsScreen,
|
|
35084
35058
|
{
|
|
35085
|
-
mode: target,
|
|
35086
35059
|
initial: importDefaults.credentials,
|
|
35087
35060
|
tokensOnly: target === "tokens",
|
|
35088
35061
|
onBack: () => goBackFrom("credentials"),
|