(domRef: Ref<HTMLElement>)
| 149 | } |
| 150 | |
| 151 | async installOpenCode(domRef: Ref<HTMLElement>) { |
| 152 | if (this.installing) { |
| 153 | return |
| 154 | } |
| 155 | this.currentAction = 'install' |
| 156 | this.installEnd = false |
| 157 | this.installing = true |
| 158 | await nextTick() |
| 159 | |
| 160 | const execXTerm = new XTerm() |
| 161 | this.xterm = markRaw(execXTerm) |
| 162 | await execXTerm.mount(domRef.value) |
| 163 | const installPlatform: InstallProxyPlatform = window.Server.isWindows |
| 164 | ? 'windows' |
| 165 | : window.Server.isMacOS |
| 166 | ? 'macos' |
| 167 | : 'linux' |
| 168 | const command = buildInstallProxyEnvCommands( |
| 169 | installPlatform, |
| 170 | (window.Server.Proxy ?? {}) as Record<string, string> |
| 171 | ) |
| 172 | command.push('npm install -g opencode-ai') |
| 173 | await execXTerm.send(command, false) |
| 174 | this.installEnd = true |
| 175 | } |
| 176 | |
| 177 | doAction(item: CommandItem) { |
| 178 | clipboard.writeText(item.label).then(() => { |
nothing calls this directly
no test coverage detected