@algolia/wizard 0.118.0 → 0.120.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 +373 -306
- 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 Box24, Text as Text25, useApp as useApp2, useInput as useInput10, useWindowSize as useWindowSize8 } from "ink";
|
|
8
8
|
import Spinner3 from "ink-spinner";
|
|
9
9
|
|
|
10
10
|
// src/lib/terminalSize.ts
|
|
@@ -516,8 +516,8 @@ var useWizard = create((set, get) => ({
|
|
|
516
516
|
}
|
|
517
517
|
}));
|
|
518
518
|
|
|
519
|
-
// src/ui/
|
|
520
|
-
import { Box, Text
|
|
519
|
+
// src/ui/Alert.tsx
|
|
520
|
+
import { Box, Text } from "ink";
|
|
521
521
|
|
|
522
522
|
// src/ui/theme.ts
|
|
523
523
|
var MARKER = {
|
|
@@ -529,6 +529,7 @@ var MARKER = {
|
|
|
529
529
|
var BRAND = "#003DFF";
|
|
530
530
|
var SECONDARY = "#5468FF";
|
|
531
531
|
var DANGER = "#F86E7E";
|
|
532
|
+
var WARNING = "#E3B341";
|
|
532
533
|
var COLORS = {
|
|
533
534
|
brand: BRAND,
|
|
534
535
|
primary: "#E6EDF3",
|
|
@@ -537,7 +538,8 @@ var COLORS = {
|
|
|
537
538
|
muted: "#8B949E",
|
|
538
539
|
dim: "#484F58",
|
|
539
540
|
highlight: { bg: "#12331C", fg: "#4ADE80" },
|
|
540
|
-
badge:
|
|
541
|
+
badge: WARNING,
|
|
542
|
+
warning: WARNING,
|
|
541
543
|
danger: DANGER,
|
|
542
544
|
success: "#4ADE80",
|
|
543
545
|
bg: {
|
|
@@ -554,8 +556,44 @@ var COLORS = {
|
|
|
554
556
|
}
|
|
555
557
|
};
|
|
556
558
|
|
|
559
|
+
// src/ui/Alert.tsx
|
|
560
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
561
|
+
var VARIANTS = {
|
|
562
|
+
error: { label: "ERROR", color: COLORS.danger },
|
|
563
|
+
warning: { label: "WARN", color: COLORS.warning },
|
|
564
|
+
success: { label: "SUCCESS", color: COLORS.success }
|
|
565
|
+
};
|
|
566
|
+
function Alert({ variant, title, message }) {
|
|
567
|
+
const { label, color } = VARIANTS[variant];
|
|
568
|
+
return /* @__PURE__ */ jsxs(
|
|
569
|
+
Box,
|
|
570
|
+
{
|
|
571
|
+
flexDirection: "column",
|
|
572
|
+
paddingLeft: 1,
|
|
573
|
+
maxWidth: 70,
|
|
574
|
+
borderStyle: "bold",
|
|
575
|
+
borderTop: false,
|
|
576
|
+
borderRight: false,
|
|
577
|
+
borderBottom: false,
|
|
578
|
+
borderLeftColor: color,
|
|
579
|
+
borderBackgroundColor: COLORS.bg.main,
|
|
580
|
+
children: [
|
|
581
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
582
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color, children: label }),
|
|
583
|
+
title && /* @__PURE__ */ jsxs(Text, { bold: true, color: COLORS.strong, children: [
|
|
584
|
+
" ",
|
|
585
|
+
title
|
|
586
|
+
] })
|
|
587
|
+
] }),
|
|
588
|
+
/* @__PURE__ */ jsx(Text, { color: COLORS.muted, children: message })
|
|
589
|
+
]
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
|
|
557
594
|
// src/ui/CliOutput.tsx
|
|
558
|
-
import {
|
|
595
|
+
import { Box as Box2, Text as Text2, useWindowSize } from "ink";
|
|
596
|
+
import { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
559
597
|
var CLI_MARKER = "\u203A";
|
|
560
598
|
var RESERVED_ROWS = 16;
|
|
561
599
|
var MAX_ROWS = 12;
|
|
@@ -578,14 +616,14 @@ function CliOutput() {
|
|
|
578
616
|
usedRows += cost;
|
|
579
617
|
}
|
|
580
618
|
const hidden = cliOutput.length - visible.length;
|
|
581
|
-
return /* @__PURE__ */
|
|
582
|
-
hidden > 0 && /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginBottom: 1, children: [
|
|
620
|
+
hidden > 0 && /* @__PURE__ */ jsxs2(Text2, { color: COLORS.dim, children: [
|
|
583
621
|
"\u2191 ",
|
|
584
622
|
hidden,
|
|
585
623
|
" earlier line(s)"
|
|
586
624
|
] }),
|
|
587
|
-
visible.map((line) => /* @__PURE__ */
|
|
588
|
-
|
|
625
|
+
visible.map((line) => /* @__PURE__ */ jsxs2(
|
|
626
|
+
Text2,
|
|
589
627
|
{
|
|
590
628
|
color: line.stream === "stderr" ? COLORS.muted : COLORS.dim,
|
|
591
629
|
wrap: URL_PATTERN.test(line.text) ? "wrap" : "truncate",
|
|
@@ -601,13 +639,13 @@ function CliOutput() {
|
|
|
601
639
|
}
|
|
602
640
|
|
|
603
641
|
// src/ui/Notices.tsx
|
|
604
|
-
import { Box as
|
|
642
|
+
import { Box as Box4, Text as Text4 } from "ink";
|
|
605
643
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
606
644
|
|
|
607
645
|
// src/ui/Table.tsx
|
|
608
|
-
import { Box as
|
|
646
|
+
import { Box as Box3, Text as Text3, measureElement, useWindowSize as useWindowSize2 } from "ink";
|
|
609
647
|
import { useEffect, useRef, useState } from "react";
|
|
610
|
-
import { jsx } from "react/jsx-runtime";
|
|
648
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
611
649
|
function Table({ columns, rows }) {
|
|
612
650
|
const { columns: termCols } = useWindowSize2();
|
|
613
651
|
const ref = useRef(null);
|
|
@@ -617,7 +655,7 @@ function Table({ columns, rows }) {
|
|
|
617
655
|
}, [termCols, columns, rows]);
|
|
618
656
|
if (rows.length === 0) return null;
|
|
619
657
|
const lines = formatTable(columns, rows, width || void 0);
|
|
620
|
-
return /* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ jsx2(Box3, { flexDirection: "column", ref, children: lines.map((line, i) => /* @__PURE__ */ jsx2(Text3, { color: COLORS.primary, wrap: "truncate", children: line }, `tbl-${i}`)) });
|
|
621
659
|
}
|
|
622
660
|
function formatTable(columns, rows, width) {
|
|
623
661
|
const natural = columns.map(
|
|
@@ -658,7 +696,7 @@ function resize(widths, budget) {
|
|
|
658
696
|
var truncate = (s, width) => s.length <= width ? s : width <= 1 ? s.slice(0, width) : `${s.slice(0, width - 1)}\u2026`;
|
|
659
697
|
|
|
660
698
|
// src/ui/Notices.tsx
|
|
661
|
-
import { jsx as
|
|
699
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
662
700
|
var AGENT_MARKER = "\u2726";
|
|
663
701
|
var PULSE_STEPS = 12;
|
|
664
702
|
var PULSE_STEP_MS = 150;
|
|
@@ -702,8 +740,8 @@ function Notices({
|
|
|
702
740
|
}, []);
|
|
703
741
|
if (visible.length === 0) return null;
|
|
704
742
|
const pulseColor = PULSE_COLORS[pulseStep];
|
|
705
|
-
return /* @__PURE__ */
|
|
706
|
-
|
|
743
|
+
return /* @__PURE__ */ jsx3(
|
|
744
|
+
Box4,
|
|
707
745
|
{
|
|
708
746
|
borderColor: border ? COLORS.border : void 0,
|
|
709
747
|
borderStyle: border ? "single" : void 0,
|
|
@@ -714,12 +752,12 @@ function Notices({
|
|
|
714
752
|
paddingTop: border ? 1 : 0,
|
|
715
753
|
flexDirection: "column",
|
|
716
754
|
gap: 1,
|
|
717
|
-
children: visible.map((notice, i) => /* @__PURE__ */
|
|
755
|
+
children: visible.map((notice, i) => /* @__PURE__ */ jsxs3(Box4, { flexDirection: "column", children: [
|
|
718
756
|
notice.messages?.map((m, j) => {
|
|
719
757
|
const line = typeof m === "string" ? { text: m } : m;
|
|
720
758
|
const prefix = j === 0 ? `${AGENT_MARKER} ` : " ";
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
|
|
759
|
+
return /* @__PURE__ */ jsxs3(
|
|
760
|
+
Text4,
|
|
723
761
|
{
|
|
724
762
|
color: !line.color ? notice === latest ? pulseColor : COLORS.dim : line.color ?? COLORS.dim,
|
|
725
763
|
bold: line.bold,
|
|
@@ -731,19 +769,19 @@ function Notices({
|
|
|
731
769
|
`notice-line-${j}`
|
|
732
770
|
);
|
|
733
771
|
}),
|
|
734
|
-
notice.table && /* @__PURE__ */
|
|
772
|
+
notice.table && /* @__PURE__ */ jsx3(Table, { columns: notice.table.columns, rows: notice.table.rows })
|
|
735
773
|
] }, `notice-${i}`))
|
|
736
774
|
}
|
|
737
775
|
);
|
|
738
776
|
}
|
|
739
777
|
|
|
740
778
|
// src/ui/PromptInput.tsx
|
|
741
|
-
import { Box as
|
|
779
|
+
import { Box as Box11, Text as Text12 } from "ink";
|
|
742
780
|
import Spinner from "ink-spinner";
|
|
743
781
|
import { useState as useState9 } from "react";
|
|
744
782
|
|
|
745
783
|
// src/ui/CommandApproval.tsx
|
|
746
|
-
import { Box as
|
|
784
|
+
import { Box as Box9, Text as Text9, useInput as useInput3 } from "ink";
|
|
747
785
|
import { useLayoutEffect as useLayoutEffect3, useState as useState6 } from "react";
|
|
748
786
|
|
|
749
787
|
// src/lib/wrapExact.ts
|
|
@@ -773,12 +811,12 @@ function wrapExact(text, width) {
|
|
|
773
811
|
}
|
|
774
812
|
|
|
775
813
|
// src/ui/DecisionSelect.tsx
|
|
776
|
-
import { Box as
|
|
814
|
+
import { Box as Box6, Text as Text6, useInput } from "ink";
|
|
777
815
|
import { useState as useState3 } from "react";
|
|
778
816
|
|
|
779
817
|
// src/ui/SelectRow.tsx
|
|
780
|
-
import { Box as
|
|
781
|
-
import { jsx as
|
|
818
|
+
import { Box as Box5, Text as Text5 } from "ink";
|
|
819
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
782
820
|
function SelectRow({
|
|
783
821
|
highlighted,
|
|
784
822
|
label,
|
|
@@ -791,16 +829,16 @@ function SelectRow({
|
|
|
791
829
|
}) {
|
|
792
830
|
const active = highlighted && !disabled;
|
|
793
831
|
const labelColor = disabled ? COLORS.dim : active ? highlightBackground ? COLORS.highlight.fg : COLORS.success : COLORS.primary;
|
|
794
|
-
return /* @__PURE__ */
|
|
795
|
-
|
|
832
|
+
return /* @__PURE__ */ jsxs4(
|
|
833
|
+
Box5,
|
|
796
834
|
{
|
|
797
835
|
width,
|
|
798
836
|
paddingX: usePadding ? 1 : 0,
|
|
799
837
|
paddingY: usePadding ? 1 : 0,
|
|
800
838
|
backgroundColor: active && highlightBackground ? COLORS.highlight.bg : void 0,
|
|
801
839
|
children: [
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
|
|
840
|
+
/* @__PURE__ */ jsx4(Box5, { width: labelWidth, children: /* @__PURE__ */ jsxs4(
|
|
841
|
+
Text5,
|
|
804
842
|
{
|
|
805
843
|
color: labelColor,
|
|
806
844
|
bold: active && !highlightBackground,
|
|
@@ -818,7 +856,7 @@ function SelectRow({
|
|
|
818
856
|
}
|
|
819
857
|
|
|
820
858
|
// src/ui/DecisionSelect.tsx
|
|
821
|
-
import { jsx as
|
|
859
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
822
860
|
function DecisionSelect({
|
|
823
861
|
actions,
|
|
824
862
|
onDecide,
|
|
@@ -836,8 +874,8 @@ function DecisionSelect({
|
|
|
836
874
|
onDecide(actions[1].value);
|
|
837
875
|
}
|
|
838
876
|
});
|
|
839
|
-
return /* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ jsxs5(Box6, { flexDirection: "column", gap: 1, children: [
|
|
878
|
+
/* @__PURE__ */ jsx5(Box6, { flexDirection: "column", children: actions.map((action, i) => /* @__PURE__ */ jsx5(
|
|
841
879
|
SelectRow,
|
|
842
880
|
{
|
|
843
881
|
highlighted: i === index,
|
|
@@ -846,34 +884,34 @@ function DecisionSelect({
|
|
|
846
884
|
},
|
|
847
885
|
action.label
|
|
848
886
|
)) }),
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
extraHints.map(({ key, label }) => /* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
887
|
+
/* @__PURE__ */ jsxs5(Box6, { gap: 2, children: [
|
|
888
|
+
extraHints.map(({ key, label }) => /* @__PURE__ */ jsxs5(Text6, { children: [
|
|
889
|
+
/* @__PURE__ */ jsx5(Text6, { color: COLORS.primary, children: key }),
|
|
890
|
+
/* @__PURE__ */ jsxs5(Text6, { color: COLORS.dim, children: [
|
|
853
891
|
" ",
|
|
854
892
|
label
|
|
855
893
|
] })
|
|
856
894
|
] }, label)),
|
|
857
|
-
/* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ jsxs5(Text6, { children: [
|
|
896
|
+
/* @__PURE__ */ jsx5(Text6, { color: COLORS.primary, children: "[\u2191] [\u2193]" }),
|
|
897
|
+
/* @__PURE__ */ jsx5(Text6, { color: COLORS.dim, children: " move" })
|
|
860
898
|
] }),
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
/* @__PURE__ */
|
|
863
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ jsxs5(Text6, { children: [
|
|
900
|
+
/* @__PURE__ */ jsx5(Text6, { color: COLORS.primary, children: "[enter]" }),
|
|
901
|
+
/* @__PURE__ */ jsx5(Text6, { color: COLORS.dim, children: " confirm" })
|
|
864
902
|
] })
|
|
865
903
|
] })
|
|
866
904
|
] });
|
|
867
905
|
}
|
|
868
906
|
|
|
869
907
|
// src/ui/Review.tsx
|
|
870
|
-
import { Box as
|
|
908
|
+
import { Box as Box8, Text as Text8, useInput as useInput2 } from "ink";
|
|
871
909
|
import { useLayoutEffect as useLayoutEffect2, useState as useState5 } from "react";
|
|
872
910
|
|
|
873
911
|
// src/ui/ScrollView.tsx
|
|
874
|
-
import { Box as
|
|
912
|
+
import { Box as Box7, Text as Text7, measureElement as measureElement2, useWindowSize as useWindowSize3 } from "ink";
|
|
875
913
|
import { useCallback, useLayoutEffect, useRef as useRef2, useState as useState4 } from "react";
|
|
876
|
-
import { jsxs as
|
|
914
|
+
import { jsxs as jsxs6 } from "react/jsx-runtime";
|
|
877
915
|
var INDICATOR_ROWS = 2;
|
|
878
916
|
function fittedWidth(node, columns) {
|
|
879
917
|
let left = 0;
|
|
@@ -944,20 +982,20 @@ function useScrollWindow({
|
|
|
944
982
|
};
|
|
945
983
|
}
|
|
946
984
|
function ScrollView({ scroll, grow = true, children }) {
|
|
947
|
-
return /* @__PURE__ */
|
|
948
|
-
|
|
985
|
+
return /* @__PURE__ */ jsxs6(
|
|
986
|
+
Box7,
|
|
949
987
|
{
|
|
950
988
|
ref: scroll.viewportRef,
|
|
951
989
|
flexDirection: "column",
|
|
952
990
|
flexGrow: grow ? 1 : 0,
|
|
953
991
|
children: [
|
|
954
|
-
scroll.hiddenAbove > 0 && /* @__PURE__ */
|
|
992
|
+
scroll.hiddenAbove > 0 && /* @__PURE__ */ jsxs6(Text7, { color: COLORS.dim, children: [
|
|
955
993
|
"\u2191 ",
|
|
956
994
|
scroll.hiddenAbove,
|
|
957
995
|
" more"
|
|
958
996
|
] }),
|
|
959
997
|
children,
|
|
960
|
-
scroll.hiddenBelow > 0 && /* @__PURE__ */
|
|
998
|
+
scroll.hiddenBelow > 0 && /* @__PURE__ */ jsxs6(Text7, { color: COLORS.dim, children: [
|
|
961
999
|
"\u2193 ",
|
|
962
1000
|
scroll.hiddenBelow,
|
|
963
1001
|
" more"
|
|
@@ -968,7 +1006,7 @@ function ScrollView({ scroll, grow = true, children }) {
|
|
|
968
1006
|
}
|
|
969
1007
|
|
|
970
1008
|
// src/ui/Review.tsx
|
|
971
|
-
import { jsx as
|
|
1009
|
+
import { jsx as jsx6, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
972
1010
|
var INGEST_SCRIPT = ".algolia-wizard/ingest.sh";
|
|
973
1011
|
function wrapText(text, width) {
|
|
974
1012
|
if (width <= 0) return [text];
|
|
@@ -1066,25 +1104,25 @@ function ReviewPanel({ review: review2 }) {
|
|
|
1066
1104
|
{ isActive: scrollable }
|
|
1067
1105
|
);
|
|
1068
1106
|
const visible = rows.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
1069
|
-
return /* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1071
|
-
row.prefix && /* @__PURE__ */
|
|
1072
|
-
/* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", flexGrow: 1, children: [
|
|
1108
|
+
/* @__PURE__ */ jsx6(ScrollView, { scroll, children: visible.map((row, i) => /* @__PURE__ */ jsxs7(Text8, { wrap: "truncate", children: [
|
|
1109
|
+
row.prefix && /* @__PURE__ */ jsx6(Text8, { color: row.prefixColor ?? row.color, bold: row.bold, children: row.prefix }),
|
|
1110
|
+
/* @__PURE__ */ jsx6(Text8, { color: row.color, bold: row.bold, children: row.text })
|
|
1073
1111
|
] }, `review-row-${i}`)) }),
|
|
1074
|
-
scrollable && /* @__PURE__ */
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
/* @__PURE__ */
|
|
1112
|
+
scrollable && /* @__PURE__ */ jsxs7(Text8, { children: [
|
|
1113
|
+
/* @__PURE__ */ jsx6(Text8, { color: COLORS.primary, children: "[j] [k]" }),
|
|
1114
|
+
/* @__PURE__ */ jsx6(Text8, { color: COLORS.dim, children: " scroll" })
|
|
1077
1115
|
] })
|
|
1078
1116
|
] });
|
|
1079
1117
|
}
|
|
1080
1118
|
function Review() {
|
|
1081
1119
|
const review2 = useWizard((s) => s.review);
|
|
1082
1120
|
if (!review2) return null;
|
|
1083
|
-
return /* @__PURE__ */
|
|
1121
|
+
return /* @__PURE__ */ jsx6(ReviewPanel, { review: review2 });
|
|
1084
1122
|
}
|
|
1085
1123
|
|
|
1086
1124
|
// src/ui/CommandApproval.tsx
|
|
1087
|
-
import { jsx as
|
|
1125
|
+
import { jsx as jsx7, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1088
1126
|
var BLANK2 = { prefix: "", text: " ", color: COLORS.dim };
|
|
1089
1127
|
var COMMAND_PREFIX = "$ ";
|
|
1090
1128
|
function fieldLines(prefix, value, color, width) {
|
|
@@ -1134,11 +1172,11 @@ function CommandApproval({
|
|
|
1134
1172
|
{ isActive: scrollable }
|
|
1135
1173
|
);
|
|
1136
1174
|
const visible = lines.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
1137
|
-
return /* @__PURE__ */
|
|
1138
|
-
messages?.map((message, index) => /* @__PURE__ */
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
|
|
1175
|
+
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", gap: 1, width: "100%", flexGrow: 1, flexShrink: 1, children: [
|
|
1176
|
+
messages?.map((message, index) => /* @__PURE__ */ jsx7(Text9, { color: COLORS.muted, children: message }, `msg-${index}`)),
|
|
1177
|
+
/* @__PURE__ */ jsx7(Text9, { color: COLORS.primary, bold: true, children: "Run this command?" }),
|
|
1178
|
+
/* @__PURE__ */ jsx7(
|
|
1179
|
+
Box9,
|
|
1142
1180
|
{
|
|
1143
1181
|
flexDirection: "column",
|
|
1144
1182
|
paddingLeft: 2,
|
|
@@ -1151,13 +1189,13 @@ function CommandApproval({
|
|
|
1151
1189
|
flexGrow: grow ? 1 : 0,
|
|
1152
1190
|
flexShrink: 1,
|
|
1153
1191
|
minHeight: 3,
|
|
1154
|
-
children: /* @__PURE__ */
|
|
1155
|
-
line.prefix ? /* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1192
|
+
children: /* @__PURE__ */ jsx7(ScrollView, { scroll, grow, children: visible.map((line, i) => /* @__PURE__ */ jsxs8(Text9, { wrap: "truncate", children: [
|
|
1193
|
+
line.prefix ? /* @__PURE__ */ jsx7(Text9, { color: COLORS.muted, children: line.prefix }) : null,
|
|
1194
|
+
/* @__PURE__ */ jsx7(Text9, { color: line.color, children: line.text })
|
|
1157
1195
|
] }, `cmd-${scroll.offset + i}`)) })
|
|
1158
1196
|
}
|
|
1159
1197
|
),
|
|
1160
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ jsx7(Box9, { flexShrink: 0, children: /* @__PURE__ */ jsx7(
|
|
1161
1199
|
DecisionSelect,
|
|
1162
1200
|
{
|
|
1163
1201
|
actions: [
|
|
@@ -1172,9 +1210,9 @@ function CommandApproval({
|
|
|
1172
1210
|
}
|
|
1173
1211
|
|
|
1174
1212
|
// src/ui/FreeTextInput.tsx
|
|
1175
|
-
import { Text as
|
|
1213
|
+
import { Text as Text10, useInput as useInput4 } from "ink";
|
|
1176
1214
|
import { useState as useState7 } from "react";
|
|
1177
|
-
import { jsx as
|
|
1215
|
+
import { jsx as jsx8, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1178
1216
|
function FreeTextInput({
|
|
1179
1217
|
value,
|
|
1180
1218
|
onChange,
|
|
@@ -1212,17 +1250,17 @@ function FreeTextInput({
|
|
|
1212
1250
|
const before = value.slice(0, at);
|
|
1213
1251
|
const current = value.slice(at, at + 1) || " ";
|
|
1214
1252
|
const after = value.slice(at + 1);
|
|
1215
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ jsxs9(Text10, { color: COLORS.strong, children: [
|
|
1216
1254
|
before,
|
|
1217
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ jsx8(Text10, { inverse: true, children: current }),
|
|
1218
1256
|
after
|
|
1219
1257
|
] });
|
|
1220
1258
|
}
|
|
1221
1259
|
|
|
1222
1260
|
// src/ui/SelectPrompt.tsx
|
|
1223
|
-
import { Box as
|
|
1261
|
+
import { Box as Box10, Text as Text11, useInput as useInput5, useWindowSize as useWindowSize4 } from "ink";
|
|
1224
1262
|
import { useLayoutEffect as useLayoutEffect4, useRef as useRef3, useState as useState8 } from "react";
|
|
1225
|
-
import { jsx as
|
|
1263
|
+
import { jsx as jsx9, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1226
1264
|
var CANCEL = "cancel";
|
|
1227
1265
|
var ARROW_WIDTH = 4;
|
|
1228
1266
|
var MULTI_TOGGLE_WIDTH = "[ ] ".length;
|
|
@@ -1247,6 +1285,7 @@ function SelectPrompt({
|
|
|
1247
1285
|
table,
|
|
1248
1286
|
list: list2,
|
|
1249
1287
|
error,
|
|
1288
|
+
alert,
|
|
1250
1289
|
multi,
|
|
1251
1290
|
cancelable,
|
|
1252
1291
|
secondary,
|
|
@@ -1329,31 +1368,32 @@ function SelectPrompt({
|
|
|
1329
1368
|
}
|
|
1330
1369
|
}
|
|
1331
1370
|
});
|
|
1332
|
-
return /* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
error && /* @__PURE__ */
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1371
|
+
return /* @__PURE__ */ jsx9(Box10, { ref: containerRef, flexGrow: 1, children: /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, width, children: [
|
|
1372
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, flexShrink: 0, children: [
|
|
1373
|
+
error && /* @__PURE__ */ jsx9(Alert, { variant: "error", message: error }),
|
|
1374
|
+
alert && /* @__PURE__ */ jsx9(Alert, { ...alert }),
|
|
1375
|
+
messages?.map((m, i) => /* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
1376
|
+
table && /* @__PURE__ */ jsx9(Table, { columns: table.columns, rows: table.rows }),
|
|
1377
|
+
list2 && list2.length > 0 && /* @__PURE__ */ jsx9(Box10, { flexDirection: "column", children: list2.map((item, i) => /* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1378
|
+
/* @__PURE__ */ jsx9(
|
|
1379
|
+
Text11,
|
|
1340
1380
|
{
|
|
1341
1381
|
color: item.color === "success" ? COLORS.success : COLORS.danger,
|
|
1342
1382
|
children: item.color === "success" ? "\u2713 " : "\u25CF "
|
|
1343
1383
|
}
|
|
1344
1384
|
),
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
item.helpText ? /* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.primary, children: item.label }),
|
|
1386
|
+
item.helpText ? /* @__PURE__ */ jsxs10(Text11, { color: COLORS.muted, children: [
|
|
1347
1387
|
" ",
|
|
1348
1388
|
item.helpText
|
|
1349
1389
|
] }) : null
|
|
1350
1390
|
] }, `list-${i}`)) }),
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
question && /* @__PURE__ */
|
|
1353
|
-
helpText && /* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
1392
|
+
question && /* @__PURE__ */ jsx9(Text11, { color: COLORS.muted, children: question }),
|
|
1393
|
+
helpText && /* @__PURE__ */ jsx9(Text11, { color: COLORS.dim, children: helpText })
|
|
1354
1394
|
] })
|
|
1355
1395
|
] }),
|
|
1356
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ jsx9(ScrollView, { scroll, children: visible.map((option, visibleIndex) => {
|
|
1357
1397
|
const i = scroll.offset + visibleIndex;
|
|
1358
1398
|
const highlighted = i === index;
|
|
1359
1399
|
const isCancel = i === cancelIndex;
|
|
@@ -1361,7 +1401,7 @@ function SelectPrompt({
|
|
|
1361
1401
|
const sec = isCancel ? void 0 : secondary?.[i];
|
|
1362
1402
|
const isText = sec?.kind === "text";
|
|
1363
1403
|
const rowDisabled = isDisabled(i);
|
|
1364
|
-
return /* @__PURE__ */
|
|
1404
|
+
return /* @__PURE__ */ jsxs10(
|
|
1365
1405
|
SelectRow,
|
|
1366
1406
|
{
|
|
1367
1407
|
highlighted,
|
|
@@ -1371,24 +1411,24 @@ function SelectPrompt({
|
|
|
1371
1411
|
label: `${bullet}${displayLabel(i)}`,
|
|
1372
1412
|
usePadding: true,
|
|
1373
1413
|
children: [
|
|
1374
|
-
isText && textWidth > 0 && /* @__PURE__ */
|
|
1375
|
-
|
|
1414
|
+
isText && textWidth > 0 && /* @__PURE__ */ jsx9(Box10, { width: textWidth, children: /* @__PURE__ */ jsx9(
|
|
1415
|
+
Text11,
|
|
1376
1416
|
{
|
|
1377
1417
|
wrap: "truncate",
|
|
1378
1418
|
color: rowDisabled ? COLORS.dim : highlighted ? COLORS.primary : COLORS.muted,
|
|
1379
1419
|
children: sec.value
|
|
1380
1420
|
}
|
|
1381
1421
|
) }),
|
|
1382
|
-
sec?.kind === "badge" && /* @__PURE__ */
|
|
1422
|
+
sec?.kind === "badge" && /* @__PURE__ */ jsx9(Box10, { width: badgeWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx9(Text11, { color: COLORS.badge, wrap: "truncate", children: sec.value }) })
|
|
1383
1423
|
]
|
|
1384
1424
|
},
|
|
1385
1425
|
`row-${i}`
|
|
1386
1426
|
);
|
|
1387
1427
|
}) }),
|
|
1388
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ jsx9(Box10, { flexShrink: 0, children: /* @__PURE__ */ jsx9(Text11, { color: COLORS.dim, children: hints.map(({ key, label }, i) => /* @__PURE__ */ jsxs10(Text11, { color: COLORS.dim, children: [
|
|
1389
1429
|
i > 0 ? " " : "",
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1430
|
+
/* @__PURE__ */ jsx9(Text11, { color: COLORS.primary, children: key }),
|
|
1431
|
+
/* @__PURE__ */ jsxs10(Text11, { color: COLORS.dim, children: [
|
|
1392
1432
|
" ",
|
|
1393
1433
|
label
|
|
1394
1434
|
] })
|
|
@@ -1397,17 +1437,17 @@ function SelectPrompt({
|
|
|
1397
1437
|
}
|
|
1398
1438
|
|
|
1399
1439
|
// src/ui/PromptInput.tsx
|
|
1400
|
-
import { jsx as
|
|
1440
|
+
import { jsx as jsx10, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1401
1441
|
var ACCEPT_REJECT_OPTIONS = ["Accept", "Reject"];
|
|
1402
1442
|
function EnterToContinuePrompt({
|
|
1403
1443
|
question,
|
|
1404
1444
|
messages,
|
|
1405
1445
|
onDecide
|
|
1406
1446
|
}) {
|
|
1407
|
-
return /* @__PURE__ */
|
|
1408
|
-
messages?.map((m, i) => /* @__PURE__ */
|
|
1409
|
-
question && /* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1447
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", gap: 1, children: [
|
|
1448
|
+
messages?.map((m, i) => /* @__PURE__ */ jsx10(Text12, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
1449
|
+
question && /* @__PURE__ */ jsx10(Text12, { color: COLORS.primary, children: question }),
|
|
1450
|
+
/* @__PURE__ */ jsx10(
|
|
1411
1451
|
DecisionSelect,
|
|
1412
1452
|
{
|
|
1413
1453
|
actions: [
|
|
@@ -1426,12 +1466,12 @@ function PromptInput() {
|
|
|
1426
1466
|
const promptKey = inputReq && `${inputReq.promptType}:${inputReq.prompt}`;
|
|
1427
1467
|
const submitting = inputReq != null && submittedReq === inputReq;
|
|
1428
1468
|
if (phase === "done" || phase === "error") {
|
|
1429
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ jsx10(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text12, { color: "gray", dimColor: true, children: "Press Enter or Esc to exit" }) });
|
|
1430
1470
|
}
|
|
1431
1471
|
if (phase !== "awaitingInput" || !inputReq) return null;
|
|
1432
1472
|
if (submitting) {
|
|
1433
|
-
return /* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1473
|
+
return /* @__PURE__ */ jsx10(Box11, { flexGrow: 1, children: /* @__PURE__ */ jsxs11(Text12, { color: COLORS.strong, bold: true, children: [
|
|
1474
|
+
/* @__PURE__ */ jsx10(Spinner, { type: "dots" }),
|
|
1435
1475
|
" Continuing\u2026"
|
|
1436
1476
|
] }) });
|
|
1437
1477
|
}
|
|
@@ -1440,7 +1480,7 @@ function PromptInput() {
|
|
|
1440
1480
|
submitInput(value);
|
|
1441
1481
|
};
|
|
1442
1482
|
if (inputReq.promptType === "multipleChoice") {
|
|
1443
|
-
return /* @__PURE__ */
|
|
1483
|
+
return /* @__PURE__ */ jsx10(Box11, { flexGrow: 1, children: /* @__PURE__ */ jsx10(
|
|
1444
1484
|
SelectPrompt,
|
|
1445
1485
|
{
|
|
1446
1486
|
question: inputReq.prompt,
|
|
@@ -1455,13 +1495,14 @@ function PromptInput() {
|
|
|
1455
1495
|
defaultSelectedIndex: inputReq.defaultSelectedIndex,
|
|
1456
1496
|
cancelable: inputReq.cancelable,
|
|
1457
1497
|
error: inputReq.error,
|
|
1498
|
+
alert: inputReq.alert,
|
|
1458
1499
|
onSelect: handleSubmit
|
|
1459
1500
|
},
|
|
1460
1501
|
promptKey
|
|
1461
1502
|
) });
|
|
1462
1503
|
}
|
|
1463
1504
|
if (inputReq.promptType === "multiSelect") {
|
|
1464
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ jsx10(Box11, { flexGrow: 1, children: /* @__PURE__ */ jsx10(
|
|
1465
1506
|
SelectPrompt,
|
|
1466
1507
|
{
|
|
1467
1508
|
multi: true,
|
|
@@ -1473,6 +1514,7 @@ function PromptInput() {
|
|
|
1473
1514
|
options: inputReq.options,
|
|
1474
1515
|
labels: inputReq.labels,
|
|
1475
1516
|
error: inputReq.error,
|
|
1517
|
+
alert: inputReq.alert,
|
|
1476
1518
|
secondary: inputReq.secondary,
|
|
1477
1519
|
cancelable: inputReq.cancelable,
|
|
1478
1520
|
onSelect: handleSubmit
|
|
@@ -1481,7 +1523,7 @@ function PromptInput() {
|
|
|
1481
1523
|
) });
|
|
1482
1524
|
}
|
|
1483
1525
|
if (inputReq.promptType === "notice") {
|
|
1484
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ jsx10(Box11, { flexGrow: 1, children: /* @__PURE__ */ jsx10(
|
|
1485
1527
|
SelectPrompt,
|
|
1486
1528
|
{
|
|
1487
1529
|
messages: inputReq.messages,
|
|
@@ -1493,7 +1535,7 @@ function PromptInput() {
|
|
|
1493
1535
|
) });
|
|
1494
1536
|
}
|
|
1495
1537
|
if (inputReq.promptType === "enterToContinue") {
|
|
1496
|
-
return /* @__PURE__ */
|
|
1538
|
+
return /* @__PURE__ */ jsx10(
|
|
1497
1539
|
EnterToContinuePrompt,
|
|
1498
1540
|
{
|
|
1499
1541
|
question: inputReq.prompt,
|
|
@@ -1503,7 +1545,7 @@ function PromptInput() {
|
|
|
1503
1545
|
);
|
|
1504
1546
|
}
|
|
1505
1547
|
if (inputReq.promptType === "commandApproval" && inputReq.command) {
|
|
1506
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ jsx10(Box11, { flexGrow: 1, children: /* @__PURE__ */ jsx10(
|
|
1507
1549
|
CommandApproval,
|
|
1508
1550
|
{
|
|
1509
1551
|
command: inputReq.command,
|
|
@@ -1514,13 +1556,13 @@ function PromptInput() {
|
|
|
1514
1556
|
}
|
|
1515
1557
|
if (inputReq.promptType === "acceptReject") {
|
|
1516
1558
|
const labels = inputReq.options?.length ? inputReq.options : ACCEPT_REJECT_OPTIONS;
|
|
1517
|
-
return /* @__PURE__ */
|
|
1518
|
-
inputReq.detectedLanguages && /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexGrow: 1, flexDirection: "column", gap: 1, children: [
|
|
1560
|
+
inputReq.detectedLanguages && /* @__PURE__ */ jsxs11(Text12, { color: COLORS.muted, children: [
|
|
1519
1561
|
"Languages:",
|
|
1520
1562
|
" ",
|
|
1521
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.success, children: inputReq.detectedLanguages })
|
|
1522
1564
|
] }),
|
|
1523
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ jsx10(
|
|
1524
1566
|
SelectPrompt,
|
|
1525
1567
|
{
|
|
1526
1568
|
question: inputReq.prompt,
|
|
@@ -1533,24 +1575,25 @@ function PromptInput() {
|
|
|
1533
1575
|
)
|
|
1534
1576
|
] });
|
|
1535
1577
|
}
|
|
1536
|
-
return /* @__PURE__ */
|
|
1537
|
-
inputReq.error && /* @__PURE__ */
|
|
1538
|
-
inputReq.
|
|
1539
|
-
inputReq.
|
|
1578
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
1579
|
+
inputReq.error && /* @__PURE__ */ jsx10(Box11, { marginBottom: 1, children: /* @__PURE__ */ jsx10(Alert, { variant: "error", message: inputReq.error }) }),
|
|
1580
|
+
inputReq.alert && /* @__PURE__ */ jsx10(Box11, { marginBottom: 1, children: /* @__PURE__ */ jsx10(Alert, { ...inputReq.alert }) }),
|
|
1581
|
+
inputReq.messages?.map((m, i) => /* @__PURE__ */ jsx10(Text12, { color: COLORS.muted, children: m }, `msg-${i}`)),
|
|
1582
|
+
inputReq.suggestion && /* @__PURE__ */ jsxs11(Text12, { color: COLORS.muted, children: [
|
|
1540
1583
|
"Press",
|
|
1541
1584
|
" ",
|
|
1542
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.accent, bold: true, children: "Enter" }),
|
|
1543
1586
|
" ",
|
|
1544
1587
|
"to use",
|
|
1545
1588
|
" ",
|
|
1546
|
-
/* @__PURE__ */
|
|
1589
|
+
/* @__PURE__ */ jsx10(Text12, { color: COLORS.accent, bold: true, children: inputReq.suggestion })
|
|
1547
1590
|
] }),
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1591
|
+
/* @__PURE__ */ jsxs11(Box11, { children: [
|
|
1592
|
+
/* @__PURE__ */ jsxs11(Text12, { color: COLORS.primary, children: [
|
|
1550
1593
|
inputReq.prompt,
|
|
1551
1594
|
" "
|
|
1552
1595
|
] }),
|
|
1553
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ jsx10(
|
|
1554
1597
|
FreeTextInput,
|
|
1555
1598
|
{
|
|
1556
1599
|
value: draft,
|
|
@@ -2504,7 +2547,7 @@ async function ensureApplication(resumeAppId) {
|
|
|
2504
2547
|
// package.json
|
|
2505
2548
|
var package_default = {
|
|
2506
2549
|
name: "@algolia/wizard",
|
|
2507
|
-
version: "0.
|
|
2550
|
+
version: "0.120.0",
|
|
2508
2551
|
description: "Magically implement Algolia functionality in your codebase",
|
|
2509
2552
|
type: "module",
|
|
2510
2553
|
engines: {
|
|
@@ -8872,6 +8915,32 @@ function requestedIndexError(indices, requestedIndexName) {
|
|
|
8872
8915
|
}
|
|
8873
8916
|
return `"${requestedIndexName}" has no records. Choose an index with data.`;
|
|
8874
8917
|
}
|
|
8918
|
+
function noIndicesMessage(appName) {
|
|
8919
|
+
return `${appName} doesn't have any indices yet. Start from a sample data set you can explore or switch to another application`;
|
|
8920
|
+
}
|
|
8921
|
+
function noIndicesWarning(appName) {
|
|
8922
|
+
return {
|
|
8923
|
+
variant: "warning",
|
|
8924
|
+
title: "No indices found",
|
|
8925
|
+
message: noIndicesMessage(appName)
|
|
8926
|
+
};
|
|
8927
|
+
}
|
|
8928
|
+
function invalidIndexAlert(appName, indexName) {
|
|
8929
|
+
return {
|
|
8930
|
+
variant: "error",
|
|
8931
|
+
title: `"${indexName}" is not a valid index`,
|
|
8932
|
+
message: noIndicesMessage(appName)
|
|
8933
|
+
};
|
|
8934
|
+
}
|
|
8935
|
+
function promptAlerts(indices, appName, invalidIndexName) {
|
|
8936
|
+
const hasIndices = indices.length > 0;
|
|
8937
|
+
if (!hasIndices && invalidIndexName) {
|
|
8938
|
+
return { alert: invalidIndexAlert(appName, invalidIndexName) };
|
|
8939
|
+
}
|
|
8940
|
+
if (!hasIndices) return { alert: noIndicesWarning(appName) };
|
|
8941
|
+
if (invalidIndexName) return { error: requestedIndexError(indices, invalidIndexName) };
|
|
8942
|
+
return {};
|
|
8943
|
+
}
|
|
8875
8944
|
async function selectIndexStep2(ctx, requestedIndexName) {
|
|
8876
8945
|
let indices = ctx.getUserInput("fetchedIndices");
|
|
8877
8946
|
!indices && ctx.notify({
|
|
@@ -8894,8 +8963,7 @@ async function selectIndexStep2(ctx, requestedIndexName) {
|
|
|
8894
8963
|
];
|
|
8895
8964
|
const options = choices.map((choice) => choice.label);
|
|
8896
8965
|
const disabled = hasIndices ? choices.map((choice) => choice.disabled) : void 0;
|
|
8897
|
-
const prompt = hasIndices ? "Select an index:" :
|
|
8898
|
-
you can explore or switch to another application`;
|
|
8966
|
+
const prompt = hasIndices ? "Select an index:" : "";
|
|
8899
8967
|
if (!alreadyChoseIndex(ctx) && requestedIndexName) {
|
|
8900
8968
|
const selectedIndex = indices.find((idx) => idx.name === requestedIndexName);
|
|
8901
8969
|
if (selectedIndex && isIndexSelectable(selectedIndex)) {
|
|
@@ -8905,7 +8973,8 @@ you can explore or switch to another application`;
|
|
|
8905
8973
|
});
|
|
8906
8974
|
}
|
|
8907
8975
|
}
|
|
8908
|
-
|
|
8976
|
+
const invalidIndexName = alreadyChoseIndex(ctx) ? void 0 : requestedIndexName;
|
|
8977
|
+
let { error, alert } = promptAlerts(indices, app.name, invalidIndexName);
|
|
8909
8978
|
let result;
|
|
8910
8979
|
while (result === void 0) {
|
|
8911
8980
|
const selection = await ctx.requestUserInput({
|
|
@@ -8913,6 +8982,7 @@ you can explore or switch to another application`;
|
|
|
8913
8982
|
promptType: "multipleChoice",
|
|
8914
8983
|
options,
|
|
8915
8984
|
error,
|
|
8985
|
+
alert,
|
|
8916
8986
|
disabled,
|
|
8917
8987
|
helpText: hasIndices ? "Choose an existing index with data, or create a new index from sample data." : void 0
|
|
8918
8988
|
});
|
|
@@ -9947,11 +10017,11 @@ function getWorkflow(id) {
|
|
|
9947
10017
|
|
|
9948
10018
|
// src/ui/Welcome.tsx
|
|
9949
10019
|
import { useState as useState10 } from "react";
|
|
9950
|
-
import { Box as
|
|
10020
|
+
import { Box as Box14, Spacer, Text as Text15, useInput as useInput6, useWindowSize as useWindowSize6 } from "ink";
|
|
9951
10021
|
|
|
9952
10022
|
// src/ui/Logo.tsx
|
|
9953
|
-
import { Box as
|
|
9954
|
-
import { jsx as
|
|
10023
|
+
import { Box as Box12, Text as Text13 } from "ink";
|
|
10024
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
9955
10025
|
var LOGO = [
|
|
9956
10026
|
" \u2597\u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588",
|
|
9957
10027
|
" \u2597\u259F\u2588\u2580\u2580 \u2588\u2588",
|
|
@@ -9965,18 +10035,18 @@ var LOGO = [
|
|
|
9965
10035
|
" \u259D\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2598 \u259D\u2580\u2588"
|
|
9966
10036
|
];
|
|
9967
10037
|
function Logo() {
|
|
9968
|
-
return /* @__PURE__ */
|
|
10038
|
+
return /* @__PURE__ */ jsx11(Box12, { flexDirection: "column", children: LOGO.map((line, i) => /* @__PURE__ */ jsx11(Text13, { color: COLORS.brand, children: line }, i)) });
|
|
9969
10039
|
}
|
|
9970
10040
|
|
|
9971
10041
|
// src/ui/ResizeNotice.tsx
|
|
9972
|
-
import { Box as
|
|
9973
|
-
import { jsx as
|
|
10042
|
+
import { Box as Box13, Text as Text14, useWindowSize as useWindowSize5 } from "ink";
|
|
10043
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
9974
10044
|
function ResizeNotice() {
|
|
9975
10045
|
const { columns, rows } = useWindowSize5();
|
|
9976
10046
|
if (rows >= MIN_ROWS && columns >= MIN_COLUMNS) return null;
|
|
9977
|
-
return /* @__PURE__ */
|
|
9978
|
-
/* @__PURE__ */
|
|
9979
|
-
/* @__PURE__ */
|
|
10047
|
+
return /* @__PURE__ */ jsxs12(Box13, { flexDirection: "column", children: [
|
|
10048
|
+
/* @__PURE__ */ jsx12(Text14, { color: COLORS.badge, children: `Terminal is ${columns}x${rows}. Recommended size is ${MIN_COLUMNS}x${MIN_ROWS}.` }),
|
|
10049
|
+
/* @__PURE__ */ jsx12(Text14, { color: COLORS.muted, children: "Enlarge the pane for the full layout." })
|
|
9980
10050
|
] });
|
|
9981
10051
|
}
|
|
9982
10052
|
|
|
@@ -10005,19 +10075,19 @@ var sidebarItems = [
|
|
|
10005
10075
|
];
|
|
10006
10076
|
|
|
10007
10077
|
// src/ui/Welcome.tsx
|
|
10008
|
-
import { jsx as
|
|
10078
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
10009
10079
|
function SidebarItem({
|
|
10010
10080
|
title,
|
|
10011
10081
|
description
|
|
10012
10082
|
}) {
|
|
10013
|
-
return /* @__PURE__ */
|
|
10014
|
-
/* @__PURE__ */
|
|
10015
|
-
/* @__PURE__ */
|
|
10016
|
-
/* @__PURE__ */
|
|
10083
|
+
return /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
|
|
10084
|
+
/* @__PURE__ */ jsxs13(Box14, { gap: 1, children: [
|
|
10085
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.success, children: "\u2192" }),
|
|
10086
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.strong, bold: true, children: title })
|
|
10017
10087
|
] }),
|
|
10018
|
-
/* @__PURE__ */
|
|
10019
|
-
/* @__PURE__ */
|
|
10020
|
-
/* @__PURE__ */
|
|
10088
|
+
/* @__PURE__ */ jsxs13(Box14, { flexDirection: "row", gap: 2, children: [
|
|
10089
|
+
/* @__PURE__ */ jsx13(Spacer, {}),
|
|
10090
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.muted, children: description })
|
|
10021
10091
|
] })
|
|
10022
10092
|
] });
|
|
10023
10093
|
}
|
|
@@ -10055,19 +10125,19 @@ function Welcome() {
|
|
|
10055
10125
|
if (rows < MIN_ROWS) {
|
|
10056
10126
|
layout = scales["small"];
|
|
10057
10127
|
}
|
|
10058
|
-
return /* @__PURE__ */
|
|
10059
|
-
/* @__PURE__ */
|
|
10060
|
-
|
|
10128
|
+
return /* @__PURE__ */ jsxs13(Box14, { flexDirection: "row", justifyContent: "space-between", width: "100%", children: [
|
|
10129
|
+
/* @__PURE__ */ jsx13(
|
|
10130
|
+
Box14,
|
|
10061
10131
|
{
|
|
10062
10132
|
paddingY: layout.main.padding.y,
|
|
10063
10133
|
paddingX: layout.main.padding.x,
|
|
10064
10134
|
flexDirection: "column",
|
|
10065
10135
|
justifyContent: "center",
|
|
10066
|
-
children: /* @__PURE__ */
|
|
10067
|
-
/* @__PURE__ */
|
|
10068
|
-
showLogo && /* @__PURE__ */
|
|
10069
|
-
/* @__PURE__ */
|
|
10070
|
-
/* @__PURE__ */
|
|
10136
|
+
children: /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", gap: 2, children: [
|
|
10137
|
+
/* @__PURE__ */ jsx13(ResizeNotice, {}),
|
|
10138
|
+
showLogo && /* @__PURE__ */ jsx13(Logo, {}),
|
|
10139
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.muted, children: "\u2726 From zero \u2192 working search in ~10 minutes" }),
|
|
10140
|
+
/* @__PURE__ */ jsx13(Box14, { flexDirection: "column", children: actions.map((action, i) => /* @__PURE__ */ jsx13(
|
|
10071
10141
|
SelectRow,
|
|
10072
10142
|
{
|
|
10073
10143
|
highlighted: i === index,
|
|
@@ -10076,21 +10146,21 @@ function Welcome() {
|
|
|
10076
10146
|
},
|
|
10077
10147
|
action.label
|
|
10078
10148
|
)) }),
|
|
10079
|
-
/* @__PURE__ */
|
|
10080
|
-
/* @__PURE__ */
|
|
10081
|
-
/* @__PURE__ */
|
|
10082
|
-
/* @__PURE__ */
|
|
10149
|
+
/* @__PURE__ */ jsxs13(Box14, { gap: 2, children: [
|
|
10150
|
+
/* @__PURE__ */ jsxs13(Text15, { children: [
|
|
10151
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.primary, children: "[\u2191] [\u2193]" }),
|
|
10152
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.dim, children: " move" })
|
|
10083
10153
|
] }),
|
|
10084
|
-
/* @__PURE__ */
|
|
10085
|
-
/* @__PURE__ */
|
|
10086
|
-
/* @__PURE__ */
|
|
10154
|
+
/* @__PURE__ */ jsxs13(Text15, { children: [
|
|
10155
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.primary, children: "[enter]" }),
|
|
10156
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.dim, children: " confirm" })
|
|
10087
10157
|
] })
|
|
10088
10158
|
] })
|
|
10089
10159
|
] })
|
|
10090
10160
|
}
|
|
10091
10161
|
),
|
|
10092
|
-
showSidebar && /* @__PURE__ */
|
|
10093
|
-
|
|
10162
|
+
showSidebar && /* @__PURE__ */ jsxs13(
|
|
10163
|
+
Box14,
|
|
10094
10164
|
{
|
|
10095
10165
|
backgroundColor: COLORS.bg.sidebar,
|
|
10096
10166
|
width: 40,
|
|
@@ -10100,8 +10170,8 @@ function Welcome() {
|
|
|
10100
10170
|
flexDirection: "column",
|
|
10101
10171
|
justifyContent: "center",
|
|
10102
10172
|
children: [
|
|
10103
|
-
/* @__PURE__ */
|
|
10104
|
-
sidebarItems.map((i, idx) => /* @__PURE__ */
|
|
10173
|
+
/* @__PURE__ */ jsx13(Text15, { color: COLORS.muted, children: "WHAT THIS WIZARD WILL DO" }),
|
|
10174
|
+
sidebarItems.map((i, idx) => /* @__PURE__ */ jsx13(SidebarItem, { title: i.title, description: i.description }, idx))
|
|
10105
10175
|
]
|
|
10106
10176
|
}
|
|
10107
10177
|
)
|
|
@@ -10109,7 +10179,7 @@ function Welcome() {
|
|
|
10109
10179
|
}
|
|
10110
10180
|
|
|
10111
10181
|
// src/ui/LearnMore.tsx
|
|
10112
|
-
import { Box as
|
|
10182
|
+
import { Box as Box15, Text as Text16, useInput as useInput7, useWindowSize as useWindowSize7 } from "ink";
|
|
10113
10183
|
|
|
10114
10184
|
// src/ui/copy/learn-more.ts
|
|
10115
10185
|
var accessIntro = "Everything runs locally on your machine. Nothing is written or sent without an explicit yes from you.";
|
|
@@ -10151,7 +10221,7 @@ var policyLinks = [
|
|
|
10151
10221
|
];
|
|
10152
10222
|
|
|
10153
10223
|
// src/ui/LearnMore.tsx
|
|
10154
|
-
import { jsx as
|
|
10224
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
10155
10225
|
var TAG_COLORS = {
|
|
10156
10226
|
READ: COLORS.success,
|
|
10157
10227
|
WRITE: COLORS.badge,
|
|
@@ -10286,8 +10356,8 @@ function LearnMore() {
|
|
|
10286
10356
|
else if (scrollable && (input === "j" || key.downArrow)) scroll.scrollBy(1);
|
|
10287
10357
|
});
|
|
10288
10358
|
const visible = rows.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
10289
|
-
return /* @__PURE__ */
|
|
10290
|
-
|
|
10359
|
+
return /* @__PURE__ */ jsxs14(
|
|
10360
|
+
Box15,
|
|
10291
10361
|
{
|
|
10292
10362
|
flexDirection: "column",
|
|
10293
10363
|
paddingX: PADDING_X,
|
|
@@ -10295,23 +10365,23 @@ function LearnMore() {
|
|
|
10295
10365
|
width: "100%",
|
|
10296
10366
|
flexGrow: 1,
|
|
10297
10367
|
children: [
|
|
10298
|
-
/* @__PURE__ */
|
|
10299
|
-
/* @__PURE__ */
|
|
10300
|
-
scrollable && /* @__PURE__ */
|
|
10301
|
-
/* @__PURE__ */
|
|
10302
|
-
/* @__PURE__ */
|
|
10368
|
+
/* @__PURE__ */ jsx14(ResizeNotice, {}),
|
|
10369
|
+
/* @__PURE__ */ jsx14(ScrollView, { scroll, children: visible.map((row, i) => /* @__PURE__ */ jsx14(Text16, { wrap: "truncate", children: row.parts.map((part, j) => /* @__PURE__ */ jsx14(Text16, { color: part.color, bold: part.bold, children: part.text }, j)) }, `learn-more-${scroll.offset}-${i}`)) }),
|
|
10370
|
+
scrollable && /* @__PURE__ */ jsxs14(Text16, { children: [
|
|
10371
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.primary, children: "[j] [k]" }),
|
|
10372
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.dim, children: " scroll" })
|
|
10303
10373
|
] }),
|
|
10304
|
-
/* @__PURE__ */
|
|
10305
|
-
/* @__PURE__ */
|
|
10306
|
-
/* @__PURE__ */
|
|
10307
|
-
/* @__PURE__ */
|
|
10308
|
-
/* @__PURE__ */
|
|
10374
|
+
/* @__PURE__ */ jsxs14(Box15, { flexDirection: "row", gap: 3, children: [
|
|
10375
|
+
/* @__PURE__ */ jsxs14(Box15, { flexDirection: "row", gap: 1, children: [
|
|
10376
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.muted, children: "[" }),
|
|
10377
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.primary, children: "esc" }),
|
|
10378
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.muted, children: "] back" })
|
|
10309
10379
|
] }),
|
|
10310
|
-
/* @__PURE__ */
|
|
10311
|
-
/* @__PURE__ */
|
|
10312
|
-
/* @__PURE__ */
|
|
10313
|
-
/* @__PURE__ */
|
|
10314
|
-
/* @__PURE__ */
|
|
10380
|
+
/* @__PURE__ */ jsxs14(Box15, { flexDirection: "row", gap: 1, children: [
|
|
10381
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.muted, children: "[" }),
|
|
10382
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.primary, children: "enter" }),
|
|
10383
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.muted, children: "]" }),
|
|
10384
|
+
/* @__PURE__ */ jsx14(Text16, { color: COLORS.success, bold: true, children: "start wizard" })
|
|
10315
10385
|
] })
|
|
10316
10386
|
] })
|
|
10317
10387
|
]
|
|
@@ -10320,17 +10390,17 @@ function LearnMore() {
|
|
|
10320
10390
|
}
|
|
10321
10391
|
|
|
10322
10392
|
// src/ui/Sidebar.tsx
|
|
10323
|
-
import { Box as
|
|
10393
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
10324
10394
|
|
|
10325
10395
|
// src/ui/Steps.tsx
|
|
10326
|
-
import { Box as
|
|
10396
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
10327
10397
|
import Spinner2 from "ink-spinner";
|
|
10328
|
-
import { jsx as
|
|
10398
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
10329
10399
|
function Steps() {
|
|
10330
10400
|
const { steps } = useWizard();
|
|
10331
10401
|
const visibleSteps = steps.filter(isStepVisible);
|
|
10332
|
-
return /* @__PURE__ */
|
|
10333
|
-
s.status === "running" ? /* @__PURE__ */
|
|
10402
|
+
return /* @__PURE__ */ jsx15(Box16, { flexDirection: "column", gap: 1, children: visibleSteps.map((s) => /* @__PURE__ */ jsx15(Box16, { flexDirection: "column", children: /* @__PURE__ */ jsxs15(Text17, { color: COLORS.status[s.status], children: [
|
|
10403
|
+
s.status === "running" ? /* @__PURE__ */ jsx15(Spinner2, { type: "dots" }) : MARKER[s.status],
|
|
10334
10404
|
" ",
|
|
10335
10405
|
s.title
|
|
10336
10406
|
] }) }, s.id)) });
|
|
@@ -10339,27 +10409,27 @@ function CurrentStep() {
|
|
|
10339
10409
|
const { steps } = useWizard();
|
|
10340
10410
|
const currentStep = steps.filter(isStepVisible).find((s) => s.status === "running");
|
|
10341
10411
|
if (!currentStep) return null;
|
|
10342
|
-
return /* @__PURE__ */
|
|
10343
|
-
/* @__PURE__ */
|
|
10412
|
+
return /* @__PURE__ */ jsxs15(Text17, { color: COLORS.status.running, children: [
|
|
10413
|
+
/* @__PURE__ */ jsx15(Spinner2, { type: "dots" }),
|
|
10344
10414
|
" ",
|
|
10345
10415
|
` ${currentStep.title}`
|
|
10346
10416
|
] });
|
|
10347
10417
|
}
|
|
10348
10418
|
|
|
10349
10419
|
// src/ui/Progress.tsx
|
|
10350
|
-
import { Box as
|
|
10351
|
-
import { jsx as
|
|
10420
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
10421
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10352
10422
|
function Progress() {
|
|
10353
10423
|
const { steps, currentStepIndex } = useWizard();
|
|
10354
10424
|
const visibleSteps = steps.filter(isStepVisible);
|
|
10355
10425
|
if (visibleSteps.length === 0) return null;
|
|
10356
10426
|
const visibleCountThroughCurrent = steps.slice(0, currentStepIndex + 1).filter(isStepVisible).length;
|
|
10357
10427
|
const activeStepNumber = Math.max(1, visibleCountThroughCurrent);
|
|
10358
|
-
return /* @__PURE__ */
|
|
10359
|
-
/* @__PURE__ */
|
|
10360
|
-
/* @__PURE__ */
|
|
10361
|
-
/* @__PURE__ */
|
|
10362
|
-
/* @__PURE__ */
|
|
10428
|
+
return /* @__PURE__ */ jsxs16(Box17, { flexDirection: "row", gap: 1, children: [
|
|
10429
|
+
/* @__PURE__ */ jsx16(Text18, { color: COLORS.muted, children: "STEP" }),
|
|
10430
|
+
/* @__PURE__ */ jsx16(Text18, { color: COLORS.strong, bold: true, children: activeStepNumber }),
|
|
10431
|
+
/* @__PURE__ */ jsx16(Text18, { color: COLORS.strong, bold: true, children: "/" }),
|
|
10432
|
+
/* @__PURE__ */ jsx16(Text18, { color: COLORS.strong, bold: true, children: visibleSteps.length })
|
|
10363
10433
|
] });
|
|
10364
10434
|
}
|
|
10365
10435
|
|
|
@@ -10374,11 +10444,11 @@ var logsSidebarCommands = [
|
|
|
10374
10444
|
];
|
|
10375
10445
|
|
|
10376
10446
|
// src/ui/Sidebar.tsx
|
|
10377
|
-
import { jsx as
|
|
10447
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10378
10448
|
function Sidebar({ inLogs = false }) {
|
|
10379
10449
|
const commands = inLogs ? logsSidebarCommands : sidebarCommands;
|
|
10380
|
-
return /* @__PURE__ */
|
|
10381
|
-
|
|
10450
|
+
return /* @__PURE__ */ jsxs17(
|
|
10451
|
+
Box18,
|
|
10382
10452
|
{
|
|
10383
10453
|
backgroundColor: "#14171E",
|
|
10384
10454
|
width: 30,
|
|
@@ -10387,16 +10457,16 @@ function Sidebar({ inLogs = false }) {
|
|
|
10387
10457
|
flexDirection: "column",
|
|
10388
10458
|
justifyContent: "space-between",
|
|
10389
10459
|
children: [
|
|
10390
|
-
/* @__PURE__ */
|
|
10391
|
-
/* @__PURE__ */
|
|
10392
|
-
/* @__PURE__ */
|
|
10460
|
+
/* @__PURE__ */ jsxs17(Box18, { flexDirection: "column", gap: 1, children: [
|
|
10461
|
+
/* @__PURE__ */ jsx17(Text19, { color: COLORS.muted, children: "PROGRESS" }),
|
|
10462
|
+
/* @__PURE__ */ jsx17(Steps, {})
|
|
10393
10463
|
] }),
|
|
10394
|
-
/* @__PURE__ */
|
|
10395
|
-
/* @__PURE__ */
|
|
10396
|
-
/* @__PURE__ */
|
|
10397
|
-
return /* @__PURE__ */
|
|
10398
|
-
/* @__PURE__ */
|
|
10399
|
-
/* @__PURE__ */
|
|
10464
|
+
/* @__PURE__ */ jsxs17(Box18, { flexDirection: "column", gap: 1, children: [
|
|
10465
|
+
/* @__PURE__ */ jsx17(Progress, {}),
|
|
10466
|
+
/* @__PURE__ */ jsx17(Box18, { flexDirection: "column", children: commands.map((c) => {
|
|
10467
|
+
return /* @__PURE__ */ jsxs17(Box18, { flexDirection: "row", gap: 1, children: [
|
|
10468
|
+
/* @__PURE__ */ jsx17(Text19, { color: COLORS.primary, children: `[${c.keyHint}]` }),
|
|
10469
|
+
/* @__PURE__ */ jsx17(Text19, { color: COLORS.muted, children: c.description })
|
|
10400
10470
|
] }, c.keyHint);
|
|
10401
10471
|
}) })
|
|
10402
10472
|
] })
|
|
@@ -10406,12 +10476,12 @@ function Sidebar({ inLogs = false }) {
|
|
|
10406
10476
|
}
|
|
10407
10477
|
|
|
10408
10478
|
// src/ui/Ribbon.tsx
|
|
10409
|
-
import { Box as
|
|
10410
|
-
import { jsx as
|
|
10479
|
+
import { Box as Box19, Text as Text20 } from "ink";
|
|
10480
|
+
import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10411
10481
|
function Ribbon() {
|
|
10412
10482
|
const firstCommand = sidebarCommands[0];
|
|
10413
|
-
return /* @__PURE__ */
|
|
10414
|
-
|
|
10483
|
+
return /* @__PURE__ */ jsxs18(
|
|
10484
|
+
Box19,
|
|
10415
10485
|
{
|
|
10416
10486
|
backgroundColor: "#14171E",
|
|
10417
10487
|
flexDirection: "row",
|
|
@@ -10419,11 +10489,11 @@ function Ribbon() {
|
|
|
10419
10489
|
paddingX: 2,
|
|
10420
10490
|
paddingY: 1,
|
|
10421
10491
|
children: [
|
|
10422
|
-
/* @__PURE__ */
|
|
10423
|
-
/* @__PURE__ */
|
|
10424
|
-
/* @__PURE__ */
|
|
10425
|
-
/* @__PURE__ */
|
|
10426
|
-
/* @__PURE__ */
|
|
10492
|
+
/* @__PURE__ */ jsx18(Progress, {}),
|
|
10493
|
+
/* @__PURE__ */ jsx18(CurrentStep, {}),
|
|
10494
|
+
/* @__PURE__ */ jsxs18(Box19, { flexDirection: "row", gap: 1, children: [
|
|
10495
|
+
/* @__PURE__ */ jsx18(Text20, { color: COLORS.primary, children: `[${firstCommand.keyHint}]` }),
|
|
10496
|
+
/* @__PURE__ */ jsx18(Text20, { color: COLORS.muted, children: firstCommand.description })
|
|
10427
10497
|
] })
|
|
10428
10498
|
]
|
|
10429
10499
|
}
|
|
@@ -10434,11 +10504,11 @@ function Ribbon() {
|
|
|
10434
10504
|
import { useState as useState14 } from "react";
|
|
10435
10505
|
|
|
10436
10506
|
// src/ui/Logs.tsx
|
|
10437
|
-
import { Box as
|
|
10507
|
+
import { Box as Box21, Text as Text22, useInput as useInput9 } from "ink";
|
|
10438
10508
|
import { useLayoutEffect as useLayoutEffect6, useState as useState12 } from "react";
|
|
10439
10509
|
|
|
10440
10510
|
// src/ui/LogDetails.tsx
|
|
10441
|
-
import { Box as
|
|
10511
|
+
import { Box as Box20, Text as Text21, useInput as useInput8 } from "ink";
|
|
10442
10512
|
import { useLayoutEffect as useLayoutEffect5, useMemo, useState as useState11 } from "react";
|
|
10443
10513
|
|
|
10444
10514
|
// src/ui/logFormat.ts
|
|
@@ -10469,7 +10539,7 @@ function durationText(entry) {
|
|
|
10469
10539
|
}
|
|
10470
10540
|
|
|
10471
10541
|
// src/ui/LogDetails.tsx
|
|
10472
|
-
import { jsx as
|
|
10542
|
+
import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
10473
10543
|
var BLANK4 = { text: " ", color: COLORS.dim };
|
|
10474
10544
|
var VALUE_INDENT = " ";
|
|
10475
10545
|
var TAB = " ";
|
|
@@ -10527,9 +10597,9 @@ function LogDetails({
|
|
|
10527
10597
|
else if (key.escape) onClose();
|
|
10528
10598
|
});
|
|
10529
10599
|
const visible = lines.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
10530
|
-
return /* @__PURE__ */
|
|
10531
|
-
/* @__PURE__ */
|
|
10532
|
-
|
|
10600
|
+
return /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", flexGrow: 1, children: [
|
|
10601
|
+
/* @__PURE__ */ jsx19(ScrollView, { scroll, children: visible.map((line, i) => /* @__PURE__ */ jsx19(
|
|
10602
|
+
Text21,
|
|
10533
10603
|
{
|
|
10534
10604
|
color: line.color,
|
|
10535
10605
|
bold: line.bold,
|
|
@@ -10538,21 +10608,21 @@ function LogDetails({
|
|
|
10538
10608
|
},
|
|
10539
10609
|
`detail-${scroll.offset + i}`
|
|
10540
10610
|
)) }),
|
|
10541
|
-
/* @__PURE__ */
|
|
10542
|
-
scroll.maxOffset > 0 && /* @__PURE__ */
|
|
10543
|
-
/* @__PURE__ */
|
|
10544
|
-
/* @__PURE__ */
|
|
10611
|
+
/* @__PURE__ */ jsxs19(Box20, { gap: 2, children: [
|
|
10612
|
+
scroll.maxOffset > 0 && /* @__PURE__ */ jsxs19(Text21, { children: [
|
|
10613
|
+
/* @__PURE__ */ jsx19(Text21, { color: COLORS.primary, children: "[j] [k]" }),
|
|
10614
|
+
/* @__PURE__ */ jsx19(Text21, { color: COLORS.dim, children: " scroll" })
|
|
10545
10615
|
] }),
|
|
10546
|
-
/* @__PURE__ */
|
|
10547
|
-
/* @__PURE__ */
|
|
10548
|
-
/* @__PURE__ */
|
|
10616
|
+
/* @__PURE__ */ jsxs19(Text21, { children: [
|
|
10617
|
+
/* @__PURE__ */ jsx19(Text21, { color: COLORS.primary, children: "[esc]" }),
|
|
10618
|
+
/* @__PURE__ */ jsx19(Text21, { color: COLORS.dim, children: " back" })
|
|
10549
10619
|
] })
|
|
10550
10620
|
] })
|
|
10551
10621
|
] });
|
|
10552
10622
|
}
|
|
10553
10623
|
|
|
10554
10624
|
// src/ui/Logs.tsx
|
|
10555
|
-
import { Fragment, jsx as
|
|
10625
|
+
import { Fragment, jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
10556
10626
|
var ROW_GAP = 1;
|
|
10557
10627
|
var SELECTED_MARKER = "\u276F";
|
|
10558
10628
|
function truncate3(str, maxWidth) {
|
|
@@ -10597,9 +10667,9 @@ function Logs({ onBack }) {
|
|
|
10597
10667
|
{ isActive: !openEntry }
|
|
10598
10668
|
);
|
|
10599
10669
|
const visible = logs.slice(scroll.offset, scroll.offset + scroll.capacity);
|
|
10600
|
-
return /* @__PURE__ */
|
|
10601
|
-
logs.length === 0 && /* @__PURE__ */
|
|
10602
|
-
/* @__PURE__ */
|
|
10670
|
+
return /* @__PURE__ */ jsx20(Box21, { flexDirection: "column", paddingX: 4, paddingY: 2, flexGrow: 1, children: openEntry ? /* @__PURE__ */ jsx20(LogDetails, { entry: openEntry, onClose: () => setOpenLogId(null) }) : /* @__PURE__ */ jsxs20(Fragment, { children: [
|
|
10671
|
+
logs.length === 0 && /* @__PURE__ */ jsx20(Text22, { color: COLORS.dim, children: "No logs yet." }),
|
|
10672
|
+
/* @__PURE__ */ jsx20(ScrollView, { scroll, children: visible.map((entry, i) => {
|
|
10603
10673
|
const selected = scroll.offset + i === selectedIndex;
|
|
10604
10674
|
const timestamp = `[${formatTimestamp(entry.startedAt)}]`;
|
|
10605
10675
|
const duration = durationText(entry);
|
|
@@ -10610,26 +10680,26 @@ function Logs({ onBack }) {
|
|
|
10610
10680
|
const name = truncate3(entry.name, budget);
|
|
10611
10681
|
budget -= name.length;
|
|
10612
10682
|
const preview = rawPreview ? truncate3(rawPreview, budget) : "";
|
|
10613
|
-
return /* @__PURE__ */
|
|
10614
|
-
/* @__PURE__ */
|
|
10615
|
-
/* @__PURE__ */
|
|
10616
|
-
/* @__PURE__ */
|
|
10617
|
-
preview && /* @__PURE__ */
|
|
10618
|
-
duration && /* @__PURE__ */
|
|
10683
|
+
return /* @__PURE__ */ jsxs20(Box21, { flexDirection: "row", gap: ROW_GAP, children: [
|
|
10684
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.success, children: selected ? SELECTED_MARKER : " " }),
|
|
10685
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.dim, children: timestamp }),
|
|
10686
|
+
/* @__PURE__ */ jsx20(Text22, { color: logNameColor(entry), wrap: "truncate", children: name }),
|
|
10687
|
+
preview && /* @__PURE__ */ jsx20(Text22, { color: COLORS.dim, wrap: "truncate", children: preview }),
|
|
10688
|
+
duration && /* @__PURE__ */ jsx20(Text22, { color: COLORS.dim, children: duration })
|
|
10619
10689
|
] }, entry.id);
|
|
10620
10690
|
}) }),
|
|
10621
|
-
/* @__PURE__ */
|
|
10622
|
-
/* @__PURE__ */
|
|
10623
|
-
/* @__PURE__ */
|
|
10624
|
-
/* @__PURE__ */
|
|
10691
|
+
/* @__PURE__ */ jsxs20(Box21, { gap: 2, children: [
|
|
10692
|
+
/* @__PURE__ */ jsxs20(Text22, { children: [
|
|
10693
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.primary, children: "[j] [k]" }),
|
|
10694
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.dim, children: " select" })
|
|
10625
10695
|
] }),
|
|
10626
|
-
/* @__PURE__ */
|
|
10627
|
-
/* @__PURE__ */
|
|
10628
|
-
/* @__PURE__ */
|
|
10696
|
+
/* @__PURE__ */ jsxs20(Text22, { children: [
|
|
10697
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.primary, children: "[enter]" }),
|
|
10698
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.dim, children: " details" })
|
|
10629
10699
|
] }),
|
|
10630
|
-
/* @__PURE__ */
|
|
10631
|
-
/* @__PURE__ */
|
|
10632
|
-
/* @__PURE__ */
|
|
10700
|
+
/* @__PURE__ */ jsxs20(Text22, { children: [
|
|
10701
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.primary, children: "[esc]" }),
|
|
10702
|
+
/* @__PURE__ */ jsx20(Text22, { color: COLORS.dim, children: " back" })
|
|
10633
10703
|
] })
|
|
10634
10704
|
] })
|
|
10635
10705
|
] }) });
|
|
@@ -10637,12 +10707,12 @@ function Logs({ onBack }) {
|
|
|
10637
10707
|
|
|
10638
10708
|
// src/ui/Tips.tsx
|
|
10639
10709
|
import { useEffect as useEffect3, useRef as useRef4, useState as useState13 } from "react";
|
|
10640
|
-
import { Box as
|
|
10710
|
+
import { Box as Box23, Text as Text24 } from "ink";
|
|
10641
10711
|
import terminalLink from "terminal-link";
|
|
10642
10712
|
|
|
10643
10713
|
// src/ui/Code.tsx
|
|
10644
|
-
import { Box as
|
|
10645
|
-
import { jsx as
|
|
10714
|
+
import { Box as Box22, Text as Text23 } from "ink";
|
|
10715
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
10646
10716
|
var TOKEN_RE = /("(?:\\.|[^"\\])*"|\btrue\b|\bfalse\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|[{}[\]:,])/g;
|
|
10647
10717
|
function highlightJson(json) {
|
|
10648
10718
|
const parts = json.split(TOKEN_RE);
|
|
@@ -10651,22 +10721,22 @@ function highlightJson(json) {
|
|
|
10651
10721
|
if (part[0] === '"') {
|
|
10652
10722
|
const next = parts.slice(i + 1).find((p) => p.trim());
|
|
10653
10723
|
const isKey = next?.trimStart().startsWith(":");
|
|
10654
|
-
return /* @__PURE__ */
|
|
10724
|
+
return /* @__PURE__ */ jsx21(Text23, { color: isKey ? "cyan" : "green", children: part }, i);
|
|
10655
10725
|
}
|
|
10656
10726
|
if (part === "true" || part === "false" || part === "null") {
|
|
10657
|
-
return /* @__PURE__ */
|
|
10727
|
+
return /* @__PURE__ */ jsx21(Text23, { color: "magenta", children: part }, i);
|
|
10658
10728
|
}
|
|
10659
10729
|
if (/^-?\d/.test(part)) {
|
|
10660
|
-
return /* @__PURE__ */
|
|
10730
|
+
return /* @__PURE__ */ jsx21(Text23, { color: "yellow", children: part }, i);
|
|
10661
10731
|
}
|
|
10662
10732
|
if (/^[{}[\]:,]$/.test(part)) {
|
|
10663
|
-
return /* @__PURE__ */
|
|
10733
|
+
return /* @__PURE__ */ jsx21(Text23, { color: COLORS.dim, children: part }, i);
|
|
10664
10734
|
}
|
|
10665
|
-
return /* @__PURE__ */
|
|
10735
|
+
return /* @__PURE__ */ jsx21(Text23, { children: part }, i);
|
|
10666
10736
|
});
|
|
10667
10737
|
}
|
|
10668
10738
|
function Code({ children }) {
|
|
10669
|
-
return /* @__PURE__ */
|
|
10739
|
+
return /* @__PURE__ */ jsx21(Box22, { children: /* @__PURE__ */ jsx21(Text23, { children: highlightJson(children) }) });
|
|
10670
10740
|
}
|
|
10671
10741
|
|
|
10672
10742
|
// src/ui/copy/tips.ts
|
|
@@ -10862,26 +10932,26 @@ var tips = [
|
|
|
10862
10932
|
];
|
|
10863
10933
|
|
|
10864
10934
|
// src/ui/Tips.tsx
|
|
10865
|
-
import { jsx as
|
|
10935
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
10866
10936
|
var TICK_MS = 16;
|
|
10867
10937
|
var CHUNK_HOLD_MS = 2e3;
|
|
10868
10938
|
var TIP_DURATION_MS = 25e3;
|
|
10869
10939
|
function TipTitle({ children }) {
|
|
10870
|
-
return /* @__PURE__ */
|
|
10871
|
-
/* @__PURE__ */
|
|
10872
|
-
/* @__PURE__ */
|
|
10940
|
+
return /* @__PURE__ */ jsxs21(Box23, { gap: 1, children: [
|
|
10941
|
+
/* @__PURE__ */ jsx22(Text24, { color: "cyan", children: "\u2726" }),
|
|
10942
|
+
/* @__PURE__ */ jsx22(Text24, { color: "white", bold: true, children })
|
|
10873
10943
|
] });
|
|
10874
10944
|
}
|
|
10875
10945
|
function InlineSegment({ segment }) {
|
|
10876
10946
|
switch (segment.type) {
|
|
10877
10947
|
case "highlight":
|
|
10878
|
-
return /* @__PURE__ */
|
|
10948
|
+
return /* @__PURE__ */ jsx22(Text24, { color: COLORS.success, children: segment.value });
|
|
10879
10949
|
case "link":
|
|
10880
|
-
return /* @__PURE__ */
|
|
10950
|
+
return /* @__PURE__ */ jsx22(Text24, { color: "cyan", underline: true, children: segment.href ? terminalLink(segment.value, segment.href) : segment.value });
|
|
10881
10951
|
case "codeword":
|
|
10882
|
-
return /* @__PURE__ */
|
|
10952
|
+
return /* @__PURE__ */ jsx22(Text24, { color: COLORS.highlight.fg, backgroundColor: COLORS.highlight.bg, children: segment.value });
|
|
10883
10953
|
default:
|
|
10884
|
-
return /* @__PURE__ */
|
|
10954
|
+
return /* @__PURE__ */ jsx22(Text24, { color: COLORS.muted, children: segment.value });
|
|
10885
10955
|
}
|
|
10886
10956
|
}
|
|
10887
10957
|
function TipContent({
|
|
@@ -10915,10 +10985,10 @@ function TipContent({
|
|
|
10915
10985
|
blocks.push({ type: "inline", segments: [segment] });
|
|
10916
10986
|
}
|
|
10917
10987
|
}
|
|
10918
|
-
return /* @__PURE__ */
|
|
10919
|
-
(block, i) => block.type === "code" ? /* @__PURE__ */
|
|
10988
|
+
return /* @__PURE__ */ jsx22(Box23, { flexDirection: "column", marginLeft: 2, gap: 1, children: blocks.map(
|
|
10989
|
+
(block, i) => block.type === "code" ? /* @__PURE__ */ jsx22(Code, { children: block.segment.value }, i) : /* @__PURE__ */ jsx22(Text24, { children: block.segments.map((segment, j) => /* @__PURE__ */ jsxs21(Text24, { children: [
|
|
10920
10990
|
j > 0 && " ",
|
|
10921
|
-
/* @__PURE__ */
|
|
10991
|
+
/* @__PURE__ */ jsx22(InlineSegment, { segment })
|
|
10922
10992
|
] }, j)) }, i)
|
|
10923
10993
|
) });
|
|
10924
10994
|
}
|
|
@@ -11008,9 +11078,9 @@ function Tips({
|
|
|
11008
11078
|
if (position.complete) return null;
|
|
11009
11079
|
const titleRevealed = tip.title.slice(0, revealed);
|
|
11010
11080
|
const contentRevealed = Math.max(0, revealed - tip.title.length);
|
|
11011
|
-
return /* @__PURE__ */
|
|
11012
|
-
/* @__PURE__ */
|
|
11013
|
-
/* @__PURE__ */
|
|
11081
|
+
return /* @__PURE__ */ jsxs21(Box23, { flexDirection: "column", marginBottom: 1, gap: 1, children: [
|
|
11082
|
+
/* @__PURE__ */ jsx22(TipTitle, { children: titleRevealed }),
|
|
11083
|
+
/* @__PURE__ */ jsx22(TipContent, { chunks: tip.chunks, revealed: contentRevealed })
|
|
11014
11084
|
] });
|
|
11015
11085
|
}
|
|
11016
11086
|
|
|
@@ -11052,7 +11122,7 @@ function useRepaintOnResize(debounceMs = 100) {
|
|
|
11052
11122
|
}
|
|
11053
11123
|
|
|
11054
11124
|
// src/ui/App.tsx
|
|
11055
|
-
import { jsx as
|
|
11125
|
+
import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11056
11126
|
function App() {
|
|
11057
11127
|
const {
|
|
11058
11128
|
phase,
|
|
@@ -11128,8 +11198,8 @@ function App() {
|
|
|
11128
11198
|
/* Clamped to exactly the viewport: a taller frame makes Ink clear and repaint
|
|
11129
11199
|
the whole screen, and the scrolling throws off its cursor arithmetic.
|
|
11130
11200
|
Flicker and leftover rows. */
|
|
11131
|
-
/* @__PURE__ */
|
|
11132
|
-
|
|
11201
|
+
/* @__PURE__ */ jsxs22(
|
|
11202
|
+
Box24,
|
|
11133
11203
|
{
|
|
11134
11204
|
backgroundColor: COLORS.bg.main,
|
|
11135
11205
|
flexDirection: "row",
|
|
@@ -11137,16 +11207,16 @@ function App() {
|
|
|
11137
11207
|
height: rows,
|
|
11138
11208
|
overflow: "hidden",
|
|
11139
11209
|
children: [
|
|
11140
|
-
mainWindowVisible && /* @__PURE__ */
|
|
11141
|
-
|
|
11210
|
+
mainWindowVisible && /* @__PURE__ */ jsxs22(
|
|
11211
|
+
Box24,
|
|
11142
11212
|
{
|
|
11143
11213
|
flexDirection,
|
|
11144
11214
|
width: "100%",
|
|
11145
11215
|
maxHeight: rows,
|
|
11146
11216
|
justifyContent: "space-between",
|
|
11147
11217
|
children: [
|
|
11148
|
-
showLogs ? /* @__PURE__ */
|
|
11149
|
-
|
|
11218
|
+
showLogs ? /* @__PURE__ */ jsx23(Logs, { onBack: () => setShowLogs(false) }) : /* @__PURE__ */ jsxs22(
|
|
11219
|
+
Box24,
|
|
11150
11220
|
{
|
|
11151
11221
|
flexDirection: "column",
|
|
11152
11222
|
paddingX: 4,
|
|
@@ -11155,58 +11225,55 @@ function App() {
|
|
|
11155
11225
|
flexGrow: 1,
|
|
11156
11226
|
gap: 1,
|
|
11157
11227
|
children: [
|
|
11158
|
-
/* @__PURE__ */
|
|
11159
|
-
phase === "preflight" && !user && /* @__PURE__ */
|
|
11160
|
-
/* @__PURE__ */
|
|
11228
|
+
/* @__PURE__ */ jsxs22(Box24, { flexGrow: 2, flexDirection: "column", children: [
|
|
11229
|
+
phase === "preflight" && !user && /* @__PURE__ */ jsx23(Box24, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs22(Text25, { color: COLORS.strong, bold: true, children: [
|
|
11230
|
+
/* @__PURE__ */ jsx23(Spinner3, { type: "dots" }),
|
|
11161
11231
|
" Signing in to Algolia"
|
|
11162
11232
|
] }) }),
|
|
11163
|
-
phase === "preflight" && user && /* @__PURE__ */
|
|
11164
|
-
/* @__PURE__ */
|
|
11233
|
+
phase === "preflight" && user && /* @__PURE__ */ jsx23(Box24, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs22(Text25, { color: COLORS.strong, bold: true, children: [
|
|
11234
|
+
/* @__PURE__ */ jsx23(Spinner3, { type: "dots" }),
|
|
11165
11235
|
" Getting things ready"
|
|
11166
11236
|
] }) }),
|
|
11167
|
-
phase === "authenticating" && /* @__PURE__ */
|
|
11168
|
-
/* @__PURE__ */
|
|
11169
|
-
/* @__PURE__ */
|
|
11237
|
+
phase === "authenticating" && /* @__PURE__ */ jsxs22(Box24, { flexDirection: "column", marginBottom: 1, children: [
|
|
11238
|
+
/* @__PURE__ */ jsxs22(Text25, { color: COLORS.strong, bold: true, children: [
|
|
11239
|
+
/* @__PURE__ */ jsx23(Spinner3, { type: "dots" }),
|
|
11170
11240
|
" Signing in to Algolia"
|
|
11171
11241
|
] }),
|
|
11172
|
-
/* @__PURE__ */
|
|
11242
|
+
/* @__PURE__ */ jsx23(Text25, { color: COLORS.muted, children: "A browser window will open \u2014 complete sign-in there." })
|
|
11173
11243
|
] }),
|
|
11174
|
-
settingUpAppId && /* @__PURE__ */
|
|
11175
|
-
/* @__PURE__ */
|
|
11244
|
+
settingUpAppId && /* @__PURE__ */ jsx23(Box24, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs22(Text25, { color: COLORS.strong, bold: true, children: [
|
|
11245
|
+
/* @__PURE__ */ jsx23(Spinner3, { type: "dots" }),
|
|
11176
11246
|
" Setting up Wizard using app",
|
|
11177
11247
|
" ",
|
|
11178
11248
|
settingUpAppId
|
|
11179
11249
|
] }) }),
|
|
11180
|
-
phase === "running" && !settingUpAppId && loadingMessage && /* @__PURE__ */
|
|
11181
|
-
/* @__PURE__ */
|
|
11250
|
+
phase === "running" && !settingUpAppId && loadingMessage && /* @__PURE__ */ jsx23(Box24, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs22(Text25, { color: COLORS.strong, bold: true, children: [
|
|
11251
|
+
/* @__PURE__ */ jsx23(Spinner3, { type: "dots" }),
|
|
11182
11252
|
" ",
|
|
11183
11253
|
loadingMessage
|
|
11184
11254
|
] }) }),
|
|
11185
|
-
/* @__PURE__ */
|
|
11186
|
-
showTips && /* @__PURE__ */
|
|
11255
|
+
/* @__PURE__ */ jsx23(CliOutput, {}),
|
|
11256
|
+
showTips && /* @__PURE__ */ jsx23(
|
|
11187
11257
|
Tips,
|
|
11188
11258
|
{
|
|
11189
11259
|
onRevealStateChange: setTipState,
|
|
11190
11260
|
onComplete: () => setTipsComplete(true)
|
|
11191
11261
|
}
|
|
11192
11262
|
),
|
|
11193
|
-
showNoticesInMain && showNotices && /* @__PURE__ */
|
|
11194
|
-
/* @__PURE__ */
|
|
11195
|
-
!showTips && /* @__PURE__ */
|
|
11196
|
-
phase === "error" && error && /* @__PURE__ */
|
|
11197
|
-
"\u2716 ",
|
|
11198
|
-
error
|
|
11199
|
-
] }) })
|
|
11263
|
+
showNoticesInMain && showNotices && /* @__PURE__ */ jsx23(Notices, { border: false }),
|
|
11264
|
+
/* @__PURE__ */ jsx23(Review, {}),
|
|
11265
|
+
!showTips && /* @__PURE__ */ jsx23(PromptInput, {}),
|
|
11266
|
+
phase === "error" && error && /* @__PURE__ */ jsx23(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx23(Alert, { variant: "error", message: error }) })
|
|
11200
11267
|
] }),
|
|
11201
|
-
!showNoticesInMain && showNotices && /* @__PURE__ */
|
|
11268
|
+
!showNoticesInMain && showNotices && /* @__PURE__ */ jsx23(Notices, {})
|
|
11202
11269
|
]
|
|
11203
11270
|
}
|
|
11204
11271
|
),
|
|
11205
|
-
showSidebar ? /* @__PURE__ */
|
|
11272
|
+
showSidebar ? /* @__PURE__ */ jsx23(Sidebar, { inLogs: showLogs }) : /* @__PURE__ */ jsx23(Ribbon, {})
|
|
11206
11273
|
]
|
|
11207
11274
|
}
|
|
11208
11275
|
),
|
|
11209
|
-
phase === "idle" && (homeScreen === "learnMore" ? /* @__PURE__ */
|
|
11276
|
+
phase === "idle" && (homeScreen === "learnMore" ? /* @__PURE__ */ jsx23(LearnMore, {}) : /* @__PURE__ */ jsx23(Welcome, {}))
|
|
11210
11277
|
]
|
|
11211
11278
|
}
|
|
11212
11279
|
)
|
|
@@ -11505,7 +11572,7 @@ async function promptResumeOrStartNew(session, next) {
|
|
|
11505
11572
|
// package.json with { type: 'json' }
|
|
11506
11573
|
var package_default2 = {
|
|
11507
11574
|
name: "@algolia/wizard",
|
|
11508
|
-
version: "0.
|
|
11575
|
+
version: "0.120.0",
|
|
11509
11576
|
description: "Magically implement Algolia functionality in your codebase",
|
|
11510
11577
|
type: "module",
|
|
11511
11578
|
engines: {
|
|
@@ -11611,7 +11678,7 @@ async function checkVersion() {
|
|
|
11611
11678
|
}
|
|
11612
11679
|
|
|
11613
11680
|
// src/main.tsx
|
|
11614
|
-
import { jsx as
|
|
11681
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
11615
11682
|
var FAILURE_EXIT_CODE = 1;
|
|
11616
11683
|
async function exitProcessWithError(store, instance, message) {
|
|
11617
11684
|
store.setError(message);
|
|
@@ -11687,7 +11754,7 @@ ${formatStepList(workflow)}`);
|
|
|
11687
11754
|
async function run(opts) {
|
|
11688
11755
|
const { workflow, skipResumePrompt, applicationId, playbookSlug, indexName } = opts;
|
|
11689
11756
|
const store = useWizard.getState();
|
|
11690
|
-
const instance = render(/* @__PURE__ */
|
|
11757
|
+
const instance = render(/* @__PURE__ */ jsx24(App, {}), { incrementalRendering: true });
|
|
11691
11758
|
await store.waitForStart();
|
|
11692
11759
|
store.syncSteps(
|
|
11693
11760
|
workflow.steps.map((s) => ({
|