mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
feat(session): surface background shell and subagent work (#360)
* feat(session): surface background shell and subagent work * fix(session): address review feedback on background work UI
This commit is contained in:
1 parent
8b806e865f
commit
1389e8e59c
20 files changed
+802
-13
No files matched your search
@@ -26,6 +26,10 @@ export type PromptSkillInput = NonNullable<SessionPromptInput['skills']>[number]
|
||||
|
||||
export type ActiveSessions = Awaited<ReturnType<OpenCodeApi['session']['active']>>
|
||||
|
||||
export type ShellInfo = Awaited<ReturnType<OpenCodeApi['shell']['list']>>['data'][number]
|
||||
|
||||
export type ShellOutputChunk = Awaited<ReturnType<OpenCodeApi['shell']['output']>>['data']
|
||||
|
||||
export interface SessionPage {
|
||||
items: SessionInfo[]
|
||||
nextCursor?: string
|
||||
@@ -167,6 +171,31 @@ export async function interruptSession(sessionID: string): Promise<void> {
|
||||
await callOpenCode((api) => api.session.interrupt({ sessionID }))
|
||||
}
|
||||
|
||||
export async function backgroundSession(sessionID: string): Promise<void> {
|
||||
await callOpenCode((api) => api.session.background({ sessionID }))
|
||||
}
|
||||
|
||||
export async function listShells(directory: string): Promise<ShellInfo[]> {
|
||||
const { data } = await callOpenCode((api) => api.shell.list(openCodeLocation(directory)))
|
||||
return data
|
||||
}
|
||||
|
||||
export async function readShellOutput(
|
||||
id: string,
|
||||
directory: string,
|
||||
cursor: number,
|
||||
limit: number,
|
||||
): Promise<ShellOutputChunk> {
|
||||
const { data } = await callOpenCode((api) =>
|
||||
api.shell.output({ id, cursor, limit, ...openCodeLocation(directory) }),
|
||||
)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function removeShell(id: string, directory: string): Promise<void> {
|
||||
await callOpenCode((api) => api.shell.remove({ id, ...openCodeLocation(directory) }))
|
||||
}
|
||||
|
||||
export async function stageRevert(sessionID: string, messageID: string): Promise<SessionRevert> {
|
||||
return callOpenCode((api) => api.session.revert.stage({ sessionID, messageID }))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user