Files
makelore/shared/coding-product-tools.ts

107 lines
2.1 KiB
TypeScript

import type { CodingSkillId } from './coding-skills';
export type CodingProjectFileStatus =
| 'added'
| 'modified'
| 'deleted'
| 'renamed'
| 'conflicted'
| 'untracked';
export interface CodingProjectFileEntry {
path: string;
name: string;
type: 'file';
status?: CodingProjectFileStatus;
size?: number;
}
export interface CodingProjectFileContent {
path: string;
content: string;
truncated: boolean;
}
export interface CodingTextSearchSubmatch {
text: string;
start: number;
end: number;
}
export interface CodingTextSearchResult {
path: string;
name: string;
lineNumber: number;
lineText: string;
submatches: CodingTextSearchSubmatch[];
}
export interface ConversationChangedFile {
path: string;
status: CodingProjectFileStatus;
diff?: string;
preview?: string;
truncated?: boolean;
}
export interface ConversationChangesSnapshot {
conversationId: string;
runId: string;
git: boolean;
baselineHead: string | null;
files: ConversationChangedFile[];
}
export interface ProductCodingSkill {
id: CodingSkillId;
name: string;
description: string;
selected: boolean;
available: boolean;
effective: boolean;
location: string;
content: string;
entries: Array<{ path: string; type: 'file' | 'directory' }>;
}
export interface ProductCodingCommand {
name: string;
title: string;
description: string;
source: 'makelore' | 'pi' | 'skill';
skillId?: CodingSkillId;
}
export interface ProductPiCommandInput {
name: string;
description?: string;
}
export interface CodingFileStatusResponse {
files: CodingProjectFileEntry[];
}
export interface CodingFileFindResponse {
files: CodingProjectFileEntry[];
}
export interface CodingFileContentResponse {
file: CodingProjectFileContent;
}
export interface CodingTextSearchResponse {
matches: CodingTextSearchResult[];
}
export interface CodingSkillsResponse {
skills: ProductCodingSkill[];
}
export interface CodingCommandsResponse {
commands: ProductCodingCommand[];
}
export interface CodingChangesResponse {
changes: ConversationChangesSnapshot | null;
}