@algolia/wizard 0.50.0 → 0.51.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/main.js +289 -243
- package/package.json +1 -2
package/dist/main.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { render } from "ink";
|
|
5
5
|
|
|
6
6
|
// src/ui/App.tsx
|
|
7
|
-
import { Box as Box20, Text as
|
|
7
|
+
import { Box as Box20, Text as Text21, useApp, useInput as useInput8, useWindowSize as useWindowSize7 } from "ink";
|
|
8
8
|
import Spinner3 from "ink-spinner";
|
|
9
9
|
|
|
10
10
|
// src/core/store.ts
|
|
@@ -641,10 +641,9 @@ function Notices({
|
|
|
641
641
|
}
|
|
642
642
|
|
|
643
643
|
// src/ui/PromptInput.tsx
|
|
644
|
-
import { Box as Box9, Text as
|
|
644
|
+
import { Box as Box9, Text as Text10 } from "ink";
|
|
645
645
|
import Spinner from "ink-spinner";
|
|
646
|
-
import
|
|
647
|
-
import { useState as useState6 } from "react";
|
|
646
|
+
import { useState as useState7 } from "react";
|
|
648
647
|
|
|
649
648
|
// src/ui/CommandApproval.tsx
|
|
650
649
|
import { Box as Box6, Text as Text6 } from "ink";
|
|
@@ -783,14 +782,62 @@ function CommandApproval({
|
|
|
783
782
|
] });
|
|
784
783
|
}
|
|
785
784
|
|
|
785
|
+
// src/ui/FreeTextInput.tsx
|
|
786
|
+
import { Text as Text7, useInput as useInput2 } from "ink";
|
|
787
|
+
import { useState as useState4 } from "react";
|
|
788
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
789
|
+
function FreeTextInput({
|
|
790
|
+
value,
|
|
791
|
+
onChange,
|
|
792
|
+
onSubmit
|
|
793
|
+
}) {
|
|
794
|
+
const [cursor, setCursor] = useState4(value.length);
|
|
795
|
+
const at = Math.min(cursor, value.length);
|
|
796
|
+
useInput2((input, key) => {
|
|
797
|
+
if (key.upArrow || key.downArrow || key.tab || key.ctrl && input === "c") {
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
if (key.return) {
|
|
801
|
+
onSubmit(value);
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
if (key.leftArrow) {
|
|
805
|
+
setCursor(Math.max(0, at - 1));
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
if (key.rightArrow) {
|
|
809
|
+
setCursor(Math.min(value.length, at + 1));
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
if (key.backspace || key.delete) {
|
|
813
|
+
if (at === 0) return;
|
|
814
|
+
onChange(value.slice(0, at - 1) + value.slice(at));
|
|
815
|
+
setCursor(at - 1);
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
if (input) {
|
|
819
|
+
onChange(value.slice(0, at) + input + value.slice(at));
|
|
820
|
+
setCursor(at + input.length);
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
const before = value.slice(0, at);
|
|
824
|
+
const current = value.slice(at, at + 1) || " ";
|
|
825
|
+
const after = value.slice(at + 1);
|
|
826
|
+
return /* @__PURE__ */ jsxs6(Text7, { color: COLORS.strong, children: [
|
|
827
|
+
before,
|
|
828
|
+
/* @__PURE__ */ jsx6(Text7, { inverse: true, children: current }),
|
|
829
|
+
after
|
|
830
|
+
] });
|
|
831
|
+
}
|
|
832
|
+
|
|
786
833
|
// src/ui/SelectPrompt.tsx
|
|
787
|
-
import { Box as Box8, Text as
|
|
788
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3, useState as
|
|
834
|
+
import { Box as Box8, Text as Text9, useInput as useInput3, useWindowSize as useWindowSize4 } from "ink";
|
|
835
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3, useState as useState6 } from "react";
|
|
789
836
|
|
|
790
837
|
// src/ui/ScrollView.tsx
|
|
791
|
-
import { Box as Box7, Text as
|
|
792
|
-
import { useCallback, useLayoutEffect, useRef as useRef2, useState as
|
|
793
|
-
import { jsxs as
|
|
838
|
+
import { Box as Box7, Text as Text8, measureElement as measureElement2, useWindowSize as useWindowSize3 } from "ink";
|
|
839
|
+
import { useCallback, useLayoutEffect, useRef as useRef2, useState as useState5 } from "react";
|
|
840
|
+
import { jsxs as jsxs7 } from "react/jsx-runtime";
|
|
794
841
|
var INDICATOR_ROWS = 2;
|
|
795
842
|
function fittedWidth(node, columns) {
|
|
796
843
|
let left = 0;
|
|
@@ -806,7 +853,7 @@ function useScrollWindow({
|
|
|
806
853
|
}) {
|
|
807
854
|
const viewportRef = useRef2(null);
|
|
808
855
|
const { columns } = useWindowSize3();
|
|
809
|
-
const [size, setSize] =
|
|
856
|
+
const [size, setSize] = useState5(
|
|
810
857
|
null
|
|
811
858
|
);
|
|
812
859
|
useLayoutEffect(() => {
|
|
@@ -819,7 +866,7 @@ function useScrollWindow({
|
|
|
819
866
|
});
|
|
820
867
|
const capacity = size === null || itemCount * rowHeight <= size.height ? itemCount : Math.max(Math.floor((size.height - INDICATOR_ROWS) / rowHeight), 1);
|
|
821
868
|
const maxOffset = Math.max(itemCount - capacity, 0);
|
|
822
|
-
const [offset, setOffset] =
|
|
869
|
+
const [offset, setOffset] = useState5(0);
|
|
823
870
|
const prevMaxOffsetRef = useRef2(0);
|
|
824
871
|
useLayoutEffect(() => {
|
|
825
872
|
const wasAtBottom = offset >= prevMaxOffsetRef.current;
|
|
@@ -861,14 +908,14 @@ function useScrollWindow({
|
|
|
861
908
|
};
|
|
862
909
|
}
|
|
863
910
|
function ScrollView({ scroll, children }) {
|
|
864
|
-
return /* @__PURE__ */
|
|
865
|
-
scroll.hiddenAbove > 0 && /* @__PURE__ */
|
|
911
|
+
return /* @__PURE__ */ jsxs7(Box7, { ref: scroll.viewportRef, flexDirection: "column", flexGrow: 1, children: [
|
|
912
|
+
scroll.hiddenAbove > 0 && /* @__PURE__ */ jsxs7(Text8, { color: COLORS.dim, children: [
|
|
866
913
|
"\u2191 ",
|
|
867
914
|
scroll.hiddenAbove,
|
|
868
915
|
" more"
|
|
869
916
|
] }),
|
|
870
917
|
children,
|
|
871
|
-
scroll.hiddenBelow > 0 && /* @__PURE__ */
|
|
918
|
+
scroll.hiddenBelow > 0 && /* @__PURE__ */ jsxs7(Text8, { color: COLORS.dim, children: [
|
|
872
919
|
"\u2193 ",
|
|
873
920
|
scroll.hiddenBelow,
|
|
874
921
|
" more"
|
|
@@ -877,7 +924,7 @@ function ScrollView({ scroll, children }) {
|
|
|
877
924
|
}
|
|
878
925
|
|
|
879
926
|
// src/ui/SelectPrompt.tsx
|
|
880
|
-
import { jsx as
|
|
927
|
+
import { jsx as jsx7, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
881
928
|
var CANCEL = "cancel";
|
|
882
929
|
var ARROW_WIDTH = 4;
|
|
883
930
|
var COLUMN_GAP = 2;
|
|
@@ -909,18 +956,18 @@ function SelectPrompt({
|
|
|
909
956
|
const rows = hasCancel ? [...options, "Cancel"] : options;
|
|
910
957
|
const cancelIndex = hasCancel ? options.length : -1;
|
|
911
958
|
const isDisabled = (i) => i !== cancelIndex && Boolean(disabled?.[i]);
|
|
912
|
-
const [index, setIndex] =
|
|
959
|
+
const [index, setIndex] = useState6(() => {
|
|
913
960
|
const start = defaultSelectedIndex > 0 && defaultSelectedIndex < options.length ? defaultSelectedIndex : 0;
|
|
914
961
|
return isDisabled(start) ? nextSelectableIndex(start, 1, rows.length, isDisabled) : start;
|
|
915
962
|
});
|
|
916
|
-
const [checked, setChecked] =
|
|
963
|
+
const [checked, setChecked] = useState6(() => /* @__PURE__ */ new Set());
|
|
917
964
|
const hints = [];
|
|
918
965
|
if (rows.length > 1) hints.push({ key: "[\u2191] [\u2193]", label: "move" });
|
|
919
966
|
if (multi) hints.push({ key: "[space]", label: "select" });
|
|
920
967
|
hints.push({ key: "[enter]", label: "confirm" });
|
|
921
968
|
const containerRef = useRef3(null);
|
|
922
969
|
const { columns } = useWindowSize4();
|
|
923
|
-
const [width, setWidth] =
|
|
970
|
+
const [width, setWidth] = useState6(columns);
|
|
924
971
|
useLayoutEffect2(() => {
|
|
925
972
|
if (!containerRef.current) return;
|
|
926
973
|
const measured = fittedWidth(containerRef.current, columns);
|
|
@@ -950,7 +997,7 @@ function SelectPrompt({
|
|
|
950
997
|
revealIndex(index);
|
|
951
998
|
}, [index, revealIndex]);
|
|
952
999
|
const visible = rows.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
953
|
-
|
|
1000
|
+
useInput3((input, key) => {
|
|
954
1001
|
if (rows.length === 0) return;
|
|
955
1002
|
if (key.upArrow || input === "k") {
|
|
956
1003
|
setIndex((i) => nextSelectableIndex(i, -1, rows.length, isDisabled));
|
|
@@ -975,17 +1022,17 @@ function SelectPrompt({
|
|
|
975
1022
|
}
|
|
976
1023
|
}
|
|
977
1024
|
});
|
|
978
|
-
return /* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
error && /* @__PURE__ */
|
|
981
|
-
messages?.map((m, i) => /* @__PURE__ */
|
|
982
|
-
table && /* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
question && /* @__PURE__ */
|
|
985
|
-
helpText && /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ jsx7(Box8, { ref: containerRef, flexGrow: 1, children: /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", gap: 1, width, children: [
|
|
1026
|
+
/* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", gap: 1, flexShrink: 0, children: [
|
|
1027
|
+
error && /* @__PURE__ */ jsx7(Text9, { color: COLORS.danger, children: error }),
|
|
1028
|
+
messages?.map((m, i) => /* @__PURE__ */ jsx7(Text9, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
1029
|
+
table && /* @__PURE__ */ jsx7(Table, { columns: table.columns, rows: table.rows }),
|
|
1030
|
+
/* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
|
|
1031
|
+
question && /* @__PURE__ */ jsx7(Text9, { color: COLORS.muted, children: question }),
|
|
1032
|
+
helpText && /* @__PURE__ */ jsx7(Text9, { color: COLORS.dim, children: helpText })
|
|
986
1033
|
] })
|
|
987
1034
|
] }),
|
|
988
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ jsx7(ScrollView, { scroll, children: visible.map((option, visibleIndex) => {
|
|
989
1036
|
const i = scroll.offset + visibleIndex;
|
|
990
1037
|
const highlighted = i === index;
|
|
991
1038
|
const isCancel = i === cancelIndex;
|
|
@@ -993,7 +1040,7 @@ function SelectPrompt({
|
|
|
993
1040
|
const sec = isCancel ? void 0 : secondary?.[i];
|
|
994
1041
|
const isText = sec?.kind === "text";
|
|
995
1042
|
const rowDisabled = isDisabled(i);
|
|
996
|
-
return /* @__PURE__ */
|
|
1043
|
+
return /* @__PURE__ */ jsxs8(
|
|
997
1044
|
SelectRow,
|
|
998
1045
|
{
|
|
999
1046
|
highlighted,
|
|
@@ -1003,24 +1050,24 @@ function SelectPrompt({
|
|
|
1003
1050
|
label: `${bullet}${option}`,
|
|
1004
1051
|
usePadding: true,
|
|
1005
1052
|
children: [
|
|
1006
|
-
isText && textWidth > 0 && /* @__PURE__ */
|
|
1007
|
-
|
|
1053
|
+
isText && textWidth > 0 && /* @__PURE__ */ jsx7(Box8, { width: textWidth, children: /* @__PURE__ */ jsx7(
|
|
1054
|
+
Text9,
|
|
1008
1055
|
{
|
|
1009
1056
|
wrap: "truncate",
|
|
1010
1057
|
color: rowDisabled ? COLORS.dim : highlighted ? COLORS.primary : COLORS.muted,
|
|
1011
1058
|
children: sec.value
|
|
1012
1059
|
}
|
|
1013
1060
|
) }),
|
|
1014
|
-
sec?.kind === "badge" && /* @__PURE__ */
|
|
1061
|
+
sec?.kind === "badge" && /* @__PURE__ */ jsx7(Box8, { width: badgeWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx7(Text9, { color: COLORS.badge, wrap: "truncate", children: sec.value }) })
|
|
1015
1062
|
]
|
|
1016
1063
|
},
|
|
1017
1064
|
`row-${i}`
|
|
1018
1065
|
);
|
|
1019
1066
|
}) }),
|
|
1020
|
-
/* @__PURE__ */
|
|
1067
|
+
/* @__PURE__ */ jsx7(Box8, { flexShrink: 0, children: /* @__PURE__ */ jsx7(Text9, { color: COLORS.dim, children: hints.map(({ key, label }, i) => /* @__PURE__ */ jsxs8(Text9, { color: COLORS.dim, children: [
|
|
1021
1068
|
i > 0 ? " " : "",
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ jsx7(Text9, { color: COLORS.primary, children: key }),
|
|
1070
|
+
/* @__PURE__ */ jsxs8(Text9, { color: COLORS.dim, children: [
|
|
1024
1071
|
" ",
|
|
1025
1072
|
label
|
|
1026
1073
|
] })
|
|
@@ -1029,17 +1076,17 @@ function SelectPrompt({
|
|
|
1029
1076
|
}
|
|
1030
1077
|
|
|
1031
1078
|
// src/ui/PromptInput.tsx
|
|
1032
|
-
import { jsx as
|
|
1079
|
+
import { jsx as jsx8, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1033
1080
|
var ACCEPT_REJECT_OPTIONS = ["Accept", "Reject"];
|
|
1034
1081
|
function EnterToContinuePrompt({
|
|
1035
1082
|
question,
|
|
1036
1083
|
messages,
|
|
1037
1084
|
onDecide
|
|
1038
1085
|
}) {
|
|
1039
|
-
return /* @__PURE__ */
|
|
1040
|
-
messages?.map((m, i) => /* @__PURE__ */
|
|
1041
|
-
question && /* @__PURE__ */
|
|
1042
|
-
/* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", gap: 1, children: [
|
|
1087
|
+
messages?.map((m, i) => /* @__PURE__ */ jsx8(Text10, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
1088
|
+
question && /* @__PURE__ */ jsx8(Text10, { color: COLORS.primary, children: question }),
|
|
1089
|
+
/* @__PURE__ */ jsx8(
|
|
1043
1090
|
DecisionSelect,
|
|
1044
1091
|
{
|
|
1045
1092
|
actions: [
|
|
@@ -1053,17 +1100,17 @@ function EnterToContinuePrompt({
|
|
|
1053
1100
|
}
|
|
1054
1101
|
function PromptInput() {
|
|
1055
1102
|
const { phase, inputReq, submitInput } = useWizard();
|
|
1056
|
-
const [draft, setDraft] =
|
|
1057
|
-
const [submittedReq, setSubmittedReq] =
|
|
1103
|
+
const [draft, setDraft] = useState7("");
|
|
1104
|
+
const [submittedReq, setSubmittedReq] = useState7(null);
|
|
1058
1105
|
const promptKey = inputReq && `${inputReq.promptType}:${inputReq.prompt}`;
|
|
1059
1106
|
const submitting = inputReq != null && submittedReq === inputReq;
|
|
1060
1107
|
if (phase === "done" || phase === "error") {
|
|
1061
|
-
return /* @__PURE__ */
|
|
1108
|
+
return /* @__PURE__ */ jsx8(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx8(Text10, { color: "gray", dimColor: true, children: "Press Enter or Esc to exit" }) });
|
|
1062
1109
|
}
|
|
1063
1110
|
if (phase !== "awaitingInput" || !inputReq) return null;
|
|
1064
1111
|
if (submitting) {
|
|
1065
|
-
return /* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ jsx8(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsxs9(Text10, { color: COLORS.strong, bold: true, children: [
|
|
1113
|
+
/* @__PURE__ */ jsx8(Spinner, { type: "dots" }),
|
|
1067
1114
|
" Continuing\u2026"
|
|
1068
1115
|
] }) });
|
|
1069
1116
|
}
|
|
@@ -1072,7 +1119,7 @@ function PromptInput() {
|
|
|
1072
1119
|
submitInput(value);
|
|
1073
1120
|
};
|
|
1074
1121
|
if (inputReq.promptType === "multipleChoice") {
|
|
1075
|
-
return /* @__PURE__ */
|
|
1122
|
+
return /* @__PURE__ */ jsx8(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx8(
|
|
1076
1123
|
SelectPrompt,
|
|
1077
1124
|
{
|
|
1078
1125
|
question: inputReq.prompt,
|
|
@@ -1091,7 +1138,7 @@ function PromptInput() {
|
|
|
1091
1138
|
) });
|
|
1092
1139
|
}
|
|
1093
1140
|
if (inputReq.promptType === "multiSelect") {
|
|
1094
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ jsx8(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx8(
|
|
1095
1142
|
SelectPrompt,
|
|
1096
1143
|
{
|
|
1097
1144
|
multi: true,
|
|
@@ -1107,7 +1154,7 @@ function PromptInput() {
|
|
|
1107
1154
|
) });
|
|
1108
1155
|
}
|
|
1109
1156
|
if (inputReq.promptType === "notice") {
|
|
1110
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ jsx8(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx8(
|
|
1111
1158
|
SelectPrompt,
|
|
1112
1159
|
{
|
|
1113
1160
|
question: inputReq.prompt,
|
|
@@ -1119,7 +1166,7 @@ function PromptInput() {
|
|
|
1119
1166
|
) });
|
|
1120
1167
|
}
|
|
1121
1168
|
if (inputReq.promptType === "enterToContinue") {
|
|
1122
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ jsx8(
|
|
1123
1170
|
EnterToContinuePrompt,
|
|
1124
1171
|
{
|
|
1125
1172
|
question: inputReq.prompt,
|
|
@@ -1129,11 +1176,11 @@ function PromptInput() {
|
|
|
1129
1176
|
);
|
|
1130
1177
|
}
|
|
1131
1178
|
if (inputReq.promptType === "commandApproval" && inputReq.command) {
|
|
1132
|
-
return /* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ jsx8(CommandApproval, { command: inputReq.command, onDecide: submitInput });
|
|
1133
1180
|
}
|
|
1134
1181
|
if (inputReq.promptType === "acceptReject") {
|
|
1135
1182
|
const labels = inputReq.options?.length ? inputReq.options : ACCEPT_REJECT_OPTIONS;
|
|
1136
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ jsx8(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx8(
|
|
1137
1184
|
SelectPrompt,
|
|
1138
1185
|
{
|
|
1139
1186
|
question: inputReq.prompt,
|
|
@@ -1145,16 +1192,16 @@ function PromptInput() {
|
|
|
1145
1192
|
promptKey
|
|
1146
1193
|
) });
|
|
1147
1194
|
}
|
|
1148
|
-
return /* @__PURE__ */
|
|
1149
|
-
inputReq.error && /* @__PURE__ */
|
|
1150
|
-
inputReq.messages?.map((m, i) => /* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
1196
|
+
inputReq.error && /* @__PURE__ */ jsx8(Text10, { color: COLORS.danger, children: inputReq.error }),
|
|
1197
|
+
inputReq.messages?.map((m, i) => /* @__PURE__ */ jsx8(Text10, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
1198
|
+
/* @__PURE__ */ jsxs9(Box9, { children: [
|
|
1199
|
+
/* @__PURE__ */ jsxs9(Text10, { color: COLORS.primary, children: [
|
|
1153
1200
|
inputReq.prompt,
|
|
1154
1201
|
" "
|
|
1155
1202
|
] }),
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
|
|
1203
|
+
/* @__PURE__ */ jsx8(
|
|
1204
|
+
FreeTextInput,
|
|
1158
1205
|
{
|
|
1159
1206
|
value: draft,
|
|
1160
1207
|
onChange: setDraft,
|
|
@@ -1163,15 +1210,15 @@ function PromptInput() {
|
|
|
1163
1210
|
setDraft("");
|
|
1164
1211
|
}
|
|
1165
1212
|
}
|
|
1166
|
-
)
|
|
1213
|
+
)
|
|
1167
1214
|
] })
|
|
1168
1215
|
] });
|
|
1169
1216
|
}
|
|
1170
1217
|
|
|
1171
1218
|
// src/ui/Review.tsx
|
|
1172
|
-
import { Box as Box10, Text as
|
|
1173
|
-
import { useLayoutEffect as useLayoutEffect3, useState as
|
|
1174
|
-
import { jsx as
|
|
1219
|
+
import { Box as Box10, Text as Text11, useInput as useInput4 } from "ink";
|
|
1220
|
+
import { useLayoutEffect as useLayoutEffect3, useState as useState8 } from "react";
|
|
1221
|
+
import { jsx as jsx9, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1175
1222
|
var INGEST_SCRIPT = ".algolia-wizard/ingest.sh";
|
|
1176
1223
|
function wrapText(text, width) {
|
|
1177
1224
|
if (width <= 0) return [text];
|
|
@@ -1254,14 +1301,14 @@ function buildRows(review2, width) {
|
|
|
1254
1301
|
return rows;
|
|
1255
1302
|
}
|
|
1256
1303
|
function ReviewPanel({ review: review2 }) {
|
|
1257
|
-
const [width, setWidth] =
|
|
1304
|
+
const [width, setWidth] = useState8(0);
|
|
1258
1305
|
const rows = width > 0 ? buildRows(review2, width) : [];
|
|
1259
1306
|
const scroll = useScrollWindow({ itemCount: rows.length });
|
|
1260
1307
|
useLayoutEffect3(() => {
|
|
1261
1308
|
if (scroll.measured) setWidth(scroll.width);
|
|
1262
1309
|
}, [scroll.measured, scroll.width]);
|
|
1263
1310
|
const scrollable = scroll.maxOffset > 0;
|
|
1264
|
-
|
|
1311
|
+
useInput4(
|
|
1265
1312
|
(_input, key) => {
|
|
1266
1313
|
if (key.upArrow) scroll.scrollBy(-1);
|
|
1267
1314
|
else if (key.downArrow) scroll.scrollBy(1);
|
|
@@ -1269,18 +1316,18 @@ function ReviewPanel({ review: review2 }) {
|
|
|
1269
1316
|
{ isActive: scrollable }
|
|
1270
1317
|
);
|
|
1271
1318
|
const visible = rows.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
1272
|
-
return /* @__PURE__ */
|
|
1273
|
-
/* @__PURE__ */
|
|
1274
|
-
row.prefix && /* @__PURE__ */
|
|
1275
|
-
/* @__PURE__ */
|
|
1319
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", flexGrow: 1, children: [
|
|
1320
|
+
/* @__PURE__ */ jsx9(ScrollView, { scroll, children: visible.map((row, i) => /* @__PURE__ */ jsxs10(Text11, { wrap: "truncate", children: [
|
|
1321
|
+
row.prefix && /* @__PURE__ */ jsx9(Text11, { color: row.prefixColor ?? row.color, bold: row.bold, children: row.prefix }),
|
|
1322
|
+
/* @__PURE__ */ jsx9(Text11, { color: row.color, bold: row.bold, children: row.text })
|
|
1276
1323
|
] }, `review-row-${i}`)) }),
|
|
1277
|
-
scrollable && /* @__PURE__ */
|
|
1324
|
+
scrollable && /* @__PURE__ */ jsx9(Text11, { color: COLORS.dim, children: "\u2191/\u2193 scroll" })
|
|
1278
1325
|
] });
|
|
1279
1326
|
}
|
|
1280
1327
|
function Review() {
|
|
1281
1328
|
const review2 = useWizard((s) => s.review);
|
|
1282
1329
|
if (!review2) return null;
|
|
1283
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ jsx9(ReviewPanel, { review: review2 });
|
|
1284
1331
|
}
|
|
1285
1332
|
|
|
1286
1333
|
// src/workflows/default.ts
|
|
@@ -3604,7 +3651,7 @@ async function runAnalysis(mode, extraInstructions = []) {
|
|
|
3604
3651
|
// package.json
|
|
3605
3652
|
var package_default = {
|
|
3606
3653
|
name: "@algolia/wizard",
|
|
3607
|
-
version: "0.
|
|
3654
|
+
version: "0.51.0",
|
|
3608
3655
|
description: "Magically implement Algolia functionality in your codebase",
|
|
3609
3656
|
type: "module",
|
|
3610
3657
|
engines: {
|
|
@@ -3662,7 +3709,6 @@ var package_default = {
|
|
|
3662
3709
|
ink: "^7.0.5",
|
|
3663
3710
|
"ink-picture": "^2.1.0",
|
|
3664
3711
|
"ink-spinner": "^5.0.0",
|
|
3665
|
-
"ink-text-input": "^6.0.0",
|
|
3666
3712
|
ioredis: "^5.11.1",
|
|
3667
3713
|
nanoid: "^5.1.15",
|
|
3668
3714
|
pino: "^10.3.1",
|
|
@@ -5058,8 +5104,8 @@ function getWorkflow(id) {
|
|
|
5058
5104
|
// src/ui/Welcome.tsx
|
|
5059
5105
|
import { dirname as dirname8, join as join11 } from "node:path";
|
|
5060
5106
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
5061
|
-
import { useState as
|
|
5062
|
-
import { Box as Box11, Spacer, Text as
|
|
5107
|
+
import { useState as useState9 } from "react";
|
|
5108
|
+
import { Box as Box11, Spacer, Text as Text12, useInput as useInput5, useWindowSize as useWindowSize5 } from "ink";
|
|
5063
5109
|
|
|
5064
5110
|
// src/ui/copy/welcome.ts
|
|
5065
5111
|
var sidebarItems = [
|
|
@@ -5087,7 +5133,7 @@ var sidebarItems = [
|
|
|
5087
5133
|
|
|
5088
5134
|
// src/ui/Welcome.tsx
|
|
5089
5135
|
import Image, { TerminalInfoContext, defaultTerminalInfo } from "ink-picture";
|
|
5090
|
-
import { jsx as
|
|
5136
|
+
import { jsx as jsx10, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5091
5137
|
var IMAGE_PATH = join11(dirname8(fileURLToPath2(import.meta.url)), "algolia.png");
|
|
5092
5138
|
var TERMINAL_INFO = {
|
|
5093
5139
|
...defaultTerminalInfo,
|
|
@@ -5098,14 +5144,14 @@ function SidebarItem({
|
|
|
5098
5144
|
title,
|
|
5099
5145
|
description
|
|
5100
5146
|
}) {
|
|
5101
|
-
return /* @__PURE__ */
|
|
5102
|
-
/* @__PURE__ */
|
|
5103
|
-
/* @__PURE__ */
|
|
5104
|
-
/* @__PURE__ */
|
|
5147
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
5148
|
+
/* @__PURE__ */ jsxs11(Box11, { gap: 1, children: [
|
|
5149
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.success, children: "\u2192" }),
|
|
5150
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.strong, bold: true, children: title })
|
|
5105
5151
|
] }),
|
|
5106
|
-
/* @__PURE__ */
|
|
5107
|
-
/* @__PURE__ */
|
|
5108
|
-
/* @__PURE__ */
|
|
5152
|
+
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "row", gap: 2, children: [
|
|
5153
|
+
/* @__PURE__ */ jsx10(Spacer, {}),
|
|
5154
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.muted, children: description })
|
|
5109
5155
|
] })
|
|
5110
5156
|
] });
|
|
5111
5157
|
}
|
|
@@ -5117,8 +5163,8 @@ function Welcome() {
|
|
|
5117
5163
|
{ label: "start wizard", run: confirmStart },
|
|
5118
5164
|
{ label: "learn more", run: openLearnMore }
|
|
5119
5165
|
];
|
|
5120
|
-
const [index, setIndex] =
|
|
5121
|
-
|
|
5166
|
+
const [index, setIndex] = useState9(0);
|
|
5167
|
+
useInput5((input, key) => {
|
|
5122
5168
|
if (key.upArrow || input === "k") {
|
|
5123
5169
|
setIndex((i) => (i - 1 + actions.length) % actions.length);
|
|
5124
5170
|
} else if (key.downArrow || input === "j") {
|
|
@@ -5141,16 +5187,16 @@ function Welcome() {
|
|
|
5141
5187
|
if (rows < 30) {
|
|
5142
5188
|
layout = scales["small"];
|
|
5143
5189
|
}
|
|
5144
|
-
return /* @__PURE__ */
|
|
5145
|
-
/* @__PURE__ */
|
|
5190
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "row", justifyContent: "space-between", width: "100%", children: [
|
|
5191
|
+
/* @__PURE__ */ jsx10(
|
|
5146
5192
|
Box11,
|
|
5147
5193
|
{
|
|
5148
5194
|
paddingY: layout.main.padding.y,
|
|
5149
5195
|
paddingX: layout.main.padding.x,
|
|
5150
5196
|
flexDirection: "column",
|
|
5151
5197
|
justifyContent: "center",
|
|
5152
|
-
children: /* @__PURE__ */
|
|
5153
|
-
/* @__PURE__ */
|
|
5198
|
+
children: /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", gap: 2, children: [
|
|
5199
|
+
/* @__PURE__ */ jsx10(TerminalInfoContext.Provider, { value: TERMINAL_INFO, children: /* @__PURE__ */ jsx10(
|
|
5154
5200
|
Image,
|
|
5155
5201
|
{
|
|
5156
5202
|
src: IMAGE_PATH,
|
|
@@ -5161,8 +5207,8 @@ function Welcome() {
|
|
|
5161
5207
|
protocol: "halfBlock"
|
|
5162
5208
|
}
|
|
5163
5209
|
) }),
|
|
5164
|
-
/* @__PURE__ */
|
|
5165
|
-
/* @__PURE__ */
|
|
5210
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.muted, children: "\u2726 From zero \u2192 working search in ~10 minutes" }),
|
|
5211
|
+
/* @__PURE__ */ jsx10(Box11, { flexDirection: "column", children: actions.map((action, i) => /* @__PURE__ */ jsx10(
|
|
5166
5212
|
SelectRow,
|
|
5167
5213
|
{
|
|
5168
5214
|
highlighted: i === index,
|
|
@@ -5171,20 +5217,20 @@ function Welcome() {
|
|
|
5171
5217
|
},
|
|
5172
5218
|
action.label
|
|
5173
5219
|
)) }),
|
|
5174
|
-
/* @__PURE__ */
|
|
5175
|
-
/* @__PURE__ */
|
|
5176
|
-
/* @__PURE__ */
|
|
5177
|
-
/* @__PURE__ */
|
|
5220
|
+
/* @__PURE__ */ jsxs11(Box11, { gap: 2, children: [
|
|
5221
|
+
/* @__PURE__ */ jsxs11(Text12, { children: [
|
|
5222
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.primary, children: "[\u2191] [\u2193]" }),
|
|
5223
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.dim, children: " move" })
|
|
5178
5224
|
] }),
|
|
5179
|
-
/* @__PURE__ */
|
|
5180
|
-
/* @__PURE__ */
|
|
5181
|
-
/* @__PURE__ */
|
|
5225
|
+
/* @__PURE__ */ jsxs11(Text12, { children: [
|
|
5226
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.primary, children: "[enter]" }),
|
|
5227
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.dim, children: " confirm" })
|
|
5182
5228
|
] })
|
|
5183
5229
|
] })
|
|
5184
5230
|
] })
|
|
5185
5231
|
}
|
|
5186
5232
|
),
|
|
5187
|
-
/* @__PURE__ */
|
|
5233
|
+
/* @__PURE__ */ jsxs11(
|
|
5188
5234
|
Box11,
|
|
5189
5235
|
{
|
|
5190
5236
|
backgroundColor: COLORS.bg.sidebar,
|
|
@@ -5195,8 +5241,8 @@ function Welcome() {
|
|
|
5195
5241
|
flexDirection: "column",
|
|
5196
5242
|
justifyContent: "center",
|
|
5197
5243
|
children: [
|
|
5198
|
-
/* @__PURE__ */
|
|
5199
|
-
sidebarItems.map((i, idx) => /* @__PURE__ */
|
|
5244
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.muted, children: "WHAT THIS WIZARD WILL DO" }),
|
|
5245
|
+
sidebarItems.map((i, idx) => /* @__PURE__ */ jsx10(SidebarItem, { title: i.title, description: i.description }, idx))
|
|
5200
5246
|
]
|
|
5201
5247
|
}
|
|
5202
5248
|
)
|
|
@@ -5205,7 +5251,7 @@ function Welcome() {
|
|
|
5205
5251
|
|
|
5206
5252
|
// src/ui/LearnMore.tsx
|
|
5207
5253
|
import { Fragment } from "react";
|
|
5208
|
-
import { Box as Box12, Text as
|
|
5254
|
+
import { Box as Box12, Text as Text13, useInput as useInput6, useWindowSize as useWindowSize6 } from "ink";
|
|
5209
5255
|
|
|
5210
5256
|
// src/ui/copy/learn-more.ts
|
|
5211
5257
|
var accessIntro = "Everything runs locally on your machine. Nothing is written or sent without an explicit yes from you.";
|
|
@@ -5247,7 +5293,7 @@ var policyLinks = [
|
|
|
5247
5293
|
];
|
|
5248
5294
|
|
|
5249
5295
|
// src/ui/LearnMore.tsx
|
|
5250
|
-
import { jsx as
|
|
5296
|
+
import { jsx as jsx11, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5251
5297
|
var TAG_COLORS = {
|
|
5252
5298
|
READ: COLORS.success,
|
|
5253
5299
|
WRITE: COLORS.badge,
|
|
@@ -5264,12 +5310,12 @@ function NeverLine({
|
|
|
5264
5310
|
}) {
|
|
5265
5311
|
const used = segments.reduce((n, s) => n + s.text.length, 0);
|
|
5266
5312
|
const rightPad = Math.max(0, width - 2 - NEVER_BOX_PAD_X - used);
|
|
5267
|
-
return /* @__PURE__ */
|
|
5268
|
-
/* @__PURE__ */
|
|
5313
|
+
return /* @__PURE__ */ jsxs12(Text13, { color: COLORS.primary, children: [
|
|
5314
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.danger, children: "\u2502" }),
|
|
5269
5315
|
" ".repeat(NEVER_BOX_PAD_X),
|
|
5270
|
-
segments.map((s, i) => /* @__PURE__ */
|
|
5316
|
+
segments.map((s, i) => /* @__PURE__ */ jsx11(Text13, { color: s.color, bold: s.bold, children: s.text }, i)),
|
|
5271
5317
|
" ".repeat(rightPad),
|
|
5272
|
-
/* @__PURE__ */
|
|
5318
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.danger, children: "\u2502" })
|
|
5273
5319
|
] });
|
|
5274
5320
|
}
|
|
5275
5321
|
function LearnMore() {
|
|
@@ -5277,11 +5323,11 @@ function LearnMore() {
|
|
|
5277
5323
|
const backToHome = useWizard((s) => s.backToHome);
|
|
5278
5324
|
const { columns } = useWindowSize6();
|
|
5279
5325
|
const dividerWidth = Math.max(0, columns - PADDING_X * 2);
|
|
5280
|
-
|
|
5326
|
+
useInput6((_input, key) => {
|
|
5281
5327
|
if (key.escape) backToHome();
|
|
5282
5328
|
else if (key.return) confirmStart();
|
|
5283
5329
|
});
|
|
5284
|
-
return /* @__PURE__ */
|
|
5330
|
+
return /* @__PURE__ */ jsxs12(
|
|
5285
5331
|
Box12,
|
|
5286
5332
|
{
|
|
5287
5333
|
flexDirection: "column",
|
|
@@ -5290,31 +5336,31 @@ function LearnMore() {
|
|
|
5290
5336
|
width: "100%",
|
|
5291
5337
|
gap: 1,
|
|
5292
5338
|
children: [
|
|
5293
|
-
/* @__PURE__ */
|
|
5294
|
-
/* @__PURE__ */
|
|
5295
|
-
/* @__PURE__ */
|
|
5296
|
-
/* @__PURE__ */
|
|
5297
|
-
/* @__PURE__ */
|
|
5298
|
-
/* @__PURE__ */
|
|
5299
|
-
/* @__PURE__ */
|
|
5300
|
-
/* @__PURE__ */
|
|
5301
|
-
/* @__PURE__ */
|
|
5339
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.strong, bold: true, children: "What algolia wizard accesses" }),
|
|
5340
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.muted, children: accessIntro }),
|
|
5341
|
+
/* @__PURE__ */ jsx11(Box12, { flexDirection: "column", children: accessItems.map((item) => /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", marginTop: 1, children: [
|
|
5342
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.border, children: "\u2500".repeat(dividerWidth) }),
|
|
5343
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "row", gap: 1, marginTop: 1, children: [
|
|
5344
|
+
/* @__PURE__ */ jsx11(Box12, { width: TAG_COLUMN_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text13, { color: TAG_COLORS[item.tag], bold: true, children: `[${item.tag}]` }) }),
|
|
5345
|
+
/* @__PURE__ */ jsx11(Box12, { flexDirection: "column", children: /* @__PURE__ */ jsxs12(Text13, { color: COLORS.primary, children: [
|
|
5346
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.strong, bold: true, children: item.title }),
|
|
5347
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.muted, children: ` \u2014 ${item.description}` })
|
|
5302
5348
|
] }) })
|
|
5303
5349
|
] })
|
|
5304
5350
|
] }, item.tag)) }),
|
|
5305
|
-
/* @__PURE__ */
|
|
5306
|
-
/* @__PURE__ */
|
|
5307
|
-
/* @__PURE__ */
|
|
5308
|
-
/* @__PURE__ */
|
|
5351
|
+
/* @__PURE__ */ jsxs12(Box12, { marginTop: 1, flexDirection: "column", children: [
|
|
5352
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.danger, children: `\u256D${"\u2500".repeat(Math.max(0, dividerWidth - 2))}\u256E` }),
|
|
5353
|
+
/* @__PURE__ */ jsx11(NeverLine, { width: dividerWidth }),
|
|
5354
|
+
/* @__PURE__ */ jsx11(
|
|
5309
5355
|
NeverLine,
|
|
5310
5356
|
{
|
|
5311
5357
|
width: dividerWidth,
|
|
5312
5358
|
segments: [{ text: "I NEVER", color: COLORS.danger, bold: true }]
|
|
5313
5359
|
}
|
|
5314
5360
|
),
|
|
5315
|
-
neverItems.map((item) => /* @__PURE__ */
|
|
5316
|
-
/* @__PURE__ */
|
|
5317
|
-
/* @__PURE__ */
|
|
5361
|
+
neverItems.map((item) => /* @__PURE__ */ jsxs12(Fragment, { children: [
|
|
5362
|
+
/* @__PURE__ */ jsx11(NeverLine, { width: dividerWidth }),
|
|
5363
|
+
/* @__PURE__ */ jsx11(
|
|
5318
5364
|
NeverLine,
|
|
5319
5365
|
{
|
|
5320
5366
|
width: dividerWidth,
|
|
@@ -5326,24 +5372,24 @@ function LearnMore() {
|
|
|
5326
5372
|
}
|
|
5327
5373
|
)
|
|
5328
5374
|
] }, item)),
|
|
5329
|
-
/* @__PURE__ */
|
|
5330
|
-
/* @__PURE__ */
|
|
5375
|
+
/* @__PURE__ */ jsx11(NeverLine, { width: dividerWidth }),
|
|
5376
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.danger, children: `\u2570${"\u2500".repeat(Math.max(0, dividerWidth - 2))}\u256F` })
|
|
5331
5377
|
] }),
|
|
5332
|
-
/* @__PURE__ */
|
|
5333
|
-
/* @__PURE__ */
|
|
5334
|
-
/* @__PURE__ */
|
|
5378
|
+
/* @__PURE__ */ jsx11(Box12, { marginTop: 1, flexDirection: "column", children: policyLinks.map((link) => /* @__PURE__ */ jsxs12(Box12, { flexDirection: "row", gap: 1, children: [
|
|
5379
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.strong, bold: true, children: `${link.label}:` }),
|
|
5380
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.accent, children: link.url })
|
|
5335
5381
|
] }, link.label)) }),
|
|
5336
|
-
/* @__PURE__ */
|
|
5337
|
-
/* @__PURE__ */
|
|
5338
|
-
/* @__PURE__ */
|
|
5339
|
-
/* @__PURE__ */
|
|
5340
|
-
/* @__PURE__ */
|
|
5382
|
+
/* @__PURE__ */ jsxs12(Box12, { marginTop: 1, flexDirection: "row", gap: 3, children: [
|
|
5383
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "row", gap: 1, children: [
|
|
5384
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.muted, children: "[" }),
|
|
5385
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.primary, children: "esc" }),
|
|
5386
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.muted, children: "] back" })
|
|
5341
5387
|
] }),
|
|
5342
|
-
/* @__PURE__ */
|
|
5343
|
-
/* @__PURE__ */
|
|
5344
|
-
/* @__PURE__ */
|
|
5345
|
-
/* @__PURE__ */
|
|
5346
|
-
/* @__PURE__ */
|
|
5388
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "row", gap: 1, children: [
|
|
5389
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.muted, children: "[" }),
|
|
5390
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.primary, children: "enter" }),
|
|
5391
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.muted, children: "]" }),
|
|
5392
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.success, bold: true, children: "start wizard" })
|
|
5347
5393
|
] })
|
|
5348
5394
|
] })
|
|
5349
5395
|
]
|
|
@@ -5352,17 +5398,17 @@ function LearnMore() {
|
|
|
5352
5398
|
}
|
|
5353
5399
|
|
|
5354
5400
|
// src/ui/Sidebar.tsx
|
|
5355
|
-
import { Box as Box15, Text as
|
|
5401
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
5356
5402
|
|
|
5357
5403
|
// src/ui/Steps.tsx
|
|
5358
|
-
import { Box as Box13, Text as
|
|
5404
|
+
import { Box as Box13, Text as Text14 } from "ink";
|
|
5359
5405
|
import Spinner2 from "ink-spinner";
|
|
5360
|
-
import { jsx as
|
|
5406
|
+
import { jsx as jsx12, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5361
5407
|
function Steps() {
|
|
5362
5408
|
const { steps } = useWizard();
|
|
5363
5409
|
const visibleSteps = steps.filter(isStepVisible);
|
|
5364
|
-
return /* @__PURE__ */
|
|
5365
|
-
s.status === "running" ? /* @__PURE__ */
|
|
5410
|
+
return /* @__PURE__ */ jsx12(Box13, { flexDirection: "column", gap: 1, children: visibleSteps.map((s) => /* @__PURE__ */ jsx12(Box13, { flexDirection: "column", children: /* @__PURE__ */ jsxs13(Text14, { color: COLORS.status[s.status], children: [
|
|
5411
|
+
s.status === "running" ? /* @__PURE__ */ jsx12(Spinner2, { type: "dots" }) : MARKER[s.status],
|
|
5366
5412
|
" ",
|
|
5367
5413
|
s.title
|
|
5368
5414
|
] }) }, s.id)) });
|
|
@@ -5371,27 +5417,27 @@ function CurrentStep() {
|
|
|
5371
5417
|
const { steps } = useWizard();
|
|
5372
5418
|
const currentStep = steps.filter(isStepVisible).find((s) => s.status === "running");
|
|
5373
5419
|
if (!currentStep) return null;
|
|
5374
|
-
return /* @__PURE__ */
|
|
5375
|
-
/* @__PURE__ */
|
|
5420
|
+
return /* @__PURE__ */ jsxs13(Text14, { color: COLORS.status.running, children: [
|
|
5421
|
+
/* @__PURE__ */ jsx12(Spinner2, { type: "dots" }),
|
|
5376
5422
|
" ",
|
|
5377
5423
|
` ${currentStep.title}`
|
|
5378
5424
|
] });
|
|
5379
5425
|
}
|
|
5380
5426
|
|
|
5381
5427
|
// src/ui/Progress.tsx
|
|
5382
|
-
import { Box as Box14, Text as
|
|
5383
|
-
import { jsx as
|
|
5428
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
5429
|
+
import { jsx as jsx13, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
5384
5430
|
function Progress() {
|
|
5385
5431
|
const { steps, currentStepIndex } = useWizard();
|
|
5386
5432
|
const visibleSteps = steps.filter(isStepVisible);
|
|
5387
5433
|
if (visibleSteps.length === 0) return null;
|
|
5388
5434
|
const visibleCountThroughCurrent = steps.slice(0, currentStepIndex + 1).filter(isStepVisible).length;
|
|
5389
5435
|
const activeStepNumber = Math.max(1, visibleCountThroughCurrent);
|
|
5390
|
-
return /* @__PURE__ */
|
|
5391
|
-
/* @__PURE__ */
|
|
5392
|
-
/* @__PURE__ */
|
|
5393
|
-
/* @__PURE__ */
|
|
5394
|
-
/* @__PURE__ */
|
|
5436
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "row", gap: 1, children: [
|
|
5437
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.muted, children: "STEP" }),
|
|
5438
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.strong, bold: true, children: activeStepNumber }),
|
|
5439
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.strong, bold: true, children: "/" }),
|
|
5440
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.strong, bold: true, children: visibleSteps.length })
|
|
5395
5441
|
] });
|
|
5396
5442
|
}
|
|
5397
5443
|
|
|
@@ -5402,9 +5448,9 @@ var sidebarCommands = [
|
|
|
5402
5448
|
];
|
|
5403
5449
|
|
|
5404
5450
|
// src/ui/Sidebar.tsx
|
|
5405
|
-
import { jsx as
|
|
5451
|
+
import { jsx as jsx14, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5406
5452
|
function Sidebar() {
|
|
5407
|
-
return /* @__PURE__ */
|
|
5453
|
+
return /* @__PURE__ */ jsxs15(
|
|
5408
5454
|
Box15,
|
|
5409
5455
|
{
|
|
5410
5456
|
backgroundColor: "#14171E",
|
|
@@ -5414,16 +5460,16 @@ function Sidebar() {
|
|
|
5414
5460
|
flexDirection: "column",
|
|
5415
5461
|
justifyContent: "space-between",
|
|
5416
5462
|
children: [
|
|
5417
|
-
/* @__PURE__ */
|
|
5418
|
-
/* @__PURE__ */
|
|
5419
|
-
/* @__PURE__ */
|
|
5463
|
+
/* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", gap: 1, children: [
|
|
5464
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.muted, children: "PROGRESS" }),
|
|
5465
|
+
/* @__PURE__ */ jsx14(Steps, {})
|
|
5420
5466
|
] }),
|
|
5421
|
-
/* @__PURE__ */
|
|
5422
|
-
/* @__PURE__ */
|
|
5423
|
-
/* @__PURE__ */
|
|
5424
|
-
return /* @__PURE__ */
|
|
5425
|
-
/* @__PURE__ */
|
|
5426
|
-
/* @__PURE__ */
|
|
5467
|
+
/* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", gap: 1, children: [
|
|
5468
|
+
/* @__PURE__ */ jsx14(Progress, {}),
|
|
5469
|
+
/* @__PURE__ */ jsx14(Box15, { flexDirection: "column", children: sidebarCommands.map((c) => {
|
|
5470
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "row", gap: 1, children: [
|
|
5471
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.primary, children: `[${c.keyHint}]` }),
|
|
5472
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.muted, children: c.description })
|
|
5427
5473
|
] }, c.keyHint);
|
|
5428
5474
|
}) })
|
|
5429
5475
|
] })
|
|
@@ -5433,11 +5479,11 @@ function Sidebar() {
|
|
|
5433
5479
|
}
|
|
5434
5480
|
|
|
5435
5481
|
// src/ui/Ribbon.tsx
|
|
5436
|
-
import { Box as Box16, Text as
|
|
5437
|
-
import { jsx as
|
|
5482
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
5483
|
+
import { jsx as jsx15, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5438
5484
|
function Ribbon() {
|
|
5439
5485
|
const firstCommand = sidebarCommands[0];
|
|
5440
|
-
return /* @__PURE__ */
|
|
5486
|
+
return /* @__PURE__ */ jsxs16(
|
|
5441
5487
|
Box16,
|
|
5442
5488
|
{
|
|
5443
5489
|
backgroundColor: "#14171E",
|
|
@@ -5446,11 +5492,11 @@ function Ribbon() {
|
|
|
5446
5492
|
paddingX: 2,
|
|
5447
5493
|
paddingY: 1,
|
|
5448
5494
|
children: [
|
|
5449
|
-
/* @__PURE__ */
|
|
5450
|
-
/* @__PURE__ */
|
|
5451
|
-
/* @__PURE__ */
|
|
5452
|
-
/* @__PURE__ */
|
|
5453
|
-
/* @__PURE__ */
|
|
5495
|
+
/* @__PURE__ */ jsx15(Progress, {}),
|
|
5496
|
+
/* @__PURE__ */ jsx15(CurrentStep, {}),
|
|
5497
|
+
/* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", gap: 1, children: [
|
|
5498
|
+
/* @__PURE__ */ jsx15(Text17, { color: COLORS.primary, children: `[${firstCommand.keyHint}]` }),
|
|
5499
|
+
/* @__PURE__ */ jsx15(Text17, { color: COLORS.muted, children: firstCommand.description })
|
|
5454
5500
|
] })
|
|
5455
5501
|
]
|
|
5456
5502
|
}
|
|
@@ -5458,11 +5504,11 @@ function Ribbon() {
|
|
|
5458
5504
|
}
|
|
5459
5505
|
|
|
5460
5506
|
// src/ui/App.tsx
|
|
5461
|
-
import { useState as
|
|
5507
|
+
import { useState as useState11 } from "react";
|
|
5462
5508
|
|
|
5463
5509
|
// src/ui/Logs.tsx
|
|
5464
|
-
import { Box as Box17, Text as
|
|
5465
|
-
import { jsx as
|
|
5510
|
+
import { Box as Box17, Text as Text18, useInput as useInput7 } from "ink";
|
|
5511
|
+
import { jsx as jsx16, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5466
5512
|
var KIND_COLOR = {
|
|
5467
5513
|
tool: COLORS.primary,
|
|
5468
5514
|
prompt: COLORS.badge
|
|
@@ -5493,14 +5539,14 @@ function formatTimestamp(ms) {
|
|
|
5493
5539
|
function Logs() {
|
|
5494
5540
|
const logs = useWizard((s) => s.logs);
|
|
5495
5541
|
const scroll = useScrollWindow({ itemCount: logs.length, followBottom: true });
|
|
5496
|
-
|
|
5542
|
+
useInput7((_input, key) => {
|
|
5497
5543
|
if (key.upArrow) scroll.scrollBy(-1);
|
|
5498
5544
|
else if (key.downArrow) scroll.scrollBy(1);
|
|
5499
5545
|
});
|
|
5500
5546
|
const visible = logs.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
5501
|
-
return /* @__PURE__ */
|
|
5502
|
-
logs.length === 0 && /* @__PURE__ */
|
|
5503
|
-
/* @__PURE__ */
|
|
5547
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", paddingX: 4, paddingY: 2, flexGrow: 1, children: [
|
|
5548
|
+
logs.length === 0 && /* @__PURE__ */ jsx16(Text18, { color: COLORS.dim, children: "No logs yet." }),
|
|
5549
|
+
/* @__PURE__ */ jsx16(ScrollView, { scroll, children: visible.map((entry) => {
|
|
5504
5550
|
const timestamp = `[${formatTimestamp(entry.startedAt)}]`;
|
|
5505
5551
|
const durationText = entry.kind === "tool" && entry.durationMs !== void 0 ? `${entry.durationMs}ms` : "";
|
|
5506
5552
|
const rawPreview = rawInputText(entry.input);
|
|
@@ -5510,25 +5556,25 @@ function Logs() {
|
|
|
5510
5556
|
const name = truncate3(entry.name, budget);
|
|
5511
5557
|
budget -= name.length;
|
|
5512
5558
|
const preview = rawPreview ? truncate3(rawPreview, budget) : "";
|
|
5513
|
-
return /* @__PURE__ */
|
|
5514
|
-
/* @__PURE__ */
|
|
5515
|
-
/* @__PURE__ */
|
|
5516
|
-
preview && /* @__PURE__ */
|
|
5517
|
-
durationText && /* @__PURE__ */
|
|
5559
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "row", gap: ROW_GAP, children: [
|
|
5560
|
+
/* @__PURE__ */ jsx16(Text18, { color: COLORS.dim, children: timestamp }),
|
|
5561
|
+
/* @__PURE__ */ jsx16(Text18, { color: logNameColor(entry), wrap: "truncate", children: name }),
|
|
5562
|
+
preview && /* @__PURE__ */ jsx16(Text18, { color: COLORS.dim, wrap: "truncate", children: preview }),
|
|
5563
|
+
durationText && /* @__PURE__ */ jsx16(Text18, { color: COLORS.dim, children: durationText })
|
|
5518
5564
|
] }, entry.id);
|
|
5519
5565
|
}) }),
|
|
5520
|
-
/* @__PURE__ */
|
|
5566
|
+
/* @__PURE__ */ jsx16(Text18, { color: COLORS.dim, children: "\u2191/\u2193 scroll" })
|
|
5521
5567
|
] });
|
|
5522
5568
|
}
|
|
5523
5569
|
|
|
5524
5570
|
// src/ui/Tips.tsx
|
|
5525
|
-
import { useEffect as useEffect3, useRef as useRef4, useState as
|
|
5526
|
-
import { Box as Box19, Text as
|
|
5571
|
+
import { useEffect as useEffect3, useRef as useRef4, useState as useState10 } from "react";
|
|
5572
|
+
import { Box as Box19, Text as Text20 } from "ink";
|
|
5527
5573
|
import terminalLink from "terminal-link";
|
|
5528
5574
|
|
|
5529
5575
|
// src/ui/Code.tsx
|
|
5530
|
-
import { Box as Box18, Text as
|
|
5531
|
-
import { jsx as
|
|
5576
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
5577
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5532
5578
|
var TOKEN_RE = /("(?:\\.|[^"\\])*"|\btrue\b|\bfalse\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|[{}[\]:,])/g;
|
|
5533
5579
|
function highlightJson(json) {
|
|
5534
5580
|
const parts = json.split(TOKEN_RE);
|
|
@@ -5537,22 +5583,22 @@ function highlightJson(json) {
|
|
|
5537
5583
|
if (part[0] === '"') {
|
|
5538
5584
|
const next = parts.slice(i + 1).find((p) => p.trim());
|
|
5539
5585
|
const isKey = next?.trimStart().startsWith(":");
|
|
5540
|
-
return /* @__PURE__ */
|
|
5586
|
+
return /* @__PURE__ */ jsx17(Text19, { color: isKey ? "cyan" : "green", children: part }, i);
|
|
5541
5587
|
}
|
|
5542
5588
|
if (part === "true" || part === "false" || part === "null") {
|
|
5543
|
-
return /* @__PURE__ */
|
|
5589
|
+
return /* @__PURE__ */ jsx17(Text19, { color: "magenta", children: part }, i);
|
|
5544
5590
|
}
|
|
5545
5591
|
if (/^-?\d/.test(part)) {
|
|
5546
|
-
return /* @__PURE__ */
|
|
5592
|
+
return /* @__PURE__ */ jsx17(Text19, { color: "yellow", children: part }, i);
|
|
5547
5593
|
}
|
|
5548
5594
|
if (/^[{}[\]:,]$/.test(part)) {
|
|
5549
|
-
return /* @__PURE__ */
|
|
5595
|
+
return /* @__PURE__ */ jsx17(Text19, { color: COLORS.dim, children: part }, i);
|
|
5550
5596
|
}
|
|
5551
|
-
return /* @__PURE__ */
|
|
5597
|
+
return /* @__PURE__ */ jsx17(Text19, { children: part }, i);
|
|
5552
5598
|
});
|
|
5553
5599
|
}
|
|
5554
5600
|
function Code({ children }) {
|
|
5555
|
-
return /* @__PURE__ */
|
|
5601
|
+
return /* @__PURE__ */ jsx17(Box18, { children: /* @__PURE__ */ jsx17(Text19, { children: highlightJson(children) }) });
|
|
5556
5602
|
}
|
|
5557
5603
|
|
|
5558
5604
|
// src/ui/copy/tips.ts
|
|
@@ -5766,26 +5812,26 @@ function tipsByIds(ids) {
|
|
|
5766
5812
|
}
|
|
5767
5813
|
|
|
5768
5814
|
// src/ui/Tips.tsx
|
|
5769
|
-
import { jsx as
|
|
5815
|
+
import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5770
5816
|
var TICK_MS = 16;
|
|
5771
5817
|
var CHUNK_HOLD_MS = 2e3;
|
|
5772
5818
|
var HOLD_MS = 12e3;
|
|
5773
5819
|
function TipTitle({ children }) {
|
|
5774
|
-
return /* @__PURE__ */
|
|
5775
|
-
/* @__PURE__ */
|
|
5776
|
-
/* @__PURE__ */
|
|
5820
|
+
return /* @__PURE__ */ jsxs18(Box19, { gap: 1, children: [
|
|
5821
|
+
/* @__PURE__ */ jsx18(Text20, { color: "cyan", children: "\u2726" }),
|
|
5822
|
+
/* @__PURE__ */ jsx18(Text20, { color: "white", bold: true, children })
|
|
5777
5823
|
] });
|
|
5778
5824
|
}
|
|
5779
5825
|
function InlineSegment({ segment }) {
|
|
5780
5826
|
switch (segment.type) {
|
|
5781
5827
|
case "highlight":
|
|
5782
|
-
return /* @__PURE__ */
|
|
5828
|
+
return /* @__PURE__ */ jsx18(Text20, { color: COLORS.success, children: segment.value });
|
|
5783
5829
|
case "link":
|
|
5784
|
-
return /* @__PURE__ */
|
|
5830
|
+
return /* @__PURE__ */ jsx18(Text20, { color: "cyan", underline: true, children: segment.href ? terminalLink(segment.value, segment.href) : segment.value });
|
|
5785
5831
|
case "codeword":
|
|
5786
|
-
return /* @__PURE__ */
|
|
5832
|
+
return /* @__PURE__ */ jsx18(Text20, { color: COLORS.highlight.fg, backgroundColor: COLORS.highlight.bg, children: segment.value });
|
|
5787
5833
|
default:
|
|
5788
|
-
return /* @__PURE__ */
|
|
5834
|
+
return /* @__PURE__ */ jsx18(Text20, { color: COLORS.muted, children: segment.value });
|
|
5789
5835
|
}
|
|
5790
5836
|
}
|
|
5791
5837
|
function TipContent({
|
|
@@ -5819,10 +5865,10 @@ function TipContent({
|
|
|
5819
5865
|
blocks.push({ type: "inline", segments: [segment] });
|
|
5820
5866
|
}
|
|
5821
5867
|
}
|
|
5822
|
-
return /* @__PURE__ */
|
|
5823
|
-
(block, i) => block.type === "code" ? /* @__PURE__ */
|
|
5868
|
+
return /* @__PURE__ */ jsx18(Box19, { flexDirection: "column", marginLeft: 2, gap: 1, children: blocks.map(
|
|
5869
|
+
(block, i) => block.type === "code" ? /* @__PURE__ */ jsx18(Code, { children: block.segment.value }, i) : /* @__PURE__ */ jsx18(Text20, { children: block.segments.map((segment, j) => /* @__PURE__ */ jsxs18(Text20, { children: [
|
|
5824
5870
|
j > 0 && " ",
|
|
5825
|
-
/* @__PURE__ */
|
|
5871
|
+
/* @__PURE__ */ jsx18(InlineSegment, { segment })
|
|
5826
5872
|
] }, j)) }, i)
|
|
5827
5873
|
) });
|
|
5828
5874
|
}
|
|
@@ -5839,8 +5885,8 @@ function Tips({
|
|
|
5839
5885
|
progress.tipIndex = 0;
|
|
5840
5886
|
progress.revealed = 0;
|
|
5841
5887
|
}
|
|
5842
|
-
const [tipIndex, setTipIndex] =
|
|
5843
|
-
const [revealed, setRevealed] =
|
|
5888
|
+
const [tipIndex, setTipIndex] = useState10(resuming ? progress.tipIndex : 0);
|
|
5889
|
+
const [revealed, setRevealed] = useState10(resuming ? progress.revealed : 0);
|
|
5844
5890
|
const tip = tips2.length > 0 ? tips2[tipIndex % tips2.length] : void 0;
|
|
5845
5891
|
const contentLength = tip?.chunks.reduce((sum, c) => sum + c.value.length, 0) ?? 0;
|
|
5846
5892
|
const totalLength = (tip?.title.length ?? 0) + contentLength;
|
|
@@ -5899,14 +5945,14 @@ function Tips({
|
|
|
5899
5945
|
if (!tip) return null;
|
|
5900
5946
|
const titleRevealed = tip.title.slice(0, revealed);
|
|
5901
5947
|
const contentRevealed = Math.max(0, revealed - tip.title.length);
|
|
5902
|
-
return /* @__PURE__ */
|
|
5903
|
-
/* @__PURE__ */
|
|
5904
|
-
/* @__PURE__ */
|
|
5948
|
+
return /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", marginBottom: 1, gap: 1, children: [
|
|
5949
|
+
/* @__PURE__ */ jsx18(TipTitle, { children: titleRevealed }),
|
|
5950
|
+
/* @__PURE__ */ jsx18(TipContent, { chunks: tip.chunks, revealed: contentRevealed })
|
|
5905
5951
|
] });
|
|
5906
5952
|
}
|
|
5907
5953
|
|
|
5908
5954
|
// src/ui/App.tsx
|
|
5909
|
-
import { jsx as
|
|
5955
|
+
import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5910
5956
|
function App() {
|
|
5911
5957
|
const {
|
|
5912
5958
|
phase,
|
|
@@ -5922,8 +5968,8 @@ function App() {
|
|
|
5922
5968
|
} = useWizard();
|
|
5923
5969
|
const { exit } = useApp();
|
|
5924
5970
|
const { columns, rows } = useWindowSize7();
|
|
5925
|
-
const [showLogs, setShowLogs] =
|
|
5926
|
-
const [tipState, setTipState] =
|
|
5971
|
+
const [showLogs, setShowLogs] = useState11(false);
|
|
5972
|
+
const [tipState, setTipState] = useState11("idle");
|
|
5927
5973
|
const finished = phase === "done" || phase === "error";
|
|
5928
5974
|
const currentStep = steps[currentStepIndex];
|
|
5929
5975
|
const stepDef = workflow ? getWorkflow(workflow.id)?.steps.find((s) => s.id === currentStep?.id) : void 0;
|
|
@@ -5936,7 +5982,7 @@ function App() {
|
|
|
5936
5982
|
const showTips = stepHasTips && (phase === "running" && currentStep?.status === "running" || isCommandApprovalPrompt || holdForTip);
|
|
5937
5983
|
const showNoticesInMain = !stepHasTips;
|
|
5938
5984
|
const showNotices = (!isAwaitingUserInput || holdForTip) && !review2;
|
|
5939
|
-
|
|
5985
|
+
useInput8(
|
|
5940
5986
|
(_input, key) => {
|
|
5941
5987
|
if (key.return) {
|
|
5942
5988
|
exit();
|
|
@@ -5944,7 +5990,7 @@ function App() {
|
|
|
5944
5990
|
},
|
|
5945
5991
|
{ isActive: finished }
|
|
5946
5992
|
);
|
|
5947
|
-
|
|
5993
|
+
useInput8((_input, key) => {
|
|
5948
5994
|
if (phase === "idle" || phase === "authenticating") return;
|
|
5949
5995
|
if (key.tab) {
|
|
5950
5996
|
setShowLogs(!showLogs);
|
|
@@ -5956,7 +6002,7 @@ function App() {
|
|
|
5956
6002
|
}
|
|
5957
6003
|
});
|
|
5958
6004
|
const escOwnedElsewhere = phase === "idle" || phase === "authenticating" || phase === "awaitingInput" && !holdForTip && (inputReq?.promptType === "enterToContinue" || inputReq?.promptType === "commandApproval");
|
|
5959
|
-
|
|
6005
|
+
useInput8((_input, key) => {
|
|
5960
6006
|
if (escOwnedElsewhere) return;
|
|
5961
6007
|
if (key.escape) {
|
|
5962
6008
|
track("AI Wizard Interaction", {
|
|
@@ -5975,7 +6021,7 @@ function App() {
|
|
|
5975
6021
|
/* Clamped to exactly the viewport: a taller frame makes Ink clear and repaint
|
|
5976
6022
|
the whole screen, and the scrolling throws off its cursor arithmetic —
|
|
5977
6023
|
flicker and leftover rows. */
|
|
5978
|
-
/* @__PURE__ */
|
|
6024
|
+
/* @__PURE__ */ jsxs19(
|
|
5979
6025
|
Box20,
|
|
5980
6026
|
{
|
|
5981
6027
|
backgroundColor: COLORS.bg.main,
|
|
@@ -5984,7 +6030,7 @@ function App() {
|
|
|
5984
6030
|
height: scrollsPastViewport ? void 0 : rows,
|
|
5985
6031
|
overflow: scrollsPastViewport ? "visible" : "hidden",
|
|
5986
6032
|
children: [
|
|
5987
|
-
mainWindowVisible && /* @__PURE__ */
|
|
6033
|
+
mainWindowVisible && /* @__PURE__ */ jsxs19(
|
|
5988
6034
|
Box20,
|
|
5989
6035
|
{
|
|
5990
6036
|
flexDirection,
|
|
@@ -5992,7 +6038,7 @@ function App() {
|
|
|
5992
6038
|
maxHeight: rows,
|
|
5993
6039
|
justifyContent: "space-between",
|
|
5994
6040
|
children: [
|
|
5995
|
-
showLogs ? /* @__PURE__ */
|
|
6041
|
+
showLogs ? /* @__PURE__ */ jsx19(Logs, {}) : /* @__PURE__ */ jsxs19(
|
|
5996
6042
|
Box20,
|
|
5997
6043
|
{
|
|
5998
6044
|
flexDirection: "column",
|
|
@@ -6002,30 +6048,30 @@ function App() {
|
|
|
6002
6048
|
flexGrow: 1,
|
|
6003
6049
|
gap: 1,
|
|
6004
6050
|
children: [
|
|
6005
|
-
/* @__PURE__ */
|
|
6006
|
-
phase === "preflight" && !user && /* @__PURE__ */
|
|
6007
|
-
/* @__PURE__ */
|
|
6051
|
+
/* @__PURE__ */ jsxs19(Box20, { flexGrow: 2, flexDirection: "column", children: [
|
|
6052
|
+
phase === "preflight" && !user && /* @__PURE__ */ jsx19(Box20, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs19(Text21, { color: COLORS.strong, bold: true, children: [
|
|
6053
|
+
/* @__PURE__ */ jsx19(Spinner3, { type: "dots" }),
|
|
6008
6054
|
" Signing in to Algolia"
|
|
6009
6055
|
] }) }),
|
|
6010
|
-
phase === "preflight" && user && /* @__PURE__ */
|
|
6011
|
-
/* @__PURE__ */
|
|
6056
|
+
phase === "preflight" && user && /* @__PURE__ */ jsx19(Box20, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs19(Text21, { color: COLORS.strong, bold: true, children: [
|
|
6057
|
+
/* @__PURE__ */ jsx19(Spinner3, { type: "dots" }),
|
|
6012
6058
|
" Getting things ready"
|
|
6013
6059
|
] }) }),
|
|
6014
|
-
phase === "authenticating" && /* @__PURE__ */
|
|
6015
|
-
/* @__PURE__ */
|
|
6016
|
-
/* @__PURE__ */
|
|
6060
|
+
phase === "authenticating" && /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", marginBottom: 1, children: [
|
|
6061
|
+
/* @__PURE__ */ jsxs19(Text21, { color: COLORS.strong, bold: true, children: [
|
|
6062
|
+
/* @__PURE__ */ jsx19(Spinner3, { type: "dots" }),
|
|
6017
6063
|
" Signing in to Algolia"
|
|
6018
6064
|
] }),
|
|
6019
|
-
/* @__PURE__ */
|
|
6065
|
+
/* @__PURE__ */ jsx19(Text21, { color: COLORS.muted, children: "A browser window will open \u2014 complete sign-in there." })
|
|
6020
6066
|
] }),
|
|
6021
|
-
settingUpAppId && /* @__PURE__ */
|
|
6022
|
-
/* @__PURE__ */
|
|
6067
|
+
settingUpAppId && /* @__PURE__ */ jsx19(Box20, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs19(Text21, { color: COLORS.strong, bold: true, children: [
|
|
6068
|
+
/* @__PURE__ */ jsx19(Spinner3, { type: "dots" }),
|
|
6023
6069
|
" Setting up Wizard using app",
|
|
6024
6070
|
" ",
|
|
6025
6071
|
settingUpAppId
|
|
6026
6072
|
] }) }),
|
|
6027
|
-
/* @__PURE__ */
|
|
6028
|
-
showTips && currentStep && /* @__PURE__ */
|
|
6073
|
+
/* @__PURE__ */ jsx19(CliOutput, {}),
|
|
6074
|
+
showTips && currentStep && /* @__PURE__ */ jsx19(
|
|
6029
6075
|
Tips,
|
|
6030
6076
|
{
|
|
6031
6077
|
stepId: currentStep.id,
|
|
@@ -6033,24 +6079,24 @@ function App() {
|
|
|
6033
6079
|
onRevealStateChange: setTipState
|
|
6034
6080
|
}
|
|
6035
6081
|
),
|
|
6036
|
-
showNoticesInMain && showNotices && /* @__PURE__ */
|
|
6037
|
-
/* @__PURE__ */
|
|
6038
|
-
!showTips && /* @__PURE__ */
|
|
6039
|
-
phase === "error" && error && /* @__PURE__ */
|
|
6082
|
+
showNoticesInMain && showNotices && /* @__PURE__ */ jsx19(Notices, { showAll: true, border: false }),
|
|
6083
|
+
/* @__PURE__ */ jsx19(Review, {}),
|
|
6084
|
+
!showTips && /* @__PURE__ */ jsx19(PromptInput, {}),
|
|
6085
|
+
phase === "error" && error && /* @__PURE__ */ jsx19(Box20, { marginTop: 1, children: /* @__PURE__ */ jsxs19(Text21, { color: COLORS.status.error, children: [
|
|
6040
6086
|
"\u2716 ",
|
|
6041
6087
|
error
|
|
6042
6088
|
] }) })
|
|
6043
6089
|
] }),
|
|
6044
|
-
!showNoticesInMain && showNotices && /* @__PURE__ */
|
|
6045
|
-
showTips && !holdForTip && /* @__PURE__ */
|
|
6090
|
+
!showNoticesInMain && showNotices && /* @__PURE__ */ jsx19(Notices, {}),
|
|
6091
|
+
showTips && !holdForTip && /* @__PURE__ */ jsx19(PromptInput, {})
|
|
6046
6092
|
]
|
|
6047
6093
|
}
|
|
6048
6094
|
),
|
|
6049
|
-
showSidebar ? /* @__PURE__ */
|
|
6095
|
+
showSidebar ? /* @__PURE__ */ jsx19(Sidebar, {}) : /* @__PURE__ */ jsx19(Ribbon, {})
|
|
6050
6096
|
]
|
|
6051
6097
|
}
|
|
6052
6098
|
),
|
|
6053
|
-
phase === "idle" && (homeScreen === "learnMore" ? /* @__PURE__ */
|
|
6099
|
+
phase === "idle" && (homeScreen === "learnMore" ? /* @__PURE__ */ jsx19(LearnMore, {}) : /* @__PURE__ */ jsx19(Welcome, {}))
|
|
6054
6100
|
]
|
|
6055
6101
|
}
|
|
6056
6102
|
)
|
|
@@ -6417,7 +6463,7 @@ function delay(ms) {
|
|
|
6417
6463
|
}
|
|
6418
6464
|
|
|
6419
6465
|
// src/main.tsx
|
|
6420
|
-
import { jsx as
|
|
6466
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
6421
6467
|
async function startup() {
|
|
6422
6468
|
setProjectRoot(process.cwd());
|
|
6423
6469
|
let args;
|
|
@@ -6468,7 +6514,7 @@ ${formatStepList(workflow)}`);
|
|
|
6468
6514
|
async function run(opts) {
|
|
6469
6515
|
const { workflow, skipResumePrompt } = opts;
|
|
6470
6516
|
const store = useWizard.getState();
|
|
6471
|
-
const instance = render(/* @__PURE__ */
|
|
6517
|
+
const instance = render(/* @__PURE__ */ jsx20(App, {}), { incrementalRendering: true });
|
|
6472
6518
|
await store.waitForStart();
|
|
6473
6519
|
store.syncSteps(
|
|
6474
6520
|
workflow.steps.map((s) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/wizard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"description": "Magically implement Algolia functionality in your codebase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"ink": "^7.0.5",
|
|
59
59
|
"ink-picture": "^2.1.0",
|
|
60
60
|
"ink-spinner": "^5.0.0",
|
|
61
|
-
"ink-text-input": "^6.0.0",
|
|
62
61
|
"ioredis": "^5.11.1",
|
|
63
62
|
"nanoid": "^5.1.15",
|
|
64
63
|
"pino": "^10.3.1",
|