feat(coding): add PI-105 product file host API
This commit is contained in:
@@ -1,29 +1,23 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
import { open, stat } from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import type {
|
||||
ConversationChangedFile,
|
||||
ConversationChangesSnapshot,
|
||||
CodingProjectFileStatus,
|
||||
} from '../../shared/coding-product-tools';
|
||||
|
||||
export type {
|
||||
ConversationChangedFile,
|
||||
ConversationChangesSnapshot,
|
||||
} from '../../shared/coding-product-tools';
|
||||
|
||||
const MAX_CHANGED_FILES = 200;
|
||||
const MAX_DIFF_BYTES = 64 * 1024;
|
||||
const MAX_UNTRACKED_PREVIEW_BYTES = 8 * 1024;
|
||||
const MAX_GIT_OUTPUT_BYTES = 8 * 1024 * 1024;
|
||||
|
||||
export type ConversationChangedFileStatus = 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
|
||||
|
||||
export interface ConversationChangedFile {
|
||||
path: string;
|
||||
status: ConversationChangedFileStatus;
|
||||
diff?: string;
|
||||
preview?: string;
|
||||
truncated?: boolean;
|
||||
}
|
||||
|
||||
export interface ConversationChangesSnapshot {
|
||||
conversationId: string;
|
||||
runId: string;
|
||||
git: boolean;
|
||||
baselineHead: string | null;
|
||||
files: ConversationChangedFile[];
|
||||
}
|
||||
export type ConversationChangedFileStatus = CodingProjectFileStatus;
|
||||
|
||||
export interface GitCommandResult {
|
||||
code: number;
|
||||
|
||||
Reference in New Issue
Block a user