mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
feat(servers): run Manager automation on linked servers
This commit is contained in:
1 parent
c591c15743
commit
a9bdb8358f
131 files changed
+6568
-949
No files matched your search
@@ -57,7 +57,7 @@ function metaFrame(cursor: number): ArrayBuffer {
|
||||
function renderSocket(overrides: Partial<Parameters<typeof useTerminalSocket>[0]> = {}) {
|
||||
return renderHook(() =>
|
||||
useTerminalSocket({
|
||||
repoId: 1,
|
||||
target: { kind: 'repo', repoId: 1 },
|
||||
directory: '/work/repo',
|
||||
ptyID: 'pty-1',
|
||||
onOutput: vi.fn(),
|
||||
@@ -87,6 +87,13 @@ describe('useTerminalSocket', () => {
|
||||
expect(url.searchParams.get('directory')).toBe('/work/repo')
|
||||
})
|
||||
|
||||
it('builds the connection url for a linked server target', () => {
|
||||
renderSocket({ target: { kind: 'server', serverId: 'srv_kitchen' } })
|
||||
const url = new URL(FakeWebSocket.instances[0].url)
|
||||
expect(url.pathname).toBe('/api/opencode-servers/srv_kitchen/terminals/pty-1/connect')
|
||||
expect(url.searchParams.get('directory')).toBe('/work/repo')
|
||||
})
|
||||
|
||||
it('accumulates the cursor and sends it when reconnecting after 1006', () => {
|
||||
renderSocket()
|
||||
const first = FakeWebSocket.instances[0]
|
||||
|
||||
Reference in new issue
Block a user