diff options
| author | Adam Malczewski <[email protected]> | 2026-06-27 01:12:40 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-27 01:12:40 +0900 |
| commit | 98b0638838a8e754927d8c030ce8bded18d63e7d (patch) | |
| tree | 0d4e21c3d4792fcd77e1040373b260e38efa34ce /packages/exec-backend/src/extension.ts | |
| parent | d92a4af6191d7d20acf861adf605ad0227b6b287 (diff) | |
| parent | 61e45e60d699ed1ca46f94a8f181c92a940317c6 (diff) | |
| download | dispatch-98b0638838a8e754927d8c030ce8bded18d63e7d.tar.gz dispatch-98b0638838a8e754927d8c030ce8bded18d63e7d.zip | |
Merge branch 'dev' into feature/heartbeat
# Conflicts:
# packages/host-bin/package.json
# packages/host-bin/src/main.ts
# packages/session-orchestrator/src/orchestrator.ts
# packages/system-prompt/src/service.test.ts
# packages/system-prompt/src/service.ts
# packages/system-prompt/src/types.ts
# packages/transport-contract/package.json
# packages/transport-http/package.json
# packages/transport-http/src/app.test.ts
# packages/transport-http/src/app.ts
# packages/transport-http/src/extension.ts
# packages/transport-http/tsconfig.json
# tsconfig.json
Diffstat (limited to 'packages/exec-backend/src/extension.ts')
| -rw-r--r-- | packages/exec-backend/src/extension.ts | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/packages/exec-backend/src/extension.ts b/packages/exec-backend/src/extension.ts index 9d6840a..5697842 100644 --- a/packages/exec-backend/src/extension.ts +++ b/packages/exec-backend/src/extension.ts @@ -2,19 +2,19 @@ import type { Extension, HostAPI, Manifest } from "@dispatch/kernel"; import type { ExecBackend } from "./backend.js"; import { localExecBackend } from "./local.js"; import { - type ExecBackendResolver, - execBackendHandle, - remoteExecBackendFactoryHandle, + type ExecBackendResolver, + execBackendHandle, + remoteExecBackendFactoryHandle, } from "./service.js"; export const manifest: Manifest = { - id: "exec-backend", - name: "Exec Backend", - version: "0.0.0", - apiVersion: "^0.1.0", - trust: "bundled", - activation: "eager", - contributes: { services: ["exec-backend/resolver"] }, + id: "exec-backend", + name: "Exec Backend", + version: "0.0.0", + apiVersion: "^0.1.0", + trust: "bundled", + activation: "eager", + contributes: { services: ["exec-backend/resolver"] }, }; /** @@ -36,22 +36,22 @@ export const manifest: Manifest = { * inside the first backend method call, not at resolve time. */ function createResolver(host: HostAPI): ExecBackendResolver { - return (computerId?: string): ExecBackend => { - if (computerId === undefined) return localExecBackend; - // computerId set → remote. Look up the factory the `ssh` extension provides. - // `host.getService` throws when nothing provided the handle (ssh not loaded); - // convert that into a clear "not configured" error rather than a crash. - let factory: (computerId: string) => ExecBackend; - try { - factory = host.getService(remoteExecBackendFactoryHandle); - } catch { - throw new Error( - `SSH remote execution is not configured: the ssh extension is not loaded ` + - `(requested computerId="${computerId}"). Load the ssh package to enable remote execution.`, - ); - } - return factory(computerId); - }; + return (computerId?: string): ExecBackend => { + if (computerId === undefined) return localExecBackend; + // computerId set → remote. Look up the factory the `ssh` extension provides. + // `host.getService` throws when nothing provided the handle (ssh not loaded); + // convert that into a clear "not configured" error rather than a crash. + let factory: (computerId: string) => ExecBackend; + try { + factory = host.getService(remoteExecBackendFactoryHandle); + } catch { + throw new Error( + `SSH remote execution is not configured: the ssh extension is not loaded ` + + `(requested computerId="${computerId}"). Load the ssh package to enable remote execution.`, + ); + } + return factory(computerId); + }; } /** @@ -63,11 +63,11 @@ function createResolver(host: HostAPI): ExecBackendResolver { * until `ssh` is loaded, a remote request fails with a clear error. */ export function createExecBackendExtension(): Extension { - return { - manifest, - activate(host) { - const resolver: ExecBackendResolver = createResolver(host); - host.provideService(execBackendHandle, resolver); - }, - }; + return { + manifest, + activate(host) { + const resolver: ExecBackendResolver = createResolver(host); + host.provideService(execBackendHandle, resolver); + }, + }; } |
