feat: complete WorkBuddy parity and Windows release workflow
This commit is contained in:
1 parent
143516b3a8
commit
d5512df549
434 files changed
+54977
-1854
No files matched your search
+68
-5
@@ -17,15 +17,23 @@ import type {
|
||||
PersonalizationPatch,
|
||||
PersonalizationSettings,
|
||||
AgentSettings,
|
||||
AgentSettingsPatch
|
||||
AgentSettingsPatch,
|
||||
MemoryPreferencesPatch,
|
||||
MemorySettingsView,
|
||||
TokenUsage
|
||||
} from './types'
|
||||
import type { ContextUsageInfo } from './types'
|
||||
import type { DownloadPayload, DownloadResult, ResourceEntry, ResourceRange, WorkspaceResource } from './resources'
|
||||
import type { ChatAttachment, InteractionResponse, MessageQuote, PermissionMode } from './conversation'
|
||||
import type { CustomModelInput, ModelRegistryView, ModelTestResult } from './models'
|
||||
import type { SandboxStatus, SandboxPolicyDocument, SandboxPolicyUpdate, SandboxSelfTestSummary, SandboxOperationView, SandboxBrokerOperationView, SandboxWorkspaceView, SandboxGitHostView, SandboxGitRemoteResult } from './sandbox'
|
||||
import type { CustomModelInput, ModelRegistryView, ModelTestResult, ModelDiscoveryInput, ModelDiscoveryResult, ModelMetadata, ModelMetadataStatus, ModelProtocol } from './models'
|
||||
import type { SessionContext, WorkspaceRegistryView } from './workspaces'
|
||||
import type { BrowserHostApi } from './browser-host'
|
||||
import type { TerminalHostApi } from './terminal-host'
|
||||
import type { ExpertsApi, McpApi, SkillsApi } from './capabilities'
|
||||
import type { ProjectInput, ProjectRecord } from './projects'
|
||||
import type { AutomationApi } from './automation-api'
|
||||
import type { LibraryApi } from './library'
|
||||
|
||||
export interface ConfigPatchLike {
|
||||
speechBaseUrl?: string
|
||||
@@ -39,6 +47,15 @@ export interface ConfigPatchLike {
|
||||
|
||||
export type EditAction = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'selectAll'
|
||||
|
||||
export interface RewindOptions {
|
||||
rollbackArtifacts?: boolean
|
||||
}
|
||||
|
||||
export interface EditInspection {
|
||||
editable: boolean
|
||||
reason?: string
|
||||
}
|
||||
|
||||
export interface SendPayload {
|
||||
skillIds?: string[]
|
||||
planId?: string
|
||||
@@ -48,10 +65,13 @@ export interface SendPayload {
|
||||
attachments?: ChatAttachment[]
|
||||
/** 表格等内容的引用快照,随用户消息持久化。 */
|
||||
quotes?: MessageQuote[]
|
||||
userContent?: import('./conversation').UserContentBlock[]
|
||||
permissionMode?: PermissionMode
|
||||
/** Retry/edit from this message; descendants are preserved in an archived branch. */
|
||||
fromMessageId?: string
|
||||
action?: 'edit' | 'resend' | 'regenerate'
|
||||
/** Editing can retain the current files after an explicit user choice. */
|
||||
rollbackArtifacts?: boolean
|
||||
}
|
||||
|
||||
export interface SendResult {
|
||||
@@ -65,6 +85,13 @@ export interface SendResult {
|
||||
messages?: ChatMessage[]
|
||||
}
|
||||
|
||||
export interface ActiveChatRun extends SendResult {
|
||||
sessionId: string
|
||||
sequence: number
|
||||
messages: ChatMessage[]
|
||||
usage?: TokenUsage
|
||||
}
|
||||
|
||||
/** 统一的返回包装,便于渲染进程处理错误而不炸掉 UI */
|
||||
export type Ipc<T> = Promise<T>
|
||||
|
||||
@@ -75,6 +102,13 @@ export interface WorkspaceAttachResult extends WorkspaceRegistryView {
|
||||
|
||||
/** preload 暴露给渲染进程的 API 形状 */
|
||||
export interface YCodeApi {
|
||||
automation: AutomationApi
|
||||
library: LibraryApi
|
||||
projects: {
|
||||
list(): Ipc<ProjectRecord[]>
|
||||
create(input: ProjectInput): Ipc<ProjectRecord>
|
||||
update(projectId: string, patch: Partial<ProjectInput>): Ipc<ProjectRecord>
|
||||
}
|
||||
experts: ExpertsApi
|
||||
skills: SkillsApi
|
||||
mcp: McpApi
|
||||
@@ -93,10 +127,23 @@ export interface YCodeApi {
|
||||
}
|
||||
app: {
|
||||
info(): Ipc<AppInfo>
|
||||
sandboxStatus(): Ipc<SandboxStatus>
|
||||
sandboxPolicy(): Ipc<SandboxPolicyDocument>
|
||||
setSandboxPolicy(update: Pick<SandboxPolicyUpdate, 'expectedRevision' | 'rules'>): Ipc<SandboxPolicyDocument>
|
||||
sandboxSelfTest(): Ipc<SandboxSelfTestSummary>
|
||||
sandboxOperation(id: string): Ipc<SandboxOperationView>
|
||||
sandboxBrokerOperation(runId: string, requestId: string): Ipc<SandboxBrokerOperationView>
|
||||
sandboxWorkspace(sessionId: string): Ipc<SandboxWorkspaceView>
|
||||
sandboxGit(sessionId: string): Ipc<SandboxGitHostView>
|
||||
sandboxGitRemoteOperation(sessionId: string, operationId: string): Ipc<SandboxGitRemoteResult>
|
||||
onSandboxChanged(listener: () => void): () => void
|
||||
openConfigDir(): Ipc<void>
|
||||
openSettings(section?: string, action?: 'new'): Ipc<void>
|
||||
onSettingsChanged(listener: () => void): () => void
|
||||
onSettingsNavigate(listener: (section: string, action?: 'new') => void): () => void
|
||||
settingsReady(): Ipc<void>
|
||||
settingsRendered(requestId: number): Ipc<void>
|
||||
onSettingsClosed(listener: () => void): () => void
|
||||
onSettingsNavigate(listener: (section: string, action?: 'new', requestId?: number) => void): () => void
|
||||
}
|
||||
git: {
|
||||
/** 读取某个会话工作目录的真实分支信息;目录不在仓库内或 git 不可用时返回 repo:false/unavailable。 */
|
||||
@@ -127,6 +174,12 @@ export interface YCodeApi {
|
||||
get(): Ipc<AgentSettings>
|
||||
update(patch: AgentSettingsPatch): Ipc<AgentSettings>
|
||||
}
|
||||
/** 设置 → 记忆与进化:偏好、长期记忆正文与导入。 */
|
||||
memory: {
|
||||
get(): Ipc<MemorySettingsView>
|
||||
update(patch: MemoryPreferencesPatch): Ipc<MemorySettingsView>
|
||||
import(input: { content: string }): Ipc<MemorySettingsView>
|
||||
}
|
||||
workspace: {
|
||||
get(): Ipc<WorkspaceInfo>
|
||||
choose(): Ipc<WorkspaceInfo & { changed: boolean }>
|
||||
@@ -139,6 +192,10 @@ export interface YCodeApi {
|
||||
open(id: string): Ipc<void>
|
||||
}
|
||||
models: {
|
||||
fetch(input: ModelDiscoveryInput): Ipc<ModelDiscoveryResult>
|
||||
metadata(model: string, protocol?: ModelProtocol): Ipc<ModelMetadata | null>
|
||||
metadataStatus(): Ipc<ModelMetadataStatus>
|
||||
refreshMetadata(): Ipc<ModelMetadataStatus>
|
||||
list(): Ipc<ModelRegistryView>
|
||||
save(input: CustomModelInput, overwrite?: boolean): Ipc<ModelRegistryView>
|
||||
remove(id: string): Ipc<ModelRegistryView>
|
||||
@@ -158,6 +215,7 @@ export interface YCodeApi {
|
||||
attachments: {
|
||||
pick(): Ipc<ChatAttachment[]>
|
||||
stage(payload: { name: string; mimeType: string; dataBase64: string }): Ipc<ChatAttachment>
|
||||
preview(id: string): Ipc<WorkspaceResource>
|
||||
remove(id: string): Ipc<void>
|
||||
}
|
||||
speech: {
|
||||
@@ -169,8 +227,9 @@ export interface YCodeApi {
|
||||
create(title?: string, context?: SessionContext): Ipc<SessionMeta>
|
||||
updateContext(id: string, context: SessionContext): Ipc<SessionMeta>
|
||||
messages(sessionId: string): Ipc<ChatMessage[]>
|
||||
contextUsage(sessionId: string): Ipc<ContextUsageInfo>
|
||||
rename(sessionId: string, title: string): Ipc<void>
|
||||
remove(sessionId: string): Ipc<void>
|
||||
remove(sessionId: string, options?: { onlyIfEmpty?: boolean }): Ipc<void>
|
||||
/** 置顶/取消置顶;返回刷新后的元信息。 */
|
||||
setPinned(sessionId: string, pinned: boolean): Ipc<SessionMeta>
|
||||
/** 归档/取消归档;不删除消息与工作目录。 */
|
||||
@@ -181,10 +240,14 @@ export interface YCodeApi {
|
||||
openWindow(sessionId: string): Ipc<void>
|
||||
}
|
||||
chat: {
|
||||
revert(sessionId: string, userMessageId: string): Ipc<{ messages: ChatMessage[] }>
|
||||
activeRun(sessionId: string): Ipc<ActiveChatRun | null>
|
||||
onStarted(listener: (run: ActiveChatRun) => void): () => void
|
||||
inspectEdit(sessionId: string, userMessageId: string): Ipc<EditInspection>
|
||||
revert(sessionId: string, userMessageId: string, options?: RewindOptions): Ipc<{ messages: ChatMessage[] }>
|
||||
feedback(sessionId: string, messageId: string, value: 'like' | 'dislike'): Ipc<void>
|
||||
send(payload: SendPayload): Ipc<SendResult>
|
||||
cancel(runId: string): Ipc<{ cancelled: boolean }>
|
||||
cancelAgent(runId: string, agentId: string): Ipc<{ cancelled: boolean }>
|
||||
respond(runId: string, interactionId: string, response: InteractionResponse): Ipc<{ accepted: boolean }>
|
||||
/** 返回取消订阅函数 */
|
||||
onEvent(listener: (event: ChatEvent) => void): () => void
|
||||
|
||||
Reference in new issue
Block a user