bioscode 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +306 -0
- package/NOTICE +45 -0
- package/README.md +277 -0
- package/dist/auth/index.d.ts +202 -0
- package/dist/brand/index.d.ts +7 -0
- package/dist/brand/loader.d.ts +463 -0
- package/dist/brand/rules.d.ts +25 -0
- package/dist/brand/schema.d.ts +246 -0
- package/dist/bus/bus-event.d.ts +10 -0
- package/dist/bus/global.d.ts +7 -0
- package/dist/bus/index.d.ts +26 -0
- package/dist/cli/auth.d.ts +23 -0
- package/dist/cli/brand.d.ts +6 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/ui.d.ts +26 -0
- package/dist/command/index.d.ts +54 -0
- package/dist/config/config.d.ts +6036 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/markdown.d.ts +415 -0
- package/dist/constants/index.d.ts +6 -0
- package/dist/constants/version.d.ts +5 -0
- package/dist/diff/engine.d.ts +15 -0
- package/dist/diff/index.d.ts +8 -0
- package/dist/diff/types.d.ts +66 -0
- package/dist/file/ignore.d.ts +7 -0
- package/dist/flag/index.d.ts +19 -0
- package/dist/gateway/bridge.d.ts +11 -0
- package/dist/gateway/handlers/llm.d.ts +7 -0
- package/dist/gateway/handlers/permission.d.ts +15 -0
- package/dist/gateway/handlers/session.d.ts +7 -0
- package/dist/gateway/handlers/system.d.ts +7 -0
- package/dist/gateway/handlers/tool.d.ts +7 -0
- package/dist/gateway/index.d.ts +18 -0
- package/dist/gateway/protocol.d.ts +159 -0
- package/dist/gateway/router.d.ts +7 -0
- package/dist/gateway/server.d.ts +24 -0
- package/dist/global/index.d.ts +23 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +34 -0
- package/dist/permission/index.d.ts +2 -0
- package/dist/permission/permission.d.ts +172 -0
- package/dist/permission/types.d.ts +109 -0
- package/dist/project/index.d.ts +3 -0
- package/dist/project/instance.d.ts +33 -0
- package/dist/project/project.d.ts +82 -0
- package/dist/project/state.d.ts +4 -0
- package/dist/prompt/index.d.ts +5 -0
- package/dist/prompt/system.d.ts +29 -0
- package/dist/prompt/template.d.ts +24 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/models.d.ts +14 -0
- package/dist/provider/provider.d.ts +848 -0
- package/dist/provider/types.d.ts +328 -0
- package/dist/server/index.d.ts +21 -0
- package/dist/server/routes/api.d.ts +2 -0
- package/dist/server/routes/auth.d.ts +2 -0
- package/dist/server/routes/events.d.ts +2 -0
- package/dist/server/routes/health.d.ts +2 -0
- package/dist/server/routes/sessions.d.ts +2 -0
- package/dist/server/services/agent.d.ts +40 -0
- package/dist/server/services/permission.d.ts +43 -0
- package/dist/server/sse/emitter.d.ts +57 -0
- package/dist/session/context-cache.d.ts +75 -0
- package/dist/session/context-optimization.d.ts +165 -0
- package/dist/session/index.d.ts +5 -0
- package/dist/session/llm.d.ts +68 -0
- package/dist/session/message-optimizer.d.ts +32 -0
- package/dist/session/session.d.ts +524 -0
- package/dist/session/title-generator.d.ts +11 -0
- package/dist/session/types.d.ts +713 -0
- package/dist/snapshot/index.d.ts +40 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/storage.d.ts +34 -0
- package/dist/theme.d.ts +64 -0
- package/dist/tool/bash.d.ts +19 -0
- package/dist/tool/edit.d.ts +21 -0
- package/dist/tool/glob.d.ts +15 -0
- package/dist/tool/grep.d.ts +20 -0
- package/dist/tool/image.d.ts +22 -0
- package/dist/tool/index.d.ts +11 -0
- package/dist/tool/ls.d.ts +14 -0
- package/dist/tool/read.d.ts +17 -0
- package/dist/tool/registry.d.ts +30 -0
- package/dist/tool/think.d.ts +11 -0
- package/dist/tool/todo.d.ts +76 -0
- package/dist/tool/tool.d.ts +65 -0
- package/dist/tool/webfetch.d.ts +15 -0
- package/dist/tool/write.d.ts +16 -0
- package/dist/tui/App.d.ts +10 -0
- package/dist/tui/components/Header.d.ts +13 -0
- package/dist/tui/components/LoadingIndicator.d.ts +26 -0
- package/dist/tui/components/Message/AssistantMessage.d.ts +11 -0
- package/dist/tui/components/Message/ReasoningMessage.d.ts +21 -0
- package/dist/tui/components/Message/ToolCallMessage.d.ts +26 -0
- package/dist/tui/components/Message/UserMessage.d.ts +12 -0
- package/dist/tui/components/Message/index.d.ts +16 -0
- package/dist/tui/components/PermissionPrompt.d.ts +6 -0
- package/dist/tui/components/PromptInput.d.ts +33 -0
- package/dist/tui/components/REPL.d.ts +22 -0
- package/dist/tui/components/Spinner.d.ts +13 -0
- package/dist/tui/components/StatusBar.d.ts +13 -0
- package/dist/tui/components/TodoList.d.ts +17 -0
- package/dist/tui/components/WelcomeBox.d.ts +13 -0
- package/dist/tui/components/dialogs/DiagnosticsPanel.d.ts +12 -0
- package/dist/tui/components/dialogs/HelpPanel.d.ts +11 -0
- package/dist/tui/components/dialogs/ModelSelector.d.ts +14 -0
- package/dist/tui/components/dialogs/PermissionPrompt.d.ts +17 -0
- package/dist/tui/components/dialogs/SessionPicker.d.ts +20 -0
- package/dist/tui/components/dialogs/index.d.ts +10 -0
- package/dist/tui/components/diff/DiffHunk.d.ts +12 -0
- package/dist/tui/components/diff/DiffLine.d.ts +14 -0
- package/dist/tui/components/diff/DiffStats.d.ts +12 -0
- package/dist/tui/components/diff/DiffView.d.ts +15 -0
- package/dist/tui/components/diff/index.d.ts +9 -0
- package/dist/tui/hooks/useAnimatedLabel.d.ts +12 -0
- package/dist/tui/hooks/usePermission.d.ts +34 -0
- package/dist/tui/hooks/useTermWidth.d.ts +13 -0
- package/dist/tui/index.d.ts +20 -0
- package/dist/tui/theme.d.ts +8 -0
- package/dist/tui/utils/Cursor.d.ts +37 -0
- package/dist/tui/utils/clipboard.d.ts +3 -0
- package/dist/tui/utils/keypress.d.ts +39 -0
- package/dist/tui/utils/markdown.d.ts +13 -0
- package/dist/tui/utils/openContent.d.ts +22 -0
- package/dist/util/ascii.d.ts +22 -0
- package/dist/util/bell.d.ts +14 -0
- package/dist/util/color.d.ts +28 -0
- package/dist/util/context.d.ts +10 -0
- package/dist/util/debug.d.ts +51 -0
- package/dist/util/error.d.ts +294 -0
- package/dist/util/example-commands.d.ts +18 -0
- package/dist/util/filesystem.d.ts +17 -0
- package/dist/util/id.d.ts +24 -0
- package/dist/util/iife.d.ts +1 -0
- package/dist/util/index.d.ts +7 -0
- package/dist/util/lazy.d.ts +1 -0
- package/dist/util/log.d.ts +26 -0
- package/dist/util/paths.d.ts +45 -0
- package/dist/util/shell.d.ts +36 -0
- package/dist/util/timeout.d.ts +1 -0
- package/dist/util/wildcard.d.ts +8 -0
- package/package.json +87 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PromptInput Component
|
|
3
|
+
*
|
|
4
|
+
* Multiline text input for the terminal with cursor management.
|
|
5
|
+
* Supports:
|
|
6
|
+
* - Multiline input:
|
|
7
|
+
* - Ctrl+J: insert newline (most reliable, works in all terminals)
|
|
8
|
+
* - Ctrl+O: insert newline
|
|
9
|
+
* - Backslash at end of line + Enter: continue on next line
|
|
10
|
+
* - Shift+Enter: insert newline (requires CSI u mode - Kitty, WezTerm, iTerm2 with setting)
|
|
11
|
+
* - Meta+Enter: insert newline (if terminal supports it)
|
|
12
|
+
* - Cursor navigation (arrows, home, end)
|
|
13
|
+
* - Word navigation (Ctrl+arrows)
|
|
14
|
+
* - History navigation (up/down when at first/last line)
|
|
15
|
+
* - Paste detection
|
|
16
|
+
*
|
|
17
|
+
* Note on Shift+Enter:
|
|
18
|
+
* Most terminal emulators (Terminal.app, default iTerm2) don't distinguish Shift+Enter
|
|
19
|
+
* from regular Enter. To enable Shift+Enter support:
|
|
20
|
+
* - iTerm2: Preferences > Profiles > Keys > Report modifiers using CSI u
|
|
21
|
+
* - Kitty/WezTerm: Enabled by default
|
|
22
|
+
* - Other terminals: Use Ctrl+J as a reliable alternative
|
|
23
|
+
*/
|
|
24
|
+
interface PromptInputProps {
|
|
25
|
+
onSubmit: (value: string) => void;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
history?: string[];
|
|
29
|
+
queued?: number;
|
|
30
|
+
termWidth?: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function PromptInput({ onSubmit, placeholder, disabled, history, queued, termWidth: termWidthProp, }: PromptInputProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REPL Component
|
|
3
|
+
*
|
|
4
|
+
* Main session view that displays messages, handles input, and manages LLM interaction.
|
|
5
|
+
*/
|
|
6
|
+
type Mode = "auto" | "plan" | "ask";
|
|
7
|
+
interface REPLProps {
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
mode: Mode;
|
|
10
|
+
ctrlCPressed: boolean;
|
|
11
|
+
instanceContext?: {
|
|
12
|
+
directory: string;
|
|
13
|
+
worktree: string;
|
|
14
|
+
project: any;
|
|
15
|
+
};
|
|
16
|
+
onNewSession: () => void;
|
|
17
|
+
onSessionCreated?: (sessionId: string) => void;
|
|
18
|
+
onSwitchSession?: (sessionId: string) => void;
|
|
19
|
+
onModeChange?: (mode: Mode) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function REPL({ sessionId, mode, ctrlCPressed, instanceContext, onNewSession, onSessionCreated, onSwitchSession, onModeChange }: REPLProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spinner Component
|
|
3
|
+
*
|
|
4
|
+
* Simple animated loading indicator for the terminal.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
interface SpinnerProps {
|
|
8
|
+
message?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
showTime?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Spinner: React.NamedExoticComponent<SpinnerProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatusBar Component
|
|
3
|
+
*
|
|
4
|
+
* Bottom status bar with shortcuts and connection status.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
type Mode = "auto" | "plan" | "ask";
|
|
8
|
+
interface StatusBarProps {
|
|
9
|
+
mode: Mode;
|
|
10
|
+
contextUsage?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const StatusBar: React.NamedExoticComponent<StatusBarProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TodoList Component
|
|
3
|
+
*
|
|
4
|
+
* Displays the current task list with status indicators.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
import type { TodoItem } from "../../tool/todo";
|
|
8
|
+
interface TodoListProps {
|
|
9
|
+
todos: TodoItem[];
|
|
10
|
+
termWidth?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const TodoList: React.NamedExoticComponent<TodoListProps>;
|
|
13
|
+
/**
|
|
14
|
+
* Compact inline version for status bar
|
|
15
|
+
*/
|
|
16
|
+
export declare function TodoStatus({ todos }: TodoListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WelcomeBox Component
|
|
3
|
+
*
|
|
4
|
+
* Welcome screen displayed on startup with product info and tips.
|
|
5
|
+
*/
|
|
6
|
+
interface WelcomeBoxProps {
|
|
7
|
+
user?: string;
|
|
8
|
+
model?: string;
|
|
9
|
+
provider?: string;
|
|
10
|
+
cwd: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function WelcomeBox({ user, model, provider, cwd }: WelcomeBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiagnosticsPanel Dialog
|
|
3
|
+
*
|
|
4
|
+
* System diagnostics and health check for /doctor command.
|
|
5
|
+
* Displays environment info, API status, and configuration checks.
|
|
6
|
+
*/
|
|
7
|
+
interface DiagnosticsProps {
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function DiagnosticsPanel({ sessionId, onClose }: DiagnosticsProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HelpPanel Dialog
|
|
3
|
+
*
|
|
4
|
+
* Interactive help panel for /help command.
|
|
5
|
+
* Shows available commands grouped by category with descriptions.
|
|
6
|
+
*/
|
|
7
|
+
interface HelpPanelProps {
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function HelpPanel({ onClose }: HelpPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModelSelector Dialog
|
|
3
|
+
*
|
|
4
|
+
* Interactive model selection for /model command.
|
|
5
|
+
* Allows users to browse and select AI models from available providers.
|
|
6
|
+
*/
|
|
7
|
+
interface ModelSelectorProps {
|
|
8
|
+
currentModel?: string;
|
|
9
|
+
availableProviders: string[];
|
|
10
|
+
onSelect: (providerId: string, modelId: string) => void;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function ModelSelector({ currentModel, availableProviders, onSelect, onCancel, }: ModelSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PermissionPrompt Dialog
|
|
3
|
+
*
|
|
4
|
+
* Interactive permission request dialog for ask mode.
|
|
5
|
+
* Displays when an operation requires user approval.
|
|
6
|
+
* Options: Allow, Allow (don't ask again), Deny, Other
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
import type { PermissionRequest } from "../../../permission/types";
|
|
10
|
+
interface PermissionPromptProps {
|
|
11
|
+
request: PermissionRequest;
|
|
12
|
+
onRespond: (granted: boolean, pattern?: string, switchToAuto?: boolean) => void;
|
|
13
|
+
onOtherSelected?: (selected: boolean) => void;
|
|
14
|
+
termWidth?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const PermissionPrompt: React.NamedExoticComponent<PermissionPromptProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SessionPicker Dialog
|
|
3
|
+
*
|
|
4
|
+
* Interactive session selection for /resume command.
|
|
5
|
+
* Groups sessions by date: Today, Yesterday, This Week, Earlier.
|
|
6
|
+
* Shows session titles based on first user prompt.
|
|
7
|
+
* Features windowed scrolling (5 visible items) and Tab section navigation.
|
|
8
|
+
*/
|
|
9
|
+
interface SessionPickerProps {
|
|
10
|
+
currentSessionId?: string;
|
|
11
|
+
instanceContext?: {
|
|
12
|
+
directory: string;
|
|
13
|
+
worktree: string;
|
|
14
|
+
project: any;
|
|
15
|
+
};
|
|
16
|
+
onSelect: (sessionId: string) => void;
|
|
17
|
+
onCancel: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function SessionPicker({ currentSessionId, instanceContext, onSelect, onCancel, }: SessionPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dialog Components
|
|
3
|
+
*
|
|
4
|
+
* Interactive panels and dialogs for commands.
|
|
5
|
+
*/
|
|
6
|
+
export { ModelSelector } from "./ModelSelector";
|
|
7
|
+
export { HelpPanel } from "./HelpPanel";
|
|
8
|
+
export { DiagnosticsPanel } from "./DiagnosticsPanel";
|
|
9
|
+
export { PermissionPrompt } from "./PermissionPrompt";
|
|
10
|
+
export { SessionPicker } from "./SessionPicker";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiffHunk Component
|
|
3
|
+
*
|
|
4
|
+
* Displays a hunk (section) of diff with header and lines.
|
|
5
|
+
*/
|
|
6
|
+
import type { DiffHunk as DiffHunkType } from "../../../diff";
|
|
7
|
+
interface DiffHunkProps {
|
|
8
|
+
hunk: DiffHunkType;
|
|
9
|
+
showLineNumbers?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function DiffHunk({ hunk, showLineNumbers }: DiffHunkProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiffLine Component
|
|
3
|
+
*
|
|
4
|
+
* Displays a single line of diff with proper styling.
|
|
5
|
+
* Supports word-level highlighting for modified lines.
|
|
6
|
+
*/
|
|
7
|
+
import type { DiffLine as DiffLineType } from "../../../diff";
|
|
8
|
+
interface DiffLineProps {
|
|
9
|
+
line: DiffLineType;
|
|
10
|
+
showLineNumbers?: boolean;
|
|
11
|
+
lineNumberWidth?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function DiffLine({ line, showLineNumbers, lineNumberWidth }: DiffLineProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiffStats Component
|
|
3
|
+
*
|
|
4
|
+
* Displays diff statistics (additions/deletions) with visual bar.
|
|
5
|
+
*/
|
|
6
|
+
interface DiffStatsProps {
|
|
7
|
+
additions: number;
|
|
8
|
+
deletions: number;
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function DiffStats({ additions, deletions, maxWidth }: DiffStatsProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiffView Component
|
|
3
|
+
*
|
|
4
|
+
* Main component for displaying file diffs in the TUI.
|
|
5
|
+
* Shows file header, stats, and all hunks.
|
|
6
|
+
*/
|
|
7
|
+
import type { DiffResult } from "../../../diff";
|
|
8
|
+
interface DiffViewProps {
|
|
9
|
+
diff: DiffResult;
|
|
10
|
+
showLineNumbers?: boolean;
|
|
11
|
+
showStats?: boolean;
|
|
12
|
+
collapsed?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function DiffView({ diff, showLineNumbers, showStats, collapsed, }: DiffViewProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff TUI Components
|
|
3
|
+
*
|
|
4
|
+
* React/Ink components for rendering diffs in the terminal.
|
|
5
|
+
*/
|
|
6
|
+
export { DiffView } from "./DiffView";
|
|
7
|
+
export { DiffHunk } from "./DiffHunk";
|
|
8
|
+
export { DiffLine } from "./DiffLine";
|
|
9
|
+
export { DiffStats } from "./DiffStats";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAnimatedLabel Hook
|
|
3
|
+
*
|
|
4
|
+
* Creates a typing/rewriting animation effect on text labels to keep the UI engaging.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Hook that returns an animated label with typing/rewriting effect
|
|
8
|
+
* @param baseLabel - The base label to animate ("Thinking", "Reasoning", etc.)
|
|
9
|
+
* @param enabled - Whether the animation is enabled (usually when streaming)
|
|
10
|
+
* @param cycleIntervalMs - How often to restart the typing cycle in milliseconds (default: 3000)
|
|
11
|
+
*/
|
|
12
|
+
export declare function useAnimatedLabel(baseLabel?: string, enabled?: boolean, cycleIntervalMs?: number): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* usePermission Hook
|
|
3
|
+
*
|
|
4
|
+
* Manages permission request state and responses.
|
|
5
|
+
*/
|
|
6
|
+
interface UsePermissionOptions {
|
|
7
|
+
instanceContext?: {
|
|
8
|
+
directory: string;
|
|
9
|
+
worktree: string;
|
|
10
|
+
project: any;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function usePermission(options?: UsePermissionOptions): {
|
|
14
|
+
pending: {
|
|
15
|
+
id: string;
|
|
16
|
+
tool: string;
|
|
17
|
+
action: string;
|
|
18
|
+
description: string;
|
|
19
|
+
risk: "low" | "medium" | "high";
|
|
20
|
+
details?: Record<string, any> | undefined;
|
|
21
|
+
}[];
|
|
22
|
+
current: {
|
|
23
|
+
id: string;
|
|
24
|
+
tool: string;
|
|
25
|
+
action: string;
|
|
26
|
+
description: string;
|
|
27
|
+
risk: "low" | "medium" | "high";
|
|
28
|
+
details?: Record<string, any> | undefined;
|
|
29
|
+
};
|
|
30
|
+
hasPending: boolean;
|
|
31
|
+
grant: (always?: boolean) => void;
|
|
32
|
+
deny: () => void;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTermWidth Hook
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL: Optimized hook that only triggers re-renders when terminal width actually changes.
|
|
5
|
+
* Unlike useStdout() which re-renders on every stdout change (including scroll),
|
|
6
|
+
* this hook uses a single initial read and then listens to resize events only.
|
|
7
|
+
*
|
|
8
|
+
* This prevents the massive re-render cascade that occurs when:
|
|
9
|
+
* - Terminal scrolls (stdout changes but columns don't)
|
|
10
|
+
* - Long sessions render many components
|
|
11
|
+
* - Each component calls useStdout() and re-renders on every scroll
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTermWidth(): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Provides the main tui() function that renders the terminal interface.
|
|
5
|
+
*/
|
|
6
|
+
export { themes, getTheme, setTheme, getThemeNames } from "./theme";
|
|
7
|
+
export type { Theme } from "./theme";
|
|
8
|
+
export interface TuiOptions {
|
|
9
|
+
sessionId?: string;
|
|
10
|
+
onExit?: () => Promise<void>;
|
|
11
|
+
instanceContext?: {
|
|
12
|
+
directory: string;
|
|
13
|
+
worktree: string;
|
|
14
|
+
project: any;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Start the Terminal User Interface
|
|
19
|
+
*/
|
|
20
|
+
export declare function tui(options?: TuiOptions): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI Theme System
|
|
3
|
+
*
|
|
4
|
+
* Re-exports theme functionality from the main theme module
|
|
5
|
+
* Kept for backward compatibility with existing imports
|
|
6
|
+
*/
|
|
7
|
+
export { themes, getTheme, setTheme, getThemeNames, initTheme, } from "../theme";
|
|
8
|
+
export type { Theme } from "../theme";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor Utility
|
|
3
|
+
*
|
|
4
|
+
* Manages cursor position for multiline text editing.
|
|
5
|
+
* Immutable class - all operations return new Cursor instances.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Cursor {
|
|
8
|
+
readonly text: string;
|
|
9
|
+
readonly offset: number;
|
|
10
|
+
constructor(text: string, offset?: number);
|
|
11
|
+
get line(): number;
|
|
12
|
+
get column(): number;
|
|
13
|
+
get lines(): string[];
|
|
14
|
+
get currentLine(): string;
|
|
15
|
+
get textBefore(): string;
|
|
16
|
+
get textAfter(): string;
|
|
17
|
+
left(): Cursor;
|
|
18
|
+
right(): Cursor;
|
|
19
|
+
up(): Cursor;
|
|
20
|
+
down(): Cursor;
|
|
21
|
+
lineStart(): Cursor;
|
|
22
|
+
lineEnd(): Cursor;
|
|
23
|
+
start(): Cursor;
|
|
24
|
+
end(): Cursor;
|
|
25
|
+
nextWord(): Cursor;
|
|
26
|
+
prevWord(): Cursor;
|
|
27
|
+
insert(str: string): Cursor;
|
|
28
|
+
delete(): Cursor;
|
|
29
|
+
backspace(): Cursor;
|
|
30
|
+
deleteWord(): Cursor;
|
|
31
|
+
deleteWordBack(): Cursor;
|
|
32
|
+
deleteToEnd(): Cursor;
|
|
33
|
+
deleteToStart(): Cursor;
|
|
34
|
+
clear(): Cursor;
|
|
35
|
+
render(cursorChar?: string, showCursor?: boolean): string;
|
|
36
|
+
renderInverted(): string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended keypress detection for CSI u encoding and other special sequences.
|
|
3
|
+
*
|
|
4
|
+
* Some modern terminals (Kitty, WezTerm, iTerm2 with settings) support CSI u encoding
|
|
5
|
+
* which sends distinct sequences for modifier+key combinations.
|
|
6
|
+
*
|
|
7
|
+
* CSI u format: \x1b[<keycode>;<modifier>u
|
|
8
|
+
* Modifier bits: 1=Shift, 2=Alt, 4=Ctrl, 8=Super
|
|
9
|
+
*
|
|
10
|
+
* For Enter (keycode 13):
|
|
11
|
+
* - Enter: \x1b[13u or just \r
|
|
12
|
+
* - Shift+Enter: \x1b[13;2u
|
|
13
|
+
* - Ctrl+Enter: \x1b[13;5u
|
|
14
|
+
* - Alt+Enter: \x1b[13;3u
|
|
15
|
+
*/
|
|
16
|
+
export interface ExtendedKey {
|
|
17
|
+
keycode: number;
|
|
18
|
+
shift: boolean;
|
|
19
|
+
ctrl: boolean;
|
|
20
|
+
alt: boolean;
|
|
21
|
+
meta: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parse CSI u encoded key sequence.
|
|
25
|
+
* Returns null if not a CSI u sequence.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseCSIu(sequence: string): ExtendedKey | null;
|
|
28
|
+
/**
|
|
29
|
+
* Check if input represents Shift+Enter in any encoding.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isShiftEnter(input: string, rawSequence?: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Check if input represents Enter (with or without modifiers) using CSI u encoding.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isEnterCSIu(input: string): {
|
|
36
|
+
isEnter: boolean;
|
|
37
|
+
shift: boolean;
|
|
38
|
+
ctrl: boolean;
|
|
39
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown Rendering for Terminal
|
|
3
|
+
*
|
|
4
|
+
* Converts markdown to styled terminal output using chalk.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Render markdown to styled terminal text
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderMarkdown(content: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Truncate text to a maximum number of lines
|
|
12
|
+
*/
|
|
13
|
+
export declare function truncateLines(text: string, maxLines: number): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Open Content Utility
|
|
3
|
+
*
|
|
4
|
+
* Detects VS Code environment and opens content in appropriate viewer.
|
|
5
|
+
* Writes content to temp file and opens with VS Code or default app.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Check if running inside VS Code terminal
|
|
9
|
+
*/
|
|
10
|
+
export declare function isVSCodeTerminal(): boolean;
|
|
11
|
+
export interface OpenContentOptions {
|
|
12
|
+
toolName: string;
|
|
13
|
+
toolId: string;
|
|
14
|
+
args: Record<string, any>;
|
|
15
|
+
output: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Open tool output content in VS Code or default app
|
|
19
|
+
*
|
|
20
|
+
* Returns the path to the created temp file
|
|
21
|
+
*/
|
|
22
|
+
export declare function openToolContent(options: OpenContentOptions): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ASCII Logo Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates ASCII art logos from text using block characters
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace AsciiGenerator {
|
|
7
|
+
/**
|
|
8
|
+
* Generate simple ASCII logo (3 lines)
|
|
9
|
+
*/
|
|
10
|
+
function generateSimple(text: string): string[];
|
|
11
|
+
/**
|
|
12
|
+
* Generate extended ASCII logo (4 lines, more detailed)
|
|
13
|
+
*/
|
|
14
|
+
function generateExtended(text: string): string[];
|
|
15
|
+
/**
|
|
16
|
+
* Generate both simple and extended logos
|
|
17
|
+
*/
|
|
18
|
+
function generateBoth(text: string): {
|
|
19
|
+
simple: string[];
|
|
20
|
+
extended: string[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal Bell Utilities
|
|
3
|
+
*
|
|
4
|
+
* Plays notification sounds in the terminal using the bell character
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Play terminal bell sound
|
|
8
|
+
* Uses the ASCII bell character to trigger the terminal's notification sound
|
|
9
|
+
*/
|
|
10
|
+
export declare function playBell(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Play multiple bell sounds with delay
|
|
13
|
+
*/
|
|
14
|
+
export declare function playBells(count?: number, delayMs?: number): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color Utilities
|
|
3
|
+
*
|
|
4
|
+
* Generates color palettes and variations from a base color
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace ColorUtils {
|
|
7
|
+
/**
|
|
8
|
+
* Generate a lighter variant of a color
|
|
9
|
+
*/
|
|
10
|
+
function lighten(hex: string, amount?: number): string;
|
|
11
|
+
/**
|
|
12
|
+
* Generate a darker variant of a color
|
|
13
|
+
*/
|
|
14
|
+
function darken(hex: string, amount?: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* Validate hex color format
|
|
17
|
+
*/
|
|
18
|
+
function isValidHex(hex: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Derive configuration parameters from product name and primary color
|
|
21
|
+
*/
|
|
22
|
+
function deriveConfig(productName: string, commandName: string, primaryColor: string): {
|
|
23
|
+
configDir: string;
|
|
24
|
+
configFile: string;
|
|
25
|
+
rulesFile: string;
|
|
26
|
+
envPrefix: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare function initDebug(enabled: boolean): void;
|
|
2
|
+
export declare function isDebugEnabled(): boolean;
|
|
3
|
+
export declare function getDebugFilePath(): string;
|
|
4
|
+
export declare function createDebugLogger(prefix: string): {
|
|
5
|
+
log: (...args: any[]) => void;
|
|
6
|
+
error: (...args: any[]) => void;
|
|
7
|
+
warn: (...args: any[]) => void;
|
|
8
|
+
info: (...args: any[]) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const debugCLI: {
|
|
11
|
+
log: (...args: any[]) => void;
|
|
12
|
+
error: (...args: any[]) => void;
|
|
13
|
+
warn: (...args: any[]) => void;
|
|
14
|
+
info: (...args: any[]) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const debugSession: {
|
|
17
|
+
log: (...args: any[]) => void;
|
|
18
|
+
error: (...args: any[]) => void;
|
|
19
|
+
warn: (...args: any[]) => void;
|
|
20
|
+
info: (...args: any[]) => void;
|
|
21
|
+
};
|
|
22
|
+
export declare const debugLLM: {
|
|
23
|
+
log: (...args: any[]) => void;
|
|
24
|
+
error: (...args: any[]) => void;
|
|
25
|
+
warn: (...args: any[]) => void;
|
|
26
|
+
info: (...args: any[]) => void;
|
|
27
|
+
};
|
|
28
|
+
export declare const debugTool: {
|
|
29
|
+
log: (...args: any[]) => void;
|
|
30
|
+
error: (...args: any[]) => void;
|
|
31
|
+
warn: (...args: any[]) => void;
|
|
32
|
+
info: (...args: any[]) => void;
|
|
33
|
+
};
|
|
34
|
+
export declare const debugStream: {
|
|
35
|
+
log: (...args: any[]) => void;
|
|
36
|
+
error: (...args: any[]) => void;
|
|
37
|
+
warn: (...args: any[]) => void;
|
|
38
|
+
info: (...args: any[]) => void;
|
|
39
|
+
};
|
|
40
|
+
export declare const debugPermission: {
|
|
41
|
+
log: (...args: any[]) => void;
|
|
42
|
+
error: (...args: any[]) => void;
|
|
43
|
+
warn: (...args: any[]) => void;
|
|
44
|
+
info: (...args: any[]) => void;
|
|
45
|
+
};
|
|
46
|
+
export declare const debugUI: {
|
|
47
|
+
log: (...args: any[]) => void;
|
|
48
|
+
error: (...args: any[]) => void;
|
|
49
|
+
warn: (...args: any[]) => void;
|
|
50
|
+
info: (...args: any[]) => void;
|
|
51
|
+
};
|