chore: include pre-built dist for github install
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
type TextPart = {
|
||||
type?: string;
|
||||
text?: string;
|
||||
};
|
||||
type MessageInfo = {
|
||||
id?: string;
|
||||
role?: string;
|
||||
error?: unknown;
|
||||
model?: {
|
||||
providerID?: string;
|
||||
modelID?: string;
|
||||
};
|
||||
providerID?: string;
|
||||
modelID?: string;
|
||||
};
|
||||
export type SessionMessage = {
|
||||
info?: MessageInfo;
|
||||
parts?: TextPart[];
|
||||
};
|
||||
export declare function getLastAssistantMessage(messages: SessionMessage[]): SessionMessage | null;
|
||||
export declare function extractAssistantText(message: SessionMessage): string;
|
||||
export declare function isGptAssistantMessage(message: SessionMessage): boolean;
|
||||
export {};
|
||||
@@ -0,0 +1,4 @@
|
||||
export declare const HOOK_NAME = "gpt-permission-continuation";
|
||||
export declare const CONTINUATION_PROMPT = "continue";
|
||||
export declare const MAX_CONSECUTIVE_AUTO_CONTINUES = 3;
|
||||
export declare const DEFAULT_STALL_PATTERNS: readonly ["if you want", "would you like", "shall i", "do you want me to", "let me know if"];
|
||||
@@ -0,0 +1 @@
|
||||
export declare function detectStallPattern(text: string, patterns?: readonly string[]): boolean;
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { SessionStateStore } from "./session-state";
|
||||
export declare function createGptPermissionContinuationHandler(args: {
|
||||
ctx: PluginInput;
|
||||
sessionStateStore: SessionStateStore;
|
||||
isContinuationStopped?: (sessionID: string) => boolean;
|
||||
}): (input: {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}) => Promise<void>;
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
export type GptPermissionContinuationHook = {
|
||||
handler: (input: {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}) => Promise<void>;
|
||||
wasRecentlyInjected: (sessionID: string) => boolean;
|
||||
};
|
||||
export declare function createGptPermissionContinuationHook(ctx: PluginInput, options?: {
|
||||
isContinuationStopped?: (sessionID: string) => boolean;
|
||||
}): GptPermissionContinuationHook;
|
||||
@@ -0,0 +1,15 @@
|
||||
type SessionState = {
|
||||
inFlight: boolean;
|
||||
consecutiveAutoContinueCount: number;
|
||||
awaitingAutoContinuationResponse: boolean;
|
||||
lastHandledMessageID?: string;
|
||||
lastAutoContinuePermissionPhrase?: string;
|
||||
lastInjectedAt?: number;
|
||||
};
|
||||
export type SessionStateStore = ReturnType<typeof createSessionStateStore>;
|
||||
export declare function createSessionStateStore(): {
|
||||
getState: (sessionID: string) => SessionState;
|
||||
wasRecentlyInjected(sessionID: string, windowMs: number): boolean;
|
||||
cleanup(sessionID: string): void;
|
||||
};
|
||||
export {};
|
||||
Reference in New Issue
Block a user