neoctl 0.2.11 → 0.2.12
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/repl/index.js +3114 -314
- package/dist/repl/index.js.map +1 -1
- package/dist/tools/builtins/image-note-tool.js +1 -5
- package/dist/tools/builtins/image-note-tool.js.map +1 -1
- package/dist/web/html.js +8 -14
- package/dist/web/html.js.map +1 -1
- package/dist/web/index.d.ts +0 -5
- package/dist/web/index.js +5 -41
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-ripgrep.cjs +196 -196
- package/vendor/ripgrep/darwin-arm64/COPYING +3 -3
- package/vendor/ripgrep/darwin-arm64/LICENSE-MIT +21 -21
- package/vendor/ripgrep/darwin-arm64/UNLICENSE +24 -24
- package/vendor/ripgrep/darwin-arm64/manifest.json +7 -7
- package/vendor/ripgrep/darwin-x64/COPYING +3 -3
- package/vendor/ripgrep/darwin-x64/LICENSE-MIT +21 -21
- package/vendor/ripgrep/darwin-x64/UNLICENSE +24 -24
- package/vendor/ripgrep/darwin-x64/manifest.json +7 -7
- package/vendor/ripgrep/linux-arm64/COPYING +3 -3
- package/vendor/ripgrep/linux-arm64/LICENSE-MIT +21 -21
- package/vendor/ripgrep/linux-arm64/UNLICENSE +24 -24
- package/vendor/ripgrep/linux-arm64/manifest.json +7 -7
- package/vendor/ripgrep/linux-x64/COPYING +3 -3
- package/vendor/ripgrep/linux-x64/LICENSE-MIT +21 -21
- package/vendor/ripgrep/linux-x64/UNLICENSE +24 -24
- package/vendor/ripgrep/linux-x64/manifest.json +7 -7
- package/vendor/ripgrep/win32-arm64/manifest.json +7 -7
- package/dist/repl/browser.d.ts +0 -232
- package/dist/repl/browser.js +0 -156
- package/dist/repl/browser.js.map +0 -1
- package/dist/repl/env-file.d.ts +0 -4
- package/dist/repl/env-file.js +0 -97
- package/dist/repl/env-file.js.map +0 -1
- package/dist/repl/foreground-exec.d.ts +0 -10
- package/dist/repl/foreground-exec.js +0 -34
- package/dist/repl/foreground-exec.js.map +0 -1
- package/dist/repl/login-view.d.ts +0 -75
- package/dist/repl/login-view.js +0 -38
- package/dist/repl/login-view.js.map +0 -1
- package/dist/repl/login.d.ts +0 -14
- package/dist/repl/login.js +0 -165
- package/dist/repl/login.js.map +0 -1
- package/dist/repl/message-rendering.d.ts +0 -99
- package/dist/repl/message-rendering.js +0 -476
- package/dist/repl/message-rendering.js.map +0 -1
- package/dist/repl/prompt-payload.d.ts +0 -9
- package/dist/repl/prompt-payload.js +0 -64
- package/dist/repl/prompt-payload.js.map +0 -1
- package/dist/repl/prompt-view.d.ts +0 -235
- package/dist/repl/prompt-view.js +0 -184
- package/dist/repl/prompt-view.js.map +0 -1
- package/dist/repl/repl-types.d.ts +0 -88
- package/dist/repl/repl-types.js +0 -2
- package/dist/repl/repl-types.js.map +0 -1
- package/dist/repl/runtime.d.ts +0 -33
- package/dist/repl/runtime.js +0 -202
- package/dist/repl/runtime.js.map +0 -1
- package/dist/repl/slash-completion.d.ts +0 -28
- package/dist/repl/slash-completion.js +0 -287
- package/dist/repl/slash-completion.js.map +0 -1
- package/dist/repl/status-panel.d.ts +0 -234
- package/dist/repl/status-panel.js +0 -509
- package/dist/repl/status-panel.js.map +0 -1
- package/dist/repl/terminal.d.ts +0 -19
- package/dist/repl/terminal.js +0 -81
- package/dist/repl/terminal.js.map +0 -1
- package/dist/repl/tool-rendering.d.ts +0 -6
- package/dist/repl/tool-rendering.js +0 -502
- package/dist/repl/tool-rendering.js.map +0 -1
- package/dist/repl/usage.d.ts +0 -17
- package/dist/repl/usage.js +0 -57
- package/dist/repl/usage.js.map +0 -1
- package/dist/tips.d.ts +0 -10
- package/dist/tips.js +0 -168
- package/dist/tips.js.map +0 -1
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { ClipboardAttachment } from "./repl-types.js";
|
|
3
|
-
import { type SlashCommandCompletion } from "./slash-completion.js";
|
|
4
|
-
export declare function PromptLine({ text, cursor, busy, locked, placeholder, ghostText, width, prompt, slashCompletions, selectedSlashCompletionIndex, attachments }: {
|
|
5
|
-
text: string;
|
|
6
|
-
cursor: number;
|
|
7
|
-
busy: boolean;
|
|
8
|
-
locked: boolean;
|
|
9
|
-
placeholder?: boolean;
|
|
10
|
-
ghostText?: string;
|
|
11
|
-
width: number;
|
|
12
|
-
prompt: string;
|
|
13
|
-
slashCompletions: SlashCommandCompletion[];
|
|
14
|
-
selectedSlashCompletionIndex: number;
|
|
15
|
-
attachments: ClipboardAttachment[];
|
|
16
|
-
}): React.FunctionComponentElement<{
|
|
17
|
-
readonly position?: "absolute" | "relative" | undefined;
|
|
18
|
-
readonly columnGap?: number | undefined;
|
|
19
|
-
readonly rowGap?: number | undefined;
|
|
20
|
-
readonly gap?: number | undefined;
|
|
21
|
-
readonly margin?: number | undefined;
|
|
22
|
-
readonly marginX?: number | undefined;
|
|
23
|
-
readonly marginY?: number | undefined;
|
|
24
|
-
readonly marginTop?: number | undefined;
|
|
25
|
-
readonly marginBottom?: number | undefined;
|
|
26
|
-
readonly marginLeft?: number | undefined;
|
|
27
|
-
readonly marginRight?: number | undefined;
|
|
28
|
-
readonly padding?: number | undefined;
|
|
29
|
-
readonly paddingX?: number | undefined;
|
|
30
|
-
readonly paddingY?: number | undefined;
|
|
31
|
-
readonly paddingTop?: number | undefined;
|
|
32
|
-
readonly paddingBottom?: number | undefined;
|
|
33
|
-
readonly paddingLeft?: number | undefined;
|
|
34
|
-
readonly paddingRight?: number | undefined;
|
|
35
|
-
readonly flexGrow?: number | undefined;
|
|
36
|
-
readonly flexShrink?: number | undefined;
|
|
37
|
-
readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
38
|
-
readonly flexBasis?: number | string | undefined;
|
|
39
|
-
readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse" | undefined;
|
|
40
|
-
readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | undefined;
|
|
41
|
-
readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | undefined;
|
|
42
|
-
readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center" | undefined;
|
|
43
|
-
readonly width?: number | string | undefined;
|
|
44
|
-
readonly height?: number | string | undefined;
|
|
45
|
-
readonly minWidth?: number | string | undefined;
|
|
46
|
-
readonly minHeight?: number | string | undefined;
|
|
47
|
-
readonly display?: "flex" | "none" | undefined;
|
|
48
|
-
readonly borderStyle?: (keyof import("cli-boxes").Boxes | import("cli-boxes").BoxStyle) | undefined;
|
|
49
|
-
readonly borderTop?: boolean | undefined;
|
|
50
|
-
readonly borderBottom?: boolean | undefined;
|
|
51
|
-
readonly borderLeft?: boolean | undefined;
|
|
52
|
-
readonly borderRight?: boolean | undefined;
|
|
53
|
-
readonly borderColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
54
|
-
readonly borderTopColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
55
|
-
readonly borderBottomColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
56
|
-
readonly borderLeftColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
57
|
-
readonly borderRightColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
58
|
-
readonly borderDimColor?: boolean | undefined;
|
|
59
|
-
readonly borderTopDimColor?: boolean | undefined;
|
|
60
|
-
readonly borderBottomDimColor?: boolean | undefined;
|
|
61
|
-
readonly borderLeftDimColor?: boolean | undefined;
|
|
62
|
-
readonly borderRightDimColor?: boolean | undefined;
|
|
63
|
-
readonly overflow?: "visible" | "hidden" | undefined;
|
|
64
|
-
readonly overflowX?: "visible" | "hidden" | undefined;
|
|
65
|
-
readonly overflowY?: "visible" | "hidden" | undefined;
|
|
66
|
-
readonly backgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
67
|
-
} & {
|
|
68
|
-
readonly 'aria-label'?: string;
|
|
69
|
-
readonly 'aria-hidden'?: boolean;
|
|
70
|
-
readonly 'aria-role'?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
71
|
-
readonly 'aria-state'?: {
|
|
72
|
-
readonly busy?: boolean;
|
|
73
|
-
readonly checked?: boolean;
|
|
74
|
-
readonly disabled?: boolean;
|
|
75
|
-
readonly expanded?: boolean;
|
|
76
|
-
readonly multiline?: boolean;
|
|
77
|
-
readonly multiselectable?: boolean;
|
|
78
|
-
readonly readonly?: boolean;
|
|
79
|
-
readonly required?: boolean;
|
|
80
|
-
readonly selected?: boolean;
|
|
81
|
-
};
|
|
82
|
-
} & {
|
|
83
|
-
children?: React.ReactNode | undefined;
|
|
84
|
-
} & React.RefAttributes<import("ink").DOMElement>>;
|
|
85
|
-
export declare function PasteStatusLine({ text, width: terminalWidth }: {
|
|
86
|
-
text: string;
|
|
87
|
-
width: number;
|
|
88
|
-
}): React.FunctionComponentElement<{
|
|
89
|
-
readonly position?: "absolute" | "relative" | undefined;
|
|
90
|
-
readonly columnGap?: number | undefined;
|
|
91
|
-
readonly rowGap?: number | undefined;
|
|
92
|
-
readonly gap?: number | undefined;
|
|
93
|
-
readonly margin?: number | undefined;
|
|
94
|
-
readonly marginX?: number | undefined;
|
|
95
|
-
readonly marginY?: number | undefined;
|
|
96
|
-
readonly marginTop?: number | undefined;
|
|
97
|
-
readonly marginBottom?: number | undefined;
|
|
98
|
-
readonly marginLeft?: number | undefined;
|
|
99
|
-
readonly marginRight?: number | undefined;
|
|
100
|
-
readonly padding?: number | undefined;
|
|
101
|
-
readonly paddingX?: number | undefined;
|
|
102
|
-
readonly paddingY?: number | undefined;
|
|
103
|
-
readonly paddingTop?: number | undefined;
|
|
104
|
-
readonly paddingBottom?: number | undefined;
|
|
105
|
-
readonly paddingLeft?: number | undefined;
|
|
106
|
-
readonly paddingRight?: number | undefined;
|
|
107
|
-
readonly flexGrow?: number | undefined;
|
|
108
|
-
readonly flexShrink?: number | undefined;
|
|
109
|
-
readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
110
|
-
readonly flexBasis?: number | string | undefined;
|
|
111
|
-
readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse" | undefined;
|
|
112
|
-
readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | undefined;
|
|
113
|
-
readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | undefined;
|
|
114
|
-
readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center" | undefined;
|
|
115
|
-
readonly width?: number | string | undefined;
|
|
116
|
-
readonly height?: number | string | undefined;
|
|
117
|
-
readonly minWidth?: number | string | undefined;
|
|
118
|
-
readonly minHeight?: number | string | undefined;
|
|
119
|
-
readonly display?: "flex" | "none" | undefined;
|
|
120
|
-
readonly borderStyle?: (keyof import("cli-boxes").Boxes | import("cli-boxes").BoxStyle) | undefined;
|
|
121
|
-
readonly borderTop?: boolean | undefined;
|
|
122
|
-
readonly borderBottom?: boolean | undefined;
|
|
123
|
-
readonly borderLeft?: boolean | undefined;
|
|
124
|
-
readonly borderRight?: boolean | undefined;
|
|
125
|
-
readonly borderColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
126
|
-
readonly borderTopColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
127
|
-
readonly borderBottomColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
128
|
-
readonly borderLeftColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
129
|
-
readonly borderRightColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
130
|
-
readonly borderDimColor?: boolean | undefined;
|
|
131
|
-
readonly borderTopDimColor?: boolean | undefined;
|
|
132
|
-
readonly borderBottomDimColor?: boolean | undefined;
|
|
133
|
-
readonly borderLeftDimColor?: boolean | undefined;
|
|
134
|
-
readonly borderRightDimColor?: boolean | undefined;
|
|
135
|
-
readonly overflow?: "visible" | "hidden" | undefined;
|
|
136
|
-
readonly overflowX?: "visible" | "hidden" | undefined;
|
|
137
|
-
readonly overflowY?: "visible" | "hidden" | undefined;
|
|
138
|
-
readonly backgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
139
|
-
} & {
|
|
140
|
-
readonly 'aria-label'?: string;
|
|
141
|
-
readonly 'aria-hidden'?: boolean;
|
|
142
|
-
readonly 'aria-role'?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
143
|
-
readonly 'aria-state'?: {
|
|
144
|
-
readonly busy?: boolean;
|
|
145
|
-
readonly checked?: boolean;
|
|
146
|
-
readonly disabled?: boolean;
|
|
147
|
-
readonly expanded?: boolean;
|
|
148
|
-
readonly multiline?: boolean;
|
|
149
|
-
readonly multiselectable?: boolean;
|
|
150
|
-
readonly readonly?: boolean;
|
|
151
|
-
readonly required?: boolean;
|
|
152
|
-
readonly selected?: boolean;
|
|
153
|
-
};
|
|
154
|
-
} & {
|
|
155
|
-
children?: React.ReactNode | undefined;
|
|
156
|
-
} & React.RefAttributes<import("ink").DOMElement>>;
|
|
157
|
-
export declare function QueuedInputLine({ text, width: terminalWidth }: {
|
|
158
|
-
text: string;
|
|
159
|
-
width: number;
|
|
160
|
-
}): React.FunctionComponentElement<{
|
|
161
|
-
readonly position?: "absolute" | "relative" | undefined;
|
|
162
|
-
readonly columnGap?: number | undefined;
|
|
163
|
-
readonly rowGap?: number | undefined;
|
|
164
|
-
readonly gap?: number | undefined;
|
|
165
|
-
readonly margin?: number | undefined;
|
|
166
|
-
readonly marginX?: number | undefined;
|
|
167
|
-
readonly marginY?: number | undefined;
|
|
168
|
-
readonly marginTop?: number | undefined;
|
|
169
|
-
readonly marginBottom?: number | undefined;
|
|
170
|
-
readonly marginLeft?: number | undefined;
|
|
171
|
-
readonly marginRight?: number | undefined;
|
|
172
|
-
readonly padding?: number | undefined;
|
|
173
|
-
readonly paddingX?: number | undefined;
|
|
174
|
-
readonly paddingY?: number | undefined;
|
|
175
|
-
readonly paddingTop?: number | undefined;
|
|
176
|
-
readonly paddingBottom?: number | undefined;
|
|
177
|
-
readonly paddingLeft?: number | undefined;
|
|
178
|
-
readonly paddingRight?: number | undefined;
|
|
179
|
-
readonly flexGrow?: number | undefined;
|
|
180
|
-
readonly flexShrink?: number | undefined;
|
|
181
|
-
readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
182
|
-
readonly flexBasis?: number | string | undefined;
|
|
183
|
-
readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse" | undefined;
|
|
184
|
-
readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | undefined;
|
|
185
|
-
readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | undefined;
|
|
186
|
-
readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center" | undefined;
|
|
187
|
-
readonly width?: number | string | undefined;
|
|
188
|
-
readonly height?: number | string | undefined;
|
|
189
|
-
readonly minWidth?: number | string | undefined;
|
|
190
|
-
readonly minHeight?: number | string | undefined;
|
|
191
|
-
readonly display?: "flex" | "none" | undefined;
|
|
192
|
-
readonly borderStyle?: (keyof import("cli-boxes").Boxes | import("cli-boxes").BoxStyle) | undefined;
|
|
193
|
-
readonly borderTop?: boolean | undefined;
|
|
194
|
-
readonly borderBottom?: boolean | undefined;
|
|
195
|
-
readonly borderLeft?: boolean | undefined;
|
|
196
|
-
readonly borderRight?: boolean | undefined;
|
|
197
|
-
readonly borderColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
198
|
-
readonly borderTopColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
199
|
-
readonly borderBottomColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
200
|
-
readonly borderLeftColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
201
|
-
readonly borderRightColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
202
|
-
readonly borderDimColor?: boolean | undefined;
|
|
203
|
-
readonly borderTopDimColor?: boolean | undefined;
|
|
204
|
-
readonly borderBottomDimColor?: boolean | undefined;
|
|
205
|
-
readonly borderLeftDimColor?: boolean | undefined;
|
|
206
|
-
readonly borderRightDimColor?: boolean | undefined;
|
|
207
|
-
readonly overflow?: "visible" | "hidden" | undefined;
|
|
208
|
-
readonly overflowX?: "visible" | "hidden" | undefined;
|
|
209
|
-
readonly overflowY?: "visible" | "hidden" | undefined;
|
|
210
|
-
readonly backgroundColor?: import("type-fest").LiteralUnion<import("ansi-styles").ForegroundColorName, string> | undefined;
|
|
211
|
-
} & {
|
|
212
|
-
readonly 'aria-label'?: string;
|
|
213
|
-
readonly 'aria-hidden'?: boolean;
|
|
214
|
-
readonly 'aria-role'?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
215
|
-
readonly 'aria-state'?: {
|
|
216
|
-
readonly busy?: boolean;
|
|
217
|
-
readonly checked?: boolean;
|
|
218
|
-
readonly disabled?: boolean;
|
|
219
|
-
readonly expanded?: boolean;
|
|
220
|
-
readonly multiline?: boolean;
|
|
221
|
-
readonly multiselectable?: boolean;
|
|
222
|
-
readonly readonly?: boolean;
|
|
223
|
-
readonly required?: boolean;
|
|
224
|
-
readonly selected?: boolean;
|
|
225
|
-
};
|
|
226
|
-
} & {
|
|
227
|
-
children?: React.ReactNode | undefined;
|
|
228
|
-
} & React.RefAttributes<import("ink").DOMElement>>;
|
|
229
|
-
export interface PromptVisualLine {
|
|
230
|
-
before: string;
|
|
231
|
-
selected: string;
|
|
232
|
-
after: string;
|
|
233
|
-
}
|
|
234
|
-
export declare function promptPrefix(busy: boolean): string;
|
|
235
|
-
export declare function promptTextView(text: string, cursor: number, terminalWidth: number, prompt: string): PromptVisualLine[];
|
package/dist/repl/prompt-view.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { escapeRegExp } from "./prompt-payload.js";
|
|
4
|
-
import { statusBarWidth } from "./status-panel.js";
|
|
5
|
-
import { isValidReplCommandLine } from "./commands.js";
|
|
6
|
-
import { slashCompletionPageCount, slashCompletionPageStart, visibleSlashCompletions, SLASH_COMPLETION_PAGE_SIZE } from "./slash-completion.js";
|
|
7
|
-
const e = React.createElement;
|
|
8
|
-
export function PromptLine({ text, cursor, busy, locked, placeholder = false, ghostText, width, prompt, slashCompletions, selectedSlashCompletionIndex, attachments }) {
|
|
9
|
-
const displayText = text.length === 0 && ghostText ? ` ${ghostText}` : text;
|
|
10
|
-
const displayCursor = text.length === 0 && ghostText ? 0 : cursor;
|
|
11
|
-
const visualLines = promptTextView(displayText, displayCursor, width, prompt);
|
|
12
|
-
const inputColor = placeholder ? "gray" : (!locked && isValidReplCommandLine(text) ? "cyan" : undefined);
|
|
13
|
-
return e(Box, { flexDirection: "column" }, ...visualLines.map((line, index) => {
|
|
14
|
-
const isGhostLine = text.length === 0 && ghostText !== undefined;
|
|
15
|
-
const afterColor = isGhostLine ? "gray" : inputColor;
|
|
16
|
-
return e(Box, { key: `prompt-${index}`, height: 1, overflow: "hidden" }, e(Text, { color: locked ? "gray" : "cyan" }, index === 0 ? prompt : " ".repeat(prompt.length)), ...renderPromptPart(line.before, inputColor, attachments, `prompt-${index}-before`), e(Text, { key: `prompt-${index}-cursor`, inverse: true, color: inputColor }, line.selected), ...renderPromptPart(line.after, afterColor, attachments, `prompt-${index}-after`));
|
|
17
|
-
}), ...SlashCompletionLines({ completions: slashCompletions, width, prompt, selectedIndex: selectedSlashCompletionIndex }));
|
|
18
|
-
}
|
|
19
|
-
export function PasteStatusLine({ text, width: terminalWidth }) {
|
|
20
|
-
const width = statusBarWidth(terminalWidth);
|
|
21
|
-
return e(Box, { width, height: 1, overflow: "hidden" }, e(Text, { color: "yellow" }, fitToWidth(text, width)));
|
|
22
|
-
}
|
|
23
|
-
export function QueuedInputLine({ text, width: terminalWidth }) {
|
|
24
|
-
const width = statusBarWidth(terminalWidth);
|
|
25
|
-
const preview = fitToWidth(`pending next: ${text.replace(/\s+/g, " ").trim()} (Esc to edit)`, width);
|
|
26
|
-
return e(Box, { width, height: 1, overflow: "hidden" }, e(Text, { color: "yellow" }, preview));
|
|
27
|
-
}
|
|
28
|
-
function renderPromptPart(text, color, attachments, keyPrefix) {
|
|
29
|
-
if (!text)
|
|
30
|
-
return [];
|
|
31
|
-
const activeLabels = attachments.map((attachment) => attachment.label).filter((label) => text.includes(label));
|
|
32
|
-
if (activeLabels.length === 0)
|
|
33
|
-
return [e(Text, { key: `${keyPrefix}-plain`, color }, text)];
|
|
34
|
-
const pattern = new RegExp(activeLabels.map(escapeRegExp).join("|"), "g");
|
|
35
|
-
const nodes = [];
|
|
36
|
-
let lastIndex = 0;
|
|
37
|
-
let match;
|
|
38
|
-
while ((match = pattern.exec(text)) !== null) {
|
|
39
|
-
if (match.index > lastIndex)
|
|
40
|
-
nodes.push(e(Text, { key: `${keyPrefix}-plain-${nodes.length}`, color }, text.slice(lastIndex, match.index)));
|
|
41
|
-
nodes.push(e(Text, { key: `${keyPrefix}-tag-${nodes.length}`, color: "black", backgroundColor: "cyan", bold: true }, match[0]));
|
|
42
|
-
lastIndex = match.index + match[0].length;
|
|
43
|
-
}
|
|
44
|
-
if (lastIndex < text.length)
|
|
45
|
-
nodes.push(e(Text, { key: `${keyPrefix}-plain-${nodes.length}`, color }, text.slice(lastIndex)));
|
|
46
|
-
return nodes;
|
|
47
|
-
}
|
|
48
|
-
function SlashCompletionLines({ completions, width, prompt, selectedIndex }) {
|
|
49
|
-
if (completions.length === 0)
|
|
50
|
-
return [];
|
|
51
|
-
const pageStart = slashCompletionPageStart(selectedIndex, completions);
|
|
52
|
-
const visibleCompletions = visibleSlashCompletions(completions, selectedIndex);
|
|
53
|
-
const safeSelectedIndex = Math.max(0, Math.min(selectedIndex - pageStart, visibleCompletions.length - 1));
|
|
54
|
-
const contentWidth = Math.max(20, width - prompt.length);
|
|
55
|
-
const nameWidth = Math.min(32, Math.max(...visibleCompletions.map((completion) => completion.value.length)));
|
|
56
|
-
const pageCount = slashCompletionPageCount(completions);
|
|
57
|
-
const pageIndex = Math.floor(pageStart / SLASH_COMPLETION_PAGE_SIZE) + 1;
|
|
58
|
-
const footer = pageCount > 1 ? "arrows select · PgUp/PgDn page · Tab complete" : "arrows select · Tab complete";
|
|
59
|
-
const rows = visibleCompletions.map((completion, index) => {
|
|
60
|
-
const selected = index === safeSelectedIndex;
|
|
61
|
-
const numberPrefix = `${pageStart + index + 1}.`.padStart(String(completions.length).length + 1);
|
|
62
|
-
const descriptionWidth = Math.max(0, contentWidth - numberPrefix.length - nameWidth - 4);
|
|
63
|
-
const description = fitToWidth(completion.description, descriptionWidth);
|
|
64
|
-
return e(Text, { key: `slash-completion-${completion.kind}-${completion.insertText}`, color: "white" }, e(Text, {
|
|
65
|
-
color: selected ? "black" : "white",
|
|
66
|
-
backgroundColor: selected ? "cyan" : undefined,
|
|
67
|
-
}, numberPrefix), e(Text, { color: "gray" }, " "), e(Text, { color: completion.kind === "reasoning" ? "magenta" : "cyan" }, completion.value.padEnd(nameWidth)), e(Text, { color: "gray" }, " "), e(Text, { color: selected ? "white" : "gray" }, description));
|
|
68
|
-
});
|
|
69
|
-
const title = pageCount > 1 ? `Completions (${completions.length}) page ${pageIndex}/${pageCount}` : `Completions (${completions.length})`;
|
|
70
|
-
return [
|
|
71
|
-
e(Text, { key: "slash-completion-header", color: "cyan", bold: true }, fitToWidth(title, contentWidth)),
|
|
72
|
-
...rows,
|
|
73
|
-
e(Text, { key: "slash-completion-footer", color: "gray" }, fitToWidth(footer, contentWidth)),
|
|
74
|
-
].map((line, index) => e(Box, { key: `slash-completion-line-${index}`, height: 1, overflow: "hidden" }, e(Text, { color: "gray" }, " ".repeat(prompt.length)), line));
|
|
75
|
-
}
|
|
76
|
-
export function promptPrefix(busy) {
|
|
77
|
-
return "● ";
|
|
78
|
-
}
|
|
79
|
-
export function promptTextView(text, cursor, terminalWidth, prompt) {
|
|
80
|
-
const safeCursor = Math.max(0, Math.min(cursor, text.length));
|
|
81
|
-
const availableWidth = Math.max(1, terminalWidth - prompt.length);
|
|
82
|
-
const prefixWidth = stringCellWidth(prompt);
|
|
83
|
-
const firstWidth = Math.max(1, terminalWidth - prefixWidth);
|
|
84
|
-
const continuationWidth = availableWidth;
|
|
85
|
-
return wrapPromptText(text, safeCursor, firstWidth, continuationWidth);
|
|
86
|
-
}
|
|
87
|
-
function wrapPromptText(text, cursor, firstWidth, continuationWidth) {
|
|
88
|
-
const segments = [];
|
|
89
|
-
let index = 0;
|
|
90
|
-
let current = "";
|
|
91
|
-
let currentStart = 0;
|
|
92
|
-
let currentWidth = 0;
|
|
93
|
-
let lineWidth = Math.max(1, firstWidth);
|
|
94
|
-
while (index < text.length) {
|
|
95
|
-
const char = nextTextChar(text, index);
|
|
96
|
-
const charWidth = Math.max(1, stringCellWidth(char.value));
|
|
97
|
-
if (current && currentWidth + charWidth > lineWidth) {
|
|
98
|
-
segments.push({ text: current, start: currentStart, end: index });
|
|
99
|
-
current = "";
|
|
100
|
-
currentStart = index;
|
|
101
|
-
currentWidth = 0;
|
|
102
|
-
lineWidth = Math.max(1, continuationWidth);
|
|
103
|
-
}
|
|
104
|
-
current += char.value;
|
|
105
|
-
currentWidth += charWidth;
|
|
106
|
-
index = char.nextIndex;
|
|
107
|
-
}
|
|
108
|
-
segments.push({ text: current, start: currentStart, end: text.length });
|
|
109
|
-
const lineIndex = segmentIndexForCursor(segments, cursor);
|
|
110
|
-
return segments.map((segment, index) => {
|
|
111
|
-
if (index !== lineIndex)
|
|
112
|
-
return { before: segment.text, selected: " ", after: "" };
|
|
113
|
-
const localCursor = Math.max(0, Math.min(cursor - segment.start, segment.text.length));
|
|
114
|
-
const selected = segment.text[localCursor] ?? " ";
|
|
115
|
-
return {
|
|
116
|
-
before: segment.text.slice(0, localCursor),
|
|
117
|
-
selected,
|
|
118
|
-
after: selected === " " ? segment.text.slice(localCursor) : segment.text.slice(localCursor + 1),
|
|
119
|
-
};
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function segmentIndexForCursor(segments, cursor) {
|
|
123
|
-
for (let index = 0; index < segments.length; index += 1) {
|
|
124
|
-
const segment = segments[index];
|
|
125
|
-
if (!segment)
|
|
126
|
-
continue;
|
|
127
|
-
if (cursor >= segment.start && cursor <= segment.end)
|
|
128
|
-
return index;
|
|
129
|
-
}
|
|
130
|
-
return Math.max(0, segments.length - 1);
|
|
131
|
-
}
|
|
132
|
-
function nextTextChar(text, index) {
|
|
133
|
-
const codePoint = text.codePointAt(index);
|
|
134
|
-
if (codePoint === undefined)
|
|
135
|
-
return { value: "", nextIndex: index + 1 };
|
|
136
|
-
const value = String.fromCodePoint(codePoint);
|
|
137
|
-
return { value, nextIndex: index + value.length };
|
|
138
|
-
}
|
|
139
|
-
function stringCellWidth(value) {
|
|
140
|
-
let width = 0;
|
|
141
|
-
for (const char of [...value])
|
|
142
|
-
width += charCellWidth(char);
|
|
143
|
-
return width;
|
|
144
|
-
}
|
|
145
|
-
function charCellWidth(char) {
|
|
146
|
-
const codePoint = char.codePointAt(0);
|
|
147
|
-
if (codePoint === undefined)
|
|
148
|
-
return 0;
|
|
149
|
-
if (codePoint === 0 || codePoint < 32 || (codePoint >= 0x7f && codePoint < 0xa0))
|
|
150
|
-
return 0;
|
|
151
|
-
if (isCombiningMark(codePoint))
|
|
152
|
-
return 0;
|
|
153
|
-
return isFullWidthCodePoint(codePoint) ? 2 : 1;
|
|
154
|
-
}
|
|
155
|
-
function isCombiningMark(codePoint) {
|
|
156
|
-
return ((codePoint >= 0x0300 && codePoint <= 0x036f) ||
|
|
157
|
-
(codePoint >= 0x1ab0 && codePoint <= 0x1aff) ||
|
|
158
|
-
(codePoint >= 0x1dc0 && codePoint <= 0x1dff) ||
|
|
159
|
-
(codePoint >= 0x20d0 && codePoint <= 0x20ff) ||
|
|
160
|
-
(codePoint >= 0xfe20 && codePoint <= 0xfe2f));
|
|
161
|
-
}
|
|
162
|
-
function isFullWidthCodePoint(codePoint) {
|
|
163
|
-
return (codePoint >= 0x1100 && (codePoint <= 0x115f ||
|
|
164
|
-
codePoint === 0x2329 ||
|
|
165
|
-
codePoint === 0x232a ||
|
|
166
|
-
(codePoint >= 0x2e80 && codePoint <= 0xa4cf && codePoint !== 0x303f) ||
|
|
167
|
-
(codePoint >= 0xac00 && codePoint <= 0xd7a3) ||
|
|
168
|
-
(codePoint >= 0xf900 && codePoint <= 0xfaff) ||
|
|
169
|
-
(codePoint >= 0xfe10 && codePoint <= 0xfe19) ||
|
|
170
|
-
(codePoint >= 0xfe30 && codePoint <= 0xfe6f) ||
|
|
171
|
-
(codePoint >= 0xff00 && codePoint <= 0xff60) ||
|
|
172
|
-
(codePoint >= 0xffe0 && codePoint <= 0xffe6) ||
|
|
173
|
-
(codePoint >= 0x1f300 && codePoint <= 0x1f64f) ||
|
|
174
|
-
(codePoint >= 0x1f900 && codePoint <= 0x1f9ff) ||
|
|
175
|
-
(codePoint >= 0x20000 && codePoint <= 0x3fffd)));
|
|
176
|
-
}
|
|
177
|
-
function fitToWidth(value, width) {
|
|
178
|
-
if (value.length === width)
|
|
179
|
-
return value;
|
|
180
|
-
if (value.length > width)
|
|
181
|
-
return value.slice(0, width);
|
|
182
|
-
return value.padEnd(width, " ");
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=prompt-view.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-view.js","sourceRoot":"","sources":["../../src/repl/prompt-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAA+B,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE7K,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC;AAE9B,MAAM,UAAU,UAAU,CACxB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,WAAW,EACwH;IAEhQ,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5E,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAClE,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9E,MAAM,UAAU,GA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AC;QAC9C,CAAC,SAAS,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC;QAC9C,CAAC,SAAS,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC,CAC/C,CACF,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,KAAa;IAC9C,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,GAAG,KAAK;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvD,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { QueryEngine } from "../core/query-engine.js";
|
|
2
|
-
import type { ContextMetrics } from "../types/events.js";
|
|
3
|
-
import type { ModelUsage } from "../model/model-gateway.js";
|
|
4
|
-
import type { ModelProviderName } from "../model/config.js";
|
|
5
|
-
import type { SessionSummary } from "../session/session-store.js";
|
|
6
|
-
import type { SecretMetadata } from "../secrets/secret-types.js";
|
|
7
|
-
import type { SkillDescriptor } from "../skills/skill-tool.js";
|
|
8
|
-
import type { ClipboardImagePayload } from "./clipboard.js";
|
|
9
|
-
export interface UiLine {
|
|
10
|
-
id: number;
|
|
11
|
-
kind: "system" | "user" | "assistant" | "thinking" | "tool" | "error" | "meta";
|
|
12
|
-
text: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
bodyTitle?: string;
|
|
15
|
-
titleStatus?: "success" | "failure";
|
|
16
|
-
format?: "markdown" | "ansi" | "plain";
|
|
17
|
-
previewStyle?: "summary";
|
|
18
|
-
summaryMaxLines?: number;
|
|
19
|
-
live?: boolean;
|
|
20
|
-
pendingReplacement?: boolean;
|
|
21
|
-
renderedKey?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface UiStatus {
|
|
24
|
-
phase: string;
|
|
25
|
-
detail?: string;
|
|
26
|
-
metrics?: ContextMetrics;
|
|
27
|
-
usage?: ModelUsage;
|
|
28
|
-
streamedOutputTokens: number;
|
|
29
|
-
activityTick: number;
|
|
30
|
-
inputTokenUpdatedAt?: number;
|
|
31
|
-
outputTokenUpdatedAt?: number;
|
|
32
|
-
retryCooldownUntil?: number;
|
|
33
|
-
}
|
|
34
|
-
export interface PagedBrowserState<TItem> {
|
|
35
|
-
items: TItem[];
|
|
36
|
-
pageSize: number;
|
|
37
|
-
pageIndex: number;
|
|
38
|
-
selectedIndex: number;
|
|
39
|
-
}
|
|
40
|
-
export interface SessionsBrowserState extends PagedBrowserState<SessionSummary> {
|
|
41
|
-
sessions: SessionSummary[];
|
|
42
|
-
runningSessionIds: string[];
|
|
43
|
-
}
|
|
44
|
-
export interface SkillsBrowserState extends PagedBrowserState<SkillDescriptor> {
|
|
45
|
-
skills: SkillDescriptor[];
|
|
46
|
-
}
|
|
47
|
-
export interface SecretsBrowserState extends PagedBrowserState<SecretMetadata> {
|
|
48
|
-
secrets: SecretMetadata[];
|
|
49
|
-
}
|
|
50
|
-
export interface BackgroundSessionRun {
|
|
51
|
-
sessionId: string;
|
|
52
|
-
title?: string;
|
|
53
|
-
reason: string;
|
|
54
|
-
startedAt: number;
|
|
55
|
-
engine: QueryEngine;
|
|
56
|
-
abortController: AbortController;
|
|
57
|
-
promise: Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
export interface ClipboardAttachment {
|
|
60
|
-
id: number;
|
|
61
|
-
kind: "image" | "text";
|
|
62
|
-
label: string;
|
|
63
|
-
text?: string;
|
|
64
|
-
image?: ClipboardImagePayload;
|
|
65
|
-
}
|
|
66
|
-
export type LoginProviderName = ModelProviderName;
|
|
67
|
-
export type LoginStep = "provider" | "fields";
|
|
68
|
-
export interface LoginFieldDefinition {
|
|
69
|
-
key: string;
|
|
70
|
-
label: string;
|
|
71
|
-
envKey: string;
|
|
72
|
-
scope: "provider" | "shared";
|
|
73
|
-
required?: boolean;
|
|
74
|
-
secret?: boolean;
|
|
75
|
-
placeholder?: string;
|
|
76
|
-
options?: readonly string[];
|
|
77
|
-
}
|
|
78
|
-
export interface LoginFormState {
|
|
79
|
-
step: LoginStep;
|
|
80
|
-
providers: LoginProviderName[];
|
|
81
|
-
selectedProviderIndex: number;
|
|
82
|
-
provider: LoginProviderName;
|
|
83
|
-
selectedFieldIndex: number;
|
|
84
|
-
cursor: number;
|
|
85
|
-
values: Record<string, string>;
|
|
86
|
-
envPath: string;
|
|
87
|
-
legacyProvider?: LoginProviderName;
|
|
88
|
-
}
|
package/dist/repl/repl-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repl-types.js","sourceRoot":"","sources":["../../src/repl/repl-types.ts"],"names":[],"mappings":""}
|
package/dist/repl/runtime.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { QueryEngine } from "../core/query-engine.js";
|
|
2
|
-
import { type ModelProviderName } from "../model/config.js";
|
|
3
|
-
import { CommunicationLogger, LoggingModelGateway } from "../model/communication-logger.js";
|
|
4
|
-
import type { ReasoningConfig } from "../model/model-gateway.js";
|
|
5
|
-
import { ToolRegistry } from "../tools/registry.js";
|
|
6
|
-
import { SecretStore } from "../secrets/secret-store.js";
|
|
7
|
-
import { type AgentToolRuntime } from "../agents/agent-tool.js";
|
|
8
|
-
import { AgentActivityStore } from "../agents/agent-activity.js";
|
|
9
|
-
import { TaskStore } from "../tasks/task-store.js";
|
|
10
|
-
import type { ContextMetrics } from "../types/events.js";
|
|
11
|
-
import { type SkillCatalog } from "../skills/skill-tool.js";
|
|
12
|
-
import { SessionUsageTracker } from "./usage.js";
|
|
13
|
-
import { ReplForegroundExecDetachRegistry } from "./foreground-exec.js";
|
|
14
|
-
export interface ReplRuntime {
|
|
15
|
-
engine: QueryEngine;
|
|
16
|
-
communicationLogger: CommunicationLogger;
|
|
17
|
-
modelGateway: LoggingModelGateway;
|
|
18
|
-
agentRuntime: AgentToolRuntime;
|
|
19
|
-
usage: SessionUsageTracker;
|
|
20
|
-
taskStore: TaskStore;
|
|
21
|
-
agentActivityStore: AgentActivityStore;
|
|
22
|
-
foregroundExecDetach: ReplForegroundExecDetachRegistry;
|
|
23
|
-
tools: ToolRegistry;
|
|
24
|
-
skills: SkillCatalog;
|
|
25
|
-
secretStore: SecretStore;
|
|
26
|
-
skillWorkspaceRoot: string;
|
|
27
|
-
initialMetrics: ContextMetrics;
|
|
28
|
-
defaultReasoning?: ReasoningConfig | null;
|
|
29
|
-
envPath: string;
|
|
30
|
-
envNotice?: string;
|
|
31
|
-
}
|
|
32
|
-
export declare function createRuntime(): Promise<ReplRuntime>;
|
|
33
|
-
export declare function syncImageGenerationTool(runtime: ReplRuntime, provider: ModelProviderName | undefined): void;
|