@prestyj/cli 4.3.164 → 4.3.200
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/cli.js +106 -27
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session.d.ts +50 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +175 -20
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agents.d.ts +6 -1
- package/dist/core/agents.d.ts.map +1 -1
- package/dist/core/agents.js +112 -3
- package/dist/core/agents.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +20 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/claude-code-version.d.ts +10 -0
- package/dist/core/claude-code-version.d.ts.map +1 -0
- package/dist/core/claude-code-version.js +106 -0
- package/dist/core/claude-code-version.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +13 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +20 -1
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.js +12 -1
- package/dist/core/compaction/compactor.test.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-registry.d.ts +30 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +41 -26
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-registry.test.d.ts +2 -0
- package/dist/core/model-registry.test.d.ts.map +1 -0
- package/dist/core/model-registry.test.js +19 -0
- package/dist/core/model-registry.test.js.map +1 -0
- package/dist/core/oauth/anthropic.d.ts.map +1 -1
- package/dist/core/oauth/anthropic.js +64 -42
- package/dist/core/oauth/anthropic.js.map +1 -1
- package/dist/core/oauth/openai.js +1 -1
- package/dist/core/oauth/openai.js.map +1 -1
- package/dist/core/prompt-commands.d.ts.map +1 -1
- package/dist/core/prompt-commands.js +480 -100
- package/dist/core/prompt-commands.js.map +1 -1
- package/dist/core/prompt-commands.test.d.ts +2 -0
- package/dist/core/prompt-commands.test.d.ts.map +1 -0
- package/dist/core/prompt-commands.test.js +33 -0
- package/dist/core/prompt-commands.test.js.map +1 -0
- package/dist/core/repomap-context.d.ts +11 -0
- package/dist/core/repomap-context.d.ts.map +1 -0
- package/dist/core/repomap-context.js +68 -0
- package/dist/core/repomap-context.js.map +1 -0
- package/dist/core/repomap-context.test.d.ts +2 -0
- package/dist/core/repomap-context.test.d.ts.map +1 -0
- package/dist/core/repomap-context.test.js +47 -0
- package/dist/core/repomap-context.test.js.map +1 -0
- package/dist/core/repomap.d.ts +74 -0
- package/dist/core/repomap.d.ts.map +1 -0
- package/dist/core/repomap.js +897 -0
- package/dist/core/repomap.js.map +1 -0
- package/dist/core/repomap.test.d.ts +2 -0
- package/dist/core/repomap.test.d.ts.map +1 -0
- package/dist/core/repomap.test.js +444 -0
- package/dist/core/repomap.test.js.map +1 -0
- package/dist/core/session-compaction.d.ts +15 -0
- package/dist/core/session-compaction.d.ts.map +1 -0
- package/dist/core/session-compaction.js +31 -0
- package/dist/core/session-compaction.js.map +1 -0
- package/dist/core/session-compaction.test.d.ts +2 -0
- package/dist/core/session-compaction.test.d.ts.map +1 -0
- package/dist/core/session-compaction.test.js +70 -0
- package/dist/core/session-compaction.test.js.map +1 -0
- package/dist/core/settings-manager.d.ts +3 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +6 -5
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +15 -14
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/style-packs/index.d.ts.map +1 -1
- package/dist/core/style-packs/index.js +8 -9
- package/dist/core/style-packs/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +12 -6
- package/dist/interactive.js.map +1 -1
- package/dist/modes/json-mode.d.ts +7 -0
- package/dist/modes/json-mode.d.ts.map +1 -1
- package/dist/modes/json-mode.js +9 -1
- package/dist/modes/json-mode.js.map +1 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +105 -108
- package/dist/system-prompt.js.map +1 -1
- package/dist/system-prompt.test.d.ts +2 -0
- package/dist/system-prompt.test.d.ts.map +1 -0
- package/dist/system-prompt.test.js +107 -0
- package/dist/system-prompt.test.js.map +1 -0
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +1 -0
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/edit-diff.d.ts +66 -1
- package/dist/tools/edit-diff.d.ts.map +1 -1
- package/dist/tools/edit-diff.js +208 -10
- package/dist/tools/edit-diff.js.map +1 -1
- package/dist/tools/edit-diff.test.js +175 -15
- package/dist/tools/edit-diff.test.js.map +1 -1
- package/dist/tools/edit.d.ts +3 -1
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +190 -44
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/edit.test.js +392 -3
- package/dist/tools/edit.test.js.map +1 -1
- package/dist/tools/enter-plan.d.ts.map +1 -1
- package/dist/tools/enter-plan.js +1 -0
- package/dist/tools/enter-plan.js.map +1 -1
- package/dist/tools/exit-plan.d.ts.map +1 -1
- package/dist/tools/exit-plan.js +1 -0
- package/dist/tools/exit-plan.js.map +1 -1
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/prompt-hints.d.ts.map +1 -1
- package/dist/tools/prompt-hints.js +6 -4
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/read.d.ts +1 -1
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +2 -1
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/subagent.d.ts +1 -1
- package/dist/tools/subagent.d.ts.map +1 -1
- package/dist/tools/subagent.js +55 -2
- package/dist/tools/subagent.js.map +1 -1
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +1 -0
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/web-fetch.d.ts +1 -0
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +96 -6
- package/dist/tools/web-fetch.js.map +1 -1
- package/dist/tools/web-fetch.test.d.ts +2 -0
- package/dist/tools/web-fetch.test.d.ts.map +1 -0
- package/dist/tools/web-fetch.test.js +90 -0
- package/dist/tools/web-fetch.test.js.map +1 -0
- package/dist/tools/web-search.d.ts +1 -0
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +167 -27
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/web-search.test.d.ts +2 -0
- package/dist/tools/web-search.test.d.ts.map +1 -0
- package/dist/tools/web-search.test.js +119 -0
- package/dist/tools/web-search.test.js.map +1 -0
- package/dist/tools/write.d.ts +1 -1
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +3 -1
- package/dist/tools/write.js.map +1 -1
- package/dist/tools/write.test.js +23 -0
- package/dist/tools/write.test.js.map +1 -1
- package/dist/ui/App.d.ts +54 -5
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +533 -241
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/activity-phrases.d.ts +2 -1
- package/dist/ui/activity-phrases.d.ts.map +1 -1
- package/dist/ui/activity-phrases.js +11 -1
- package/dist/ui/activity-phrases.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.d.ts +15 -1
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +143 -44
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.test.d.ts +2 -0
- package/dist/ui/components/ActivityIndicator.test.d.ts.map +1 -0
- package/dist/ui/components/ActivityIndicator.test.js +40 -0
- package/dist/ui/components/ActivityIndicator.test.js.map +1 -0
- package/dist/ui/components/AnimationContext.d.ts +8 -2
- package/dist/ui/components/AnimationContext.d.ts.map +1 -1
- package/dist/ui/components/AnimationContext.js +94 -16
- package/dist/ui/components/AnimationContext.js.map +1 -1
- package/dist/ui/components/AssistantMessage.js +1 -1
- package/dist/ui/components/AssistantMessage.js.map +1 -1
- package/dist/ui/components/CompactionNotice.d.ts +5 -1
- package/dist/ui/components/CompactionNotice.d.ts.map +1 -1
- package/dist/ui/components/CompactionNotice.js +4 -6
- package/dist/ui/components/CompactionNotice.js.map +1 -1
- package/dist/ui/components/Footer.d.ts +10 -2
- package/dist/ui/components/Footer.d.ts.map +1 -1
- package/dist/ui/components/Footer.js +45 -8
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/components/InputArea.d.ts.map +1 -1
- package/dist/ui/components/InputArea.js +76 -28
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/ServerToolExecution.d.ts +1 -0
- package/dist/ui/components/ServerToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ServerToolExecution.js +21 -2
- package/dist/ui/components/ServerToolExecution.js.map +1 -1
- package/dist/ui/components/Spinner.d.ts +3 -1
- package/dist/ui/components/Spinner.d.ts.map +1 -1
- package/dist/ui/components/Spinner.js +10 -4
- package/dist/ui/components/Spinner.js.map +1 -1
- package/dist/ui/components/StreamingArea.js +1 -1
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
- package/dist/ui/components/SubAgentPanel.js +3 -4
- package/dist/ui/components/SubAgentPanel.js.map +1 -1
- package/dist/ui/components/ToolExecution.d.ts +2 -0
- package/dist/ui/components/ToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolExecution.js +24 -5
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolGroupExecution.js +23 -2
- package/dist/ui/components/ToolGroupExecution.js.map +1 -1
- package/dist/ui/components/ToolUseLoader.d.ts +4 -2
- package/dist/ui/components/ToolUseLoader.d.ts.map +1 -1
- package/dist/ui/components/ToolUseLoader.js +3 -3
- package/dist/ui/components/ToolUseLoader.js.map +1 -1
- package/dist/ui/components/index.d.ts +1 -2
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/index.js +1 -2
- package/dist/ui/components/index.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +4 -1
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +110 -13
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useBlink.d.ts.map +1 -1
- package/dist/ui/hooks/useBlink.js +3 -4
- package/dist/ui/hooks/useBlink.js.map +1 -1
- package/dist/ui/hooks/useTerminalSize.d.ts +12 -3
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -1
- package/dist/ui/hooks/useTerminalSize.js +16 -1
- package/dist/ui/hooks/useTerminalSize.js.map +1 -1
- package/dist/ui/pixel.js +1 -1
- package/dist/ui/render.d.ts +44 -5
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +56 -8
- package/dist/ui/render.js.map +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +2 -0
- package/dist/utils/error-handler.js.map +1 -1
- package/package.json +10 -7
- package/dist/ui/buddy/Buddy.d.ts +0 -15
- package/dist/ui/buddy/Buddy.d.ts.map +0 -1
- package/dist/ui/buddy/Buddy.js +0 -118
- package/dist/ui/buddy/Buddy.js.map +0 -1
- package/dist/ui/buddy/gacha.d.ts +0 -8
- package/dist/ui/buddy/gacha.d.ts.map +0 -1
- package/dist/ui/buddy/gacha.js +0 -94
- package/dist/ui/buddy/gacha.js.map +0 -1
- package/dist/ui/buddy/species.d.ts +0 -52
- package/dist/ui/buddy/species.d.ts.map +0 -1
- package/dist/ui/buddy/species.js +0 -257
- package/dist/ui/buddy/species.js.map +0 -1
- package/dist/ui/components/ThinkingIndicator.d.ts +0 -6
- package/dist/ui/components/ThinkingIndicator.d.ts.map +0 -1
- package/dist/ui/components/ThinkingIndicator.js +0 -145
- package/dist/ui/components/ThinkingIndicator.js.map +0 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
interface CompactionSpinnerProps {
|
|
2
|
+
/** Disable decorative ticks so terminal scrollback remains usable during active runs. */
|
|
3
|
+
staticDisplay?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function CompactionSpinner({ staticDisplay }: CompactionSpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
2
6
|
interface CompactionDoneProps {
|
|
3
7
|
originalCount: number;
|
|
4
8
|
newCount: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactionNotice.d.ts","sourceRoot":"","sources":["../../../src/ui/components/CompactionNotice.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"CompactionNotice.d.ts","sourceRoot":"","sources":["../../../src/ui/components/CompactionNotice.tsx"],"names":[],"mappings":"AAkBA,UAAU,sBAAsB;IAC9B,yFAAyF;IACzF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,aAAqB,EAAE,EAAE,sBAAsB,2CAwBlF;AAID,UAAU,mBAAmB;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,WAAW,GACZ,EAAE,mBAAmB,2CA6BrB"}
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Text, Box } from "ink";
|
|
4
4
|
import { useTheme } from "../theme/theme.js";
|
|
5
5
|
import { SPINNER_FRAMES, SPINNER_INTERVAL } from "../spinner-frames.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useFocusedAnimation, deriveFrame } from "./AnimationContext.js";
|
|
7
7
|
const ACCENT_COLOR = "#fbbf24"; // warning/amber
|
|
8
8
|
function formatTokenCount(n) {
|
|
9
9
|
if (n >= 1000) {
|
|
@@ -12,12 +12,10 @@ function formatTokenCount(n) {
|
|
|
12
12
|
}
|
|
13
13
|
return String(n);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
export function CompactionSpinner() {
|
|
15
|
+
export function CompactionSpinner({ staticDisplay = false }) {
|
|
17
16
|
const theme = useTheme();
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const frame = deriveFrame(tick, SPINNER_INTERVAL, SPINNER_FRAMES.length);
|
|
17
|
+
const { active: animationActive, tick } = useFocusedAnimation(!staticDisplay);
|
|
18
|
+
const frame = animationActive ? deriveFrame(tick, SPINNER_INTERVAL, SPINNER_FRAMES.length) : 0;
|
|
21
19
|
return (_jsx(Box, { marginTop: 1, children: _jsxs(Box, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, borderLeftColor: ACCENT_COLOR, paddingLeft: 1, children: [_jsxs(Text, { color: ACCENT_COLOR, children: [SPINNER_FRAMES[frame], " "] }), _jsx(Text, { color: theme.textMuted, italic: true, children: "Compacting conversation" }), _jsx(Text, { color: theme.textDim, children: "..." })] }) }));
|
|
22
20
|
}
|
|
23
21
|
export function CompactionDone({ originalCount, newCount, tokensBefore, tokensAfter, }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactionNotice.js","sourceRoot":"","sources":["../../../src/ui/components/CompactionNotice.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAA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I,IAAC,KAAK,EAAE,KAAK,CAAC,SAAS,uCAA+B,IACvD,EACN,KAAC,GAAG,IAAC,UAAU,EAAE,CAAC,YAChB,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,aACvB,aAAa,cAAK,QAAQ,uBAAc,gBAAgB,CAAC,YAAY,CAAC,aAAI,GAAG,EAC7E,gBAAgB,CAAC,WAAW,CAAC,qBAAY,SAAS,mBAC9C,GACH,IACF,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import type { ThinkingLevel } from "@prestyj/ai";
|
|
2
|
+
import { type ContextWindowOptions } from "../../core/model-registry.js";
|
|
1
3
|
interface FooterProps {
|
|
2
4
|
model: string;
|
|
3
5
|
tokensIn: number;
|
|
6
|
+
contextWindowOptions?: ContextWindowOptions;
|
|
4
7
|
cwd: string;
|
|
5
8
|
gitBranch?: string | null;
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Active thinking tier, or `undefined` when thinking is off. The footer
|
|
11
|
+
* renders the tier verbatim (`Thinking xhigh`) and color-codes by power.
|
|
12
|
+
* `xhigh` additionally shimmers to signal it's the top tier.
|
|
13
|
+
*/
|
|
14
|
+
thinkingLevel?: ThinkingLevel;
|
|
7
15
|
planMode?: boolean;
|
|
8
16
|
exitPending?: boolean;
|
|
9
17
|
/** Hide the plan-mode toggle entirely (for products that don't have plan mode). */
|
|
@@ -24,6 +32,6 @@ interface FooterProps {
|
|
|
24
32
|
*/
|
|
25
33
|
statusBelow?: boolean;
|
|
26
34
|
}
|
|
27
|
-
export declare function Footer({ model, tokensIn, cwd, gitBranch,
|
|
35
|
+
export declare function Footer({ model, tokensIn, contextWindowOptions, cwd, gitBranch, thinkingLevel, planMode, exitPending, hidePlan, statusLabel, statusColor, hideCwd, hideGitBranch, statusBelow, }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
28
36
|
export {};
|
|
29
37
|
//# sourceMappingURL=Footer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Footer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/ui/components/Footer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAI3F,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA8ED,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,oBAAoB,EACpB,GAAG,EACH,SAAS,EACT,aAAa,EACb,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EACX,OAAO,EACP,aAAa,EACb,WAAW,GACZ,EAAE,WAAW,2CAiOb"}
|
|
@@ -5,6 +5,7 @@ import { useTheme } from "../theme/theme.js";
|
|
|
5
5
|
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
6
6
|
import { getContextWindow } from "../../core/model-registry.js";
|
|
7
7
|
import { PARTIAL_BLOCKS, LIGHT_SHADE } from "../constants/figures.js";
|
|
8
|
+
import { useFocusedAnimation, useReducedMotion } from "./AnimationContext.js";
|
|
8
9
|
// Model ID → short display name
|
|
9
10
|
const MODEL_SHORT_NAMES = {
|
|
10
11
|
"claude-opus-4-7": "Opus",
|
|
@@ -12,17 +13,15 @@ const MODEL_SHORT_NAMES = {
|
|
|
12
13
|
"claude-haiku-4-5": "Haiku",
|
|
13
14
|
"claude-haiku-4-5-20251001": "Haiku",
|
|
14
15
|
"gpt-5.5": "GPT-5.5",
|
|
15
|
-
"gpt-5.5-pro": "GPT-5.5 Pro",
|
|
16
16
|
"gpt-5.4": "GPT-5.4",
|
|
17
17
|
"gpt-5.4-mini": "GPT-5.4 Mini",
|
|
18
18
|
"gpt-5.3-codex": "GPT-5.3 Codex",
|
|
19
|
-
"codex-mini-latest": "Codex Mini",
|
|
20
19
|
};
|
|
21
20
|
function getShortModelName(model) {
|
|
22
21
|
return MODEL_SHORT_NAMES[model] ?? model;
|
|
23
22
|
}
|
|
24
|
-
function getContextPercent(model, tokensIn) {
|
|
25
|
-
const limit = getContextWindow(model);
|
|
23
|
+
function getContextPercent(model, tokensIn, options) {
|
|
24
|
+
const limit = getContextWindow(model, options);
|
|
26
25
|
if (!limit || tokensIn === 0)
|
|
27
26
|
return 0;
|
|
28
27
|
return Math.round((tokensIn / limit) * 100);
|
|
@@ -34,13 +33,46 @@ function getContextColor(pct, theme) {
|
|
|
34
33
|
return theme.warning;
|
|
35
34
|
return theme.success;
|
|
36
35
|
}
|
|
37
|
-
|
|
36
|
+
// ── Thinking-level visual treatment ─────────────────────────
|
|
37
|
+
//
|
|
38
|
+
// Higher tier = warmer / more saturated color. `xhigh` adds a moving shimmer
|
|
39
|
+
// so the top tier reads as visibly "on full power" at a glance.
|
|
40
|
+
const XHIGH_COLOR = "#db2777"; // hot pink — the visible "max power" tone
|
|
41
|
+
const XHIGH_SHIMMER_COLOR = "#f472b6"; // brighter pink that rides the shimmer
|
|
42
|
+
const SHIMMER_WIDTH = 2;
|
|
43
|
+
function getThinkingColor(level, theme) {
|
|
44
|
+
if (!level)
|
|
45
|
+
return theme.textDim;
|
|
46
|
+
if (level === "low")
|
|
47
|
+
return theme.textMuted;
|
|
48
|
+
if (level === "medium")
|
|
49
|
+
return theme.accent;
|
|
50
|
+
if (level === "high")
|
|
51
|
+
return theme.warning;
|
|
52
|
+
return XHIGH_COLOR; // xhigh
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Per-char shimmer for the xhigh thinking label. A bright spot rides across
|
|
56
|
+
* the text; chars within `SHIMMER_WIDTH` of the spot render bright/bold, the
|
|
57
|
+
* rest stay in the base color. Subscribes to the global animation tick so
|
|
58
|
+
* the timer only runs while xhigh is visible.
|
|
59
|
+
*/
|
|
60
|
+
const XhighShimmer = ({ text, active = true }) => {
|
|
61
|
+
const { active: animationActive, tick } = useFocusedAnimation(active);
|
|
62
|
+
const cycle = text.length + SHIMMER_WIDTH * 2;
|
|
63
|
+
const pos = animationActive ? (tick % cycle) - SHIMMER_WIDTH : -SHIMMER_WIDTH;
|
|
64
|
+
return (_jsx(Text, { children: text.split("").map((ch, i) => {
|
|
65
|
+
const isBright = Math.abs(i - pos) <= SHIMMER_WIDTH;
|
|
66
|
+
return (_jsx(Text, { color: isBright ? XHIGH_SHIMMER_COLOR : XHIGH_COLOR, bold: isBright, children: ch }, i));
|
|
67
|
+
}) }));
|
|
68
|
+
};
|
|
69
|
+
export function Footer({ model, tokensIn, contextWindowOptions, cwd, gitBranch, thinkingLevel, planMode, exitPending, hidePlan, statusLabel, statusColor, hideCwd, hideGitBranch, statusBelow, }) {
|
|
38
70
|
const theme = useTheme();
|
|
39
71
|
const { columns } = useTerminalSize();
|
|
40
72
|
// Show only the current directory name
|
|
41
73
|
const parts = cwd.split("/").filter(Boolean);
|
|
42
74
|
const displayPath = parts.length > 0 ? parts[parts.length - 1] : cwd;
|
|
43
|
-
const contextPct = getContextPercent(model, tokensIn);
|
|
75
|
+
const contextPct = getContextPercent(model, tokensIn, contextWindowOptions);
|
|
44
76
|
const contextColor = getContextColor(contextPct, theme);
|
|
45
77
|
const sep = _jsx(Text, { color: theme.border, children: " \u2502 " });
|
|
46
78
|
const modelName = getShortModelName(model);
|
|
@@ -63,7 +95,12 @@ export function Footer({ model, tokensIn, cwd, gitBranch, thinkingEnabled, planM
|
|
|
63
95
|
}
|
|
64
96
|
// Plan/Thinking labels
|
|
65
97
|
const planText = planMode ? "Plan on" : "Plan off";
|
|
66
|
-
|
|
98
|
+
// Show the actual tier when on (`Thinking xhigh`) so users see what they're
|
|
99
|
+
// paying for. Off is the only state that stays generic.
|
|
100
|
+
const thinkingText = thinkingLevel ? `Thinking ${thinkingLevel}` : "Thinking off";
|
|
101
|
+
const thinkingColor = getThinkingColor(thinkingLevel, theme);
|
|
102
|
+
const reducedMotion = useReducedMotion();
|
|
103
|
+
const shimmerXhigh = thinkingLevel === "xhigh" && !reducedMotion;
|
|
67
104
|
const showPlan = !hidePlan;
|
|
68
105
|
// Calculate whether everything fits on one line
|
|
69
106
|
const leftLen = displayPath.length + 2 + (gitBranch ? gitBranch.length + 5 : 0);
|
|
@@ -83,7 +120,7 @@ export function Footer({ model, tokensIn, cwd, gitBranch, thinkingEnabled, planM
|
|
|
83
120
|
? "\u2026" + displayPath.slice(displayPath.length - maxPath + 1)
|
|
84
121
|
: displayPath;
|
|
85
122
|
// Shared right-side content
|
|
86
|
-
const rightContent = (_jsxs(_Fragment, { children: [_jsx(Text, { children: barChars }), _jsxs(Text, { color: contextColor, children: [" ", contextPct, "%"] }), sep, _jsx(Text, { color: theme.primary, bold: true, children: modelName }), showPlan ? (_jsxs(_Fragment, { children: [sep, _jsx(Text, { color: planMode ? theme.planPrimary : theme.textDim, children: planText })] })) : null, sep, _jsx(Text, { color:
|
|
123
|
+
const rightContent = (_jsxs(_Fragment, { children: [_jsx(Text, { children: barChars }), _jsxs(Text, { color: contextColor, children: [" ", contextPct, "%"] }), sep, _jsx(Text, { color: theme.primary, bold: true, children: modelName }), showPlan ? (_jsxs(_Fragment, { children: [sep, _jsx(Text, { color: planMode ? theme.planPrimary : theme.textDim, children: planText })] })) : null, sep, shimmerXhigh ? (_jsx(XhighShimmer, { text: thinkingText, active: !exitPending })) : (_jsx(Text, { color: thinkingColor, bold: thinkingLevel === "high", children: thinkingText }))] }));
|
|
87
124
|
if (exitPending) {
|
|
88
125
|
return (_jsx(Box, { paddingLeft: 1, paddingRight: 1, width: columns, children: _jsx(Text, { color: theme.warning, children: "Press Ctrl+C again to exit" }) }));
|
|
89
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../src/ui/components/Footer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../src/ui/components/Footer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAA6B,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAmC9E,gCAAgC;AAChC,MAAM,iBAAiB,GAA2B;IAChD,iBAAiB,EAAE,MAAM;IACzB,mBAAmB,EAAE,QAAQ;IAC7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O,aACxE,cAAc,IAAI,CACjB,MAAC,GAAG,eACD,OAAO,IAAI,CACV,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAC,UAAU,YACxC,SAAS,GACL,CACR,EACA,aAAa,IAAI,CAChB,8BACG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EACrB,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAC,UAAU,aAC1C,SAAS,EACT,SAAS,IACL,IACN,CACJ,EACA,WAAW,IAAI,CACd,8BACG,OAAO,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EACtC,KAAC,IAAI,IAAC,KAAK,EAAE,WAAW,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,EAAC,UAAU,YACpD,WAAW,GACP,IACN,CACJ,IACG,CACP,EACD,KAAC,GAAG,cAAE,YAAY,GAAO,IACrB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputArea.d.ts","sourceRoot":"","sources":["../../../src/ui/components/InputArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAMpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAoC,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"InputArea.d.ts","sourceRoot":"","sources":["../../../src/ui/components/InputArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAMpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAoC,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAuLhG,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,KAAK,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IAChF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B;qEACiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;;;;;;;;OASG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AAkDD,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,OAAO,EACP,QAAgB,EAChB,QAAe,EACf,WAAW,EACX,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,GAAG,EACH,QAAa,EACb,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,KAAK,GACN,EAAE,cAAc,2CA+0ChB"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import React, { useState, useRef, useEffect, useMemo } from "react";
|
|
3
3
|
import { Text, Box, useInput, useStdin } from "ink";
|
|
4
4
|
import { useTheme } from "../theme/theme.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useFocusedAnimation, deriveFrame } from "./AnimationContext.js";
|
|
6
6
|
import { useTerminalSize } from "../hooks/useTerminalSize.js";
|
|
7
7
|
import { extractImagePaths, readImageFile, getClipboardImage } from "../../utils/image.js";
|
|
8
8
|
import { SlashCommandMenu, filterCommands } from "./SlashCommandMenu.js";
|
|
@@ -27,6 +27,9 @@ const DISABLE_MOUSE = "\x1b[?1006l\x1b[?1000l";
|
|
|
27
27
|
function isMouseEscapeSequence(input) {
|
|
28
28
|
return input.includes("[<") && /\[<\d+;\d+;\d+[Mm]/.test(input);
|
|
29
29
|
}
|
|
30
|
+
function stripTerminalFocusSequences(input) {
|
|
31
|
+
return input.replaceAll("\x1b[I", "").replaceAll("\x1b[O", "");
|
|
32
|
+
}
|
|
30
33
|
// Option+Arrow escape sequences — terminals send these as raw input strings
|
|
31
34
|
// rather than setting key.meta + key.leftArrow reliably.
|
|
32
35
|
const OPTION_LEFT_SEQUENCES = new Set([
|
|
@@ -270,12 +273,15 @@ export function InputArea({ onSubmit, onAbort, disabled = false, isActive = true
|
|
|
270
273
|
}, [slashFilter]);
|
|
271
274
|
// Border color pulse (when idle/waiting for input)
|
|
272
275
|
const borderPulseColors = useMemo(() => [theme.primary, theme.accent, theme.secondary, theme.accent], [theme.primary, theme.accent, theme.secondary]);
|
|
273
|
-
// Derive border pulse and cursor blink from global animation tick
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
276
|
+
// Derive border pulse and cursor blink from global animation tick.
|
|
277
|
+
// Disable it while the agent owns the terminal; otherwise the idle input's
|
|
278
|
+
// cursor/border animation keeps repainting the live area during long runs,
|
|
279
|
+
// which makes terminal scrollback snap back to the bottom.
|
|
280
|
+
const inputAnimationEnabled = !disabled && isActive;
|
|
281
|
+
const { active: inputAnimationActive, tick } = useFocusedAnimation(inputAnimationEnabled);
|
|
282
|
+
const borderFrame = inputAnimationActive ? deriveFrame(tick, 800, borderPulseColors.length) : 0;
|
|
277
283
|
// Cursor blink: ~530ms period → visible for ~500ms, hidden for ~500ms
|
|
278
|
-
const cursorVisible = !
|
|
284
|
+
const cursorVisible = !inputAnimationActive || deriveFrame(tick, 530, 2) === 0;
|
|
279
285
|
// Auto-detect image paths as they're pasted/typed — debounce so full paste arrives
|
|
280
286
|
const extractingRef = useRef(false);
|
|
281
287
|
useEffect(() => {
|
|
@@ -308,34 +314,71 @@ export function InputArea({ onSubmit, onAbort, disabled = false, isActive = true
|
|
|
308
314
|
}, 300);
|
|
309
315
|
return () => clearTimeout(timer);
|
|
310
316
|
}, [value, cwd, disabled]);
|
|
311
|
-
// Normalize
|
|
312
|
-
// keyboard protocol
|
|
313
|
-
//
|
|
314
|
-
//
|
|
315
|
-
//
|
|
317
|
+
// Normalize Enter/Tab sequences from terminals that don't speak kitty
|
|
318
|
+
// keyboard protocol cleanly. Two cases handled:
|
|
319
|
+
//
|
|
320
|
+
// 1. Numpad Enter (kitty form: ESC[57414u or ESC[57414;Nu) — Ink parses
|
|
321
|
+
// this as "kpenter" rather than "return", so key.return is never set.
|
|
322
|
+
// 2. xterm modifyOtherKeys=2 form: ESC[27;<mod>;<keycode>~ — Terminal.app,
|
|
323
|
+
// older xterms, and some iTerm2 configs send Shift+Enter as
|
|
324
|
+
// ESC[27;2;13~ when the kitty enable request is ignored. Ink can't
|
|
325
|
+
// parse this form and the raw bytes leak into the text input.
|
|
326
|
+
//
|
|
327
|
+
// We wrap the internal event emitter so we can both translate the
|
|
328
|
+
// sequence into something Ink recognises AND swallow the original
|
|
329
|
+
// bytes before Ink's parser sees them.
|
|
316
330
|
const { internal_eventEmitter } = useStdin();
|
|
317
331
|
useEffect(() => {
|
|
318
332
|
if (!isActive || !internal_eventEmitter)
|
|
319
333
|
return;
|
|
320
|
-
// Matches ESC[57414u or ESC[57414;Nu (N = modifier) — numpad Enter
|
|
321
|
-
// in the kitty keyboard protocol.
|
|
322
334
|
// eslint-disable-next-line no-control-regex
|
|
323
335
|
const kpEnterRe = /^\x1b\[57414(;\d+)?u$/;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
336
|
+
// eslint-disable-next-line no-control-regex
|
|
337
|
+
const xtermModifyRe = /^\x1b\[27;(\d+);(\d+)~$/;
|
|
338
|
+
const synthForEnter = (mod) => {
|
|
339
|
+
const hasShift = !!(mod & 1);
|
|
340
|
+
const hasMeta = !!(mod & 10);
|
|
341
|
+
return hasShift ? "\x1b[13;2u" : hasMeta ? "\x1b\r" : "\r";
|
|
342
|
+
};
|
|
343
|
+
const originalEmit = internal_eventEmitter.emit.bind(internal_eventEmitter);
|
|
344
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
345
|
+
const wrappedEmit = (event, ...args) => {
|
|
346
|
+
if (event === "input" && typeof args[0] === "string") {
|
|
347
|
+
const data = args[0];
|
|
348
|
+
const withoutFocusReports = stripTerminalFocusSequences(data);
|
|
349
|
+
if (!withoutFocusReports)
|
|
350
|
+
return true;
|
|
351
|
+
if (kpEnterRe.test(withoutFocusReports)) {
|
|
352
|
+
const modMatch = /;(\d+)u$/.exec(withoutFocusReports);
|
|
353
|
+
const mod = modMatch ? Math.max(0, parseInt(modMatch[1], 10) - 1) : 0;
|
|
354
|
+
return originalEmit("input", synthForEnter(mod));
|
|
355
|
+
}
|
|
356
|
+
const xtermMatch = xtermModifyRe.exec(withoutFocusReports);
|
|
357
|
+
if (xtermMatch) {
|
|
358
|
+
const mod = Math.max(0, parseInt(xtermMatch[1], 10) - 1);
|
|
359
|
+
const keycode = parseInt(xtermMatch[2], 10);
|
|
360
|
+
if (keycode === 13) {
|
|
361
|
+
return originalEmit("input", synthForEnter(mod));
|
|
362
|
+
}
|
|
363
|
+
if (keycode === 9) {
|
|
364
|
+
const hasShift = !!(mod & 1);
|
|
365
|
+
return originalEmit("input", hasShift ? "\x1b[Z" : "\t");
|
|
366
|
+
}
|
|
367
|
+
// Unknown keycode in this form — swallow so the raw bytes
|
|
368
|
+
// don't end up in the text field.
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
if (withoutFocusReports !== data) {
|
|
372
|
+
return originalEmit("input", withoutFocusReports);
|
|
373
|
+
}
|
|
334
374
|
}
|
|
375
|
+
return originalEmit(event, ...args);
|
|
335
376
|
};
|
|
336
|
-
internal_eventEmitter.
|
|
377
|
+
internal_eventEmitter.emit = wrappedEmit;
|
|
337
378
|
return () => {
|
|
338
|
-
internal_eventEmitter.
|
|
379
|
+
if (internal_eventEmitter.emit === wrappedEmit) {
|
|
380
|
+
internal_eventEmitter.emit = originalEmit;
|
|
381
|
+
}
|
|
339
382
|
};
|
|
340
383
|
}, [isActive, internal_eventEmitter]);
|
|
341
384
|
// --- Mouse click-to-position-cursor ---
|
|
@@ -412,8 +455,9 @@ export function InputArea({ onSubmit, onAbort, disabled = false, isActive = true
|
|
|
412
455
|
internal_eventEmitter.emit = (event, ...args) => {
|
|
413
456
|
if (event === "input" && typeof args[0] === "string") {
|
|
414
457
|
const data = args[0];
|
|
415
|
-
// Strip all SGR mouse sequences from the data
|
|
416
|
-
const
|
|
458
|
+
// Strip all terminal focus reports and SGR mouse sequences from the data
|
|
459
|
+
const dataWithoutFocusReports = stripTerminalFocusSequences(data);
|
|
460
|
+
const stripped = dataWithoutFocusReports.replace(SGR_MOUSE_RE_G, "");
|
|
417
461
|
// Process each mouse sequence for click handling
|
|
418
462
|
let match;
|
|
419
463
|
SGR_MOUSE_RE_G.lastIndex = 0;
|
|
@@ -582,9 +626,13 @@ export function InputArea({ onSubmit, onAbort, disabled = false, isActive = true
|
|
|
582
626
|
};
|
|
583
627
|
useInput((input, key) => {
|
|
584
628
|
// Filter out stray mouse escape sequences so they don't get inserted as text
|
|
585
|
-
|
|
629
|
+
const inputWithoutFocusReports = stripTerminalFocusSequences(input);
|
|
630
|
+
if (!inputWithoutFocusReports && input)
|
|
631
|
+
return;
|
|
632
|
+
if (isMouseEscapeSequence(inputWithoutFocusReports))
|
|
586
633
|
return;
|
|
587
634
|
// Reset kill ring accumulation for non-kill keys
|
|
635
|
+
input = inputWithoutFocusReports;
|
|
588
636
|
const isKillKey = key.ctrl && (input === "k" || input === "u" || input === "w");
|
|
589
637
|
if (!isKillKey)
|
|
590
638
|
lastActionWasKill = false;
|