@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/app.js
CHANGED
|
@@ -4,8 +4,8 @@ var __esm = (fn, res) => function __init() {
|
|
|
4
4
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
5
|
};
|
|
6
6
|
var __export = (target, all) => {
|
|
7
|
-
for (var
|
|
8
|
-
__defProp(target,
|
|
7
|
+
for (var name2 in all)
|
|
8
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
// packages/experience-design-system-cli/src/tui/package-root.ts
|
|
@@ -165,7 +165,7 @@ async function pruneExpiredLogs(base, retentionDays, now = Date.now()) {
|
|
|
165
165
|
const contentfulDir = join4(base, ".contentful");
|
|
166
166
|
const result = { logs: 0, folders: 0 };
|
|
167
167
|
try {
|
|
168
|
-
const sessions = (await readdir(contentfulDir)).filter((
|
|
168
|
+
const sessions = (await readdir(contentfulDir)).filter((name2) => SESSION_FOLDER.test(name2));
|
|
169
169
|
for (const session of sessions) {
|
|
170
170
|
const files = await logFilesIn(join4(contentfulDir, session, "debug")).catch(() => []);
|
|
171
171
|
for (const file of files) {
|
|
@@ -721,8 +721,8 @@ var init_extract_sentinel_output = __esm({
|
|
|
721
721
|
});
|
|
722
722
|
|
|
723
723
|
// packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js
|
|
724
|
-
function formatGenerateProgressLine(done, total,
|
|
725
|
-
return `progress=generate:${done}/${total}:${
|
|
724
|
+
function formatGenerateProgressLine(done, total, name2) {
|
|
725
|
+
return `progress=generate:${done}/${total}:${name2}`;
|
|
726
726
|
}
|
|
727
727
|
var init_format_generate_progress_line = __esm({
|
|
728
728
|
"packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/metadata/format-generate-progress-line.js"() {
|
|
@@ -1408,14 +1408,14 @@ function formatToolCall(obj) {
|
|
|
1408
1408
|
return ` ${ansi.cyan("\u25C8")} ${slot}${req} ${ansi.dim(desc)}`;
|
|
1409
1409
|
}
|
|
1410
1410
|
case "select_component": {
|
|
1411
|
-
const
|
|
1411
|
+
const name2 = String(obj["name"] ?? "");
|
|
1412
1412
|
const reason = typeof obj["reason"] === "string" ? obj["reason"] : "";
|
|
1413
|
-
return ` ${ansi.green("+")} ${
|
|
1413
|
+
return ` ${ansi.green("+")} ${name2} ${ansi.dim(reason)}`;
|
|
1414
1414
|
}
|
|
1415
1415
|
case "reject_component": {
|
|
1416
|
-
const
|
|
1416
|
+
const name2 = String(obj["name"] ?? "");
|
|
1417
1417
|
const reason = typeof obj["reason"] === "string" ? obj["reason"] : "";
|
|
1418
|
-
return ` ${ansi.dim("\u2013")} ${
|
|
1418
|
+
return ` ${ansi.dim("\u2013")} ${name2} ${ansi.dim(reason)}`;
|
|
1419
1419
|
}
|
|
1420
1420
|
default:
|
|
1421
1421
|
return null;
|
|
@@ -2484,7 +2484,7 @@ var init_cache_keys = __esm({
|
|
|
2484
2484
|
});
|
|
2485
2485
|
|
|
2486
2486
|
// packages/experience-design-system-cli/app.tsx
|
|
2487
|
-
import { useEffect as
|
|
2487
|
+
import { useEffect as useEffect31, useState as useState39 } from "react";
|
|
2488
2488
|
|
|
2489
2489
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2490
2490
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -3573,17 +3573,17 @@ var TRUNCATED_MARKER = "/* truncated */";
|
|
|
3573
3573
|
function escapeForRegExp(value) {
|
|
3574
3574
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3575
3575
|
}
|
|
3576
|
-
function identifierPattern(
|
|
3577
|
-
return new RegExp(`(?<![A-Za-z0-9_$])${escapeForRegExp(
|
|
3576
|
+
function identifierPattern(name2) {
|
|
3577
|
+
return new RegExp(`(?<![A-Za-z0-9_$])${escapeForRegExp(name2)}(?![A-Za-z0-9_$])`);
|
|
3578
3578
|
}
|
|
3579
3579
|
function excerptAroundNames(text, names, maxChars, contextLines = 6) {
|
|
3580
3580
|
if (text.length <= maxChars)
|
|
3581
3581
|
return { content: text, usesNotShown: [] };
|
|
3582
|
-
const patterns = names.filter((
|
|
3582
|
+
const patterns = names.filter((name2) => name2.length > 0).map((name2) => ({ name: name2, pattern: identifierPattern(name2) }));
|
|
3583
3583
|
const lines = text.split("\n");
|
|
3584
3584
|
const windows = [];
|
|
3585
3585
|
lines.forEach((line, index) => {
|
|
3586
|
-
const mentioned = patterns.filter(({ pattern }) => pattern.test(line)).map(({ name }) =>
|
|
3586
|
+
const mentioned = patterns.filter(({ pattern }) => pattern.test(line)).map(({ name: name2 }) => name2);
|
|
3587
3587
|
if (mentioned.length === 0)
|
|
3588
3588
|
return;
|
|
3589
3589
|
const start = Math.max(0, index - contextLines);
|
|
@@ -3591,8 +3591,8 @@ function excerptAroundNames(text, names, maxChars, contextLines = 6) {
|
|
|
3591
3591
|
const last = windows[windows.length - 1];
|
|
3592
3592
|
if (last && start <= last.end + 1) {
|
|
3593
3593
|
last.end = Math.max(last.end, end);
|
|
3594
|
-
for (const
|
|
3595
|
-
last.names.add(
|
|
3594
|
+
for (const name2 of mentioned)
|
|
3595
|
+
last.names.add(name2);
|
|
3596
3596
|
} else {
|
|
3597
3597
|
windows.push({ start, end, names: new Set(mentioned) });
|
|
3598
3598
|
}
|
|
@@ -3603,8 +3603,8 @@ ${TRUNCATED_MARKER}`, usesNotShown: [] };
|
|
|
3603
3603
|
}
|
|
3604
3604
|
const lastWindowFor = /* @__PURE__ */ new Map();
|
|
3605
3605
|
for (const window of windows)
|
|
3606
|
-
for (const
|
|
3607
|
-
lastWindowFor.set(
|
|
3606
|
+
for (const name2 of window.names)
|
|
3607
|
+
lastWindowFor.set(name2, window);
|
|
3608
3608
|
const kept = [];
|
|
3609
3609
|
const cut = /* @__PURE__ */ new Set();
|
|
3610
3610
|
let used = 0;
|
|
@@ -3618,15 +3618,15 @@ ${ELLIPSIS_MARKER}
|
|
|
3618
3618
|
const head = chunk.slice(0, maxChars);
|
|
3619
3619
|
kept.push({ window, text: head });
|
|
3620
3620
|
used += head.length;
|
|
3621
|
-
for (const
|
|
3622
|
-
if (lastWindowFor.get(
|
|
3623
|
-
cut.add(
|
|
3621
|
+
for (const name2 of window.names) {
|
|
3622
|
+
if (lastWindowFor.get(name2) === window && !identifierPattern(name2).test(head))
|
|
3623
|
+
cut.add(name2);
|
|
3624
3624
|
}
|
|
3625
3625
|
continue;
|
|
3626
3626
|
}
|
|
3627
|
-
for (const
|
|
3628
|
-
if (lastWindowFor.get(
|
|
3629
|
-
cut.add(
|
|
3627
|
+
for (const name2 of window.names) {
|
|
3628
|
+
if (lastWindowFor.get(name2) === window)
|
|
3629
|
+
cut.add(name2);
|
|
3630
3630
|
}
|
|
3631
3631
|
continue;
|
|
3632
3632
|
}
|
|
@@ -3637,15 +3637,15 @@ ${ELLIPSIS_MARKER}
|
|
|
3637
3637
|
const parts = kept.map((entry, index) => (index > 0 ? `
|
|
3638
3638
|
${ELLIPSIS_MARKER}
|
|
3639
3639
|
` : "") + entry.text);
|
|
3640
|
-
const usesNotShown = names.filter((
|
|
3640
|
+
const usesNotShown = names.filter((name2, index) => cut.has(name2) && names.indexOf(name2) === index);
|
|
3641
3641
|
return { content: `${parts.join("")}
|
|
3642
3642
|
${TRUNCATED_MARKER}`, usesNotShown };
|
|
3643
3643
|
}
|
|
3644
3644
|
|
|
3645
3645
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/components/derive-component-id.js
|
|
3646
3646
|
import { createHash } from "node:crypto";
|
|
3647
|
-
function deriveComponentId(
|
|
3648
|
-
return createHash("sha256").update(`${
|
|
3647
|
+
function deriveComponentId(name2, source) {
|
|
3648
|
+
return createHash("sha256").update(`${name2}:${source}`).digest("hex").slice(0, 12);
|
|
3649
3649
|
}
|
|
3650
3650
|
|
|
3651
3651
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/helpers/cdf/cdf-mappers.js
|
|
@@ -3713,8 +3713,8 @@ function getLatestCompletedSessionForCommand(db, command) {
|
|
|
3713
3713
|
}
|
|
3714
3714
|
|
|
3715
3715
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/sessions/write.js
|
|
3716
|
-
function createSession(db, id,
|
|
3717
|
-
db.prepare("INSERT INTO sessions (id, name, created_at, updated_at) VALUES (?, ?, ?, ?)").run(id,
|
|
3716
|
+
function createSession(db, id, name2, timestamp) {
|
|
3717
|
+
db.prepare("INSERT INTO sessions (id, name, created_at, updated_at) VALUES (?, ?, ?, ?)").run(id, name2, timestamp, timestamp);
|
|
3718
3718
|
}
|
|
3719
3719
|
function updateSessionTimestamp(db, sessionId, timestamp) {
|
|
3720
3720
|
db.prepare("UPDATE sessions SET updated_at = ? WHERE id = ?").run(timestamp, sessionId);
|
|
@@ -4996,7 +4996,7 @@ function identifiersIn(propTypes) {
|
|
|
4996
4996
|
return [...names];
|
|
4997
4997
|
}
|
|
4998
4998
|
function declaresAnyType(text, typeNames) {
|
|
4999
|
-
return typeNames.some((
|
|
4999
|
+
return typeNames.some((name2) => new RegExp(`\\b(?:type|interface|enum|const|class)\\s+${escapeForRegExp(name2)}\\b`).test(text));
|
|
5000
5000
|
}
|
|
5001
5001
|
function extractRelativeImportPaths(sourceText) {
|
|
5002
5002
|
const specifiers = /* @__PURE__ */ new Set();
|
|
@@ -5061,7 +5061,7 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
5061
5061
|
frontier = nextFrontier;
|
|
5062
5062
|
}
|
|
5063
5063
|
const inHand = [sourceText, ...discovered.map((d) => d.content)];
|
|
5064
|
-
const declaredTypeNames = candidateTypeNames.filter((
|
|
5064
|
+
const declaredTypeNames = candidateTypeNames.filter((name2) => inHand.some((text) => declaresAnyType(text, [name2])));
|
|
5065
5065
|
const usesNotShown = /* @__PURE__ */ new Set();
|
|
5066
5066
|
const searchNames = [.../* @__PURE__ */ new Set([...propNames, ...declaredTypeNames])];
|
|
5067
5067
|
let enlarged = 0;
|
|
@@ -5071,19 +5071,19 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
5071
5071
|
enlarged++;
|
|
5072
5072
|
const budget = enlarge ? MAX_TYPE_DECLARING_SIBLING_CHARS : MAX_SIBLING_SNIPPET_CHARS;
|
|
5073
5073
|
const excerpt = excerptAroundNames(d.content, searchNames, budget);
|
|
5074
|
-
for (const
|
|
5075
|
-
usesNotShown.add(
|
|
5074
|
+
for (const name2 of excerpt.usesNotShown)
|
|
5075
|
+
usesNotShown.add(name2);
|
|
5076
5076
|
return { path: d.path, content: excerpt.content };
|
|
5077
5077
|
});
|
|
5078
5078
|
const truncatedCount = Math.max(0, discovered.length - MAX_SIBLING_FILES);
|
|
5079
5079
|
return {
|
|
5080
5080
|
siblings,
|
|
5081
5081
|
truncatedCount,
|
|
5082
|
-
usesNotShown: propNames.filter((
|
|
5082
|
+
usesNotShown: propNames.filter((name2) => usesNotShown.has(name2)),
|
|
5083
5083
|
declaredTypeNames
|
|
5084
5084
|
};
|
|
5085
5085
|
}
|
|
5086
|
-
async function loadComponentSourceRef(
|
|
5086
|
+
async function loadComponentSourceRef(name2, sourcePath, propNames = [], propTypes = []) {
|
|
5087
5087
|
let content = null;
|
|
5088
5088
|
let siblingFiles = [];
|
|
5089
5089
|
let truncatedSiblingCount = 0;
|
|
@@ -5100,18 +5100,18 @@ async function loadComponentSourceRef(name, sourcePath, propNames = [], propType
|
|
|
5100
5100
|
} = await loadSiblingFiles(rawText, sourcePath, propNames, identifiersIn(propTypes)));
|
|
5101
5101
|
const mainExcerpt = excerptAroundNames(rawText, [.../* @__PURE__ */ new Set([...propNames, ...declaredTypeNames])], MAX_COMPONENT_SOURCE_CHARS);
|
|
5102
5102
|
content = mainExcerpt.content;
|
|
5103
|
-
for (const
|
|
5104
|
-
usesNotShown.add(
|
|
5105
|
-
for (const
|
|
5106
|
-
usesNotShown.add(
|
|
5103
|
+
for (const name3 of mainExcerpt.usesNotShown)
|
|
5104
|
+
usesNotShown.add(name3);
|
|
5105
|
+
for (const name3 of siblingUsesNotShown)
|
|
5106
|
+
usesNotShown.add(name3);
|
|
5107
5107
|
} catch {
|
|
5108
5108
|
}
|
|
5109
|
-
const ref = { component:
|
|
5109
|
+
const ref = { component: name2, sourcePath, content };
|
|
5110
5110
|
if (siblingFiles.length > 0)
|
|
5111
5111
|
ref.siblingFiles = siblingFiles;
|
|
5112
5112
|
if (truncatedSiblingCount > 0)
|
|
5113
5113
|
ref.truncatedSiblingCount = truncatedSiblingCount;
|
|
5114
|
-
const notShown = propNames.filter((
|
|
5114
|
+
const notShown = propNames.filter((name3) => usesNotShown.has(name3));
|
|
5115
5115
|
if (notShown.length > 0)
|
|
5116
5116
|
ref.usesNotShown = notShown;
|
|
5117
5117
|
return ref;
|
|
@@ -5264,7 +5264,7 @@ function loadCDFComponents(db, sessionId) {
|
|
|
5264
5264
|
const allowedComponentsBySlot = indexRowsByKey(allowedComponents, (ac) => `${ac.component_id}::${ac.slot_name}`);
|
|
5265
5265
|
const tokenPathsByProp = indexRowsByKey(tokenPaths, (t) => `${t.component_id}::${t.prop_name}`);
|
|
5266
5266
|
const toTokenPaths = (rows) => rows === void 0 ? void 0 : rows.map((r) => r.path);
|
|
5267
|
-
return components.map(({ component_id, name, description }) => {
|
|
5267
|
+
return components.map(({ component_id, name: name2, description }) => {
|
|
5268
5268
|
const compProps = propsByComponent.get(component_id) ?? [];
|
|
5269
5269
|
const $properties = {};
|
|
5270
5270
|
for (const p of compProps) {
|
|
@@ -5321,7 +5321,7 @@ function loadCDFComponents(db, sessionId) {
|
|
|
5321
5321
|
entry.$description = description;
|
|
5322
5322
|
if (Object.keys($slots).length > 0)
|
|
5323
5323
|
entry.$slots = $slots;
|
|
5324
|
-
return { key:
|
|
5324
|
+
return { key: name2, entry };
|
|
5325
5325
|
});
|
|
5326
5326
|
}
|
|
5327
5327
|
function loadScopeComponents(db, sessionId) {
|
|
@@ -5910,29 +5910,29 @@ function extractTsxComponents(filePaths, componentFilePattern, extract) {
|
|
|
5910
5910
|
}
|
|
5911
5911
|
function resolveDefaultExportName(declarations, exported, allowVariableDeclaration = false) {
|
|
5912
5912
|
const declaration = declarations[0];
|
|
5913
|
-
const
|
|
5914
|
-
if (!
|
|
5913
|
+
const name2 = Node.isFunctionDeclaration(declaration) ? declaration.getName() : allowVariableDeclaration && Node.isVariableDeclaration(declaration) ? declaration.getName() : void 0;
|
|
5914
|
+
if (!name2 || !/^[A-Z]/.test(name2) || exported.has(name2))
|
|
5915
5915
|
return void 0;
|
|
5916
|
-
return
|
|
5916
|
+
return name2;
|
|
5917
5917
|
}
|
|
5918
5918
|
function getRenderableExports(sourceFile, exclusions, options) {
|
|
5919
5919
|
const renderable = [];
|
|
5920
5920
|
const exported = sourceFile.getExportedDeclarations();
|
|
5921
5921
|
for (const [exportKey, declarations] of exported) {
|
|
5922
|
-
const
|
|
5923
|
-
if (!
|
|
5922
|
+
const name2 = exportKey === "default" ? resolveDefaultExportName(declarations, exported, options.allowVariableDeclaration) : exportKey;
|
|
5923
|
+
if (!name2 || !/^[A-Z]/.test(name2))
|
|
5924
5924
|
continue;
|
|
5925
|
-
if (
|
|
5925
|
+
if (name2.startsWith("use")) {
|
|
5926
5926
|
exclusions.push({
|
|
5927
5927
|
itemType: "component",
|
|
5928
|
-
name,
|
|
5928
|
+
name: name2,
|
|
5929
5929
|
source: sourceFile.getFilePath(),
|
|
5930
5930
|
reason: options.hookReason,
|
|
5931
5931
|
stage: "component-filter"
|
|
5932
5932
|
});
|
|
5933
5933
|
continue;
|
|
5934
5934
|
}
|
|
5935
|
-
renderable.push({ name, declarations });
|
|
5935
|
+
renderable.push({ name: name2, declarations });
|
|
5936
5936
|
}
|
|
5937
5937
|
return renderable;
|
|
5938
5938
|
}
|
|
@@ -6315,7 +6315,7 @@ function extractProps(classDecl) {
|
|
|
6315
6315
|
for (const property of classDecl.getProperties()) {
|
|
6316
6316
|
if (!hasDecorator(property, "Prop"))
|
|
6317
6317
|
continue;
|
|
6318
|
-
const
|
|
6318
|
+
const name2 = property.getName();
|
|
6319
6319
|
const typeNode = property.getTypeNode();
|
|
6320
6320
|
const typeText = typeNode ? typeNode.getText() : "unknown";
|
|
6321
6321
|
const hasQuestionToken = property.hasQuestionToken();
|
|
@@ -6353,21 +6353,21 @@ function extractProps(classDecl) {
|
|
|
6353
6353
|
}
|
|
6354
6354
|
const allowedValues = extractAllowedValues2(typeText);
|
|
6355
6355
|
props.push({
|
|
6356
|
-
name,
|
|
6356
|
+
name: name2,
|
|
6357
6357
|
type: typeText,
|
|
6358
6358
|
required: isRequired,
|
|
6359
6359
|
...defaultValue !== void 0 && { defaultValue },
|
|
6360
6360
|
...description && { description },
|
|
6361
6361
|
...allowedValues && { allowedValues },
|
|
6362
|
-
...intrinsicDomAttributeProps.has(
|
|
6362
|
+
...intrinsicDomAttributeProps.has(name2) && { domAttribute: true },
|
|
6363
6363
|
sourceStartLine: property.getStartLineNumber(),
|
|
6364
6364
|
sourceEndLine: property.getEndLineNumber()
|
|
6365
6365
|
});
|
|
6366
6366
|
}
|
|
6367
6367
|
return props.sort((a, b) => a.name.localeCompare(b.name));
|
|
6368
6368
|
}
|
|
6369
|
-
function normalizeSlotName(
|
|
6370
|
-
const normalizedName =
|
|
6369
|
+
function normalizeSlotName(name2) {
|
|
6370
|
+
const normalizedName = name2 && name2.length > 0 ? name2 : "default";
|
|
6371
6371
|
return {
|
|
6372
6372
|
name: normalizedName,
|
|
6373
6373
|
isDefault: normalizedName === "default"
|
|
@@ -6437,9 +6437,9 @@ function extractSlots(classDecl, warnings, componentName) {
|
|
|
6437
6437
|
if (tagName === "slot") {
|
|
6438
6438
|
const nameAttribute = openingElement.getAttributes().find((attribute) => Node2.isJsxAttribute(attribute) && attribute.getNameNode().getText() === "name");
|
|
6439
6439
|
const initializer2 = Node2.isJsxAttribute(nameAttribute) ? nameAttribute.getInitializer() : void 0;
|
|
6440
|
-
const
|
|
6440
|
+
const name3 = initializer2 && Node2.isStringLiteral(initializer2) ? initializer2.getLiteralValue() : initializer2 && Node2.isJsxExpression(initializer2) ? initializer2.getExpression()?.getText() ?? "" : "";
|
|
6441
6441
|
upsertSlot({
|
|
6442
|
-
...normalizeSlotName(
|
|
6442
|
+
...normalizeSlotName(name3)
|
|
6443
6443
|
});
|
|
6444
6444
|
return;
|
|
6445
6445
|
}
|
|
@@ -6448,11 +6448,11 @@ function extractSlots(classDecl, warnings, componentName) {
|
|
|
6448
6448
|
const initializer = slotAttribute.getInitializer();
|
|
6449
6449
|
if (!initializer || !Node2.isStringLiteral(initializer))
|
|
6450
6450
|
return;
|
|
6451
|
-
const
|
|
6452
|
-
if (!
|
|
6451
|
+
const name2 = initializer.getLiteralValue();
|
|
6452
|
+
if (!name2)
|
|
6453
6453
|
return;
|
|
6454
6454
|
upsertSlot({
|
|
6455
|
-
name,
|
|
6455
|
+
name: name2,
|
|
6456
6456
|
isDefault: false
|
|
6457
6457
|
});
|
|
6458
6458
|
});
|
|
@@ -6474,15 +6474,15 @@ function extractFromSourceFile(sourceFile, warnings) {
|
|
|
6474
6474
|
const tag = getComponentTag(classDecl);
|
|
6475
6475
|
if (!tag)
|
|
6476
6476
|
continue;
|
|
6477
|
-
const
|
|
6477
|
+
const name2 = kebabToPascal(tag);
|
|
6478
6478
|
const props = extractProps(classDecl);
|
|
6479
|
-
const slots = extractSlots(classDecl, warnings,
|
|
6479
|
+
const slots = extractSlots(classDecl, warnings, name2);
|
|
6480
6480
|
const eventNames = detectEvents(classDecl);
|
|
6481
6481
|
if (eventNames.length > 0) {
|
|
6482
|
-
warnings.push(`Component ${
|
|
6482
|
+
warnings.push(`Component ${name2} has ${eventNames.length} events not captured: ${eventNames.join(", ")}`);
|
|
6483
6483
|
}
|
|
6484
6484
|
components.push({
|
|
6485
|
-
name,
|
|
6485
|
+
name: name2,
|
|
6486
6486
|
source: sourceFile.getFilePath(),
|
|
6487
6487
|
sourcePath: sourceFile.getFilePath(),
|
|
6488
6488
|
framework: "stencil",
|
|
@@ -6634,9 +6634,9 @@ function extractAllowedComponentsFromJsdoc(jsdocText, componentNames) {
|
|
|
6634
6634
|
return [];
|
|
6635
6635
|
const found = /* @__PURE__ */ new Set();
|
|
6636
6636
|
for (const raw of m[1].split(",")) {
|
|
6637
|
-
const
|
|
6638
|
-
if (
|
|
6639
|
-
found.add(
|
|
6637
|
+
const name2 = raw.trim();
|
|
6638
|
+
if (name2 && componentNames.has(name2))
|
|
6639
|
+
found.add(name2);
|
|
6640
6640
|
}
|
|
6641
6641
|
return [...found].sort();
|
|
6642
6642
|
}
|
|
@@ -6671,8 +6671,8 @@ function collectTypePredicateComponentReferences(sourceFile, ctx) {
|
|
|
6671
6671
|
const assertedTypeNode = returnTypeNode.getTypeNode();
|
|
6672
6672
|
if (!assertedTypeNode)
|
|
6673
6673
|
continue;
|
|
6674
|
-
for (const
|
|
6675
|
-
found.add(
|
|
6674
|
+
for (const name2 of extractAllowedComponentsFromTypeText(assertedTypeNode.getText(), ctx)) {
|
|
6675
|
+
found.add(name2);
|
|
6676
6676
|
}
|
|
6677
6677
|
}
|
|
6678
6678
|
return [...found].sort();
|
|
@@ -6691,13 +6691,13 @@ function collectRuntimeTypeCheckComponentReferences(sourceFile, componentNames)
|
|
|
6691
6691
|
return void 0;
|
|
6692
6692
|
if (!Node3.isIdentifier(otherSide) && !Node3.isPropertyAccessExpression(otherSide))
|
|
6693
6693
|
return void 0;
|
|
6694
|
-
const
|
|
6695
|
-
if (!
|
|
6694
|
+
const name2 = otherSide.getText().split(".").pop();
|
|
6695
|
+
if (!name2 || !componentNames.has(name2))
|
|
6696
6696
|
return void 0;
|
|
6697
6697
|
const baseIdentifier = Node3.isPropertyAccessExpression(otherSide) ? otherSide.getExpression() : otherSide;
|
|
6698
6698
|
if (!Node3.isIdentifier(baseIdentifier) || !localBindings.has(baseIdentifier.getText()))
|
|
6699
6699
|
return void 0;
|
|
6700
|
-
return
|
|
6700
|
+
return name2;
|
|
6701
6701
|
};
|
|
6702
6702
|
const match2 = candidateFromTypeAccess(left, right) ?? candidateFromTypeAccess(right, left);
|
|
6703
6703
|
if (match2)
|
|
@@ -6749,8 +6749,8 @@ function collectArrayMapRenderComponentReferences(funcNode, componentNames, ownC
|
|
|
6749
6749
|
const found = /* @__PURE__ */ new Set();
|
|
6750
6750
|
const propNames = new Set(propTypesByName.keys());
|
|
6751
6751
|
const renderCountByComponent = /* @__PURE__ */ new Map();
|
|
6752
|
-
const bumpRenderCount = (
|
|
6753
|
-
renderCountByComponent.set(
|
|
6752
|
+
const bumpRenderCount = (name2) => {
|
|
6753
|
+
renderCountByComponent.set(name2, (renderCountByComponent.get(name2) ?? 0) + 1);
|
|
6754
6754
|
};
|
|
6755
6755
|
for (const jsxElement of [
|
|
6756
6756
|
...funcNode.getDescendantsOfKind(SyntaxKind3.JsxSelfClosingElement),
|
|
@@ -7078,7 +7078,7 @@ function sourceFileUsesCreateContext(sourceFile) {
|
|
|
7078
7078
|
function isNextJsComponent(filePath, exportedNames) {
|
|
7079
7079
|
const normalized = filePath.replace(/\\/g, "/");
|
|
7080
7080
|
const isAppRouterFile = /\/app\/.*\/(page|layout)\.[jt]sx?$/.test(normalized);
|
|
7081
|
-
const hasNextExports = exportedNames.some((
|
|
7081
|
+
const hasNextExports = exportedNames.some((name2) => name2 === "generateMetadata" || name2 === "generateStaticParams");
|
|
7082
7082
|
return isAppRouterFile || hasNextExports;
|
|
7083
7083
|
}
|
|
7084
7084
|
function isRepoLocalTransparentPolymorphicWrapperDeclaration(declaration, typeName) {
|
|
@@ -7260,8 +7260,8 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
7260
7260
|
const props = [];
|
|
7261
7261
|
let hasChildren = false;
|
|
7262
7262
|
for (const property of type.getProperties()) {
|
|
7263
|
-
const
|
|
7264
|
-
if (
|
|
7263
|
+
const name2 = property.getName();
|
|
7264
|
+
if (name2 === "children") {
|
|
7265
7265
|
if (suppressNeverChildrenSlot) {
|
|
7266
7266
|
const declaration2 = property.getValueDeclaration() ?? property.getDeclarations()[0];
|
|
7267
7267
|
if (declaration2 && property.getTypeAtLocation(declaration2).isNever()) {
|
|
@@ -7271,7 +7271,7 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
7271
7271
|
hasChildren = true;
|
|
7272
7272
|
continue;
|
|
7273
7273
|
}
|
|
7274
|
-
if (slotNames.has(
|
|
7274
|
+
if (slotNames.has(name2))
|
|
7275
7275
|
continue;
|
|
7276
7276
|
const declaration = property.getValueDeclaration() ?? property.getDeclarations()[0];
|
|
7277
7277
|
if (!declaration)
|
|
@@ -7282,7 +7282,7 @@ function extractPropsFromTypeSymbols(type, slotNames, suppressNeverChildrenSlot
|
|
|
7282
7282
|
const required = !property.isOptional();
|
|
7283
7283
|
const allowedValues = extractAllowedValues(propType);
|
|
7284
7284
|
props.push({
|
|
7285
|
-
name,
|
|
7285
|
+
name: name2,
|
|
7286
7286
|
type: typeText,
|
|
7287
7287
|
required,
|
|
7288
7288
|
...allowedValues && { allowedValues },
|
|
@@ -7313,19 +7313,19 @@ function extractPropsFromInterfaceDeclaration(declaration, slotNames, seen, excl
|
|
|
7313
7313
|
return acc;
|
|
7314
7314
|
const propType = symbol.getTypeAtLocation(decl);
|
|
7315
7315
|
const typeText = propType.isAny() ? ("getTypeNode" in decl && typeof decl.getTypeNode === "function" ? decl.getTypeNode()?.getText() : void 0) ?? propType.getText(decl) : propType.getText(decl);
|
|
7316
|
-
const
|
|
7317
|
-
if (
|
|
7316
|
+
const name2 = symbol.getName();
|
|
7317
|
+
if (name2 === "children") {
|
|
7318
7318
|
if (suppressNeverChildrenSlot && propType.isNever())
|
|
7319
7319
|
return acc;
|
|
7320
7320
|
acc.hasChildren = true;
|
|
7321
7321
|
return acc;
|
|
7322
7322
|
}
|
|
7323
|
-
if (slotNames.has(
|
|
7323
|
+
if (slotNames.has(name2))
|
|
7324
7324
|
return acc;
|
|
7325
7325
|
const required = !symbol.isOptional();
|
|
7326
7326
|
const allowedValues = extractAllowedValues(propType);
|
|
7327
7327
|
acc.props.push({
|
|
7328
|
-
name,
|
|
7328
|
+
name: name2,
|
|
7329
7329
|
type: typeText,
|
|
7330
7330
|
required,
|
|
7331
7331
|
...allowedValues && { allowedValues },
|
|
@@ -7658,7 +7658,7 @@ function collectReboundDeclarations(body) {
|
|
|
7658
7658
|
function collectPropDataflow(func, param, availablePropNames) {
|
|
7659
7659
|
const valueAliases = /* @__PURE__ */ new Map();
|
|
7660
7660
|
const objectAliases = /* @__PURE__ */ new Map();
|
|
7661
|
-
const fullPropsShape = new Map([...availablePropNames].map((
|
|
7661
|
+
const fullPropsShape = new Map([...availablePropNames].map((name2) => [name2, name2]));
|
|
7662
7662
|
const belongsToComponentFunction = (node) => node.getFirstAncestor((ancestor) => Node4.isFunctionDeclaration(ancestor) || Node4.isArrowFunction(ancestor) || Node4.isFunctionExpression(ancestor)) === func;
|
|
7663
7663
|
const resolveValue = (expression) => {
|
|
7664
7664
|
if (!expression)
|
|
@@ -7852,12 +7852,12 @@ function extractSlots2(type, hasChildren) {
|
|
|
7852
7852
|
slots.push({ name: "children", isDefault: true });
|
|
7853
7853
|
}
|
|
7854
7854
|
for (const property of type.getProperties()) {
|
|
7855
|
-
const
|
|
7856
|
-
if (
|
|
7855
|
+
const name2 = property.getName();
|
|
7856
|
+
if (name2 === "children")
|
|
7857
7857
|
continue;
|
|
7858
7858
|
if (!getRenderPropType(property))
|
|
7859
7859
|
continue;
|
|
7860
|
-
const slotName =
|
|
7860
|
+
const slotName = name2.replace(/^render/, "");
|
|
7861
7861
|
slots.push({
|
|
7862
7862
|
name: slotName.charAt(0).toLowerCase() + slotName.slice(1),
|
|
7863
7863
|
isDefault: false
|
|
@@ -7870,9 +7870,9 @@ function isExpandableDomAttributeWrapperName(typeName) {
|
|
|
7870
7870
|
}
|
|
7871
7871
|
function getStringLiteralTypeValues(typeNode) {
|
|
7872
7872
|
if (Node4.isLiteralTypeNode(typeNode)) {
|
|
7873
|
-
const
|
|
7874
|
-
if (Node4.isStringLiteral(
|
|
7875
|
-
return [
|
|
7873
|
+
const literal4 = typeNode.getLiteral();
|
|
7874
|
+
if (Node4.isStringLiteral(literal4)) {
|
|
7875
|
+
return [literal4.getLiteralText()];
|
|
7876
7876
|
}
|
|
7877
7877
|
}
|
|
7878
7878
|
if (!Node4.isUnionTypeNode(typeNode))
|
|
@@ -8113,17 +8113,17 @@ function getSyntheticDomAttributeProps(typeNode) {
|
|
|
8113
8113
|
}
|
|
8114
8114
|
return [...propsByName.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
8115
8115
|
}
|
|
8116
|
-
function getDomAttributeSurface(
|
|
8117
|
-
if (seen.has(
|
|
8116
|
+
function getDomAttributeSurface(name2, seen = /* @__PURE__ */ new Set()) {
|
|
8117
|
+
if (seen.has(name2))
|
|
8118
8118
|
return [];
|
|
8119
|
-
seen.add(
|
|
8119
|
+
seen.add(name2);
|
|
8120
8120
|
const propsByName = /* @__PURE__ */ new Map();
|
|
8121
|
-
for (const parentName of DOM_ATTRIBUTE_WRAPPER_PARENTS[
|
|
8121
|
+
for (const parentName of DOM_ATTRIBUTE_WRAPPER_PARENTS[name2] ?? []) {
|
|
8122
8122
|
for (const prop of getDomAttributeSurface(parentName, seen)) {
|
|
8123
8123
|
propsByName.set(prop.name, prop);
|
|
8124
8124
|
}
|
|
8125
8125
|
}
|
|
8126
|
-
for (const prop of DOM_ATTRIBUTE_PROP_SURFACES[
|
|
8126
|
+
for (const prop of DOM_ATTRIBUTE_PROP_SURFACES[name2]) {
|
|
8127
8127
|
propsByName.set(prop.name, prop);
|
|
8128
8128
|
}
|
|
8129
8129
|
return [...propsByName.values()].map((prop) => ({
|
|
@@ -8220,12 +8220,12 @@ function extractPickedPropsFromTypeNode(typeNode, slotNames, excludedProps = /*
|
|
|
8220
8220
|
}
|
|
8221
8221
|
const pickedKeys = getStringLiteralTypeValues(pickedKeysNode);
|
|
8222
8222
|
const props = [];
|
|
8223
|
-
for (const
|
|
8224
|
-
if (slotNames.has(
|
|
8223
|
+
for (const name2 of pickedKeys) {
|
|
8224
|
+
if (slotNames.has(name2))
|
|
8225
8225
|
continue;
|
|
8226
|
-
if (excludedProps.has(
|
|
8226
|
+
if (excludedProps.has(name2))
|
|
8227
8227
|
continue;
|
|
8228
|
-
const pickedProp = sourcePropsByName.get(
|
|
8228
|
+
const pickedProp = sourcePropsByName.get(name2);
|
|
8229
8229
|
if (pickedProp) {
|
|
8230
8230
|
props.push(pickedProp);
|
|
8231
8231
|
}
|
|
@@ -8455,7 +8455,7 @@ async function extractReactComponents(filePaths) {
|
|
|
8455
8455
|
function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
8456
8456
|
const components = [];
|
|
8457
8457
|
const usesCreateContext = sourceFileUsesCreateContext(sourceFile);
|
|
8458
|
-
for (const { name, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8458
|
+
for (const { name: name2, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8459
8459
|
allowVariableDeclaration: true,
|
|
8460
8460
|
hookReason: "React hook names are not renderable components"
|
|
8461
8461
|
})) {
|
|
@@ -8467,7 +8467,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
8467
8467
|
const params = funcNode.getParameters();
|
|
8468
8468
|
if (params.length === 0) {
|
|
8469
8469
|
components.push({
|
|
8470
|
-
name,
|
|
8470
|
+
name: name2,
|
|
8471
8471
|
source: sourceFile.getFilePath(),
|
|
8472
8472
|
sourcePath: sourceFile.getFilePath(),
|
|
8473
8473
|
framework: isNext ? "next" : "react",
|
|
@@ -8511,7 +8511,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
8511
8511
|
}
|
|
8512
8512
|
const resolvedProps = [...mergedPropsByName.values()];
|
|
8513
8513
|
const noUsefulTypes = resolvedProps.length === 0 || resolvedProps.every((p) => p.type === "any");
|
|
8514
|
-
const finalProps = noUsefulTypes ? extractPropTypes(sourceFile,
|
|
8514
|
+
const finalProps = noUsefulTypes ? extractPropTypes(sourceFile, name2) ?? resolvedProps : resolvedProps;
|
|
8515
8515
|
const propsWithDefaults = finalProps.map((p) => {
|
|
8516
8516
|
if (!defaults.has(p.name))
|
|
8517
8517
|
return p;
|
|
@@ -8544,7 +8544,7 @@ function extractFromSourceFile2(sourceFile, isNext, exclusions) {
|
|
|
8544
8544
|
const propsTypeName = firstParamTypeNode?.getText?.().trim();
|
|
8545
8545
|
const propsTypeNameCapture = propsTypeName && /^[A-Za-z_$][\w$]*$/.test(propsTypeName) ? propsTypeName : void 0;
|
|
8546
8546
|
components.push({
|
|
8547
|
-
name,
|
|
8547
|
+
name: name2,
|
|
8548
8548
|
source: sourceFile.getFilePath(),
|
|
8549
8549
|
sourcePath: sourceFile.getFilePath(),
|
|
8550
8550
|
framework: isNext ? "next" : "react",
|
|
@@ -8759,10 +8759,10 @@ async function extractVueTsxComponents(filePaths) {
|
|
|
8759
8759
|
}
|
|
8760
8760
|
function extractFromSourceFile3(sourceFile, exclusions) {
|
|
8761
8761
|
const components = [];
|
|
8762
|
-
for (const { name, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8762
|
+
for (const { name: name2, declarations } of getRenderableExports(sourceFile, exclusions, {
|
|
8763
8763
|
hookReason: "Vue composition hook names are not renderable components"
|
|
8764
8764
|
})) {
|
|
8765
|
-
const component = extractVueTsxComponent(declarations,
|
|
8765
|
+
const component = extractVueTsxComponent(declarations, name2, sourceFile);
|
|
8766
8766
|
if (component) {
|
|
8767
8767
|
components.push(component);
|
|
8768
8768
|
}
|
|
@@ -8778,11 +8778,11 @@ function extractVueTsxComponent(declarations, exportName, sourceFile) {
|
|
|
8778
8778
|
const resolved = resolveVueComponentOptions(declaration.getInitializer());
|
|
8779
8779
|
if (!resolved)
|
|
8780
8780
|
continue;
|
|
8781
|
-
const
|
|
8781
|
+
const name2 = extractVueGenericComponentName(resolved.options) ?? exportName;
|
|
8782
8782
|
const props = extractVueGenericComponentProps(resolved.options);
|
|
8783
8783
|
const slots = extractVueGenericComponentSlots(resolved.options, resolved.slotsTypeNode);
|
|
8784
8784
|
return {
|
|
8785
|
-
name,
|
|
8785
|
+
name: name2,
|
|
8786
8786
|
source: sourceFile.getFilePath(),
|
|
8787
8787
|
framework: "vue",
|
|
8788
8788
|
props,
|
|
@@ -8956,16 +8956,16 @@ function extractVueObjectPropDefinition(propName, initializer) {
|
|
|
8956
8956
|
for (const property of initializer.getProperties()) {
|
|
8957
8957
|
if (!Node5.isPropertyAssignment(property))
|
|
8958
8958
|
continue;
|
|
8959
|
-
const
|
|
8959
|
+
const name2 = property.getName();
|
|
8960
8960
|
const value = property.getInitializer();
|
|
8961
8961
|
if (!value)
|
|
8962
8962
|
continue;
|
|
8963
|
-
if (
|
|
8963
|
+
if (name2 === "type") {
|
|
8964
8964
|
type = getVuePropTypeText(value);
|
|
8965
8965
|
allowedValues = extractAllowedValues(value.getType());
|
|
8966
|
-
} else if (
|
|
8966
|
+
} else if (name2 === "required") {
|
|
8967
8967
|
required = value.getText() === "true";
|
|
8968
|
-
} else if (
|
|
8968
|
+
} else if (name2 === "default") {
|
|
8969
8969
|
defaultValue = value.getText();
|
|
8970
8970
|
}
|
|
8971
8971
|
}
|
|
@@ -9258,20 +9258,20 @@ async function extractVueComponents(filePaths, onProgress) {
|
|
|
9258
9258
|
async function extractFromVueSFC(filePath, source) {
|
|
9259
9259
|
const { descriptor, errors } = parseSFC(source);
|
|
9260
9260
|
const fileWarnings = errors.map((e) => `Parse error in ${filePath}: ${e instanceof Error ? e.message : String(e)}`);
|
|
9261
|
-
const
|
|
9261
|
+
const name2 = getVueComponentName(filePath);
|
|
9262
9262
|
let props = [];
|
|
9263
9263
|
const setupProps = descriptor.scriptSetup ? await extractSetupProps(filePath, descriptor.scriptSetup.content) : null;
|
|
9264
9264
|
if (setupProps !== null) {
|
|
9265
9265
|
props = setupProps;
|
|
9266
9266
|
} else if (descriptor.script) {
|
|
9267
|
-
return extractOptionsComponent(filePath, descriptor.script.content, fileWarnings,
|
|
9267
|
+
return extractOptionsComponent(filePath, descriptor.script.content, fileWarnings, name2, descriptor.template?.ast, source);
|
|
9268
9268
|
}
|
|
9269
9269
|
let slots = descriptor.template?.ast ? extractSlotsFromTemplate(descriptor.template.ast) : [];
|
|
9270
9270
|
const runtimeSlots = extractSlotsFromRuntimeAccess(source);
|
|
9271
9271
|
slots = mergeSlotsDedup(slots, runtimeSlots);
|
|
9272
9272
|
return {
|
|
9273
9273
|
component: {
|
|
9274
|
-
name,
|
|
9274
|
+
name: name2,
|
|
9275
9275
|
source: filePath,
|
|
9276
9276
|
sourcePath: filePath,
|
|
9277
9277
|
framework: "vue",
|
|
@@ -9289,7 +9289,7 @@ function getVueComponentName(filePath) {
|
|
|
9289
9289
|
const parentDirName = basename(dirname9(filePath));
|
|
9290
9290
|
return parentDirName || fileName;
|
|
9291
9291
|
}
|
|
9292
|
-
async function extractOptionsComponent(filePath, scriptContent, fileWarnings,
|
|
9292
|
+
async function extractOptionsComponent(filePath, scriptContent, fileWarnings, name2, templateAst, sfcSource) {
|
|
9293
9293
|
const props = await extractOptionsProps(filePath, scriptContent);
|
|
9294
9294
|
let slots = templateAst ? extractSlotsFromTemplate(templateAst) : [];
|
|
9295
9295
|
if (sfcSource) {
|
|
@@ -9298,7 +9298,7 @@ async function extractOptionsComponent(filePath, scriptContent, fileWarnings, na
|
|
|
9298
9298
|
}
|
|
9299
9299
|
return {
|
|
9300
9300
|
component: {
|
|
9301
|
-
name,
|
|
9301
|
+
name: name2,
|
|
9302
9302
|
source: filePath,
|
|
9303
9303
|
sourcePath: filePath,
|
|
9304
9304
|
framework: "vue",
|
|
@@ -9371,13 +9371,13 @@ function extractGenericProps(typeText) {
|
|
|
9371
9371
|
const resolved = resolveTypeProperty(property);
|
|
9372
9372
|
if (!resolved)
|
|
9373
9373
|
continue;
|
|
9374
|
-
const { name, typeText: resolvedTypeText, required } = resolved;
|
|
9374
|
+
const { name: name2, typeText: resolvedTypeText, required } = resolved;
|
|
9375
9375
|
let typeText2 = resolvedTypeText;
|
|
9376
9376
|
if (!required) {
|
|
9377
9377
|
typeText2 = typeText2.replace(/\s*\|\s*undefined$/, "").replace(/^undefined\s*\|\s*/, "");
|
|
9378
9378
|
}
|
|
9379
9379
|
props.push({
|
|
9380
|
-
name,
|
|
9380
|
+
name: name2,
|
|
9381
9381
|
type: typeText2,
|
|
9382
9382
|
required
|
|
9383
9383
|
});
|
|
@@ -9675,14 +9675,14 @@ function parseObjectProps(obj) {
|
|
|
9675
9675
|
for (const prop of obj.getProperties()) {
|
|
9676
9676
|
if (!Node6.isPropertyAssignment(prop))
|
|
9677
9677
|
continue;
|
|
9678
|
-
const
|
|
9679
|
-
if (!isPublicVuePropName(
|
|
9678
|
+
const name2 = prop.getName();
|
|
9679
|
+
if (!isPublicVuePropName(name2))
|
|
9680
9680
|
continue;
|
|
9681
9681
|
const init = prop.getInitializer();
|
|
9682
9682
|
if (!init || !Node6.isObjectLiteralExpression(init)) {
|
|
9683
9683
|
const initText = init?.getText() ?? "any";
|
|
9684
9684
|
result.push({
|
|
9685
|
-
name,
|
|
9685
|
+
name: name2,
|
|
9686
9686
|
type: VUE_TYPE_MAP[initText] ?? "any",
|
|
9687
9687
|
required: false,
|
|
9688
9688
|
sourceStartLine: prop.getStartLineNumber(),
|
|
@@ -9715,7 +9715,7 @@ function parseObjectProps(obj) {
|
|
|
9715
9715
|
}
|
|
9716
9716
|
}
|
|
9717
9717
|
result.push({
|
|
9718
|
-
name,
|
|
9718
|
+
name: name2,
|
|
9719
9719
|
type,
|
|
9720
9720
|
required,
|
|
9721
9721
|
...defaultValue !== void 0 && { defaultValue },
|
|
@@ -9725,8 +9725,8 @@ function parseObjectProps(obj) {
|
|
|
9725
9725
|
}
|
|
9726
9726
|
return result;
|
|
9727
9727
|
}
|
|
9728
|
-
function isPublicVuePropName(
|
|
9729
|
-
return !/^[_$]/.test(
|
|
9728
|
+
function isPublicVuePropName(name2) {
|
|
9729
|
+
return !/^[_$]/.test(name2);
|
|
9730
9730
|
}
|
|
9731
9731
|
function extractSlotsFromTemplate(ast) {
|
|
9732
9732
|
const slots = [];
|
|
@@ -9758,10 +9758,10 @@ function extractSlotsFromRuntimeAccess(source) {
|
|
|
9758
9758
|
for (const pattern of [dotPattern, bracketPattern]) {
|
|
9759
9759
|
let match2;
|
|
9760
9760
|
while ((match2 = pattern.exec(source)) !== null) {
|
|
9761
|
-
const
|
|
9762
|
-
if (!seen.has(
|
|
9763
|
-
seen.add(
|
|
9764
|
-
slots.push({ name, isDefault:
|
|
9761
|
+
const name2 = match2[1];
|
|
9762
|
+
if (!seen.has(name2)) {
|
|
9763
|
+
seen.add(name2);
|
|
9764
|
+
slots.push({ name: name2, isDefault: name2 === "default" });
|
|
9765
9765
|
}
|
|
9766
9766
|
}
|
|
9767
9767
|
}
|
|
@@ -9870,12 +9870,12 @@ function extractPropsFromFrontmatter(frontmatter) {
|
|
|
9870
9870
|
const propsTypeAlias = sf.getTypeAlias("Props");
|
|
9871
9871
|
if (propsInterface) {
|
|
9872
9872
|
for (const member of propsInterface.getProperties()) {
|
|
9873
|
-
const
|
|
9873
|
+
const name2 = member.getName();
|
|
9874
9874
|
const typeText = member.getTypeNode()?.getText() ?? "any";
|
|
9875
9875
|
const required = !member.hasQuestionToken();
|
|
9876
9876
|
const allowedValues = extractAllowedValues3(typeText);
|
|
9877
9877
|
props.push({
|
|
9878
|
-
name,
|
|
9878
|
+
name: name2,
|
|
9879
9879
|
type: typeText,
|
|
9880
9880
|
required,
|
|
9881
9881
|
...allowedValues && { allowedValues },
|
|
@@ -9889,10 +9889,10 @@ function extractPropsFromFrontmatter(frontmatter) {
|
|
|
9889
9889
|
const resolved = resolveTypeProperty(property);
|
|
9890
9890
|
if (!resolved)
|
|
9891
9891
|
continue;
|
|
9892
|
-
const { name, declaration: decl, typeText, required } = resolved;
|
|
9892
|
+
const { name: name2, declaration: decl, typeText, required } = resolved;
|
|
9893
9893
|
const allowedValues = extractAllowedValues3(typeText);
|
|
9894
9894
|
props.push({
|
|
9895
|
-
name,
|
|
9895
|
+
name: name2,
|
|
9896
9896
|
type: typeText,
|
|
9897
9897
|
required,
|
|
9898
9898
|
...allowedValues && { allowedValues },
|
|
@@ -9958,7 +9958,7 @@ function mergeSlots(...slotGroups) {
|
|
|
9958
9958
|
return merged;
|
|
9959
9959
|
}
|
|
9960
9960
|
function extractFromAstroFile(filePath, source) {
|
|
9961
|
-
const
|
|
9961
|
+
const name2 = basename2(filePath, ".astro");
|
|
9962
9962
|
const fenceIndex = source.startsWith("---") ? 0 : -1;
|
|
9963
9963
|
let frontmatter = "";
|
|
9964
9964
|
let template = source;
|
|
@@ -9977,7 +9977,7 @@ function extractFromAstroFile(filePath, source) {
|
|
|
9977
9977
|
});
|
|
9978
9978
|
const slots = mergeSlots(extractSlotsFromTemplate2(template), extractSlotsFromFrontmatter(frontmatter));
|
|
9979
9979
|
return {
|
|
9980
|
-
name,
|
|
9980
|
+
name: name2,
|
|
9981
9981
|
source: filePath,
|
|
9982
9982
|
sourcePath: filePath,
|
|
9983
9983
|
framework: "astro",
|
|
@@ -10189,10 +10189,10 @@ function extractSlotsFromTemplate3(templateContent) {
|
|
|
10189
10189
|
for (const match2 of templateContent.matchAll(slotRegex)) {
|
|
10190
10190
|
const attrs = match2[1] ?? "";
|
|
10191
10191
|
const nameMatch = attrs.match(/\bname=["']([^"']+)["']/);
|
|
10192
|
-
const
|
|
10193
|
-
slots.set(
|
|
10192
|
+
const name2 = nameMatch?.[1] ?? "default";
|
|
10193
|
+
slots.set(name2, name2 === "default");
|
|
10194
10194
|
}
|
|
10195
|
-
return [...slots.entries()].map(([
|
|
10195
|
+
return [...slots.entries()].map(([name2, isDefault]) => ({ name: name2, isDefault })).sort((a, b) => a.name.localeCompare(b.name));
|
|
10196
10196
|
}
|
|
10197
10197
|
function mergeSlotLists(...slotLists) {
|
|
10198
10198
|
const merged = /* @__PURE__ */ new Map();
|
|
@@ -10221,20 +10221,20 @@ function extractJsDocSlots(classDecl) {
|
|
|
10221
10221
|
const comment = tag.getCommentText()?.trim();
|
|
10222
10222
|
if (!comment)
|
|
10223
10223
|
continue;
|
|
10224
|
-
let
|
|
10224
|
+
let name2 = "default";
|
|
10225
10225
|
let description = comment;
|
|
10226
10226
|
if (comment.startsWith("-")) {
|
|
10227
10227
|
description = comment.slice(1).trim();
|
|
10228
10228
|
} else {
|
|
10229
10229
|
const match2 = comment.match(/^(\S+)\s*-\s*(.*)$/s);
|
|
10230
10230
|
if (match2) {
|
|
10231
|
-
|
|
10231
|
+
name2 = match2[1];
|
|
10232
10232
|
description = match2[2].trim();
|
|
10233
10233
|
}
|
|
10234
10234
|
}
|
|
10235
10235
|
slots.push({
|
|
10236
|
-
name,
|
|
10237
|
-
isDefault:
|
|
10236
|
+
name: name2,
|
|
10237
|
+
isDefault: name2 === "default",
|
|
10238
10238
|
...description && { description }
|
|
10239
10239
|
});
|
|
10240
10240
|
}
|
|
@@ -10279,8 +10279,8 @@ function isNonPublicLitMember(member) {
|
|
|
10279
10279
|
function hasShoelaceRuntimeBookkeepingField(classDecl) {
|
|
10280
10280
|
return classDecl.getProperties().some((property) => property.getName() === "initialReflectedProperties");
|
|
10281
10281
|
}
|
|
10282
|
-
function isInternalRuntimeField(
|
|
10283
|
-
return applyRuntimeFieldDenylist && INTERNAL_RUNTIME_FIELD_NAMES.has(
|
|
10282
|
+
function isInternalRuntimeField(name2, applyRuntimeFieldDenylist) {
|
|
10283
|
+
return applyRuntimeFieldDenylist && INTERNAL_RUNTIME_FIELD_NAMES.has(name2);
|
|
10284
10284
|
}
|
|
10285
10285
|
function getExplicitLitPropertyAttributeName(property) {
|
|
10286
10286
|
const decorator = property.getDecorators().find((candidate) => candidate.getName() === "property");
|
|
@@ -10307,8 +10307,8 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
10307
10307
|
continue;
|
|
10308
10308
|
if (isNonPublicLitMember(property))
|
|
10309
10309
|
continue;
|
|
10310
|
-
const
|
|
10311
|
-
if (
|
|
10310
|
+
const name2 = property.getName();
|
|
10311
|
+
if (name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
10312
10312
|
continue;
|
|
10313
10313
|
const scope = property.getScope();
|
|
10314
10314
|
if (scope === "private" || scope === "protected")
|
|
@@ -10323,7 +10323,7 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
10323
10323
|
}
|
|
10324
10324
|
const typeNode = property.getTypeNode();
|
|
10325
10325
|
const type = typeNode ? typeNode.getText() : "any";
|
|
10326
|
-
const publicName =
|
|
10326
|
+
const publicName = name2.startsWith("_") && hasDecorators ? getExplicitLitPropertyAttributeName(property) : null;
|
|
10327
10327
|
let defaultValue;
|
|
10328
10328
|
if (initializer) {
|
|
10329
10329
|
if (Node8.isStringLiteral(initializer)) {
|
|
@@ -10333,7 +10333,7 @@ function extractClassProperties(classDecl, applyRuntimeFieldDenylist = false) {
|
|
|
10333
10333
|
}
|
|
10334
10334
|
}
|
|
10335
10335
|
props.push({
|
|
10336
|
-
name: publicName ? kebabToCamel(publicName) :
|
|
10336
|
+
name: publicName ? kebabToCamel(publicName) : name2,
|
|
10337
10337
|
type,
|
|
10338
10338
|
required: false,
|
|
10339
10339
|
...defaultValue !== void 0 && { defaultValue },
|
|
@@ -10353,15 +10353,15 @@ function extractAccessorProperties(classDecl, applyRuntimeFieldDenylist = false)
|
|
|
10353
10353
|
continue;
|
|
10354
10354
|
if (isNonPublicLitMember(getter))
|
|
10355
10355
|
continue;
|
|
10356
|
-
const
|
|
10357
|
-
if (
|
|
10356
|
+
const name2 = getter.getName();
|
|
10357
|
+
if (name2 === "observedAttributes" || name2 === "template" || name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
10358
10358
|
continue;
|
|
10359
10359
|
const scope = getter.getScope();
|
|
10360
10360
|
if (scope === "private" || scope === "protected")
|
|
10361
10361
|
continue;
|
|
10362
|
-
const entry = accessors.get(
|
|
10362
|
+
const entry = accessors.get(name2) ?? {};
|
|
10363
10363
|
entry.getter = getter;
|
|
10364
|
-
accessors.set(
|
|
10364
|
+
accessors.set(name2, entry);
|
|
10365
10365
|
}
|
|
10366
10366
|
for (const setter of classDecl.getSetAccessors()) {
|
|
10367
10367
|
if (setter.isStatic())
|
|
@@ -10370,24 +10370,24 @@ function extractAccessorProperties(classDecl, applyRuntimeFieldDenylist = false)
|
|
|
10370
10370
|
continue;
|
|
10371
10371
|
if (isNonPublicLitMember(setter))
|
|
10372
10372
|
continue;
|
|
10373
|
-
const
|
|
10374
|
-
if (
|
|
10373
|
+
const name2 = setter.getName();
|
|
10374
|
+
if (name2 === "observedAttributes" || name2 === "template" || name2.startsWith("#") || isInternalRuntimeField(name2, applyRuntimeFieldDenylist))
|
|
10375
10375
|
continue;
|
|
10376
10376
|
const scope = setter.getScope();
|
|
10377
10377
|
if (scope === "private" || scope === "protected")
|
|
10378
10378
|
continue;
|
|
10379
|
-
const entry = accessors.get(
|
|
10379
|
+
const entry = accessors.get(name2) ?? {};
|
|
10380
10380
|
entry.setter = setter;
|
|
10381
|
-
accessors.set(
|
|
10381
|
+
accessors.set(name2, entry);
|
|
10382
10382
|
}
|
|
10383
|
-
for (const [
|
|
10383
|
+
for (const [name2, { getter, setter }] of accessors) {
|
|
10384
10384
|
const hasPropertyDecorator = getter?.getDecorators().some((decorator) => decorator.getName() === "property") || setter?.getDecorators().some((decorator) => decorator.getName() === "property");
|
|
10385
10385
|
if (!hasPropertyDecorator && !(getter && setter))
|
|
10386
10386
|
continue;
|
|
10387
10387
|
const type = getter?.getReturnTypeNode()?.getText() ?? setter?.getParameters()[0]?.getTypeNode()?.getText() ?? "any";
|
|
10388
10388
|
const accessorNode = getter ?? setter;
|
|
10389
10389
|
props.push({
|
|
10390
|
-
name,
|
|
10390
|
+
name: name2,
|
|
10391
10391
|
type,
|
|
10392
10392
|
required: false,
|
|
10393
10393
|
...accessorNode ? {
|
|
@@ -10409,11 +10409,11 @@ function extractJsDocAttributeProps(classDecl) {
|
|
|
10409
10409
|
const match2 = normalizedComment?.match(/(?:\{([^}]+)\}\s+)?([^\s]+)(?:\s*-\s*([\s\S]*))?/);
|
|
10410
10410
|
if (!match2)
|
|
10411
10411
|
continue;
|
|
10412
|
-
const [, type,
|
|
10413
|
-
if (!
|
|
10412
|
+
const [, type, name2, description] = match2;
|
|
10413
|
+
if (!name2 || name2.startsWith("#"))
|
|
10414
10414
|
continue;
|
|
10415
10415
|
props.push({
|
|
10416
|
-
name,
|
|
10416
|
+
name: name2,
|
|
10417
10417
|
type: type?.trim() || "any",
|
|
10418
10418
|
required: false,
|
|
10419
10419
|
...description ? { description: description.replace(/\s+/g, " ").trim() } : {}
|
|
@@ -10765,7 +10765,7 @@ function extractFromSourceFile4(sourceFile, project) {
|
|
|
10765
10765
|
const tagName = tagNameMap.get(className) ?? siblingDefinedTagName ?? decoratorTagName ?? jsDocTagName ?? fastDefinitionTagName ?? void 0;
|
|
10766
10766
|
if (!tagName)
|
|
10767
10767
|
continue;
|
|
10768
|
-
const
|
|
10768
|
+
const name2 = chooseComponentName(classDecl, className, tagName);
|
|
10769
10769
|
const observedAttrs = extractObservedAttributes(classDecl);
|
|
10770
10770
|
const inheritedProps = extractInheritedClassProperties(classDecl, project);
|
|
10771
10771
|
const classProps = mergePropLists(extractJsDocAttributeProps(classDecl), extractAccessorProperties(classDecl), extractClassProperties(classDecl));
|
|
@@ -10773,7 +10773,7 @@ function extractFromSourceFile4(sourceFile, project) {
|
|
|
10773
10773
|
const templateContent = extractTemplateContent(classDecl, project);
|
|
10774
10774
|
const slots = mergeSlotLists(extractInheritedSlots(classDecl, project), extractJsDocSlots(classDecl), extractSlotsFromTemplate3(templateContent), extractFastTemplateSlots(classDecl, project));
|
|
10775
10775
|
components.push({
|
|
10776
|
-
name,
|
|
10776
|
+
name: name2,
|
|
10777
10777
|
source: sourceFile.getFilePath(),
|
|
10778
10778
|
sourcePath: sourceFile.getFilePath(),
|
|
10779
10779
|
framework: "web-component",
|
|
@@ -11085,8 +11085,8 @@ async function retryComponentWithProject(component, ctx, project, warnings) {
|
|
|
11085
11085
|
}
|
|
11086
11086
|
function addImportedDeclarationsToProject(project, ctx) {
|
|
11087
11087
|
const importedNames = collectReferencedTypeNames(ctx.annotation);
|
|
11088
|
-
for (const
|
|
11089
|
-
const localDecl = findLocalTypeDeclaration(ctx.instance,
|
|
11088
|
+
for (const name2 of [...importedNames]) {
|
|
11089
|
+
const localDecl = findLocalTypeDeclaration(ctx.instance, name2, ctx.moduleScript) ?? (ctx.moduleScript ? findLocalTypeDeclaration(ctx.moduleScript, name2, ctx.instance) : null);
|
|
11090
11090
|
if (localDecl) {
|
|
11091
11091
|
for (const referenced of collectReferencedTypeNames(localDecl))
|
|
11092
11092
|
importedNames.add(referenced);
|
|
@@ -11267,21 +11267,21 @@ function collapseUnresolvedTypeWarnings(warnings) {
|
|
|
11267
11267
|
}
|
|
11268
11268
|
async function extractFromSvelteFile(filePath, source) {
|
|
11269
11269
|
const warnings = [];
|
|
11270
|
-
const
|
|
11270
|
+
const name2 = getSvelteComponentName(filePath);
|
|
11271
11271
|
let ast;
|
|
11272
11272
|
try {
|
|
11273
11273
|
ast = parseSvelte(source, { modern: true });
|
|
11274
11274
|
} catch (e) {
|
|
11275
11275
|
return {
|
|
11276
11276
|
component: null,
|
|
11277
|
-
warnings: [`${
|
|
11277
|
+
warnings: [`${name2}: parse error in ${filePath}: ${e instanceof Error ? e.message : String(e)}`]
|
|
11278
11278
|
};
|
|
11279
11279
|
}
|
|
11280
11280
|
const instance = ast["instance"];
|
|
11281
11281
|
const moduleScript = ast["module"];
|
|
11282
11282
|
const fragment = ast["fragment"];
|
|
11283
11283
|
if (instance && hasV4ExportLetProps(instance)) {
|
|
11284
|
-
warnings.push(`${
|
|
11284
|
+
warnings.push(`${name2}: Svelte 4 export let syntax not yet supported (${filePath}); see INTEG-4267 for v5-only scope and follow-up`);
|
|
11285
11285
|
return { component: null, warnings };
|
|
11286
11286
|
}
|
|
11287
11287
|
const propsCall = instance ? findPropsCall(instance) : null;
|
|
@@ -11296,7 +11296,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11296
11296
|
instance,
|
|
11297
11297
|
moduleScript,
|
|
11298
11298
|
filePath,
|
|
11299
|
-
componentName:
|
|
11299
|
+
componentName: name2,
|
|
11300
11300
|
source,
|
|
11301
11301
|
snippetLocals
|
|
11302
11302
|
});
|
|
@@ -11308,12 +11308,12 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11308
11308
|
extractionReasons.push(...result.additionalReasons);
|
|
11309
11309
|
} else if (instance) {
|
|
11310
11310
|
} else {
|
|
11311
|
-
warnings.push(`${
|
|
11311
|
+
warnings.push(`${name2}: no instance script block (${filePath}); no props extracted`);
|
|
11312
11312
|
}
|
|
11313
11313
|
const templateSlots = fragment ? extractTemplateSlots(fragment) : [];
|
|
11314
11314
|
const { slots, mixedWarning } = mergeSlots2(snippetSlotsFromProps, templateSlots);
|
|
11315
11315
|
if (mixedWarning) {
|
|
11316
|
-
warnings.push(`${
|
|
11316
|
+
warnings.push(`${name2}: mixed Snippet and <slot> usage detected (${filePath}); preferring Snippet entries`);
|
|
11317
11317
|
}
|
|
11318
11318
|
let propsTypeNameCapture;
|
|
11319
11319
|
if (propsCall) {
|
|
@@ -11326,7 +11326,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11326
11326
|
}
|
|
11327
11327
|
}
|
|
11328
11328
|
const component = {
|
|
11329
|
-
name,
|
|
11329
|
+
name: name2,
|
|
11330
11330
|
source: filePath,
|
|
11331
11331
|
framework: "svelte",
|
|
11332
11332
|
props,
|
|
@@ -11352,7 +11352,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
11352
11352
|
instance,
|
|
11353
11353
|
moduleScript,
|
|
11354
11354
|
annotation,
|
|
11355
|
-
componentName:
|
|
11355
|
+
componentName: name2
|
|
11356
11356
|
};
|
|
11357
11357
|
}
|
|
11358
11358
|
}
|
|
@@ -11495,8 +11495,8 @@ function describeAnnotationForUser(annotation) {
|
|
|
11495
11495
|
if (!annotation)
|
|
11496
11496
|
return "<unknown>";
|
|
11497
11497
|
if (annotation.type === "TSTypeReference") {
|
|
11498
|
-
const
|
|
11499
|
-
return
|
|
11498
|
+
const name2 = annotation["typeName"]?.["name"] ?? null;
|
|
11499
|
+
return name2 ? `'${name2}'` : "<unnamed reference>";
|
|
11500
11500
|
}
|
|
11501
11501
|
if (annotation.type === "TSIntersectionType")
|
|
11502
11502
|
return "<intersection>";
|
|
@@ -11571,7 +11571,7 @@ async function resolveViaTypeChecker(annotation, instance, moduleScript, filePat
|
|
|
11571
11571
|
return null;
|
|
11572
11572
|
const members = [];
|
|
11573
11573
|
for (const symbol of properties) {
|
|
11574
|
-
const
|
|
11574
|
+
const name2 = symbol.getName();
|
|
11575
11575
|
const declaration = symbol.getValueDeclaration() ?? symbol.getDeclarations()[0];
|
|
11576
11576
|
if (!declaration)
|
|
11577
11577
|
continue;
|
|
@@ -11586,7 +11586,7 @@ async function resolveViaTypeChecker(annotation, instance, moduleScript, filePat
|
|
|
11586
11586
|
const declaredTypeText = readDeclaredTypeNodeText(declaration);
|
|
11587
11587
|
const isSnippet = declaredTypeText !== null && isSnippetTypeText(declaredTypeText, snippetLocals) || typeRefersToSnippet(propType) || isSnippetTypeText(typeText, snippetLocals);
|
|
11588
11588
|
members.push({
|
|
11589
|
-
name,
|
|
11589
|
+
name: name2,
|
|
11590
11590
|
optional: optional5,
|
|
11591
11591
|
typeText,
|
|
11592
11592
|
...declaredTypeText ? { declaredTypeText } : {},
|
|
@@ -11674,7 +11674,7 @@ function mergeSets(a, b) {
|
|
|
11674
11674
|
out.add(v);
|
|
11675
11675
|
return out;
|
|
11676
11676
|
}
|
|
11677
|
-
function findLocalTypeDeclaration(instance,
|
|
11677
|
+
function findLocalTypeDeclaration(instance, name2, module) {
|
|
11678
11678
|
for (const script of [instance, module]) {
|
|
11679
11679
|
const body = script?.["content"]?.["body"];
|
|
11680
11680
|
if (!body)
|
|
@@ -11683,7 +11683,7 @@ function findLocalTypeDeclaration(instance, name, module) {
|
|
|
11683
11683
|
const decl = stmt.type === "ExportNamedDeclaration" ? stmt["declaration"] ?? stmt : stmt;
|
|
11684
11684
|
if (decl.type === "TSInterfaceDeclaration" || decl.type === "TSTypeAliasDeclaration") {
|
|
11685
11685
|
const id = decl["id"];
|
|
11686
|
-
if (id?.["name"] ===
|
|
11686
|
+
if (id?.["name"] === name2)
|
|
11687
11687
|
return decl;
|
|
11688
11688
|
}
|
|
11689
11689
|
}
|
|
@@ -11704,8 +11704,8 @@ function readMembersFromInterfaceOrAlias(decl, snippetLocals) {
|
|
|
11704
11704
|
}
|
|
11705
11705
|
return [];
|
|
11706
11706
|
}
|
|
11707
|
-
function readMembersFromTypeLiteral(
|
|
11708
|
-
const members =
|
|
11707
|
+
function readMembersFromTypeLiteral(literal4, snippetLocals) {
|
|
11708
|
+
const members = literal4["members"];
|
|
11709
11709
|
if (!members)
|
|
11710
11710
|
return [];
|
|
11711
11711
|
return members.map((m) => readPropertySignature(m, snippetLocals)).filter((m) => !!m);
|
|
@@ -11714,8 +11714,8 @@ function readPropertySignature(member, snippetLocals) {
|
|
|
11714
11714
|
if (member.type !== "TSPropertySignature")
|
|
11715
11715
|
return null;
|
|
11716
11716
|
const key = member["key"];
|
|
11717
|
-
const
|
|
11718
|
-
if (!
|
|
11717
|
+
const name2 = key?.["name"] ?? null;
|
|
11718
|
+
if (!name2)
|
|
11719
11719
|
return null;
|
|
11720
11720
|
const optional5 = !!member["optional"];
|
|
11721
11721
|
const typeNode = member["typeAnnotation"]?.["typeAnnotation"];
|
|
@@ -11725,7 +11725,7 @@ function readPropertySignature(member, snippetLocals) {
|
|
|
11725
11725
|
const leading = member["leadingComments"] ?? [];
|
|
11726
11726
|
const description = extractJsdocText(leading);
|
|
11727
11727
|
return {
|
|
11728
|
-
name,
|
|
11728
|
+
name: name2,
|
|
11729
11729
|
optional: optional5,
|
|
11730
11730
|
typeText,
|
|
11731
11731
|
isSnippet,
|
|
@@ -11864,19 +11864,19 @@ function extractFromDestructure(propsCall, _ctx, typeMembers, warnings, addition
|
|
|
11864
11864
|
if (p.type !== "Property")
|
|
11865
11865
|
continue;
|
|
11866
11866
|
const key = p["key"];
|
|
11867
|
-
const
|
|
11868
|
-
if (!
|
|
11867
|
+
const name2 = key?.["name"] ?? null;
|
|
11868
|
+
if (!name2)
|
|
11869
11869
|
continue;
|
|
11870
|
-
seenInDestructure.add(
|
|
11870
|
+
seenInDestructure.add(name2);
|
|
11871
11871
|
const value = p["value"];
|
|
11872
11872
|
const hasDefault = value?.type === "AssignmentPattern";
|
|
11873
11873
|
const defaultValueRaw = hasDefault ? renderLiteral(value["right"]) : void 0;
|
|
11874
|
-
const typeMember = typeByName.get(
|
|
11874
|
+
const typeMember = typeByName.get(name2);
|
|
11875
11875
|
if (typeMember?.isSnippet) {
|
|
11876
|
-
snippetNames.add(
|
|
11876
|
+
snippetNames.add(name2);
|
|
11877
11877
|
const slot = {
|
|
11878
|
-
name,
|
|
11879
|
-
isDefault:
|
|
11878
|
+
name: name2,
|
|
11879
|
+
isDefault: name2 === "children",
|
|
11880
11880
|
...typeMember.description ? { description: typeMember.description } : {}
|
|
11881
11881
|
};
|
|
11882
11882
|
const authorText = typeMember.declaredTypeText ?? typeMember.typeText;
|
|
@@ -11887,7 +11887,7 @@ function extractFromDestructure(propsCall, _ctx, typeMembers, warnings, addition
|
|
|
11887
11887
|
}
|
|
11888
11888
|
const required = typeMember ? !typeMember.optional && !hasDefault : !hasDefault;
|
|
11889
11889
|
const propDef = {
|
|
11890
|
-
name,
|
|
11890
|
+
name: name2,
|
|
11891
11891
|
type: typeMember?.typeText ?? "unknown",
|
|
11892
11892
|
required
|
|
11893
11893
|
};
|
|
@@ -11945,9 +11945,9 @@ function propertyOrder(properties) {
|
|
|
11945
11945
|
for (const p of properties) {
|
|
11946
11946
|
if (p.type !== "Property")
|
|
11947
11947
|
continue;
|
|
11948
|
-
const
|
|
11949
|
-
if (
|
|
11950
|
-
m.set(
|
|
11948
|
+
const name2 = p["key"]?.["name"] ?? null;
|
|
11949
|
+
if (name2)
|
|
11950
|
+
m.set(name2, i++);
|
|
11951
11951
|
}
|
|
11952
11952
|
return m;
|
|
11953
11953
|
}
|
|
@@ -12126,10 +12126,10 @@ function extractTemplateSlots(fragment) {
|
|
|
12126
12126
|
if (!node)
|
|
12127
12127
|
return;
|
|
12128
12128
|
if (node.type === "SlotElement") {
|
|
12129
|
-
const
|
|
12130
|
-
if (!seen.has(
|
|
12131
|
-
seen.add(
|
|
12132
|
-
slots.push({ name, isDefault:
|
|
12129
|
+
const name2 = readSlotName(node);
|
|
12130
|
+
if (!seen.has(name2)) {
|
|
12131
|
+
seen.add(name2);
|
|
12132
|
+
slots.push({ name: name2, isDefault: name2 === "default" });
|
|
12133
12133
|
}
|
|
12134
12134
|
}
|
|
12135
12135
|
const children = node["nodes"] ?? node["children"] ?? [];
|
|
@@ -12328,9 +12328,9 @@ function extractDecoratorInput(field) {
|
|
|
12328
12328
|
}
|
|
12329
12329
|
const resolved = resolvePropType(typeNode);
|
|
12330
12330
|
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
12331
|
-
const
|
|
12331
|
+
const name2 = alias ?? fieldName;
|
|
12332
12332
|
const prop = {
|
|
12333
|
-
name,
|
|
12333
|
+
name: name2,
|
|
12334
12334
|
type: typeText,
|
|
12335
12335
|
required,
|
|
12336
12336
|
sourceStartLine: field.getStartLineNumber(),
|
|
@@ -12400,9 +12400,9 @@ function extractSignalInput(field) {
|
|
|
12400
12400
|
const typeArg = init.getTypeArguments()[0];
|
|
12401
12401
|
const resolved = resolvePropType(typeArg);
|
|
12402
12402
|
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
12403
|
-
const
|
|
12403
|
+
const name2 = alias ?? fieldName;
|
|
12404
12404
|
const prop = {
|
|
12405
|
-
name,
|
|
12405
|
+
name: name2,
|
|
12406
12406
|
type: typeText,
|
|
12407
12407
|
required,
|
|
12408
12408
|
sourceStartLine: field.getStartLineNumber(),
|
|
@@ -12485,10 +12485,10 @@ function extractProps2(cls, meta) {
|
|
|
12485
12485
|
const parsed = parseInputsArrayEntry(entry);
|
|
12486
12486
|
if (!parsed)
|
|
12487
12487
|
continue;
|
|
12488
|
-
const
|
|
12489
|
-
if (byName.has(
|
|
12488
|
+
const name2 = parsed.alias ?? parsed.fieldName;
|
|
12489
|
+
if (byName.has(name2))
|
|
12490
12490
|
continue;
|
|
12491
|
-
byName.set(
|
|
12491
|
+
byName.set(name2, { name: name2, type: "any", required: false });
|
|
12492
12492
|
}
|
|
12493
12493
|
return [...byName.values()];
|
|
12494
12494
|
}
|
|
@@ -12601,16 +12601,16 @@ async function resolveTemplateSource(meta) {
|
|
|
12601
12601
|
|
|
12602
12602
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/strip-library-prefix.js
|
|
12603
12603
|
var KNOWN_PREFIXES = ["Mat", "Cdk", "Nz", "Cds", "Ibm", "Clr", "Hlm", "Brn", "Tui", "Nb", "Fd", "P", "Ng"];
|
|
12604
|
-
function stripLibraryPrefix(
|
|
12604
|
+
function stripLibraryPrefix(name2) {
|
|
12605
12605
|
for (const prefix of KNOWN_PREFIXES) {
|
|
12606
|
-
if (
|
|
12607
|
-
const rest =
|
|
12606
|
+
if (name2.startsWith(prefix) && name2.length > prefix.length) {
|
|
12607
|
+
const rest = name2.slice(prefix.length);
|
|
12608
12608
|
if (rest[0] && rest[0] === rest[0].toUpperCase()) {
|
|
12609
12609
|
return rest;
|
|
12610
12610
|
}
|
|
12611
12611
|
}
|
|
12612
12612
|
}
|
|
12613
|
-
return
|
|
12613
|
+
return name2;
|
|
12614
12614
|
}
|
|
12615
12615
|
|
|
12616
12616
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/derive-slot-name.js
|
|
@@ -12678,8 +12678,8 @@ function extractContentChildQueries(cls) {
|
|
|
12678
12678
|
if (init && Node15.isCallExpression(init)) {
|
|
12679
12679
|
const callee = init.getExpression();
|
|
12680
12680
|
if (Node15.isIdentifier(callee)) {
|
|
12681
|
-
const
|
|
12682
|
-
if (
|
|
12681
|
+
const name2 = callee.getText();
|
|
12682
|
+
if (name2 === "contentChild" || name2 === "contentChildren") {
|
|
12683
12683
|
const first = init.getArguments()[0];
|
|
12684
12684
|
const allowed = resolveClassIdentifierArg(first);
|
|
12685
12685
|
out.push(buildSlot(fieldName, allowed));
|
|
@@ -12708,9 +12708,9 @@ function resolveClassIdentifierArg(arg) {
|
|
|
12708
12708
|
return [arg.getText()];
|
|
12709
12709
|
return [];
|
|
12710
12710
|
}
|
|
12711
|
-
function buildSlot(
|
|
12711
|
+
function buildSlot(name2, allowed) {
|
|
12712
12712
|
const slot = {
|
|
12713
|
-
name,
|
|
12713
|
+
name: name2,
|
|
12714
12714
|
isDefault: false
|
|
12715
12715
|
};
|
|
12716
12716
|
if (allowed.length > 0)
|
|
@@ -12744,11 +12744,11 @@ async function extractSlots3(cls, meta, props) {
|
|
|
12744
12744
|
const template = await resolveTemplateSource(meta);
|
|
12745
12745
|
if (template) {
|
|
12746
12746
|
for (const el of parseNgContentElements(template)) {
|
|
12747
|
-
const
|
|
12748
|
-
if (byName.has(
|
|
12747
|
+
const name2 = deriveSlotName(el.rawSelect, meta.normalizedName);
|
|
12748
|
+
if (byName.has(name2))
|
|
12749
12749
|
continue;
|
|
12750
|
-
byName.set(
|
|
12751
|
-
name,
|
|
12750
|
+
byName.set(name2, {
|
|
12751
|
+
name: name2,
|
|
12752
12752
|
isDefault: el.rawSelect === null
|
|
12753
12753
|
});
|
|
12754
12754
|
}
|
|
@@ -12830,9 +12830,9 @@ function normalizeSlots(slots) {
|
|
|
12830
12830
|
return slots.map((slot) => {
|
|
12831
12831
|
if (slot.name.trim())
|
|
12832
12832
|
return slot;
|
|
12833
|
-
const
|
|
12833
|
+
const name2 = fallbackIndex === 0 ? "children" : `slot_${fallbackIndex}`;
|
|
12834
12834
|
fallbackIndex++;
|
|
12835
|
-
return { ...slot, name };
|
|
12835
|
+
return { ...slot, name: name2 };
|
|
12836
12836
|
});
|
|
12837
12837
|
}
|
|
12838
12838
|
|
|
@@ -13547,8 +13547,8 @@ ${fileDigest}`);
|
|
|
13547
13547
|
|
|
13548
13548
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/edges/manifest-doc-evidence.js
|
|
13549
13549
|
import { dirname as dirname14 } from "node:path";
|
|
13550
|
-
function kebabToPascal3(
|
|
13551
|
-
return
|
|
13550
|
+
function kebabToPascal3(name2) {
|
|
13551
|
+
return name2.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
|
|
13552
13552
|
}
|
|
13553
13553
|
function collectManifestEdges(files, componentNames) {
|
|
13554
13554
|
const edges = [];
|
|
@@ -13940,9 +13940,9 @@ import { resolve as resolve16 } from "node:path";
|
|
|
13940
13940
|
|
|
13941
13941
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/create-component-id.js
|
|
13942
13942
|
import { createHash as createHash7 } from "node:crypto";
|
|
13943
|
-
function createComponentId(
|
|
13944
|
-
const sourceHash = createHash7("sha256").update(`${
|
|
13945
|
-
return `${
|
|
13943
|
+
function createComponentId(name2, resolvedSourcePath) {
|
|
13944
|
+
const sourceHash = createHash7("sha256").update(`${name2}:${resolvedSourcePath}`).digest("hex").slice(0, 12);
|
|
13945
|
+
return `${name2}-${sourceHash}`;
|
|
13946
13946
|
}
|
|
13947
13947
|
|
|
13948
13948
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/resolve-component-source-path.js
|
|
@@ -14239,10 +14239,10 @@ var CATEGORY_BY_EXTENSION = {
|
|
|
14239
14239
|
};
|
|
14240
14240
|
|
|
14241
14241
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/categorize-file.js
|
|
14242
|
-
function categorizeFile(
|
|
14243
|
-
if (
|
|
14242
|
+
function categorizeFile(name2) {
|
|
14243
|
+
if (name2.endsWith(".d.ts"))
|
|
14244
14244
|
return "other";
|
|
14245
|
-
const ext = path.extname(
|
|
14245
|
+
const ext = path.extname(name2);
|
|
14246
14246
|
return CATEGORY_BY_EXTENSION[ext] ?? "other";
|
|
14247
14247
|
}
|
|
14248
14248
|
|
|
@@ -14250,20 +14250,20 @@ function categorizeFile(name) {
|
|
|
14250
14250
|
import path2 from "node:path";
|
|
14251
14251
|
|
|
14252
14252
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-noise-config-file.js
|
|
14253
|
-
function isNoiseConfigFile(
|
|
14254
|
-
return DENYLISTED_EXACT_FILE_NAMES.has(
|
|
14253
|
+
function isNoiseConfigFile(name2) {
|
|
14254
|
+
return DENYLISTED_EXACT_FILE_NAMES.has(name2) || DENYLISTED_FILE_NAME_PATTERNS.some((pattern) => pattern.test(name2));
|
|
14255
14255
|
}
|
|
14256
14256
|
|
|
14257
14257
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/is-source-file.js
|
|
14258
|
-
function isSourceFile(
|
|
14259
|
-
if (
|
|
14258
|
+
function isSourceFile(name2) {
|
|
14259
|
+
if (name2.endsWith(".d.ts"))
|
|
14260
14260
|
return false;
|
|
14261
|
-
if (EXCLUDED_SUFFIXES.some((suffix) =>
|
|
14261
|
+
if (EXCLUDED_SUFFIXES.some((suffix) => name2.endsWith(suffix)))
|
|
14262
14262
|
return false;
|
|
14263
|
-
const ext = path2.extname(
|
|
14263
|
+
const ext = path2.extname(name2);
|
|
14264
14264
|
if (INCLUDED_EXTENSIONS.has(ext))
|
|
14265
14265
|
return true;
|
|
14266
|
-
if (DENYLIST_GATED_EXTENSIONS.has(ext) && !isNoiseConfigFile(
|
|
14266
|
+
if (DENYLIST_GATED_EXTENSIONS.has(ext) && !isNoiseConfigFile(name2))
|
|
14267
14267
|
return true;
|
|
14268
14268
|
return false;
|
|
14269
14269
|
}
|
|
@@ -14469,7 +14469,7 @@ async function buildSourceFingerprint(opts) {
|
|
|
14469
14469
|
const seen = /* @__PURE__ */ new Set();
|
|
14470
14470
|
for (const row of rows) {
|
|
14471
14471
|
const sourcePath = rowField(row, "source_path");
|
|
14472
|
-
const
|
|
14472
|
+
const name2 = rowField(row, "name");
|
|
14473
14473
|
if (!sourcePath)
|
|
14474
14474
|
continue;
|
|
14475
14475
|
const abs = resolve19(sourcePath);
|
|
@@ -14479,8 +14479,8 @@ async function buildSourceFingerprint(opts) {
|
|
|
14479
14479
|
try {
|
|
14480
14480
|
const st = await stat2(abs);
|
|
14481
14481
|
const entry = { mtime: st.mtime.toISOString() };
|
|
14482
|
-
if (
|
|
14483
|
-
entry.componentName =
|
|
14482
|
+
if (name2)
|
|
14483
|
+
entry.componentName = name2;
|
|
14484
14484
|
files[abs] = entry;
|
|
14485
14485
|
} catch {
|
|
14486
14486
|
}
|
|
@@ -14511,10 +14511,10 @@ var SAVE_FILES = ["components.json", "tokens.json"];
|
|
|
14511
14511
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/list-conflicting-files.js
|
|
14512
14512
|
async function listConflictingFiles(path5) {
|
|
14513
14513
|
const conflicts = [];
|
|
14514
|
-
for (const
|
|
14514
|
+
for (const name2 of SAVE_FILES) {
|
|
14515
14515
|
try {
|
|
14516
|
-
await access4(join14(path5,
|
|
14517
|
-
conflicts.push(
|
|
14516
|
+
await access4(join14(path5, name2));
|
|
14517
|
+
conflicts.push(name2);
|
|
14518
14518
|
} catch {
|
|
14519
14519
|
}
|
|
14520
14520
|
}
|
|
@@ -14731,18 +14731,18 @@ var separatorObjectExplode = (style) => {
|
|
|
14731
14731
|
return "&";
|
|
14732
14732
|
}
|
|
14733
14733
|
};
|
|
14734
|
-
var serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
|
|
14734
|
+
var serializeArrayParam = ({ allowReserved, explode, name: name2, style, value }) => {
|
|
14735
14735
|
if (!explode) {
|
|
14736
14736
|
const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
|
|
14737
14737
|
switch (style) {
|
|
14738
14738
|
case "label":
|
|
14739
14739
|
return `.${joinedValues2}`;
|
|
14740
14740
|
case "matrix":
|
|
14741
|
-
return `;${
|
|
14741
|
+
return `;${name2}=${joinedValues2}`;
|
|
14742
14742
|
case "simple":
|
|
14743
14743
|
return joinedValues2;
|
|
14744
14744
|
default:
|
|
14745
|
-
return `${
|
|
14745
|
+
return `${name2}=${joinedValues2}`;
|
|
14746
14746
|
}
|
|
14747
14747
|
}
|
|
14748
14748
|
const separator = separatorArrayExplode(style);
|
|
@@ -14752,24 +14752,24 @@ var serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
|
|
|
14752
14752
|
}
|
|
14753
14753
|
return serializePrimitiveParam({
|
|
14754
14754
|
allowReserved,
|
|
14755
|
-
name,
|
|
14755
|
+
name: name2,
|
|
14756
14756
|
value: v
|
|
14757
14757
|
});
|
|
14758
14758
|
}).join(separator);
|
|
14759
14759
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
14760
14760
|
};
|
|
14761
|
-
var serializePrimitiveParam = ({ allowReserved, name, value }) => {
|
|
14761
|
+
var serializePrimitiveParam = ({ allowReserved, name: name2, value }) => {
|
|
14762
14762
|
if (value === void 0 || value === null) {
|
|
14763
14763
|
return "";
|
|
14764
14764
|
}
|
|
14765
14765
|
if (typeof value === "object") {
|
|
14766
14766
|
throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
|
|
14767
14767
|
}
|
|
14768
|
-
return `${
|
|
14768
|
+
return `${name2}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
14769
14769
|
};
|
|
14770
|
-
var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly }) => {
|
|
14770
|
+
var serializeObjectParam = ({ allowReserved, explode, name: name2, style, value, valueOnly }) => {
|
|
14771
14771
|
if (value instanceof Date) {
|
|
14772
|
-
return valueOnly ? value.toISOString() : `${
|
|
14772
|
+
return valueOnly ? value.toISOString() : `${name2}=${value.toISOString()}`;
|
|
14773
14773
|
}
|
|
14774
14774
|
if (style !== "deepObject" && !explode) {
|
|
14775
14775
|
let values = [];
|
|
@@ -14783,11 +14783,11 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
14783
14783
|
const joinedValues2 = values.join(",");
|
|
14784
14784
|
switch (style) {
|
|
14785
14785
|
case "form":
|
|
14786
|
-
return `${
|
|
14786
|
+
return `${name2}=${joinedValues2}`;
|
|
14787
14787
|
case "label":
|
|
14788
14788
|
return `.${joinedValues2}`;
|
|
14789
14789
|
case "matrix":
|
|
14790
|
-
return `;${
|
|
14790
|
+
return `;${name2}=${joinedValues2}`;
|
|
14791
14791
|
default:
|
|
14792
14792
|
return joinedValues2;
|
|
14793
14793
|
}
|
|
@@ -14795,7 +14795,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
14795
14795
|
const separator = separatorObjectExplode(style);
|
|
14796
14796
|
const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
|
|
14797
14797
|
allowReserved,
|
|
14798
|
-
name: style === "deepObject" ? `${
|
|
14798
|
+
name: style === "deepObject" ? `${name2}[${key}]` : key,
|
|
14799
14799
|
value: v
|
|
14800
14800
|
})).join(separator);
|
|
14801
14801
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
@@ -14809,31 +14809,31 @@ var defaultPathSerializer = ({ path: path5, url: _url }) => {
|
|
|
14809
14809
|
if (matches) {
|
|
14810
14810
|
for (const match2 of matches) {
|
|
14811
14811
|
let explode = false;
|
|
14812
|
-
let
|
|
14812
|
+
let name2 = match2.substring(1, match2.length - 1);
|
|
14813
14813
|
let style = "simple";
|
|
14814
|
-
if (
|
|
14814
|
+
if (name2.endsWith("*")) {
|
|
14815
14815
|
explode = true;
|
|
14816
|
-
|
|
14816
|
+
name2 = name2.substring(0, name2.length - 1);
|
|
14817
14817
|
}
|
|
14818
|
-
if (
|
|
14819
|
-
|
|
14818
|
+
if (name2.startsWith(".")) {
|
|
14819
|
+
name2 = name2.substring(1);
|
|
14820
14820
|
style = "label";
|
|
14821
|
-
} else if (
|
|
14822
|
-
|
|
14821
|
+
} else if (name2.startsWith(";")) {
|
|
14822
|
+
name2 = name2.substring(1);
|
|
14823
14823
|
style = "matrix";
|
|
14824
14824
|
}
|
|
14825
|
-
const value = path5[
|
|
14825
|
+
const value = path5[name2];
|
|
14826
14826
|
if (value === void 0 || value === null) {
|
|
14827
14827
|
continue;
|
|
14828
14828
|
}
|
|
14829
14829
|
if (Array.isArray(value)) {
|
|
14830
|
-
url = url.replace(match2, serializeArrayParam({ explode, name, style, value }));
|
|
14830
|
+
url = url.replace(match2, serializeArrayParam({ explode, name: name2, style, value }));
|
|
14831
14831
|
continue;
|
|
14832
14832
|
}
|
|
14833
14833
|
if (typeof value === "object") {
|
|
14834
14834
|
url = url.replace(match2, serializeObjectParam({
|
|
14835
14835
|
explode,
|
|
14836
|
-
name,
|
|
14836
|
+
name: name2,
|
|
14837
14837
|
style,
|
|
14838
14838
|
value,
|
|
14839
14839
|
valueOnly: true
|
|
@@ -14842,7 +14842,7 @@ var defaultPathSerializer = ({ path: path5, url: _url }) => {
|
|
|
14842
14842
|
}
|
|
14843
14843
|
if (style === "matrix") {
|
|
14844
14844
|
url = url.replace(match2, `;${serializePrimitiveParam({
|
|
14845
|
-
name,
|
|
14845
|
+
name: name2,
|
|
14846
14846
|
value
|
|
14847
14847
|
})}`);
|
|
14848
14848
|
continue;
|
|
@@ -14853,12 +14853,12 @@ var defaultPathSerializer = ({ path: path5, url: _url }) => {
|
|
|
14853
14853
|
}
|
|
14854
14854
|
return url;
|
|
14855
14855
|
};
|
|
14856
|
-
var createQuerySerializer = ({ allowReserved, array:
|
|
14856
|
+
var createQuerySerializer = ({ allowReserved, array: array4, object } = {}) => {
|
|
14857
14857
|
const querySerializer = (queryParams) => {
|
|
14858
14858
|
const search = [];
|
|
14859
14859
|
if (queryParams && typeof queryParams === "object") {
|
|
14860
|
-
for (const
|
|
14861
|
-
const value = queryParams[
|
|
14860
|
+
for (const name2 in queryParams) {
|
|
14861
|
+
const value = queryParams[name2];
|
|
14862
14862
|
if (value === void 0 || value === null) {
|
|
14863
14863
|
continue;
|
|
14864
14864
|
}
|
|
@@ -14866,10 +14866,10 @@ var createQuerySerializer = ({ allowReserved, array: array3, object } = {}) => {
|
|
|
14866
14866
|
const serializedArray = serializeArrayParam({
|
|
14867
14867
|
allowReserved,
|
|
14868
14868
|
explode: true,
|
|
14869
|
-
name,
|
|
14869
|
+
name: name2,
|
|
14870
14870
|
style: "form",
|
|
14871
14871
|
value,
|
|
14872
|
-
...
|
|
14872
|
+
...array4
|
|
14873
14873
|
});
|
|
14874
14874
|
if (serializedArray)
|
|
14875
14875
|
search.push(serializedArray);
|
|
@@ -14877,7 +14877,7 @@ var createQuerySerializer = ({ allowReserved, array: array3, object } = {}) => {
|
|
|
14877
14877
|
const serializedObject = serializeObjectParam({
|
|
14878
14878
|
allowReserved,
|
|
14879
14879
|
explode: true,
|
|
14880
|
-
name,
|
|
14880
|
+
name: name2,
|
|
14881
14881
|
style: "deepObject",
|
|
14882
14882
|
value,
|
|
14883
14883
|
...object
|
|
@@ -14887,7 +14887,7 @@ var createQuerySerializer = ({ allowReserved, array: array3, object } = {}) => {
|
|
|
14887
14887
|
} else {
|
|
14888
14888
|
const serializedPrimitive = serializePrimitiveParam({
|
|
14889
14889
|
allowReserved,
|
|
14890
|
-
name,
|
|
14890
|
+
name: name2,
|
|
14891
14891
|
value
|
|
14892
14892
|
});
|
|
14893
14893
|
if (serializedPrimitive)
|
|
@@ -14921,11 +14921,11 @@ var getParseAs = (contentType) => {
|
|
|
14921
14921
|
}
|
|
14922
14922
|
return;
|
|
14923
14923
|
};
|
|
14924
|
-
var checkForExistence = (options,
|
|
14925
|
-
if (!
|
|
14924
|
+
var checkForExistence = (options, name2) => {
|
|
14925
|
+
if (!name2) {
|
|
14926
14926
|
return false;
|
|
14927
14927
|
}
|
|
14928
|
-
if (options.headers.has(
|
|
14928
|
+
if (options.headers.has(name2) || options.query?.[name2] || options.headers.get("Cookie")?.includes(`${name2}=`)) {
|
|
14929
14929
|
return true;
|
|
14930
14930
|
}
|
|
14931
14931
|
return false;
|
|
@@ -14939,20 +14939,20 @@ var setAuthParams = async ({ security, ...options }) => {
|
|
|
14939
14939
|
if (!token) {
|
|
14940
14940
|
continue;
|
|
14941
14941
|
}
|
|
14942
|
-
const
|
|
14942
|
+
const name2 = auth.name ?? "Authorization";
|
|
14943
14943
|
switch (auth.in) {
|
|
14944
14944
|
case "query":
|
|
14945
14945
|
if (!options.query) {
|
|
14946
14946
|
options.query = {};
|
|
14947
14947
|
}
|
|
14948
|
-
options.query[
|
|
14948
|
+
options.query[name2] = token;
|
|
14949
14949
|
break;
|
|
14950
14950
|
case "cookie":
|
|
14951
|
-
options.headers.append("Cookie", `${
|
|
14951
|
+
options.headers.append("Cookie", `${name2}=${token}`);
|
|
14952
14952
|
break;
|
|
14953
14953
|
case "header":
|
|
14954
14954
|
default:
|
|
14955
|
-
options.headers.set(
|
|
14955
|
+
options.headers.set(name2, token);
|
|
14956
14956
|
break;
|
|
14957
14957
|
}
|
|
14958
14958
|
}
|
|
@@ -15811,11 +15811,11 @@ function parseEdsiError(rawInput) {
|
|
|
15811
15811
|
...binding.diagnostics ? { diagnostics: binding.diagnostics } : {}
|
|
15812
15812
|
};
|
|
15813
15813
|
}
|
|
15814
|
-
const
|
|
15815
|
-
if (
|
|
15814
|
+
const literal4 = parseObjectLiteralTail(cleaned);
|
|
15815
|
+
if (literal4 && (literal4.code || literal4.cycle)) {
|
|
15816
15816
|
const braceStart = cleaned.lastIndexOf("{");
|
|
15817
15817
|
const head = braceStart === -1 ? cleaned : cleaned.slice(0, braceStart).trim();
|
|
15818
|
-
return { code:
|
|
15818
|
+
return { code: literal4.code ?? null, message: head || cleaned, cycle: literal4.cycle ?? null, raw: false };
|
|
15819
15819
|
}
|
|
15820
15820
|
return { code: null, message: cleaned || prefix || rawInput, cycle: null, raw: true };
|
|
15821
15821
|
}
|
|
@@ -16118,8 +16118,8 @@ function countCharacterEdits(a, b) {
|
|
|
16118
16118
|
}
|
|
16119
16119
|
|
|
16120
16120
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/helpers/existing-entities/simplify-name-for-comparison.js
|
|
16121
|
-
function simplifyNameForComparison(
|
|
16122
|
-
const stripped =
|
|
16121
|
+
function simplifyNameForComparison(name2) {
|
|
16122
|
+
const stripped = name2.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
16123
16123
|
return stripped.endsWith("s") && stripped.length > 1 ? stripped.slice(0, -1) : stripped;
|
|
16124
16124
|
}
|
|
16125
16125
|
|
|
@@ -16421,9 +16421,9 @@ init_cache_keys();
|
|
|
16421
16421
|
import { execFile } from "node:child_process";
|
|
16422
16422
|
import { promisify } from "node:util";
|
|
16423
16423
|
var execFileAsync = promisify(execFile);
|
|
16424
|
-
async function binaryExists(
|
|
16424
|
+
async function binaryExists(name2) {
|
|
16425
16425
|
try {
|
|
16426
|
-
await execFileAsync(process.platform === "win32" ? "where" : "which", [
|
|
16426
|
+
await execFileAsync(process.platform === "win32" ? "where" : "which", [name2]);
|
|
16427
16427
|
return true;
|
|
16428
16428
|
} catch {
|
|
16429
16429
|
return false;
|
|
@@ -16893,20 +16893,20 @@ function collectSiblingRendererImports(sourceText) {
|
|
|
16893
16893
|
continue;
|
|
16894
16894
|
if (/-g(?:ql|gl)(?:$|\.)/i.test(importPath))
|
|
16895
16895
|
continue;
|
|
16896
|
-
for (const
|
|
16897
|
-
if (
|
|
16898
|
-
names.add(
|
|
16896
|
+
for (const name2 of parseImportedNames(importClause)) {
|
|
16897
|
+
if (name2)
|
|
16898
|
+
names.add(name2);
|
|
16899
16899
|
}
|
|
16900
16900
|
}
|
|
16901
16901
|
return [...names];
|
|
16902
16902
|
}
|
|
16903
16903
|
function hasSiblingForwardRender(sourceText, siblingImports) {
|
|
16904
|
-
return siblingImports.some((
|
|
16905
|
-
const renderPattern = new RegExp(`<${escapeRegExp(
|
|
16904
|
+
return siblingImports.some((name2) => {
|
|
16905
|
+
const renderPattern = new RegExp(`<${escapeRegExp(name2)}\\b[\\s\\S]*?(?:/>|</${escapeRegExp(name2)}>)`);
|
|
16906
16906
|
if (!renderPattern.test(sourceText))
|
|
16907
16907
|
return false;
|
|
16908
|
-
const siblingSpreadPattern = new RegExp(`<${escapeRegExp(
|
|
16909
|
-
const propsPlusSiblingSpreadPattern = new RegExp(`<${escapeRegExp(
|
|
16908
|
+
const siblingSpreadPattern = new RegExp(`<${escapeRegExp(name2)}\\b[^>]*\\{\\.\\.\\.(?!props\\b)[^}]+\\}`);
|
|
16909
|
+
const propsPlusSiblingSpreadPattern = new RegExp(`<${escapeRegExp(name2)}\\b[^>]*\\{\\.\\.\\.props\\}[^>]*\\{\\.\\.\\.(?!props\\b)[^}]+\\}`);
|
|
16910
16910
|
return siblingSpreadPattern.test(sourceText) || propsPlusSiblingSpreadPattern.test(sourceText);
|
|
16911
16911
|
});
|
|
16912
16912
|
}
|
|
@@ -17153,34 +17153,34 @@ var DOM_PASS_THROUGH_PROPS = /* @__PURE__ */ new Set([
|
|
|
17153
17153
|
"modelValue",
|
|
17154
17154
|
"modelModifiers"
|
|
17155
17155
|
]);
|
|
17156
|
-
function isDomPassThroughProp(
|
|
17157
|
-
if (DOM_PASS_THROUGH_PROPS.has(
|
|
17156
|
+
function isDomPassThroughProp(name2) {
|
|
17157
|
+
if (DOM_PASS_THROUGH_PROPS.has(name2))
|
|
17158
17158
|
return true;
|
|
17159
|
-
if (/^aria[-A-Z]/.test(
|
|
17159
|
+
if (/^aria[-A-Z]/.test(name2))
|
|
17160
17160
|
return true;
|
|
17161
|
-
return
|
|
17161
|
+
return name2.startsWith("data-");
|
|
17162
17162
|
}
|
|
17163
17163
|
function preClassifyProp(prop) {
|
|
17164
|
-
const { name, type } = prop;
|
|
17165
|
-
if (/^on[A-Z]/.test(
|
|
17164
|
+
const { name: name2, type } = prop;
|
|
17165
|
+
if (/^on[A-Z]/.test(name2) || type.includes("=> void") || type.includes("EventHandler")) {
|
|
17166
17166
|
return { category: "exclude" };
|
|
17167
17167
|
}
|
|
17168
|
-
if (
|
|
17168
|
+
if (name2 === "ref" || name2 === "innerRef" || type.includes("Ref<") || type.includes("RefObject<")) {
|
|
17169
17169
|
return { category: "exclude" };
|
|
17170
17170
|
}
|
|
17171
|
-
if (
|
|
17171
|
+
if (name2 === "testId" || name2 === "data-testid" || name2 === "dataTestId") {
|
|
17172
17172
|
return { category: "exclude" };
|
|
17173
17173
|
}
|
|
17174
|
-
if (
|
|
17174
|
+
if (name2 === "key") {
|
|
17175
17175
|
return { category: "exclude" };
|
|
17176
17176
|
}
|
|
17177
17177
|
if (type.includes("Dispatch<") || type.includes("SetStateAction")) {
|
|
17178
17178
|
return { category: "exclude" };
|
|
17179
17179
|
}
|
|
17180
|
-
if (isDomPassThroughProp(
|
|
17180
|
+
if (isDomPassThroughProp(name2)) {
|
|
17181
17181
|
return { category: "exclude" };
|
|
17182
17182
|
}
|
|
17183
|
-
if (
|
|
17183
|
+
if (name2 === "name" && prop.domAttribute) {
|
|
17184
17184
|
return { category: "exclude" };
|
|
17185
17185
|
}
|
|
17186
17186
|
if (isStringLiteralUnion(type)) {
|
|
@@ -17189,36 +17189,36 @@ function preClassifyProp(prop) {
|
|
|
17189
17189
|
if (!isComplexType(type)) {
|
|
17190
17190
|
const designNameStart = /^(variant|size|spacing|gap|color|bg|theme|align|layout|orientation|position)/i;
|
|
17191
17191
|
const designNameEnd = /(Color|Size|Variant|Style)$/;
|
|
17192
|
-
if (designNameStart.test(
|
|
17192
|
+
if (designNameStart.test(name2) || designNameEnd.test(name2)) {
|
|
17193
17193
|
return { category: "design", cdfTypeHint: "string" };
|
|
17194
17194
|
}
|
|
17195
17195
|
}
|
|
17196
17196
|
if (isBooleanType(type)) {
|
|
17197
17197
|
const stateNames = ["disabled", "loading", "expanded", "isOpen", "selected", "checked", "active", "preview"];
|
|
17198
|
-
if (stateNames.includes(
|
|
17198
|
+
if (stateNames.includes(name2)) {
|
|
17199
17199
|
return { category: "state", cdfTypeHint: "boolean" };
|
|
17200
17200
|
}
|
|
17201
17201
|
}
|
|
17202
17202
|
if (isBooleanType(type)) {
|
|
17203
17203
|
const visualToggle = /^(hide|show|enable|disable|vertical|horizontal|reverse|bold|italic|imageOn|with)/i;
|
|
17204
|
-
if (visualToggle.test(
|
|
17204
|
+
if (visualToggle.test(name2)) {
|
|
17205
17205
|
return { category: "design", cdfTypeHint: "boolean" };
|
|
17206
17206
|
}
|
|
17207
17207
|
}
|
|
17208
|
-
if (
|
|
17208
|
+
if (name2 === "componentId" || name2 === "sectionKey" || name2 === "locale" || name2 === "variantIndex") {
|
|
17209
17209
|
return { category: "state", cdfTypeHint: "string" };
|
|
17210
17210
|
}
|
|
17211
17211
|
if (isStringType(type)) {
|
|
17212
17212
|
const urlNameStart = /^(href|url|link|src)/i;
|
|
17213
17213
|
const urlNameEnd = /(Url|Href|Link|Src)$/;
|
|
17214
|
-
if (urlNameStart.test(
|
|
17214
|
+
if (urlNameStart.test(name2) || urlNameEnd.test(name2)) {
|
|
17215
17215
|
return { category: "content", cdfTypeHint: "string" };
|
|
17216
17216
|
}
|
|
17217
17217
|
}
|
|
17218
17218
|
if (isStringType(type)) {
|
|
17219
17219
|
const textNameStart = /^(label|title|text|description|caption|heading|subheading|body|alt|name|placeholder|summary)/i;
|
|
17220
17220
|
const textNameEnd = /(Text|Label|Title|Name)$/;
|
|
17221
|
-
if (textNameStart.test(
|
|
17221
|
+
if (textNameStart.test(name2) || textNameEnd.test(name2)) {
|
|
17222
17222
|
return { category: "content", cdfTypeHint: "string" };
|
|
17223
17223
|
}
|
|
17224
17224
|
}
|
|
@@ -17427,7 +17427,7 @@ async function resolveComposition(request) {
|
|
|
17427
17427
|
timeoutMs: 12e4,
|
|
17428
17428
|
promptViaStdin: true,
|
|
17429
17429
|
bedrock,
|
|
17430
|
-
onDebugEvent: (
|
|
17430
|
+
onDebugEvent: (name2, payload) => onDebugEvent?.("agent", { event: name2, ...payload })
|
|
17431
17431
|
});
|
|
17432
17432
|
lastAgentExitCode = res.exitCode;
|
|
17433
17433
|
if (res.exitCode !== 0 && res.stderr.trim()) {
|
|
@@ -17688,7 +17688,7 @@ function collectDuplicateNames(components) {
|
|
|
17688
17688
|
sources.push(c2.source);
|
|
17689
17689
|
nameCounts.set(c2.name, sources);
|
|
17690
17690
|
}
|
|
17691
|
-
return [...nameCounts.entries()].filter(([, srcs]) => srcs.length > 1).map(([
|
|
17691
|
+
return [...nameCounts.entries()].filter(([, srcs]) => srcs.length > 1).map(([name2, sources]) => ({ name: name2, sources }));
|
|
17692
17692
|
}
|
|
17693
17693
|
|
|
17694
17694
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/filter-dropped-allowed-components.js
|
|
@@ -17779,7 +17779,7 @@ async function runOneGenerateComponent(options, component, index, total) {
|
|
|
17779
17779
|
});
|
|
17780
17780
|
}
|
|
17781
17781
|
}
|
|
17782
|
-
effectiveSlots = effectiveSlots.map((slot) => slot.allowedComponents ? { ...slot, allowedComponents: slot.allowedComponents.filter((
|
|
17782
|
+
effectiveSlots = effectiveSlots.map((slot) => slot.allowedComponents ? { ...slot, allowedComponents: slot.allowedComponents.filter((name2) => allowedComponentNames2.has(name2)) } : slot);
|
|
17783
17783
|
const cacheComponent = normalizeComponentForCache(component);
|
|
17784
17784
|
if (!noCache && precomputedCachedNames.has(component.name)) {
|
|
17785
17785
|
onProgress?.({ kind: "component:cached", index, total, name: component.name, pinned: false });
|
|
@@ -18157,9 +18157,8 @@ function PathValidationScreen({
|
|
|
18157
18157
|
}
|
|
18158
18158
|
|
|
18159
18159
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
18160
|
-
import {
|
|
18160
|
+
import { useRef as useRef5, useState as useState9 } from "react";
|
|
18161
18161
|
import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
|
|
18162
|
-
init_debug_store();
|
|
18163
18162
|
|
|
18164
18163
|
// packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
|
|
18165
18164
|
import { useState as useState8 } from "react";
|
|
@@ -18336,39 +18335,6 @@ function FieldForm({
|
|
|
18336
18335
|
] });
|
|
18337
18336
|
}
|
|
18338
18337
|
|
|
18339
|
-
// packages/experience-design-system-cli/src/tui/shared/debug-trail.ts
|
|
18340
|
-
init_config();
|
|
18341
|
-
import { existsSync as existsSync9 } from "node:fs";
|
|
18342
|
-
function diffSnapshots(before, after) {
|
|
18343
|
-
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])];
|
|
18344
|
-
const changed_fields = names.filter((name) => before[name] !== after[name]);
|
|
18345
|
-
return { changed: changed_fields.length > 0, changed_fields };
|
|
18346
|
-
}
|
|
18347
|
-
var DEFAULT_TRAIL_LIMIT = 30;
|
|
18348
|
-
function createTrail(limit = DEFAULT_TRAIL_LIMIT) {
|
|
18349
|
-
const actions = [];
|
|
18350
|
-
return {
|
|
18351
|
-
record(action) {
|
|
18352
|
-
actions.push(action);
|
|
18353
|
-
if (actions.length > limit) actions.shift();
|
|
18354
|
-
},
|
|
18355
|
-
entries: () => [...actions]
|
|
18356
|
-
};
|
|
18357
|
-
}
|
|
18358
|
-
var MIN_SECRET_LENGTH = 6;
|
|
18359
|
-
function scrubError(error, secrets) {
|
|
18360
|
-
let message = error instanceof Error ? error.message : String(error);
|
|
18361
|
-
for (const secret of secrets) {
|
|
18362
|
-
if (secret.length < MIN_SECRET_LENGTH) continue;
|
|
18363
|
-
for (const form of /* @__PURE__ */ new Set([secret, encodeURIComponent(secret)])) message = message.split(form).join("[redacted]");
|
|
18364
|
-
}
|
|
18365
|
-
return message;
|
|
18366
|
-
}
|
|
18367
|
-
function describeSettingsFile() {
|
|
18368
|
-
const path5 = configFilePath();
|
|
18369
|
-
return { path: path5, eds_home_set: Boolean(process.env["EDS_HOME"]), exists: existsSync9(path5) };
|
|
18370
|
-
}
|
|
18371
|
-
|
|
18372
18338
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/logic.ts
|
|
18373
18339
|
var FIELDS = ["spaceId", "environmentId", "cmaToken", "host"];
|
|
18374
18340
|
function credentialsPurpose(tokensOnly) {
|
|
@@ -18383,36 +18349,12 @@ function normalize(values) {
|
|
|
18383
18349
|
host: toConfiguredHost2(values.host) ?? DEFAULT_CONFIGURED_HOST
|
|
18384
18350
|
};
|
|
18385
18351
|
}
|
|
18386
|
-
function
|
|
18387
|
-
return
|
|
18352
|
+
function missingField(values) {
|
|
18353
|
+
return values.spaceId === "" || values.environmentId === "" || values.cmaToken === "";
|
|
18388
18354
|
}
|
|
18389
18355
|
function isUnchanged(current, initial) {
|
|
18390
18356
|
return FIELDS.every((field) => current[field] === initial[field]);
|
|
18391
18357
|
}
|
|
18392
|
-
function rejectedAttempt(reason, credentials) {
|
|
18393
|
-
return { host: credentials.host, reason: scrubError(reason, [credentials.cmaToken]) };
|
|
18394
|
-
}
|
|
18395
|
-
function credentialsLog(credentials) {
|
|
18396
|
-
return {
|
|
18397
|
-
space_id: credentials.spaceId,
|
|
18398
|
-
environment_id: credentials.environmentId,
|
|
18399
|
-
host: credentials.host,
|
|
18400
|
-
cma_token: credentials.cmaToken
|
|
18401
|
-
};
|
|
18402
|
-
}
|
|
18403
|
-
function credentialsOutputs({
|
|
18404
|
-
outcome,
|
|
18405
|
-
credentials,
|
|
18406
|
-
initial,
|
|
18407
|
-
attempts
|
|
18408
|
-
}) {
|
|
18409
|
-
return {
|
|
18410
|
-
outcome,
|
|
18411
|
-
...credentialsLog(credentials),
|
|
18412
|
-
changed_fields: diffSnapshots(initial, credentials).changed_fields,
|
|
18413
|
-
rejected_attempts: attempts
|
|
18414
|
-
};
|
|
18415
|
-
}
|
|
18416
18358
|
|
|
18417
18359
|
// packages/experience-design-system-cli/src/tui/user-agent.ts
|
|
18418
18360
|
init_version();
|
|
@@ -18460,9 +18402,7 @@ var MENU = [
|
|
|
18460
18402
|
{ choice: "continue", label: "Continue", description: "Check the credentials and go on" },
|
|
18461
18403
|
{ choice: "edit", label: "Edit", description: "Change the credentials" }
|
|
18462
18404
|
];
|
|
18463
|
-
var MAX_LOGGED_ATTEMPTS2 = 10;
|
|
18464
18405
|
function CredentialsScreen({
|
|
18465
|
-
mode,
|
|
18466
18406
|
onDone,
|
|
18467
18407
|
onBack,
|
|
18468
18408
|
initial = {},
|
|
@@ -18485,64 +18425,17 @@ function CredentialsScreen({
|
|
|
18485
18425
|
const [focus, setFocus] = useState9(0);
|
|
18486
18426
|
const [active, setActive] = useState9(0);
|
|
18487
18427
|
const [beforeEdit, setBeforeEdit] = useState9(initialValues);
|
|
18488
|
-
const visit = useRef5({ attempts: [], lastReason: "" }).current;
|
|
18489
|
-
useEffect8(() => {
|
|
18490
|
-
startDebugRun({
|
|
18491
|
-
flow: "import/credentials",
|
|
18492
|
-
step: "04-credentials",
|
|
18493
|
-
menuOption: "Credentials",
|
|
18494
|
-
inputs: { import_mode: mode, prefilled, ...credentialsLog(initialValues) }
|
|
18495
|
-
});
|
|
18496
|
-
}, []);
|
|
18497
|
-
const reject = (attempt, text) => {
|
|
18498
|
-
if (visit.attempts.length < MAX_LOGGED_ATTEMPTS2) visit.attempts.push(attempt);
|
|
18499
|
-
visit.lastReason = attempt.reason;
|
|
18500
|
-
setNotice({ kind: "error", text });
|
|
18501
|
-
};
|
|
18502
|
-
const leave = () => {
|
|
18503
|
-
void finishDebugRun({
|
|
18504
|
-
outputs: {
|
|
18505
|
-
...credentialsOutputs({
|
|
18506
|
-
outcome: "back",
|
|
18507
|
-
credentials: normalize(values),
|
|
18508
|
-
initial: initialValues,
|
|
18509
|
-
attempts: visit.attempts
|
|
18510
|
-
}),
|
|
18511
|
-
...notice ? { error: visit.lastReason } : {}
|
|
18512
|
-
},
|
|
18513
|
-
status: notice ? "error" : "success",
|
|
18514
|
-
exitMethod: "discarded"
|
|
18515
|
-
});
|
|
18516
|
-
onBack();
|
|
18517
|
-
};
|
|
18518
18428
|
const submit = async () => {
|
|
18519
18429
|
const credentials = normalize(values);
|
|
18520
|
-
|
|
18521
|
-
|
|
18522
|
-
reject(
|
|
18523
|
-
rejectedAttempt(`Missing required fields: ${missing.join(", ")}`, credentials),
|
|
18524
|
-
"Space ID, environment and CMA token are all required."
|
|
18525
|
-
);
|
|
18430
|
+
if (missingField(credentials)) {
|
|
18431
|
+
setNotice({ kind: "error", text: "Space ID, environment and CMA token are all required." });
|
|
18526
18432
|
return;
|
|
18527
18433
|
}
|
|
18528
18434
|
setValidating(true);
|
|
18529
18435
|
const result = await validate3(credentials);
|
|
18530
18436
|
setValidating(false);
|
|
18531
|
-
if (
|
|
18532
|
-
|
|
18533
|
-
return;
|
|
18534
|
-
}
|
|
18535
|
-
void finishDebugRun({
|
|
18536
|
-
outputs: credentialsOutputs({
|
|
18537
|
-
outcome: "validated",
|
|
18538
|
-
credentials,
|
|
18539
|
-
initial: initialValues,
|
|
18540
|
-
attempts: visit.attempts
|
|
18541
|
-
}),
|
|
18542
|
-
status: "success",
|
|
18543
|
-
exitMethod: "saved"
|
|
18544
|
-
});
|
|
18545
|
-
onDone({ skipped: false, credentials });
|
|
18437
|
+
if (result.ok) onDone({ skipped: false, credentials });
|
|
18438
|
+
else setNotice({ kind: "error", text: result.error });
|
|
18546
18439
|
};
|
|
18547
18440
|
const choose = (choice) => {
|
|
18548
18441
|
if (choice === "continue") void submit();
|
|
@@ -18551,7 +18444,7 @@ function CredentialsScreen({
|
|
|
18551
18444
|
setBeforeEdit(values);
|
|
18552
18445
|
setActive(0);
|
|
18553
18446
|
setEditing(true);
|
|
18554
|
-
} else
|
|
18447
|
+
} else onBack();
|
|
18555
18448
|
};
|
|
18556
18449
|
const stopEditing = () => {
|
|
18557
18450
|
setEditing(false);
|
|
@@ -18561,7 +18454,7 @@ function CredentialsScreen({
|
|
|
18561
18454
|
if (validating) return;
|
|
18562
18455
|
if (editing) {
|
|
18563
18456
|
if (key.escape) {
|
|
18564
|
-
if (!prefilled)
|
|
18457
|
+
if (!prefilled) onBack();
|
|
18565
18458
|
else {
|
|
18566
18459
|
setValues(beforeEdit);
|
|
18567
18460
|
setNotice(null);
|
|
@@ -18897,14 +18790,14 @@ function TokenReviewScreen({ tokensPath, onContinue, onQuit }) {
|
|
|
18897
18790
|
init_config();
|
|
18898
18791
|
|
|
18899
18792
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
|
|
18900
|
-
import { useEffect as
|
|
18793
|
+
import { useEffect as useEffect8, useRef as useRef6, useState as useState11 } from "react";
|
|
18901
18794
|
|
|
18902
18795
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run.ts
|
|
18903
18796
|
import { mkdir as mkdir8 } from "node:fs/promises";
|
|
18904
18797
|
import { join as join20, resolve as resolve24 } from "node:path";
|
|
18905
18798
|
|
|
18906
18799
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
|
|
18907
|
-
import { existsSync as
|
|
18800
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
18908
18801
|
import { dirname as dirname16, join as join19, resolve as resolve22 } from "node:path";
|
|
18909
18802
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
18910
18803
|
function findSkillPath(fileName) {
|
|
@@ -18912,7 +18805,7 @@ function findSkillPath(fileName) {
|
|
|
18912
18805
|
let dir = thisDir;
|
|
18913
18806
|
for (; ; ) {
|
|
18914
18807
|
const candidate = join19(dir, "skills", fileName);
|
|
18915
|
-
if (
|
|
18808
|
+
if (existsSync9(candidate)) return candidate;
|
|
18916
18809
|
const parent = resolve22(dir, "..");
|
|
18917
18810
|
if (parent === dir) {
|
|
18918
18811
|
throw new Error(`skill file not found (looked for skills/${fileName} from ${thisDir})`);
|
|
@@ -19154,7 +19047,7 @@ async function resolveSelectionPrompt(overrides) {
|
|
|
19154
19047
|
function useExtraction(input) {
|
|
19155
19048
|
const [state2, setState] = useState11();
|
|
19156
19049
|
const current = useRef6();
|
|
19157
|
-
|
|
19050
|
+
useEffect8(() => {
|
|
19158
19051
|
current.current = input;
|
|
19159
19052
|
if (!input) {
|
|
19160
19053
|
setState(void 0);
|
|
@@ -19180,7 +19073,7 @@ function useExtraction(input) {
|
|
|
19180
19073
|
}
|
|
19181
19074
|
|
|
19182
19075
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
|
|
19183
|
-
import { useEffect as
|
|
19076
|
+
import { useEffect as useEffect9, useRef as useRef7, useState as useState12 } from "react";
|
|
19184
19077
|
|
|
19185
19078
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run-tokens-only.ts
|
|
19186
19079
|
var TOKENS_SKILL_PATH2 = findSkillPath("generate-tokens.md");
|
|
@@ -19215,7 +19108,7 @@ async function runTokensOnly(input, deps = realDeps2) {
|
|
|
19215
19108
|
function useTokensOnly(input) {
|
|
19216
19109
|
const [state2, setState] = useState12();
|
|
19217
19110
|
const current = useRef7();
|
|
19218
|
-
|
|
19111
|
+
useEffect9(() => {
|
|
19219
19112
|
current.current = input;
|
|
19220
19113
|
if (!input) {
|
|
19221
19114
|
setState(void 0);
|
|
@@ -19725,7 +19618,7 @@ function collectDependents(components) {
|
|
|
19725
19618
|
function findRoots(components, selected) {
|
|
19726
19619
|
const scope = selected ? components.filter((c2) => selected.has(c2.name)) : components;
|
|
19727
19620
|
const dependents = collectDependents(scope);
|
|
19728
|
-
return scope.map((c2) => c2.name).filter((
|
|
19621
|
+
return scope.map((c2) => c2.name).filter((name2) => !dependents.has(name2)).sort();
|
|
19729
19622
|
}
|
|
19730
19623
|
function findCycleInClosure(root, reachable, components) {
|
|
19731
19624
|
const scopedComponents = components.filter((c2) => reachable.has(c2.name)).map((c2) => ({ name: c2.name, slots: c2.slots }));
|
|
@@ -19761,9 +19654,9 @@ function computeClosure(root, components) {
|
|
|
19761
19654
|
const reachable = walkReachable2(root, byName, known);
|
|
19762
19655
|
const cyclePath = findCycleInClosure(root, reachable, components);
|
|
19763
19656
|
if (cyclePath) {
|
|
19764
|
-
const nodes2 = [...reachable].sort().map((
|
|
19765
|
-
name,
|
|
19766
|
-
depth:
|
|
19657
|
+
const nodes2 = [...reachable].sort().map((name2) => ({
|
|
19658
|
+
name: name2,
|
|
19659
|
+
depth: name2 === root ? 0 : 1,
|
|
19767
19660
|
path: [root],
|
|
19768
19661
|
parents: []
|
|
19769
19662
|
}));
|
|
@@ -19799,12 +19692,12 @@ function computeClosure(root, components) {
|
|
|
19799
19692
|
}
|
|
19800
19693
|
}
|
|
19801
19694
|
const nodes = [];
|
|
19802
|
-
for (const [
|
|
19695
|
+
for (const [name2, d] of depth.entries()) {
|
|
19803
19696
|
nodes.push({
|
|
19804
|
-
name,
|
|
19697
|
+
name: name2,
|
|
19805
19698
|
depth: d,
|
|
19806
|
-
path: parentPath.get(
|
|
19807
|
-
parents: [...parents.get(
|
|
19699
|
+
path: parentPath.get(name2),
|
|
19700
|
+
parents: [...parents.get(name2) ?? /* @__PURE__ */ new Set()].sort()
|
|
19808
19701
|
});
|
|
19809
19702
|
}
|
|
19810
19703
|
nodes.sort((a, b) => a.depth - b.depth || a.name.localeCompare(b.name));
|
|
@@ -19827,8 +19720,8 @@ function findSharedDeps(closures) {
|
|
|
19827
19720
|
}
|
|
19828
19721
|
}
|
|
19829
19722
|
const out = /* @__PURE__ */ new Map();
|
|
19830
|
-
for (const [
|
|
19831
|
-
if (roots.length >= 2) out.set(
|
|
19723
|
+
for (const [name2, roots] of counts.entries()) {
|
|
19724
|
+
if (roots.length >= 2) out.set(name2, [...roots].sort());
|
|
19832
19725
|
}
|
|
19833
19726
|
return out;
|
|
19834
19727
|
}
|
|
@@ -20031,13 +19924,13 @@ function buildVisibleRows(props) {
|
|
|
20031
19924
|
...findRoots(subgraph),
|
|
20032
19925
|
...subgraph.filter((n) => hasDirectChild(n)).map((n) => n.name)
|
|
20033
19926
|
]);
|
|
20034
|
-
for (const
|
|
20035
|
-
const full = computeClosure(
|
|
20036
|
-
closures.set(
|
|
19927
|
+
for (const name2 of [...parentNames].sort()) {
|
|
19928
|
+
const full = computeClosure(name2, subgraph);
|
|
19929
|
+
closures.set(name2, { ...full, nodes: full.nodes.filter((n) => n.depth <= 1) });
|
|
20037
19930
|
}
|
|
20038
19931
|
const sharedDeps = findSharedDeps(closures);
|
|
20039
|
-
const hasCycleDepDirect = (
|
|
20040
|
-
const it = itemByKey.get(
|
|
19932
|
+
const hasCycleDepDirect = (name2) => {
|
|
19933
|
+
const it = itemByKey.get(name2)?.it;
|
|
20041
19934
|
if (!it) return false;
|
|
20042
19935
|
for (const target of allowedComponentNames(it.entry)) {
|
|
20043
19936
|
if (cycleParticipants.has(target)) return true;
|
|
@@ -20142,28 +20035,28 @@ function buildVisibleRows(props) {
|
|
|
20142
20035
|
});
|
|
20143
20036
|
});
|
|
20144
20037
|
}
|
|
20145
|
-
for (const
|
|
20146
|
-
const rec = itemByKey.get(
|
|
20038
|
+
for (const name2 of standaloneRoots) {
|
|
20039
|
+
const rec = itemByKey.get(name2);
|
|
20147
20040
|
if (!rec) continue;
|
|
20148
20041
|
rows.push({
|
|
20149
20042
|
kind: "standalone",
|
|
20150
|
-
key: `stand:${
|
|
20151
|
-
label:
|
|
20043
|
+
key: `stand:${name2}`,
|
|
20044
|
+
label: name2,
|
|
20152
20045
|
indent: 0,
|
|
20153
20046
|
itemIdx: rec.idx
|
|
20154
20047
|
});
|
|
20155
20048
|
}
|
|
20156
20049
|
const nodeByName = new Map(subgraph.map((n) => [n.name, n]));
|
|
20157
|
-
const sharedLeafNames = [...sharedDeps.keys()].filter((
|
|
20050
|
+
const sharedLeafNames = [...sharedDeps.keys()].filter((name2) => (nodeByName.get(name2)?.slots.length ?? 0) === 0).sort();
|
|
20158
20051
|
const seenStandaloneNames = new Set(standaloneRoots);
|
|
20159
|
-
for (const
|
|
20160
|
-
if (seenStandaloneNames.has(
|
|
20161
|
-
const rec = itemByKey.get(
|
|
20052
|
+
for (const name2 of sharedLeafNames) {
|
|
20053
|
+
if (seenStandaloneNames.has(name2)) continue;
|
|
20054
|
+
const rec = itemByKey.get(name2);
|
|
20162
20055
|
if (!rec) continue;
|
|
20163
20056
|
rows.push({
|
|
20164
20057
|
kind: "standalone",
|
|
20165
|
-
key: `shared-standalone:${
|
|
20166
|
-
label: `${
|
|
20058
|
+
key: `shared-standalone:${name2}`,
|
|
20059
|
+
label: `${name2} (shared)`,
|
|
20167
20060
|
indent: 0,
|
|
20168
20061
|
sharedSuffix: true,
|
|
20169
20062
|
itemIdx: rec.idx
|
|
@@ -20179,13 +20072,13 @@ function buildVisibleRows(props) {
|
|
|
20179
20072
|
indent: 0,
|
|
20180
20073
|
itemIdx: -1
|
|
20181
20074
|
});
|
|
20182
|
-
for (const
|
|
20183
|
-
const rec = itemByKey.get(
|
|
20075
|
+
for (const name2 of flatNames) {
|
|
20076
|
+
const rec = itemByKey.get(name2);
|
|
20184
20077
|
if (!rec) continue;
|
|
20185
20078
|
rows.push({
|
|
20186
20079
|
kind: "flat",
|
|
20187
|
-
key: `flat:${
|
|
20188
|
-
label:
|
|
20080
|
+
key: `flat:${name2}`,
|
|
20081
|
+
label: name2,
|
|
20189
20082
|
indent: 0,
|
|
20190
20083
|
itemIdx: rec.idx
|
|
20191
20084
|
});
|
|
@@ -20195,9 +20088,9 @@ function buildVisibleRows(props) {
|
|
|
20195
20088
|
if (filterVisibleKeys !== void 0) {
|
|
20196
20089
|
return rows.filter((row) => {
|
|
20197
20090
|
if (row.itemIdx < 0) return true;
|
|
20198
|
-
const
|
|
20199
|
-
if (
|
|
20200
|
-
return filterVisibleKeys.has(
|
|
20091
|
+
const name2 = items[row.itemIdx]?.key;
|
|
20092
|
+
if (name2 === void 0) return true;
|
|
20093
|
+
return filterVisibleKeys.has(name2);
|
|
20201
20094
|
});
|
|
20202
20095
|
}
|
|
20203
20096
|
return rows;
|
|
@@ -20419,7 +20312,7 @@ function useImmediateInput(handler, enabled = true) {
|
|
|
20419
20312
|
|
|
20420
20313
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.ts
|
|
20421
20314
|
import { useStdout as useStdout2 } from "ink";
|
|
20422
|
-
import { useEffect as
|
|
20315
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
20423
20316
|
function readTerminalSize(stdout) {
|
|
20424
20317
|
return {
|
|
20425
20318
|
columns: stdout?.columns ?? 80,
|
|
@@ -20429,7 +20322,7 @@ function readTerminalSize(stdout) {
|
|
|
20429
20322
|
function useTerminalSize() {
|
|
20430
20323
|
const { stdout } = useStdout2();
|
|
20431
20324
|
const [size, setSize] = useState13(() => readTerminalSize(stdout));
|
|
20432
|
-
|
|
20325
|
+
useEffect10(() => {
|
|
20433
20326
|
const updateSize = () => setSize(readTerminalSize(stdout));
|
|
20434
20327
|
stdout?.on("resize", updateSize);
|
|
20435
20328
|
updateSize();
|
|
@@ -20612,7 +20505,7 @@ function createSidebarViewsHelpSection(includeBreaking) {
|
|
|
20612
20505
|
}
|
|
20613
20506
|
|
|
20614
20507
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
|
|
20615
|
-
import { useEffect as
|
|
20508
|
+
import { useEffect as useEffect11, useMemo as useMemo3, useRef as useRef9, useState as useState16 } from "react";
|
|
20616
20509
|
|
|
20617
20510
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts
|
|
20618
20511
|
var TWO_COLUMN_MIN_WIDTH = 100;
|
|
@@ -20842,11 +20735,11 @@ function computeCycleAwareAcceptCascade(target, components, cycleUnits) {
|
|
|
20842
20735
|
const byName = new Map(components.map((c2) => [c2.name, c2]));
|
|
20843
20736
|
const visited = /* @__PURE__ */ new Set();
|
|
20844
20737
|
const queue = [];
|
|
20845
|
-
const enqueue = (
|
|
20846
|
-
if (visited.has(
|
|
20847
|
-
visited.add(
|
|
20848
|
-
queue.push(
|
|
20849
|
-
const unit = cycleUnits.get(
|
|
20738
|
+
const enqueue = (name2) => {
|
|
20739
|
+
if (visited.has(name2)) return;
|
|
20740
|
+
visited.add(name2);
|
|
20741
|
+
queue.push(name2);
|
|
20742
|
+
const unit = cycleUnits.get(name2);
|
|
20850
20743
|
if (unit) {
|
|
20851
20744
|
for (const member of unit) {
|
|
20852
20745
|
if (!visited.has(member)) {
|
|
@@ -20971,7 +20864,7 @@ function buildScopeGraph(components) {
|
|
|
20971
20864
|
cycles = [];
|
|
20972
20865
|
}
|
|
20973
20866
|
const cycleParticipants = /* @__PURE__ */ new Set();
|
|
20974
|
-
for (const cycle of cycles) for (const
|
|
20867
|
+
for (const cycle of cycles) for (const name2 of cycle.path) cycleParticipants.add(name2);
|
|
20975
20868
|
return {
|
|
20976
20869
|
nodes,
|
|
20977
20870
|
cycles,
|
|
@@ -21159,10 +21052,10 @@ function computeSidebarBudget({ rows, panelOpen, entryCount }) {
|
|
|
21159
21052
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/sidebar-navigation.ts
|
|
21160
21053
|
function collectExpandedGroupRoots(closures, cycleParticipants) {
|
|
21161
21054
|
const roots = /* @__PURE__ */ new Set();
|
|
21162
|
-
for (const [
|
|
21163
|
-
if (closure.nodes.length > 1) roots.add(
|
|
21055
|
+
for (const [name2, closure] of closures.entries()) {
|
|
21056
|
+
if (closure.nodes.length > 1) roots.add(name2);
|
|
21164
21057
|
}
|
|
21165
|
-
for (const
|
|
21058
|
+
for (const name2 of cycleParticipants) roots.add(name2);
|
|
21166
21059
|
return roots;
|
|
21167
21060
|
}
|
|
21168
21061
|
function computeSidebarViewToggle({
|
|
@@ -21233,9 +21126,9 @@ function buildFlatDimPredicate(input) {
|
|
|
21233
21126
|
const isFlat = input.viewMode === "flat";
|
|
21234
21127
|
const keys = isFlat ? input.filterVisibleKeys : void 0;
|
|
21235
21128
|
if (!hasSearch && keys === void 0) return void 0;
|
|
21236
|
-
return (
|
|
21237
|
-
if (hasSearch && !fuzzyMatches(input.searchQuery,
|
|
21238
|
-
if (keys !== void 0 && !keys.has(
|
|
21129
|
+
return (name2) => {
|
|
21130
|
+
if (hasSearch && !fuzzyMatches(input.searchQuery, name2)) return true;
|
|
21131
|
+
if (keys !== void 0 && !keys.has(name2)) return true;
|
|
21239
21132
|
return false;
|
|
21240
21133
|
};
|
|
21241
21134
|
}
|
|
@@ -21243,7 +21136,7 @@ function buildFlatDimPredicate(input) {
|
|
|
21243
21136
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/state.ts
|
|
21244
21137
|
function apply(state2, entries) {
|
|
21245
21138
|
const next = new Map(state2);
|
|
21246
|
-
for (const [
|
|
21139
|
+
for (const [name2, decision] of entries) next.set(name2, decision);
|
|
21247
21140
|
return next;
|
|
21248
21141
|
}
|
|
21249
21142
|
function reduceDecisions(state2, action, components, graph) {
|
|
@@ -21252,44 +21145,44 @@ function reduceDecisions(state2, action, components, graph) {
|
|
|
21252
21145
|
if (state2.get(action.name) === "accepted") return state2;
|
|
21253
21146
|
return apply(
|
|
21254
21147
|
state2,
|
|
21255
|
-
acceptCascade(graph, action.name).map((
|
|
21148
|
+
acceptCascade(graph, action.name).map((name2) => [name2, "accepted"])
|
|
21256
21149
|
);
|
|
21257
21150
|
}
|
|
21258
21151
|
case "reject": {
|
|
21259
21152
|
if (state2.get(action.name) === "rejected") return state2;
|
|
21260
21153
|
const { toReject, toDeselect } = rejectCascade(graph, action.name);
|
|
21261
21154
|
return apply(state2, [
|
|
21262
|
-
...toReject.map((
|
|
21263
|
-
...toDeselect.map((
|
|
21155
|
+
...toReject.map((name2) => [name2, "rejected"]),
|
|
21156
|
+
...toDeselect.map((name2) => [name2, "undecided"])
|
|
21264
21157
|
]);
|
|
21265
21158
|
}
|
|
21266
21159
|
case "toggle-all": {
|
|
21267
21160
|
const nonCycle = components.filter((c2) => !graph.cycleParticipants.has(c2.name)).map((c2) => c2.name);
|
|
21268
|
-
const anyNotAccepted = nonCycle.some((
|
|
21161
|
+
const anyNotAccepted = nonCycle.some((name2) => state2.get(name2) !== "accepted");
|
|
21269
21162
|
if (anyNotAccepted) {
|
|
21270
21163
|
return apply(state2, [
|
|
21271
|
-
...nonCycle.map((
|
|
21272
|
-
...reachableCycleMembers(graph, nonCycle).map((
|
|
21164
|
+
...nonCycle.map((name2) => [name2, "accepted"]),
|
|
21165
|
+
...reachableCycleMembers(graph, nonCycle).map((name2) => [name2, "accepted"])
|
|
21273
21166
|
]);
|
|
21274
21167
|
}
|
|
21275
21168
|
return apply(state2, [
|
|
21276
|
-
...nonCycle.map((
|
|
21169
|
+
...nonCycle.map((name2) => [name2, "rejected"]),
|
|
21277
21170
|
...components.filter((c2) => graph.cycleParticipants.has(c2.name) && state2.get(c2.name) === "accepted").map((c2) => [c2.name, "undecided"])
|
|
21278
21171
|
]);
|
|
21279
21172
|
}
|
|
21280
21173
|
case "accept-unflagged": {
|
|
21281
21174
|
const seeds = components.filter((c2) => !graph.cycleParticipants.has(c2.name) && !isAiFlagged(c2)).map((c2) => c2.name);
|
|
21282
21175
|
return apply(state2, [
|
|
21283
|
-
...seeds.map((
|
|
21284
|
-
...reachableCycleMembers(graph, seeds).map((
|
|
21176
|
+
...seeds.map((name2) => [name2, "accepted"]),
|
|
21177
|
+
...reachableCycleMembers(graph, seeds).map((name2) => [name2, "accepted"])
|
|
21285
21178
|
]);
|
|
21286
21179
|
}
|
|
21287
21180
|
}
|
|
21288
21181
|
}
|
|
21289
|
-
function rejectNeedsConfirmation(graph,
|
|
21290
|
-
if (state2.get(
|
|
21291
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
21292
|
-
const ancestors = toReject.filter((n) => n !==
|
|
21182
|
+
function rejectNeedsConfirmation(graph, name2, state2) {
|
|
21183
|
+
if (state2.get(name2) === "rejected") return false;
|
|
21184
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
21185
|
+
const ancestors = toReject.filter((n) => n !== name2);
|
|
21293
21186
|
return ancestors.length + toDeselect.length >= 2;
|
|
21294
21187
|
}
|
|
21295
21188
|
function partitionDecisions(components, state2) {
|
|
@@ -21349,7 +21242,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21349
21242
|
return seed;
|
|
21350
21243
|
});
|
|
21351
21244
|
const seededGroupsRef = useRef9(closures.size > 0 || cycleParticipants.size > 0);
|
|
21352
|
-
|
|
21245
|
+
useEffect11(() => {
|
|
21353
21246
|
if (seededGroupsRef.current) return;
|
|
21354
21247
|
if (closures.size === 0 && cycleParticipants.size === 0) return;
|
|
21355
21248
|
seededGroupsRef.current = true;
|
|
@@ -21379,8 +21272,8 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21379
21272
|
for (const node of closure.nodes) keys.add(node.name);
|
|
21380
21273
|
}
|
|
21381
21274
|
for (const unit of cycleUnits.values()) {
|
|
21382
|
-
if (![...unit].some((
|
|
21383
|
-
for (const
|
|
21275
|
+
if (![...unit].some((name2) => decisions.get(name2) === "accepted")) continue;
|
|
21276
|
+
for (const name2 of unit) keys.add(name2);
|
|
21384
21277
|
}
|
|
21385
21278
|
return keys;
|
|
21386
21279
|
}, [closures, cycleUnits, showDependencies, decisions]);
|
|
@@ -21440,7 +21333,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21440
21333
|
entryCount: 0
|
|
21441
21334
|
});
|
|
21442
21335
|
const panelLayout = useMemo3(() => computePanelLayout(visibleCount), [visibleCount]);
|
|
21443
|
-
|
|
21336
|
+
useEffect11(() => {
|
|
21444
21337
|
setNav((prev) => {
|
|
21445
21338
|
const maxIdx = Math.max(0, visibleRows.length - 1);
|
|
21446
21339
|
const nextCursor = Math.min(prev.cursor, maxIdx);
|
|
@@ -21478,12 +21371,12 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21478
21371
|
return void 0;
|
|
21479
21372
|
}
|
|
21480
21373
|
};
|
|
21481
|
-
const jumpCursorTo = (
|
|
21374
|
+
const jumpCursorTo = (name2) => {
|
|
21482
21375
|
let idx = -1;
|
|
21483
21376
|
for (let i = 0; i < visibleRows.length; i++) {
|
|
21484
21377
|
const row = visibleRows[i];
|
|
21485
21378
|
if (row.itemIdx < 0) continue;
|
|
21486
|
-
if (groupedItems[row.itemIdx]?.key ===
|
|
21379
|
+
if (groupedItems[row.itemIdx]?.key === name2) {
|
|
21487
21380
|
idx = i;
|
|
21488
21381
|
break;
|
|
21489
21382
|
}
|
|
@@ -21497,18 +21390,18 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
21497
21390
|
});
|
|
21498
21391
|
};
|
|
21499
21392
|
const decide = (action) => setDecisions((prev) => reduceDecisions(prev, action, components, graph));
|
|
21500
|
-
const requestReject = (
|
|
21501
|
-
if (decisions.get(
|
|
21502
|
-
if (rejectNeedsConfirmation(graph,
|
|
21503
|
-
const { toReject, toDeselect } = rejectCascade(graph,
|
|
21393
|
+
const requestReject = (name2) => {
|
|
21394
|
+
if (decisions.get(name2) === "rejected") return;
|
|
21395
|
+
if (rejectNeedsConfirmation(graph, name2, decisions)) {
|
|
21396
|
+
const { toReject, toDeselect } = rejectCascade(graph, name2);
|
|
21504
21397
|
setPendingRejectCascade({
|
|
21505
|
-
target:
|
|
21506
|
-
ancestors: toReject.filter((n) => n !==
|
|
21398
|
+
target: name2,
|
|
21399
|
+
ancestors: toReject.filter((n) => n !== name2).sort(),
|
|
21507
21400
|
descendants: [...toDeselect].sort()
|
|
21508
21401
|
});
|
|
21509
21402
|
return;
|
|
21510
21403
|
}
|
|
21511
|
-
decide({ type: "reject", name });
|
|
21404
|
+
decide({ type: "reject", name: name2 });
|
|
21512
21405
|
};
|
|
21513
21406
|
const mode = showHelp ? "help" : pendingRejectCascade ? "reject-prompt" : searchOpen ? "search" : cyclesPanelOpen ? "cycles" : aiRationalePanel.isOpen ? "flags" : "main";
|
|
21514
21407
|
const context = {
|
|
@@ -21915,7 +21808,7 @@ function ScopeGateView({ components, tokensPath, onConfirm, onQuit }) {
|
|
|
21915
21808
|
}
|
|
21916
21809
|
|
|
21917
21810
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.ts
|
|
21918
|
-
import { useEffect as
|
|
21811
|
+
import { useEffect as useEffect12, useMemo as useMemo5, useRef as useRef10, useState as useState17 } from "react";
|
|
21919
21812
|
|
|
21920
21813
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/cache-check.ts
|
|
21921
21814
|
async function checkGenerationCache(input) {
|
|
@@ -21964,7 +21857,7 @@ function useScopeGateFlow(input, deps = realDeps3) {
|
|
|
21964
21857
|
const loaded = useMemo5(() => sessionId ? deps.load(sessionId) : void 0, [sessionId]);
|
|
21965
21858
|
const cacheCheck = useRef10(void 0);
|
|
21966
21859
|
const [confirmed, setConfirmed] = useState17();
|
|
21967
|
-
|
|
21860
|
+
useEffect12(() => {
|
|
21968
21861
|
if (!input || !loaded?.ok || cacheCheck.current) return;
|
|
21969
21862
|
cacheCheck.current = deps.checkCache(input.cache);
|
|
21970
21863
|
}, [input, loaded]);
|
|
@@ -21987,25 +21880,25 @@ function formatAcceptanceSummary(counts) {
|
|
|
21987
21880
|
if (counts.autoRejected === 0) return `${accepted}.`;
|
|
21988
21881
|
return `${accepted}, ${counts.autoRejected} excluded due to validation errors.`;
|
|
21989
21882
|
}
|
|
21990
|
-
var capitalize = (
|
|
21883
|
+
var capitalize = (name2) => name2.charAt(0).toUpperCase() + name2.slice(1);
|
|
21991
21884
|
function describeGeneration(input) {
|
|
21992
21885
|
const agent = capitalize(input.agent);
|
|
21993
21886
|
return `${formatAcceptanceSummary({ accepted: input.acceptedCount, autoRejected: 0 })}
|
|
21994
21887
|
${agent} is reading each selected component and writing a Contentful component definition for it.${input.hasTokens ? "\nUsing your design tokens for prop resolution." : ""}`;
|
|
21995
21888
|
}
|
|
21996
21889
|
function progressRows2(progress, agent) {
|
|
21997
|
-
const
|
|
21890
|
+
const name2 = capitalize(agent);
|
|
21998
21891
|
const { components, mapTokens } = progress;
|
|
21999
21892
|
const rows = [
|
|
22000
21893
|
{
|
|
22001
|
-
text: components ? components.current : `Starting up ${
|
|
21894
|
+
text: components ? components.current : `Starting up ${name2}...`,
|
|
22002
21895
|
complete: false,
|
|
22003
21896
|
...components ? { progress: { done: components.done, total: components.total } } : {}
|
|
22004
21897
|
}
|
|
22005
21898
|
];
|
|
22006
21899
|
if (mapTokens !== "idle") {
|
|
22007
21900
|
rows.push({
|
|
22008
|
-
text: mapTokens === "running" ? `Mapping token restrictions via ${
|
|
21901
|
+
text: mapTokens === "running" ? `Mapping token restrictions via ${name2}...` : "Token restrictions ready",
|
|
22009
21902
|
complete: mapTokens === "complete"
|
|
22010
21903
|
});
|
|
22011
21904
|
}
|
|
@@ -22031,7 +21924,7 @@ function GenerationScreen({
|
|
|
22031
21924
|
}
|
|
22032
21925
|
|
|
22033
21926
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
|
|
22034
|
-
import { useEffect as
|
|
21927
|
+
import { useEffect as useEffect13, useRef as useRef11, useState as useState18 } from "react";
|
|
22035
21928
|
|
|
22036
21929
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/run.ts
|
|
22037
21930
|
import { resolve as resolve25 } from "node:path";
|
|
@@ -22197,7 +22090,7 @@ function applyProgressEvent2(event, previous, total) {
|
|
|
22197
22090
|
function useGeneration(input) {
|
|
22198
22091
|
const [state2, setState] = useState18();
|
|
22199
22092
|
const current = useRef11();
|
|
22200
|
-
|
|
22093
|
+
useEffect13(() => {
|
|
22201
22094
|
current.current = input;
|
|
22202
22095
|
if (!input) {
|
|
22203
22096
|
setState(void 0);
|
|
@@ -22246,6 +22139,18 @@ function buildFlowStart(input) {
|
|
|
22246
22139
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
22247
22140
|
import { Box as Box45 } from "ink";
|
|
22248
22141
|
|
|
22142
|
+
// packages/experience-design-system-types/dist/src/source-input-association.js
|
|
22143
|
+
import * as z3 from "zod/mini";
|
|
22144
|
+
var name = z3.string().check(z3.refine((value) => value.trim().length > 0));
|
|
22145
|
+
var SourceInputAssociationSchema = z3.strictObject({
|
|
22146
|
+
schemaVersion: z3.literal(1),
|
|
22147
|
+
componentId: name,
|
|
22148
|
+
componentDeclarationId: name,
|
|
22149
|
+
rootSymbolId: name,
|
|
22150
|
+
inputName: name,
|
|
22151
|
+
inputPath: z3.array(name).check(z3.minLength(1))
|
|
22152
|
+
}).check(z3.refine((value) => value.inputPath[0] === value.inputName));
|
|
22153
|
+
|
|
22249
22154
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
22250
22155
|
import { Ajv as Ajv2 } from "ajv";
|
|
22251
22156
|
|
|
@@ -22414,32 +22319,32 @@ function validateCDF2(input) {
|
|
|
22414
22319
|
}
|
|
22415
22320
|
|
|
22416
22321
|
// packages/experience-design-system-types/dist/src/cdf/types.js
|
|
22417
|
-
import * as
|
|
22418
|
-
var CDFPropertySchema2 =
|
|
22419
|
-
$type:
|
|
22420
|
-
$category:
|
|
22421
|
-
$description:
|
|
22422
|
-
$required:
|
|
22423
|
-
$default:
|
|
22424
|
-
$values:
|
|
22425
|
-
"$token.kind":
|
|
22426
|
-
"$token.allowed":
|
|
22322
|
+
import * as z4 from "zod/mini";
|
|
22323
|
+
var CDFPropertySchema2 = z4.strictObject({
|
|
22324
|
+
$type: z4.enum(CDF_PROPERTY_TYPES2),
|
|
22325
|
+
$category: z4.enum(CDF_PROPERTY_CATEGORIES2),
|
|
22326
|
+
$description: z4.optional(z4.string()),
|
|
22327
|
+
$required: z4.optional(z4.boolean()),
|
|
22328
|
+
$default: z4.optional(z4.any()),
|
|
22329
|
+
$values: z4.optional(z4.array(z4.string())),
|
|
22330
|
+
"$token.kind": z4.optional(z4.string()),
|
|
22331
|
+
"$token.allowed": z4.optional(z4.array(z4.string()))
|
|
22427
22332
|
});
|
|
22428
|
-
var CDFSlotSchema2 =
|
|
22429
|
-
$description:
|
|
22430
|
-
$allowedComponents:
|
|
22431
|
-
$required:
|
|
22333
|
+
var CDFSlotSchema2 = z4.strictObject({
|
|
22334
|
+
$description: z4.optional(z4.string()),
|
|
22335
|
+
$allowedComponents: z4.optional(z4.array(z4.string())),
|
|
22336
|
+
$required: z4.optional(z4.boolean())
|
|
22432
22337
|
});
|
|
22433
|
-
var CDFComponentSchema2 =
|
|
22434
|
-
$type:
|
|
22435
|
-
$description:
|
|
22436
|
-
$properties:
|
|
22437
|
-
$slots:
|
|
22338
|
+
var CDFComponentSchema2 = z4.strictObject({
|
|
22339
|
+
$type: z4.literal("component"),
|
|
22340
|
+
$description: z4.optional(z4.string()),
|
|
22341
|
+
$properties: z4.record(z4.string(), CDFPropertySchema2),
|
|
22342
|
+
$slots: z4.optional(z4.record(z4.string(), CDFSlotSchema2))
|
|
22438
22343
|
});
|
|
22439
|
-
var CDFTokenSchema2 =
|
|
22440
|
-
$type:
|
|
22441
|
-
$value:
|
|
22442
|
-
$description:
|
|
22344
|
+
var CDFTokenSchema2 = z4.strictObject({
|
|
22345
|
+
$type: z4.enum(DESIGN_TOKEN_TYPES2),
|
|
22346
|
+
$value: z4.unknown(),
|
|
22347
|
+
$description: z4.optional(z4.string())
|
|
22443
22348
|
});
|
|
22444
22349
|
|
|
22445
22350
|
// packages/experience-design-system-types/dist/src/cdf/build.js
|
|
@@ -22447,9 +22352,9 @@ function stripUnsupportedSlotFields(entry) {
|
|
|
22447
22352
|
if (!entry.$slots)
|
|
22448
22353
|
return entry;
|
|
22449
22354
|
const cleaned = {};
|
|
22450
|
-
for (const [
|
|
22355
|
+
for (const [name2, slot] of Object.entries(entry.$slots)) {
|
|
22451
22356
|
const { $required: _required, ...rest } = slot;
|
|
22452
|
-
cleaned[
|
|
22357
|
+
cleaned[name2] = rest;
|
|
22453
22358
|
}
|
|
22454
22359
|
return { ...entry, $slots: cleaned };
|
|
22455
22360
|
}
|
|
@@ -22492,7 +22397,7 @@ function validateSlotReferences2(components) {
|
|
|
22492
22397
|
const slots = entry.$slots ?? {};
|
|
22493
22398
|
for (const [slotKey, slot] of Object.entries(slots)) {
|
|
22494
22399
|
const allowed = slot?.$allowedComponents ?? [];
|
|
22495
|
-
const unresolved = allowed.filter((
|
|
22400
|
+
const unresolved = allowed.filter((name2) => !componentKeys.has(name2));
|
|
22496
22401
|
if (unresolved.length === 0)
|
|
22497
22402
|
continue;
|
|
22498
22403
|
errors.push({
|
|
@@ -22518,12 +22423,12 @@ function setAtPath(root, dottedPath, value) {
|
|
|
22518
22423
|
}
|
|
22519
22424
|
|
|
22520
22425
|
// packages/experience-design-system-types/dist/src/dtcg/types.js
|
|
22521
|
-
import * as
|
|
22522
|
-
var DTCGTokenSchema2 =
|
|
22523
|
-
path:
|
|
22524
|
-
$type:
|
|
22525
|
-
$value:
|
|
22526
|
-
$description:
|
|
22426
|
+
import * as z5 from "zod/mini";
|
|
22427
|
+
var DTCGTokenSchema2 = z5.strictObject({
|
|
22428
|
+
path: z5.string(),
|
|
22429
|
+
$type: z5.enum(DESIGN_TOKEN_TYPES2),
|
|
22430
|
+
$value: z5.unknown(),
|
|
22431
|
+
$description: z5.optional(z5.string())
|
|
22527
22432
|
});
|
|
22528
22433
|
|
|
22529
22434
|
// packages/experience-design-system-types/dist/src/dtcg/validate.js
|
|
@@ -22533,8 +22438,8 @@ var TOKEN_TYPE_SET4 = new Set(DESIGN_TOKEN_TYPES2);
|
|
|
22533
22438
|
var nodeTypes = globalThis.process?.getBuiltinModule?.("node:util")?.types;
|
|
22534
22439
|
|
|
22535
22440
|
// packages/experience-design-system-types/dist/src/property-contract/date-time-value.js
|
|
22536
|
-
import * as
|
|
22537
|
-
var dateTimeValueSchema =
|
|
22441
|
+
import * as z6 from "zod/mini";
|
|
22442
|
+
var dateTimeValueSchema = z6.iso.datetime({ offset: true });
|
|
22538
22443
|
|
|
22539
22444
|
// packages/experience-design-system-types/dist/src/property-contract/target-definition.js
|
|
22540
22445
|
var TARGET_PROPERTY_TYPES = [
|
|
@@ -22622,7 +22527,7 @@ function failedComponentNames(errors) {
|
|
|
22622
22527
|
return [...new Set(errors.map((error) => error.componentName))];
|
|
22623
22528
|
}
|
|
22624
22529
|
function matchedComponentNames(errors, missingNames) {
|
|
22625
|
-
return failedComponentNames(errors).filter((
|
|
22530
|
+
return failedComponentNames(errors).filter((name2) => !missingNames.includes(name2));
|
|
22626
22531
|
}
|
|
22627
22532
|
function formatErrorLine(error) {
|
|
22628
22533
|
const context = [`Component: ${error.componentName}`, error.path ? `Path: ${error.path}` : null].filter(Boolean);
|
|
@@ -22678,7 +22583,7 @@ function PreviewValidationErrorScreen({
|
|
|
22678
22583
|
}
|
|
22679
22584
|
|
|
22680
22585
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
22681
|
-
import { useCallback as useCallback5, useEffect as
|
|
22586
|
+
import { useCallback as useCallback5, useEffect as useEffect20, useMemo as useMemo6, useRef as useRef16, useState as useState26 } from "react";
|
|
22682
22587
|
import figures8 from "figures";
|
|
22683
22588
|
|
|
22684
22589
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
@@ -22752,11 +22657,11 @@ function computeRenderStatuses(closure, directIssues) {
|
|
|
22752
22657
|
inheritedSources.get(ancestor).set(node.name, ownStatus);
|
|
22753
22658
|
}
|
|
22754
22659
|
}
|
|
22755
|
-
for (const [
|
|
22756
|
-
out.set(
|
|
22660
|
+
for (const [name2, status] of own2.entries()) {
|
|
22661
|
+
out.set(name2, {
|
|
22757
22662
|
status,
|
|
22758
22663
|
isOwn: true,
|
|
22759
|
-
sourceComponents: [
|
|
22664
|
+
sourceComponents: [name2]
|
|
22760
22665
|
});
|
|
22761
22666
|
}
|
|
22762
22667
|
for (const [ancestor, sources] of inheritedSources.entries()) {
|
|
@@ -22939,7 +22844,7 @@ function enumerateCycleBreaks(cycle, components) {
|
|
|
22939
22844
|
import { Box as Box32, Text as Text34 } from "ink";
|
|
22940
22845
|
|
|
22941
22846
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
22942
|
-
import React13, { useEffect as
|
|
22847
|
+
import React13, { useEffect as useEffect14, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
|
|
22943
22848
|
import figures6 from "figures";
|
|
22944
22849
|
import { Box as Box26, measureElement, Text as Text27 } from "ink";
|
|
22945
22850
|
|
|
@@ -23021,7 +22926,7 @@ function parseToState(json) {
|
|
|
23021
22926
|
}
|
|
23022
22927
|
const componentDescription = typeof component.$description === "string" ? component.$description : "";
|
|
23023
22928
|
const rawProps = component.$properties ?? {};
|
|
23024
|
-
const props = Object.entries(rawProps).map(([
|
|
22929
|
+
const props = Object.entries(rawProps).map(([name2, raw]) => {
|
|
23025
22930
|
const p = raw ?? {};
|
|
23026
22931
|
const type = CDF_PROPERTY_TYPES2.includes(p.$type) ? p.$type : "string";
|
|
23027
22932
|
let defaultValue = null;
|
|
@@ -23033,7 +22938,7 @@ function parseToState(json) {
|
|
|
23033
22938
|
}
|
|
23034
22939
|
}
|
|
23035
22940
|
return {
|
|
23036
|
-
name,
|
|
22941
|
+
name: name2,
|
|
23037
22942
|
type,
|
|
23038
22943
|
category: CDF_PROPERTY_CATEGORIES2.includes(p.$category) ? p.$category : "content",
|
|
23039
22944
|
required: p.$required === true,
|
|
@@ -23045,10 +22950,10 @@ function parseToState(json) {
|
|
|
23045
22950
|
};
|
|
23046
22951
|
});
|
|
23047
22952
|
const rawSlots = component.$slots ?? {};
|
|
23048
|
-
const slots = Object.entries(rawSlots).map(([
|
|
22953
|
+
const slots = Object.entries(rawSlots).map(([name2, raw]) => {
|
|
23049
22954
|
const s = raw ?? {};
|
|
23050
22955
|
return {
|
|
23051
|
-
name,
|
|
22956
|
+
name: name2,
|
|
23052
22957
|
description: typeof s.$description === "string" ? s.$description : "",
|
|
23053
22958
|
required: s.$required === true,
|
|
23054
22959
|
allowedComponents: Array.isArray(s.$allowedComponents) ? s.$allowedComponents.filter((v) => typeof v === "string") : []
|
|
@@ -23156,7 +23061,7 @@ function DefaultValueRow({
|
|
|
23156
23061
|
] });
|
|
23157
23062
|
}
|
|
23158
23063
|
function RowLabel({
|
|
23159
|
-
name,
|
|
23064
|
+
name: name2,
|
|
23160
23065
|
selected,
|
|
23161
23066
|
trailing = true
|
|
23162
23067
|
}) {
|
|
@@ -23169,7 +23074,7 @@ function RowLabel({
|
|
|
23169
23074
|
wrap: "truncate-end",
|
|
23170
23075
|
children: [
|
|
23171
23076
|
" ",
|
|
23172
|
-
|
|
23077
|
+
name2,
|
|
23173
23078
|
trailing ? " " : ""
|
|
23174
23079
|
]
|
|
23175
23080
|
}
|
|
@@ -23521,10 +23426,10 @@ function SlotRow({
|
|
|
23521
23426
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
23522
23427
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
23523
23428
|
/* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
23524
|
-
slice.map((
|
|
23429
|
+
slice.map((name2, i) => {
|
|
23525
23430
|
const absIdx = start + i;
|
|
23526
23431
|
const isCursor = absIdx === cursor;
|
|
23527
|
-
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${
|
|
23432
|
+
return /* @__PURE__ */ jsx32(Text27, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${name2}` : ` ${name2}` }, name2);
|
|
23528
23433
|
})
|
|
23529
23434
|
] });
|
|
23530
23435
|
})() })
|
|
@@ -24421,8 +24326,8 @@ function FieldEditor({
|
|
|
24421
24326
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
24422
24327
|
const modeLabel = (() => {
|
|
24423
24328
|
if (pendingDelete) {
|
|
24424
|
-
const
|
|
24425
|
-
return `Delete ${pendingDelete.kind} "${
|
|
24329
|
+
const name2 = pendingDelete.kind === "prop" ? props[pendingDelete.idx]?.name : slots[pendingDelete.idx]?.name;
|
|
24330
|
+
return `Delete ${pendingDelete.kind} "${name2}"? [y] delete \xB7 any other key cancels`;
|
|
24426
24331
|
}
|
|
24427
24332
|
if (editingValue) {
|
|
24428
24333
|
return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
|
|
@@ -24497,7 +24402,7 @@ function FieldEditor({
|
|
|
24497
24402
|
}
|
|
24498
24403
|
return Math.max(start + 1, end2);
|
|
24499
24404
|
};
|
|
24500
|
-
|
|
24405
|
+
useEffect14(() => {
|
|
24501
24406
|
if (focusLevel === "field" || selectedRowIdx < 0) return;
|
|
24502
24407
|
setListScrollStart((previous) => {
|
|
24503
24408
|
if (initialFocusTarget && !initialFocusScrollApplied.current) {
|
|
@@ -25551,7 +25456,7 @@ function finalizeReviewSession(extractSessionId, components) {
|
|
|
25551
25456
|
);
|
|
25552
25457
|
db.exec("BEGIN");
|
|
25553
25458
|
try {
|
|
25554
|
-
for (const
|
|
25459
|
+
for (const name2 of toReject) statement.run(extractSessionId, name2);
|
|
25555
25460
|
db.exec("COMMIT");
|
|
25556
25461
|
} catch (error) {
|
|
25557
25462
|
db.exec("ROLLBACK");
|
|
@@ -25569,7 +25474,7 @@ function finalizeReviewSession(extractSessionId, components) {
|
|
|
25569
25474
|
}
|
|
25570
25475
|
|
|
25571
25476
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-session.ts
|
|
25572
|
-
import { useCallback as useCallback2, useEffect as
|
|
25477
|
+
import { useCallback as useCallback2, useEffect as useEffect16, useRef as useRef13, useState as useState21 } from "react";
|
|
25573
25478
|
|
|
25574
25479
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/history.ts
|
|
25575
25480
|
var DEFAULT_MAX_DEPTH = 50;
|
|
@@ -25625,7 +25530,7 @@ function createHistoryStack(seed, maxDepth = DEFAULT_MAX_DEPTH) {
|
|
|
25625
25530
|
}
|
|
25626
25531
|
|
|
25627
25532
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-finalize-preview.ts
|
|
25628
|
-
import { useEffect as
|
|
25533
|
+
import { useEffect as useEffect15, useRef as useRef12, useState as useState20 } from "react";
|
|
25629
25534
|
|
|
25630
25535
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/run-live-preview.ts
|
|
25631
25536
|
var TimeoutError = class extends Error {
|
|
@@ -25785,7 +25690,7 @@ function useFinalizePreview(opts) {
|
|
|
25785
25690
|
const [scrollOffset, setScrollOffset] = useState20(0);
|
|
25786
25691
|
const generationRef = useRef12(0);
|
|
25787
25692
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
25788
|
-
|
|
25693
|
+
useEffect15(() => {
|
|
25789
25694
|
if (!open) {
|
|
25790
25695
|
setStatus("idle");
|
|
25791
25696
|
setRemoved([]);
|
|
@@ -25848,7 +25753,7 @@ function useReviewSession({
|
|
|
25848
25753
|
}));
|
|
25849
25754
|
return { result, catalog };
|
|
25850
25755
|
}, [loadSession, tokensPath]);
|
|
25851
|
-
|
|
25756
|
+
useEffect16(() => {
|
|
25852
25757
|
let disposed = false;
|
|
25853
25758
|
void (async () => {
|
|
25854
25759
|
try {
|
|
@@ -25901,7 +25806,7 @@ function useReviewSession({
|
|
|
25901
25806
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
25902
25807
|
const [reviewMetadata, setReviewMetadata] = useState21(null);
|
|
25903
25808
|
const [componentRationale, setComponentRationale] = useState21(null);
|
|
25904
|
-
|
|
25809
|
+
useEffect16(() => {
|
|
25905
25810
|
const current = components[selectedIdx];
|
|
25906
25811
|
if (!current) {
|
|
25907
25812
|
setReviewMetadata(null);
|
|
@@ -25933,7 +25838,7 @@ function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
|
25933
25838
|
function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
|
|
25934
25839
|
const historyRef = useRef13(null);
|
|
25935
25840
|
const historySeededRef = useRef13(false);
|
|
25936
|
-
|
|
25841
|
+
useEffect16(() => {
|
|
25937
25842
|
if (loading || historySeededRef.current) return;
|
|
25938
25843
|
historySeededRef.current = true;
|
|
25939
25844
|
historyRef.current = createHistoryStack(createSnapshot(components));
|
|
@@ -25984,7 +25889,7 @@ function useReviewFinalize({
|
|
|
25984
25889
|
}
|
|
25985
25890
|
|
|
25986
25891
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-editor.ts
|
|
25987
|
-
import { useEffect as
|
|
25892
|
+
import { useEffect as useEffect17, useRef as useRef14, useState as useState22 } from "react";
|
|
25988
25893
|
|
|
25989
25894
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/token-suggestions.ts
|
|
25990
25895
|
function collectTokenSuggestions(entry, availableTokens = []) {
|
|
@@ -26037,7 +25942,7 @@ function useReviewEditor({
|
|
|
26037
25942
|
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState22(/* @__PURE__ */ new Set());
|
|
26038
25943
|
const tokenReviewSuggestedRef = useRef14(/* @__PURE__ */ new Map());
|
|
26039
25944
|
const pendingGRef = useRef14(false);
|
|
26040
|
-
|
|
25945
|
+
useEffect17(() => {
|
|
26041
25946
|
setTokenReviewRow(0);
|
|
26042
25947
|
setTokenReviewEditing(false);
|
|
26043
25948
|
setTokenReviewEditCursor(0);
|
|
@@ -26449,7 +26354,7 @@ function handleJsonPanelInput(input, key, state2) {
|
|
|
26449
26354
|
}
|
|
26450
26355
|
|
|
26451
26356
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-preview.ts
|
|
26452
|
-
import { useCallback as useCallback4, useEffect as
|
|
26357
|
+
import { useCallback as useCallback4, useEffect as useEffect19, useState as useState25 } from "react";
|
|
26453
26358
|
|
|
26454
26359
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/preview-annotations.ts
|
|
26455
26360
|
function applyPreviewAnnotations(preview, localNames) {
|
|
@@ -26457,13 +26362,13 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
26457
26362
|
const unchanged = new Set(preview.components.unchanged);
|
|
26458
26363
|
const changedNames = /* @__PURE__ */ new Set();
|
|
26459
26364
|
for (const item of preview.components.changed) {
|
|
26460
|
-
const
|
|
26461
|
-
if (typeof
|
|
26462
|
-
changedNames.add(
|
|
26365
|
+
const name2 = item.current?.name;
|
|
26366
|
+
if (typeof name2 !== "string") continue;
|
|
26367
|
+
changedNames.add(name2);
|
|
26463
26368
|
if (item.changeClassification?.classification === "breaking") {
|
|
26464
|
-
out.set(
|
|
26369
|
+
out.set(name2, "breaking");
|
|
26465
26370
|
} else {
|
|
26466
|
-
out.set(
|
|
26371
|
+
out.set(name2, "changed");
|
|
26467
26372
|
}
|
|
26468
26373
|
}
|
|
26469
26374
|
const removedNames = /* @__PURE__ */ new Set();
|
|
@@ -26473,18 +26378,18 @@ function applyPreviewAnnotations(preview, localNames) {
|
|
|
26473
26378
|
out.set(entity.name, "removed");
|
|
26474
26379
|
}
|
|
26475
26380
|
}
|
|
26476
|
-
for (const
|
|
26477
|
-
if (unchanged.has(
|
|
26478
|
-
if (changedNames.has(
|
|
26479
|
-
if (removedNames.has(
|
|
26480
|
-
if (out.has(
|
|
26481
|
-
out.set(
|
|
26381
|
+
for (const name2 of localNames) {
|
|
26382
|
+
if (unchanged.has(name2)) continue;
|
|
26383
|
+
if (changedNames.has(name2)) continue;
|
|
26384
|
+
if (removedNames.has(name2)) continue;
|
|
26385
|
+
if (out.has(name2)) continue;
|
|
26386
|
+
out.set(name2, "new");
|
|
26482
26387
|
}
|
|
26483
26388
|
return out;
|
|
26484
26389
|
}
|
|
26485
26390
|
|
|
26486
26391
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-live-preview.ts
|
|
26487
|
-
import { useCallback as useCallback3, useEffect as
|
|
26392
|
+
import { useCallback as useCallback3, useEffect as useEffect18, useRef as useRef15, useState as useState24 } from "react";
|
|
26488
26393
|
var DEFAULT_DEBOUNCE_MS = 500;
|
|
26489
26394
|
function useLivePreview(opts) {
|
|
26490
26395
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
@@ -26495,14 +26400,14 @@ function useLivePreview(opts) {
|
|
|
26495
26400
|
const latestRef = useRef15(0);
|
|
26496
26401
|
const inflightRef = useRef15(0);
|
|
26497
26402
|
const optsRef = useRef15(opts);
|
|
26498
|
-
|
|
26403
|
+
useEffect18(() => {
|
|
26499
26404
|
optsRef.current = opts;
|
|
26500
26405
|
});
|
|
26501
26406
|
const disabledRef = useRef15(disabled);
|
|
26502
|
-
|
|
26407
|
+
useEffect18(() => {
|
|
26503
26408
|
disabledRef.current = disabled;
|
|
26504
26409
|
}, [disabled]);
|
|
26505
|
-
|
|
26410
|
+
useEffect18(() => {
|
|
26506
26411
|
return () => {
|
|
26507
26412
|
if (timerRef.current) {
|
|
26508
26413
|
clearTimeout(timerRef.current);
|
|
@@ -26616,13 +26521,13 @@ function useReviewPreview({
|
|
|
26616
26521
|
deleteAllComponents
|
|
26617
26522
|
});
|
|
26618
26523
|
const [spinnerTick, setSpinnerTick] = useState25(0);
|
|
26619
|
-
|
|
26524
|
+
useEffect19(() => {
|
|
26620
26525
|
if (livePreviewHook.status !== "running") return;
|
|
26621
26526
|
const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
|
|
26622
26527
|
return () => clearInterval(id);
|
|
26623
26528
|
}, [livePreviewHook.status]);
|
|
26624
26529
|
const livePreviewSpinner = SPINNER_FRAMES[spinnerTick % SPINNER_FRAMES.length];
|
|
26625
|
-
|
|
26530
|
+
useEffect19(() => {
|
|
26626
26531
|
if (loading) return;
|
|
26627
26532
|
if (!livePreview) return;
|
|
26628
26533
|
if (components.length === 0) return;
|
|
@@ -27042,7 +26947,7 @@ function GenerateReviewStepView({
|
|
|
27042
26947
|
[components]
|
|
27043
26948
|
);
|
|
27044
26949
|
const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
27045
|
-
|
|
26950
|
+
useEffect20(() => {
|
|
27046
26951
|
if (seededGroupsRef.current) return;
|
|
27047
26952
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
27048
26953
|
seededGroupsRef.current = true;
|
|
@@ -27069,7 +26974,7 @@ function GenerateReviewStepView({
|
|
|
27069
26974
|
suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
|
|
27070
26975
|
}));
|
|
27071
26976
|
}, [slotCycles, cycleView]);
|
|
27072
|
-
|
|
26977
|
+
useEffect20(() => {
|
|
27073
26978
|
const decision = computeAutoRejectDecision({
|
|
27074
26979
|
loading,
|
|
27075
26980
|
autoRejectFired: autoRejectFiredRef.current,
|
|
@@ -27113,7 +27018,7 @@ function GenerateReviewStepView({
|
|
|
27113
27018
|
applySnapshot: applyHistorySnapshot
|
|
27114
27019
|
});
|
|
27115
27020
|
const autoRejectPushedRef = useRef16(false);
|
|
27116
|
-
|
|
27021
|
+
useEffect20(() => {
|
|
27117
27022
|
if (loading) return;
|
|
27118
27023
|
if (!historySeededRef.current) return;
|
|
27119
27024
|
if (!autoRejectFiredRef.current) return;
|
|
@@ -27197,7 +27102,7 @@ function GenerateReviewStepView({
|
|
|
27197
27102
|
const panelHeight = leftPanelHeight + 2;
|
|
27198
27103
|
const panelContentHeight = Math.max(1, panelHeight - 3);
|
|
27199
27104
|
const cycleViewportHeight = Math.max(1, panelHeight - 4);
|
|
27200
|
-
|
|
27105
|
+
useEffect20(() => {
|
|
27201
27106
|
if (selectableRowPositions.length === 0) return;
|
|
27202
27107
|
const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
|
|
27203
27108
|
const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
|
|
@@ -27232,10 +27137,10 @@ function GenerateReviewStepView({
|
|
|
27232
27137
|
const merged = /* @__PURE__ */ new Map();
|
|
27233
27138
|
for (const closure of closures.values()) {
|
|
27234
27139
|
const per = computeRenderStatuses(closure, directIssues);
|
|
27235
|
-
for (const [
|
|
27236
|
-
const existing = merged.get(
|
|
27140
|
+
for (const [name2, rs] of per.entries()) {
|
|
27141
|
+
const existing = merged.get(name2);
|
|
27237
27142
|
if (!existing || !existing.isOwn && rs.isOwn) {
|
|
27238
|
-
merged.set(
|
|
27143
|
+
merged.set(name2, rs);
|
|
27239
27144
|
}
|
|
27240
27145
|
}
|
|
27241
27146
|
}
|
|
@@ -27290,11 +27195,11 @@ function GenerateReviewStepView({
|
|
|
27290
27195
|
reviewEditor.setSaveError(null);
|
|
27291
27196
|
setPendingEditorFocus(null);
|
|
27292
27197
|
};
|
|
27293
|
-
const jumpCursorToName = (
|
|
27198
|
+
const jumpCursorToName = (name2) => {
|
|
27294
27199
|
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
27295
27200
|
const row = visibleRowsMemo[i];
|
|
27296
27201
|
if (row.itemIdx < 0) continue;
|
|
27297
|
-
if (components[row.itemIdx]?.key ===
|
|
27202
|
+
if (components[row.itemIdx]?.key === name2) {
|
|
27298
27203
|
jumpCursorToRow(i);
|
|
27299
27204
|
return;
|
|
27300
27205
|
}
|
|
@@ -27822,8 +27727,8 @@ function GenerateReviewStepView({
|
|
|
27822
27727
|
}
|
|
27823
27728
|
),
|
|
27824
27729
|
!dialogOpen && autoRejected.length > 0 && (() => {
|
|
27825
|
-
const stillRejected = autoRejected.filter((
|
|
27826
|
-
const c2 = components.find((x) => x.key ===
|
|
27730
|
+
const stillRejected = autoRejected.filter((name2) => {
|
|
27731
|
+
const c2 = components.find((x) => x.key === name2);
|
|
27827
27732
|
return c2?.status === "rejected";
|
|
27828
27733
|
});
|
|
27829
27734
|
if (stillRejected.length === 0) return null;
|
|
@@ -28142,10 +28047,10 @@ function normalizePath(input) {
|
|
|
28142
28047
|
}
|
|
28143
28048
|
|
|
28144
28049
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
|
|
28145
|
-
import { useEffect as
|
|
28050
|
+
import { useEffect as useEffect21, useState as useState27 } from "react";
|
|
28146
28051
|
function useBlinkingCursor() {
|
|
28147
28052
|
const [visible, setVisible] = useState27(true);
|
|
28148
|
-
|
|
28053
|
+
useEffect21(() => {
|
|
28149
28054
|
const interval = setInterval(() => setVisible((current) => !current), 500);
|
|
28150
28055
|
return () => clearInterval(interval);
|
|
28151
28056
|
}, []);
|
|
@@ -28261,12 +28166,12 @@ function countedThings({ components, tokens }, counts = {}) {
|
|
|
28261
28166
|
}
|
|
28262
28167
|
|
|
28263
28168
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
28264
|
-
import { useEffect as
|
|
28169
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
28265
28170
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
28266
28171
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
28267
28172
|
function useTimedSpinner() {
|
|
28268
28173
|
const [elapsedSeconds, setElapsedSeconds] = useState29(0);
|
|
28269
|
-
|
|
28174
|
+
useEffect22(() => {
|
|
28270
28175
|
const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
|
|
28271
28176
|
return () => {
|
|
28272
28177
|
clearInterval(timer);
|
|
@@ -28324,7 +28229,7 @@ function PushingStep({ progress, produced, counts }) {
|
|
|
28324
28229
|
}
|
|
28325
28230
|
|
|
28326
28231
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
28327
|
-
import { useEffect as
|
|
28232
|
+
import { useEffect as useEffect23, useState as useState30, useMemo as useMemo7 } from "react";
|
|
28328
28233
|
import { Box as Box44, Text as Text46 } from "ink";
|
|
28329
28234
|
|
|
28330
28235
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/preview-diff.ts
|
|
@@ -28334,31 +28239,31 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
28334
28239
|
const proposedProperties = proposed["$properties"] ?? {};
|
|
28335
28240
|
const proposedProps = new Set(Object.keys(proposedProperties));
|
|
28336
28241
|
const oldProps = current.fullProperties;
|
|
28337
|
-
for (const
|
|
28338
|
-
if (!currentProps.has(
|
|
28339
|
-
const def = proposedProperties[
|
|
28340
|
-
lines.push({ key: `${
|
|
28242
|
+
for (const name2 of [...proposedProps].sort()) {
|
|
28243
|
+
if (!currentProps.has(name2)) {
|
|
28244
|
+
const def = proposedProperties[name2];
|
|
28245
|
+
lines.push({ key: `${name2}-add`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(def)}` });
|
|
28341
28246
|
}
|
|
28342
28247
|
}
|
|
28343
|
-
for (const
|
|
28344
|
-
if (!proposedProps.has(
|
|
28345
|
-
if (oldProps?.[
|
|
28346
|
-
lines.push({ key: `${
|
|
28248
|
+
for (const name2 of [...currentProps].sort()) {
|
|
28249
|
+
if (!proposedProps.has(name2)) {
|
|
28250
|
+
if (oldProps?.[name2]) {
|
|
28251
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(oldProps[name2])}` });
|
|
28347
28252
|
} else {
|
|
28348
|
-
const cat = current.contentProperties.includes(
|
|
28349
|
-
lines.push({ key: `${
|
|
28253
|
+
const cat = current.contentProperties.includes(name2) ? "content" : "design";
|
|
28254
|
+
lines.push({ key: `${name2}-rm`, color: PALETTE.error, text: `- ${name2} (${cat})` });
|
|
28350
28255
|
}
|
|
28351
28256
|
}
|
|
28352
28257
|
}
|
|
28353
28258
|
const handledProps = /* @__PURE__ */ new Set();
|
|
28354
|
-
for (const
|
|
28355
|
-
if (!proposedProps.has(
|
|
28356
|
-
const newDef = proposedProperties[
|
|
28357
|
-
const oldDef = oldProps?.[
|
|
28259
|
+
for (const name2 of [...currentProps].sort()) {
|
|
28260
|
+
if (!proposedProps.has(name2)) continue;
|
|
28261
|
+
const newDef = proposedProperties[name2];
|
|
28262
|
+
const oldDef = oldProps?.[name2];
|
|
28358
28263
|
if (!oldDef) continue;
|
|
28359
|
-
const diffs = diffProperty(
|
|
28264
|
+
const diffs = diffProperty(name2, oldDef, newDef);
|
|
28360
28265
|
if (diffs.length > 0) {
|
|
28361
|
-
handledProps.add(
|
|
28266
|
+
handledProps.add(name2);
|
|
28362
28267
|
for (const d of diffs) lines.push(d);
|
|
28363
28268
|
}
|
|
28364
28269
|
}
|
|
@@ -28381,40 +28286,40 @@ function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
|
28381
28286
|
const proposedSlots = proposed["$slots"] ?? {};
|
|
28382
28287
|
const proposedSlotNames = new Set(Object.keys(proposedSlots));
|
|
28383
28288
|
const currentSlotAllowed = current.currentSlotAllowed ?? {};
|
|
28384
|
-
for (const
|
|
28385
|
-
if (!currentSlots.has(
|
|
28386
|
-
lines.push({ key: `slot-${
|
|
28289
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
28290
|
+
if (!currentSlots.has(name2)) {
|
|
28291
|
+
lines.push({ key: `slot-${name2}-add`, color: PALETTE.success, text: `+ slot: ${name2}` });
|
|
28387
28292
|
}
|
|
28388
28293
|
}
|
|
28389
|
-
for (const
|
|
28390
|
-
if (!proposedSlotNames.has(
|
|
28391
|
-
lines.push({ key: `slot-${
|
|
28294
|
+
for (const name2 of [...currentSlots].sort()) {
|
|
28295
|
+
if (!proposedSlotNames.has(name2)) {
|
|
28296
|
+
lines.push({ key: `slot-${name2}-rm`, color: PALETTE.error, text: `- slot: ${name2}` });
|
|
28392
28297
|
}
|
|
28393
28298
|
}
|
|
28394
|
-
for (const
|
|
28395
|
-
const nextAllowed = normalizeAllowedComponents(proposedSlots[
|
|
28396
|
-
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[
|
|
28397
|
-
const prevExists = currentSlots.has(
|
|
28299
|
+
for (const name2 of [...proposedSlotNames].sort()) {
|
|
28300
|
+
const nextAllowed = normalizeAllowedComponents(proposedSlots[name2]?.["$allowedComponents"]);
|
|
28301
|
+
const prevAllowed = normalizeAllowedComponents(currentSlotAllowed[name2]);
|
|
28302
|
+
const prevExists = currentSlots.has(name2);
|
|
28398
28303
|
if (!prevExists) {
|
|
28399
28304
|
if (nextAllowed.length > 0) {
|
|
28400
28305
|
lines.push({
|
|
28401
|
-
key: `slot-${
|
|
28306
|
+
key: `slot-${name2}-allow-new`,
|
|
28402
28307
|
color: PALETTE.success,
|
|
28403
|
-
text: `+ slot ${
|
|
28308
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
28404
28309
|
});
|
|
28405
28310
|
}
|
|
28406
28311
|
continue;
|
|
28407
28312
|
}
|
|
28408
28313
|
if (arraysEqual(prevAllowed, nextAllowed)) continue;
|
|
28409
28314
|
lines.push({
|
|
28410
|
-
key: `slot-${
|
|
28315
|
+
key: `slot-${name2}-allow-old`,
|
|
28411
28316
|
color: PALETTE.error,
|
|
28412
|
-
text: `- slot ${
|
|
28317
|
+
text: `- slot ${name2} allowedComponents: [${prevAllowed.join(", ")}]`
|
|
28413
28318
|
});
|
|
28414
28319
|
lines.push({
|
|
28415
|
-
key: `slot-${
|
|
28320
|
+
key: `slot-${name2}-allow-new`,
|
|
28416
28321
|
color: PALETTE.success,
|
|
28417
|
-
text: `+ slot ${
|
|
28322
|
+
text: `+ slot ${name2} allowedComponents: [${nextAllowed.join(", ")}]`
|
|
28418
28323
|
});
|
|
28419
28324
|
}
|
|
28420
28325
|
return lines;
|
|
@@ -28450,7 +28355,7 @@ function normalizeType(type) {
|
|
|
28450
28355
|
return type.toLowerCase();
|
|
28451
28356
|
}
|
|
28452
28357
|
}
|
|
28453
|
-
function diffProperty(
|
|
28358
|
+
function diffProperty(name2, old, newDef) {
|
|
28454
28359
|
const diffs = [];
|
|
28455
28360
|
const newType = newDef["$type"] ?? "";
|
|
28456
28361
|
const newCategory = newDef["$category"] ?? "";
|
|
@@ -28461,15 +28366,15 @@ function diffProperty(name, old, newDef) {
|
|
|
28461
28366
|
const requiredChanged = old.required !== newRequired;
|
|
28462
28367
|
const defaultChanged = JSON.stringify(old.default) !== JSON.stringify(newDefault);
|
|
28463
28368
|
if (!typeChanged && !categoryChanged && !requiredChanged && !defaultChanged) return [];
|
|
28464
|
-
diffs.push({ key: `${
|
|
28465
|
-
diffs.push({ key: `${
|
|
28369
|
+
diffs.push({ key: `${name2}-old`, color: PALETTE.error, text: `- ${name2}: ${formatOldProp(old)}` });
|
|
28370
|
+
diffs.push({ key: `${name2}-new`, color: PALETTE.success, text: `+ ${name2}: ${formatPropDef(newDef)}` });
|
|
28466
28371
|
return diffs;
|
|
28467
28372
|
}
|
|
28468
28373
|
function formatDefault(value) {
|
|
28469
28374
|
const sys = value?.sys;
|
|
28470
28375
|
if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
|
|
28471
|
-
const
|
|
28472
|
-
if (
|
|
28376
|
+
const name2 = sys.urn.split("/designTokens/")[1];
|
|
28377
|
+
if (name2) return name2;
|
|
28473
28378
|
}
|
|
28474
28379
|
return JSON.stringify(value);
|
|
28475
28380
|
}
|
|
@@ -28522,8 +28427,8 @@ function buildPreviewSummaryLines(preview) {
|
|
|
28522
28427
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
28523
28428
|
});
|
|
28524
28429
|
for (const [index, item] of components.new.entries()) {
|
|
28525
|
-
const
|
|
28526
|
-
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${
|
|
28430
|
+
const name2 = item.key ?? item.$name ?? "unknown";
|
|
28431
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
28527
28432
|
}
|
|
28528
28433
|
}
|
|
28529
28434
|
if (components.changed.length > 0) {
|
|
@@ -28616,27 +28521,27 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
28616
28521
|
}
|
|
28617
28522
|
return void 0;
|
|
28618
28523
|
}
|
|
28619
|
-
function appendChangedPreviewLine(lines, keyPrefix,
|
|
28524
|
+
function appendChangedPreviewLine(lines, keyPrefix, name2, hasPendingDraftChanges, changeClassification) {
|
|
28620
28525
|
lines.push({
|
|
28621
|
-
key: `${keyPrefix}-h-${
|
|
28526
|
+
key: `${keyPrefix}-h-${name2}`,
|
|
28622
28527
|
color: PALETTE.warning,
|
|
28623
|
-
text: ` ~ ${
|
|
28528
|
+
text: ` ~ ${name2}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
28624
28529
|
});
|
|
28625
28530
|
if (changeClassification?.classification !== "breaking") return;
|
|
28626
28531
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
28627
|
-
lines.push({ key: `${keyPrefix}-b-${
|
|
28532
|
+
lines.push({ key: `${keyPrefix}-b-${name2}`, color: PALETTE.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
28628
28533
|
}
|
|
28629
28534
|
function buildPreviewDiffLines(preview) {
|
|
28630
28535
|
const lines = [];
|
|
28631
28536
|
const { components, tokens } = preview;
|
|
28632
28537
|
for (const item of components.new) {
|
|
28633
28538
|
const raw = item;
|
|
28634
|
-
const
|
|
28635
|
-
lines.push({ key: `comp-new-${
|
|
28539
|
+
const name2 = raw.key ?? raw.$name ?? "unknown";
|
|
28540
|
+
lines.push({ key: `comp-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
28636
28541
|
const slots = raw.$slots ?? {};
|
|
28637
28542
|
for (const slotName of Object.keys(slots).sort()) {
|
|
28638
28543
|
lines.push({
|
|
28639
|
-
key: `comp-new-${
|
|
28544
|
+
key: `comp-new-${name2}-slot-${slotName}`,
|
|
28640
28545
|
color: PALETTE.success,
|
|
28641
28546
|
text: ` slot: ${slotName}`
|
|
28642
28547
|
});
|
|
@@ -28644,7 +28549,7 @@ function buildPreviewDiffLines(preview) {
|
|
|
28644
28549
|
if (Array.isArray(allowed) && allowed.length > 0) {
|
|
28645
28550
|
const names = allowed.filter((n) => typeof n === "string");
|
|
28646
28551
|
lines.push({
|
|
28647
|
-
key: `comp-new-${
|
|
28552
|
+
key: `comp-new-${name2}-slot-${slotName}-allow`,
|
|
28648
28553
|
color: PALETTE.success,
|
|
28649
28554
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
28650
28555
|
});
|
|
@@ -28682,8 +28587,8 @@ function buildPreviewDiffLines(preview) {
|
|
|
28682
28587
|
}
|
|
28683
28588
|
for (const item of tokens.new) {
|
|
28684
28589
|
const raw = item;
|
|
28685
|
-
const
|
|
28686
|
-
lines.push({ key: `tok-new-${
|
|
28590
|
+
const name2 = raw.name ?? raw.path ?? "unknown";
|
|
28591
|
+
lines.push({ key: `tok-new-${name2}`, color: PALETTE.success, text: ` + ${name2}` });
|
|
28687
28592
|
}
|
|
28688
28593
|
for (const item of tokens.removed) {
|
|
28689
28594
|
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
|
|
@@ -28719,7 +28624,7 @@ function WizardPreviewStep({
|
|
|
28719
28624
|
const activeLines = diffExpanded ? diffLines : summaryLines;
|
|
28720
28625
|
const maxScroll = Math.max(0, activeLines.length - viewportHeight);
|
|
28721
28626
|
const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
|
|
28722
|
-
|
|
28627
|
+
useEffect23(() => {
|
|
28723
28628
|
setScrollOffset((previous) => Math.min(previous, maxScroll));
|
|
28724
28629
|
}, [maxScroll]);
|
|
28725
28630
|
useImmediateInput((input, key) => {
|
|
@@ -28937,7 +28842,7 @@ function FlowScreen({
|
|
|
28937
28842
|
}
|
|
28938
28843
|
|
|
28939
28844
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
28940
|
-
import { useEffect as
|
|
28845
|
+
import { useEffect as useEffect24, useRef as useRef17, useSyncExternalStore } from "react";
|
|
28941
28846
|
|
|
28942
28847
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
|
|
28943
28848
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
@@ -29696,14 +29601,14 @@ function useFlow(start, options = {}) {
|
|
|
29696
29601
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
29697
29602
|
() => current?.getState()
|
|
29698
29603
|
);
|
|
29699
|
-
|
|
29604
|
+
useEffect24(() => {
|
|
29700
29605
|
if (!start) controller.current = void 0;
|
|
29701
29606
|
}, [start]);
|
|
29702
29607
|
return current && state2 ? { controller: current, state: state2 } : void 0;
|
|
29703
29608
|
}
|
|
29704
29609
|
|
|
29705
29610
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
29706
|
-
import { useEffect as
|
|
29611
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
29707
29612
|
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
29708
29613
|
init_debug_store();
|
|
29709
29614
|
|
|
@@ -29777,7 +29682,7 @@ function Section({ title, rows }) {
|
|
|
29777
29682
|
}
|
|
29778
29683
|
function HelpScreen({ onDone }) {
|
|
29779
29684
|
const [info, setInfo] = useState31();
|
|
29780
|
-
|
|
29685
|
+
useEffect25(() => {
|
|
29781
29686
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
29782
29687
|
void readHelpInfo().then(setInfo);
|
|
29783
29688
|
}, []);
|
|
@@ -29874,10 +29779,43 @@ import { useState as useState36 } from "react";
|
|
|
29874
29779
|
import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
|
|
29875
29780
|
|
|
29876
29781
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
29877
|
-
import { useEffect as
|
|
29782
|
+
import { useEffect as useEffect27, useRef as useRef18, useState as useState34 } from "react";
|
|
29878
29783
|
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
29879
29784
|
init_debug_store();
|
|
29880
29785
|
|
|
29786
|
+
// packages/experience-design-system-cli/src/tui/settings/shared/debug-trail.ts
|
|
29787
|
+
init_config();
|
|
29788
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
29789
|
+
function diffSnapshots(before, after) {
|
|
29790
|
+
const names = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])];
|
|
29791
|
+
const changed_fields = names.filter((name2) => before[name2] !== after[name2]);
|
|
29792
|
+
return { changed: changed_fields.length > 0, changed_fields };
|
|
29793
|
+
}
|
|
29794
|
+
var DEFAULT_TRAIL_LIMIT = 30;
|
|
29795
|
+
function createTrail(limit = DEFAULT_TRAIL_LIMIT) {
|
|
29796
|
+
const actions = [];
|
|
29797
|
+
return {
|
|
29798
|
+
record(action) {
|
|
29799
|
+
actions.push(action);
|
|
29800
|
+
if (actions.length > limit) actions.shift();
|
|
29801
|
+
},
|
|
29802
|
+
entries: () => [...actions]
|
|
29803
|
+
};
|
|
29804
|
+
}
|
|
29805
|
+
var MIN_SECRET_LENGTH = 6;
|
|
29806
|
+
function scrubError(error, secrets) {
|
|
29807
|
+
let message = error instanceof Error ? error.message : String(error);
|
|
29808
|
+
for (const secret of secrets) {
|
|
29809
|
+
if (secret.length < MIN_SECRET_LENGTH) continue;
|
|
29810
|
+
for (const form of /* @__PURE__ */ new Set([secret, encodeURIComponent(secret)])) message = message.split(form).join("[redacted]");
|
|
29811
|
+
}
|
|
29812
|
+
return message;
|
|
29813
|
+
}
|
|
29814
|
+
function describeSettingsFile() {
|
|
29815
|
+
const path5 = configFilePath();
|
|
29816
|
+
return { path: path5, eds_home_set: Boolean(process.env["EDS_HOME"]), exists: existsSync10(path5) };
|
|
29817
|
+
}
|
|
29818
|
+
|
|
29881
29819
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-status.ts
|
|
29882
29820
|
import { execFile as execFile2 } from "node:child_process";
|
|
29883
29821
|
import { access as access5, constants } from "node:fs/promises";
|
|
@@ -29898,11 +29836,11 @@ var LOGIN_HINTS = {
|
|
|
29898
29836
|
cursor: "sign in from Cursor",
|
|
29899
29837
|
copilot: "run `copilot` and sign in"
|
|
29900
29838
|
};
|
|
29901
|
-
function effectiveBinary(
|
|
29902
|
-
return savedBinary.trim() || AGENT_BINARIES[
|
|
29839
|
+
function effectiveBinary(name2, savedBinary) {
|
|
29840
|
+
return savedBinary.trim() || AGENT_BINARIES[name2];
|
|
29903
29841
|
}
|
|
29904
|
-
function defaultModelLabel(
|
|
29905
|
-
const model = DEFAULT_MODELS[
|
|
29842
|
+
function defaultModelLabel(name2) {
|
|
29843
|
+
const model = DEFAULT_MODELS[name2];
|
|
29906
29844
|
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
29907
29845
|
}
|
|
29908
29846
|
var fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
@@ -29931,32 +29869,32 @@ function readVersion(binary) {
|
|
|
29931
29869
|
});
|
|
29932
29870
|
});
|
|
29933
29871
|
}
|
|
29934
|
-
async function inspect(
|
|
29935
|
-
const target = effectiveBinary(
|
|
29872
|
+
async function inspect(name2, binary) {
|
|
29873
|
+
const target = effectiveBinary(name2, binary);
|
|
29936
29874
|
const found = await resolveOnPath(target);
|
|
29937
29875
|
if (!found) return { checks: [fail3("path", `\`${target}\` was not found or is not executable`)], found: null };
|
|
29938
29876
|
const checks = [pass("path", found)];
|
|
29939
29877
|
checks.push(await readVersion(found));
|
|
29940
|
-
if (
|
|
29941
|
-
const auth = await withBinaryEnv(
|
|
29878
|
+
if (name2 === "claude") {
|
|
29879
|
+
const auth = await withBinaryEnv(name2, found, () => checkAgentAuth(name2));
|
|
29942
29880
|
checks.push(
|
|
29943
29881
|
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
29944
29882
|
);
|
|
29945
29883
|
}
|
|
29946
29884
|
return { checks, found };
|
|
29947
29885
|
}
|
|
29948
|
-
async function inspectAgent(
|
|
29949
|
-
return (await inspect(
|
|
29886
|
+
async function inspectAgent(name2, binary) {
|
|
29887
|
+
return (await inspect(name2, binary)).checks;
|
|
29950
29888
|
}
|
|
29951
|
-
async function testAgent(
|
|
29952
|
-
const { checks, found } = await inspect(
|
|
29889
|
+
async function testAgent(name2, binary, model) {
|
|
29890
|
+
const { checks, found } = await inspect(name2, binary);
|
|
29953
29891
|
if (!found || !checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
29954
29892
|
const started = Date.now();
|
|
29955
29893
|
const result = await withBinaryEnv(
|
|
29956
|
-
|
|
29894
|
+
name2,
|
|
29957
29895
|
found,
|
|
29958
29896
|
() => createLocalCliAgentInvoker().invoke({
|
|
29959
|
-
agent:
|
|
29897
|
+
agent: name2,
|
|
29960
29898
|
...model.trim() ? { model: model.trim() } : {},
|
|
29961
29899
|
prompt: TEST_PROMPT,
|
|
29962
29900
|
timeoutMs: PROMPT_TIMEOUT_MS
|
|
@@ -29972,7 +29910,7 @@ async function testAgent(name, binary, model) {
|
|
|
29972
29910
|
}
|
|
29973
29911
|
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
29974
29912
|
}
|
|
29975
|
-
function statusFromChecks(
|
|
29913
|
+
function statusFromChecks(name2, checks, savedBinary) {
|
|
29976
29914
|
if (checks.length === 0) return "checking";
|
|
29977
29915
|
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
29978
29916
|
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
@@ -29984,13 +29922,13 @@ function statusFromChecks(name, checks, savedBinary) {
|
|
|
29984
29922
|
}
|
|
29985
29923
|
const login = checks.find((check) => check.step === "login");
|
|
29986
29924
|
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
29987
|
-
return
|
|
29925
|
+
return name2 === "claude" ? "ready" : "unknown";
|
|
29988
29926
|
}
|
|
29989
|
-
function setupHint(
|
|
29990
|
-
if (status === "not-configured") return `${INSTALL_HINTS[
|
|
29991
|
-
if (status === "not-found") return `${INSTALL_HINTS[
|
|
29992
|
-
if (status === "not-logged-in") return LOGIN_HINTS[
|
|
29993
|
-
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[
|
|
29927
|
+
function setupHint(name2, status) {
|
|
29928
|
+
if (status === "not-configured") return `${INSTALL_HINTS[name2]}, or set its command path in settings`;
|
|
29929
|
+
if (status === "not-found") return `${INSTALL_HINTS[name2]}, or correct the command path in settings`;
|
|
29930
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name2];
|
|
29931
|
+
if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[name2]}`;
|
|
29994
29932
|
if (status === "timed-out") return "it may be slow or waiting for input; run the test again, or try it in a terminal";
|
|
29995
29933
|
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
29996
29934
|
return "";
|
|
@@ -30012,14 +29950,14 @@ var LIST_STATUS = {
|
|
|
30012
29950
|
"timed-out": { symbol: "\u2717", text: "test timed out", tone: "bad" },
|
|
30013
29951
|
unknown: { symbol: "\u25D0", text: "installed, login unknown", tone: "muted" }
|
|
30014
29952
|
};
|
|
30015
|
-
function modelLine(
|
|
29953
|
+
function modelLine(name2, savedModel) {
|
|
30016
29954
|
const model = savedModel.trim();
|
|
30017
|
-
return model ? model : `${defaultModelLabel(
|
|
29955
|
+
return model ? model : `${defaultModelLabel(name2)} (built-in default)`;
|
|
30018
29956
|
}
|
|
30019
|
-
function baseRows(
|
|
29957
|
+
function baseRows(name2, checks, savedBinary) {
|
|
30020
29958
|
const path5 = checks.find((check) => check.step === "path");
|
|
30021
29959
|
const version2 = checks.find((check) => check.step === "version");
|
|
30022
|
-
const hint = setupHint(
|
|
29960
|
+
const hint = setupHint(name2, statusFromChecks(name2, checks, savedBinary));
|
|
30023
29961
|
const setup = hint ? { label: "Setup", value: hint, tone: "muted" } : void 0;
|
|
30024
29962
|
if (!path5?.ok) {
|
|
30025
29963
|
const saved = savedBinary.trim() !== "";
|
|
@@ -30042,15 +29980,15 @@ function baseRows(name, checks, savedBinary) {
|
|
|
30042
29980
|
};
|
|
30043
29981
|
}
|
|
30044
29982
|
var checking = [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
30045
|
-
function panelRows(
|
|
29983
|
+
function panelRows(name2, checks, settings) {
|
|
30046
29984
|
if (!checks) return checking;
|
|
30047
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
30048
|
-
const model = { label: "Model", value: modelLine(
|
|
29985
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, settings.binary);
|
|
29986
|
+
const model = { label: "Model", value: modelLine(name2, settings.model), tone: "muted" };
|
|
30049
29987
|
return [command, ...found ? [...version2?.tone === "ok" ? [version2] : [], model] : [], ...setup ? [setup] : []];
|
|
30050
29988
|
}
|
|
30051
|
-
function statusRows(
|
|
29989
|
+
function statusRows(name2, checks, savedBinary) {
|
|
30052
29990
|
if (!checks) return checking;
|
|
30053
|
-
const { command, version: version2, setup, found } = baseRows(
|
|
29991
|
+
const { command, version: version2, setup, found } = baseRows(name2, checks, savedBinary);
|
|
30054
29992
|
if (!found) return [command];
|
|
30055
29993
|
const login = checks.find((check) => check.step === "login");
|
|
30056
29994
|
const prompt = checks.find((check) => check.step === "prompt");
|
|
@@ -30069,8 +30007,8 @@ function statusRows(name, checks, savedBinary) {
|
|
|
30069
30007
|
const testRow = prompt ? [{ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" }] : [];
|
|
30070
30008
|
return [command, ...version2 ? [version2] : [], loginRow, ...testRow, ...setup ? [setup] : []];
|
|
30071
30009
|
}
|
|
30072
|
-
async function withBinaryEnv(
|
|
30073
|
-
const key = `EDS_AGENT_BINARY_${
|
|
30010
|
+
async function withBinaryEnv(name2, binary, run) {
|
|
30011
|
+
const key = `EDS_AGENT_BINARY_${name2.toUpperCase()}`;
|
|
30074
30012
|
const previous = process.env[key];
|
|
30075
30013
|
process.env[key] = binary;
|
|
30076
30014
|
try {
|
|
@@ -30084,9 +30022,9 @@ async function withBinaryEnv(name, binary, run) {
|
|
|
30084
30022
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-debug.ts
|
|
30085
30023
|
function agentSnapshot(config) {
|
|
30086
30024
|
const snapshot = { default_agent: config.defaultAgent };
|
|
30087
|
-
for (const
|
|
30088
|
-
snapshot[`${
|
|
30089
|
-
snapshot[`${
|
|
30025
|
+
for (const name2 of AGENT_NAMES) {
|
|
30026
|
+
snapshot[`${name2}.model`] = config.agents[name2].model;
|
|
30027
|
+
snapshot[`${name2}.binary`] = config.agents[name2].binary;
|
|
30090
30028
|
}
|
|
30091
30029
|
return snapshot;
|
|
30092
30030
|
}
|
|
@@ -30103,10 +30041,10 @@ function environmentFrom(checks, savedBinary, envValue) {
|
|
|
30103
30041
|
}
|
|
30104
30042
|
async function describeAgents(config) {
|
|
30105
30043
|
const entries = await Promise.all(
|
|
30106
|
-
AGENT_NAMES.map(async (
|
|
30107
|
-
const saved = config.agents[
|
|
30108
|
-
const checks = await inspectAgent(
|
|
30109
|
-
return [
|
|
30044
|
+
AGENT_NAMES.map(async (name2) => {
|
|
30045
|
+
const saved = config.agents[name2].binary;
|
|
30046
|
+
const checks = await inspectAgent(name2, saved);
|
|
30047
|
+
return [name2, environmentFrom(checks, saved, process.env[`EDS_AGENT_BINARY_${name2.toUpperCase()}`])];
|
|
30110
30048
|
})
|
|
30111
30049
|
);
|
|
30112
30050
|
return Object.fromEntries(entries);
|
|
@@ -30127,7 +30065,7 @@ var AGENT_LABELS = {
|
|
|
30127
30065
|
};
|
|
30128
30066
|
var asString = (value) => typeof value === "string" ? value : "";
|
|
30129
30067
|
function emptyAgents() {
|
|
30130
|
-
return Object.fromEntries(AGENT_NAMES.map((
|
|
30068
|
+
return Object.fromEntries(AGENT_NAMES.map((name2) => [name2, { model: "", binary: "" }]));
|
|
30131
30069
|
}
|
|
30132
30070
|
async function readAgentConfig() {
|
|
30133
30071
|
const store = await readV1Store();
|
|
@@ -30137,11 +30075,11 @@ async function readAgentConfig() {
|
|
|
30137
30075
|
const agents = emptyAgents();
|
|
30138
30076
|
const saved = store["agents"];
|
|
30139
30077
|
if (saved && typeof saved === "object") {
|
|
30140
|
-
for (const
|
|
30141
|
-
const entry = saved[
|
|
30078
|
+
for (const name2 of AGENT_NAMES) {
|
|
30079
|
+
const entry = saved[name2];
|
|
30142
30080
|
if (entry && typeof entry === "object") {
|
|
30143
30081
|
const fields2 = entry;
|
|
30144
|
-
agents[
|
|
30082
|
+
agents[name2] = { model: asString(fields2["model"]), binary: asString(fields2["binary"]) };
|
|
30145
30083
|
}
|
|
30146
30084
|
}
|
|
30147
30085
|
}
|
|
@@ -30154,10 +30092,10 @@ async function writeAgentConfig(config) {
|
|
|
30154
30092
|
const existing = await readV1Store();
|
|
30155
30093
|
const merged = { ...existing };
|
|
30156
30094
|
const agents = {};
|
|
30157
|
-
for (const
|
|
30158
|
-
const model = config.agents[
|
|
30159
|
-
const binary = config.agents[
|
|
30160
|
-
if (model || binary) agents[
|
|
30095
|
+
for (const name2 of AGENT_NAMES) {
|
|
30096
|
+
const model = config.agents[name2].model.trim();
|
|
30097
|
+
const binary = config.agents[name2].binary.trim();
|
|
30098
|
+
if (model || binary) agents[name2] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
30161
30099
|
}
|
|
30162
30100
|
const defaultModel = config.defaultChosen ? agents[config.defaultAgent]?.model : void 0;
|
|
30163
30101
|
if (config.defaultChosen) merged["agent"] = config.defaultAgent;
|
|
@@ -30170,7 +30108,7 @@ async function writeAgentConfig(config) {
|
|
|
30170
30108
|
}
|
|
30171
30109
|
|
|
30172
30110
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
30173
|
-
import { useEffect as
|
|
30111
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
30174
30112
|
import { Box as Box48, Text as Text50 } from "ink";
|
|
30175
30113
|
|
|
30176
30114
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentStatusBadge.tsx
|
|
@@ -30182,20 +30120,20 @@ var TONE_COLOR = {
|
|
|
30182
30120
|
muted: PALETTE.muted
|
|
30183
30121
|
};
|
|
30184
30122
|
function AgentStatusBadge({
|
|
30185
|
-
name,
|
|
30123
|
+
name: name2,
|
|
30186
30124
|
checks,
|
|
30187
30125
|
binary
|
|
30188
30126
|
}) {
|
|
30189
|
-
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(
|
|
30127
|
+
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name2, checks, binary) : "checking"];
|
|
30190
30128
|
return /* @__PURE__ */ jsx59(Text49, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
30191
30129
|
}
|
|
30192
30130
|
|
|
30193
30131
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/apply-binary-overrides.ts
|
|
30194
30132
|
var shellValues = /* @__PURE__ */ new Map();
|
|
30195
30133
|
function applyBinaryOverrides(config) {
|
|
30196
|
-
for (const
|
|
30197
|
-
const key = `EDS_AGENT_BINARY_${
|
|
30198
|
-
const binary = config.agents[
|
|
30134
|
+
for (const name2 of AGENT_NAMES) {
|
|
30135
|
+
const key = `EDS_AGENT_BINARY_${name2.toUpperCase()}`;
|
|
30136
|
+
const binary = config.agents[name2].binary.trim();
|
|
30199
30137
|
if (binary) {
|
|
30200
30138
|
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
30201
30139
|
process.env[key] = binary;
|
|
@@ -30210,9 +30148,9 @@ function applyBinaryOverrides(config) {
|
|
|
30210
30148
|
|
|
30211
30149
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
30212
30150
|
import { jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
30213
|
-
var fields = (
|
|
30214
|
-
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[
|
|
30215
|
-
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(
|
|
30151
|
+
var fields = (name2) => [
|
|
30152
|
+
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[name2]}\` from the PATH)` },
|
|
30153
|
+
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name2)})` }
|
|
30216
30154
|
];
|
|
30217
30155
|
var INSPECT_DELAY_MS = 400;
|
|
30218
30156
|
function StatusHeading() {
|
|
@@ -30222,53 +30160,53 @@ function StatusHeading() {
|
|
|
30222
30160
|
] });
|
|
30223
30161
|
}
|
|
30224
30162
|
function AgentDetail({
|
|
30225
|
-
name,
|
|
30163
|
+
name: name2,
|
|
30226
30164
|
config,
|
|
30227
30165
|
setConfig,
|
|
30228
30166
|
onBack,
|
|
30229
30167
|
record: record3
|
|
30230
30168
|
}) {
|
|
30231
|
-
const settings = config.agents[
|
|
30169
|
+
const settings = config.agents[name2];
|
|
30232
30170
|
const [saving, setSaving] = useState33(false);
|
|
30233
30171
|
const [testing, setTesting] = useState33(false);
|
|
30234
30172
|
const [notice, setNotice] = useState33(null);
|
|
30235
30173
|
const [checks, setChecks] = useState33(void 0);
|
|
30236
|
-
|
|
30174
|
+
useEffect26(() => {
|
|
30237
30175
|
let active = true;
|
|
30238
30176
|
setChecks(void 0);
|
|
30239
30177
|
const timer = setTimeout(() => {
|
|
30240
|
-
void inspectAgent(
|
|
30178
|
+
void inspectAgent(name2, settings.binary).then((result) => active && setChecks(result));
|
|
30241
30179
|
}, INSPECT_DELAY_MS);
|
|
30242
30180
|
return () => {
|
|
30243
30181
|
active = false;
|
|
30244
30182
|
clearTimeout(timer);
|
|
30245
30183
|
};
|
|
30246
|
-
}, [
|
|
30184
|
+
}, [name2, settings.binary]);
|
|
30247
30185
|
const save = () => {
|
|
30248
30186
|
setSaving(true);
|
|
30249
30187
|
setNotice(null);
|
|
30250
30188
|
writeAgentConfig(config).then(() => {
|
|
30251
30189
|
applyBinaryOverrides(config);
|
|
30252
|
-
record3(`saved ${
|
|
30253
|
-
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[
|
|
30190
|
+
record3(`saved ${name2}`);
|
|
30191
|
+
setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[name2]} settings are written to config.json` });
|
|
30254
30192
|
}).catch((err) => {
|
|
30255
|
-
record3(`saving ${
|
|
30193
|
+
record3(`saving ${name2} failed`, err);
|
|
30256
30194
|
setNotice({ kind: "error", text: `Not saved: ${err instanceof Error ? err.message : String(err)}` });
|
|
30257
30195
|
}).finally(() => setSaving(false));
|
|
30258
30196
|
};
|
|
30259
30197
|
const runTest = () => {
|
|
30260
30198
|
setTesting(true);
|
|
30261
30199
|
setNotice(null);
|
|
30262
|
-
testAgent(
|
|
30200
|
+
testAgent(name2, settings.binary, settings.model).then((result) => {
|
|
30263
30201
|
setChecks(result);
|
|
30264
30202
|
const outcome = testOutcome(result);
|
|
30265
30203
|
if (!outcome || !outcome.ok)
|
|
30266
|
-
record3(`test of ${
|
|
30204
|
+
record3(`test of ${name2} failed: ${outcome?.text ?? "the agent could not be started"}`);
|
|
30267
30205
|
setNotice(
|
|
30268
30206
|
outcome ? { kind: outcome.ok ? "success" : "error", text: outcome.text } : { kind: "error", text: "Test not run: the agent could not be started (see Status)" }
|
|
30269
30207
|
);
|
|
30270
30208
|
}).catch((err) => {
|
|
30271
|
-
record3(`test of ${
|
|
30209
|
+
record3(`test of ${name2} could not run`, err);
|
|
30272
30210
|
setNotice({ kind: "error", text: `Test could not run: ${err instanceof Error ? err.message : String(err)}` });
|
|
30273
30211
|
}).finally(() => setTesting(false));
|
|
30274
30212
|
};
|
|
@@ -30279,19 +30217,19 @@ function AgentDetail({
|
|
|
30279
30217
|
hint: "run test",
|
|
30280
30218
|
onRun: runTest
|
|
30281
30219
|
};
|
|
30282
|
-
const formFields = fields(
|
|
30220
|
+
const formFields = fields(name2);
|
|
30283
30221
|
const labelWidth = formLabelWidth([...formFields, action]);
|
|
30284
30222
|
return /* @__PURE__ */ jsx60(
|
|
30285
30223
|
FieldForm,
|
|
30286
30224
|
{
|
|
30287
|
-
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[
|
|
30288
|
-
subtitle: config.defaultAgent ===
|
|
30225
|
+
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[name2]}`,
|
|
30226
|
+
subtitle: config.defaultAgent === name2 ? "This is the default agent." : `Runs the \`${AGENT_BINARIES[name2]}\` command.`,
|
|
30289
30227
|
fields: formFields,
|
|
30290
30228
|
values: { binary: settings.binary, model: settings.model },
|
|
30291
30229
|
onChange: (key, value) => {
|
|
30292
|
-
setConfig({ ...config, agents: { ...config.agents, [
|
|
30230
|
+
setConfig({ ...config, agents: { ...config.agents, [name2]: { ...settings, [key]: value } } });
|
|
30293
30231
|
setNotice(null);
|
|
30294
|
-
record3(`edited ${
|
|
30232
|
+
record3(`edited ${name2}.${key}`);
|
|
30295
30233
|
},
|
|
30296
30234
|
onSave: save,
|
|
30297
30235
|
onQuit: onBack,
|
|
@@ -30300,7 +30238,7 @@ function AgentDetail({
|
|
|
30300
30238
|
busy: saving || testing,
|
|
30301
30239
|
children: /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
30302
30240
|
/* @__PURE__ */ jsx60(StatusHeading, {}),
|
|
30303
|
-
statusRows(
|
|
30241
|
+
statusRows(name2, checks, settings.binary).map((row) => /* @__PURE__ */ jsx60(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx60(Text50, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
30304
30242
|
] })
|
|
30305
30243
|
}
|
|
30306
30244
|
);
|
|
@@ -30325,13 +30263,13 @@ function AgentsScreen({ onDone }) {
|
|
|
30325
30263
|
error: ""
|
|
30326
30264
|
}).current;
|
|
30327
30265
|
const inspectAll = (loaded) => {
|
|
30328
|
-
for (const
|
|
30329
|
-
void inspectAgent(
|
|
30330
|
-
(result) => setChecks((previous) => ({ ...previous, [
|
|
30266
|
+
for (const name2 of AGENT_NAMES) {
|
|
30267
|
+
void inspectAgent(name2, loaded.agents[name2].binary).then(
|
|
30268
|
+
(result) => setChecks((previous) => ({ ...previous, [name2]: result }))
|
|
30331
30269
|
);
|
|
30332
30270
|
}
|
|
30333
30271
|
};
|
|
30334
|
-
|
|
30272
|
+
useEffect27(() => {
|
|
30335
30273
|
readAgentConfig().then((loaded) => {
|
|
30336
30274
|
setConfig(loaded);
|
|
30337
30275
|
inspectAll(loaded);
|
|
@@ -30367,21 +30305,21 @@ function AgentsScreen({ onDone }) {
|
|
|
30367
30305
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
30368
30306
|
});
|
|
30369
30307
|
};
|
|
30370
|
-
const makeDefault = (
|
|
30308
|
+
const makeDefault = (name2) => {
|
|
30371
30309
|
if (!config || saving) return;
|
|
30372
|
-
if (
|
|
30373
|
-
setNotice({ kind: "success", text: `${AGENT_LABELS[
|
|
30310
|
+
if (name2 === config.defaultAgent) {
|
|
30311
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name2]} is already the default agent` });
|
|
30374
30312
|
return;
|
|
30375
30313
|
}
|
|
30376
30314
|
setSaving(true);
|
|
30377
30315
|
setNotice(null);
|
|
30378
|
-
writeAgentConfig({ ...config, defaultAgent:
|
|
30379
|
-
setConfig((current) => current ? { ...current, defaultAgent:
|
|
30380
|
-
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[
|
|
30381
|
-
visit.trail.record(`made ${
|
|
30316
|
+
writeAgentConfig({ ...config, defaultAgent: name2, defaultChosen: true }).then(() => {
|
|
30317
|
+
setConfig((current) => current ? { ...current, defaultAgent: name2, defaultChosen: true } : current);
|
|
30318
|
+
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name2]}` });
|
|
30319
|
+
visit.trail.record(`made ${name2} the default`);
|
|
30382
30320
|
}).catch((err) => {
|
|
30383
30321
|
visit.error = scrubError(err, []);
|
|
30384
|
-
visit.trail.record(`making ${
|
|
30322
|
+
visit.trail.record(`making ${name2} the default failed`);
|
|
30385
30323
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
30386
30324
|
}).finally(() => setSaving(false));
|
|
30387
30325
|
};
|
|
@@ -30468,14 +30406,14 @@ function AgentsScreen({ onDone }) {
|
|
|
30468
30406
|
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
30469
30407
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: "STATUS" })
|
|
30470
30408
|
] }),
|
|
30471
|
-
AGENT_NAMES.map((
|
|
30472
|
-
const isFocused = focusedAgent ===
|
|
30409
|
+
AGENT_NAMES.map((name2) => {
|
|
30410
|
+
const isFocused = focusedAgent === name2;
|
|
30473
30411
|
return /* @__PURE__ */ jsxs49(Box49, { gap: 1, children: [
|
|
30474
30412
|
/* @__PURE__ */ jsx61(Text51, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
30475
|
-
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children:
|
|
30476
|
-
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[
|
|
30477
|
-
/* @__PURE__ */ jsx61(AgentStatusBadge, { name, checks: checks[
|
|
30478
|
-
] },
|
|
30413
|
+
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.success, children: name2 === config.defaultAgent ? "\u2605" : " " }),
|
|
30414
|
+
/* @__PURE__ */ jsx61(Box49, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx61(Text51, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name2] }) }),
|
|
30415
|
+
/* @__PURE__ */ jsx61(AgentStatusBadge, { name: name2, checks: checks[name2], binary: config.agents[name2].binary })
|
|
30416
|
+
] }, name2);
|
|
30479
30417
|
}),
|
|
30480
30418
|
/* @__PURE__ */ jsxs49(Box49, { flexDirection: "column", marginTop: 1, children: [
|
|
30481
30419
|
/* @__PURE__ */ jsx61(Text51, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
@@ -30508,7 +30446,7 @@ function AgentsScreen({ onDone }) {
|
|
|
30508
30446
|
}
|
|
30509
30447
|
|
|
30510
30448
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
30511
|
-
import { useEffect as
|
|
30449
|
+
import { useEffect as useEffect28, useRef as useRef19, useState as useState35 } from "react";
|
|
30512
30450
|
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
30513
30451
|
init_debug_store();
|
|
30514
30452
|
|
|
@@ -30573,7 +30511,7 @@ function ProjectScreen({ onDone }) {
|
|
|
30573
30511
|
error: ""
|
|
30574
30512
|
}).current;
|
|
30575
30513
|
const scrub = (err) => scrubError(err, [config?.cmaToken ?? ""]);
|
|
30576
|
-
|
|
30514
|
+
useEffect28(() => {
|
|
30577
30515
|
readCredentials().then((cfg) => {
|
|
30578
30516
|
setConfig(cfg);
|
|
30579
30517
|
visit.before = snapshotOf(cfg);
|
|
@@ -30725,7 +30663,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
30725
30663
|
}
|
|
30726
30664
|
|
|
30727
30665
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
30728
|
-
import { useEffect as
|
|
30666
|
+
import { useEffect as useEffect29, useState as useState37 } from "react";
|
|
30729
30667
|
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
30730
30668
|
|
|
30731
30669
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
@@ -30749,7 +30687,7 @@ import { Fragment as Fragment20, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-
|
|
|
30749
30687
|
function OptInAnalyticsScreen({ onDone }) {
|
|
30750
30688
|
const [loading, setLoading] = useState37(true);
|
|
30751
30689
|
const [enabled, setEnabled] = useState37(true);
|
|
30752
|
-
|
|
30690
|
+
useEffect29(() => {
|
|
30753
30691
|
readAnalyticsSetting().then((setting) => {
|
|
30754
30692
|
setEnabled(setting.enabled);
|
|
30755
30693
|
setLoading(false);
|
|
@@ -30803,7 +30741,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
30803
30741
|
}
|
|
30804
30742
|
|
|
30805
30743
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
30806
|
-
import { useEffect as
|
|
30744
|
+
import { useEffect as useEffect30, useRef as useRef20, useState as useState38 } from "react";
|
|
30807
30745
|
import { Box as Box53, Text as Text55, useInput as useInput19 } from "ink";
|
|
30808
30746
|
init_debug_mode_store();
|
|
30809
30747
|
init_debug_store();
|
|
@@ -30821,7 +30759,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
30821
30759
|
);
|
|
30822
30760
|
const [notice, setNotice] = useState38(null);
|
|
30823
30761
|
const visit = useRef20({ trail: createTrail(), before: void 0, error: "" }).current;
|
|
30824
|
-
|
|
30762
|
+
useEffect30(() => {
|
|
30825
30763
|
readDebugModeSetting().then((loaded) => {
|
|
30826
30764
|
setSetting(loaded);
|
|
30827
30765
|
setPending(loaded.retentionDays);
|
|
@@ -30976,7 +30914,7 @@ function App({ importOptions, inkClear }) {
|
|
|
30976
30914
|
const [flowStart, setFlowStart] = useState39();
|
|
30977
30915
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
30978
30916
|
const [importDefaults, setImportDefaults] = useState39();
|
|
30979
|
-
|
|
30917
|
+
useEffect31(() => {
|
|
30980
30918
|
if (screen !== "import") {
|
|
30981
30919
|
setImportDefaults(void 0);
|
|
30982
30920
|
return;
|
|
@@ -31049,7 +30987,7 @@ function App({ importOptions, inkClear }) {
|
|
|
31049
30987
|
}
|
|
31050
30988
|
});
|
|
31051
30989
|
};
|
|
31052
|
-
|
|
30990
|
+
useEffect31(() => {
|
|
31053
30991
|
if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
|
|
31054
30992
|
const { credentialsSkipped, input, tokens } = tokensOnlyRun;
|
|
31055
30993
|
const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
|
|
@@ -31071,12 +31009,12 @@ function App({ importOptions, inkClear }) {
|
|
|
31071
31009
|
}
|
|
31072
31010
|
});
|
|
31073
31011
|
}, [tokensOnly, tokensOnlyRun]);
|
|
31074
|
-
|
|
31012
|
+
useEffect31(() => {
|
|
31075
31013
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
31076
31014
|
setExtractionRun(void 0);
|
|
31077
31015
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
31078
31016
|
}, [extraction, extractionRun]);
|
|
31079
|
-
|
|
31017
|
+
useEffect31(() => {
|
|
31080
31018
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
31081
31019
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
31082
31020
|
setGenerationInput({
|
|
@@ -31094,7 +31032,7 @@ function App({ importOptions, inkClear }) {
|
|
|
31094
31032
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
31095
31033
|
});
|
|
31096
31034
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
31097
|
-
|
|
31035
|
+
useEffect31(() => {
|
|
31098
31036
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
31099
31037
|
const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
31100
31038
|
inkClear();
|
|
@@ -31263,7 +31201,6 @@ function App({ importOptions, inkClear }) {
|
|
|
31263
31201
|
return /* @__PURE__ */ jsx66(
|
|
31264
31202
|
CredentialsScreen,
|
|
31265
31203
|
{
|
|
31266
|
-
mode: target,
|
|
31267
31204
|
initial: importDefaults.credentials,
|
|
31268
31205
|
tokensOnly: target === "tokens",
|
|
31269
31206
|
onBack: () => goBackFrom("credentials"),
|