feat(coding): add PI-105 product file host API

This commit is contained in:
2026-08-23 18:17:30 +08:00
parent 7680bfb0cf
commit 9520872d2f
17 changed files with 1419 additions and 38 deletions

View 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;
}