mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
* refactor(pty): delete the SSH PTY provider and its registry slot Nothing in production registers an SSH PTY provider, so the registry's SSH map was always empty: every SSH lookup answered undefined or threw the 'No PTY provider for connection' error. Delete the provider stack, its consumer-session and source-recovery contracts, the registry maps and the getSshProvider dependency, keeping each caller's existing result for an absent provider. The registry now dispatches only 'local'; any other host throws PtyHostNotDispatchableError, which keeps the renderer-matched message for SSH ids and is never read as a gone or exited PTY. * test(pty): keep the no-provider SSH routing cases in local-only form * test: reword a comment naming the deleted SSH PTY provider * test: drop an import the rebase left unused --------- Co-authored-by: m4air <m4air@Mac.localdomain>
50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { join } from 'node:path'
|
|
import type { RuntimeSkillCommandHost } from './runtime-skill-command-contract'
|
|
import { RuntimeSkillInstallQueries } from './runtime-skill-install-queries'
|
|
|
|
describe('RuntimeSkillInstallQueries', () => {
|
|
it('fails an SSH inventory without a host to read it from', async () => {
|
|
const host: RuntimeSkillCommandHost = {
|
|
getRuntimeId: () => 'runtime-1',
|
|
getUserDataPath: () => '/tmp/orca-runtime-skill-test',
|
|
isPackaged: () => true,
|
|
getSettings: () => ({}),
|
|
listRepos: () => [{ id: 'repo-1', path: '/remote/app', connectionId: 'ssh-1' }],
|
|
listFolderWorkspaces: () => [],
|
|
listResolvedWorktrees: async () => [],
|
|
showManagedWorktree: async () => {
|
|
throw new Error('unused')
|
|
},
|
|
skillTransactionRecovery: Promise.resolve()
|
|
}
|
|
|
|
await expect(
|
|
new RuntimeSkillInstallQueries(host).listManagedSkillInstalls('ssh-1')
|
|
).rejects.toThrow('skill-install-ssh-relay-unavailable')
|
|
})
|
|
|
|
it('uses the account-managed Claude config directory for global discovery', async () => {
|
|
const host: RuntimeSkillCommandHost = {
|
|
getRuntimeId: () => 'runtime-1',
|
|
getUserDataPath: () => '/tmp/orca-runtime-skill-test',
|
|
isPackaged: () => true,
|
|
getSettings: () => ({}),
|
|
listRepos: () => [],
|
|
listFolderWorkspaces: () => [],
|
|
listResolvedWorktrees: async () => [],
|
|
showManagedWorktree: async () => {
|
|
throw new Error('unused')
|
|
},
|
|
getClaudeConfigDirectory: () => '/accounts/claude/managed',
|
|
skillTransactionRecovery: Promise.resolve()
|
|
}
|
|
|
|
await expect(
|
|
new RuntimeSkillInstallQueries(host).resolveSkillDiscoveryProviderRoots({
|
|
kind: 'native-host'
|
|
})
|
|
).resolves.toMatchObject({ claude: join('/accounts/claude/managed', 'skills') })
|
|
})
|
|
})
|