@algolia/wizard 0.22.0 → 0.23.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 +240 -181
- package/package.json +1 -1
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
|
|
7
|
+
import { Box as Box17, Text as Text17, useApp, useInput as useInput7, useWindowSize as useWindowSize8 } from "ink";
|
|
8
8
|
|
|
9
9
|
// src/core/store.ts
|
|
10
10
|
import { create } from "zustand";
|
|
@@ -632,7 +632,7 @@ function Notices() {
|
|
|
632
632
|
}
|
|
633
633
|
|
|
634
634
|
// src/ui/PromptInput.tsx
|
|
635
|
-
import { Box as
|
|
635
|
+
import { Box as Box9, Text as Text9, useInput as useInput3 } from "ink";
|
|
636
636
|
import TextInput from "ink-text-input";
|
|
637
637
|
import { useState as useState5 } from "react";
|
|
638
638
|
|
|
@@ -709,7 +709,7 @@ function CommandApproval({
|
|
|
709
709
|
}
|
|
710
710
|
|
|
711
711
|
// src/ui/SelectPrompt.tsx
|
|
712
|
-
import { Box as
|
|
712
|
+
import { Box as Box8, Text as Text8, useInput as useInput2, useWindowSize as useWindowSize5 } from "ink";
|
|
713
713
|
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3, useState as useState4 } from "react";
|
|
714
714
|
|
|
715
715
|
// src/ui/ScrollView.tsx
|
|
@@ -800,8 +800,47 @@ function ScrollView({ scroll, children }) {
|
|
|
800
800
|
] });
|
|
801
801
|
}
|
|
802
802
|
|
|
803
|
-
// src/ui/
|
|
803
|
+
// src/ui/SelectRow.tsx
|
|
804
|
+
import { Box as Box7, Text as Text7 } from "ink";
|
|
804
805
|
import { jsx as jsx5, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
806
|
+
function SelectRow({
|
|
807
|
+
highlighted,
|
|
808
|
+
label,
|
|
809
|
+
width,
|
|
810
|
+
labelWidth,
|
|
811
|
+
highlightBackground = true,
|
|
812
|
+
usePadding = false,
|
|
813
|
+
children
|
|
814
|
+
}) {
|
|
815
|
+
const labelColor = highlighted ? highlightBackground ? COLORS.highlight.fg : COLORS.success : void 0;
|
|
816
|
+
return /* @__PURE__ */ jsxs6(
|
|
817
|
+
Box7,
|
|
818
|
+
{
|
|
819
|
+
width,
|
|
820
|
+
paddingX: usePadding ? 1 : 0,
|
|
821
|
+
paddingY: usePadding ? 1 : 0,
|
|
822
|
+
backgroundColor: highlighted && highlightBackground ? COLORS.highlight.bg : void 0,
|
|
823
|
+
children: [
|
|
824
|
+
/* @__PURE__ */ jsx5(Box7, { width: labelWidth, children: /* @__PURE__ */ jsxs6(
|
|
825
|
+
Text7,
|
|
826
|
+
{
|
|
827
|
+
color: labelColor,
|
|
828
|
+
bold: highlighted && !highlightBackground,
|
|
829
|
+
wrap: "truncate",
|
|
830
|
+
children: [
|
|
831
|
+
highlighted ? "\u276F " : " ",
|
|
832
|
+
label
|
|
833
|
+
]
|
|
834
|
+
}
|
|
835
|
+
) }),
|
|
836
|
+
children
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// src/ui/SelectPrompt.tsx
|
|
843
|
+
import { jsx as jsx6, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
805
844
|
var CANCEL = "cancel";
|
|
806
845
|
var ARROW_WIDTH = 4;
|
|
807
846
|
var COLUMN_GAP = 2;
|
|
@@ -886,56 +925,50 @@ function SelectPrompt({
|
|
|
886
925
|
}
|
|
887
926
|
}
|
|
888
927
|
});
|
|
889
|
-
return /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
error && /* @__PURE__ */
|
|
892
|
-
messages?.map((m, i) => /* @__PURE__ */
|
|
893
|
-
table && /* @__PURE__ */
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
question && /* @__PURE__ */
|
|
896
|
-
helpText && /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ jsx6(Box8, { ref: containerRef, flexGrow: 1, children: /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, width, children: [
|
|
929
|
+
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, flexShrink: 0, children: [
|
|
930
|
+
error && /* @__PURE__ */ jsx6(Text8, { color: COLORS.danger, children: error }),
|
|
931
|
+
messages?.map((m, i) => /* @__PURE__ */ jsx6(Text8, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
932
|
+
table && /* @__PURE__ */ jsx6(Table, { columns: table.columns, rows: table.rows }),
|
|
933
|
+
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
|
|
934
|
+
question && /* @__PURE__ */ jsx6(Text8, { color: COLORS.muted, children: question }),
|
|
935
|
+
helpText && /* @__PURE__ */ jsx6(Text8, { color: COLORS.dim, children: helpText })
|
|
897
936
|
] })
|
|
898
937
|
] }),
|
|
899
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ jsx6(ScrollView, { scroll, children: visible.map((option, visibleIndex) => {
|
|
900
939
|
const i = scroll.offset + visibleIndex;
|
|
901
940
|
const highlighted = i === index;
|
|
902
941
|
const isCancel = i === cancelIndex;
|
|
903
942
|
const bullet = multi && !isCancel ? checked.has(i) ? "\u25CF " : "\u25CB " : "";
|
|
904
943
|
const sec = isCancel ? void 0 : secondary?.[i];
|
|
905
|
-
const labelColor = highlighted ? COLORS.highlight.fg : void 0;
|
|
906
|
-
const label = /* @__PURE__ */ jsxs6(Text7, { color: labelColor, wrap: "truncate", children: [
|
|
907
|
-
highlighted ? "\u276F " : " ",
|
|
908
|
-
bullet,
|
|
909
|
-
option
|
|
910
|
-
] });
|
|
911
944
|
const isText = sec?.kind === "text";
|
|
912
|
-
return /* @__PURE__ */
|
|
913
|
-
|
|
945
|
+
return /* @__PURE__ */ jsxs7(
|
|
946
|
+
SelectRow,
|
|
914
947
|
{
|
|
948
|
+
highlighted,
|
|
915
949
|
width: isText ? "100%" : barWidth,
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
950
|
+
labelWidth: isText ? labelWidth : barLabelWidth,
|
|
951
|
+
label: `${bullet}${option}`,
|
|
952
|
+
usePadding: true,
|
|
919
953
|
children: [
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
|
|
922
|
-
Text7,
|
|
954
|
+
isText && textWidth > 0 && /* @__PURE__ */ jsx6(Box8, { width: textWidth, children: /* @__PURE__ */ jsx6(
|
|
955
|
+
Text8,
|
|
923
956
|
{
|
|
924
957
|
wrap: "truncate",
|
|
925
958
|
color: highlighted ? COLORS.primary : COLORS.muted,
|
|
926
959
|
children: sec.value
|
|
927
960
|
}
|
|
928
961
|
) }),
|
|
929
|
-
sec?.kind === "badge" && /* @__PURE__ */
|
|
962
|
+
sec?.kind === "badge" && /* @__PURE__ */ jsx6(Box8, { width: badgeWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx6(Text8, { color: COLORS.badge, wrap: "truncate", children: sec.value }) })
|
|
930
963
|
]
|
|
931
964
|
},
|
|
932
965
|
`row-${i}`
|
|
933
966
|
);
|
|
934
967
|
}) }),
|
|
935
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ jsx6(Box8, { flexShrink: 0, children: /* @__PURE__ */ jsx6(Text8, { color: COLORS.dim, children: hints.map(({ key, label }, i) => /* @__PURE__ */ jsxs7(Text8, { color: COLORS.dim, children: [
|
|
936
969
|
i > 0 ? " " : "",
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ jsx6(Text8, { color: COLORS.primary, children: key }),
|
|
971
|
+
/* @__PURE__ */ jsxs7(Text8, { color: COLORS.dim, children: [
|
|
939
972
|
" ",
|
|
940
973
|
label
|
|
941
974
|
] })
|
|
@@ -944,7 +977,7 @@ function SelectPrompt({
|
|
|
944
977
|
}
|
|
945
978
|
|
|
946
979
|
// src/ui/PromptInput.tsx
|
|
947
|
-
import { jsx as
|
|
980
|
+
import { jsx as jsx7, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
948
981
|
var ACCEPT_REJECT_OPTIONS = ["Accept", "Reject"];
|
|
949
982
|
function EnterToContinuePrompt({
|
|
950
983
|
question,
|
|
@@ -955,12 +988,12 @@ function EnterToContinuePrompt({
|
|
|
955
988
|
if (key.return) onDecide(true);
|
|
956
989
|
else if (key.escape) onDecide(false);
|
|
957
990
|
});
|
|
958
|
-
return /* @__PURE__ */
|
|
959
|
-
messages?.map((m, i) => /* @__PURE__ */
|
|
960
|
-
question && /* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", gap: 1, children: [
|
|
992
|
+
messages?.map((m, i) => /* @__PURE__ */ jsx7(Text9, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
993
|
+
question && /* @__PURE__ */ jsx7(Text9, { color: COLORS.primary, children: question }),
|
|
994
|
+
/* @__PURE__ */ jsxs8(Box9, { gap: 1, flexDirection: "column", children: [
|
|
995
|
+
/* @__PURE__ */ jsx7(NextAction, { action: "continue", keyHint: "enter" }),
|
|
996
|
+
/* @__PURE__ */ jsx7(NextAction, { action: "decline", keyHint: "esc", hierarchy: "secondary" })
|
|
964
997
|
] })
|
|
965
998
|
] });
|
|
966
999
|
}
|
|
@@ -968,11 +1001,11 @@ function PromptInput() {
|
|
|
968
1001
|
const { phase, inputReq, submitInput } = useWizard();
|
|
969
1002
|
const [draft, setDraft] = useState5("");
|
|
970
1003
|
if (phase === "done" || phase === "error") {
|
|
971
|
-
return /* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ jsx7(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx7(Text9, { color: "gray", dimColor: true, children: "Press Enter or Esc to exit" }) });
|
|
972
1005
|
}
|
|
973
1006
|
if (phase !== "awaitingInput" || !inputReq) return null;
|
|
974
1007
|
if (inputReq.promptType === "multipleChoice") {
|
|
975
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ jsx7(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx7(
|
|
976
1009
|
SelectPrompt,
|
|
977
1010
|
{
|
|
978
1011
|
question: inputReq.prompt,
|
|
@@ -989,7 +1022,7 @@ function PromptInput() {
|
|
|
989
1022
|
) });
|
|
990
1023
|
}
|
|
991
1024
|
if (inputReq.promptType === "multiSelect") {
|
|
992
|
-
return /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ jsx7(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx7(
|
|
993
1026
|
SelectPrompt,
|
|
994
1027
|
{
|
|
995
1028
|
multi: true,
|
|
@@ -1004,7 +1037,7 @@ function PromptInput() {
|
|
|
1004
1037
|
) });
|
|
1005
1038
|
}
|
|
1006
1039
|
if (inputReq.promptType === "notice") {
|
|
1007
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ jsx7(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx7(
|
|
1008
1041
|
SelectPrompt,
|
|
1009
1042
|
{
|
|
1010
1043
|
question: inputReq.prompt,
|
|
@@ -1015,7 +1048,7 @@ function PromptInput() {
|
|
|
1015
1048
|
) });
|
|
1016
1049
|
}
|
|
1017
1050
|
if (inputReq.promptType === "enterToContinue") {
|
|
1018
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ jsx7(
|
|
1019
1052
|
EnterToContinuePrompt,
|
|
1020
1053
|
{
|
|
1021
1054
|
question: inputReq.prompt,
|
|
@@ -1025,11 +1058,11 @@ function PromptInput() {
|
|
|
1025
1058
|
);
|
|
1026
1059
|
}
|
|
1027
1060
|
if (inputReq.promptType === "commandApproval" && inputReq.command) {
|
|
1028
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ jsx7(CommandApproval, { command: inputReq.command, onDecide: submitInput });
|
|
1029
1062
|
}
|
|
1030
1063
|
if (inputReq.promptType === "acceptReject") {
|
|
1031
1064
|
const labels = inputReq.options?.length ? inputReq.options : ACCEPT_REJECT_OPTIONS;
|
|
1032
|
-
return /* @__PURE__ */
|
|
1065
|
+
return /* @__PURE__ */ jsx7(Box9, { flexGrow: 1, children: /* @__PURE__ */ jsx7(
|
|
1033
1066
|
SelectPrompt,
|
|
1034
1067
|
{
|
|
1035
1068
|
question: inputReq.prompt,
|
|
@@ -1040,15 +1073,15 @@ function PromptInput() {
|
|
|
1040
1073
|
}
|
|
1041
1074
|
) });
|
|
1042
1075
|
}
|
|
1043
|
-
return /* @__PURE__ */
|
|
1044
|
-
inputReq.error && /* @__PURE__ */
|
|
1045
|
-
inputReq.messages?.map((m, i) => /* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", children: [
|
|
1077
|
+
inputReq.error && /* @__PURE__ */ jsx7(Text9, { color: COLORS.danger, children: inputReq.error }),
|
|
1078
|
+
inputReq.messages?.map((m, i) => /* @__PURE__ */ jsx7(Text9, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
1079
|
+
/* @__PURE__ */ jsxs8(Box9, { children: [
|
|
1080
|
+
/* @__PURE__ */ jsxs8(Text9, { color: COLORS.primary, children: [
|
|
1048
1081
|
inputReq.prompt,
|
|
1049
1082
|
" "
|
|
1050
1083
|
] }),
|
|
1051
|
-
/* @__PURE__ */
|
|
1084
|
+
/* @__PURE__ */ jsx7(
|
|
1052
1085
|
TextInput,
|
|
1053
1086
|
{
|
|
1054
1087
|
value: draft,
|
|
@@ -1066,7 +1099,8 @@ function PromptInput() {
|
|
|
1066
1099
|
// src/ui/Welcome.tsx
|
|
1067
1100
|
import { dirname as dirname2, join as join3 } from "node:path";
|
|
1068
1101
|
import { fileURLToPath } from "node:url";
|
|
1069
|
-
import {
|
|
1102
|
+
import { useState as useState6 } from "react";
|
|
1103
|
+
import { Box as Box10, Spacer, Text as Text10, useInput as useInput4, useWindowSize as useWindowSize6 } from "ink";
|
|
1070
1104
|
|
|
1071
1105
|
// src/ui/copy/welcome.ts
|
|
1072
1106
|
var sidebarItems = [
|
|
@@ -1094,7 +1128,7 @@ var sidebarItems = [
|
|
|
1094
1128
|
|
|
1095
1129
|
// src/ui/Welcome.tsx
|
|
1096
1130
|
import Image, { TerminalInfoContext, defaultTerminalInfo } from "ink-picture";
|
|
1097
|
-
import { jsx as
|
|
1131
|
+
import { jsx as jsx8, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1098
1132
|
var IMAGE_PATH = join3(dirname2(fileURLToPath(import.meta.url)), "algolia.png");
|
|
1099
1133
|
var TERMINAL_INFO = {
|
|
1100
1134
|
...defaultTerminalInfo,
|
|
@@ -1105,14 +1139,14 @@ function SidebarItem({
|
|
|
1105
1139
|
title,
|
|
1106
1140
|
description
|
|
1107
1141
|
}) {
|
|
1108
|
-
return /* @__PURE__ */
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1142
|
+
return /* @__PURE__ */ jsxs9(Box10, { flexDirection: "column", children: [
|
|
1143
|
+
/* @__PURE__ */ jsxs9(Box10, { gap: 1, children: [
|
|
1144
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.success, children: "\u2192" }),
|
|
1145
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.strong, bold: true, children: title })
|
|
1112
1146
|
] }),
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1147
|
+
/* @__PURE__ */ jsxs9(Box10, { flexDirection: "row", gap: 2, children: [
|
|
1148
|
+
/* @__PURE__ */ jsx8(Spacer, {}),
|
|
1149
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.muted, children: description })
|
|
1116
1150
|
] })
|
|
1117
1151
|
] });
|
|
1118
1152
|
}
|
|
@@ -1120,9 +1154,19 @@ function Welcome() {
|
|
|
1120
1154
|
const confirmStart = useWizard((s) => s.confirmStart);
|
|
1121
1155
|
const openLearnMore = useWizard((s) => s.openLearnMore);
|
|
1122
1156
|
const { rows } = useWindowSize6();
|
|
1157
|
+
const actions = [
|
|
1158
|
+
{ label: "start wizard", run: confirmStart },
|
|
1159
|
+
{ label: "learn more", run: openLearnMore }
|
|
1160
|
+
];
|
|
1161
|
+
const [index, setIndex] = useState6(0);
|
|
1123
1162
|
useInput4((input, key) => {
|
|
1124
|
-
if (key.
|
|
1125
|
-
|
|
1163
|
+
if (key.upArrow || input === "k") {
|
|
1164
|
+
setIndex((i) => (i - 1 + actions.length) % actions.length);
|
|
1165
|
+
} else if (key.downArrow || input === "j") {
|
|
1166
|
+
setIndex((i) => (i + 1) % actions.length);
|
|
1167
|
+
} else if (key.return) {
|
|
1168
|
+
actions[index].run();
|
|
1169
|
+
}
|
|
1126
1170
|
});
|
|
1127
1171
|
const scales = {
|
|
1128
1172
|
large: {
|
|
@@ -1138,16 +1182,16 @@ function Welcome() {
|
|
|
1138
1182
|
if (rows < 30) {
|
|
1139
1183
|
layout = scales["small"];
|
|
1140
1184
|
}
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
|
|
1185
|
+
return /* @__PURE__ */ jsxs9(Box10, { flexDirection: "row", justifyContent: "space-between", width: "100%", children: [
|
|
1186
|
+
/* @__PURE__ */ jsx8(
|
|
1187
|
+
Box10,
|
|
1144
1188
|
{
|
|
1145
1189
|
paddingY: layout.main.padding.y,
|
|
1146
1190
|
paddingX: layout.main.padding.x,
|
|
1147
1191
|
flexDirection: "column",
|
|
1148
1192
|
justifyContent: "center",
|
|
1149
|
-
children: /* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */
|
|
1193
|
+
children: /* @__PURE__ */ jsxs9(Box10, { flexDirection: "column", gap: 2, children: [
|
|
1194
|
+
/* @__PURE__ */ jsx8(TerminalInfoContext.Provider, { value: TERMINAL_INFO, children: /* @__PURE__ */ jsx8(
|
|
1151
1195
|
Image,
|
|
1152
1196
|
{
|
|
1153
1197
|
src: IMAGE_PATH,
|
|
@@ -1158,16 +1202,31 @@ function Welcome() {
|
|
|
1158
1202
|
protocol: "halfBlock"
|
|
1159
1203
|
}
|
|
1160
1204
|
) }),
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
|
|
1164
|
-
|
|
1205
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.muted, children: "\u2726 From zero \u2192 working search in ~10 minutes" }),
|
|
1206
|
+
/* @__PURE__ */ jsx8(Box10, { flexDirection: "column", children: actions.map((action, i) => /* @__PURE__ */ jsx8(
|
|
1207
|
+
SelectRow,
|
|
1208
|
+
{
|
|
1209
|
+
highlighted: i === index,
|
|
1210
|
+
highlightBackground: false,
|
|
1211
|
+
label: action.label
|
|
1212
|
+
},
|
|
1213
|
+
action.label
|
|
1214
|
+
)) }),
|
|
1215
|
+
/* @__PURE__ */ jsxs9(Box10, { gap: 2, children: [
|
|
1216
|
+
/* @__PURE__ */ jsxs9(Text10, { children: [
|
|
1217
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.primary, children: "[\u2191] [\u2193]" }),
|
|
1218
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.dim, children: " move" })
|
|
1219
|
+
] }),
|
|
1220
|
+
/* @__PURE__ */ jsxs9(Text10, { children: [
|
|
1221
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.primary, children: "[enter]" }),
|
|
1222
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.dim, children: " confirm" })
|
|
1223
|
+
] })
|
|
1165
1224
|
] })
|
|
1166
1225
|
] })
|
|
1167
1226
|
}
|
|
1168
1227
|
),
|
|
1169
|
-
/* @__PURE__ */
|
|
1170
|
-
|
|
1228
|
+
/* @__PURE__ */ jsxs9(
|
|
1229
|
+
Box10,
|
|
1171
1230
|
{
|
|
1172
1231
|
backgroundColor: COLORS.bg.sidebar,
|
|
1173
1232
|
width: 40,
|
|
@@ -1177,8 +1236,8 @@ function Welcome() {
|
|
|
1177
1236
|
flexDirection: "column",
|
|
1178
1237
|
justifyContent: "center",
|
|
1179
1238
|
children: [
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
sidebarItems.map((i, idx) => /* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ jsx8(Text10, { color: COLORS.muted, children: "WHAT THIS WIZARD WILL DO" }),
|
|
1240
|
+
sidebarItems.map((i, idx) => /* @__PURE__ */ jsx8(SidebarItem, { title: i.title, description: i.description }, idx))
|
|
1182
1241
|
]
|
|
1183
1242
|
}
|
|
1184
1243
|
)
|
|
@@ -1187,7 +1246,7 @@ function Welcome() {
|
|
|
1187
1246
|
|
|
1188
1247
|
// src/ui/LearnMore.tsx
|
|
1189
1248
|
import { Fragment as Fragment2 } from "react";
|
|
1190
|
-
import { Box as
|
|
1249
|
+
import { Box as Box11, Text as Text11, useInput as useInput5, useWindowSize as useWindowSize7 } from "ink";
|
|
1191
1250
|
|
|
1192
1251
|
// src/ui/copy/learn-more.ts
|
|
1193
1252
|
var accessIntro = "Everything runs locally on your machine. Nothing is written or sent without an explicit yes from you.";
|
|
@@ -1229,7 +1288,7 @@ var policyLinks = [
|
|
|
1229
1288
|
];
|
|
1230
1289
|
|
|
1231
1290
|
// src/ui/LearnMore.tsx
|
|
1232
|
-
import { jsx as
|
|
1291
|
+
import { jsx as jsx9, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1233
1292
|
var TAG_COLORS = {
|
|
1234
1293
|
READ: COLORS.success,
|
|
1235
1294
|
WRITE: COLORS.badge,
|
|
@@ -1246,12 +1305,12 @@ function NeverLine({
|
|
|
1246
1305
|
}) {
|
|
1247
1306
|
const used = segments.reduce((n, s) => n + s.text.length, 0);
|
|
1248
1307
|
const rightPad = Math.max(0, width - 2 - NEVER_BOX_PAD_X - used);
|
|
1249
|
-
return /* @__PURE__ */
|
|
1250
|
-
/* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ jsxs10(Text11, { color: COLORS.primary, children: [
|
|
1309
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.danger, children: "\u2502" }),
|
|
1251
1310
|
" ".repeat(NEVER_BOX_PAD_X),
|
|
1252
|
-
segments.map((s, i) => /* @__PURE__ */
|
|
1311
|
+
segments.map((s, i) => /* @__PURE__ */ jsx9(Text11, { color: s.color, bold: s.bold, children: s.text }, i)),
|
|
1253
1312
|
" ".repeat(rightPad),
|
|
1254
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.danger, children: "\u2502" })
|
|
1255
1314
|
] });
|
|
1256
1315
|
}
|
|
1257
1316
|
function LearnMore() {
|
|
@@ -1263,8 +1322,8 @@ function LearnMore() {
|
|
|
1263
1322
|
if (key.escape) backToHome();
|
|
1264
1323
|
else if (key.return) confirmStart();
|
|
1265
1324
|
});
|
|
1266
|
-
return /* @__PURE__ */
|
|
1267
|
-
|
|
1325
|
+
return /* @__PURE__ */ jsxs10(
|
|
1326
|
+
Box11,
|
|
1268
1327
|
{
|
|
1269
1328
|
flexDirection: "column",
|
|
1270
1329
|
paddingX: PADDING_X,
|
|
@@ -1272,31 +1331,31 @@ function LearnMore() {
|
|
|
1272
1331
|
width: "100%",
|
|
1273
1332
|
gap: 1,
|
|
1274
1333
|
children: [
|
|
1275
|
-
/* @__PURE__ */
|
|
1276
|
-
/* @__PURE__ */
|
|
1277
|
-
/* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.strong, bold: true, children: "What algolia wizard accesses" }),
|
|
1335
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: accessIntro }),
|
|
1336
|
+
/* @__PURE__ */ jsx9(Box11, { flexDirection: "column", children: accessItems.map((item) => /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", marginTop: 1, children: [
|
|
1337
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.border, children: "\u2500".repeat(dividerWidth) }),
|
|
1338
|
+
/* @__PURE__ */ jsxs10(Box11, { flexDirection: "row", gap: 1, marginTop: 1, children: [
|
|
1339
|
+
/* @__PURE__ */ jsx9(Box11, { width: TAG_COLUMN_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx9(Text11, { color: TAG_COLORS[item.tag], bold: true, children: `[${item.tag}]` }) }),
|
|
1340
|
+
/* @__PURE__ */ jsx9(Box11, { flexDirection: "column", children: /* @__PURE__ */ jsxs10(Text11, { color: COLORS.primary, children: [
|
|
1341
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.strong, bold: true, children: item.title }),
|
|
1342
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: ` \u2014 ${item.description}` })
|
|
1284
1343
|
] }) })
|
|
1285
1344
|
] })
|
|
1286
1345
|
] }, item.tag)) }),
|
|
1287
|
-
/* @__PURE__ */
|
|
1288
|
-
/* @__PURE__ */
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ jsxs10(Box11, { marginTop: 1, flexDirection: "column", children: [
|
|
1347
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.danger, children: `\u256D${"\u2500".repeat(Math.max(0, dividerWidth - 2))}\u256E` }),
|
|
1348
|
+
/* @__PURE__ */ jsx9(NeverLine, { width: dividerWidth }),
|
|
1349
|
+
/* @__PURE__ */ jsx9(
|
|
1291
1350
|
NeverLine,
|
|
1292
1351
|
{
|
|
1293
1352
|
width: dividerWidth,
|
|
1294
1353
|
segments: [{ text: "I NEVER", color: COLORS.danger, bold: true }]
|
|
1295
1354
|
}
|
|
1296
1355
|
),
|
|
1297
|
-
neverItems.map((item) => /* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1356
|
+
neverItems.map((item) => /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1357
|
+
/* @__PURE__ */ jsx9(NeverLine, { width: dividerWidth }),
|
|
1358
|
+
/* @__PURE__ */ jsx9(
|
|
1300
1359
|
NeverLine,
|
|
1301
1360
|
{
|
|
1302
1361
|
width: dividerWidth,
|
|
@@ -1308,24 +1367,24 @@ function LearnMore() {
|
|
|
1308
1367
|
}
|
|
1309
1368
|
)
|
|
1310
1369
|
] }, item)),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx9(NeverLine, { width: dividerWidth }),
|
|
1371
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.danger, children: `\u2570${"\u2500".repeat(Math.max(0, dividerWidth - 2))}\u256F` })
|
|
1313
1372
|
] }),
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1373
|
+
/* @__PURE__ */ jsx9(Box11, { marginTop: 1, flexDirection: "column", children: policyLinks.map((link) => /* @__PURE__ */ jsxs10(Box11, { flexDirection: "row", gap: 1, children: [
|
|
1374
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.strong, bold: true, children: `${link.label}:` }),
|
|
1375
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.accent, children: link.url })
|
|
1317
1376
|
] }, link.label)) }),
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ jsxs10(Box11, { marginTop: 1, flexDirection: "row", gap: 3, children: [
|
|
1378
|
+
/* @__PURE__ */ jsxs10(Box11, { flexDirection: "row", gap: 1, children: [
|
|
1379
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: "[" }),
|
|
1380
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.primary, children: "esc" }),
|
|
1381
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: "] back" })
|
|
1323
1382
|
] }),
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ jsxs10(Box11, { flexDirection: "row", gap: 1, children: [
|
|
1384
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: "[" }),
|
|
1385
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.primary, children: "enter" }),
|
|
1386
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: "]" }),
|
|
1387
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.success, bold: true, children: "start wizard" })
|
|
1329
1388
|
] })
|
|
1330
1389
|
] })
|
|
1331
1390
|
]
|
|
@@ -1334,10 +1393,10 @@ function LearnMore() {
|
|
|
1334
1393
|
}
|
|
1335
1394
|
|
|
1336
1395
|
// src/ui/Sidebar.tsx
|
|
1337
|
-
import { Box as
|
|
1396
|
+
import { Box as Box14, Text as Text14 } from "ink";
|
|
1338
1397
|
|
|
1339
1398
|
// src/ui/Steps.tsx
|
|
1340
|
-
import { Box as
|
|
1399
|
+
import { Box as Box12, Text as Text12 } from "ink";
|
|
1341
1400
|
import Spinner from "ink-spinner";
|
|
1342
1401
|
|
|
1343
1402
|
// src/core/persistence.ts
|
|
@@ -1366,12 +1425,12 @@ async function clearWorkflowState(workflowId) {
|
|
|
1366
1425
|
}
|
|
1367
1426
|
|
|
1368
1427
|
// src/ui/Steps.tsx
|
|
1369
|
-
import { jsx as
|
|
1428
|
+
import { jsx as jsx10, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1370
1429
|
function Steps() {
|
|
1371
1430
|
const { steps } = useWizard();
|
|
1372
1431
|
const visibleSteps = steps.filter(isStepVisible);
|
|
1373
|
-
return /* @__PURE__ */
|
|
1374
|
-
s.status === "running" ? /* @__PURE__ */
|
|
1432
|
+
return /* @__PURE__ */ jsx10(Box12, { flexDirection: "column", gap: 1, children: visibleSteps.map((s) => /* @__PURE__ */ jsx10(Box12, { flexDirection: "column", children: /* @__PURE__ */ jsxs11(Text12, { color: COLORS.status[s.status], children: [
|
|
1433
|
+
s.status === "running" ? /* @__PURE__ */ jsx10(Spinner, { type: "dots" }) : MARKER[s.status],
|
|
1375
1434
|
" ",
|
|
1376
1435
|
s.title
|
|
1377
1436
|
] }) }, s.id)) });
|
|
@@ -1380,27 +1439,27 @@ function CurrentStep() {
|
|
|
1380
1439
|
const { steps } = useWizard();
|
|
1381
1440
|
const currentStep = steps.filter(isStepVisible).find((s) => s.status === "running");
|
|
1382
1441
|
if (!currentStep) return null;
|
|
1383
|
-
return /* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ jsxs11(Text12, { color: COLORS.status.running, children: [
|
|
1443
|
+
/* @__PURE__ */ jsx10(Spinner, { type: "dots" }),
|
|
1385
1444
|
" ",
|
|
1386
1445
|
` ${currentStep.title}`
|
|
1387
1446
|
] });
|
|
1388
1447
|
}
|
|
1389
1448
|
|
|
1390
1449
|
// src/ui/Progress.tsx
|
|
1391
|
-
import { Box as
|
|
1392
|
-
import { jsx as
|
|
1450
|
+
import { Box as Box13, Text as Text13 } from "ink";
|
|
1451
|
+
import { jsx as jsx11, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1393
1452
|
function Progress() {
|
|
1394
1453
|
const { steps, currentStepIndex } = useWizard();
|
|
1395
1454
|
const visibleSteps = steps.filter(isStepVisible);
|
|
1396
1455
|
if (visibleSteps.length === 0) return null;
|
|
1397
1456
|
const visibleCountThroughCurrent = steps.slice(0, currentStepIndex + 1).filter(isStepVisible).length;
|
|
1398
1457
|
const activeStepNumber = Math.max(1, visibleCountThroughCurrent);
|
|
1399
|
-
return /* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1403
|
-
/* @__PURE__ */
|
|
1458
|
+
return /* @__PURE__ */ jsxs12(Box13, { flexDirection: "row", gap: 1, children: [
|
|
1459
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.muted, children: "STEP" }),
|
|
1460
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.strong, bold: true, children: activeStepNumber }),
|
|
1461
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.strong, bold: true, children: "/" }),
|
|
1462
|
+
/* @__PURE__ */ jsx11(Text13, { color: COLORS.strong, bold: true, children: visibleSteps.length })
|
|
1404
1463
|
] });
|
|
1405
1464
|
}
|
|
1406
1465
|
|
|
@@ -1411,10 +1470,10 @@ var sidebarCommands = [
|
|
|
1411
1470
|
];
|
|
1412
1471
|
|
|
1413
1472
|
// src/ui/Sidebar.tsx
|
|
1414
|
-
import { jsx as
|
|
1473
|
+
import { jsx as jsx12, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1415
1474
|
function Sidebar() {
|
|
1416
|
-
return /* @__PURE__ */
|
|
1417
|
-
|
|
1475
|
+
return /* @__PURE__ */ jsxs13(
|
|
1476
|
+
Box14,
|
|
1418
1477
|
{
|
|
1419
1478
|
backgroundColor: "#14171E",
|
|
1420
1479
|
width: 30,
|
|
@@ -1423,16 +1482,16 @@ function Sidebar() {
|
|
|
1423
1482
|
flexDirection: "column",
|
|
1424
1483
|
justifyContent: "space-between",
|
|
1425
1484
|
children: [
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", gap: 1, children: [
|
|
1486
|
+
/* @__PURE__ */ jsx12(Text14, { color: COLORS.muted, children: "PROGRESS" }),
|
|
1487
|
+
/* @__PURE__ */ jsx12(Steps, {})
|
|
1429
1488
|
] }),
|
|
1430
|
-
/* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
/* @__PURE__ */
|
|
1433
|
-
return /* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1435
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", gap: 1, children: [
|
|
1490
|
+
/* @__PURE__ */ jsx12(Progress, {}),
|
|
1491
|
+
/* @__PURE__ */ jsx12(Box14, { flexDirection: "column", children: sidebarCommands.map((c) => {
|
|
1492
|
+
return /* @__PURE__ */ jsxs13(Box14, { flexDirection: "row", gap: 1, children: [
|
|
1493
|
+
/* @__PURE__ */ jsx12(Text14, { color: COLORS.primary, children: `[${c.keyHint}]` }),
|
|
1494
|
+
/* @__PURE__ */ jsx12(Text14, { color: COLORS.muted, children: c.description })
|
|
1436
1495
|
] });
|
|
1437
1496
|
}) })
|
|
1438
1497
|
] })
|
|
@@ -1442,12 +1501,12 @@ function Sidebar() {
|
|
|
1442
1501
|
}
|
|
1443
1502
|
|
|
1444
1503
|
// src/ui/Ribbon.tsx
|
|
1445
|
-
import { Box as
|
|
1446
|
-
import { jsx as
|
|
1504
|
+
import { Box as Box15, Text as Text15 } from "ink";
|
|
1505
|
+
import { jsx as jsx13, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1447
1506
|
function Ribbon() {
|
|
1448
1507
|
const firstCommand = sidebarCommands[0];
|
|
1449
|
-
return /* @__PURE__ */
|
|
1450
|
-
|
|
1508
|
+
return /* @__PURE__ */ jsxs14(
|
|
1509
|
+
Box15,
|
|
1451
1510
|
{
|
|
1452
1511
|
backgroundColor: "#14171E",
|
|
1453
1512
|
flexDirection: "row",
|
|
@@ -1455,11 +1514,11 @@ function Ribbon() {
|
|
|
1455
1514
|
paddingX: 2,
|
|
1456
1515
|
paddingY: 1,
|
|
1457
1516
|
children: [
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ jsx13(Progress, {}),
|
|
1518
|
+
/* @__PURE__ */ jsx13(CurrentStep, {}),
|
|
1519
|
+
/* @__PURE__ */ jsxs14(Box15, { flexDirection: "row", gap: 1, children: [
|
|
1520
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.primary, children: `[${firstCommand.keyHint}]` }),
|
|
1521
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.muted, children: firstCommand.description })
|
|
1463
1522
|
] })
|
|
1464
1523
|
]
|
|
1465
1524
|
}
|
|
@@ -1467,11 +1526,11 @@ function Ribbon() {
|
|
|
1467
1526
|
}
|
|
1468
1527
|
|
|
1469
1528
|
// src/ui/App.tsx
|
|
1470
|
-
import { useState as
|
|
1529
|
+
import { useState as useState7 } from "react";
|
|
1471
1530
|
|
|
1472
1531
|
// src/ui/Logs.tsx
|
|
1473
|
-
import { Box as
|
|
1474
|
-
import { jsx as
|
|
1532
|
+
import { Box as Box16, Text as Text16, useInput as useInput6 } from "ink";
|
|
1533
|
+
import { jsx as jsx14, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1475
1534
|
var KIND_COLOR = {
|
|
1476
1535
|
tool: COLORS.primary,
|
|
1477
1536
|
prompt: COLORS.badge
|
|
@@ -1507,9 +1566,9 @@ function Logs() {
|
|
|
1507
1566
|
else if (key.downArrow) scroll.scrollBy(1);
|
|
1508
1567
|
});
|
|
1509
1568
|
const visible = logs.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
1510
|
-
return /* @__PURE__ */
|
|
1511
|
-
logs.length === 0 && /* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1569
|
+
return /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", paddingX: 4, paddingY: 2, flexGrow: 1, children: [
|
|
1570
|
+
logs.length === 0 && /* @__PURE__ */ jsx14(Text16, { color: COLORS.dim, children: "No logs yet." }),
|
|
1571
|
+
/* @__PURE__ */ jsx14(ScrollView, { scroll, children: visible.map((entry) => {
|
|
1513
1572
|
const timestamp = `[${formatTimestamp(entry.startedAt)}]`;
|
|
1514
1573
|
const durationText = entry.kind === "tool" && entry.durationMs !== void 0 ? `${entry.durationMs}ms` : "";
|
|
1515
1574
|
const rawPreview = rawInputText(entry.input);
|
|
@@ -1519,14 +1578,14 @@ function Logs() {
|
|
|
1519
1578
|
const name = truncate2(entry.name, budget);
|
|
1520
1579
|
budget -= name.length;
|
|
1521
1580
|
const preview = rawPreview ? truncate2(rawPreview, budget) : "";
|
|
1522
|
-
return /* @__PURE__ */
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
/* @__PURE__ */
|
|
1525
|
-
preview && /* @__PURE__ */
|
|
1526
|
-
durationText && /* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ jsxs15(Box16, { flexDirection: "row", gap: ROW_GAP, children: [
|
|
1582
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.dim, children: timestamp }),
|
|
1583
|
+
/* @__PURE__ */ jsx14(Text16, { color: logNameColor(entry), wrap: "truncate", children: name }),
|
|
1584
|
+
preview && /* @__PURE__ */ jsx14(Text16, { color: COLORS.dim, wrap: "truncate", children: preview }),
|
|
1585
|
+
durationText && /* @__PURE__ */ jsx14(Text16, { color: COLORS.dim, children: durationText })
|
|
1527
1586
|
] }, entry.id);
|
|
1528
1587
|
}) }),
|
|
1529
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.dim, children: "\u2191/\u2193 scroll" })
|
|
1530
1589
|
] });
|
|
1531
1590
|
}
|
|
1532
1591
|
|
|
@@ -1718,12 +1777,12 @@ function track(event, payload) {
|
|
|
1718
1777
|
}
|
|
1719
1778
|
|
|
1720
1779
|
// src/ui/App.tsx
|
|
1721
|
-
import { jsx as
|
|
1780
|
+
import { jsx as jsx15, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1722
1781
|
function App() {
|
|
1723
1782
|
const { phase, error, homeScreen, currentStepIndex, steps, inputReq } = useWizard();
|
|
1724
1783
|
const { exit } = useApp();
|
|
1725
1784
|
const { columns, rows } = useWindowSize8();
|
|
1726
|
-
const [showLogs, setShowLogs] =
|
|
1785
|
+
const [showLogs, setShowLogs] = useState7(false);
|
|
1727
1786
|
const finished = phase === "done" || phase === "error";
|
|
1728
1787
|
const currentStep = steps[currentStepIndex];
|
|
1729
1788
|
useInput7(
|
|
@@ -1765,8 +1824,8 @@ function App() {
|
|
|
1765
1824
|
/* Clamped to exactly the viewport: a taller frame makes Ink clear and repaint
|
|
1766
1825
|
the whole screen, and the scrolling throws off its cursor arithmetic —
|
|
1767
1826
|
flicker and leftover rows. */
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
|
|
1827
|
+
/* @__PURE__ */ jsxs16(
|
|
1828
|
+
Box17,
|
|
1770
1829
|
{
|
|
1771
1830
|
backgroundColor: COLORS.bg.main,
|
|
1772
1831
|
flexDirection: "row",
|
|
@@ -1774,16 +1833,16 @@ function App() {
|
|
|
1774
1833
|
height: scrollsPastViewport ? void 0 : rows,
|
|
1775
1834
|
overflow: scrollsPastViewport ? "visible" : "hidden",
|
|
1776
1835
|
children: [
|
|
1777
|
-
mainWindowVisible && /* @__PURE__ */
|
|
1778
|
-
|
|
1836
|
+
mainWindowVisible && /* @__PURE__ */ jsxs16(
|
|
1837
|
+
Box17,
|
|
1779
1838
|
{
|
|
1780
1839
|
flexDirection,
|
|
1781
1840
|
width: "100%",
|
|
1782
1841
|
maxHeight: rows,
|
|
1783
1842
|
justifyContent: "space-between",
|
|
1784
1843
|
children: [
|
|
1785
|
-
showLogs ? /* @__PURE__ */
|
|
1786
|
-
|
|
1844
|
+
showLogs ? /* @__PURE__ */ jsx15(Logs, {}) : /* @__PURE__ */ jsxs16(
|
|
1845
|
+
Box17,
|
|
1787
1846
|
{
|
|
1788
1847
|
flexDirection: "column",
|
|
1789
1848
|
paddingX: 4,
|
|
@@ -1791,25 +1850,25 @@ function App() {
|
|
|
1791
1850
|
width: showSidebar ? 70 : "100%",
|
|
1792
1851
|
flexGrow: 1,
|
|
1793
1852
|
children: [
|
|
1794
|
-
phase === "authenticating" && /* @__PURE__ */
|
|
1795
|
-
/* @__PURE__ */
|
|
1796
|
-
/* @__PURE__ */
|
|
1853
|
+
phase === "authenticating" && /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", marginBottom: 1, children: [
|
|
1854
|
+
/* @__PURE__ */ jsx15(Text17, { color: COLORS.strong, bold: true, children: "Signing in to Algolia" }),
|
|
1855
|
+
/* @__PURE__ */ jsx15(Text17, { color: COLORS.muted, children: "A browser window will open \u2014 complete sign-in there." })
|
|
1797
1856
|
] }),
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
phase === "error" && error && /* @__PURE__ */
|
|
1857
|
+
/* @__PURE__ */ jsx15(CliOutput, {}),
|
|
1858
|
+
/* @__PURE__ */ jsx15(Notices, {}),
|
|
1859
|
+
/* @__PURE__ */ jsx15(PromptInput, {}),
|
|
1860
|
+
phase === "error" && error && /* @__PURE__ */ jsx15(Box17, { marginTop: 1, children: /* @__PURE__ */ jsxs16(Text17, { color: COLORS.status.error, children: [
|
|
1802
1861
|
"\u2716 ",
|
|
1803
1862
|
error
|
|
1804
1863
|
] }) })
|
|
1805
1864
|
]
|
|
1806
1865
|
}
|
|
1807
1866
|
),
|
|
1808
|
-
showSidebar ? /* @__PURE__ */
|
|
1867
|
+
showSidebar ? /* @__PURE__ */ jsx15(Sidebar, {}) : /* @__PURE__ */ jsx15(Ribbon, {})
|
|
1809
1868
|
]
|
|
1810
1869
|
}
|
|
1811
1870
|
),
|
|
1812
|
-
phase === "idle" && (homeScreen === "learnMore" ? /* @__PURE__ */
|
|
1871
|
+
phase === "idle" && (homeScreen === "learnMore" ? /* @__PURE__ */ jsx15(LearnMore, {}) : /* @__PURE__ */ jsx15(Welcome, {}))
|
|
1813
1872
|
]
|
|
1814
1873
|
}
|
|
1815
1874
|
)
|
|
@@ -3641,7 +3700,7 @@ async function runAnalysis(mode, extraInstructions = []) {
|
|
|
3641
3700
|
// package.json
|
|
3642
3701
|
var package_default = {
|
|
3643
3702
|
name: "@algolia/wizard",
|
|
3644
|
-
version: "0.
|
|
3703
|
+
version: "0.23.0",
|
|
3645
3704
|
description: "Magically implement Algolia functionality in your codebase",
|
|
3646
3705
|
type: "module",
|
|
3647
3706
|
engines: {
|
|
@@ -5371,7 +5430,7 @@ function delay(ms) {
|
|
|
5371
5430
|
}
|
|
5372
5431
|
|
|
5373
5432
|
// src/main.tsx
|
|
5374
|
-
import { jsx as
|
|
5433
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5375
5434
|
async function startup() {
|
|
5376
5435
|
setProjectRoot(process.cwd());
|
|
5377
5436
|
let args;
|
|
@@ -5421,7 +5480,7 @@ ${formatStepList(workflow)}`);
|
|
|
5421
5480
|
}
|
|
5422
5481
|
async function run(workflow) {
|
|
5423
5482
|
const store = useWizard.getState();
|
|
5424
|
-
const instance = render(/* @__PURE__ */
|
|
5483
|
+
const instance = render(/* @__PURE__ */ jsx16(App, {}), { incrementalRendering: true });
|
|
5425
5484
|
await store.waitForStart();
|
|
5426
5485
|
let user = await getUser();
|
|
5427
5486
|
if (!user) {
|