feat(coding): add PI-105 product file host API
This commit is contained in:
100
shared/coding-product-tools.ts
Normal file
100
shared/coding-product-tools.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
import type { BundledCodingSkillId } from './coding-skills';
|
||||
|
||||
export type CodingProjectFileStatus =
|
||||
| 'added'
|
||||
| 'modified'
|
||||
| 'deleted'
|
||||
| 'renamed'
|
||||
| '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: BundledCodingSkillId;
|
||||
name: string;
|
||||
description: string;
|
||||
selected: boolean;
|
||||
}
|
||||
|
||||
export interface ProductCodingCommand {
|
||||
name: string;
|
||||
title: string;
|
||||
description: string;
|
||||
source: 'makelore' | 'pi' | 'skill';
|
||||
skillId?: BundledCodingSkillId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user