@contentful/experience-design-system-cli 2.41.1-dev-build-ac8ef6b7.0 → 2.41.1-dev-build-c9e39919.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 +192 -60
- package/dist/index.js +205 -62
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/09-review/review-log.d.ts +31 -0
- package/dist/src/tui/import/steps/09-review/use-review-log.d.ts +20 -0
- package/dist/src/tui/import/steps/09-review/use-review-session.d.ts +3 -1
- package/dist/src/tui/import/steps/10-flow/flow/flow-log.d.ts +0 -2
- package/dist/src/tui/import/steps/10-flow/flow/use-flow-log.d.ts +2 -2
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -2499,7 +2499,7 @@ var init_cache_keys = __esm({
|
|
|
2499
2499
|
});
|
|
2500
2500
|
|
|
2501
2501
|
// packages/experience-design-system-cli/app.tsx
|
|
2502
|
-
import { useEffect as
|
|
2502
|
+
import { useEffect as useEffect36, useState as useState39 } from "react";
|
|
2503
2503
|
|
|
2504
2504
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2505
2505
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -17417,10 +17417,10 @@ async function readCandidateFiles(components, extraFiles = []) {
|
|
|
17417
17417
|
async function selectCompositionPromptFiles(components, sourceFiles) {
|
|
17418
17418
|
const allFiles = await readCandidateFiles(components, sourceFiles);
|
|
17419
17419
|
const selectedCandidates = selectCandidateFiles(allFiles).map((c2) => ({ path: c2.path, content: c2.content }));
|
|
17420
|
-
const
|
|
17421
|
-
const promptFiles =
|
|
17420
|
+
const capped3 = capCandidatesToPromptBudget(selectedCandidates);
|
|
17421
|
+
const promptFiles = capped3.kept;
|
|
17422
17422
|
const runtimeFiles = allFiles.map((c2) => ({ path: c2.path, content: c2.content }));
|
|
17423
|
-
const droppedWarning =
|
|
17423
|
+
const droppedWarning = capped3.dropped.length > 0 ? `composition \u2014 ${capped3.dropped.length} candidate file(s) omitted from the agent prompt to fit the context budget; resolution runs on the ${promptFiles.length} highest-value files.` : void 0;
|
|
17424
17424
|
return { promptFiles, runtimeFiles, droppedWarning };
|
|
17425
17425
|
}
|
|
17426
17426
|
|
|
@@ -22892,7 +22892,7 @@ function PreviewValidationErrorScreen({
|
|
|
22892
22892
|
}
|
|
22893
22893
|
|
|
22894
22894
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
22895
|
-
import { useCallback as useCallback5, useEffect as
|
|
22895
|
+
import { useCallback as useCallback5, useEffect as useEffect24, useMemo as useMemo6, useRef as useRef17, useState as useState26 } from "react";
|
|
22896
22896
|
import figures8 from "figures";
|
|
22897
22897
|
|
|
22898
22898
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
@@ -26144,7 +26144,13 @@ function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
|
26144
26144
|
}, [components, extractSessionId, selectedIdx]);
|
|
26145
26145
|
return { reviewMetadata, componentRationale };
|
|
26146
26146
|
}
|
|
26147
|
-
function useReviewHistory({
|
|
26147
|
+
function useReviewHistory({
|
|
26148
|
+
loading,
|
|
26149
|
+
components,
|
|
26150
|
+
createSnapshot,
|
|
26151
|
+
applySnapshot,
|
|
26152
|
+
onAction
|
|
26153
|
+
}) {
|
|
26148
26154
|
const historyRef = useRef13(null);
|
|
26149
26155
|
const historySeededRef = useRef13(false);
|
|
26150
26156
|
useEffect19(() => {
|
|
@@ -26155,14 +26161,19 @@ function useReviewHistory({ loading, components, createSnapshot, applySnapshot }
|
|
|
26155
26161
|
const pushHistorySnapshot = (entries, label) => {
|
|
26156
26162
|
if (!historyRef.current) return;
|
|
26157
26163
|
historyRef.current.push(createSnapshot(entries), label);
|
|
26164
|
+
onAction?.(label);
|
|
26158
26165
|
};
|
|
26159
26166
|
const handleUndo = () => {
|
|
26160
26167
|
const snapshot = historyRef.current?.undo();
|
|
26161
|
-
if (snapshot)
|
|
26168
|
+
if (!snapshot) return;
|
|
26169
|
+
applySnapshot(snapshot);
|
|
26170
|
+
onAction?.("undo");
|
|
26162
26171
|
};
|
|
26163
26172
|
const handleRedo = () => {
|
|
26164
26173
|
const snapshot = historyRef.current?.redo();
|
|
26165
|
-
if (snapshot)
|
|
26174
|
+
if (!snapshot) return;
|
|
26175
|
+
applySnapshot(snapshot);
|
|
26176
|
+
onAction?.("redo");
|
|
26166
26177
|
};
|
|
26167
26178
|
const resetHistory = (snapshot) => {
|
|
26168
26179
|
historyRef.current?.reset(snapshot);
|
|
@@ -26845,6 +26856,117 @@ function useReviewPreview({
|
|
|
26845
26856
|
return { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner };
|
|
26846
26857
|
}
|
|
26847
26858
|
|
|
26859
|
+
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-log.ts
|
|
26860
|
+
init_debug_store();
|
|
26861
|
+
import { useEffect as useEffect23, useRef as useRef16 } from "react";
|
|
26862
|
+
|
|
26863
|
+
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-log.ts
|
|
26864
|
+
var REVIEW_RUN = { flow: "import/review", step: "09-review", menuOption: "Review" };
|
|
26865
|
+
var MAX_ACTIONS = 30;
|
|
26866
|
+
var MAX_NAMES2 = 20;
|
|
26867
|
+
var countStatuses = (components) => {
|
|
26868
|
+
const counts = {};
|
|
26869
|
+
for (const { status } of components) counts[status] = (counts[status] ?? 0) + 1;
|
|
26870
|
+
return counts;
|
|
26871
|
+
};
|
|
26872
|
+
var capped2 = (keys) => ({
|
|
26873
|
+
count: keys.length,
|
|
26874
|
+
keys: keys.slice(0, MAX_NAMES2)
|
|
26875
|
+
});
|
|
26876
|
+
function reviewInputs(components) {
|
|
26877
|
+
return { components: components.length, by_status: countStatuses(components) };
|
|
26878
|
+
}
|
|
26879
|
+
function openReviewTrail(components, now) {
|
|
26880
|
+
return {
|
|
26881
|
+
startedAt: now,
|
|
26882
|
+
start: new Map(components.map((component) => [component.key, component.status])),
|
|
26883
|
+
actions: [],
|
|
26884
|
+
kinds: {}
|
|
26885
|
+
};
|
|
26886
|
+
}
|
|
26887
|
+
function recordReviewAction(trail, label) {
|
|
26888
|
+
const kind = label.split(":")[0] ?? label;
|
|
26889
|
+
trail.kinds[kind] = (trail.kinds[kind] ?? 0) + 1;
|
|
26890
|
+
if (trail.actions.length < MAX_ACTIONS) trail.actions.push(label);
|
|
26891
|
+
}
|
|
26892
|
+
function render(trail, components, now, outcome) {
|
|
26893
|
+
const acceptedByUser = [];
|
|
26894
|
+
const rejectedByUser = [];
|
|
26895
|
+
for (const { key, status } of components) {
|
|
26896
|
+
const was = trail.start.get(key);
|
|
26897
|
+
if (was === status) continue;
|
|
26898
|
+
if (status === "accepted") acceptedByUser.push(key);
|
|
26899
|
+
if (status === "rejected") rejectedByUser.push(key);
|
|
26900
|
+
}
|
|
26901
|
+
const total = Object.values(trail.kinds).reduce((sum, count) => sum + count, 0);
|
|
26902
|
+
return {
|
|
26903
|
+
outcome,
|
|
26904
|
+
seconds: Math.round((now - trail.startedAt) / 100) / 10,
|
|
26905
|
+
edits: { total, by_kind: trail.kinds, in_order: trail.actions },
|
|
26906
|
+
now: countStatuses(components),
|
|
26907
|
+
accepted_by_user: capped2(acceptedByUser),
|
|
26908
|
+
rejected_by_user: capped2(rejectedByUser)
|
|
26909
|
+
};
|
|
26910
|
+
}
|
|
26911
|
+
function reviewProgress(trail, components, now) {
|
|
26912
|
+
return render(trail, components, now, "interrupted");
|
|
26913
|
+
}
|
|
26914
|
+
function reviewFinish(trail, components, now, final) {
|
|
26915
|
+
const outcome = final ? `finalized: ${final.accepted} accepted, ${final.rejected} rejected, ${final.unresolved} unresolved` : "left the review without finishing";
|
|
26916
|
+
return {
|
|
26917
|
+
outputs: render(trail, components, now, outcome),
|
|
26918
|
+
status: "success",
|
|
26919
|
+
exitMethod: final ? "saved" : "discarded"
|
|
26920
|
+
};
|
|
26921
|
+
}
|
|
26922
|
+
|
|
26923
|
+
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-log.ts
|
|
26924
|
+
function useReviewLog({
|
|
26925
|
+
loading,
|
|
26926
|
+
loadError,
|
|
26927
|
+
components
|
|
26928
|
+
}) {
|
|
26929
|
+
const trail = useRef16(void 0);
|
|
26930
|
+
const started = useRef16(false);
|
|
26931
|
+
const latest = useRef16(components);
|
|
26932
|
+
latest.current = components;
|
|
26933
|
+
useEffect23(() => {
|
|
26934
|
+
if (loading || started.current) return;
|
|
26935
|
+
started.current = true;
|
|
26936
|
+
startDebugRun({ ...REVIEW_RUN, inputs: reviewInputs(components) });
|
|
26937
|
+
if (loadError) {
|
|
26938
|
+
void finishDebugRun({
|
|
26939
|
+
outputs: { outcome: "could not load the components", error: loadError },
|
|
26940
|
+
status: "error",
|
|
26941
|
+
exitMethod: "discarded"
|
|
26942
|
+
});
|
|
26943
|
+
return;
|
|
26944
|
+
}
|
|
26945
|
+
trail.current = openReviewTrail(components, Date.now());
|
|
26946
|
+
setDebugRunProgress(reviewProgress(trail.current, components, Date.now()));
|
|
26947
|
+
}, [loading, loadError, components]);
|
|
26948
|
+
useEffect23(
|
|
26949
|
+
() => () => {
|
|
26950
|
+
const open = trail.current;
|
|
26951
|
+
trail.current = void 0;
|
|
26952
|
+
if (open) void finishDebugRun(reviewFinish(open, latest.current, Date.now(), void 0));
|
|
26953
|
+
},
|
|
26954
|
+
[]
|
|
26955
|
+
);
|
|
26956
|
+
return {
|
|
26957
|
+
record: (label) => {
|
|
26958
|
+
if (!trail.current) return;
|
|
26959
|
+
recordReviewAction(trail.current, label);
|
|
26960
|
+
setDebugRunProgress(reviewProgress(trail.current, latest.current, Date.now()));
|
|
26961
|
+
},
|
|
26962
|
+
finish: (counts) => {
|
|
26963
|
+
const open = trail.current;
|
|
26964
|
+
trail.current = void 0;
|
|
26965
|
+
if (open) void finishDebugRun(reviewFinish(open, latest.current, Date.now(), counts));
|
|
26966
|
+
}
|
|
26967
|
+
};
|
|
26968
|
+
}
|
|
26969
|
+
|
|
26848
26970
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx
|
|
26849
26971
|
import { Box as Box37, Text as Text39 } from "ink";
|
|
26850
26972
|
import { jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
@@ -27132,6 +27254,7 @@ function GenerateReviewStepView({
|
|
|
27132
27254
|
tokensPath,
|
|
27133
27255
|
onExtraLoaded: setLoadedSlotCycles
|
|
27134
27256
|
});
|
|
27257
|
+
const reviewLog = useReviewLog({ loading, loadError, components });
|
|
27135
27258
|
const [nav, setNav] = useState26({
|
|
27136
27259
|
cursorRowIdx: 0,
|
|
27137
27260
|
sidebarScrollOffset: 0
|
|
@@ -27149,7 +27272,7 @@ function GenerateReviewStepView({
|
|
|
27149
27272
|
setFinalizeError
|
|
27150
27273
|
} = reviewSurface;
|
|
27151
27274
|
const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState26(false);
|
|
27152
|
-
const removedBannerDefaultedRef =
|
|
27275
|
+
const removedBannerDefaultedRef = useRef17(false);
|
|
27153
27276
|
const [cyclePanelScroll, setCyclePanelScroll] = useState26(0);
|
|
27154
27277
|
const [cyclesCursor, setCyclesCursor] = useState26(0);
|
|
27155
27278
|
const cyclePanel = useOverlayPanel({
|
|
@@ -27169,7 +27292,7 @@ function GenerateReviewStepView({
|
|
|
27169
27292
|
const [breakCursor, setBreakCursor] = useState26(0);
|
|
27170
27293
|
const [breakConfirm, setBreakConfirm] = useState26(false);
|
|
27171
27294
|
const [expandedGroups, setExpandedGroups] = useState26(/* @__PURE__ */ new Set());
|
|
27172
|
-
const seededGroupsRef =
|
|
27295
|
+
const seededGroupsRef = useRef17(false);
|
|
27173
27296
|
const {
|
|
27174
27297
|
searchOpen,
|
|
27175
27298
|
setSearchOpen,
|
|
@@ -27193,7 +27316,7 @@ function GenerateReviewStepView({
|
|
|
27193
27316
|
const [pendingEditorFocus, setPendingEditorFocus] = useState26(null);
|
|
27194
27317
|
const [autoRejected, setAutoRejected] = useState26([]);
|
|
27195
27318
|
const [undoSnapshot, setUndoSnapshot] = useState26(null);
|
|
27196
|
-
const autoRejectFiredRef =
|
|
27319
|
+
const autoRejectFiredRef = useRef17(false);
|
|
27197
27320
|
const [showReloadDialog, setShowReloadDialog] = useState26(false);
|
|
27198
27321
|
const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
|
|
27199
27322
|
const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
|
|
@@ -27225,7 +27348,10 @@ function GenerateReviewStepView({
|
|
|
27225
27348
|
cmaToken,
|
|
27226
27349
|
host,
|
|
27227
27350
|
components,
|
|
27228
|
-
onFinalize
|
|
27351
|
+
onFinalize: (accepted, rejected, unresolved) => {
|
|
27352
|
+
reviewLog.finish({ accepted, rejected, unresolved });
|
|
27353
|
+
onFinalize(accepted, rejected, unresolved);
|
|
27354
|
+
}
|
|
27229
27355
|
});
|
|
27230
27356
|
const recomputeCycles = (currentComponents) => {
|
|
27231
27357
|
try {
|
|
@@ -27256,7 +27382,7 @@ function GenerateReviewStepView({
|
|
|
27256
27382
|
[components]
|
|
27257
27383
|
);
|
|
27258
27384
|
const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
27259
|
-
|
|
27385
|
+
useEffect24(() => {
|
|
27260
27386
|
if (seededGroupsRef.current) return;
|
|
27261
27387
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
27262
27388
|
seededGroupsRef.current = true;
|
|
@@ -27283,7 +27409,7 @@ function GenerateReviewStepView({
|
|
|
27283
27409
|
suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
|
|
27284
27410
|
}));
|
|
27285
27411
|
}, [slotCycles, cycleView]);
|
|
27286
|
-
|
|
27412
|
+
useEffect24(() => {
|
|
27287
27413
|
const decision = computeAutoRejectDecision({
|
|
27288
27414
|
loading,
|
|
27289
27415
|
autoRejectFired: autoRejectFiredRef.current,
|
|
@@ -27324,10 +27450,11 @@ function GenerateReviewStepView({
|
|
|
27324
27450
|
autoRejected,
|
|
27325
27451
|
undoSnapshot
|
|
27326
27452
|
}),
|
|
27327
|
-
applySnapshot: applyHistorySnapshot
|
|
27453
|
+
applySnapshot: applyHistorySnapshot,
|
|
27454
|
+
onAction: reviewLog.record
|
|
27328
27455
|
});
|
|
27329
|
-
const autoRejectPushedRef =
|
|
27330
|
-
|
|
27456
|
+
const autoRejectPushedRef = useRef17(false);
|
|
27457
|
+
useEffect24(() => {
|
|
27331
27458
|
if (loading) return;
|
|
27332
27459
|
if (!historySeededRef.current) return;
|
|
27333
27460
|
if (!autoRejectFiredRef.current) return;
|
|
@@ -27411,7 +27538,7 @@ function GenerateReviewStepView({
|
|
|
27411
27538
|
const panelHeight = leftPanelHeight + 2;
|
|
27412
27539
|
const panelContentHeight = Math.max(1, panelHeight - 3);
|
|
27413
27540
|
const cycleViewportHeight = Math.max(1, panelHeight - 4);
|
|
27414
|
-
|
|
27541
|
+
useEffect24(() => {
|
|
27415
27542
|
if (selectableRowPositions.length === 0) return;
|
|
27416
27543
|
const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
|
|
27417
27544
|
const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
|
|
@@ -28356,10 +28483,10 @@ function normalizePath(input) {
|
|
|
28356
28483
|
}
|
|
28357
28484
|
|
|
28358
28485
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
|
|
28359
|
-
import { useEffect as
|
|
28486
|
+
import { useEffect as useEffect25, useState as useState27 } from "react";
|
|
28360
28487
|
function useBlinkingCursor() {
|
|
28361
28488
|
const [visible, setVisible] = useState27(true);
|
|
28362
|
-
|
|
28489
|
+
useEffect25(() => {
|
|
28363
28490
|
const interval = setInterval(() => setVisible((current) => !current), 500);
|
|
28364
28491
|
return () => clearInterval(interval);
|
|
28365
28492
|
}, []);
|
|
@@ -28475,12 +28602,12 @@ function countedThings({ components, tokens }, counts = {}) {
|
|
|
28475
28602
|
}
|
|
28476
28603
|
|
|
28477
28604
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
28478
|
-
import { useEffect as
|
|
28605
|
+
import { useEffect as useEffect26, useState as useState29 } from "react";
|
|
28479
28606
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
28480
28607
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
28481
28608
|
function useTimedSpinner() {
|
|
28482
28609
|
const [elapsedSeconds, setElapsedSeconds] = useState29(0);
|
|
28483
|
-
|
|
28610
|
+
useEffect26(() => {
|
|
28484
28611
|
const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
|
|
28485
28612
|
return () => {
|
|
28486
28613
|
clearInterval(timer);
|
|
@@ -28538,7 +28665,7 @@ function PushingStep({ progress, produced, counts }) {
|
|
|
28538
28665
|
}
|
|
28539
28666
|
|
|
28540
28667
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
28541
|
-
import { useEffect as
|
|
28668
|
+
import { useEffect as useEffect27, useState as useState30, useMemo as useMemo7 } from "react";
|
|
28542
28669
|
import { Box as Box44, Text as Text46 } from "ink";
|
|
28543
28670
|
|
|
28544
28671
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/preview-diff.ts
|
|
@@ -28933,7 +29060,7 @@ function WizardPreviewStep({
|
|
|
28933
29060
|
const activeLines = diffExpanded ? diffLines : summaryLines;
|
|
28934
29061
|
const maxScroll = Math.max(0, activeLines.length - viewportHeight);
|
|
28935
29062
|
const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
|
|
28936
|
-
|
|
29063
|
+
useEffect27(() => {
|
|
28937
29064
|
setScrollOffset((previous) => Math.min(previous, maxScroll));
|
|
28938
29065
|
}, [maxScroll]);
|
|
28939
29066
|
useImmediateInput((input, key) => {
|
|
@@ -29025,7 +29152,7 @@ function buildRunTeaserLine(runId) {
|
|
|
29025
29152
|
|
|
29026
29153
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow-log.ts
|
|
29027
29154
|
init_debug_store();
|
|
29028
|
-
import { useEffect as
|
|
29155
|
+
import { useEffect as useEffect28, useRef as useRef18 } from "react";
|
|
29029
29156
|
|
|
29030
29157
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/flow-log.ts
|
|
29031
29158
|
var FLOW_RUN = { flow: "import/publish", step: "10-publish", menuOption: "Publish" };
|
|
@@ -29042,7 +29169,7 @@ var LABELS = {
|
|
|
29042
29169
|
"preview-validation-error": "Preview validation"
|
|
29043
29170
|
};
|
|
29044
29171
|
var WORK = ["printing", "previewing", "pushing"];
|
|
29045
|
-
var FINISHED = ["done", "error", "preview-validation-error"];
|
|
29172
|
+
var FINISHED = ["done", "error", "preview-validation-error", "final-review"];
|
|
29046
29173
|
var MAX_LOGGED = 10;
|
|
29047
29174
|
var MAX_OUTCOME = 200;
|
|
29048
29175
|
var scrub = (text, state2) => scrubError(text, [state2.cmaToken]);
|
|
@@ -29110,7 +29237,7 @@ function arrive(trail, state2) {
|
|
|
29110
29237
|
return next;
|
|
29111
29238
|
}
|
|
29112
29239
|
function openTrail(state2, now) {
|
|
29113
|
-
return arrive({ startedAt: now, stageStartedAt: now, at: state2.step, stages: []
|
|
29240
|
+
return arrive({ startedAt: now, stageStartedAt: now, at: state2.step, stages: [] }, state2);
|
|
29114
29241
|
}
|
|
29115
29242
|
function advance(trail, from, to, now) {
|
|
29116
29243
|
const next = { ...trail, stages: [...trail.stages], stageStartedAt: now };
|
|
@@ -29124,17 +29251,15 @@ function advance(trail, from, to, now) {
|
|
|
29124
29251
|
next.pushFailed = pushHasFailures(to.pushResult);
|
|
29125
29252
|
}
|
|
29126
29253
|
if (from.step === "printing" && !failed) next.saved = { path: to.componentsPath, run_id: to.lastRunId };
|
|
29127
|
-
if (from.step === "preview-gate" && to.step === "final-review") next.edits += 1;
|
|
29128
29254
|
return arrive(next, to);
|
|
29129
29255
|
}
|
|
29130
29256
|
var isFlowFinished = (step) => FINISHED.includes(step);
|
|
29131
|
-
function
|
|
29257
|
+
function render2(trail, now, outcome) {
|
|
29132
29258
|
return {
|
|
29133
29259
|
outcome,
|
|
29134
29260
|
total_seconds: seconds(now - trail.startedAt),
|
|
29135
29261
|
stages: trail.stages,
|
|
29136
29262
|
...trail.preview ? { preview: trail.preview } : {},
|
|
29137
|
-
...trail.edits > 0 ? { edited_definitions_after_preview: trail.edits } : {},
|
|
29138
29263
|
...trail.push ? { push: trail.push } : {},
|
|
29139
29264
|
...trail.saved ? { saved: trail.saved } : {},
|
|
29140
29265
|
...trail.failure ? { error: trail.failure } : {},
|
|
@@ -29142,13 +29267,20 @@ function render(trail, now, outcome) {
|
|
|
29142
29267
|
};
|
|
29143
29268
|
}
|
|
29144
29269
|
function flowProgress(trail, now) {
|
|
29145
|
-
return
|
|
29270
|
+
return render2(trail, now, `interrupted at ${LABELS[trail.at]}`);
|
|
29146
29271
|
}
|
|
29147
29272
|
function flowFinish(trail, final, now) {
|
|
29148
29273
|
if (!final) {
|
|
29149
29274
|
const midWork = WORK.includes(trail.at);
|
|
29150
29275
|
const outcome2 = `left the import ${midWork ? "while" : "at"} ${LABELS[trail.at]}${midWork ? " was running" : ""}`;
|
|
29151
|
-
return { outputs:
|
|
29276
|
+
return { outputs: render2(trail, now, outcome2), status: midWork ? "error" : "success", exitMethod: "discarded" };
|
|
29277
|
+
}
|
|
29278
|
+
if (final.step === "final-review") {
|
|
29279
|
+
return {
|
|
29280
|
+
outputs: render2(trail, now, "went back to edit the definitions"),
|
|
29281
|
+
status: "success",
|
|
29282
|
+
exitMethod: "discarded"
|
|
29283
|
+
};
|
|
29152
29284
|
}
|
|
29153
29285
|
let outcome;
|
|
29154
29286
|
let failed = true;
|
|
@@ -29163,7 +29295,7 @@ function flowFinish(trail, final, now) {
|
|
|
29163
29295
|
outcome = final.credentialsSkipped ? "saved without pushing (credentials skipped)" : "published";
|
|
29164
29296
|
}
|
|
29165
29297
|
return {
|
|
29166
|
-
outputs:
|
|
29298
|
+
outputs: render2(trail, now, outcome),
|
|
29167
29299
|
status: failed ? "error" : "success",
|
|
29168
29300
|
exitMethod: failed ? "discarded" : "saved"
|
|
29169
29301
|
};
|
|
@@ -29171,9 +29303,9 @@ function flowFinish(trail, final, now) {
|
|
|
29171
29303
|
|
|
29172
29304
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow-log.ts
|
|
29173
29305
|
function useFlowLog(state2) {
|
|
29174
|
-
const trail =
|
|
29175
|
-
const previous =
|
|
29176
|
-
|
|
29306
|
+
const trail = useRef18(void 0);
|
|
29307
|
+
const previous = useRef18(void 0);
|
|
29308
|
+
useEffect28(() => {
|
|
29177
29309
|
const before = previous.current;
|
|
29178
29310
|
previous.current = state2;
|
|
29179
29311
|
const moved = before !== void 0 && before.step !== state2.step;
|
|
@@ -29196,7 +29328,7 @@ function useFlowLog(state2) {
|
|
|
29196
29328
|
trail.current = open;
|
|
29197
29329
|
setDebugRunProgress(flowProgress(open, now));
|
|
29198
29330
|
}, [state2]);
|
|
29199
|
-
|
|
29331
|
+
useEffect28(
|
|
29200
29332
|
() => () => {
|
|
29201
29333
|
const open = trail.current;
|
|
29202
29334
|
trail.current = void 0;
|
|
@@ -29335,7 +29467,7 @@ function FlowScreen({
|
|
|
29335
29467
|
}
|
|
29336
29468
|
|
|
29337
29469
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
29338
|
-
import { useEffect as
|
|
29470
|
+
import { useEffect as useEffect29, useRef as useRef19, useSyncExternalStore } from "react";
|
|
29339
29471
|
|
|
29340
29472
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
|
|
29341
29473
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
@@ -30077,7 +30209,7 @@ function createFlowController(start, deps) {
|
|
|
30077
30209
|
|
|
30078
30210
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
30079
30211
|
function useFlow(start, options = {}) {
|
|
30080
|
-
const controller =
|
|
30212
|
+
const controller = useRef19();
|
|
30081
30213
|
if (start && !controller.current) {
|
|
30082
30214
|
try {
|
|
30083
30215
|
startWizardLog();
|
|
@@ -30094,14 +30226,14 @@ function useFlow(start, options = {}) {
|
|
|
30094
30226
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
30095
30227
|
() => current?.getState()
|
|
30096
30228
|
);
|
|
30097
|
-
|
|
30229
|
+
useEffect29(() => {
|
|
30098
30230
|
if (!start) controller.current = void 0;
|
|
30099
30231
|
}, [start]);
|
|
30100
30232
|
return current && state2 ? { controller: current, state: state2 } : void 0;
|
|
30101
30233
|
}
|
|
30102
30234
|
|
|
30103
30235
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
30104
|
-
import { useEffect as
|
|
30236
|
+
import { useEffect as useEffect30, useState as useState31 } from "react";
|
|
30105
30237
|
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
30106
30238
|
init_debug_store();
|
|
30107
30239
|
|
|
@@ -30175,7 +30307,7 @@ function Section({ title, rows }) {
|
|
|
30175
30307
|
}
|
|
30176
30308
|
function HelpScreen({ onDone }) {
|
|
30177
30309
|
const [info, setInfo] = useState31();
|
|
30178
|
-
|
|
30310
|
+
useEffect30(() => {
|
|
30179
30311
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
30180
30312
|
void readHelpInfo().then(setInfo);
|
|
30181
30313
|
}, []);
|
|
@@ -30272,7 +30404,7 @@ import { useState as useState36 } from "react";
|
|
|
30272
30404
|
import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
|
|
30273
30405
|
|
|
30274
30406
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
30275
|
-
import { useEffect as
|
|
30407
|
+
import { useEffect as useEffect32, useRef as useRef20, useState as useState34 } from "react";
|
|
30276
30408
|
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
30277
30409
|
init_debug_store();
|
|
30278
30410
|
|
|
@@ -30568,7 +30700,7 @@ async function writeAgentConfig(config) {
|
|
|
30568
30700
|
}
|
|
30569
30701
|
|
|
30570
30702
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
30571
|
-
import { useEffect as
|
|
30703
|
+
import { useEffect as useEffect31, useState as useState33 } from "react";
|
|
30572
30704
|
import { Box as Box48, Text as Text50 } from "ink";
|
|
30573
30705
|
|
|
30574
30706
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentStatusBadge.tsx
|
|
@@ -30631,7 +30763,7 @@ function AgentDetail({
|
|
|
30631
30763
|
const [testing, setTesting] = useState33(false);
|
|
30632
30764
|
const [notice, setNotice] = useState33(null);
|
|
30633
30765
|
const [checks, setChecks] = useState33(void 0);
|
|
30634
|
-
|
|
30766
|
+
useEffect31(() => {
|
|
30635
30767
|
let active = true;
|
|
30636
30768
|
setChecks(void 0);
|
|
30637
30769
|
const timer = setTimeout(() => {
|
|
@@ -30716,7 +30848,7 @@ function AgentsScreen({ onDone }) {
|
|
|
30716
30848
|
const [saving, setSaving] = useState34(false);
|
|
30717
30849
|
const [loadError, setLoadError] = useState34(null);
|
|
30718
30850
|
const [checks, setChecks] = useState34({});
|
|
30719
|
-
const visit =
|
|
30851
|
+
const visit = useRef20({
|
|
30720
30852
|
trail: createTrail(),
|
|
30721
30853
|
before: void 0,
|
|
30722
30854
|
environment: void 0,
|
|
@@ -30729,7 +30861,7 @@ function AgentsScreen({ onDone }) {
|
|
|
30729
30861
|
);
|
|
30730
30862
|
}
|
|
30731
30863
|
};
|
|
30732
|
-
|
|
30864
|
+
useEffect32(() => {
|
|
30733
30865
|
readAgentConfig().then((loaded) => {
|
|
30734
30866
|
setConfig(loaded);
|
|
30735
30867
|
inspectAll(loaded);
|
|
@@ -30906,7 +31038,7 @@ function AgentsScreen({ onDone }) {
|
|
|
30906
31038
|
}
|
|
30907
31039
|
|
|
30908
31040
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
30909
|
-
import { useEffect as
|
|
31041
|
+
import { useEffect as useEffect33, useRef as useRef21, useState as useState35 } from "react";
|
|
30910
31042
|
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
30911
31043
|
init_debug_store();
|
|
30912
31044
|
|
|
@@ -30964,14 +31096,14 @@ function ProjectScreen({ onDone }) {
|
|
|
30964
31096
|
const [saving, setSaving] = useState35(false);
|
|
30965
31097
|
const [notice, setNotice] = useState35(null);
|
|
30966
31098
|
const [loadError, setLoadError] = useState35(null);
|
|
30967
|
-
const visit =
|
|
31099
|
+
const visit = useRef21({
|
|
30968
31100
|
trail: createTrail(),
|
|
30969
31101
|
before: void 0,
|
|
30970
31102
|
persisted: void 0,
|
|
30971
31103
|
error: ""
|
|
30972
31104
|
}).current;
|
|
30973
31105
|
const scrub2 = (err) => scrubError(err, [config?.cmaToken ?? ""]);
|
|
30974
|
-
|
|
31106
|
+
useEffect33(() => {
|
|
30975
31107
|
readCredentials().then((cfg) => {
|
|
30976
31108
|
setConfig(cfg);
|
|
30977
31109
|
visit.before = snapshotOf(cfg);
|
|
@@ -31123,7 +31255,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
31123
31255
|
}
|
|
31124
31256
|
|
|
31125
31257
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
31126
|
-
import { useEffect as
|
|
31258
|
+
import { useEffect as useEffect34, useState as useState37 } from "react";
|
|
31127
31259
|
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
31128
31260
|
|
|
31129
31261
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
@@ -31147,7 +31279,7 @@ import { Fragment as Fragment20, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-
|
|
|
31147
31279
|
function OptInAnalyticsScreen({ onDone }) {
|
|
31148
31280
|
const [loading, setLoading] = useState37(true);
|
|
31149
31281
|
const [enabled, setEnabled] = useState37(true);
|
|
31150
|
-
|
|
31282
|
+
useEffect34(() => {
|
|
31151
31283
|
readAnalyticsSetting().then((setting) => {
|
|
31152
31284
|
setEnabled(setting.enabled);
|
|
31153
31285
|
setLoading(false);
|
|
@@ -31201,7 +31333,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
31201
31333
|
}
|
|
31202
31334
|
|
|
31203
31335
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
31204
|
-
import { useEffect as
|
|
31336
|
+
import { useEffect as useEffect35, useRef as useRef22, useState as useState38 } from "react";
|
|
31205
31337
|
import { Box as Box53, Text as Text55, useInput as useInput19 } from "ink";
|
|
31206
31338
|
init_debug_mode_store();
|
|
31207
31339
|
init_debug_store();
|
|
@@ -31218,8 +31350,8 @@ function DebugModeScreen({ onDone }) {
|
|
|
31218
31350
|
RETENTION_CHOICES[RETENTION_CHOICES.length - 1]
|
|
31219
31351
|
);
|
|
31220
31352
|
const [notice, setNotice] = useState38(null);
|
|
31221
|
-
const visit =
|
|
31222
|
-
|
|
31353
|
+
const visit = useRef22({ trail: createTrail(), before: void 0, error: "" }).current;
|
|
31354
|
+
useEffect35(() => {
|
|
31223
31355
|
readDebugModeSetting().then((loaded) => {
|
|
31224
31356
|
setSetting(loaded);
|
|
31225
31357
|
setPending(loaded.retentionDays);
|
|
@@ -31374,7 +31506,7 @@ function App({ importOptions, inkClear }) {
|
|
|
31374
31506
|
const [flowStart, setFlowStart] = useState39();
|
|
31375
31507
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
31376
31508
|
const [importDefaults, setImportDefaults] = useState39();
|
|
31377
|
-
|
|
31509
|
+
useEffect36(() => {
|
|
31378
31510
|
if (screen !== "import") {
|
|
31379
31511
|
setImportDefaults(void 0);
|
|
31380
31512
|
return;
|
|
@@ -31447,7 +31579,7 @@ function App({ importOptions, inkClear }) {
|
|
|
31447
31579
|
}
|
|
31448
31580
|
});
|
|
31449
31581
|
};
|
|
31450
|
-
|
|
31582
|
+
useEffect36(() => {
|
|
31451
31583
|
if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
|
|
31452
31584
|
const { credentialsSkipped, input, tokens } = tokensOnlyRun;
|
|
31453
31585
|
const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
|
|
@@ -31469,12 +31601,12 @@ function App({ importOptions, inkClear }) {
|
|
|
31469
31601
|
}
|
|
31470
31602
|
});
|
|
31471
31603
|
}, [tokensOnly, tokensOnlyRun]);
|
|
31472
|
-
|
|
31604
|
+
useEffect36(() => {
|
|
31473
31605
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
31474
31606
|
setExtractionRun(void 0);
|
|
31475
31607
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
31476
31608
|
}, [extraction, extractionRun]);
|
|
31477
|
-
|
|
31609
|
+
useEffect36(() => {
|
|
31478
31610
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
31479
31611
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
31480
31612
|
setGenerationInput({
|
|
@@ -31492,7 +31624,7 @@ function App({ importOptions, inkClear }) {
|
|
|
31492
31624
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
31493
31625
|
});
|
|
31494
31626
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
31495
|
-
|
|
31627
|
+
useEffect36(() => {
|
|
31496
31628
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
31497
31629
|
const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
31498
31630
|
inkClear();
|