@odysx/codemind 0.0.0-stage → 0.1.1

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.
Files changed (108) hide show
  1. package/README.md +293 -2
  2. package/dist/commands/agents.d.ts +2 -0
  3. package/dist/commands/agents.js +91 -0
  4. package/dist/commands/auth.d.ts +2 -0
  5. package/dist/commands/auth.js +35 -0
  6. package/dist/commands/chat.d.ts +2 -0
  7. package/dist/commands/chat.js +180 -0
  8. package/dist/commands/keys.d.ts +2 -0
  9. package/dist/commands/keys.js +81 -0
  10. package/dist/commands/local.d.ts +2 -0
  11. package/dist/commands/local.js +325 -0
  12. package/dist/commands/mcp.d.ts +2 -0
  13. package/dist/commands/mcp.js +73 -0
  14. package/dist/commands/prompts.d.ts +2 -0
  15. package/dist/commands/prompts.js +59 -0
  16. package/dist/commands/skills.d.ts +2 -0
  17. package/dist/commands/skills.js +41 -0
  18. package/dist/core/auth/index.d.ts +10 -0
  19. package/dist/core/auth/index.js +82 -0
  20. package/dist/core/config/index.d.ts +47 -0
  21. package/dist/core/config/index.js +118 -0
  22. package/dist/core/history.d.ts +14 -0
  23. package/dist/core/history.js +80 -0
  24. package/dist/core/markdown-renderer.d.ts +47 -0
  25. package/dist/core/markdown-renderer.js +385 -0
  26. package/dist/core/permissions/index.d.ts +31 -0
  27. package/dist/core/permissions/index.js +64 -0
  28. package/dist/core/provider/external.d.ts +28 -0
  29. package/dist/core/provider/external.js +248 -0
  30. package/dist/core/provider/index.d.ts +138 -0
  31. package/dist/core/provider/index.js +510 -0
  32. package/dist/core/registry/index.d.ts +25 -0
  33. package/dist/core/registry/index.js +216 -0
  34. package/dist/core/schema/types.d.ts +93 -0
  35. package/dist/core/schema/types.js +12 -0
  36. package/dist/core/terminal.d.ts +40 -0
  37. package/dist/core/terminal.js +134 -0
  38. package/dist/core/workspace/index.d.ts +35 -0
  39. package/dist/core/workspace/index.js +194 -0
  40. package/dist/index.d.ts +10 -0
  41. package/dist/index.js +393 -0
  42. package/dist/ui/app.d.ts +3 -0
  43. package/dist/ui/app.js +554 -0
  44. package/dist/ui/commands/cases/catalog.d.ts +11 -0
  45. package/dist/ui/commands/cases/catalog.js +62 -0
  46. package/dist/ui/commands/cases/misc.d.ts +35 -0
  47. package/dist/ui/commands/cases/misc.js +245 -0
  48. package/dist/ui/commands/cases/tasks.d.ts +13 -0
  49. package/dist/ui/commands/cases/tasks.js +91 -0
  50. package/dist/ui/commands/runCommand.d.ts +22 -0
  51. package/dist/ui/commands/runCommand.js +136 -0
  52. package/dist/ui/components/AgentPicker.d.ts +11 -0
  53. package/dist/ui/components/AgentPicker.js +7 -0
  54. package/dist/ui/components/AuthPicker.d.ts +14 -0
  55. package/dist/ui/components/AuthPicker.js +7 -0
  56. package/dist/ui/components/Banner.d.ts +8 -0
  57. package/dist/ui/components/Banner.js +24 -0
  58. package/dist/ui/components/CommandMenu.d.ts +17 -0
  59. package/dist/ui/components/CommandMenu.js +21 -0
  60. package/dist/ui/components/ErrorBoundary.d.ts +24 -0
  61. package/dist/ui/components/ErrorBoundary.js +51 -0
  62. package/dist/ui/components/InputBar.d.ts +28 -0
  63. package/dist/ui/components/InputBar.js +108 -0
  64. package/dist/ui/components/KeysPanel.d.ts +12 -0
  65. package/dist/ui/components/KeysPanel.js +25 -0
  66. package/dist/ui/components/MessageView.d.ts +29 -0
  67. package/dist/ui/components/MessageView.js +107 -0
  68. package/dist/ui/components/PermissionPrompt.d.ts +10 -0
  69. package/dist/ui/components/PermissionPrompt.js +4 -0
  70. package/dist/ui/components/Pickers.d.ts +43 -0
  71. package/dist/ui/components/Pickers.js +33 -0
  72. package/dist/ui/components/SearchOverlay.d.ts +21 -0
  73. package/dist/ui/components/SearchOverlay.js +14 -0
  74. package/dist/ui/components/SessionPicker.d.ts +12 -0
  75. package/dist/ui/components/SessionPicker.js +8 -0
  76. package/dist/ui/components/WorkingIndicator.d.ts +10 -0
  77. package/dist/ui/components/WorkingIndicator.js +23 -0
  78. package/dist/ui/controls/ApiKeyEntry.d.ts +8 -0
  79. package/dist/ui/controls/ApiKeyEntry.js +5 -0
  80. package/dist/ui/controls/MultiSelect.d.ts +18 -0
  81. package/dist/ui/controls/MultiSelect.js +9 -0
  82. package/dist/ui/hooks/useAgentPicker.d.ts +14 -0
  83. package/dist/ui/hooks/useAgentPicker.js +53 -0
  84. package/dist/ui/hooks/useAuthFlow.d.ts +14 -0
  85. package/dist/ui/hooks/useAuthFlow.js +31 -0
  86. package/dist/ui/hooks/useKeysFlow.d.ts +17 -0
  87. package/dist/ui/hooks/useKeysFlow.js +130 -0
  88. package/dist/ui/hooks/useSessionPicker.d.ts +29 -0
  89. package/dist/ui/hooks/useSessionPicker.js +58 -0
  90. package/dist/ui/hooks/useTerminalSize.d.ts +6 -0
  91. package/dist/ui/hooks/useTerminalSize.js +29 -0
  92. package/dist/ui/input/keyRouter.d.ts +125 -0
  93. package/dist/ui/input/keyRouter.js +574 -0
  94. package/dist/ui/layouts/ScreenLayout.d.ts +98 -0
  95. package/dist/ui/layouts/ScreenLayout.js +56 -0
  96. package/dist/ui/shared/types.d.ts +143 -0
  97. package/dist/ui/shared/types.js +38 -0
  98. package/dist/ui/theme.d.ts +29 -0
  99. package/dist/ui/theme.js +54 -0
  100. package/dist/ui/utils/markdown.d.ts +74 -0
  101. package/dist/ui/utils/markdown.js +187 -0
  102. package/dist/ui/utils/mentions.d.ts +12 -0
  103. package/dist/ui/utils/mentions.js +28 -0
  104. package/dist/ui/utils/terminal-text.d.ts +33 -0
  105. package/dist/ui/utils/terminal-text.js +123 -0
  106. package/dist/ui/utils/text.d.ts +72 -0
  107. package/dist/ui/utils/text.js +171 -0
  108. package/package.json +50 -6
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Last-resort render boundary.
3
+ *
4
+ * Ink unmounts with a raw stack trace when a component throws mid-render —
5
+ * inside the alternate screen that trace is painted over the user's prompt and
6
+ * the terminal is left in the alternate buffer. This boundary catches the
7
+ * throw, renders a readable card, and leaves the user with a working shell.
8
+ *
9
+ * Class component because React only supports error boundaries that way.
10
+ */
11
+ import React from "react";
12
+ interface State {
13
+ error: Error | null;
14
+ }
15
+ export declare class ErrorBoundary extends React.Component<{
16
+ children: React.ReactNode;
17
+ }, State> {
18
+ state: State;
19
+ static getDerivedStateFromError(error: Error): State;
20
+ componentDidCatch(error: Error): void;
21
+ render(): React.ReactNode;
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Last-resort render boundary.
4
+ *
5
+ * Ink unmounts with a raw stack trace when a component throws mid-render —
6
+ * inside the alternate screen that trace is painted over the user's prompt and
7
+ * the terminal is left in the alternate buffer. This boundary catches the
8
+ * throw, renders a readable card, and leaves the user with a working shell.
9
+ *
10
+ * Class component because React only supports error boundaries that way.
11
+ */
12
+ import React from "react";
13
+ import { Box, Text, useInput } from "ink";
14
+ import { theme } from "../theme.js";
15
+ import { exitWith } from "../../core/terminal.js";
16
+ /** The crash card owns input too: without this, ctrl+c would do nothing. */
17
+ const CrashCard = ({ error }) => {
18
+ useInput((chunk, key) => {
19
+ if ((key.ctrl && chunk === "c") || key.escape || key.return) {
20
+ exitWith(1);
21
+ }
22
+ });
23
+ return (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [_jsxs(Text, { color: theme.color.error, bold: true, children: [theme.glyph.cross, " the interface hit an unexpected error"] }), _jsx(Text, { dimColor: true, children: error.message }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { dimColor: true, children: "The stack was written to ~/.odysx/last-crash.log." }), _jsxs(Text, { children: ["Press ", _jsx(Text, { color: theme.color.accent, children: "ctrl+c" }), " to exit, then restart with", " ", _jsx(Text, { color: theme.color.accent, children: "odysx" }), "."] })] })] }));
24
+ };
25
+ export class ErrorBoundary extends React.Component {
26
+ state = { error: null };
27
+ static getDerivedStateFromError(error) {
28
+ return { error };
29
+ }
30
+ componentDidCatch(error) {
31
+ // Best-effort diagnostic file — the screen may be gone by the time the
32
+ // user reads the card, so keep the stack somewhere durable.
33
+ void (async () => {
34
+ try {
35
+ const { writeFileSync, mkdirSync } = await import("node:fs");
36
+ const { join } = await import("node:path");
37
+ const { homedir } = await import("node:os");
38
+ const dir = join(homedir(), ".odysx");
39
+ mkdirSync(dir, { recursive: true });
40
+ writeFileSync(join(dir, "last-crash.log"), `${new Date().toISOString()}\n${error.stack ?? error.message}\n`, "utf-8");
41
+ }
42
+ catch { /* never let the crash log crash */ }
43
+ })();
44
+ }
45
+ render() {
46
+ if (!this.state.error)
47
+ return this.props.children;
48
+ return _jsx(CrashCard, { error: this.state.error });
49
+ }
50
+ }
51
+ //# sourceMappingURL=ErrorBoundary.js.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Fixed bottom input bar — the prompt line plus a context footer.
3
+ *
4
+ * The footer answers "where am I and what will my Enter do?" at a glance:
5
+ * agent · model · provider · workspace on the left, auth + key hints on the
6
+ * right. It is a single row that never wraps: the two blocks are measured in
7
+ * display columns and the workspace absorbs whatever slack is left (truncated
8
+ * from the front so the leaf folder stays visible, like Claude Code).
9
+ *
10
+ * The draft is multiline (Shift/Alt+Enter or a trailing `\`) and is windowed
11
+ * twice — by logical line and, within a line, by columns. A pasted file or a
12
+ * very long single line must not push the transcript off-screen, and must not
13
+ * overflow the box (an overflowing text node loses the border on wrapped rows).
14
+ */
15
+ import React from "react";
16
+ /** Visible priority: prompt · agent · model are fixed; cwd absorbs slack. */
17
+ export declare const InputBar: ({ value, cursor, agent, model, authed, provider, turns, cwd, mode, }: {
18
+ value: string;
19
+ cursor: number;
20
+ agent: string;
21
+ model: string;
22
+ authed: boolean;
23
+ provider?: string;
24
+ turns: number;
25
+ cwd: string;
26
+ mode: string;
27
+ }) => React.JSX.Element;
28
+ //# sourceMappingURL=InputBar.d.ts.map
@@ -0,0 +1,108 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useStdout } from "ink";
3
+ import { theme } from "../theme.js";
4
+ import { toChars } from "../utils/text.js";
5
+ import { displayWidth } from "../utils/terminal-text.js";
6
+ /** Rows of draft shown at once, caret kept inside the window. */
7
+ const MAX_VISIBLE_LINES = 8;
8
+ /** Horizontal chrome around a draft row: 2 border + 2 padding + 2 prefix. */
9
+ const ROW_CHROME = 6;
10
+ /** Keep the trailing part of a path so the leaf directory stays visible. */
11
+ const tailTruncate = (value, max) => {
12
+ if (max <= 1)
13
+ return "";
14
+ const chars = toChars(value); // never split an emoji / surrogate pair
15
+ if (chars.length <= max)
16
+ return value;
17
+ return "…" + chars.slice(chars.length - (max - 1)).join("");
18
+ };
19
+ /** Visible priority: prompt · agent · model are fixed; cwd absorbs slack. */
20
+ export const InputBar = ({ value, cursor, agent, model, authed, provider, turns, cwd, mode, }) => {
21
+ const { stdout } = useStdout();
22
+ const width = stdout?.columns ?? 80;
23
+ // Footer budget: every block on the row is measured in display columns and
24
+ // the workspace absorbs the remainder. The previous estimate used a magic
25
+ // `+ 22` and ignored the actual gaps, so at 80 columns the row silently
26
+ // wrapped as soon as the path got long — pushing the input up a line.
27
+ const providerLabel = provider && provider !== "odysx" ? provider : "odysx";
28
+ const authLabel = authed ? "✓ authed" : "○ /signin to start";
29
+ const turnsLabel = `${turns} msg${turns === 1 ? "" : "s"}`;
30
+ const modeLabel = `mode:${mode}`;
31
+ const hintsLabel = "/help · ctrl+c";
32
+ const leftText = [agent, providerLabel, model || "default", turnsLabel, modeLabel].reduce((n, s) => n + displayWidth(s), 0);
33
+ // columnGap={1} between 10 left children and 3 right children, plus the
34
+ // container's paddingX={1} on both sides.
35
+ const gaps = 9 + 2 + 2;
36
+ const fixed = leftText + displayWidth(authLabel) + displayWidth(hintsLabel) + gaps;
37
+ const cwdBudget = Math.max(8, width - fixed);
38
+ const shownCwd = tailTruncate(cwd, cwdBudget);
39
+ // Work in code points so an emoji is never split by the caret. The draft is
40
+ // split into rows here (not by string index) to keep the caret column right.
41
+ const chars = toChars(value);
42
+ const at = Math.max(0, Math.min(cursor, chars.length));
43
+ const rows = [[]];
44
+ let caretLine = 0;
45
+ let caretCol = 0;
46
+ for (let i = 0; i < chars.length; i++) {
47
+ if (chars[i] === "\n") {
48
+ rows.push([]);
49
+ if (i < at) {
50
+ caretLine++;
51
+ caretCol = 0;
52
+ }
53
+ }
54
+ else {
55
+ rows[rows.length - 1].push(chars[i]);
56
+ if (i < at)
57
+ caretCol++;
58
+ }
59
+ }
60
+ // A single logical line can still be thousands of columns wide (a pasted
61
+ // file with no newlines). Window it by columns too, keeping the caret in
62
+ // view; otherwise the text node overflows the box and Ink loses the border
63
+ // on every wrapped continuation row.
64
+ const rowBudget = Math.max(8, width - ROW_CHROME);
65
+ const windowRow = (row, caret) => {
66
+ // Prefix sums keep this linear: measuring a growing slice per iteration
67
+ // turned a 5k-character paste into tens of millions of width calls.
68
+ const prefix = [0];
69
+ for (const ch of row)
70
+ prefix.push(prefix[prefix.length - 1] + displayWidth(ch));
71
+ if (prefix[row.length] <= rowBudget) {
72
+ return { chars: row, caret: Math.max(0, caret), cutLeft: false, cutRight: false };
73
+ }
74
+ // Centre the caret when there is one, otherwise show the head of the row.
75
+ const start = caret >= 0
76
+ ? Math.min(Math.max(0, caret - Math.floor(rowBudget / 2)), caret)
77
+ : 0;
78
+ let end = start;
79
+ while (end < row.length && prefix[end + 1] - prefix[start] <= rowBudget)
80
+ end++;
81
+ return {
82
+ chars: row.slice(start, end),
83
+ caret: caret >= 0 ? Math.max(0, Math.min(caret - start, end - start)) : 0,
84
+ cutLeft: start > 0,
85
+ cutRight: end < row.length,
86
+ };
87
+ };
88
+ // Window the draft so a large paste cannot push the transcript off-screen.
89
+ const total = rows.length;
90
+ let start = 0;
91
+ if (total > MAX_VISIBLE_LINES) {
92
+ start = Math.max(0, Math.min(caretLine - Math.floor(MAX_VISIBLE_LINES / 2), total - MAX_VISIBLE_LINES));
93
+ }
94
+ const end = Math.min(total, start + MAX_VISIBLE_LINES);
95
+ const hiddenAbove = start;
96
+ const hiddenBelow = total - end;
97
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { borderStyle: "round", borderColor: value ? theme.color.user : theme.color.muted, paddingX: 1, flexDirection: "column", children: [hiddenAbove > 0 && (_jsxs(Text, { dimColor: true, children: [" ", "\u2026 ", hiddenAbove, " earlier line", hiddenAbove === 1 ? "" : "s"] })), rows.slice(start, end).map((row, i) => {
98
+ const index = start + i;
99
+ const isCaretRow = index === caretLine;
100
+ // Clamp each row to the box width. A wrapped continuation row
101
+ // overflows the yoga box and Ink stops drawing its border.
102
+ const shown = windowRow(row, isCaretRow ? caretCol : -1);
103
+ return (_jsxs(Text, { children: [index === 0 ? (_jsxs(Text, { color: theme.color.user, bold: true, children: [theme.glyph.pointer, " "] })) : (" "), shown.cutLeft ? "…" : "", isCaretRow ? (_jsxs(_Fragment, { children: [shown.chars.slice(0, shown.caret).join(""), _jsx(Text, { inverse: true, children: shown.chars[shown.caret] ?? " " }), shown.chars.slice(shown.caret + 1).join("")] })) : (shown.chars.join("")), shown.cutRight ? "…" : ""] }, index));
104
+ }), hiddenBelow > 0 && (_jsxs(Text, { dimColor: true, children: [" ", "\u2026 ", hiddenBelow, " more line", hiddenBelow === 1 ? "" : "s"] }))] }), _jsxs(Box, { justifyContent: "space-between", paddingX: 1, children: [_jsxs(Box, { columnGap: 1, flexShrink: 1, children: [_jsx(Text, { color: theme.color.success, children: agent }), _jsx(Text, { dimColor: true, children: theme.glyph.info }), _jsx(Text, { dimColor: true, children: providerLabel }), _jsx(Text, { color: theme.color.info, children: model || "default" }), _jsx(Text, { dimColor: true, children: theme.glyph.info }), _jsx(Text, { dimColor: true, children: turnsLabel }), _jsx(Text, { dimColor: true, children: theme.glyph.info }), _jsx(Text, { color: mode === "plan" ? theme.color.warning :
105
+ mode === "auto" ? theme.color.error :
106
+ theme.color.info, children: modeLabel }), _jsx(Text, { dimColor: true, children: theme.glyph.info }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: shownCwd })] }), _jsxs(Box, { columnGap: 1, flexShrink: 0, children: [authed ? (_jsxs(Text, { color: theme.color.success, children: [theme.glyph.check, " authed"] })) : (_jsx(Text, { color: theme.color.warning, children: "\u25CB /signin to start" })), _jsx(Text, { dimColor: true, children: theme.glyph.info }), _jsx(Text, { dimColor: true, children: hintsLabel })] })] })] }));
107
+ };
108
+ //# sourceMappingURL=InputBar.js.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * /keys panel — list, create, revoke, usage; shows the full key once on create.
3
+ *
4
+ * Revocation requires a second confirmation (see keyRouter confirm-revoke):
5
+ * the panel renders the question and the valid answers, nothing more.
6
+ */
7
+ import React from "react";
8
+ import type { KeysState } from "../shared/types.js";
9
+ export declare const KeysPanel: ({ state }: {
10
+ state: KeysState;
11
+ }) => React.JSX.Element;
12
+ //# sourceMappingURL=KeysPanel.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { theme } from "../theme.js";
4
+ const Frame = ({ color, title, children }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: color, paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: color, children: title }), children] }));
5
+ export const KeysPanel = ({ state }) => {
6
+ if (state.mode === "create-name") {
7
+ return (_jsxs(Frame, { color: theme.color.accent, title: "Create API key \u2014 name", children: [_jsx(Text, { dimColor: true, children: "Enter continue \u00B7 esc cancel" }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: theme.color.accent, bold: true, children: [theme.glyph.pointer, " ", state.draftName, _jsx(Text, { dimColor: true, children: "_" })] }) })] }));
8
+ }
9
+ if (state.mode === "created" && state.createdKey) {
10
+ return (_jsxs(Frame, { color: theme.color.warning, title: `${theme.glyph.warn} Key created — copy it now`, children: [_jsx(Text, { dimColor: true, children: "This is the only time the full key is shown." }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.color.success, bold: true, children: state.createdKey.key }) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Name: ", state.createdKey.name, " \u00B7 Enter to dismiss"] }) })] }));
11
+ }
12
+ const selected = state.rows[state.selectedIndex];
13
+ return (_jsxs(Frame, { color: theme.color.accent, title: "API keys", children: [_jsx(Text, { dimColor: true, children: "\u2191/\u2193 move \u00B7 a create \u00B7 r revoke \u00B7 u usage \u00B7 s set active \u00B7 esc close" }), state.mode === "confirm-revoke" && selected && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { color: theme.color.warning, bold: true, children: [theme.glyph.warn, " Revoke \u201C", selected.name, "\u201D (", selected.key_prefix, "\u2026)?"] }), _jsx(Text, { dimColor: true, children: "This cannot be undone. y revoke \u00B7 n/esc keep" })] })), state.busy && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.color.accent, children: "Loading\u2026" }) })), !state.busy && state.rows.length === 0 && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["No keys yet \u2014 press ", _jsx(Text, { color: theme.color.brand, children: "a" }), " to create one."] }) })), !state.busy && state.rows.length > 0 && (_jsx(Box, { marginTop: 1, flexDirection: "column", children: state.rows.map((row, idx) => {
14
+ const sel = idx === state.selectedIndex;
15
+ const status = row.is_active ? "active" : "revoked";
16
+ const lastUsed = row.last_used_at
17
+ ? new Date(row.last_used_at).toLocaleDateString()
18
+ : "never";
19
+ const isActive = state.activeKeyLabel
20
+ ? row.key_prefix.startsWith(state.activeKeyLabel)
21
+ : false;
22
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: sel ? theme.color.accent : theme.color.muted, bold: sel, children: [sel ? `${theme.glyph.pointer} ` : " ", isActive ? "● " : "", row.name, _jsxs(Text, { dimColor: true, children: [" ", row.key_prefix, "\u2026 \u00B7 ", status, isActive ? " · active (local)" : "", " \u00B7 last used ", lastUsed] })] }), sel && row.scopes && row.scopes.length > 0 && (_jsxs(Text, { dimColor: true, children: [" ", "scopes: ", row.scopes.join(", ")] }))] }, row.id));
23
+ }) }))] }));
24
+ };
25
+ //# sourceMappingURL=KeysPanel.js.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Message rendering — user prompts, system notices, and markdown-aware agent
3
+ * replies.
4
+ *
5
+ * Completed messages render once inside Ink's static region (see
6
+ * ScreenLayout), so this component can afford real structure: headings,
7
+ * lists, fenced code with a language label, quotes, rules, and tables. The
8
+ * cheap line parser lives in utils/markdown.ts.
9
+ */
10
+ import React from "react";
11
+ import type { ChatMessage } from "../shared/types.js";
12
+ declare const MessageViewImpl: ({ msg, live }: {
13
+ msg: ChatMessage;
14
+ live?: boolean;
15
+ }) => React.JSX.Element;
16
+ export declare const MessageView: React.MemoExoticComponent<typeof MessageViewImpl>;
17
+ /**
18
+ * The reply currently being streamed. Rendered outside the static region.
19
+ *
20
+ * Memoized on purpose: a token commit replaces the message object and should
21
+ * re-parse, but keystrokes and the elapsed-seconds tick also re-render App
22
+ * while a turn is live. Without `memo` each of those re-parses the entire
23
+ * reply (several ms on a long answer) for no visible change.
24
+ */
25
+ export declare const StreamingMessage: React.MemoExoticComponent<({ msg }: {
26
+ msg: ChatMessage;
27
+ }) => React.JSX.Element>;
28
+ export {};
29
+ //# sourceMappingURL=MessageView.d.ts.map
@@ -0,0 +1,107 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Message rendering — user prompts, system notices, and markdown-aware agent
4
+ * replies.
5
+ *
6
+ * Completed messages render once inside Ink's static region (see
7
+ * ScreenLayout), so this component can afford real structure: headings,
8
+ * lists, fenced code with a language label, quotes, rules, and tables. The
9
+ * cheap line parser lives in utils/markdown.ts.
10
+ */
11
+ import { memo } from "react";
12
+ import { Box, Text, useStdout } from "ink";
13
+ import { parseMarkdown } from "../utils/markdown.js";
14
+ import { displayWidth, padToWidth, sanitize, truncateToWidth } from "../utils/terminal-text.js";
15
+ import { theme, systemColor } from "../theme.js";
16
+ /* ── Inline styling ─────────────────────────────────────────────────────── */
17
+ const Run = ({ run }) => (_jsx(Text, { bold: run.bold, italic: run.italic, underline: run.underline, strikethrough: run.strike, color: run.code ? theme.color.code : run.link ? theme.color.link : undefined, children: run.text }));
18
+ const Runs = ({ runs }) => runs.length === 0 ? null : (_jsx(_Fragment, { children: runs.map((run, i) => (_jsx(Run, { run: run }, i))) }));
19
+ /* ── Block rendering ────────────────────────────────────────────────────── */
20
+ const MAX_CODE_LINES = 400;
21
+ const CodeBlock = ({ lang, lines, open }) => {
22
+ const shown = lines.slice(0, MAX_CODE_LINES);
23
+ const hidden = lines.length - shown.length;
24
+ return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { dimColor: true, children: [theme.glyph.rule.repeat(2), " ", lang || "code", open ? " …" : ""] }), _jsxs(Box, { flexDirection: "column", paddingLeft: 1, children: [shown.map((line, i) => (_jsx(Text, { color: theme.color.muted, children: line || " " }, i))), hidden > 0 && _jsxs(Text, { dimColor: true, children: ["\u2026 ", hidden, " more lines"] })] }), _jsx(Text, { dimColor: true, children: theme.glyph.rule.repeat(2) })] }));
25
+ };
26
+ const TableBlock = ({ line }) => {
27
+ const { stdout } = useStdout();
28
+ const available = Math.max(20, (stdout?.columns ?? 80) - 4);
29
+ const columns = line.header.length;
30
+ // Column widths are measured in terminal columns, not code units: a CJK or
31
+ // emoji cell is two columns wide and would misalign every row after it.
32
+ // The per-cell cap keeps a wide table inside the terminal instead of
33
+ // letting Ink wrap it into unreadable fragments.
34
+ const cap = Math.max(6, Math.floor((available - 2 * (columns - 1)) / columns));
35
+ const widths = line.header.map((cell, i) => {
36
+ let width = Math.max(displayWidth(cell), 3);
37
+ // reduce, not spread: Math.max(...rows) overflows the stack on huge tables
38
+ for (const row of line.rows)
39
+ width = Math.max(width, displayWidth(row[i] ?? ""));
40
+ return Math.min(width, cap);
41
+ });
42
+ const pad = (cell, i) => padToWidth(truncateToWidth(cell, widths[i], ""), widths[i], line.align[i] ?? "left");
43
+ return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { bold: true, color: theme.color.brand, children: line.header.map((c, i) => pad(c, i)).join(" ") }), _jsx(Text, { dimColor: true, children: widths.map((w) => theme.glyph.rule.repeat(w)).join(" ") }), line.rows.map((row, r) => (_jsx(Text, { children: row.map((c, i) => pad(c ?? "", i)).join(" ") }, r)))] }));
44
+ };
45
+ const Block = ({ line }) => {
46
+ // Called unconditionally: hooks may not sit inside a switch branch.
47
+ const { stdout } = useStdout();
48
+ switch (line.kind) {
49
+ case "blank":
50
+ return _jsx(Text, { children: " " });
51
+ case "heading":
52
+ return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { bold: true, color: theme.color.brand, children: _jsx(Runs, { runs: line.runs }) }) }));
53
+ case "rule": {
54
+ // A fixed 40 is right for exactly one width: at 40 columns the 41st
55
+ // cell wrapped and left an orphan glyph on the next line.
56
+ const width = Math.max(10, Math.min(40, (stdout?.columns ?? 80) - 4));
57
+ return _jsx(Text, { dimColor: true, children: theme.glyph.rule.repeat(width) });
58
+ }
59
+ case "quote":
60
+ return (_jsxs(Text, { color: theme.color.accent, children: [theme.glyph.bar, " ", _jsx(Runs, { runs: line.runs })] }));
61
+ case "bullet":
62
+ return (_jsxs(Text, { children: [" ".repeat(line.depth), _jsxs(Text, { color: theme.color.success, children: [line.marker, " "] }), _jsx(Runs, { runs: line.runs })] }));
63
+ case "code":
64
+ return _jsx(CodeBlock, { lang: line.lang, lines: line.lines, open: line.open });
65
+ case "table":
66
+ return _jsx(TableBlock, { line: line });
67
+ case "text":
68
+ default:
69
+ return (_jsx(Text, { wrap: "wrap", children: _jsx(Runs, { runs: line.runs }) }));
70
+ }
71
+ };
72
+ /* ── Messages ───────────────────────────────────────────────────────────── */
73
+ /**
74
+ * How many rendered blocks of a live reply are shown at once.
75
+ *
76
+ * A 1200-line reply costs ~266 ms per frame in Ink's layout/output pass; 90%
77
+ * of that is node layout, not parsing. Rendering only the tail bounds the
78
+ * frame to roughly constant time. Nothing is lost: when the turn ends the
79
+ * whole message moves into <Static> and is written once, in full.
80
+ */
81
+ const LIVE_BLOCK_LIMIT = 60;
82
+ const MessageViewImpl = ({ msg, live = false }) => {
83
+ // User text comes from the keyboard (and mid-prompt pastes) and system lines
84
+ // can embed server error strings: both are untrusted for terminal purposes.
85
+ if (msg.role === "user") {
86
+ return (_jsxs(Box, { marginTop: 1, marginBottom: 1, paddingLeft: 1, borderStyle: "round", borderColor: theme.color.muted, borderTop: false, borderRight: false, borderBottom: false, children: [_jsxs(Text, { color: theme.color.user, bold: true, children: [theme.glyph.pointer, " "] }), _jsx(Text, { color: theme.color.user, children: sanitize(msg.text) })] }));
87
+ }
88
+ if (msg.role === "system") {
89
+ const text = sanitize(msg.text);
90
+ return (_jsx(Box, { marginTop: 1, paddingLeft: 1, children: _jsx(Text, { color: systemColor(text), wrap: "wrap", children: text }) }));
91
+ }
92
+ const blocks = parseMarkdown(msg.text);
93
+ const hidden = live ? Math.max(0, blocks.length - LIVE_BLOCK_LIMIT) : 0;
94
+ const shown = hidden > 0 ? blocks.slice(-LIVE_BLOCK_LIMIT) : blocks;
95
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: theme.color.accent, bold: true, children: msg.agentName ?? "agent" }), _jsxs(Text, { dimColor: true, children: [" ", theme.glyph.info] })] }), _jsxs(Box, { flexDirection: "column", paddingLeft: 1, children: [hidden > 0 && (_jsxs(Text, { dimColor: true, children: ["\u2026 ", hidden, " earlier line", hidden === 1 ? "" : "s", " (shown in full when the reply finishes)"] })), shown.map((line, i) => (_jsx(Block, { line: line }, hidden + i)))] })] }));
96
+ };
97
+ export const MessageView = memo(MessageViewImpl);
98
+ /**
99
+ * The reply currently being streamed. Rendered outside the static region.
100
+ *
101
+ * Memoized on purpose: a token commit replaces the message object and should
102
+ * re-parse, but keystrokes and the elapsed-seconds tick also re-render App
103
+ * while a turn is live. Without `memo` each of those re-parses the entire
104
+ * reply (several ms on a long answer) for no visible change.
105
+ */
106
+ export const StreamingMessage = memo(({ msg }) => (_jsx(MessageViewImpl, { msg: msg, live: true })));
107
+ //# sourceMappingURL=MessageView.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * PermissionPrompt — Claude Code style y/N confirmation for risky local ops,
3
+ * with a before/after diff preview when the op is a file write.
4
+ */
5
+ import React from "react";
6
+ import type { PendingOp } from "../shared/types.js";
7
+ export declare const PermissionPrompt: ({ op }: {
8
+ op: PendingOp;
9
+ }) => React.JSX.Element;
10
+ //# sourceMappingURL=PermissionPrompt.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ export const PermissionPrompt = ({ op }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: "yellow", children: "\u26A0 Permission required" }), _jsxs(Text, { children: ["OdysX wants to ", _jsx(Text, { bold: true, children: op.kind }), ": ", op.summary] }), op.diff && (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, children: [_jsx(Text, { bold: true, children: op.diff.file }), op.diff.before ? (_jsxs(Text, { color: "red", children: ["- ", op.diff.before.slice(0, 120).replace(/\n/g, " ⏎ ")] })) : (_jsx(Text, { dimColor: true, children: "(new file)" })), _jsxs(Text, { color: "green", children: ["+ ", op.diff.after.slice(0, 120).replace(/\n/g, " ⏎ ")] })] })), _jsx(Text, { dimColor: true, children: "y = allow \u00B7 n/esc = deny" })] }));
4
+ //# sourceMappingURL=PermissionPrompt.js.map
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Overlay pickers: agent switcher, session resumer, sign-in chooser, and the
3
+ * y/N permission prompt for risky local ops.
4
+ *
5
+ * One frame, one interaction grammar (`↑/↓ move · Enter confirm · esc back`),
6
+ * one palette — the four overlays should feel like the same control.
7
+ */
8
+ import React from "react";
9
+ import type { AgentOption, PendingOp, SessionRow } from "../shared/types.js";
10
+ export declare const AgentPicker: ({ options, selected, busy, }: {
11
+ options: AgentOption[];
12
+ selected: number;
13
+ busy?: boolean;
14
+ }) => React.JSX.Element;
15
+ export declare const SessionPicker: ({ rows, selected, busy, }: {
16
+ rows: SessionRow[];
17
+ selected: number;
18
+ busy?: boolean;
19
+ }) => React.JSX.Element;
20
+ export declare const AuthPicker: ({ options, selected, busy, }: {
21
+ options: readonly {
22
+ id: string;
23
+ label: string;
24
+ description: string;
25
+ }[];
26
+ selected: number;
27
+ busy?: boolean;
28
+ }) => React.JSX.Element;
29
+ /**
30
+ * Folder trust prompt — shown once per unfamiliar workspace, before the REPL
31
+ * exposes any read/write/exec capability. Unlike the y/N op prompt, declining
32
+ * here exits: an untrusted folder means no session at all, not a session with
33
+ * capabilities turned off one by one after the fact.
34
+ */
35
+ export declare const TrustPrompt: ({ folder, selected, mode, }: {
36
+ folder: string;
37
+ selected: number;
38
+ mode: string;
39
+ }) => React.JSX.Element;
40
+ export declare const PermissionPrompt: ({ op }: {
41
+ op: PendingOp;
42
+ }) => React.JSX.Element;
43
+ //# sourceMappingURL=Pickers.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { theme } from "../theme.js";
4
+ /** Shared frame so every overlay has identical chrome. */
5
+ const Panel = ({ title, hint, color = theme.color.accent, children, }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: color, paddingX: 1, paddingY: 0, marginBottom: 1, children: [_jsx(Text, { bold: true, color: color, children: title }), hint && _jsx(Text, { dimColor: true, children: hint }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: children })] }));
6
+ /** A selectable row: pointer, label, and a dimmed detail. */
7
+ const Row = ({ selected, color, label, detail, disabled, }) => (_jsxs(Text, { color: selected ? color : theme.color.muted, bold: selected, dimColor: disabled, wrap: "truncate-end", children: [selected ? `${theme.glyph.pointer} ` : " ", label, detail ? ` — ${detail}` : ""] }));
8
+ /** Notice rendered in place of rows when a list is empty. */
9
+ const Empty = ({ children }) => (_jsx(Text, { dimColor: true, children: children }));
10
+ /* ── /agent picker ── */
11
+ export const AgentPicker = ({ options, selected, busy, }) => (_jsx(Panel, { title: "Select an agent", hint: "\u2191/\u2193 move \u00B7 Enter switch \u00B7 esc cancel", children: busy && options.length === 0 ? (_jsx(Empty, { children: "Loading your agents\u2026" })) : options.length === 0 ? (_jsx(Empty, { children: "No agents available." })) : (options.map((opt, idx) => (_jsx(Row, { selected: idx === selected, color: theme.color.accent, label: opt.label, detail: opt.description }, opt.id)))) }));
12
+ /* ── /sessions picker ── */
13
+ export const SessionPicker = ({ rows, selected, busy, }) => (_jsx(Panel, { title: "Resume a session", hint: "\u2191/\u2193 move \u00B7 Enter resume \u00B7 esc cancel", color: theme.color.info, children: busy && rows.length === 0 ? (_jsx(Empty, { children: "Loading your sessions\u2026" })) : rows.length === 0 ? (_jsx(Empty, { children: "No sessions yet." })) : (rows.map((s, idx) => {
14
+ const when = s.updated_at ? new Date(s.updated_at).toLocaleString() : "unknown time";
15
+ const who = s.agent_name || s.agent_id || "agent";
16
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Row, { selected: idx === selected, color: theme.color.info, label: s.title?.slice(0, 60) || s.session_id.slice(0, 8), detail: when }), idx === selected && (_jsxs(Text, { dimColor: true, children: [" ", who, s.model ? ` · ${s.model}` : "", " \u00B7 ", s.session_id.slice(0, 12)] }))] }, s.session_id));
17
+ })) }));
18
+ /* ── Sign-in method picker ── */
19
+ export const AuthPicker = ({ options, selected, busy, }) => (_jsx(Panel, { title: "Sign in to OdysX", hint: "\u2191/\u2193 move \u00B7 Enter select \u00B7 esc cancel", color: theme.color.info, children: options.map((opt, idx) => (_jsx(Row, { selected: idx === selected && !busy, color: theme.color.info, label: opt.label, detail: opt.description }, opt.id))) }));
20
+ /**
21
+ * Folder trust prompt — shown once per unfamiliar workspace, before the REPL
22
+ * exposes any read/write/exec capability. Unlike the y/N op prompt, declining
23
+ * here exits: an untrusted folder means no session at all, not a session with
24
+ * capabilities turned off one by one after the fact.
25
+ */
26
+ export const TrustPrompt = ({ folder, selected, mode, }) => (_jsxs(Panel, { title: `${theme.glyph.warn} Trust this folder?`, color: theme.color.warning, hint: "\u2191/\u2193 or 1/2 to choose \u00B7 Enter confirm \u00B7 esc exit", children: [_jsx(Text, { wrap: "truncate-end", children: folder }), _jsx(Text, { dimColor: true, children: "Codemind can read, edit, and run commands here. Only trust folders you own." }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Row, { selected: selected === 0, color: theme.color.success, label: "1. Yes, I trust this folder" }), _jsx(Row, { selected: selected === 1, color: theme.color.error, label: "2. No, exit" })] }), _jsxs(Text, { dimColor: true, children: ["Permission mode after trusting: ", mode, " (/mode to change)"] })] }));
27
+ /* ── PermissionPrompt — y/N for risky local ops, with a diff preview ── */
28
+ export const PermissionPrompt = ({ op }) => (_jsxs(Panel, { title: `${theme.glyph.warn} Permission required`, color: theme.color.warning, hint: "y = allow \u00B7 n/esc = deny", children: [_jsxs(Text, { children: ["OdysX wants to ", _jsx(Text, { bold: true, children: op.kind }), ": ", op.summary] }), op.diff && (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 1, children: [_jsx(Text, { bold: true, children: op.diff.file }), op.diff.before ? (_jsxs(Text, { color: theme.color.error, children: ["- ", preview(op.diff.before)] })) : (_jsx(Text, { dimColor: true, children: "(new file)" })), _jsxs(Text, { color: theme.color.success, children: ["+ ", preview(op.diff.after)] })] }))] }));
29
+ const preview = (text) => {
30
+ const single = text.replace(/\s*\n\s*/g, " ⏎ ");
31
+ return single.length > 160 ? single.slice(0, 159) + "…" : single;
32
+ };
33
+ //# sourceMappingURL=Pickers.js.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Searchable overlay used by Ctrl+/ (command palette) and Ctrl+R (history).
3
+ *
4
+ * Both modes share one interaction grammar and one frame; only the title,
5
+ * rows and empty hint differ. It renders above the input bar and outside
6
+ * <Static>, so results are redrawn on every keystroke.
7
+ */
8
+ import React from "react";
9
+ export interface SearchRow {
10
+ key: string;
11
+ label: string;
12
+ detail?: string;
13
+ }
14
+ export declare const SearchOverlay: ({ title, query, rows, selected, hint, }: {
15
+ title: string;
16
+ query: string;
17
+ rows: SearchRow[];
18
+ selected: number;
19
+ hint: string;
20
+ }) => React.JSX.Element;
21
+ //# sourceMappingURL=SearchOverlay.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useStdout } from "ink";
3
+ import { theme } from "../theme.js";
4
+ import { displayWidth, truncateToWidth } from "../utils/terminal-text.js";
5
+ export const SearchOverlay = ({ title, query, rows, selected, hint, }) => {
6
+ const { stdout } = useStdout();
7
+ const width = Math.max(20, (stdout?.columns ?? 80) - 6);
8
+ // Bound the visible window so a long history can't push the input offscreen.
9
+ const limit = 10;
10
+ const start = Math.max(0, Math.min(selected - 4, Math.max(0, rows.length - limit)));
11
+ const visible = rows.slice(start, start + limit);
12
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.color.info, paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: theme.color.info, children: title }), _jsxs(Text, { color: theme.color.user, children: [theme.glyph.pointer, " ", query || "…"] }), visible.map((row, i) => (_jsxs(Text, { color: start + i === selected ? theme.color.brand : theme.color.muted, bold: start + i === selected, wrap: "truncate-end", children: [start + i === selected ? "› " : " ", truncateToWidth(row.label, Math.max(8, Math.floor(width * 0.55))), row.detail ? ` ${truncateToWidth(row.detail, Math.max(6, width - displayWidth(row.label) - 8))}` : ""] }, row.key))), rows.length === 0 && _jsx(Text, { dimColor: true, children: "No matches." }), start > 0 && _jsxs(Text, { dimColor: true, children: [" \u2026 ", start, " above"] }), rows.length - start - visible.length > 0 && (_jsxs(Text, { dimColor: true, children: [" \u2026 ", rows.length - start - visible.length, " below"] })), _jsx(Text, { dimColor: true, children: hint })] }));
13
+ };
14
+ //# sourceMappingURL=SearchOverlay.js.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Session picker (/sessions → select a past session to resume).
3
+ * Same interaction model as AgentPicker: ↑/↓ · Enter · esc.
4
+ */
5
+ import React from "react";
6
+ import type { SessionRow } from "../shared/types.js";
7
+ export declare const SessionPicker: ({ options, selected, busy, }: {
8
+ options: SessionRow[];
9
+ selected: number;
10
+ busy?: boolean;
11
+ }) => React.JSX.Element;
12
+ //# sourceMappingURL=SessionPicker.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ export const SessionPicker = ({ options, selected, busy, }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "blue", paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: "blue", children: "Resume a session" }), _jsx(Text, { dimColor: true, children: "\u2191/\u2193 to move \u00B7 Enter to resume \u00B7 esc to cancel" }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: busy && options.length === 0 ? (_jsx(Text, { dimColor: true, children: "Loading your sessions\u2026" })) : (options.map((opt, idx) => {
4
+ const isSelected = idx === selected && !busy;
5
+ const when = opt.updated_at ? new Date(opt.updated_at).toLocaleString() : "unknown time";
6
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: isSelected ? "blue" : "gray", bold: isSelected, children: [isSelected ? "❯ " : " ", opt.title || opt.session_id.slice(0, 8), _jsxs(Text, { dimColor: true, children: [" \u2014 ", when] })] }), (opt.agent_name || opt.agent_id) && (_jsxs(Text, { dimColor: true, children: [" ", "agent: ", opt.agent_name ?? opt.agent_id, opt.model ? ` · ${opt.model}` : ""] }))] }, opt.session_id));
7
+ })) })] }));
8
+ //# sourceMappingURL=SessionPicker.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Live spinner while the agent streams — frame, elapsed time, and what Enter
3
+ * will do (queue) vs Esc (interrupt).
4
+ */
5
+ import React from "react";
6
+ export declare const WorkingIndicator: ({ elapsed, agent }: {
7
+ elapsed: number;
8
+ agent?: string;
9
+ }) => React.JSX.Element;
10
+ //# sourceMappingURL=WorkingIndicator.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Live spinner while the agent streams — frame, elapsed time, and what Enter
4
+ * will do (queue) vs Esc (interrupt).
5
+ */
6
+ import { useState, useEffect } from "react";
7
+ import { Box, Text } from "ink";
8
+ import { theme } from "../theme.js";
9
+ const SPINNER_FRAMES = ["✶", "✻", "✽", "✺", "❋", "✹"];
10
+ const formatElapsed = (seconds) => {
11
+ if (seconds < 60)
12
+ return `${seconds}s`;
13
+ return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
14
+ };
15
+ export const WorkingIndicator = ({ elapsed, agent }) => {
16
+ const [frame, setFrame] = useState(0);
17
+ useEffect(() => {
18
+ const iv = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), 90);
19
+ return () => clearInterval(iv);
20
+ }, []);
21
+ return (_jsxs(Box, { marginBottom: 1, paddingLeft: 1, columnGap: 1, children: [_jsx(Text, { color: theme.color.accent, children: SPINNER_FRAMES[frame] }), _jsxs(Text, { color: theme.color.muted, wrap: "truncate-end", children: [agent ? `${agent} is thinking` : "Thinking", " \u00B7 ", formatElapsed(elapsed)] }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: "esc to interrupt \u00B7 enter to queue" })] }));
22
+ };
23
+ //# sourceMappingURL=WorkingIndicator.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Masked "paste your API key" entry box (auth flow, api-key mode).
3
+ */
4
+ import React from "react";
5
+ export declare const ApiKeyEntry: ({ draft }: {
6
+ draft: string;
7
+ }) => React.JSX.Element;
8
+ //# sourceMappingURL=ApiKeyEntry.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text } from "ink";
3
+ import { theme } from "../theme.js";
4
+ export const ApiKeyEntry = ({ draft }) => (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.color.info, paddingX: 1, marginBottom: 1, children: [_jsx(Text, { bold: true, color: theme.color.info, children: "Paste your OdysX API key" }), _jsx(Text, { dimColor: true, children: "Enter to save \u00B7 esc to cancel \u00B7 input is masked" }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: theme.color.info, bold: true, children: [theme.glyph.pointer, " ", "•".repeat(draft.length), _jsx(Text, { dimColor: true, children: "_" })] }) })] }));
5
+ //# sourceMappingURL=ApiKeyEntry.js.map