@useconvoy/cli 0.163.0 → 0.173.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/LICENSE +201 -89
- package/NOTICE +2 -0
- package/README.md +13 -1
- package/dist/src/agent/app/runner.js +5 -4
- package/dist/src/agent/app/runner.js.map +1 -1
- package/dist/src/agent/app/worktree-op-processor.js +20 -1
- package/dist/src/agent/app/worktree-op-processor.js.map +1 -1
- package/dist/src/commands/connect/workflow.js +7 -3
- package/dist/src/commands/connect/workflow.js.map +1 -1
- package/dist/src/commands/devcontainer/command.js +1 -1
- package/dist/src/commands/devcontainer/command.js.map +1 -1
- package/dist/src/commands/devcontainer/install.d.ts +2 -2
- package/dist/src/commands/devcontainer/install.js +3 -3
- package/dist/src/commands/devcontainer/install.js.map +1 -1
- package/dist/src/commands/init/mcp-service.js +2 -2
- package/dist/src/commands/init/mcp-service.js.map +1 -1
- package/dist/src/commands/keys/workflow.d.ts +2 -0
- package/dist/src/commands/project/workflow.js +2 -3
- package/dist/src/commands/project/workflow.js.map +1 -1
- package/dist/src/commands/projects/archive.d.ts +3 -0
- package/dist/src/commands/projects/archive.js +44 -0
- package/dist/src/commands/projects/archive.js.map +1 -0
- package/dist/src/commands/projects/index.js +4 -1
- package/dist/src/commands/projects/index.js.map +1 -1
- package/dist/src/commands/projects/list.js +6 -5
- package/dist/src/commands/projects/list.js.map +1 -1
- package/dist/src/commands/service/formatters.d.ts +13 -1
- package/dist/src/commands/service/formatters.js +33 -0
- package/dist/src/commands/service/formatters.js.map +1 -1
- package/dist/src/commands/service/validators.d.ts +24 -0
- package/dist/src/commands/service/validators.js +9 -0
- package/dist/src/commands/service/validators.js.map +1 -1
- package/dist/src/commands/service/workflow.js +6 -1
- package/dist/src/commands/service/workflow.js.map +1 -1
- package/dist/src/commands/threads/create.js +19 -1
- package/dist/src/commands/threads/create.js.map +1 -1
- package/dist/src/commands/threads/get.js +2 -0
- package/dist/src/commands/threads/get.js.map +1 -1
- package/dist/src/commands/tui/actions/app.d.ts +2 -1
- package/dist/src/commands/tui/actions/app.js +34 -27
- package/dist/src/commands/tui/actions/app.js.map +1 -1
- package/dist/src/commands/tui/actions/formatters.js +4 -2
- package/dist/src/commands/tui/actions/formatters.js.map +1 -1
- package/dist/src/commands/tui/actions/validators.d.ts +5 -0
- package/dist/src/commands/tui/actions/validators.js +2 -0
- package/dist/src/commands/tui/actions/validators.js.map +1 -1
- package/dist/src/commands/tui/actions/workflow.js +36 -10
- package/dist/src/commands/tui/actions/workflow.js.map +1 -1
- package/dist/src/commands/tui/app.js +158 -66
- package/dist/src/commands/tui/app.js.map +1 -1
- package/dist/src/commands/tui/credentials/app.d.ts +4 -1
- package/dist/src/commands/tui/credentials/app.js +139 -80
- package/dist/src/commands/tui/credentials/app.js.map +1 -1
- package/dist/src/commands/tui/details/app.d.ts +15 -0
- package/dist/src/commands/tui/details/app.js +92 -0
- package/dist/src/commands/tui/details/app.js.map +1 -0
- package/dist/src/commands/tui/details/index.d.ts +1 -0
- package/dist/src/commands/tui/details/index.js +2 -0
- package/dist/src/commands/tui/details/index.js.map +1 -0
- package/dist/src/commands/tui/details/workflow.d.ts +14 -0
- package/dist/src/commands/tui/details/workflow.js +38 -0
- package/dist/src/commands/tui/details/workflow.js.map +1 -0
- package/dist/src/commands/tui/dialog/app.d.ts +18 -1
- package/dist/src/commands/tui/dialog/app.js +49 -10
- package/dist/src/commands/tui/dialog/app.js.map +1 -1
- package/dist/src/commands/tui/dialog/index.d.ts +1 -1
- package/dist/src/commands/tui/dialog/index.js +1 -1
- package/dist/src/commands/tui/dialog/index.js.map +1 -1
- package/dist/src/commands/tui/environments/app.d.ts +3 -1
- package/dist/src/commands/tui/environments/app.js +38 -27
- package/dist/src/commands/tui/environments/app.js.map +1 -1
- package/dist/src/commands/tui/formatters.d.ts +38 -9
- package/dist/src/commands/tui/formatters.js +135 -35
- package/dist/src/commands/tui/formatters.js.map +1 -1
- package/dist/src/commands/tui/logs/app.d.ts +3 -1
- package/dist/src/commands/tui/logs/app.js +22 -9
- package/dist/src/commands/tui/logs/app.js.map +1 -1
- package/dist/src/commands/tui/logs/formatters.js +2 -2
- package/dist/src/commands/tui/logs/formatters.js.map +1 -1
- package/dist/src/commands/tui/mouse.d.ts +26 -0
- package/dist/src/commands/tui/mouse.js +107 -0
- package/dist/src/commands/tui/mouse.js.map +1 -0
- package/dist/src/commands/tui/onboarding/app.d.ts +3 -1
- package/dist/src/commands/tui/onboarding/app.js +97 -85
- package/dist/src/commands/tui/onboarding/app.js.map +1 -1
- package/dist/src/commands/tui/onboarding/runtime-access.js +2 -1
- package/dist/src/commands/tui/onboarding/runtime-access.js.map +1 -1
- package/dist/src/commands/tui/render.js +5 -3
- package/dist/src/commands/tui/render.js.map +1 -1
- package/dist/src/commands/tui/runtimes/app.d.ts +2 -1
- package/dist/src/commands/tui/runtimes/app.js +9 -9
- package/dist/src/commands/tui/runtimes/app.js.map +1 -1
- package/dist/src/commands/tui/workflow.d.ts +12 -2
- package/dist/src/commands/tui/workflow.js +6 -3
- package/dist/src/commands/tui/workflow.js.map +1 -1
- package/dist/src/convex/_generated/api.d.ts +0 -2
- package/dist/src/convex/_generated/server.d.ts +3 -3
- package/dist/src/lib/browser-login.js +2 -2
- package/dist/src/lib/browser-login.js.map +1 -1
- package/dist/src/lib/connect-events.d.ts +2 -0
- package/dist/src/lib/connect-events.js.map +1 -1
- package/dist/src/lib/git/checkpoint.d.ts +2 -0
- package/dist/src/lib/git/checkpoint.js +5 -4
- package/dist/src/lib/git/checkpoint.js.map +1 -1
- package/dist/src/lib/git/exec.d.ts +4 -0
- package/dist/src/lib/git/exec.js +9 -3
- package/dist/src/lib/git/exec.js.map +1 -1
- package/dist/src/lib/git/history.d.ts +33 -0
- package/dist/src/lib/git/history.js +108 -0
- package/dist/src/lib/git/history.js.map +1 -0
- package/dist/src/lib/git/index.d.ts +1 -0
- package/dist/src/lib/git/index.js +1 -0
- package/dist/src/lib/git/index.js.map +1 -1
- package/dist/src/lib/git/worktrees.js +3 -1
- package/dist/src/lib/git/worktrees.js.map +1 -1
- package/dist/src/lib/url.d.ts +5 -5
- package/dist/src/lib/url.js +19 -6
- package/dist/src/lib/url.js.map +1 -1
- package/dist/templates/project-isolation/devcontainer.json +1 -1
- package/package.json +4 -3
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Browser } from "../workflow.js";
|
|
2
2
|
import type { Row } from "../validators.js";
|
|
3
|
-
export declare function LogDetail({ browser, row, width, height, small }: {
|
|
3
|
+
export declare function LogDetail({ browser, row, width, height, small, mouse, toggleMouse }: {
|
|
4
4
|
browser: Browser;
|
|
5
5
|
row: Row;
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
8
8
|
small?: boolean;
|
|
9
|
+
mouse: boolean;
|
|
10
|
+
toggleMouse(): void;
|
|
9
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,8 @@ import { Logs } from "./workflow.js";
|
|
|
8
8
|
import { exportLogs } from "./export.js";
|
|
9
9
|
import { Dialog } from "../dialog/index.js";
|
|
10
10
|
import { displayLines } from "./formatters.js";
|
|
11
|
-
|
|
11
|
+
import { useWheel } from "../mouse.js";
|
|
12
|
+
export function LogDetail({ browser, row, width, height, small = false, mouse, toggleMouse }) {
|
|
12
13
|
const { exit } = useApp();
|
|
13
14
|
const [logs] = useState(() => new Logs(args => browser.readLogs(row, args)));
|
|
14
15
|
const state = useSyncExternalStore(logs.subscribe, logs.getSnapshot);
|
|
@@ -21,15 +22,25 @@ export function LogDetail({ browser, row, width, height, small = false }) {
|
|
|
21
22
|
const exporting = useRef(undefined);
|
|
22
23
|
const lines = useMemo(() => displayLines(state.events, Math.max(1, width)), [state.events, width]);
|
|
23
24
|
const capacity = Math.max(1, height - 8);
|
|
24
|
-
const
|
|
25
|
+
const end = Math.max(0, lines.length - capacity);
|
|
26
|
+
const start = state.following ? end : Math.min(offset, end);
|
|
27
|
+
// Reads `following` live and uses an updater, so a burst of wheel reports or keys moves once per tick.
|
|
28
|
+
const scroll = (delta) => {
|
|
29
|
+
const fromEnd = logs.getSnapshot().following;
|
|
30
|
+
logs.pause();
|
|
31
|
+
setOffset(old => Math.max(0, Math.min(end, (fromEnd ? end : Math.min(old, end)) + delta)));
|
|
32
|
+
};
|
|
33
|
+
useWheel(mode === "view" && !small ? scroll : undefined);
|
|
25
34
|
useEffect(() => {
|
|
26
35
|
active.current = true;
|
|
27
36
|
logs.start();
|
|
28
37
|
return () => { active.current = false; exporting.current?.abort(); logs.dispose(); };
|
|
29
38
|
}, [logs]);
|
|
30
39
|
const chooseDestination = async () => {
|
|
31
|
-
if (!path.trim())
|
|
40
|
+
if (!path.trim()) {
|
|
41
|
+
setNotice("Enter a file path.");
|
|
32
42
|
return;
|
|
43
|
+
}
|
|
33
44
|
const destination = resolve(path);
|
|
34
45
|
setMode("checking");
|
|
35
46
|
try {
|
|
@@ -127,6 +138,10 @@ export function LogDetail({ browser, row, width, height, small = false }) {
|
|
|
127
138
|
}
|
|
128
139
|
if (mode !== "view")
|
|
129
140
|
return;
|
|
141
|
+
if (input === "m") {
|
|
142
|
+
toggleMouse();
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
130
145
|
if (input === "e") {
|
|
131
146
|
logs.pause();
|
|
132
147
|
setNotice("");
|
|
@@ -162,12 +177,10 @@ export function LogDetail({ browser, row, width, height, small = false }) {
|
|
|
162
177
|
return;
|
|
163
178
|
}
|
|
164
179
|
const delta = key.pageUp ? -capacity : key.pageDown ? capacity : key.upArrow || input === "k" ? -1 : key.downArrow || input === "j" ? 1 : 0;
|
|
165
|
-
if (delta)
|
|
166
|
-
|
|
167
|
-
setOffset(Math.max(0, Math.min(lines.length - capacity, start + delta)));
|
|
168
|
-
}
|
|
180
|
+
if (delta)
|
|
181
|
+
scroll(delta);
|
|
169
182
|
});
|
|
170
|
-
const prompt = mode !== "view" && _jsx(Dialog, { inline: mode === "notice" || mode === "exporting" || mode === "checking", width: width, height: height, onCancel: cancel, scrollable: mode === "notice" || mode === "exporting", lines: mode === "path" ? ["Export stored run", "", `Export path: ${path}`,
|
|
183
|
+
const prompt = mode !== "view" && _jsx(Dialog, { inline: mode === "notice" || mode === "exporting" || mode === "checking", width: width, height: height, onCancel: cancel, scrollable: mode === "notice" || mode === "exporting", error: mode === "path" ? notice || undefined : undefined, lines: mode === "path" ? ["Export stored run", "", `Export path: ${path}`, "Type path · Tab selects buttons · Enter continues"]
|
|
171
184
|
: mode === "confirm" ? [`${overwrite ? "Overwrite" : "Create"} ${path}?`, "", "Tab / arrows select · Enter activate"]
|
|
172
185
|
: [mode === "checking" ? "Checking destination…" : notice, "", "↑/↓ PgUp/PgDn scroll"], onText: mode === "path" ? editPath : undefined, onSubmit: chooseDestination, buttons: mode === "checking" ? [] : mode === "notice" ? [{ label: "Close", activate: cancel }]
|
|
173
186
|
: [{ label: "Cancel", activate: cancel }, ...(mode === "path" ? [{ label: "Continue", activate: () => { void chooseDestination(); } }]
|
|
@@ -176,6 +189,6 @@ export function LogDetail({ browser, row, width, height, small = false }) {
|
|
|
176
189
|
return _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "Resize to 45\u00D710 to browse." }), _jsx(Text, { children: "Esc back \u00B7 q / Ctrl+C detach" })] });
|
|
177
190
|
if (["notice", "exporting", "checking"].includes(mode))
|
|
178
191
|
return _jsxs(Box, { flexDirection: "column", width: width, height: height, children: [_jsxs(Text, { bold: true, color: palette.text, children: ["Export \u00B7 ", plain(row.run?.runId ?? row.run?.messageId)] }), prompt] });
|
|
179
|
-
return _jsxs(Box, { flexDirection: "column", width: width, height: height, children: [_jsxs(Text, { bold: true, wrap: "truncate", color: palette.text, children: ["Raw JSON \u00B7 ", plain(row.thread.title), " \u00B7 ", plain(row.run?.runId ?? row.run?.messageId)] }), _jsxs(Text, { color: palette.muted, wrap: "truncate", children: [state.following ? "Following" : "Paused", " \u00B7 ", state.events.length, " events / ", state.bytes, " bytes \u00B7 ", state.latest > state.seen ? "unread events" : "caught up", " ", state.loading ? "· reading" : ""] }), _jsx(Box, { height: capacity, flexShrink: 0, flexDirection: "column", overflow: "hidden", children: lines.length ? lines.slice(start, start + capacity).map((line, i) => _jsx(Text, { wrap: "truncate", color: palette.text, children: line || " " }, i)) : _jsx(Text, { color: palette.text, children: state.loading ? "Loading stored events…" : "No stored events available. Live deltas are not retained history." }) }),
|
|
192
|
+
return _jsxs(Box, { flexDirection: "column", width: width, height: height, children: [_jsxs(Text, { bold: true, wrap: "truncate", color: palette.text, children: ["Raw JSON \u00B7 ", plain(row.thread.title), " \u00B7 ", plain(row.run?.runId ?? row.run?.messageId)] }), _jsxs(Text, { color: palette.muted, wrap: "truncate", children: [state.following ? "Following" : "Paused", " \u00B7 ", state.events.length, " events / ", state.bytes, " bytes \u00B7 ", state.latest > state.seen ? "unread events" : "caught up", " ", state.loading ? "· reading" : ""] }), _jsx(Box, { height: capacity, flexShrink: 0, flexDirection: "column", overflow: "hidden", children: lines.length ? lines.slice(start, start + capacity).map((line, i) => _jsx(Text, { wrap: "truncate", color: palette.text, children: line || " " }, i)) : _jsx(Text, { color: palette.text, children: state.loading ? "Loading stored events…" : "No stored events available. Live deltas are not retained history." }) }), state.error ? _jsxs(Text, { bold: true, color: palette.danger, wrap: "truncate", children: ["\u2717 ", state.error] }) : _jsx(Text, { color: palette.muted, wrap: "truncate", children: "Stored payloads; original completeness unknown. Ingestion may have shortened historical data." }), _jsx(Text, { wrap: "truncate", color: palette.muted, children: `Events ${state.events[0]?.order ?? "–"}…${state.events.at(-1)?.order ?? "–"} · [m] ${mouse ? "select text" : "mouse"}` }), _jsx(Text, { color: palette.muted, wrap: "truncate", children: "\u2191/\u2193 scroll \u00B7 PgUp/PgDn \u00B7 p older \u00B7 n newer \u00B7 Space pause \u00B7 f latest" }), _jsxs(Text, { color: palette.muted, wrap: "truncate", children: ["[e] Export entire stored run \u00B7 r retry \u00B7 Esc ", mode === "exporting" ? "cancel export" : "back", " \u00B7 q detach"] }), prompt] });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C,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,wBAAmB,EAC3J,MAAM,IACH,CAAC;AACT,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { breakLines, terminalJson } from "../formatters.js";
|
|
2
2
|
export { terminalJson } from "../formatters.js";
|
|
3
3
|
export function displayLines(events, columns) {
|
|
4
4
|
const lines = [];
|
|
@@ -12,7 +12,7 @@ export function displayLines(events, columns) {
|
|
|
12
12
|
lines.push(`[Event ${event.order}: ${event.bytes} bytes. Exceeds display limit; export retrieves the stored JSON.]`);
|
|
13
13
|
continue;
|
|
14
14
|
}
|
|
15
|
-
lines.push(...
|
|
15
|
+
lines.push(...breakLines(terminalJson(event.eventJson), columns));
|
|
16
16
|
}
|
|
17
17
|
return lines;
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../../../src/commands/tui/logs/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../../../src/commands/tui/logs/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,UAAU,YAAY,CAAC,MAAkB,EAAE,OAAe;IAC9D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAChF,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,mEAAmE,CAAC,CAAC;YACrH,SAAS;QACX,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type DOMElement } from "ink";
|
|
3
|
+
export declare const trackingOff = "\u001B[?1002l\u001B[?1006l";
|
|
4
|
+
type MouseEvent = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
} & ({
|
|
8
|
+
kind: "press" | "release";
|
|
9
|
+
button: number;
|
|
10
|
+
} | {
|
|
11
|
+
kind: "wheel";
|
|
12
|
+
delta: -1 | 1;
|
|
13
|
+
});
|
|
14
|
+
/** Reads SGR mouse reports out of stdin chunks; holds a split report's head until the next chunk. */
|
|
15
|
+
export declare function mouseParser(): (chunk: string) => MouseEvent[];
|
|
16
|
+
/** Calls `onClick` on a left press inside the box at `ref`. */
|
|
17
|
+
export declare function useClick(ref: RefObject<DOMElement | null>, onClick: () => void): void;
|
|
18
|
+
/** Sends wheel ticks (-1 up, 1 down) to the topmost mounted handler; `undefined` leaves the wheel to the one below. */
|
|
19
|
+
export declare function useWheel(onWheel: ((delta: -1 | 1) => void) | undefined): void;
|
|
20
|
+
/** Turns terminal mouse reports on while `enabled` and mounted; call it after the root `useInput` so raw mode is on first. */
|
|
21
|
+
export declare function useMouseTracking(enabled: boolean): void;
|
|
22
|
+
/** Set by an open form or editor; a sidebar click calls it with the navigation to run once the form is left. */
|
|
23
|
+
export type LeaveRef = RefObject<((then: () => void) => void) | undefined>;
|
|
24
|
+
/** Registers `onLeave` while defined; leave it undefined while the form must stay, such as during an operation. */
|
|
25
|
+
export declare function useLeave(ref: LeaveRef | undefined, onLeave: ((then: () => void) => void) | undefined): void;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { useEffect, useEffectEvent } from "react";
|
|
2
|
+
import { measureElement, useStdin, useStdout } from "ink";
|
|
3
|
+
// Button-event tracking (1002) with SGR encoding (1006). Spec: docs/specs/cli-tui.md, "Mouse".
|
|
4
|
+
const trackingOn = "\u001b[?1002h\u001b[?1006h";
|
|
5
|
+
export const trackingOff = "\u001b[?1002l\u001b[?1006l";
|
|
6
|
+
// eslint-disable-next-line no-control-regex -- an SGR mouse report
|
|
7
|
+
const report = /\u001b\[<(\d+);(\d+);(\d+)([Mm])/g;
|
|
8
|
+
// eslint-disable-next-line no-control-regex -- a report's head cut off at a chunk's end
|
|
9
|
+
const head = /\u001b(?:\[(?:<[\d;]*)?)?$/;
|
|
10
|
+
/** Reads SGR mouse reports out of stdin chunks; holds a split report's head until the next chunk. */
|
|
11
|
+
export function mouseParser() {
|
|
12
|
+
let pending = "";
|
|
13
|
+
return (chunk) => {
|
|
14
|
+
const text = pending + chunk;
|
|
15
|
+
pending = head.exec(text)?.[0] ?? "";
|
|
16
|
+
return [...text.matchAll(report)].flatMap(([, code, column, row, final]) => {
|
|
17
|
+
const button = Number(code), x = Number(column) - 1, y = Number(row) - 1;
|
|
18
|
+
if (button & 32)
|
|
19
|
+
return []; // Drag motion.
|
|
20
|
+
if (button & 64)
|
|
21
|
+
return button & 2 ? [] : [{ kind: "wheel", delta: button & 1 ? 1 : -1, x, y }];
|
|
22
|
+
return [{ kind: final === "M" ? "press" : "release", button: button & 3, x, y }];
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const routers = new WeakMap();
|
|
27
|
+
// Ink reads stdin with read(), which emits 'data' too, so this listener never takes input from Ink.
|
|
28
|
+
function subscribe(stdin, add) {
|
|
29
|
+
let router = routers.get(stdin);
|
|
30
|
+
if (!router) {
|
|
31
|
+
const parse = mouseParser();
|
|
32
|
+
const created = { clicks: [], wheels: [], listener: chunk => { for (const event of parse(String(chunk)))
|
|
33
|
+
dispatch(created, event); } };
|
|
34
|
+
routers.set(stdin, router = created);
|
|
35
|
+
stdin.on("data", created.listener);
|
|
36
|
+
}
|
|
37
|
+
const remove = add(router);
|
|
38
|
+
return () => {
|
|
39
|
+
remove();
|
|
40
|
+
if (router.clicks.length || router.wheels.length)
|
|
41
|
+
return;
|
|
42
|
+
stdin.off("data", router.listener);
|
|
43
|
+
routers.delete(stdin);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// The last-mounted subscriber is on top: a dialog mounts after the panel under it.
|
|
47
|
+
function dispatch(router, event) {
|
|
48
|
+
if (event.kind === "wheel") {
|
|
49
|
+
router.wheels.at(-1)?.(event.delta);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (event.kind !== "press" || event.button !== 0)
|
|
53
|
+
return;
|
|
54
|
+
const hit = [...router.clicks].reverse().find(({ ref }) => {
|
|
55
|
+
if (!ref.current)
|
|
56
|
+
return false;
|
|
57
|
+
const box = measureElement(ref.current);
|
|
58
|
+
return event.x >= box.x && event.x < box.x + box.width && event.y >= box.y && event.y < box.y + box.height;
|
|
59
|
+
});
|
|
60
|
+
hit?.handle();
|
|
61
|
+
}
|
|
62
|
+
const without = (list, item) => () => { list.splice(list.indexOf(item), 1); };
|
|
63
|
+
/** Calls `onClick` on a left press inside the box at `ref`. */
|
|
64
|
+
export function useClick(ref, onClick) {
|
|
65
|
+
const { stdin } = useStdin();
|
|
66
|
+
const handle = useEffectEvent(onClick);
|
|
67
|
+
useEffect(() => subscribe(stdin, router => {
|
|
68
|
+
const click = { ref, handle: () => handle() };
|
|
69
|
+
router.clicks.push(click);
|
|
70
|
+
return without(router.clicks, click);
|
|
71
|
+
}), [stdin, ref]);
|
|
72
|
+
}
|
|
73
|
+
/** Sends wheel ticks (-1 up, 1 down) to the topmost mounted handler; `undefined` leaves the wheel to the one below. */
|
|
74
|
+
export function useWheel(onWheel) {
|
|
75
|
+
const { stdin } = useStdin();
|
|
76
|
+
const active = Boolean(onWheel);
|
|
77
|
+
const handle = useEffectEvent((delta) => onWheel?.(delta));
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (!active)
|
|
80
|
+
return;
|
|
81
|
+
return subscribe(stdin, router => {
|
|
82
|
+
const wheel = (delta) => handle(delta);
|
|
83
|
+
router.wheels.push(wheel);
|
|
84
|
+
return without(router.wheels, wheel);
|
|
85
|
+
});
|
|
86
|
+
}, [stdin, active]);
|
|
87
|
+
}
|
|
88
|
+
/** Turns terminal mouse reports on while `enabled` and mounted; call it after the root `useInput` so raw mode is on first. */
|
|
89
|
+
export function useMouseTracking(enabled) {
|
|
90
|
+
const { stdout } = useStdout();
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (!enabled || !stdout.isTTY)
|
|
93
|
+
return;
|
|
94
|
+
stdout.write(trackingOn);
|
|
95
|
+
return () => { stdout.write(trackingOff); };
|
|
96
|
+
}, [stdout, enabled]);
|
|
97
|
+
}
|
|
98
|
+
/** Registers `onLeave` while defined; leave it undefined while the form must stay, such as during an operation. */
|
|
99
|
+
export function useLeave(ref, onLeave) {
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (!ref || !onLeave)
|
|
102
|
+
return;
|
|
103
|
+
ref.current = onLeave;
|
|
104
|
+
return () => { ref.current = undefined; };
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=mouse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mouse.js","sourceRoot":"","sources":["../../../../src/commands/tui/mouse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAkB,MAAM,OAAO,CAAC;AACl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S,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,IAAI,CAAE,MAA8B,CAAC,KAAK;YAAE,OAAO;QAC/D,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACzB,OAAO,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACxB,CAAC;AAID,mHAAmH;AACnH,MAAM,UAAU,QAAQ,CAAC,GAAyB,EAAE,OAAiD;IACnG,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO;YAAE,OAAO;QAC7B,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QACtB,OAAO,GAAG,EAAE,GAAG,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Browser } from "../workflow.js";
|
|
2
2
|
import { loadChoices } from "./workflow.js";
|
|
3
|
-
|
|
3
|
+
import { type LeaveRef } from "../mouse.js";
|
|
4
|
+
export declare function Onboarding({ browser, leave, width: columns, height: rows, load }: {
|
|
4
5
|
browser: Browser;
|
|
6
|
+
leave?: LeaveRef;
|
|
5
7
|
width: number;
|
|
6
8
|
height: number;
|
|
7
9
|
load?: typeof loadChoices;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Box, Text, useInput } from "ink";
|
|
4
|
-
import { masked, palette, plain,
|
|
4
|
+
import { masked, palette, plain, rich, wrapLines } from "../formatters.js";
|
|
5
5
|
import { suggestProjectAlias } from "../../setup/resolution.js";
|
|
6
6
|
import { toProfileKey } from "../../setup/prompts.js";
|
|
7
7
|
import { savedDeploymentUrls, loadChoices, validateForm } from "./workflow.js";
|
|
8
8
|
import { RuntimeAccess } from "./runtime-access.js";
|
|
9
9
|
import { resultMessage } from "./formatters.js";
|
|
10
|
-
import { Dialog } from "../dialog/index.js";
|
|
10
|
+
import { Caret, Clickable, Dialog, editText } from "../dialog/index.js";
|
|
11
|
+
import { useLeave, useWheel } from "../mouse.js";
|
|
11
12
|
import { MODE_COPY, prerequisiteFailure, prerequisiteLines } from "../../environment/formatters.js";
|
|
12
13
|
const workspaceModes = [
|
|
13
14
|
{ label: "Empty directory", description: "Start without repository files. Create a new directory on this target." },
|
|
@@ -17,7 +18,7 @@ const workspaceModes = [
|
|
|
17
18
|
const names = new Intl.Collator(undefined, { sensitivity: "base", numeric: true });
|
|
18
19
|
/** Both auth values live on one web settings page (CLI / Convex URL block plus the keys). */
|
|
19
20
|
const AUTH_HINT = "Find both in Convoy under Profile settings → API keys.";
|
|
20
|
-
export function Onboarding({ browser, width: columns, height: rows, load = loadChoices }) {
|
|
21
|
+
export function Onboarding({ browser, leave, width: columns, height: rows, load = loadChoices }) {
|
|
21
22
|
const session = browser.onboardingSession;
|
|
22
23
|
const target = browser.targets[browser.getSnapshot().scope.connection];
|
|
23
24
|
const [compatible, setCompatible] = useState(!session && target.checkProject ? undefined : true);
|
|
@@ -68,6 +69,7 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
68
69
|
const [done, setDone] = useState(Boolean(session));
|
|
69
70
|
const [retained, setRetained] = useState(false);
|
|
70
71
|
const [discard, setDiscard] = useState(false);
|
|
72
|
+
const leaving = useRef(undefined); // The sidebar click to run after Discard.
|
|
71
73
|
const mounted = useRef(true);
|
|
72
74
|
const discovery = useRef(undefined);
|
|
73
75
|
const edited = useRef(new Set());
|
|
@@ -103,11 +105,15 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
103
105
|
const count = Math.max(1, Math.floor((height - 8 - hint - (width < 50 ? 1 : 0) - (message ? 2 : 0)) / fieldRows));
|
|
104
106
|
const payload = () => ({ ...options, url, apiKey: secret, reuse: mode === 1, clone: mode === 2 ? options.clone : undefined });
|
|
105
107
|
const move = (next) => { setStep(next); setIndex(0); setCursor(undefined); setMessage(""); };
|
|
108
|
+
// The sidebar leaves the form, but not during an operation, the repair flow or Runtime access.
|
|
109
|
+
useLeave(leave, !busy && !updating && !discard && step !== "access" ? then => close(then) : undefined);
|
|
106
110
|
const finish = () => { setSecret(""); browser.closeOnboarding(done && applied ? options.profileKey : undefined, done && !applied); };
|
|
107
|
-
const close = () => { if (!done && (url !== (process.env.CONVOY_URL ?? "") || secret || Object.keys(options).length || directory))
|
|
111
|
+
const close = (then) => { leaving.current = then; if (!done && (url !== (process.env.CONVOY_URL ?? "") || secret || Object.keys(options).length || directory))
|
|
108
112
|
setDiscard(true);
|
|
109
|
-
else
|
|
110
|
-
finish();
|
|
113
|
+
else {
|
|
114
|
+
finish();
|
|
115
|
+
then?.();
|
|
116
|
+
} };
|
|
111
117
|
const authenticate = async () => {
|
|
112
118
|
if (!url.trim() || !secret.trim()) {
|
|
113
119
|
setMessage("Enter the deployment URL and API key.");
|
|
@@ -232,6 +238,60 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
232
238
|
const lists = step === "choice" ? ["Link existing project", "Create new project"]
|
|
233
239
|
: step === "project" ? choices.projects.map(p => `${p.organizationName} / ${p.name} (${p.alias})`)
|
|
234
240
|
: step === "organization" ? choices.organizations.map(o => `${o.name} (${o.slug})`) : [];
|
|
241
|
+
// Enter on a form or confirmation button; a click on one lands here too.
|
|
242
|
+
const pressForm = (at) => {
|
|
243
|
+
if (at < fields.length)
|
|
244
|
+
return;
|
|
245
|
+
if (at === fields.length) {
|
|
246
|
+
close();
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (step === "auth") {
|
|
250
|
+
void authenticate();
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
try {
|
|
254
|
+
validateForm(directory, payload(), mode === 2);
|
|
255
|
+
move("confirm");
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
setMessage(error instanceof Error ? error.message : "Check inputs.");
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const pressConfirm = (at) => { if (at === 0)
|
|
262
|
+
move("details");
|
|
263
|
+
else
|
|
264
|
+
void submit(); };
|
|
265
|
+
// Enter or a click on a list row, dropdown option or select field.
|
|
266
|
+
const chooseItem = (at) => {
|
|
267
|
+
if (step === "choice") {
|
|
268
|
+
move(at === 0 ? "project" : "organization");
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
edited.current.clear();
|
|
272
|
+
if (step === "project") {
|
|
273
|
+
const p = choices.projects[at];
|
|
274
|
+
const profileKey = toProfileKey(p.alias) || "project";
|
|
275
|
+
setOptions({ project: p._id, profileName: p.name, profileKey });
|
|
276
|
+
setDirectory(profileKey);
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
setOptions({ create: true, org: choices.organizations[at]._id, projectName: "New project", projectAlias: suggestProjectAlias("New project"), profileName: "New project", profileKey: "new-project" });
|
|
280
|
+
setDirectory("new-project");
|
|
281
|
+
}
|
|
282
|
+
move("details");
|
|
283
|
+
};
|
|
284
|
+
const pick = (at) => {
|
|
285
|
+
if (step === "auth") {
|
|
286
|
+
changeUrl(deployments[at] ?? "");
|
|
287
|
+
setIndex(1);
|
|
288
|
+
}
|
|
289
|
+
else
|
|
290
|
+
setMode(at);
|
|
291
|
+
setDropdown(undefined);
|
|
292
|
+
setCursor(undefined);
|
|
293
|
+
};
|
|
294
|
+
const openDropdown = () => setDropdown(step === "auth" ? Math.max(0, deployments.indexOf(url)) : mode);
|
|
235
295
|
useInput((input, key) => {
|
|
236
296
|
if (discard || updating || compatible !== true)
|
|
237
297
|
return;
|
|
@@ -257,16 +317,8 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
257
317
|
setDropdown(value => Math.max(0, (value ?? 0) - 1));
|
|
258
318
|
if (key.downArrow)
|
|
259
319
|
setDropdown(value => Math.min(dropdownOptions.length - 1, (value ?? 0) + 1));
|
|
260
|
-
if (key.return)
|
|
261
|
-
|
|
262
|
-
changeUrl(deployments[dropdown] ?? "");
|
|
263
|
-
setIndex(1);
|
|
264
|
-
}
|
|
265
|
-
else
|
|
266
|
-
setMode(dropdown);
|
|
267
|
-
setDropdown(undefined);
|
|
268
|
-
setCursor(undefined);
|
|
269
|
-
}
|
|
320
|
+
if (key.return)
|
|
321
|
+
pick(dropdown);
|
|
270
322
|
return;
|
|
271
323
|
}
|
|
272
324
|
if (key.escape) {
|
|
@@ -284,12 +336,8 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
284
336
|
setIndex(value => 1 - value);
|
|
285
337
|
if (key.leftArrow || key.rightArrow)
|
|
286
338
|
setIndex(key.leftArrow ? 0 : 1);
|
|
287
|
-
if (key.return)
|
|
288
|
-
|
|
289
|
-
move("details");
|
|
290
|
-
else
|
|
291
|
-
void submit();
|
|
292
|
-
}
|
|
339
|
+
if (key.return)
|
|
340
|
+
pressConfirm(index);
|
|
293
341
|
return;
|
|
294
342
|
}
|
|
295
343
|
if (["choice", "project", "organization"].includes(step)) {
|
|
@@ -297,28 +345,12 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
297
345
|
setIndex(value => Math.max(0, value - 1));
|
|
298
346
|
if (key.downArrow)
|
|
299
347
|
setIndex(value => Math.min(lists.length - 1, value + 1));
|
|
300
|
-
if (
|
|
301
|
-
|
|
302
|
-
if (step === "choice") {
|
|
303
|
-
move(index === 0 ? "project" : "organization");
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
edited.current.clear();
|
|
307
|
-
if (step === "project") {
|
|
308
|
-
const p = choices.projects[index];
|
|
309
|
-
const profileKey = toProfileKey(p.alias) || "project";
|
|
310
|
-
setOptions({ project: p._id, profileName: p.name, profileKey });
|
|
311
|
-
setDirectory(profileKey);
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
setOptions({ create: true, org: choices.organizations[index]._id, projectName: "New project", projectAlias: suggestProjectAlias("New project"), profileName: "New project", profileKey: "new-project" });
|
|
315
|
-
setDirectory("new-project");
|
|
316
|
-
}
|
|
317
|
-
move("details");
|
|
348
|
+
if (key.return && lists.length)
|
|
349
|
+
chooseItem(index);
|
|
318
350
|
return;
|
|
319
351
|
}
|
|
320
352
|
if (fields[index]?.select && (key.return || input === " ")) {
|
|
321
|
-
|
|
353
|
+
openDropdown();
|
|
322
354
|
return;
|
|
323
355
|
}
|
|
324
356
|
if (key.pageUp || key.pageDown) {
|
|
@@ -336,52 +368,31 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
336
368
|
return;
|
|
337
369
|
}
|
|
338
370
|
if (key.return) {
|
|
339
|
-
|
|
340
|
-
return;
|
|
341
|
-
if (index === fields.length) {
|
|
342
|
-
close();
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
if (step === "auth") {
|
|
346
|
-
void authenticate();
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
try {
|
|
350
|
-
validateForm(directory, payload(), mode === 2);
|
|
351
|
-
move("confirm");
|
|
352
|
-
}
|
|
353
|
-
catch (error) {
|
|
354
|
-
setMessage(error instanceof Error ? error.message : "Check inputs.");
|
|
355
|
-
}
|
|
371
|
+
pressForm(index);
|
|
356
372
|
return;
|
|
357
373
|
}
|
|
358
374
|
const field = fields[index];
|
|
359
375
|
if (!field || field.select)
|
|
360
376
|
return;
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
setCursor(key.home ? 0 : key.end ? chars.length : Math.max(0, Math.min(chars.length, position + (key.leftArrow ? -1 : 1))));
|
|
377
|
+
// A masked field shows no position, so its cursor stays at the end.
|
|
378
|
+
const edit = editText(field.value, field.secret ? undefined : cursor, input, key, field.secret ? 4096 : 256);
|
|
379
|
+
if (!edit)
|
|
365
380
|
return;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
chars.splice(position - 1, 1);
|
|
370
|
-
field.set(chars.join(""));
|
|
371
|
-
setCursor(position - 1);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
else if (input) {
|
|
375
|
-
const inserted = [...printable(input)];
|
|
376
|
-
chars.splice(position, 0, ...inserted);
|
|
377
|
-
field.set(chars.slice(0, field.secret ? 4096 : 256).join(""));
|
|
378
|
-
setCursor(position + inserted.length);
|
|
379
|
-
}
|
|
381
|
+
if (edit.value !== field.value)
|
|
382
|
+
field.set(edit.value);
|
|
383
|
+
setCursor(edit.cursor);
|
|
380
384
|
});
|
|
385
|
+
// The wheel moves the highlight or focus as ↑/↓ do, so rows past the visible window scroll in.
|
|
386
|
+
const clamp = (value, length) => Math.max(0, Math.min(length - 1, value));
|
|
387
|
+
const form = step === "auth" || step === "details";
|
|
388
|
+
useWheel(discard || updating || compatible !== true || busy || small ? undefined
|
|
389
|
+
: dropdown !== undefined ? delta => setDropdown(value => clamp((value ?? 0) + delta, dropdownOptions.length))
|
|
390
|
+
: lists.length ? delta => setIndex(value => clamp(value + delta, lists.length))
|
|
391
|
+
: form ? delta => { setIndex(value => clamp(Math.min(value, fields.length - 1) + delta, fields.length)); setCursor(undefined); } : undefined);
|
|
381
392
|
if (updating)
|
|
382
393
|
return null;
|
|
383
394
|
if (discard)
|
|
384
|
-
return _jsx(Dialog, { width: columns, height: rows, lines: ["Discard project draft?", "Entered fields and the credential will be cleared. Prepared files and remote data remain."], onCancel: () => setDiscard(false), buttons: [{ label: "Keep editing", activate: () => setDiscard(false) }, { label: "Discard", activate: finish }] });
|
|
395
|
+
return _jsx(Dialog, { width: columns, height: rows, lines: ["Discard project draft?", "Entered fields and the credential will be cleared. Prepared files and remote data remain."], onCancel: () => setDiscard(false), buttons: [{ label: "Keep editing", activate: () => setDiscard(false) }, { label: "Discard", activate: () => { finish(); leaving.current?.(); } }] });
|
|
385
396
|
if (compatible !== true)
|
|
386
397
|
return _jsx(Dialog, { inline: true, width: columns, height: rows, onCancel: close, lines: [compatible === false ? "Remote update required" : compatibilityError || "Checking target setup support…",
|
|
387
398
|
`Target: ${target.name}`, "Guided project registration requires target setup support. A version difference alone does not block supported targets.",
|
|
@@ -405,22 +416,23 @@ export function Onboarding({ browser, width: columns, height: rows, load = loadC
|
|
|
405
416
|
return;
|
|
406
417
|
} if (browser.onboardingSession)
|
|
407
418
|
browser.onboardingSession.step = "result"; setStep("result"); } });
|
|
408
|
-
const form = step === "auth" || step === "details";
|
|
409
419
|
const first = Math.max(0, Math.min(index - count + 1, fields.length - count));
|
|
410
420
|
const visible = fields.slice(first, first + count);
|
|
411
421
|
const title = { auth: "Connect to Convoy", choice: "Add project", project: "Link existing project", organization: "Choose organization", details: "Project details", confirm: "Review registration" }[step];
|
|
412
|
-
const button = (label,
|
|
422
|
+
const button = (label, at, press) => {
|
|
423
|
+
const selected = index === at;
|
|
424
|
+
return _jsx(Clickable, { flexShrink: 0, width: label.length + 6, onClick: () => { if (busy || small)
|
|
425
|
+
return; setIndex(at); press(at); }, children: _jsx(Text, { bold: true, color: selected ? rich ? palette.selectedText : "black" : rich ? palette.accent : "white", backgroundColor: selected ? rich ? palette.selected : "cyan" : rich ? undefined : "black", children: `${selected ? ">" : " "} [ ${label} ]` }) });
|
|
426
|
+
};
|
|
413
427
|
return _jsx(Box, { flexDirection: "column", width: width, height: height, backgroundColor: palette.base ?? "black", paddingX: 2, paddingY: 1, children: small ? _jsx(Text, { wrap: "truncate", children: "Resize to continue." }) : _jsxs(_Fragment, { children: [_jsxs(Text, { bold: true, color: palette.text ?? "white", children: [title, " \u00B7 ", plain(target.name)] }), _jsx(Text, { color: palette.muted, wrap: "truncate", children: dropdown !== undefined ? (step === "auth" ? "Choose a deployment or enter a new URL." : "Choose how to prepare files on this target.") : step === "details" && mode === 2 ? "Clone copies a Git repository into this workspace." : form ? "Type to edit · ↑/↓ or Tab moves between controls." : "↑/↓ select · Enter choose · Esc back" }), _jsx(Box, { flexDirection: "column", flexGrow: 1, marginTop: 1, children: !target.addProject ? _jsxs(Text, { children: [target.addProjectUnavailable ?? "Add project requires a configured Linux project environment or saved Docker target.", " Esc closes."] })
|
|
414
428
|
: busy ? _jsx(Text, { children: message })
|
|
415
429
|
: step === "confirm" ? confirmation.map((line, i) => _jsx(Text, { children: line }, i))
|
|
416
|
-
: dropdown !== undefined ? _jsxs(_Fragment, { children: [_jsx(Text, { bold: true, children: step === "auth" ? "Saved deployments" : "Workspace mode" }), dropdownOptions.slice(Math.max(0, dropdown - height + 11), Math.max(0, dropdown - height + 11) + height - 10).map((value, offset) => _jsxs(Text, { wrap: "truncate", color: offset + Math.max(0, dropdown - height + 11) === dropdown ? palette.accent : palette.text ?? "white", children: [offset + Math.max(0, dropdown - height + 11) === dropdown ? "> " : " ", plain(value)] }, value)), explanation.length > 0 && _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(Text, { children: workspaceModes[dropdown].description }) })] }) : form ? _jsxs(_Fragment, { children: [visible.map((field, offset) => {
|
|
430
|
+
: dropdown !== undefined ? _jsxs(_Fragment, { children: [_jsx(Text, { bold: true, children: step === "auth" ? "Saved deployments" : "Workspace mode" }), dropdownOptions.slice(Math.max(0, dropdown - height + 11), Math.max(0, dropdown - height + 11) + height - 10).map((value, offset) => _jsx(Clickable, { onClick: () => pick(offset + Math.max(0, dropdown - height + 11)), children: _jsxs(Text, { wrap: "truncate", color: offset + Math.max(0, dropdown - height + 11) === dropdown ? palette.accent : palette.text ?? "white", children: [offset + Math.max(0, dropdown - height + 11) === dropdown ? "> " : " ", plain(value)] }) }, value)), explanation.length > 0 && _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(Text, { children: workspaceModes[dropdown].description }) })] }) : form ? _jsxs(_Fragment, { children: [visible.map((field, offset) => {
|
|
417
431
|
const active = first + offset === index;
|
|
418
432
|
const value = field.secret ? masked(field.value) : plain(field.value);
|
|
419
|
-
const position = field.secret ? value.length : Math.min(cursor ?? [...value].length, [...value].length);
|
|
420
|
-
const before = wrapLines([...value].slice(0, position).join(""), width - 12).at(-1) ?? "";
|
|
421
|
-
const after = [...value].slice(position);
|
|
422
433
|
const placeholder = step === "auth" ? field.secret ? "Paste your Convoy API key" : "https://your-deployment.convex.cloud" : field.label.startsWith("Git repository") ? "https://github.com/owner/repo.git" : "Enter a value";
|
|
423
|
-
return _jsxs(
|
|
424
|
-
|
|
434
|
+
return _jsxs(Clickable, { flexDirection: "column", marginBottom: fieldRows - 2, onClick: () => { setIndex(first + offset); setCursor(undefined); if (field.select)
|
|
435
|
+
openDropdown(); }, children: [_jsxs(Text, { color: active ? palette.accent : palette.text ?? "white", wrap: "truncate", children: [active ? "> " : " ", field.label] }), _jsxs(Text, { wrap: "truncate", backgroundColor: rich ? active ? palette.idle : palette.surface : active ? "gray" : "black", color: palette.text ?? "white", children: ["[ ", field.select ? `${value} ▾` : active ? _jsx(Caret, { value: value, cursor: field.secret ? undefined : cursor, width: width - 12, placeholder: _jsx(Text, { color: palette.muted, children: placeholder }) }) : value || _jsx(Text, { color: palette.muted, children: placeholder }), " ]"] })] }, field.label);
|
|
436
|
+
}), hint > 0 && _jsx(Text, { color: palette.muted, wrap: "truncate", children: AUTH_HINT }), fields.length > count && _jsxs(Text, { color: palette.muted, children: ["Inputs ", first + 1, "-", Math.min(fields.length, first + count), " of ", fields.length, " \u00B7 PgUp/PgDn scroll"] })] }) : (lists.length ? lists.slice(Math.max(0, index - height + 11), Math.max(0, index - height + 11) + height - 10).map((line, i) => _jsx(Clickable, { onClick: () => chooseItem(i + Math.max(0, index - height + 11)), children: _jsxs(Text, { wrap: "truncate", children: [i + Math.max(0, index - height + 11) === index ? ">" : " ", " ", plain(line)] }) }, line)) : _jsx(Text, { children: "No accessible entries. Esc to go back." })) }), !busy && message && _jsx(Text, { color: palette.warning, children: message }), form && dropdown === undefined && !busy && target.addProject && _jsxs(Box, { gap: width < 50 ? 0 : 2, flexDirection: width < 50 ? "column" : "row", children: [button("Cancel", fields.length, pressForm), button(step === "auth" ? "Load choices" : "Review registration", fields.length + 1, pressForm)] }), step === "confirm" && !busy && _jsxs(Box, { gap: 2, children: [button("Back", 0, pressConfirm), button("Register", 1, pressConfirm)] }), _jsx(Text, { color: palette.muted, wrap: "truncate", children: dropdown !== undefined ? "↑/↓ select · Enter choose · Esc cancel" : form || step === "confirm" ? "Tab focus · ←/→ buttons · Enter select · Esc back" : "Esc back / cancel" })] }) });
|
|
425
437
|
}
|
|
426
438
|
//# sourceMappingURL=app.js.map
|