chore: include pre-built dist for github install
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
export type RalphLoopStrategy = "reset" | "continue";
|
||||
export type ParsedRalphLoopArguments = {
|
||||
prompt: string;
|
||||
maxIterations?: number;
|
||||
completionPromise?: string;
|
||||
strategy?: RalphLoopStrategy;
|
||||
};
|
||||
export declare function parseRalphLoopArguments(rawArguments: string): ParsedRalphLoopArguments;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { RalphLoopState } from "./types";
|
||||
type LoopStateController = {
|
||||
clear: () => boolean;
|
||||
markVerificationPending: (sessionID: string) => RalphLoopState | null;
|
||||
};
|
||||
export declare function handleDetectedCompletion(ctx: PluginInput, input: {
|
||||
sessionID: string;
|
||||
state: RalphLoopState;
|
||||
loopState: LoopStateController;
|
||||
directory: string;
|
||||
apiTimeoutMs: number;
|
||||
}): Promise<void>;
|
||||
export {};
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
export declare function detectCompletionInTranscript(transcriptPath: string | undefined, promise: string, startedAt?: string): boolean;
|
||||
export declare function detectCompletionInSessionMessages(ctx: PluginInput, options: {
|
||||
sessionID: string;
|
||||
promise: string;
|
||||
apiTimeoutMs: number;
|
||||
directory: string;
|
||||
sinceMessageIndex?: number;
|
||||
}): Promise<boolean>;
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
export declare const HOOK_NAME = "ralph-loop";
|
||||
export declare const DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
|
||||
export declare const COMPLETION_TAG_PATTERN: RegExp;
|
||||
export declare const DEFAULT_MAX_ITERATIONS = 100;
|
||||
export declare const DEFAULT_COMPLETION_PROMISE = "DONE";
|
||||
export declare const ULTRAWORK_VERIFICATION_PROMISE = "VERIFIED";
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { RalphLoopState } from "./types";
|
||||
export declare function buildContinuationPrompt(state: RalphLoopState): string;
|
||||
export declare function buildVerificationFailurePrompt(state: RalphLoopState): string;
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
export declare function injectContinuationPrompt(ctx: PluginInput, options: {
|
||||
sessionID: string;
|
||||
prompt: string;
|
||||
directory: string;
|
||||
apiTimeoutMs: number;
|
||||
inheritFromSessionID?: string;
|
||||
}): Promise<void>;
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
export * from "./types";
|
||||
export * from "./constants";
|
||||
export { readState, writeState, clearState, incrementIteration } from "./storage";
|
||||
export { createRalphLoopHook } from "./ralph-loop-hook";
|
||||
export type { RalphLoopHook } from "./ralph-loop-hook";
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { RalphLoopState } from "./types";
|
||||
type ContinuationOptions = {
|
||||
directory: string;
|
||||
apiTimeoutMs: number;
|
||||
previousSessionID: string;
|
||||
loopState: {
|
||||
setSessionID: (sessionID: string) => RalphLoopState | null;
|
||||
};
|
||||
};
|
||||
export declare function continueIteration(ctx: PluginInput, state: RalphLoopState, options: ContinuationOptions): Promise<void>;
|
||||
export {};
|
||||
@@ -0,0 +1,7 @@
|
||||
export declare function createLoopSessionRecovery(options?: {
|
||||
recoveryWindowMs?: number;
|
||||
}): {
|
||||
isRecovering(sessionID: string): boolean;
|
||||
markRecovering(sessionID: string): void;
|
||||
clear(sessionID: string): void;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { RalphLoopOptions, RalphLoopState } from "./types";
|
||||
export declare function createLoopStateController(options: {
|
||||
directory: string;
|
||||
stateDir: string | undefined;
|
||||
config: RalphLoopOptions["config"] | undefined;
|
||||
}): {
|
||||
startLoop(sessionID: string, prompt: string, loopOptions?: {
|
||||
maxIterations?: number;
|
||||
completionPromise?: string;
|
||||
messageCountAtStart?: number;
|
||||
ultrawork?: boolean;
|
||||
strategy?: "reset" | "continue";
|
||||
}): boolean;
|
||||
cancelLoop(sessionID: string): boolean;
|
||||
getState(): RalphLoopState | null;
|
||||
clear(): boolean;
|
||||
incrementIteration(): RalphLoopState | null;
|
||||
setSessionID(sessionID: string): RalphLoopState | null;
|
||||
setMessageCountAtStart(sessionID: string, messageCountAtStart: number): RalphLoopState | null;
|
||||
markVerificationPending(sessionID: string): RalphLoopState | null;
|
||||
setVerificationSessionID(sessionID: string, verificationSessionID: string): RalphLoopState | null;
|
||||
restartAfterFailedVerification(sessionID: string, messageCountAtStart?: number): RalphLoopState | null;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export { getMessageDir } from "../../shared/opencode-message-dir";
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { RalphLoopState } from "./types";
|
||||
type LoopStateController = {
|
||||
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
||||
};
|
||||
export declare function handlePendingVerification(ctx: PluginInput, input: {
|
||||
sessionID: string;
|
||||
state: RalphLoopState;
|
||||
verificationSessionID?: string;
|
||||
matchesParentSession: boolean;
|
||||
matchesVerificationSession: boolean;
|
||||
loopState: LoopStateController;
|
||||
directory: string;
|
||||
apiTimeoutMs: number;
|
||||
}): Promise<void>;
|
||||
export {};
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { RalphLoopOptions, RalphLoopState } from "./types";
|
||||
type SessionRecovery = {
|
||||
isRecovering: (sessionID: string) => boolean;
|
||||
markRecovering: (sessionID: string) => void;
|
||||
clear: (sessionID: string) => void;
|
||||
};
|
||||
type LoopStateController = {
|
||||
getState: () => RalphLoopState | null;
|
||||
clear: () => boolean;
|
||||
incrementIteration: () => RalphLoopState | null;
|
||||
setSessionID: (sessionID: string) => RalphLoopState | null;
|
||||
markVerificationPending: (sessionID: string) => RalphLoopState | null;
|
||||
setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null;
|
||||
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
||||
};
|
||||
type RalphLoopEventHandlerOptions = {
|
||||
directory: string;
|
||||
apiTimeoutMs: number;
|
||||
getTranscriptPath: (sessionID: string) => string | undefined;
|
||||
checkSessionExists?: RalphLoopOptions["checkSessionExists"];
|
||||
sessionRecovery: SessionRecovery;
|
||||
loopState: LoopStateController;
|
||||
};
|
||||
export declare function createRalphLoopEventHandler(ctx: PluginInput, options: RalphLoopEventHandlerOptions): ({ event }: {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}) => Promise<void>;
|
||||
export {};
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { RalphLoopOptions, RalphLoopState } from "./types";
|
||||
export interface RalphLoopHook {
|
||||
event: (input: {
|
||||
event: {
|
||||
type: string;
|
||||
properties?: unknown;
|
||||
};
|
||||
}) => Promise<void>;
|
||||
startLoop: (sessionID: string, prompt: string, options?: {
|
||||
maxIterations?: number;
|
||||
completionPromise?: string;
|
||||
messageCountAtStart?: number;
|
||||
ultrawork?: boolean;
|
||||
strategy?: "reset" | "continue";
|
||||
}) => boolean;
|
||||
cancelLoop: (sessionID: string) => boolean;
|
||||
getState: () => RalphLoopState | null;
|
||||
}
|
||||
export declare function createRalphLoopHook(ctx: PluginInput, options?: RalphLoopOptions): RalphLoopHook;
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { RalphLoopState } from "./types";
|
||||
type LoopStateController = {
|
||||
getState: () => RalphLoopState | null;
|
||||
clear: () => boolean;
|
||||
};
|
||||
type SessionRecovery = {
|
||||
clear: (sessionID: string) => void;
|
||||
markRecovering: (sessionID: string) => void;
|
||||
};
|
||||
export declare function handleDeletedLoopSession(props: Record<string, unknown> | undefined, loopState: LoopStateController, sessionRecovery: SessionRecovery): boolean;
|
||||
export declare function handleErroredLoopSession(props: Record<string, unknown> | undefined, loopState: LoopStateController, sessionRecovery: SessionRecovery): boolean;
|
||||
export {};
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
export declare function createIterationSession(ctx: PluginInput, parentSessionID: string, directory: string): Promise<string | null>;
|
||||
export declare function selectSessionInTui(client: PluginInput["client"], sessionID: string): Promise<boolean>;
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
import type { RalphLoopState } from "./types";
|
||||
export declare function getStateFilePath(directory: string, customPath?: string): string;
|
||||
export declare function readState(directory: string, customPath?: string): RalphLoopState | null;
|
||||
export declare function writeState(directory: string, state: RalphLoopState, customPath?: string): boolean;
|
||||
export declare function clearState(directory: string, customPath?: string): boolean;
|
||||
export declare function incrementIteration(directory: string, customPath?: string): RalphLoopState | null;
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
import type { RalphLoopConfig } from "../../config";
|
||||
export interface RalphLoopState {
|
||||
active: boolean;
|
||||
iteration: number;
|
||||
max_iterations?: number;
|
||||
message_count_at_start?: number;
|
||||
completion_promise: string;
|
||||
initial_completion_promise?: string;
|
||||
verification_attempt_id?: string;
|
||||
verification_session_id?: string;
|
||||
started_at: string;
|
||||
prompt: string;
|
||||
session_id?: string;
|
||||
ultrawork?: boolean;
|
||||
verification_pending?: boolean;
|
||||
strategy?: "reset" | "continue";
|
||||
}
|
||||
export interface RalphLoopOptions {
|
||||
config?: RalphLoopConfig;
|
||||
getTranscriptPath?: (sessionId: string) => string;
|
||||
apiTimeout?: number;
|
||||
checkSessionExists?: (sessionId: string) => Promise<boolean>;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin";
|
||||
import type { RalphLoopState } from "./types";
|
||||
type LoopStateController = {
|
||||
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
||||
};
|
||||
export declare function handleFailedVerification(ctx: PluginInput, input: {
|
||||
state: RalphLoopState;
|
||||
directory: string;
|
||||
apiTimeoutMs: number;
|
||||
loopState: LoopStateController;
|
||||
}): Promise<boolean>;
|
||||
export {};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function withTimeout<TData>(promise: Promise<TData>, timeoutMs: number): Promise<TData>;
|
||||
Reference in New Issue
Block a user