oh-my-opencode 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.ja.md +6 -6
  2. package/README.ko.md +6 -6
  3. package/README.md +6 -6
  4. package/README.zh-cn.md +6 -6
  5. package/dist/agents/sisyphus-junior/gpt.d.ts +4 -14
  6. package/dist/cli/index.js +357 -104
  7. package/dist/cli/run/event-handlers.d.ts +1 -0
  8. package/dist/cli/run/opencode-bin-path.d.ts +3 -0
  9. package/dist/cli/run/opencode-binary-resolver.d.ts +5 -0
  10. package/dist/cli/run/session-resolver.d.ts +1 -0
  11. package/dist/cli/run/types.d.ts +29 -0
  12. package/dist/config/schema/browser-automation.d.ts +2 -0
  13. package/dist/config/schema/experimental.d.ts +1 -0
  14. package/dist/config/schema/hooks.d.ts +1 -0
  15. package/dist/config/schema/oh-my-opencode-config.d.ts +3 -0
  16. package/dist/create-hooks.d.ts +3 -0
  17. package/dist/create-managers.d.ts +1 -0
  18. package/dist/features/background-agent/manager.d.ts +3 -0
  19. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  20. package/dist/features/builtin-skills/skills/playwright-cli.d.ts +10 -0
  21. package/dist/features/tmux-subagent/action-executor-core.d.ts +21 -0
  22. package/dist/features/tmux-subagent/action-executor.d.ts +3 -12
  23. package/dist/features/tmux-subagent/grid-planning.d.ts +2 -2
  24. package/dist/features/tmux-subagent/pane-split-availability.d.ts +3 -2
  25. package/dist/features/tmux-subagent/polling-manager.d.ts +1 -0
  26. package/dist/features/tmux-subagent/spawn-target-finder.d.ts +1 -1
  27. package/dist/hooks/context-window-monitor.d.ts +5 -1
  28. package/dist/hooks/directory-agents-injector/hook.d.ts +3 -1
  29. package/dist/hooks/directory-readme-injector/hook.d.ts +3 -1
  30. package/dist/hooks/hashline-read-enhancer/hook.d.ts +18 -0
  31. package/dist/hooks/hashline-read-enhancer/index.d.ts +1 -0
  32. package/dist/hooks/index.d.ts +1 -0
  33. package/dist/hooks/preemptive-compaction.d.ts +4 -1
  34. package/dist/hooks/rules-injector/hook.d.ts +3 -1
  35. package/dist/hooks/think-mode/switcher.d.ts +7 -0
  36. package/dist/hooks/tool-output-truncator.d.ts +3 -0
  37. package/dist/index.js +1758 -830
  38. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
  39. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -0
  40. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +4 -1
  41. package/dist/shared/dynamic-truncator.d.ts +7 -3
  42. package/dist/shared/fallback-model-availability.d.ts +9 -2
  43. package/dist/shared/git-worktree/index.d.ts +2 -0
  44. package/dist/shared/git-worktree/parse-status-porcelain-line.d.ts +6 -0
  45. package/dist/shared/index.d.ts +2 -0
  46. package/dist/shared/model-availability.d.ts +0 -5
  47. package/dist/shared/session-directory-resolver.d.ts +7 -0
  48. package/dist/shared/tmux/tmux-utils/layout.d.ts +2 -2
  49. package/dist/tools/call-omo-agent/tools.d.ts +1 -1
  50. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +7 -1
  51. package/dist/tools/hashline-edit/constants.d.ts +2 -0
  52. package/dist/tools/hashline-edit/edit-operations.d.ts +6 -0
  53. package/dist/tools/hashline-edit/hash-computation.d.ts +3 -0
  54. package/dist/tools/hashline-edit/index.d.ts +7 -0
  55. package/dist/tools/hashline-edit/tools.d.ts +2 -0
  56. package/dist/tools/hashline-edit/types.d.ts +22 -0
  57. package/dist/tools/hashline-edit/validation.d.ts +6 -0
  58. package/dist/tools/index.d.ts +1 -0
  59. package/package.json +8 -8
@@ -7,3 +7,4 @@ export declare function handleMessagePartUpdated(ctx: RunContext, payload: Event
7
7
  export declare function handleMessageUpdated(ctx: RunContext, payload: EventPayload, state: EventState): void;
8
8
  export declare function handleToolExecute(ctx: RunContext, payload: EventPayload, state: EventState): void;
9
9
  export declare function handleToolResult(ctx: RunContext, payload: EventPayload, state: EventState): void;
10
+ export declare function handleTuiToast(_ctx: RunContext, payload: EventPayload, state: EventState): void;
@@ -0,0 +1,3 @@
1
+ type EnvLike = Record<string, string | undefined>;
2
+ export declare function prependResolvedOpencodeBinToPath(env?: EnvLike, resolve?: (id: string) => string): void;
3
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function collectCandidateBinaryPaths(pathEnv: string | undefined, which?: (command: string) => string | null | undefined, platform?: NodeJS.Platform): string[];
2
+ export declare function canExecuteBinary(binaryPath: string): Promise<boolean>;
3
+ export declare function findWorkingOpencodeBinary(pathEnv?: string | undefined, probe?: (binaryPath: string) => Promise<boolean>, which?: (command: string) => string | null | undefined, platform?: NodeJS.Platform): Promise<string | null>;
4
+ export declare function buildPathWithBinaryFirst(pathEnv: string | undefined, binaryPath: string): string;
5
+ export declare function withWorkingOpencodePath<T>(startServer: () => Promise<T>, finder?: (pathEnv: string | undefined) => Promise<string | null>): Promise<T>;
@@ -2,4 +2,5 @@ import type { OpencodeClient } from "./types";
2
2
  export declare function resolveSession(options: {
3
3
  client: OpencodeClient;
4
4
  sessionId?: string;
5
+ directory: string;
5
6
  }): Promise<string>;
@@ -46,9 +46,11 @@ export interface EventPayload {
46
46
  }
47
47
  export interface SessionIdleProps {
48
48
  sessionID?: string;
49
+ sessionId?: string;
49
50
  }
50
51
  export interface SessionStatusProps {
51
52
  sessionID?: string;
53
+ sessionId?: string;
52
54
  status?: {
53
55
  type?: string;
54
56
  };
@@ -56,6 +58,7 @@ export interface SessionStatusProps {
56
58
  export interface MessageUpdatedProps {
57
59
  info?: {
58
60
  sessionID?: string;
61
+ sessionId?: string;
59
62
  role?: string;
60
63
  modelID?: string;
61
64
  providerID?: string;
@@ -63,28 +66,54 @@ export interface MessageUpdatedProps {
63
66
  };
64
67
  }
65
68
  export interface MessagePartUpdatedProps {
69
+ /** @deprecated Legacy structure — current OpenCode puts sessionID inside part */
66
70
  info?: {
67
71
  sessionID?: string;
72
+ sessionId?: string;
68
73
  role?: string;
69
74
  };
70
75
  part?: {
76
+ id?: string;
77
+ sessionID?: string;
78
+ sessionId?: string;
79
+ messageID?: string;
71
80
  type?: string;
72
81
  text?: string;
82
+ /** Tool name (for part.type === "tool") */
83
+ tool?: string;
84
+ /** Tool state (for part.type === "tool") */
85
+ state?: {
86
+ status?: string;
87
+ input?: Record<string, unknown>;
88
+ output?: string;
89
+ };
73
90
  name?: string;
74
91
  input?: unknown;
92
+ time?: {
93
+ start?: number;
94
+ end?: number;
95
+ };
75
96
  };
76
97
  }
77
98
  export interface ToolExecuteProps {
78
99
  sessionID?: string;
100
+ sessionId?: string;
79
101
  name?: string;
80
102
  input?: Record<string, unknown>;
81
103
  }
82
104
  export interface ToolResultProps {
83
105
  sessionID?: string;
106
+ sessionId?: string;
84
107
  name?: string;
85
108
  output?: string;
86
109
  }
87
110
  export interface SessionErrorProps {
88
111
  sessionID?: string;
112
+ sessionId?: string;
89
113
  error?: unknown;
90
114
  }
115
+ export interface TuiToastShowProps {
116
+ title?: string;
117
+ message?: string;
118
+ variant?: "info" | "success" | "warning" | "error";
119
+ }
@@ -3,12 +3,14 @@ export declare const BrowserAutomationProviderSchema: z.ZodEnum<{
3
3
  playwright: "playwright";
4
4
  "agent-browser": "agent-browser";
5
5
  "dev-browser": "dev-browser";
6
+ "playwright-cli": "playwright-cli";
6
7
  }>;
7
8
  export declare const BrowserAutomationConfigSchema: z.ZodObject<{
8
9
  provider: z.ZodDefault<z.ZodEnum<{
9
10
  playwright: "playwright";
10
11
  "agent-browser": "agent-browser";
11
12
  "dev-browser": "dev-browser";
13
+ "playwright-cli": "playwright-cli";
12
14
  }>>;
13
15
  }, z.core.$strip>;
14
16
  export type BrowserAutomationProvider = z.infer<typeof BrowserAutomationProviderSchema>;
@@ -33,5 +33,6 @@ export declare const ExperimentalConfigSchema: z.ZodObject<{
33
33
  task_system: z.ZodOptional<z.ZodBoolean>;
34
34
  plugin_load_timeout_ms: z.ZodOptional<z.ZodNumber>;
35
35
  safe_hook_creation: z.ZodOptional<z.ZodBoolean>;
36
+ hashline_edit: z.ZodOptional<z.ZodBoolean>;
36
37
  }, z.core.$strip>;
37
38
  export type ExperimentalConfig = z.infer<typeof ExperimentalConfigSchema>;
@@ -42,5 +42,6 @@ export declare const HookNameSchema: z.ZodEnum<{
42
42
  "tasks-todowrite-disabler": "tasks-todowrite-disabler";
43
43
  "write-existing-file-guard": "write-existing-file-guard";
44
44
  "anthropic-effort": "anthropic-effort";
45
+ "hashline-read-enhancer": "hashline-read-enhancer";
45
46
  }>;
46
47
  export type HookName = z.infer<typeof HookNameSchema>;
@@ -66,6 +66,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
66
66
  "tasks-todowrite-disabler": "tasks-todowrite-disabler";
67
67
  "write-existing-file-guard": "write-existing-file-guard";
68
68
  "anthropic-effort": "anthropic-effort";
69
+ "hashline-read-enhancer": "hashline-read-enhancer";
69
70
  }>>>;
70
71
  disabled_commands: z.ZodOptional<z.ZodArray<z.ZodEnum<{
71
72
  "init-deep": "init-deep";
@@ -1211,6 +1212,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1211
1212
  task_system: z.ZodOptional<z.ZodBoolean>;
1212
1213
  plugin_load_timeout_ms: z.ZodOptional<z.ZodNumber>;
1213
1214
  safe_hook_creation: z.ZodOptional<z.ZodBoolean>;
1215
+ hashline_edit: z.ZodOptional<z.ZodBoolean>;
1214
1216
  }, z.core.$strip>>;
1215
1217
  auto_update: z.ZodOptional<z.ZodBoolean>;
1216
1218
  skills: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
@@ -1262,6 +1264,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1262
1264
  playwright: "playwright";
1263
1265
  "agent-browser": "agent-browser";
1264
1266
  "dev-browser": "dev-browser";
1267
+ "playwright-cli": "playwright-cli";
1265
1268
  }>>;
1266
1269
  }, z.core.$strip>>;
1267
1270
  websearch: z.ZodOptional<z.ZodObject<{
@@ -3,10 +3,12 @@ import type { HookName, OhMyOpenCodeConfig } from "./config";
3
3
  import type { LoadedSkill } from "./features/opencode-skill-loader/types";
4
4
  import type { BackgroundManager } from "./features/background-agent";
5
5
  import type { PluginContext } from "./plugin/types";
6
+ import type { ModelCacheState } from "./plugin-state";
6
7
  export type CreatedHooks = ReturnType<typeof createHooks>;
7
8
  export declare function createHooks(args: {
8
9
  ctx: PluginContext;
9
10
  pluginConfig: OhMyOpenCodeConfig;
11
+ modelCacheState: ModelCacheState;
10
12
  backgroundManager: BackgroundManager;
11
13
  isHookEnabled: (hookName: HookName) => boolean;
12
14
  safeHookEnabled: boolean;
@@ -34,6 +36,7 @@ export declare function createHooks(args: {
34
36
  rulesInjector: ReturnType<typeof import("./hooks").createRulesInjectorHook> | null;
35
37
  tasksTodowriteDisabler: ReturnType<typeof import("./hooks").createTasksTodowriteDisablerHook> | null;
36
38
  writeExistingFileGuard: ReturnType<typeof import("./hooks").createWriteExistingFileGuardHook> | null;
39
+ hashlineReadEnhancer: ReturnType<typeof import("./hooks").createHashlineReadEnhancerHook> | null;
37
40
  contextWindowMonitor: ReturnType<typeof import("./hooks").createContextWindowMonitorHook> | null;
38
41
  preemptiveCompaction: ReturnType<typeof import("./hooks").createPreemptiveCompactionHook> | null;
39
42
  sessionRecovery: ReturnType<typeof import("./hooks").createSessionRecoveryHook> | null;
@@ -16,4 +16,5 @@ export declare function createManagers(args: {
16
16
  pluginConfig: OhMyOpenCodeConfig;
17
17
  tmuxConfig: TmuxConfig;
18
18
  modelCacheState: ModelCacheState;
19
+ backgroundNotificationHookEnabled: boolean;
19
20
  }): Managers;
@@ -29,6 +29,7 @@ export declare class BackgroundManager {
29
29
  private client;
30
30
  private directory;
31
31
  private pollingInterval?;
32
+ private pollingInFlight;
32
33
  private concurrencyManager;
33
34
  private shutdownTriggered;
34
35
  private config?;
@@ -40,11 +41,13 @@ export declare class BackgroundManager {
40
41
  private completionTimers;
41
42
  private idleDeferralTimers;
42
43
  private notificationQueueByParent;
44
+ private enableParentSessionNotifications;
43
45
  readonly taskHistory: TaskHistory;
44
46
  constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
45
47
  tmuxConfig?: TmuxConfig;
46
48
  onSubagentSessionCreated?: OnSubagentSessionCreated;
47
49
  onShutdown?: () => void;
50
+ enableParentSessionNotifications?: boolean;
48
51
  });
49
52
  launch(input: LaunchInput): Promise<BackgroundTask>;
50
53
  private processKey;
@@ -1,4 +1,5 @@
1
1
  export { playwrightSkill, agentBrowserSkill } from "./playwright";
2
+ export { playwrightCliSkill } from "./playwright-cli";
2
3
  export { frontendUiUxSkill } from "./frontend-ui-ux";
3
4
  export { gitMasterSkill } from "./git-master";
4
5
  export { devBrowserSkill } from "./dev-browser";
@@ -0,0 +1,10 @@
1
+ import type { BuiltinSkill } from "../types";
2
+ /**
3
+ * Playwright CLI skill — token-efficient CLI alternative to the MCP-based playwright skill.
4
+ *
5
+ * Uses name "playwright" (not "playwright-cli") because agents hardcode "playwright" as the
6
+ * canonical browser skill name. The browserProvider config swaps the implementation behind
7
+ * the same name: "playwright" gives MCP, "playwright-cli" gives this CLI variant.
8
+ * The binary is still called `playwright-cli` (see allowedTools).
9
+ */
10
+ export declare const playwrightCliSkill: BuiltinSkill;
@@ -0,0 +1,21 @@
1
+ import type { TmuxConfig } from "../../config/schema";
2
+ import type { applyLayout, closeTmuxPane, enforceMainPaneWidth, replaceTmuxPane, spawnTmuxPane } from "../../shared/tmux";
3
+ import type { PaneAction, WindowState } from "./types";
4
+ export interface ActionResult {
5
+ success: boolean;
6
+ paneId?: string;
7
+ error?: string;
8
+ }
9
+ export interface ExecuteContext {
10
+ config: TmuxConfig;
11
+ serverUrl: string;
12
+ windowState: WindowState;
13
+ }
14
+ export interface ActionExecutorDeps {
15
+ spawnTmuxPane: typeof spawnTmuxPane;
16
+ closeTmuxPane: typeof closeTmuxPane;
17
+ replaceTmuxPane: typeof replaceTmuxPane;
18
+ applyLayout: typeof applyLayout;
19
+ enforceMainPaneWidth: typeof enforceMainPaneWidth;
20
+ }
21
+ export declare function executeActionWithDeps(action: PaneAction, ctx: ExecuteContext, deps: ActionExecutorDeps): Promise<ActionResult>;
@@ -1,10 +1,6 @@
1
- import type { TmuxConfig } from "../../config/schema";
2
- import type { PaneAction, WindowState } from "./types";
3
- export interface ActionResult {
4
- success: boolean;
5
- paneId?: string;
6
- error?: string;
7
- }
1
+ import type { PaneAction } from "./types";
2
+ import type { ActionResult, ExecuteContext } from "./action-executor-core";
3
+ export type { ActionExecutorDeps, ActionResult, ExecuteContext } from "./action-executor-core";
8
4
  export interface ExecuteActionsResult {
9
5
  success: boolean;
10
6
  spawnedPaneId?: string;
@@ -13,10 +9,5 @@ export interface ExecuteActionsResult {
13
9
  result: ActionResult;
14
10
  }>;
15
11
  }
16
- export interface ExecuteContext {
17
- config: TmuxConfig;
18
- serverUrl: string;
19
- windowState: WindowState;
20
- }
21
12
  export declare function executeAction(action: PaneAction, ctx: ExecuteContext): Promise<ActionResult>;
22
13
  export declare function executeActions(actions: PaneAction[], ctx: ExecuteContext): Promise<ExecuteActionsResult>;
@@ -14,6 +14,6 @@ export interface GridPlan {
14
14
  slotWidth: number;
15
15
  slotHeight: number;
16
16
  }
17
- export declare function calculateCapacity(windowWidth: number, windowHeight: number, minPaneWidth?: number): GridCapacity;
18
- export declare function computeGridPlan(windowWidth: number, windowHeight: number, paneCount: number): GridPlan;
17
+ export declare function calculateCapacity(windowWidth: number, windowHeight: number, minPaneWidth?: number, mainPaneWidth?: number): GridCapacity;
18
+ export declare function computeGridPlan(windowWidth: number, windowHeight: number, paneCount: number, mainPaneWidth?: number, minPaneWidth?: number): GridPlan;
19
19
  export declare function mapPaneToSlot(pane: TmuxPaneInfo, plan: GridPlan, mainPaneWidth: number): GridSlot;
@@ -4,5 +4,6 @@ export declare function getColumnWidth(agentAreaWidth: number, paneCount: number
4
4
  export declare function isSplittableAtCount(agentAreaWidth: number, paneCount: number, minPaneWidth?: number): boolean;
5
5
  export declare function findMinimalEvictions(agentAreaWidth: number, currentCount: number, minPaneWidth?: number): number | null;
6
6
  export declare function canSplitPane(pane: TmuxPaneInfo, direction: SplitDirection, minPaneWidth?: number): boolean;
7
- export declare function canSplitPaneAnyDirection(pane: TmuxPaneInfo): boolean;
8
- export declare function getBestSplitDirection(pane: TmuxPaneInfo): SplitDirection | null;
7
+ export declare function canSplitPaneAnyDirection(pane: TmuxPaneInfo, minPaneWidth?: number): boolean;
8
+ export declare function canSplitPaneAnyDirectionWithMinWidth(pane: TmuxPaneInfo, minPaneWidth?: number): boolean;
9
+ export declare function getBestSplitDirection(pane: TmuxPaneInfo, minPaneWidth?: number): SplitDirection | null;
@@ -5,6 +5,7 @@ export declare class TmuxPollingManager {
5
5
  private sessions;
6
6
  private closeSessionById;
7
7
  private pollInterval?;
8
+ private pollingInFlight;
8
9
  constructor(client: OpencodeClient, sessions: Map<string, TrackedSession>, closeSessionById: (sessionId: string) => Promise<void>);
9
10
  startPolling(): void;
10
11
  stopPolling(): void;
@@ -3,4 +3,4 @@ export interface SpawnTarget {
3
3
  targetPaneId: string;
4
4
  splitDirection: SplitDirection;
5
5
  }
6
- export declare function findSpawnTarget(state: WindowState): SpawnTarget | null;
6
+ export declare function findSpawnTarget(state: WindowState, minPaneWidth?: number): SpawnTarget | null;
@@ -1,5 +1,8 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
- export declare function createContextWindowMonitorHook(_ctx: PluginInput): {
2
+ type ModelCacheStateLike = {
3
+ anthropicContext1MEnabled: boolean;
4
+ };
5
+ export declare function createContextWindowMonitorHook(_ctx: PluginInput, modelCacheState?: ModelCacheStateLike): {
3
6
  "tool.execute.after": (input: {
4
7
  tool: string;
5
8
  sessionID: string;
@@ -16,3 +19,4 @@ export declare function createContextWindowMonitorHook(_ctx: PluginInput): {
16
19
  };
17
20
  }) => Promise<void>;
18
21
  };
22
+ export {};
@@ -18,7 +18,9 @@ interface EventInput {
18
18
  properties?: unknown;
19
19
  };
20
20
  }
21
- export declare function createDirectoryAgentsInjectorHook(ctx: PluginInput): {
21
+ export declare function createDirectoryAgentsInjectorHook(ctx: PluginInput, modelCacheState?: {
22
+ anthropicContext1MEnabled: boolean;
23
+ }): {
22
24
  "tool.execute.before": (input: ToolExecuteInput, output: ToolExecuteBeforeOutput) => Promise<void>;
23
25
  "tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
24
26
  event: ({ event }: EventInput) => Promise<void>;
@@ -18,7 +18,9 @@ interface EventInput {
18
18
  properties?: unknown;
19
19
  };
20
20
  }
21
- export declare function createDirectoryReadmeInjectorHook(ctx: PluginInput): {
21
+ export declare function createDirectoryReadmeInjectorHook(ctx: PluginInput, modelCacheState?: {
22
+ anthropicContext1MEnabled: boolean;
23
+ }): {
22
24
  "tool.execute.before": (input: ToolExecuteInput, output: ToolExecuteBeforeOutput) => Promise<void>;
23
25
  "tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
24
26
  event: ({ event }: EventInput) => Promise<void>;
@@ -0,0 +1,18 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ interface HashlineReadEnhancerConfig {
3
+ hashline_edit?: {
4
+ enabled: boolean;
5
+ };
6
+ }
7
+ export declare function createHashlineReadEnhancerHook(_ctx: PluginInput, config: HashlineReadEnhancerConfig): {
8
+ "tool.execute.after": (input: {
9
+ tool: string;
10
+ sessionID: string;
11
+ callID: string;
12
+ }, output: {
13
+ title: string;
14
+ output: string;
15
+ metadata: unknown;
16
+ }) => Promise<void>;
17
+ };
18
+ export {};
@@ -0,0 +1 @@
1
+ export { createHashlineReadEnhancerHook } from "./hook";
@@ -40,3 +40,4 @@ export { createUnstableAgentBabysitterHook } from "./unstable-agent-babysitter";
40
40
  export { createPreemptiveCompactionHook } from "./preemptive-compaction";
41
41
  export { createTasksTodowriteDisablerHook } from "./tasks-todowrite-disabler";
42
42
  export { createWriteExistingFileGuardHook } from "./write-existing-file-guard";
43
+ export { createHashlineReadEnhancerHook } from "./hashline-read-enhancer";
@@ -1,3 +1,6 @@
1
+ type ModelCacheStateLike = {
2
+ anthropicContext1MEnabled: boolean;
3
+ };
1
4
  type PluginInput = {
2
5
  client: {
3
6
  session: {
@@ -10,7 +13,7 @@ type PluginInput = {
10
13
  };
11
14
  directory: string;
12
15
  };
13
- export declare function createPreemptiveCompactionHook(ctx: PluginInput): {
16
+ export declare function createPreemptiveCompactionHook(ctx: PluginInput, modelCacheState?: ModelCacheStateLike): {
14
17
  "tool.execute.after": (input: {
15
18
  tool: string;
16
19
  sessionID: string;
@@ -18,7 +18,9 @@ interface EventInput {
18
18
  properties?: unknown;
19
19
  };
20
20
  }
21
- export declare function createRulesInjectorHook(ctx: PluginInput): {
21
+ export declare function createRulesInjectorHook(ctx: PluginInput, modelCacheState?: {
22
+ anthropicContext1MEnabled: boolean;
23
+ }): {
22
24
  "tool.execute.before": (input: ToolExecuteInput, output: ToolExecuteBeforeOutput) => Promise<void>;
23
25
  "tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
24
26
  event: ({ event }: EventInput) => Promise<void>;
@@ -23,6 +23,13 @@ export declare const THINKING_CONFIGS: {
23
23
  };
24
24
  readonly maxTokens: 128000;
25
25
  };
26
+ readonly "google-vertex-anthropic": {
27
+ readonly thinking: {
28
+ readonly type: "enabled";
29
+ readonly budgetTokens: 64000;
30
+ };
31
+ readonly maxTokens: 128000;
32
+ };
26
33
  readonly "amazon-bedrock": {
27
34
  readonly reasoningConfig: {
28
35
  readonly type: "enabled";
@@ -1,6 +1,9 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { ExperimentalConfig } from "../config/schema";
3
3
  interface ToolOutputTruncatorOptions {
4
+ modelCacheState?: {
5
+ anthropicContext1MEnabled: boolean;
6
+ };
4
7
  experimental?: ExperimentalConfig;
5
8
  }
6
9
  export declare function createToolOutputTruncatorHook(ctx: PluginInput, options?: ToolOutputTruncatorOptions): {