Files
oh-my-opencode/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts
T
2026-03-14 04:56:50 +00:00

72 lines
2.0 KiB
TypeScript

import type { BackgroundManager } from "../../features/background-agent";
type BabysittingConfig = {
timeout_ms?: number;
};
type BabysitterContext = {
directory: string;
client: {
session: {
messages: (args: {
path: {
id: string;
};
}) => Promise<{
data?: unknown;
} | unknown[]>;
prompt: (args: {
path: {
id: string;
};
body: {
parts: Array<{
type: "text";
text: string;
}>;
agent?: string;
model?: {
providerID: string;
modelID: string;
};
tools?: Record<string, boolean>;
};
query?: {
directory?: string;
};
}) => Promise<unknown>;
promptAsync: (args: {
path: {
id: string;
};
body: {
parts: Array<{
type: "text";
text: string;
}>;
agent?: string;
model?: {
providerID: string;
modelID: string;
};
tools?: Record<string, boolean>;
};
query?: {
directory?: string;
};
}) => Promise<unknown>;
};
};
};
type BabysitterOptions = {
backgroundManager: Pick<BackgroundManager, "getTasksByParentSession">;
config?: BabysittingConfig;
};
export declare function createUnstableAgentBabysitterHook(ctx: BabysitterContext, options: BabysitterOptions): {
event: ({ event }: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
};
export {};