Remove ultrawork-model-override hook and per-agent ultrawork model swap config that relied on zen opencode.ai free tier (no longer functional). Removed: - src/hooks/ultrawork-model-override/ (hook, test, index) - ultrawork field from AgentOverrideConfigSchema - ultrawork-model-override from HookNameSchema - UltraworkConfig type from model-fallback-types - Non-max20 sonnet+ultrawork-opus codepath from model-fallback - Claude subscription model table from installation docs - All references in plugin-interface, create-session-hooks, schema.json - Related test cases and updated snapshots
69 lines
1.9 KiB
TypeScript
69 lines
1.9 KiB
TypeScript
import type { PluginContext, PluginInterface, ToolsRecord } from "./plugin/types"
|
|
import type { OhMyOpenCodeConfig } from "./config"
|
|
|
|
import { createChatParamsHandler } from "./plugin/chat-params"
|
|
import { createChatMessageHandler } from "./plugin/chat-message"
|
|
import { createMessagesTransformHandler } from "./plugin/messages-transform"
|
|
import { createEventHandler } from "./plugin/event"
|
|
import { createToolExecuteAfterHandler } from "./plugin/tool-execute-after"
|
|
import { createToolExecuteBeforeHandler } from "./plugin/tool-execute-before"
|
|
|
|
import type { CreatedHooks } from "./create-hooks"
|
|
import type { Managers } from "./create-managers"
|
|
|
|
export function createPluginInterface(args: {
|
|
ctx: PluginContext
|
|
pluginConfig: OhMyOpenCodeConfig
|
|
firstMessageVariantGate: {
|
|
shouldOverride: (sessionID: string) => boolean
|
|
markApplied: (sessionID: string) => void
|
|
markSessionCreated: (sessionInfo: { id?: string; title?: string; parentID?: string } | undefined) => void
|
|
clear: (sessionID: string) => void
|
|
}
|
|
managers: Managers
|
|
hooks: CreatedHooks
|
|
tools: ToolsRecord
|
|
}): PluginInterface {
|
|
const { ctx, pluginConfig, firstMessageVariantGate, managers, hooks, tools } =
|
|
args
|
|
|
|
return {
|
|
tool: tools,
|
|
|
|
"chat.params": async (input, output) => {
|
|
const handler = createChatParamsHandler({ anthropicEffort: hooks.anthropicEffort })
|
|
await handler(input, output)
|
|
},
|
|
|
|
"chat.message": createChatMessageHandler({
|
|
ctx,
|
|
pluginConfig,
|
|
firstMessageVariantGate,
|
|
hooks,
|
|
}),
|
|
|
|
"experimental.chat.messages.transform": createMessagesTransformHandler({
|
|
hooks,
|
|
}),
|
|
|
|
config: managers.configHandler,
|
|
|
|
event: createEventHandler({
|
|
ctx,
|
|
pluginConfig,
|
|
firstMessageVariantGate,
|
|
managers,
|
|
hooks,
|
|
}),
|
|
|
|
"tool.execute.before": createToolExecuteBeforeHandler({
|
|
ctx,
|
|
hooks,
|
|
}),
|
|
|
|
"tool.execute.after": createToolExecuteAfterHandler({
|
|
hooks,
|
|
}),
|
|
}
|
|
}
|