portercode 0.1.4 → 0.1.11
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 +174 -21
- package/README.md +162 -68
- package/dist/auth/index.d.ts +99 -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/cli/auth.d.ts +14 -2
- package/dist/cli/brand.d.ts +6 -0
- package/dist/config/config.d.ts +0 -720
- package/dist/constants/index.d.ts +6 -9
- package/dist/constants/version.d.ts +5 -0
- package/dist/gateway/index.d.ts +5 -4
- package/dist/global/index.d.ts +12 -0
- package/dist/index.js +39 -1
- package/dist/prompt/template.d.ts +24 -0
- package/dist/provider/models.d.ts +0 -3
- package/dist/provider/provider.d.ts +5 -1
- package/dist/server/services/agent.d.ts +11 -0
- package/dist/session/context-cache.d.ts +75 -0
- package/dist/session/context-optimization.d.ts +5 -0
- package/dist/session/llm.d.ts +38 -1
- package/dist/session/message-optimizer.d.ts +32 -0
- package/dist/session/session.d.ts +101 -9
- package/dist/session/types.d.ts +92 -16
- package/dist/src/auth/index.d.ts +202 -0
- package/dist/src/brand/index.d.ts +7 -0
- package/dist/src/bus/bus-event.d.ts +10 -0
- package/dist/src/bus/global.d.ts +7 -0
- package/dist/src/bus/index.d.ts +26 -0
- package/dist/src/cli/auth.d.ts +23 -0
- package/dist/src/cli/index.d.ts +1 -0
- package/dist/src/cli/ui.d.ts +26 -0
- package/dist/src/command/index.d.ts +54 -0
- package/dist/src/config/config.d.ts +6036 -0
- package/dist/src/config/index.d.ts +2 -0
- package/dist/src/config/markdown.d.ts +415 -0
- package/dist/src/constants/index.d.ts +6 -0
- package/dist/src/constants/version.d.ts +5 -0
- package/dist/src/diff/engine.d.ts +15 -0
- package/dist/src/diff/index.d.ts +8 -0
- package/dist/src/diff/types.d.ts +66 -0
- package/dist/src/file/ignore.d.ts +7 -0
- package/dist/src/flag/index.d.ts +19 -0
- package/dist/src/gateway/bridge.d.ts +11 -0
- package/dist/src/gateway/handlers/llm.d.ts +7 -0
- package/dist/src/gateway/handlers/permission.d.ts +15 -0
- package/dist/src/gateway/handlers/session.d.ts +7 -0
- package/dist/src/gateway/handlers/system.d.ts +7 -0
- package/dist/src/gateway/handlers/tool.d.ts +7 -0
- package/dist/src/gateway/index.d.ts +18 -0
- package/dist/src/gateway/protocol.d.ts +159 -0
- package/dist/src/gateway/router.d.ts +7 -0
- package/dist/src/gateway/server.d.ts +24 -0
- package/dist/src/global/index.d.ts +23 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/permission/index.d.ts +2 -0
- package/dist/src/permission/permission.d.ts +172 -0
- package/dist/src/permission/types.d.ts +109 -0
- package/dist/src/project/index.d.ts +3 -0
- package/dist/src/project/instance.d.ts +33 -0
- package/dist/src/project/project.d.ts +82 -0
- package/dist/src/project/state.d.ts +4 -0
- package/dist/src/prompt/index.d.ts +5 -0
- package/dist/src/prompt/system.d.ts +29 -0
- package/dist/src/prompt/template.d.ts +24 -0
- package/dist/src/provider/index.d.ts +3 -0
- package/dist/src/provider/models.d.ts +14 -0
- package/dist/src/provider/provider.d.ts +848 -0
- package/dist/src/provider/types.d.ts +328 -0
- package/dist/src/server/index.d.ts +21 -0
- package/dist/src/server/routes/api.d.ts +2 -0
- package/dist/src/server/routes/auth.d.ts +2 -0
- package/dist/src/server/routes/events.d.ts +2 -0
- package/dist/src/server/routes/health.d.ts +2 -0
- package/dist/src/server/routes/sessions.d.ts +2 -0
- package/dist/src/server/services/agent.d.ts +40 -0
- package/dist/src/server/services/permission.d.ts +43 -0
- package/dist/src/server/sse/emitter.d.ts +57 -0
- package/dist/src/session/context-cache.d.ts +75 -0
- package/dist/src/session/context-optimization.d.ts +165 -0
- package/dist/src/session/index.d.ts +5 -0
- package/dist/src/session/llm.d.ts +68 -0
- package/dist/src/session/message-optimizer.d.ts +32 -0
- package/dist/src/session/session.d.ts +524 -0
- package/dist/src/session/title-generator.d.ts +11 -0
- package/dist/src/session/types.d.ts +713 -0
- package/dist/src/snapshot/index.d.ts +40 -0
- package/dist/src/storage/index.d.ts +1 -0
- package/dist/src/storage/storage.d.ts +34 -0
- package/dist/src/theme.d.ts +66 -0
- package/dist/src/tool/bash.d.ts +19 -0
- package/dist/src/tool/edit.d.ts +21 -0
- package/dist/src/tool/glob.d.ts +15 -0
- package/dist/src/tool/grep.d.ts +20 -0
- package/dist/src/tool/image.d.ts +22 -0
- package/dist/src/tool/index.d.ts +11 -0
- package/dist/src/tool/ls.d.ts +14 -0
- package/dist/src/tool/read.d.ts +17 -0
- package/dist/src/tool/registry.d.ts +30 -0
- package/dist/src/tool/think.d.ts +11 -0
- package/dist/src/tool/todo.d.ts +76 -0
- package/dist/src/tool/tool.d.ts +65 -0
- package/dist/src/tool/webfetch.d.ts +15 -0
- package/dist/src/tool/websearch.d.ts +18 -0
- package/dist/src/tool/write.d.ts +16 -0
- package/dist/src/tui/App.d.ts +10 -0
- package/dist/src/tui/components/Header.d.ts +13 -0
- package/dist/src/tui/components/LoadingIndicator.d.ts +26 -0
- package/dist/src/tui/components/Message/AssistantMessage.d.ts +11 -0
- package/dist/src/tui/components/Message/ReasoningMessage.d.ts +21 -0
- package/dist/src/tui/components/Message/ToolCallMessage.d.ts +26 -0
- package/dist/src/tui/components/Message/UserMessage.d.ts +12 -0
- package/dist/src/tui/components/Message/index.d.ts +16 -0
- package/dist/src/tui/components/PermissionPrompt.d.ts +6 -0
- package/dist/src/tui/components/PromptInput.d.ts +33 -0
- package/dist/src/tui/components/REPL.d.ts +22 -0
- package/dist/src/tui/components/Spinner.d.ts +13 -0
- package/dist/src/tui/components/StatusBar.d.ts +13 -0
- package/dist/src/tui/components/TodoList.d.ts +17 -0
- package/dist/src/tui/components/WelcomeBox.d.ts +13 -0
- package/dist/src/tui/components/dialogs/DiagnosticsPanel.d.ts +12 -0
- package/dist/src/tui/components/dialogs/HelpPanel.d.ts +11 -0
- package/dist/src/tui/components/dialogs/ModelSelector.d.ts +14 -0
- package/dist/src/tui/components/dialogs/PermissionPrompt.d.ts +17 -0
- package/dist/src/tui/components/dialogs/SessionPicker.d.ts +20 -0
- package/dist/src/tui/components/dialogs/index.d.ts +10 -0
- package/dist/src/tui/components/diff/DiffHunk.d.ts +12 -0
- package/dist/src/tui/components/diff/DiffLine.d.ts +14 -0
- package/dist/src/tui/components/diff/DiffStats.d.ts +12 -0
- package/dist/src/tui/components/diff/DiffView.d.ts +15 -0
- package/dist/src/tui/components/diff/index.d.ts +9 -0
- package/dist/src/tui/hooks/useAnimatedLabel.d.ts +12 -0
- package/dist/src/tui/hooks/usePermission.d.ts +34 -0
- package/dist/src/tui/hooks/useTermWidth.d.ts +13 -0
- package/dist/src/tui/index.d.ts +20 -0
- package/dist/src/tui/theme.d.ts +8 -0
- package/dist/src/tui/utils/Cursor.d.ts +37 -0
- package/dist/src/tui/utils/clipboard.d.ts +3 -0
- package/dist/src/tui/utils/keypress.d.ts +39 -0
- package/dist/src/tui/utils/markdown.d.ts +13 -0
- package/dist/src/tui/utils/openContent.d.ts +22 -0
- package/dist/src/util/ascii.d.ts +22 -0
- package/dist/src/util/bell.d.ts +14 -0
- package/dist/src/util/color.d.ts +28 -0
- package/dist/src/util/context.d.ts +10 -0
- package/dist/src/util/debug.d.ts +51 -0
- package/dist/src/util/error.d.ts +294 -0
- package/dist/src/util/example-commands.d.ts +18 -0
- package/dist/src/util/filesystem.d.ts +17 -0
- package/dist/src/util/id.d.ts +24 -0
- package/dist/src/util/iife.d.ts +1 -0
- package/dist/src/util/index.d.ts +7 -0
- package/dist/src/util/lazy.d.ts +1 -0
- package/dist/src/util/log.d.ts +26 -0
- package/dist/src/util/paths.d.ts +45 -0
- package/dist/src/util/shell.d.ts +36 -0
- package/dist/src/util/timeout.d.ts +1 -0
- package/dist/src/util/wildcard.d.ts +8 -0
- package/dist/theme.d.ts +64 -0
- package/dist/tool/image.d.ts +3 -4
- package/dist/tool/think.d.ts +11 -0
- package/dist/tool/webfetch.d.ts +15 -0
- package/dist/tool/websearch.d.ts +18 -0
- package/dist/tools/think.d.ts +2 -0
- package/dist/tui/App.d.ts +1 -1
- package/dist/tui/components/Header.d.ts +2 -1
- package/dist/tui/components/LoadingIndicator.d.ts +26 -0
- package/dist/tui/components/Message/AssistantMessage.d.ts +2 -1
- package/dist/tui/components/Message/ReasoningMessage.d.ts +2 -1
- package/dist/tui/components/Message/ToolCallMessage.d.ts +3 -2
- package/dist/tui/components/Message/UserMessage.d.ts +2 -1
- package/dist/tui/components/Message/index.d.ts +4 -1
- package/dist/tui/components/PromptInput.d.ts +2 -1
- package/dist/tui/components/REPL.d.ts +6 -1
- package/dist/tui/components/StatusBar.d.ts +2 -1
- package/dist/tui/components/dialogs/SessionPicker.d.ts +6 -1
- package/dist/tui/hooks/useAnimatedLabel.d.ts +12 -0
- package/dist/tui/hooks/usePermission.d.ts +9 -1
- package/dist/tui/hooks/useTermWidth.d.ts +13 -0
- package/dist/tui/index.d.ts +5 -0
- package/dist/tui/theme.d.ts +4 -23
- 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/paths.d.ts +45 -0
- package/dist/util/shell.d.ts +36 -0
- package/package.json +21 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LoadingIndicator Component
|
|
3
|
+
*
|
|
4
|
+
* Isolated loading spinner with local animation state to prevent parent re-renders.
|
|
5
|
+
* CRITICAL: Animation loop is self-contained - does NOT cause parent (REPL) to re-render.
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
interface LoadingIndicatorProps {
|
|
9
|
+
baseActivity: string;
|
|
10
|
+
tokenUsage: {
|
|
11
|
+
input: number;
|
|
12
|
+
output: number;
|
|
13
|
+
};
|
|
14
|
+
escapePressed: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* LoadingIndicator with optimized animation
|
|
18
|
+
*
|
|
19
|
+
* CRITICAL ARCHITECTURE for flicker-free animation:
|
|
20
|
+
* - Local state for spinner frame, isolated from parent re-renders
|
|
21
|
+
* - Fixed-width layout to prevent text reflow
|
|
22
|
+
* - React.memo with custom comparison to prevent parent-triggered re-renders
|
|
23
|
+
* - Low frequency updates (8fps) to minimize layout recalculations
|
|
24
|
+
*/
|
|
25
|
+
export declare const LoadingIndicator: React.NamedExoticComponent<LoadingIndicatorProps>;
|
|
26
|
+
export {};
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Displays an assistant message with markdown rendering.
|
|
5
5
|
*/
|
|
6
|
+
import React from "react";
|
|
6
7
|
interface AssistantMessageProps {
|
|
7
8
|
content: string;
|
|
8
9
|
}
|
|
9
|
-
export declare
|
|
10
|
+
export declare const AssistantMessage: React.NamedExoticComponent<AssistantMessageProps>;
|
|
10
11
|
export {};
|
|
@@ -14,7 +14,8 @@ export declare const ReasoningMessage: React.NamedExoticComponent<ReasoningMessa
|
|
|
14
14
|
/**
|
|
15
15
|
* Compact version for message history
|
|
16
16
|
*/
|
|
17
|
-
export declare function ReasoningHistoryMessage({ content }: {
|
|
17
|
+
export declare function ReasoningHistoryMessage({ content, termWidth: termWidthProp }: {
|
|
18
18
|
content: string;
|
|
19
|
+
termWidth?: number;
|
|
19
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -17,9 +17,10 @@ export declare const ToolCallMessage: React.NamedExoticComponent<ToolCallMessage
|
|
|
17
17
|
/**
|
|
18
18
|
* Compact version for message history (tool results)
|
|
19
19
|
*/
|
|
20
|
-
export declare
|
|
20
|
+
export declare const ToolResultMessage: React.NamedExoticComponent<{
|
|
21
21
|
toolName?: string;
|
|
22
22
|
input?: Record<string, any>;
|
|
23
23
|
output?: string;
|
|
24
|
-
|
|
24
|
+
termWidth?: number;
|
|
25
|
+
}>;
|
|
25
26
|
export {};
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Displays a user message in the conversation.
|
|
5
5
|
* Long messages are truncated to 3 lines with a count indicator.
|
|
6
6
|
*/
|
|
7
|
+
import React from "react";
|
|
7
8
|
interface UserMessageProps {
|
|
8
9
|
content: string;
|
|
9
10
|
}
|
|
10
|
-
export declare
|
|
11
|
+
export declare const UserMessage: React.NamedExoticComponent<UserMessageProps>;
|
|
11
12
|
export {};
|
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Dispatcher that renders the appropriate message component based on type.
|
|
5
5
|
*/
|
|
6
|
+
import React from "react";
|
|
6
7
|
import type { MessageWithParts } from "../../../session/types";
|
|
7
8
|
interface MessageProps {
|
|
8
9
|
message: MessageWithParts;
|
|
10
|
+
termWidth?: number;
|
|
11
|
+
maxToolResults?: number;
|
|
9
12
|
}
|
|
10
|
-
export declare
|
|
13
|
+
export declare const Message: React.NamedExoticComponent<MessageProps>;
|
|
11
14
|
export { UserMessage } from "./UserMessage";
|
|
12
15
|
export { AssistantMessage } from "./AssistantMessage";
|
|
13
16
|
export { ToolCallMessage, ToolResultMessage } from "./ToolCallMessage";
|
|
@@ -27,6 +27,7 @@ interface PromptInputProps {
|
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
history?: string[];
|
|
29
29
|
queued?: number;
|
|
30
|
+
termWidth?: number;
|
|
30
31
|
}
|
|
31
|
-
export declare function PromptInput({ onSubmit, placeholder, disabled, history, queued, }: PromptInputProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function PromptInput({ onSubmit, placeholder, disabled, history, queued, termWidth: termWidthProp, }: PromptInputProps): import("react/jsx-runtime").JSX.Element;
|
|
32
33
|
export {};
|
|
@@ -8,10 +8,15 @@ interface REPLProps {
|
|
|
8
8
|
sessionId?: string;
|
|
9
9
|
mode: Mode;
|
|
10
10
|
ctrlCPressed: boolean;
|
|
11
|
+
instanceContext?: {
|
|
12
|
+
directory: string;
|
|
13
|
+
worktree: string;
|
|
14
|
+
project: any;
|
|
15
|
+
};
|
|
11
16
|
onNewSession: () => void;
|
|
12
17
|
onSessionCreated?: (sessionId: string) => void;
|
|
13
18
|
onSwitchSession?: (sessionId: string) => void;
|
|
14
19
|
onModeChange?: (mode: Mode) => void;
|
|
15
20
|
}
|
|
16
|
-
export declare function REPL({ sessionId, mode, ctrlCPressed, onNewSession, onSessionCreated, onSwitchSession, onModeChange }: REPLProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function REPL({ sessionId, mode, ctrlCPressed, instanceContext, onNewSession, onSessionCreated, onSwitchSession, onModeChange }: REPLProps): import("react/jsx-runtime").JSX.Element;
|
|
17
22
|
export {};
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Bottom status bar with shortcuts and connection status.
|
|
5
5
|
*/
|
|
6
|
+
import React from "react";
|
|
6
7
|
type Mode = "auto" | "plan" | "ask";
|
|
7
8
|
interface StatusBarProps {
|
|
8
9
|
mode: Mode;
|
|
9
10
|
contextUsage?: number;
|
|
10
11
|
}
|
|
11
|
-
export declare
|
|
12
|
+
export declare const StatusBar: React.NamedExoticComponent<StatusBarProps>;
|
|
12
13
|
export {};
|
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
interface SessionPickerProps {
|
|
10
10
|
currentSessionId?: string;
|
|
11
|
+
instanceContext?: {
|
|
12
|
+
directory: string;
|
|
13
|
+
worktree: string;
|
|
14
|
+
project: any;
|
|
15
|
+
};
|
|
11
16
|
onSelect: (sessionId: string) => void;
|
|
12
17
|
onCancel: () => void;
|
|
13
18
|
}
|
|
14
|
-
export declare function SessionPicker({ currentSessionId, onSelect, onCancel, }: SessionPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function SessionPicker({ currentSessionId, instanceContext, onSelect, onCancel, }: SessionPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
15
20
|
export {};
|
|
@@ -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;
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Manages permission request state and responses.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
interface UsePermissionOptions {
|
|
7
|
+
instanceContext?: {
|
|
8
|
+
directory: string;
|
|
9
|
+
worktree: string;
|
|
10
|
+
project: any;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function usePermission(options?: UsePermissionOptions): {
|
|
7
14
|
pending: {
|
|
8
15
|
id: string;
|
|
9
16
|
tool: string;
|
|
@@ -24,3 +31,4 @@ export declare function usePermission(): {
|
|
|
24
31
|
grant: (always?: boolean) => void;
|
|
25
32
|
deny: () => void;
|
|
26
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;
|
package/dist/tui/index.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export type { Theme } from "./theme";
|
|
|
8
8
|
export interface TuiOptions {
|
|
9
9
|
sessionId?: string;
|
|
10
10
|
onExit?: () => Promise<void>;
|
|
11
|
+
instanceContext?: {
|
|
12
|
+
directory: string;
|
|
13
|
+
worktree: string;
|
|
14
|
+
project: any;
|
|
15
|
+
};
|
|
11
16
|
}
|
|
12
17
|
/**
|
|
13
18
|
* Start the Terminal User Interface
|
package/dist/tui/theme.d.ts
CHANGED
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TUI Theme System
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Re-exports theme functionality from the main theme module
|
|
5
|
+
* Kept for backward compatibility with existing imports
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
background: string;
|
|
9
|
-
foreground: string;
|
|
10
|
-
text: string;
|
|
11
|
-
primary: string;
|
|
12
|
-
secondary: string;
|
|
13
|
-
success: string;
|
|
14
|
-
warning: string;
|
|
15
|
-
error: string;
|
|
16
|
-
muted: string;
|
|
17
|
-
border: string;
|
|
18
|
-
selection: string;
|
|
19
|
-
diffAdd: string;
|
|
20
|
-
diffRemove: string;
|
|
21
|
-
diffContext: string;
|
|
22
|
-
diffHunkHeader: string;
|
|
23
|
-
}
|
|
24
|
-
export declare const themes: Record<string, Theme>;
|
|
25
|
-
export declare function getTheme(): Theme;
|
|
26
|
-
export declare function setTheme(name: string): void;
|
|
27
|
-
export declare function getThemeNames(): string[];
|
|
7
|
+
export { themes, getTheme, setTheme, getThemeNames, initTheme, } from "../theme";
|
|
8
|
+
export type { Theme } from "../theme";
|
|
@@ -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,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform path utilities
|
|
3
|
+
* Helps handle file paths correctly across Windows, macOS, and Linux
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Resolve home directory paths (~/...)
|
|
7
|
+
* Works cross-platform (Windows, macOS, Linux)
|
|
8
|
+
*
|
|
9
|
+
* @param filepath - Path that may start with ~/
|
|
10
|
+
* @returns Resolved absolute path
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* resolveHomePath("~/Documents/file.txt")
|
|
14
|
+
* // Windows: C:\Users\username\Documents\file.txt
|
|
15
|
+
* // macOS: /Users/username/Documents/file.txt
|
|
16
|
+
* // Linux: /home/username/Documents/file.txt
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveHomePath(filepath: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Get platform-specific config directory for an application
|
|
21
|
+
*
|
|
22
|
+
* @param commandName - Name of the command/application
|
|
23
|
+
* @returns Platform-appropriate config directory path
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* getConfigDir("portercode")
|
|
27
|
+
* // Windows: C:\Users\username\AppData\Roaming\portercode
|
|
28
|
+
* // macOS: /Users/username/Library/Application Support/portercode
|
|
29
|
+
* // Linux: /home/username/.config/portercode
|
|
30
|
+
*/
|
|
31
|
+
export declare function getConfigDir(commandName: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get platform-specific data directory for an application
|
|
34
|
+
* This is where app data files are typically stored
|
|
35
|
+
*
|
|
36
|
+
* @param commandName - Name of the command/application
|
|
37
|
+
* @returns Platform-appropriate data directory path
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* getDataDir("portercode")
|
|
41
|
+
* // Windows: C:\Users\username\AppData\Local\portercode
|
|
42
|
+
* // macOS: /Users/username/Library/Application Support/portercode
|
|
43
|
+
* // Linux: /home/username/.local/share/portercode
|
|
44
|
+
*/
|
|
45
|
+
export declare function getDataDir(commandName: string): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell Utilities
|
|
3
|
+
*
|
|
4
|
+
* Manages shell aliases and RC files across different shells
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace ShellUtils {
|
|
7
|
+
type Shell = "bash" | "zsh" | "fish" | "powershell" | "unknown";
|
|
8
|
+
/**
|
|
9
|
+
* Detect current shell
|
|
10
|
+
*/
|
|
11
|
+
function detectShell(): Shell;
|
|
12
|
+
/**
|
|
13
|
+
* Get shell RC file path
|
|
14
|
+
*/
|
|
15
|
+
function getShellRc(shell?: Shell): string;
|
|
16
|
+
/**
|
|
17
|
+
* Create alias in shell RC file
|
|
18
|
+
*/
|
|
19
|
+
function createAlias(aliasName: string, targetCommand: string, shell?: Shell): Promise<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
rcFile: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Remove alias from shell RC file
|
|
26
|
+
*/
|
|
27
|
+
function removeAlias(aliasName: string, shell?: Shell): Promise<{
|
|
28
|
+
success: boolean;
|
|
29
|
+
rcFile: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Check if alias exists in shell RC files
|
|
34
|
+
*/
|
|
35
|
+
function hasAlias(aliasName: string, shell?: Shell): Promise<boolean>;
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "portercode",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.11",
|
|
5
5
|
"description": "AI-powered coding assistant CLI",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -24,6 +24,16 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"dev": "bun run ./src/index.ts",
|
|
26
26
|
"build": "bun run build.ts",
|
|
27
|
+
"build:windows": "bun run build-windows.ts",
|
|
28
|
+
"build:windows-portable": "bun run build-windows-portable.ts",
|
|
29
|
+
"build:windows-installer": "bun run build-windows-installer.ts",
|
|
30
|
+
"build:distributions": "bun run build-distributions.ts",
|
|
31
|
+
"build:all": "bun run build-all-platforms.ts",
|
|
32
|
+
"release": "bun run release.ts",
|
|
33
|
+
"release:draft": "bun run release.ts --draft",
|
|
34
|
+
"publish:all": "bun run publish.ts",
|
|
35
|
+
"publish:github": "bun run publish.ts --github",
|
|
36
|
+
"publish:npm": "bun run publish.ts --npm",
|
|
27
37
|
"prepublishOnly": "bun run build",
|
|
28
38
|
"test": "bun test",
|
|
29
39
|
"typecheck": "tsc --noEmit"
|
|
@@ -42,11 +52,13 @@
|
|
|
42
52
|
"@types/react": "^18.2.0",
|
|
43
53
|
"@types/yargs": "^17.0.33",
|
|
44
54
|
"javascript-obfuscator": "^5.1.0",
|
|
55
|
+
"puppeteer": "^24.34.0",
|
|
45
56
|
"typescript": "^5.8.3"
|
|
46
57
|
},
|
|
47
58
|
"dependencies": {
|
|
48
59
|
"@ai-sdk/anthropic": "^3.0.1",
|
|
49
60
|
"@ai-sdk/google": "^3.0.1",
|
|
61
|
+
"@ai-sdk/google-vertex": "^4.0.9",
|
|
50
62
|
"@ai-sdk/groq": "^3.0.1",
|
|
51
63
|
"@ai-sdk/openai": "^3.0.1",
|
|
52
64
|
"@ai-sdk/provider": "^2.0.0",
|
|
@@ -57,8 +69,10 @@
|
|
|
57
69
|
"chalk": "^5.3.0",
|
|
58
70
|
"cli-highlight": "^2.1.11",
|
|
59
71
|
"clipboardy": "^5.0.2",
|
|
72
|
+
"crawlee": "^3.15.3",
|
|
60
73
|
"diff": "^7.0.0",
|
|
61
74
|
"figures": "^6.0.1",
|
|
75
|
+
"google-auth-library": "^10.5.0",
|
|
62
76
|
"gray-matter": "^4.0.3",
|
|
63
77
|
"hono": "^4.11.3",
|
|
64
78
|
"ignore": "^7.0.5",
|
|
@@ -66,6 +80,7 @@
|
|
|
66
80
|
"jsonc-parser": "^3.3.1",
|
|
67
81
|
"marked": "^12.0.0",
|
|
68
82
|
"minimatch": "^10.0.3",
|
|
83
|
+
"playwright": "^1.49.0",
|
|
69
84
|
"react": "^18.2.0",
|
|
70
85
|
"react-devtools-core": "^7.0.1",
|
|
71
86
|
"ulid": "^2.3.0",
|
|
@@ -74,5 +89,10 @@
|
|
|
74
89
|
"yargs": "^18.0.0",
|
|
75
90
|
"zod": "^3.24.5",
|
|
76
91
|
"zod-to-json-schema": "^3.25.1"
|
|
92
|
+
},
|
|
93
|
+
"overrides": {
|
|
94
|
+
"ink": {
|
|
95
|
+
"react-devtools-core": "^7.0.1"
|
|
96
|
+
}
|
|
77
97
|
}
|
|
78
98
|
}
|