feat: 初始化项目结构与核心文件
- 添加项目配置文件(tsconfig.json、bunfig.toml、.gitignore、.env.example) - 创建文档架构图(00runtime.png 至 08-state-data-flow.png) - 添加核心工具常量定义(FileEditTool、AgentTool、BashTool 等) - 实现基础命令框架(help、exit、config、model 等) - 添加 Ink TUI 组件库和布局引擎 - 包含内存管理、沙箱、shell 工具等基础工具类 - 设置预加载脚本和版本信息
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
export type PermissionMode =
|
||||
| 'ask'
|
||||
| 'skip_all_permission_checks'
|
||||
| 'follow_a_plan';
|
||||
|
||||
export type Logger = {
|
||||
silly?: (...args: unknown[]) => void;
|
||||
debug?: (...args: unknown[]) => void;
|
||||
info?: (...args: unknown[]) => void;
|
||||
warn?: (...args: unknown[]) => void;
|
||||
error?: (...args: unknown[]) => void;
|
||||
};
|
||||
|
||||
export type ClaudeForChromeContext = Record<string, unknown>;
|
||||
|
||||
export const BROWSER_TOOLS: Array<{ name: string }> = [];
|
||||
|
||||
export function createClaudeForChromeMcpServer(
|
||||
_context: ClaudeForChromeContext,
|
||||
) {
|
||||
return {
|
||||
async connect(_transport: unknown): Promise<void> {},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
export type SyntaxTheme = {
|
||||
theme: string;
|
||||
source: string | null;
|
||||
};
|
||||
|
||||
export class ColorDiff {
|
||||
private hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] };
|
||||
private filePath: string;
|
||||
private firstLine: string | null;
|
||||
private prefixContent: string | null;
|
||||
|
||||
constructor(
|
||||
hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] },
|
||||
firstLine: string | null,
|
||||
filePath: string,
|
||||
prefixContent?: string | null,
|
||||
) {
|
||||
this.hunk = hunk;
|
||||
this.filePath = filePath;
|
||||
this.firstLine = firstLine;
|
||||
this.prefixContent = prefixContent ?? null;
|
||||
}
|
||||
|
||||
render(themeName: string, width: number, dim: boolean): string[] | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export class ColorFile {
|
||||
private code: string;
|
||||
private filePath: string;
|
||||
|
||||
constructor(code: string, filePath: string) {
|
||||
this.code = code;
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
render(themeName: string, width: number, dim: boolean): string[] | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function getSyntaxTheme(themeName: string): SyntaxTheme {
|
||||
return { theme: themeName, source: null };
|
||||
}
|
||||
Reference in New Issue
Block a user