chore: include pre-built dist for github install
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
import type { MessageInfo } from "./types";
|
||||
export declare function isLastAssistantMessageAborted(messages: Array<{
|
||||
info?: MessageInfo;
|
||||
}>): boolean;
|
||||
@@ -0,0 +1,11 @@
|
||||
export declare const HOOK_NAME = "todo-continuation-enforcer";
|
||||
export declare const DEFAULT_SKIP_AGENTS: string[];
|
||||
export declare const CONTINUATION_PROMPT: string;
|
||||
export declare const COUNTDOWN_SECONDS = 2;
|
||||
export declare const TOAST_DURATION_MS = 900;
|
||||
export declare const COUNTDOWN_GRACE_PERIOD_MS = 500;
|
||||
export declare const ABORT_WINDOW_MS = 3000;
|
||||
export declare const CONTINUATION_COOLDOWN_MS = 5000;
|
||||
export declare const MAX_STAGNATION_COUNT = 3;
|
||||
export declare const MAX_CONSECUTIVE_FAILURES = 5;
|
||||
export declare const FAILURE_RESET_WINDOW_MS: number;
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
import type { ResolvedMessageInfo } from "./types";
|
||||
import type { SessionStateStore } from "./session-state";
|
||||
export declare function injectContinuation(args: {
|
||||
ctx: PluginInput;
|
||||
sessionID: string;
|
||||
backgroundManager?: BackgroundManager;
|
||||
skipAgents?: string[];
|
||||
resolvedInfo?: ResolvedMessageInfo;
|
||||
sessionStateStore: SessionStateStore;
|
||||
isContinuationStopped?: (sessionID: string) => boolean;
|
||||
}): Promise<void>;
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
import type { ResolvedMessageInfo } from "./types";
|
||||
import type { SessionStateStore } from "./session-state";
|
||||
export declare function startCountdown(args: {
|
||||
ctx: PluginInput;
|
||||
sessionID: string;
|
||||
incompleteCount: number;
|
||||
total: number;
|
||||
resolvedInfo?: ResolvedMessageInfo;
|
||||
backgroundManager?: BackgroundManager;
|
||||
skipAgents: string[];
|
||||
sessionStateStore: SessionStateStore;
|
||||
isContinuationStopped?: (sessionID: string) => boolean;
|
||||
}): void;
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
import type { SessionStateStore } from "./session-state";
|
||||
export declare function createTodoContinuationHandler(args: {
|
||||
ctx: PluginInput;
|
||||
sessionStateStore: SessionStateStore;
|
||||
backgroundManager?: BackgroundManager;
|
||||
skipAgents?: string[];
|
||||
isContinuationStopped?: (sessionID: string) => boolean;
|
||||
shouldSkipContinuation?: (sessionID: string) => boolean;
|
||||
}): (input: {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}) => Promise<void>;
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
import type { SessionStateStore } from "./session-state";
|
||||
export declare function handleSessionIdle(args: {
|
||||
ctx: PluginInput;
|
||||
sessionID: string;
|
||||
sessionStateStore: SessionStateStore;
|
||||
backgroundManager?: BackgroundManager;
|
||||
skipAgents?: string[];
|
||||
isContinuationStopped?: (sessionID: string) => boolean;
|
||||
shouldSkipContinuation?: (sessionID: string) => boolean;
|
||||
}): Promise<void>;
|
||||
@@ -0,0 +1,4 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { TodoContinuationEnforcer, TodoContinuationEnforcerOptions } from "./types";
|
||||
export type { TodoContinuationEnforcer, TodoContinuationEnforcerOptions } from "./types";
|
||||
export declare function createTodoContinuationEnforcer(ctx: PluginInput, options?: TodoContinuationEnforcerOptions): TodoContinuationEnforcer;
|
||||
@@ -0,0 +1 @@
|
||||
export { getMessageDir } from "../../shared/opencode-message-dir";
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { SessionStateStore } from "./session-state";
|
||||
export declare function handleNonIdleEvent(args: {
|
||||
eventType: string;
|
||||
properties: Record<string, unknown> | undefined;
|
||||
sessionStateStore: SessionStateStore;
|
||||
}): void;
|
||||
@@ -0,0 +1,14 @@
|
||||
interface MessagePart {
|
||||
type: string;
|
||||
name?: string;
|
||||
toolName?: string;
|
||||
}
|
||||
interface Message {
|
||||
info?: {
|
||||
role?: string;
|
||||
};
|
||||
role?: string;
|
||||
parts?: MessagePart[];
|
||||
}
|
||||
export declare function hasUnansweredQuestion(messages: Message[]): boolean;
|
||||
export {};
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { SessionState, Todo } from "./types";
|
||||
export interface ContinuationProgressUpdate {
|
||||
previousIncompleteCount?: number;
|
||||
previousStagnationCount: number;
|
||||
stagnationCount: number;
|
||||
hasProgressed: boolean;
|
||||
progressSource: "none" | "todo" | "activity";
|
||||
}
|
||||
export interface SessionStateStore {
|
||||
getState: (sessionID: string) => SessionState;
|
||||
getExistingState: (sessionID: string) => SessionState | undefined;
|
||||
trackContinuationProgress: (sessionID: string, incompleteCount: number, todos?: Todo[]) => ContinuationProgressUpdate;
|
||||
resetContinuationProgress: (sessionID: string) => void;
|
||||
cancelCountdown: (sessionID: string) => void;
|
||||
cleanup: (sessionID: string) => void;
|
||||
cancelAllCountdowns: () => void;
|
||||
shutdown: () => void;
|
||||
}
|
||||
export declare function createSessionStateStore(): SessionStateStore;
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { ContinuationProgressUpdate } from "./session-state";
|
||||
export declare function shouldStopForStagnation(args: {
|
||||
sessionID: string;
|
||||
incompleteCount: number;
|
||||
progressUpdate: ContinuationProgressUpdate;
|
||||
}): boolean;
|
||||
@@ -0,0 +1,2 @@
|
||||
import type { Todo } from "./types";
|
||||
export declare function getIncompleteCount(todos: Todo[]): number;
|
||||
@@ -0,0 +1,63 @@
|
||||
import type { BackgroundManager } from "../../features/background-agent";
|
||||
import type { ToolPermission } from "../../features/hook-message-injector";
|
||||
export interface TodoContinuationEnforcerOptions {
|
||||
backgroundManager?: BackgroundManager;
|
||||
skipAgents?: string[];
|
||||
isContinuationStopped?: (sessionID: string) => boolean;
|
||||
shouldSkipContinuation?: (sessionID: string) => boolean;
|
||||
}
|
||||
export interface TodoContinuationEnforcer {
|
||||
handler: (input: {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}) => Promise<void>;
|
||||
markRecovering: (sessionID: string) => void;
|
||||
markRecoveryComplete: (sessionID: string) => void;
|
||||
cancelAllCountdowns: () => void;
|
||||
dispose: () => void;
|
||||
}
|
||||
export interface Todo {
|
||||
content: string;
|
||||
status: string;
|
||||
priority: string;
|
||||
id?: string;
|
||||
}
|
||||
export interface SessionState {
|
||||
countdownTimer?: ReturnType<typeof setTimeout>;
|
||||
countdownInterval?: ReturnType<typeof setInterval>;
|
||||
isRecovering?: boolean;
|
||||
countdownStartedAt?: number;
|
||||
abortDetectedAt?: number;
|
||||
lastIncompleteCount?: number;
|
||||
lastInjectedAt?: number;
|
||||
awaitingPostInjectionProgressCheck?: boolean;
|
||||
inFlight?: boolean;
|
||||
stagnationCount: number;
|
||||
consecutiveFailures: number;
|
||||
}
|
||||
export interface MessageInfo {
|
||||
id?: string;
|
||||
role?: string;
|
||||
error?: {
|
||||
name?: string;
|
||||
data?: unknown;
|
||||
};
|
||||
agent?: string;
|
||||
model?: {
|
||||
providerID: string;
|
||||
modelID: string;
|
||||
};
|
||||
providerID?: string;
|
||||
modelID?: string;
|
||||
tools?: Record<string, ToolPermission>;
|
||||
}
|
||||
export interface ResolvedMessageInfo {
|
||||
agent?: string;
|
||||
model?: {
|
||||
providerID: string;
|
||||
modelID: string;
|
||||
};
|
||||
tools?: Record<string, ToolPermission>;
|
||||
}
|
||||
Reference in New Issue
Block a user