@shelltender/server
Version:
Server-side terminal session management for Shelltender
244 lines • 8.5 kB
TypeScript
import type { PatternConfig } from '@shelltender/core';
/**
* Patterns for detecting AI coding assistant states and interactions
* Focused on reliable visual indicators rather than specific text
*/
export declare const THINKING_ANIMATION_SYMBOLS: string[];
export declare const BOX_DRAWING_CHARS: {
TOP_LEFT: string;
TOP_RIGHT: string;
BOTTOM_LEFT: string;
BOTTOM_RIGHT: string;
HORIZONTAL: string;
VERTICAL: string;
};
export declare const AgenticCodingPatterns: {
readonly status: {
readonly thinking: {
readonly name: "ai-thinking";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "AI assistant is processing/thinking (animation + action word + time + tokens)";
readonly options: {
readonly debounce: 100;
};
};
readonly thinkingSimple: {
readonly name: "ai-thinking-simple";
readonly type: "string";
readonly pattern: string[];
readonly description: "AI thinking indicator (animation symbols only)";
readonly options: {
readonly debounce: 50;
};
};
readonly contextLoading: {
readonly name: "ai-context-loading";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Context window loading percentage";
readonly options: {
readonly debounce: 200;
};
};
readonly actionWord: {
readonly name: "ai-action-word";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Captures the action word during thinking (for collection)";
readonly options: {
readonly debounce: 100;
};
};
};
readonly input: {
readonly yesNo: {
readonly name: "ai-yes-no-prompt";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Yes/No confirmation prompt";
readonly options: {
readonly debounce: 500;
};
};
readonly multiChoice: {
readonly name: "ai-multi-choice";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Multiple choice selection prompt";
readonly options: {
readonly debounce: 500;
};
};
readonly numberedOption: {
readonly name: "ai-numbered-option";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Numbered option in a list";
readonly options: {
readonly debounce: 200;
};
};
readonly openQuestion: {
readonly name: "ai-open-question";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Open-ended question from AI";
readonly options: {
readonly debounce: 300;
};
};
readonly inputRequest: {
readonly name: "ai-input-request";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Request for user input";
readonly options: {
readonly debounce: 300;
};
};
};
readonly ui: {
readonly boxTop: {
readonly name: "ai-box-top";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Top of a UI box";
readonly options: {
readonly debounce: 100;
};
};
readonly boxBottom: {
readonly name: "ai-box-bottom";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Bottom of a UI box";
readonly options: {
readonly debounce: 100;
};
};
readonly inputBox: {
readonly name: "ai-input-box";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Input prompt inside a box";
readonly options: {
readonly debounce: 200;
};
};
readonly boxSeparator: {
readonly name: "ai-box-separator";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Horizontal separator line";
readonly options: {
readonly debounce: 100;
};
};
};
readonly completion: {
readonly success: {
readonly name: "ai-task-success";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Task completed successfully";
readonly options: {
readonly debounce: 300;
};
};
readonly error: {
readonly name: "ai-task-error";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Task failed or encountered error";
readonly options: {
readonly debounce: 300;
};
};
readonly warning: {
readonly name: "ai-task-warning";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Warning or important note";
readonly options: {
readonly debounce: 300;
};
};
};
readonly special: {
readonly interrupted: {
readonly name: "ai-interrupted";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "AI processing was interrupted";
readonly options: {
readonly debounce: 200;
};
};
readonly escToInterrupt: {
readonly name: "ai-esc-hint";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Hint that ESC key can interrupt";
readonly options: {
readonly debounce: 500;
};
};
};
readonly terminal: {
readonly setTitle: {
readonly name: "terminal-set-title";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Terminal window/tab title change (OSC 0)";
readonly options: {
readonly debounce: 100;
};
};
readonly setWindowTitle: {
readonly name: "terminal-set-window-title";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Terminal window title change (OSC 2)";
readonly options: {
readonly debounce: 100;
};
};
readonly setIconTitle: {
readonly name: "terminal-set-icon-title";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Terminal icon/tab title change (OSC 1)";
readonly options: {
readonly debounce: 100;
};
};
readonly claudeTitle: {
readonly name: "claude-title-change";
readonly type: "regex";
readonly pattern: RegExp;
readonly description: "Claude changing terminal title with context";
readonly options: {
readonly debounce: 200;
};
};
};
};
export declare function getAllAgenticPatterns(): PatternConfig[];
export declare function getAgenticPatternsByCategory(category: keyof typeof AgenticCodingPatterns): PatternConfig[];
export declare function extractActionWord(text: string): string | null;
export declare function extractTerminalTitle(text: string): {
type: 'window' | 'icon' | 'both';
title: string;
} | null;
export interface AIStatus {
type: 'thinking' | 'loading-context' | 'waiting-input' | 'idle';
animation?: string;
actionWord?: string;
duration?: string;
tokens?: string;
contextProgress?: number;
terminalTitle?: string;
}
export declare function detectAIStatus(text: string): AIStatus | null;
//# sourceMappingURL=AgenticCodingPatterns.d.ts.map