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
+3
View File
@@ -0,0 +1,3 @@
import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder";
import type { OhMyOpenCodeConfig } from "../config";
export declare function createAvailableCategories(pluginConfig: OhMyOpenCodeConfig): AvailableCategory[];
+4
View File
@@ -0,0 +1,4 @@
import type { PluginContext } from "./types";
export declare function createChatHeadersHandler(args: {
ctx: PluginContext;
}): (input: unknown, output: unknown) => Promise<void>;
+31
View File
@@ -0,0 +1,31 @@
import type { OhMyOpenCodeConfig } from "../config";
import type { PluginContext } from "./types";
import type { CreatedHooks } from "../create-hooks";
type FirstMessageVariantGate = {
shouldOverride: (sessionID: string) => boolean;
markApplied: (sessionID: string) => void;
};
type ChatMessagePart = {
type: string;
text?: string;
[key: string]: unknown;
};
export type ChatMessageHandlerOutput = {
message: Record<string, unknown>;
parts: ChatMessagePart[];
};
export type ChatMessageInput = {
sessionID: string;
agent?: string;
model?: {
providerID: string;
modelID: string;
};
};
export declare function createChatMessageHandler(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
firstMessageVariantGate: FirstMessageVariantGate;
hooks: CreatedHooks;
}): (input: ChatMessageInput, output: ChatMessageHandlerOutput) => Promise<void>;
export {};
+27
View File
@@ -0,0 +1,27 @@
export type ChatParamsInput = {
sessionID: string;
agent: {
name?: string;
};
model: {
providerID: string;
modelID: string;
};
provider: {
id: string;
};
message: {
variant?: string;
};
};
export type ChatParamsOutput = {
temperature?: number;
topP?: number;
topK?: number;
options: Record<string, unknown>;
};
export declare function createChatParamsHandler(args: {
anthropicEffort: {
"chat.params"?: (input: ChatParamsInput, output: ChatParamsOutput) => Promise<void>;
} | null;
}): (input: unknown, output: unknown) => Promise<void>;
+21
View File
@@ -0,0 +1,21 @@
import type { OhMyOpenCodeConfig } from "../config";
import type { PluginContext } from "./types";
import type { CreatedHooks } from "../create-hooks";
import type { Managers } from "../create-managers";
type FirstMessageVariantGate = {
markSessionCreated: (sessionInfo: {
id?: string;
title?: string;
parentID?: string;
} | undefined) => void;
clear: (sessionID: string) => void;
};
type EventInput = Parameters<NonNullable<NonNullable<CreatedHooks["writeExistingFileGuard"]>["event"]>>[0];
export declare function createEventHandler(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
firstMessageVariantGate: FirstMessageVariantGate;
managers: Managers;
hooks: CreatedHooks;
}): (input: EventInput) => Promise<void>;
export {};
+28
View File
@@ -0,0 +1,28 @@
import type { HookName, OhMyOpenCodeConfig } from "../../config";
import type { BackgroundManager } from "../../features/background-agent";
import type { PluginContext } from "../types";
import { createGptPermissionContinuationHook, createTodoContinuationEnforcer, createBackgroundNotificationHook, createStopContinuationGuardHook, createCompactionContextInjector, createCompactionTodoPreserverHook, createAtlasHook } from "../../hooks";
import { createUnstableAgentBabysitter } from "../unstable-agent-babysitter";
export type ContinuationHooks = {
gptPermissionContinuation: ReturnType<typeof createGptPermissionContinuationHook> | null;
stopContinuationGuard: ReturnType<typeof createStopContinuationGuardHook> | null;
compactionContextInjector: ReturnType<typeof createCompactionContextInjector> | null;
compactionTodoPreserver: ReturnType<typeof createCompactionTodoPreserverHook> | null;
todoContinuationEnforcer: ReturnType<typeof createTodoContinuationEnforcer> | null;
unstableAgentBabysitter: ReturnType<typeof createUnstableAgentBabysitter> | null;
backgroundNotificationHook: ReturnType<typeof createBackgroundNotificationHook> | null;
atlasHook: ReturnType<typeof createAtlasHook> | null;
};
type SessionRecovery = {
setOnAbortCallback: (callback: (sessionID: string) => void) => void;
setOnRecoveryCompleteCallback: (callback: (sessionID: string) => void) => void;
} | null;
export declare function createContinuationHooks(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
isHookEnabled: (hookName: HookName) => boolean;
safeHookEnabled: boolean;
backgroundManager: BackgroundManager;
sessionRecovery: SessionRecovery;
}): ContinuationHooks;
export {};
+50
View File
@@ -0,0 +1,50 @@
import type { HookName, OhMyOpenCodeConfig } from "../../config";
import type { PluginContext } from "../types";
import type { ModelCacheState } from "../../plugin-state";
export declare function createCoreHooks(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
modelCacheState: ModelCacheState;
isHookEnabled: (hookName: HookName) => boolean;
safeHookEnabled: boolean;
}): {
claudeCodeHooks: ReturnType<typeof import("../../hooks").createClaudeCodeHooksHook> | null;
keywordDetector: ReturnType<typeof import("../../hooks").createKeywordDetectorHook> | null;
contextInjectorMessagesTransform: ReturnType<typeof import("../../features/context-injector").createContextInjectorMessagesTransformHook>;
thinkingBlockValidator: ReturnType<typeof import("../../hooks").createThinkingBlockValidatorHook> | null;
commentChecker: ReturnType<typeof import("../../hooks").createCommentCheckerHooks> | null;
toolOutputTruncator: ReturnType<typeof import("../../hooks").createToolOutputTruncatorHook> | null;
directoryAgentsInjector: ReturnType<typeof import("../../hooks").createDirectoryAgentsInjectorHook> | null;
directoryReadmeInjector: ReturnType<typeof import("../../hooks").createDirectoryReadmeInjectorHook> | null;
emptyTaskResponseDetector: ReturnType<typeof import("../../hooks").createEmptyTaskResponseDetectorHook> | null;
rulesInjector: ReturnType<typeof import("../../hooks").createRulesInjectorHook> | null;
tasksTodowriteDisabler: ReturnType<typeof import("../../hooks").createTasksTodowriteDisablerHook> | null;
writeExistingFileGuard: ReturnType<typeof import("../../hooks").createWriteExistingFileGuardHook> | null;
hashlineReadEnhancer: ReturnType<typeof import("../../hooks").createHashlineReadEnhancerHook> | null;
jsonErrorRecovery: ReturnType<typeof import("../../hooks").createJsonErrorRecoveryHook> | null;
readImageResizer: ReturnType<typeof import("../../hooks").createReadImageResizerHook> | null;
contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
sessionNotification: ReturnType<typeof import("../../hooks").createSessionNotification> | null;
thinkMode: ReturnType<typeof import("../../hooks").createThinkModeHook> | null;
modelFallback: ReturnType<typeof import("../../hooks").createModelFallbackHook> | null;
anthropicContextWindowLimitRecovery: ReturnType<typeof import("../../hooks").createAnthropicContextWindowLimitRecoveryHook> | null;
autoUpdateChecker: ReturnType<typeof import("../../hooks").createAutoUpdateCheckerHook> | null;
agentUsageReminder: ReturnType<typeof import("../../hooks").createAgentUsageReminderHook> | null;
nonInteractiveEnv: ReturnType<typeof import("../../hooks").createNonInteractiveEnvHook> | null;
interactiveBashSession: ReturnType<typeof import("../../hooks").createInteractiveBashSessionHook> | null;
ralphLoop: ReturnType<typeof import("../../hooks").createRalphLoopHook> | null;
editErrorRecovery: ReturnType<typeof import("../../hooks").createEditErrorRecoveryHook> | null;
delegateTaskRetry: ReturnType<typeof import("../../hooks").createDelegateTaskRetryHook> | null;
startWork: ReturnType<typeof import("../../hooks").createStartWorkHook> | null;
prometheusMdOnly: ReturnType<typeof import("../../hooks").createPrometheusMdOnlyHook> | null;
sisyphusJuniorNotepad: ReturnType<typeof import("../../hooks").createSisyphusJuniorNotepadHook> | null;
noSisyphusGpt: ReturnType<typeof import("../../hooks").createNoSisyphusGptHook> | null;
noHephaestusNonGpt: ReturnType<typeof import("../../hooks").createNoHephaestusNonGptHook> | null;
questionLabelTruncator: ReturnType<typeof import("../../hooks").createQuestionLabelTruncatorHook> | null;
taskResumeInfo: ReturnType<typeof import("../../hooks").createTaskResumeInfoHook> | null;
anthropicEffort: ReturnType<typeof import("../../hooks/anthropic-effort").createAnthropicEffortHook> | null;
runtimeFallback: ReturnType<typeof import("../../hooks").createRuntimeFallbackHook> | null;
delegateTaskEnglishDirective: ReturnType<typeof import("../../hooks").createDelegateTaskEnglishDirectiveHook> | null;
};
+38
View File
@@ -0,0 +1,38 @@
import type { OhMyOpenCodeConfig, HookName } from "../../config";
import type { ModelCacheState } from "../../plugin-state";
import type { PluginContext } from "../types";
import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createModelFallbackHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createDelegateTaskEnglishDirectiveHook, createTaskResumeInfoHook, createStartWorkHook, createPrometheusMdOnlyHook, createSisyphusJuniorNotepadHook, createNoSisyphusGptHook, createNoHephaestusNonGptHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook, createRuntimeFallbackHook } from "../../hooks";
import { createAnthropicEffortHook } from "../../hooks/anthropic-effort";
export type SessionHooks = {
contextWindowMonitor: ReturnType<typeof createContextWindowMonitorHook> | null;
preemptiveCompaction: ReturnType<typeof createPreemptiveCompactionHook> | null;
sessionRecovery: ReturnType<typeof createSessionRecoveryHook> | null;
sessionNotification: ReturnType<typeof createSessionNotification> | null;
thinkMode: ReturnType<typeof createThinkModeHook> | null;
modelFallback: ReturnType<typeof createModelFallbackHook> | null;
anthropicContextWindowLimitRecovery: ReturnType<typeof createAnthropicContextWindowLimitRecoveryHook> | null;
autoUpdateChecker: ReturnType<typeof createAutoUpdateCheckerHook> | null;
agentUsageReminder: ReturnType<typeof createAgentUsageReminderHook> | null;
nonInteractiveEnv: ReturnType<typeof createNonInteractiveEnvHook> | null;
interactiveBashSession: ReturnType<typeof createInteractiveBashSessionHook> | null;
ralphLoop: ReturnType<typeof createRalphLoopHook> | null;
editErrorRecovery: ReturnType<typeof createEditErrorRecoveryHook> | null;
delegateTaskRetry: ReturnType<typeof createDelegateTaskRetryHook> | null;
startWork: ReturnType<typeof createStartWorkHook> | null;
prometheusMdOnly: ReturnType<typeof createPrometheusMdOnlyHook> | null;
sisyphusJuniorNotepad: ReturnType<typeof createSisyphusJuniorNotepadHook> | null;
noSisyphusGpt: ReturnType<typeof createNoSisyphusGptHook> | null;
noHephaestusNonGpt: ReturnType<typeof createNoHephaestusNonGptHook> | null;
questionLabelTruncator: ReturnType<typeof createQuestionLabelTruncatorHook> | null;
taskResumeInfo: ReturnType<typeof createTaskResumeInfoHook> | null;
anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null;
runtimeFallback: ReturnType<typeof createRuntimeFallbackHook> | null;
delegateTaskEnglishDirective: ReturnType<typeof createDelegateTaskEnglishDirectiveHook> | null;
};
export declare function createSessionHooks(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
modelCacheState: ModelCacheState;
isHookEnabled: (hookName: HookName) => boolean;
safeHookEnabled: boolean;
}): SessionHooks;
+17
View File
@@ -0,0 +1,17 @@
import type { AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
import type { HookName, OhMyOpenCodeConfig } from "../../config";
import type { LoadedSkill } from "../../features/opencode-skill-loader/types";
import type { PluginContext } from "../types";
import { createAutoSlashCommandHook, createCategorySkillReminderHook } from "../../hooks";
export type SkillHooks = {
categorySkillReminder: ReturnType<typeof createCategorySkillReminderHook> | null;
autoSlashCommand: ReturnType<typeof createAutoSlashCommandHook> | null;
};
export declare function createSkillHooks(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
isHookEnabled: (hookName: HookName) => boolean;
safeHookEnabled: boolean;
mergedSkills: LoadedSkill[];
availableSkills: AvailableSkill[];
}): SkillHooks;
+24
View File
@@ -0,0 +1,24 @@
import type { HookName, OhMyOpenCodeConfig } from "../../config";
import type { ModelCacheState } from "../../plugin-state";
import type { PluginContext } from "../types";
import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook, createReadImageResizerHook, createJsonErrorRecoveryHook } from "../../hooks";
export type ToolGuardHooks = {
commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
directoryAgentsInjector: ReturnType<typeof createDirectoryAgentsInjectorHook> | null;
directoryReadmeInjector: ReturnType<typeof createDirectoryReadmeInjectorHook> | null;
emptyTaskResponseDetector: ReturnType<typeof createEmptyTaskResponseDetectorHook> | null;
rulesInjector: ReturnType<typeof createRulesInjectorHook> | null;
tasksTodowriteDisabler: ReturnType<typeof createTasksTodowriteDisablerHook> | null;
writeExistingFileGuard: ReturnType<typeof createWriteExistingFileGuardHook> | null;
hashlineReadEnhancer: ReturnType<typeof createHashlineReadEnhancerHook> | null;
jsonErrorRecovery: ReturnType<typeof createJsonErrorRecoveryHook> | null;
readImageResizer: ReturnType<typeof createReadImageResizerHook> | null;
};
export declare function createToolGuardHooks(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
modelCacheState: ModelCacheState;
isHookEnabled: (hookName: HookName) => boolean;
safeHookEnabled: boolean;
}): ToolGuardHooks;
+16
View File
@@ -0,0 +1,16 @@
import type { OhMyOpenCodeConfig } from "../../config";
import type { PluginContext } from "../types";
import { createClaudeCodeHooksHook, createKeywordDetectorHook, createThinkingBlockValidatorHook } from "../../hooks";
import { createContextInjectorMessagesTransformHook } from "../../features/context-injector";
export type TransformHooks = {
claudeCodeHooks: ReturnType<typeof createClaudeCodeHooksHook> | null;
keywordDetector: ReturnType<typeof createKeywordDetectorHook> | null;
contextInjectorMessagesTransform: ReturnType<typeof createContextInjectorMessagesTransformHook>;
thinkingBlockValidator: ReturnType<typeof createThinkingBlockValidatorHook> | null;
};
export declare function createTransformHooks(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
isHookEnabled: (hookName: string) => boolean;
safeHookEnabled?: boolean;
}): TransformHooks;
+13
View File
@@ -0,0 +1,13 @@
import type { Message, Part } from "@opencode-ai/sdk";
import type { CreatedHooks } from "../create-hooks";
type MessageWithParts = {
info: Message;
parts: Part[];
};
type MessagesTransformOutput = {
messages: MessageWithParts[];
};
export declare function createMessagesTransformHandler(args: {
hooks: CreatedHooks;
}): (input: Record<string, never>, output: MessagesTransformOutput) => Promise<void>;
export {};
+2
View File
@@ -0,0 +1,2 @@
import type { ToolDefinition } from "@opencode-ai/plugin";
export declare function normalizeToolArgSchemas<TDefinition extends Pick<ToolDefinition, "args">>(toolDefinition: TDefinition): TDefinition;
+6
View File
@@ -0,0 +1,6 @@
export declare function pruneRecentSyntheticIdles(args: {
recentSyntheticIdles: Map<string, number>;
recentRealIdles: Map<string, number>;
now: number;
dedupWindowMs: number;
}): void;
+19
View File
@@ -0,0 +1,19 @@
interface SessionMessage {
info?: {
agent?: string;
role?: string;
};
}
type SessionClient = {
session: {
messages: (opts: {
path: {
id: string;
};
}) => Promise<{
data?: SessionMessage[];
}>;
};
};
export declare function resolveSessionAgent(client: SessionClient, sessionId: string): Promise<string | undefined>;
export {};
+8
View File
@@ -0,0 +1,8 @@
type EventInput = {
event: {
type: string;
properties?: Record<string, unknown>;
};
};
export declare function normalizeSessionStatusToIdle(input: EventInput): EventInput | null;
export {};
+14
View File
@@ -0,0 +1,14 @@
import type { AvailableSkill } from "../agents/dynamic-agent-prompt-builder";
import type { OhMyOpenCodeConfig } from "../config";
import type { BrowserAutomationProvider } from "../config/schema/browser-automation";
import type { LoadedSkill } from "../features/opencode-skill-loader/types";
export type SkillContext = {
mergedSkills: LoadedSkill[];
availableSkills: AvailableSkill[];
browserProvider: BrowserAutomationProvider;
disabledSkills: Set<string>;
};
export declare function createSkillContext(args: {
directory: string;
pluginConfig: OhMyOpenCodeConfig;
}): Promise<SkillContext>;
+10
View File
@@ -0,0 +1,10 @@
export declare function createSystemTransformHandler(): (input: {
sessionID?: string;
model: {
id: string;
providerID: string;
[key: string]: unknown;
};
}, output: {
system: string[];
}) => Promise<void>;
+14
View File
@@ -0,0 +1,14 @@
import type { CreatedHooks } from "../create-hooks";
import type { PluginContext } from "./types";
export declare function createToolExecuteAfterHandler(args: {
ctx: PluginContext;
hooks: CreatedHooks;
}): (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
title: string;
output: string;
metadata: Record<string, unknown>;
} | undefined) => Promise<void>;
+12
View File
@@ -0,0 +1,12 @@
import type { PluginContext } from "./types";
import type { CreatedHooks } from "../create-hooks";
export declare function createToolExecuteBeforeHandler(args: {
ctx: PluginContext;
hooks: CreatedHooks;
}): (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
args: Record<string, unknown>;
}) => Promise<void>;
+16
View File
@@ -0,0 +1,16 @@
import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder";
import type { OhMyOpenCodeConfig } from "../config";
import type { PluginContext, ToolsRecord } from "./types";
import type { Managers } from "../create-managers";
import type { SkillContext } from "./skill-context";
export type ToolRegistryResult = {
filteredTools: ToolsRecord;
taskSystemEnabled: boolean;
};
export declare function createToolRegistry(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
managers: Pick<Managers, "backgroundManager" | "tmuxSessionManager" | "skillMcpManager">;
skillContext: SkillContext;
availableCategories: AvailableCategory[];
}): ToolRegistryResult;
+18
View File
@@ -0,0 +1,18 @@
import type { Plugin, ToolDefinition } from "@opencode-ai/plugin";
export type PluginContext = Parameters<Plugin>[0];
export type PluginInstance = Awaited<ReturnType<Plugin>>;
type ChatHeadersHook = PluginInstance extends {
"chat.headers"?: infer T;
} ? T : (input: unknown, output: unknown) => Promise<void>;
export type PluginInterface = Omit<PluginInstance, "experimental.session.compacting" | "chat.headers"> & {
"chat.headers"?: ChatHeadersHook;
};
export type ToolsRecord = Record<string, ToolDefinition>;
export type TmuxConfig = {
enabled: boolean;
layout: "main-horizontal" | "main-vertical" | "tiled" | "even-horizontal" | "even-vertical";
main_pane_size: number;
main_pane_min_width: number;
agent_pane_min_width: number;
};
export {};
+11
View File
@@ -0,0 +1,11 @@
/**
* Schedules a deferred SQLite update to change the message model in the DB
* WITHOUT triggering a Bus event. Uses microtask retry loop to wait for
* Session.updateMessage() to save the message first, then overwrites the model.
*
* Falls back to setTimeout(fn, 0) after 10 microtask attempts.
*/
export declare function scheduleDeferredModelOverride(messageId: string, targetModel: {
providerID: string;
modelID: string;
}, variant?: string): void;
+23
View File
@@ -0,0 +1,23 @@
import type { OhMyOpenCodeConfig } from "../config";
export declare function detectUltrawork(text: string): boolean;
export type UltraworkOverrideResult = {
providerID?: string;
modelID?: string;
variant?: string;
};
export declare function resolveUltraworkOverride(pluginConfig: OhMyOpenCodeConfig, inputAgentName: string | undefined, output: {
message: Record<string, unknown>;
parts: Array<{
type: string;
text?: string;
[key: string]: unknown;
}>;
}, sessionID?: string): UltraworkOverrideResult | null;
export declare function applyUltraworkModelOverrideOnMessage(pluginConfig: OhMyOpenCodeConfig, inputAgentName: string | undefined, output: {
message: Record<string, unknown>;
parts: Array<{
type: string;
text?: string;
[key: string]: unknown;
}>;
}, tui: unknown, sessionID?: string, client?: unknown): void | Promise<void>;
+6
View File
@@ -0,0 +1,6 @@
type ModelDescriptor = {
providerID: string;
modelID: string;
};
export declare function resolveValidUltraworkVariant(client: unknown, model: ModelDescriptor | undefined, variant: string | undefined): Promise<string | undefined>;
export {};
+15
View File
@@ -0,0 +1,15 @@
import type { OhMyOpenCodeConfig } from "../config";
import type { PluginContext } from "./types";
import type { BackgroundManager } from "../features/background-agent";
export declare function createUnstableAgentBabysitter(args: {
ctx: PluginContext;
backgroundManager: BackgroundManager;
pluginConfig: OhMyOpenCodeConfig;
}): {
event: ({ event }: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
};