MCPcopy Index your code
hub / github.com/anomalyco/opencode / clientFor

Function clientFor

packages/app/src/components/prompt-input/submit.test.ts:49–75  ·  view source on GitHub ↗
(directory: string)

Source from the content-addressed store, hash-verified

47}
48
49const clientFor = (directory: string) => {
50 createdClients.push(directory)
51 return {
52 session: {
53 create: async () => {
54 createdSessions.push(directory)
55 return {
56 data: {
57 id: `session-${createdSessions.length}`,
58 title: `New session ${createdSessions.length}`,
59 },
60 }
61 },
62 shell: async () => {
63 sentShell.push(directory)
64 return { data: undefined }
65 },
66 prompt: async () => ({ data: undefined }),
67 promptAsync: async () => ({ data: undefined }),
68 command: async () => ({ data: undefined }),
69 abort: async () => ({ data: undefined }),
70 },
71 worktree: {
72 create: async () => ({ data: { directory: `${directory}/new` } }),
73 },
74 }
75}
76
77beforeAll(async () => {
78 const rootClient = clientFor("/repo/main")

Callers 2

submit.test.tsFile · 0.85
createClientFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected