chore: include pre-built dist for github install

This commit is contained in:
Robin Mordasiewicz
2026-03-14 04:56:50 +00:00
parent a7f0a4cf46
commit bce8ff3a75
1011 changed files with 150081 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
import type { OpencodeClient } from "@opencode-ai/sdk";
export declare function loadAgentProfileColors(client: OpencodeClient): Promise<Record<string, string>>;
+5
View File
@@ -0,0 +1,5 @@
import type { RunOptions } from "./types";
import type { OhMyOpenCodeConfig } from "../../config";
type EnvVars = Record<string, string | undefined>;
export declare const resolveRunAgent: (options: RunOptions, pluginConfig: OhMyOpenCodeConfig, env?: EnvVars) => string;
export {};
+2
View File
@@ -0,0 +1,2 @@
import type { RunContext } from "./types";
export declare function checkCompletionConditions(ctx: RunContext): Promise<boolean>;
+9
View File
@@ -0,0 +1,9 @@
export interface ContinuationState {
hasActiveBoulder: boolean;
hasActiveRalphLoop: boolean;
hasHookMarker: boolean;
hasTodoHookMarker: boolean;
hasActiveHookMarker: boolean;
activeHookMarkerReason: string | null;
}
export declare function getContinuationState(directory: string, sessionID: string): ContinuationState;
+5
View File
@@ -0,0 +1,5 @@
export declare const displayChars: {
readonly treeEnd: "`-" | "└─";
readonly treeIndent: " ";
readonly treeJoin: " " | " ";
};
+3
View File
@@ -0,0 +1,3 @@
import type { RunContext, EventPayload } from "./types";
export declare function serializeError(error: unknown): string;
export declare function logEventVerbose(ctx: RunContext, payload: EventPayload): void;
+11
View File
@@ -0,0 +1,11 @@
import type { RunContext, EventPayload } from "./types";
import type { EventState } from "./event-state";
export declare function handleSessionIdle(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleSessionStatus(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleSessionError(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleMessagePartUpdated(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleMessagePartDelta(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleMessageUpdated(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleToolExecute(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleToolResult(ctx: RunContext, payload: EventPayload, state: EventState): void;
export declare function handleTuiToast(_ctx: RunContext, payload: EventPayload, state: EventState): void;
+49
View File
@@ -0,0 +1,49 @@
export interface EventState {
mainSessionIdle: boolean;
mainSessionError: boolean;
lastError: string | null;
lastOutput: string;
lastPartText: string;
currentTool: string | null;
/** Set to true when the main session has produced meaningful work (text, tool call, or tool result) */
hasReceivedMeaningfulWork: boolean;
/** Timestamp of the last received event (for watchdog detection) */
lastEventTimestamp: number;
/** Count of assistant messages for the main session */
messageCount: number;
/** Current agent name from the latest assistant message */
currentAgent: string | null;
/** Current model ID from the latest assistant message */
currentModel: string | null;
/** Current model variant from the latest assistant message */
currentVariant: string | null;
/** Current message role (user/assistant) — used to filter user messages from display */
currentMessageRole: string | null;
/** Agent profile colors keyed by display name */
agentColorsByName: Record<string, string>;
/** Part type registry keyed by partID (text, reasoning, tool, ...) */
partTypesById: Record<string, string>;
/** Whether a THINK block is currently open in output */
inThinkBlock: boolean;
/** Tracks streamed reasoning text to avoid duplicates */
lastReasoningText: string;
/** Whether compact thinking line already printed for current reasoning block */
hasPrintedThinkingLine: boolean;
/** Last rendered thinking line width (for in-place padding updates) */
lastThinkingLineWidth: number;
/** Message role lookup by message ID to filter user parts */
messageRoleById: Record<string, string>;
/** Last rendered thinking summary (to avoid duplicate re-render) */
lastThinkingSummary: string;
/** Whether text stream is currently at line start (for padding) */
textAtLineStart: boolean;
/** Whether reasoning stream is currently at line start (for padding) */
thinkingAtLineStart: boolean;
/** Current assistant message ID — prevents counter resets on repeated message.updated for same message */
currentMessageId: string | null;
/** Assistant message start timestamp by message ID */
messageStartedAtById: Record<string, number>;
/** Prevent duplicate completion metadata lines per message */
completionMetaPrintedByMessageId: Record<string, boolean>;
}
export declare function createEventState(): EventState;
+3
View File
@@ -0,0 +1,3 @@
import type { RunContext } from "./types";
import type { EventState } from "./event-state";
export declare function processEvents(ctx: RunContext, stream: AsyncIterable<unknown>, state: EventState): Promise<void>;
+4
View File
@@ -0,0 +1,4 @@
export type { EventState } from "./event-state";
export { createEventState } from "./event-state";
export { serializeError } from "./event-formatting";
export { processEvents } from "./event-stream-processor";
+10
View File
@@ -0,0 +1,10 @@
export { run } from "./runner";
export { resolveRunAgent } from "./agent-resolver";
export { resolveRunModel } from "./model-resolver";
export { createServerConnection } from "./server-connection";
export { resolveSession } from "./session-resolver";
export { createJsonOutputManager } from "./json-output";
export { executeOnCompleteHook } from "./on-complete-hook";
export { createEventState, processEvents, serializeError } from "./events";
export type { EventState } from "./events";
export type { RunOptions, RunContext, RunResult, ServerConnection } from "./types";
+12
View File
@@ -0,0 +1,12 @@
import type { RunResult } from "./types";
export interface JsonOutputManager {
redirectToStderr: () => void;
restore: () => void;
emitResult: (result: RunResult) => void;
}
interface JsonOutputManagerOptions {
stdout?: NodeJS.WriteStream;
stderr?: NodeJS.WriteStream;
}
export declare function createJsonOutputManager(options?: JsonOutputManagerOptions): JsonOutputManager;
export {};
+4
View File
@@ -0,0 +1,4 @@
export declare function resolveRunModel(modelString?: string): {
providerID: string;
modelID: string;
} | undefined;
+7
View File
@@ -0,0 +1,7 @@
export declare function executeOnCompleteHook(options: {
command: string;
sessionId: string;
exitCode: number;
durationMs: number;
messageCount: number;
}): Promise<void>;
+5
View File
@@ -0,0 +1,5 @@
export declare function collectCandidateBinaryPaths(pathEnv: string | undefined, which?: (command: string) => string | null | undefined, platform?: NodeJS.Platform): string[];
export declare function canExecuteBinary(binaryPath: string): Promise<boolean>;
export declare function findWorkingOpencodeBinary(pathEnv?: string | undefined, probe?: (binaryPath: string) => Promise<boolean>, which?: (command: string) => string | null | undefined, platform?: NodeJS.Platform): Promise<string | null>;
export declare function buildPathWithBinaryFirst(pathEnv: string | undefined, binaryPath: string): string;
export declare function withWorkingOpencodePath<T>(startServer: () => Promise<T>, finder?: (pathEnv: string | undefined) => Promise<string | null>): Promise<T>;
+7
View File
@@ -0,0 +1,7 @@
export declare function renderAgentHeader(agent: string | null, model: string | null, variant: string | null, agentColorsByName: Record<string, string>): void;
export declare function openThinkBlock(): void;
export declare function closeThinkBlock(): void;
export declare function writePaddedText(text: string, atLineStart: boolean): {
output: string;
atLineStart: boolean;
};
+10
View File
@@ -0,0 +1,10 @@
import type { RunContext } from "./types";
import type { EventState } from "./events";
export interface PollOptions {
pollIntervalMs?: number;
requiredConsecutive?: number;
minStabilizationMs?: number;
eventWatchdogMs?: number;
secondaryMeaningfulWorkTimeoutMs?: number;
}
export declare function pollForCompletion(ctx: RunContext, eventState: EventState, abortController: AbortController, options?: PollOptions): Promise<number>;
+5
View File
@@ -0,0 +1,5 @@
import type { RunOptions } from "./types";
import { resolveRunAgent } from "./agent-resolver";
export { resolveRunAgent };
export declare function waitForEventProcessorShutdown(eventProcessor: Promise<void>, timeoutMs?: number): Promise<void>;
export declare function run(options: RunOptions): Promise<number>;
+6
View File
@@ -0,0 +1,6 @@
import type { ServerConnection } from "./types";
export declare function createServerConnection(options: {
port?: number;
attach?: string;
signal: AbortSignal;
}): Promise<ServerConnection>;
+6
View File
@@ -0,0 +1,6 @@
import type { OpencodeClient } from "./types";
export declare function resolveSession(options: {
client: OpencodeClient;
sessionId?: string;
directory: string;
}): Promise<string>;
+12
View File
@@ -0,0 +1,12 @@
type StdinLike = {
isTTY?: boolean;
isRaw?: boolean;
setRawMode?: (mode: boolean) => void;
isPaused?: () => boolean;
resume: () => void;
pause: () => void;
on: (event: "data", listener: (chunk: string | Uint8Array) => void) => void;
removeListener: (event: "data", listener: (chunk: string | Uint8Array) => void) => void;
};
export declare function suppressRunInput(stdin?: StdinLike, onInterrupt?: () => void): () => void;
export {};
+5
View File
@@ -0,0 +1,5 @@
export declare function createTimestampTransformer(now?: () => Date): (chunk: string) => string;
export declare function createTimestampedStdoutController(stdout?: NodeJS.WriteStream): {
enable: () => void;
restore: () => void;
};
+6
View File
@@ -0,0 +1,6 @@
export interface ToolHeader {
icon: string;
title: string;
description?: string;
}
export declare function formatToolHeader(toolName: string, input: Record<string, unknown>): ToolHeader;
+132
View File
@@ -0,0 +1,132 @@
import type { OpencodeClient } from "@opencode-ai/sdk";
export type { OpencodeClient };
export interface RunOptions {
message: string;
agent?: string;
model?: string;
timestamp?: boolean;
verbose?: boolean;
directory?: string;
port?: number;
attach?: string;
onComplete?: string;
json?: boolean;
sessionId?: string;
}
export interface ServerConnection {
client: OpencodeClient;
cleanup: () => void;
}
export interface RunResult {
sessionId: string;
success: boolean;
durationMs: number;
messageCount: number;
summary: string;
}
export interface RunContext {
client: OpencodeClient;
sessionID: string;
directory: string;
abortController: AbortController;
verbose?: boolean;
}
export interface Todo {
id?: string;
content: string;
status: string;
priority: string;
}
export interface SessionStatus {
type: "idle" | "busy" | "retry";
}
export interface ChildSession {
id: string;
}
export interface EventPayload {
type: string;
properties?: Record<string, unknown>;
}
export interface SessionIdleProps {
sessionID?: string;
sessionId?: string;
}
export interface SessionStatusProps {
sessionID?: string;
sessionId?: string;
status?: {
type?: string;
};
}
export interface MessageUpdatedProps {
info?: {
id?: string;
sessionID?: string;
sessionId?: string;
role?: string;
modelID?: string;
providerID?: string;
agent?: string;
variant?: string;
};
}
export interface MessagePartUpdatedProps {
/** @deprecated Legacy structure — current OpenCode puts sessionID inside part */
info?: {
sessionID?: string;
sessionId?: string;
role?: string;
};
part?: {
id?: string;
sessionID?: string;
sessionId?: string;
messageID?: string;
type?: string;
text?: string;
/** Tool name (for part.type === "tool") */
tool?: string;
/** Tool state (for part.type === "tool") */
state?: {
status?: string;
input?: Record<string, unknown>;
output?: string;
};
name?: string;
input?: unknown;
time?: {
start?: number;
end?: number;
};
};
}
export interface MessagePartDeltaProps {
sessionID?: string;
sessionId?: string;
messageID?: string;
partID?: string;
field?: string;
delta?: string;
}
export interface ToolExecuteProps {
sessionID?: string;
sessionId?: string;
name?: string;
input?: Record<string, unknown>;
}
export interface ToolResultProps {
sessionID?: string;
sessionId?: string;
name?: string;
output?: string;
}
export interface SessionErrorProps {
sessionID?: string;
sessionId?: string;
error?: unknown;
}
export interface TuiToastShowProps {
title?: string;
message?: string;
variant?: "info" | "success" | "warning" | "error";
}