refactor: remove unused imports from interactive-bash-session, session-recovery, start-work
This commit is contained in:
parent
1ba330f8ca
commit
bfabad7681
@ -1,5 +1,5 @@
|
|||||||
import type { PluginInput } from "@opencode-ai/plugin";
|
import type { PluginInput } from "@opencode-ai/plugin";
|
||||||
import { loadInteractiveBashSessionState, saveInteractiveBashSessionState, clearInteractiveBashSessionState } from "./storage";
|
import { saveInteractiveBashSessionState, clearInteractiveBashSessionState } from "./storage";
|
||||||
import { buildSessionReminderMessage } from "./constants";
|
import { buildSessionReminderMessage } from "./constants";
|
||||||
import type { InteractiveBashSessionState } from "./types";
|
import type { InteractiveBashSessionState } from "./types";
|
||||||
import { tokenizeCommand, findSubcommand, extractSessionNameFromTokens } from "./parser";
|
import { tokenizeCommand, findSubcommand, extractSessionNameFromTokens } from "./parser";
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import type { InteractiveBashSessionState } from "./types";
|
import type { InteractiveBashSessionState } from "./types";
|
||||||
import { loadInteractiveBashSessionState, saveInteractiveBashSessionState } from "./storage";
|
import { loadInteractiveBashSessionState } from "./storage";
|
||||||
import { OMO_SESSION_PREFIX } from "./constants";
|
import { OMO_SESSION_PREFIX } from "./constants";
|
||||||
import { subagentSessions } from "../../features/claude-code-session-state";
|
|
||||||
|
|
||||||
export function getOrCreateState(sessionID: string, sessionStates: Map<string, InteractiveBashSessionState>): InteractiveBashSessionState {
|
export function getOrCreateState(sessionID: string, sessionStates: Map<string, InteractiveBashSessionState>): InteractiveBashSessionState {
|
||||||
if (!sessionStates.has(sessionID)) {
|
if (!sessionStates.has(sessionID)) {
|
||||||
@ -32,9 +31,4 @@ export async function killAllTrackedSessions(
|
|||||||
await proc.exited;
|
await proc.exited;
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const sessionId of subagentSessions) {
|
|
||||||
// Note: ctx is not available here, so we can't call ctx.client.session.abort
|
|
||||||
// This will need to be handled in the hook where ctx is available
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,16 +8,6 @@ import { isRecord } from "../../../shared/record-type-guard"
|
|||||||
|
|
||||||
type OpencodeClient = PluginInput["client"]
|
type OpencodeClient = PluginInput["client"]
|
||||||
|
|
||||||
function isStoredPart(value: unknown): value is StoredPart {
|
|
||||||
if (!isRecord(value)) return false
|
|
||||||
return (
|
|
||||||
typeof value.id === "string" &&
|
|
||||||
typeof value.sessionID === "string" &&
|
|
||||||
typeof value.messageID === "string" &&
|
|
||||||
typeof value.type === "string"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function readParts(messageID: string): StoredPart[] {
|
export function readParts(messageID: string): StoredPart[] {
|
||||||
if (isSqliteBackend()) return []
|
if (isSqliteBackend()) return []
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
clearBoulderState,
|
clearBoulderState,
|
||||||
} from "../../features/boulder-state"
|
} from "../../features/boulder-state"
|
||||||
import { log } from "../../shared/logger"
|
import { log } from "../../shared/logger"
|
||||||
import { getSessionAgent, updateSessionAgent } from "../../features/claude-code-session-state"
|
import { updateSessionAgent } from "../../features/claude-code-session-state"
|
||||||
|
|
||||||
export const HOOK_NAME = "start-work" as const
|
export const HOOK_NAME = "start-work" as const
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user