Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"better-sqlite3-multiple-ciphers": "12.4.1",
"cheerio": "^1.1.2",
"compare-versions": "^6.1.1",
"cross-spawn": "^7.0.6",
"diff": "^7.0.0",
"electron-log": "^5.4.3",
"electron-store": "^8.2.0",
Expand Down
14 changes: 12 additions & 2 deletions src/main/presenter/configPresenter/acpConfHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const BUILTIN_TEMPLATES: Record<AcpBuiltinAgentId, BuiltinTemplate> = {
name: DEFAULT_PROFILE_NAME,
command: 'npx',
args: ['-y', '@zed-industries/claude-code-acp'],
env: { ANTHROPIC_API_KEY: '' }
env: {}
})
},
'codex-acp': {
Expand All @@ -44,14 +44,15 @@ const BUILTIN_TEMPLATES: Record<AcpBuiltinAgentId, BuiltinTemplate> = {
name: DEFAULT_PROFILE_NAME,
command: 'npx',
args: ['-y', '@zed-industries/codex-acp'],
env: { OPENAI_API_KEY: '' }
env: {}
})
}
}

type InternalStore = Partial<AcpStoreData> & {
agents?: AcpAgentConfig[]
builtinsVersion?: string
useBuiltinRuntime?: boolean
}

const deepClone = <T>(value: T): T => {
Expand All @@ -71,6 +72,7 @@ export class AcpConfHelper {
builtins: [],
customs: [],
enabled: false,
useBuiltinRuntime: false,
version: ACP_STORE_VERSION
}
})
Expand All @@ -92,6 +94,14 @@ export class AcpConfHelper {
return true
}

getUseBuiltinRuntime(): boolean {
return Boolean(this.store.get('useBuiltinRuntime'))
}

setUseBuiltinRuntime(enabled: boolean): void {
this.store.set('useBuiltinRuntime', enabled)
}

getEnabledAgents(): AcpAgentConfig[] {
const data = this.getData()
if (!data.enabled) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/presenter/configPresenter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,14 @@ export class ConfigPresenter implements IConfigPresenter {
this.notifyAcpAgentsChanged()
}

async getAcpUseBuiltinRuntime(): Promise<boolean> {
return this.acpConfHelper.getUseBuiltinRuntime()
}

async setAcpUseBuiltinRuntime(enabled: boolean): Promise<void> {
this.acpConfHelper.setUseBuiltinRuntime(enabled)
}

// ===================== ACP configuration methods =====================
async getAcpAgents(): Promise<AcpAgentConfig[]> {
return this.acpConfHelper.getEnabledAgents()
Expand Down
Loading