oh-my-opencode 2.5.0 → 2.5.2

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.
@@ -4,6 +4,7 @@ export interface DisabledHooksConfig {
4
4
  PreToolUse?: string[];
5
5
  PostToolUse?: string[];
6
6
  UserPromptSubmit?: string[];
7
+ PreCompact?: string[];
7
8
  }
8
9
  export interface PluginExtendedConfig {
9
10
  disabledHooks?: DisabledHooksConfig;
@@ -1,6 +1,11 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { PluginConfig } from "./types";
3
3
  export declare function createClaudeCodeHooksHook(ctx: PluginInput, config?: PluginConfig): {
4
+ "experimental.session.compacting": (input: {
5
+ sessionID: string;
6
+ }, output: {
7
+ context: string[];
8
+ }) => Promise<void>;
4
9
  "chat.message": (input: {
5
10
  sessionID: string;
6
11
  agent?: string;
@@ -0,0 +1,16 @@
1
+ import type { ClaudeHooksConfig } from "./types";
2
+ import { type PluginExtendedConfig } from "./config-loader";
3
+ export interface PreCompactContext {
4
+ sessionId: string;
5
+ cwd: string;
6
+ }
7
+ export interface PreCompactResult {
8
+ context: string[];
9
+ elapsedMs?: number;
10
+ hookName?: string;
11
+ continue?: boolean;
12
+ stopReason?: string;
13
+ suppressOutput?: boolean;
14
+ systemMessage?: string;
15
+ }
16
+ export declare function executePreCompactHooks(ctx: PreCompactContext, config: ClaudeHooksConfig | null, extendedConfig?: PluginExtendedConfig | null): Promise<PreCompactResult>;
@@ -2,7 +2,7 @@
2
2
  * Claude Code Hooks Type Definitions
3
3
  * Maps Claude Code hook concepts to OpenCode plugin events
4
4
  */
5
- export type ClaudeHookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop";
5
+ export type ClaudeHookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "PreCompact";
6
6
  export interface HookMatcher {
7
7
  matcher: string;
8
8
  hooks: HookCommand[];
@@ -16,6 +16,7 @@ export interface ClaudeHooksConfig {
16
16
  PostToolUse?: HookMatcher[];
17
17
  UserPromptSubmit?: HookMatcher[];
18
18
  Stop?: HookMatcher[];
19
+ PreCompact?: HookMatcher[];
19
20
  }
20
21
  export interface PreToolUseInput {
21
22
  session_id: string;
@@ -67,6 +68,12 @@ export interface StopInput {
67
68
  todo_path?: string;
68
69
  hook_source?: HookSource;
69
70
  }
71
+ export interface PreCompactInput {
72
+ session_id: string;
73
+ cwd: string;
74
+ hook_event_name: "PreCompact";
75
+ hook_source?: HookSource;
76
+ }
70
77
  export type PermissionDecision = "allow" | "deny" | "ask";
71
78
  /**
72
79
  * Common JSON fields for all hook outputs (Claude Code spec)
@@ -141,6 +148,15 @@ export interface StopOutput {
141
148
  permission_mode?: PermissionMode;
142
149
  inject_prompt?: string;
143
150
  }
151
+ export interface PreCompactOutput extends HookCommonOutput {
152
+ /** Additional context to inject into compaction prompt */
153
+ context?: string[];
154
+ hookSpecificOutput?: {
155
+ hookEventName: "PreCompact";
156
+ /** Additional context strings to inject */
157
+ additionalContext?: string[];
158
+ };
159
+ }
144
160
  export type ClaudeCodeContent = {
145
161
  type: "text";
146
162
  text: string;
@@ -0,0 +1 @@
1
+ export declare function isNonInteractive(): boolean;
@@ -1,5 +1,6 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  export * from "./constants";
3
+ export * from "./detector";
3
4
  export * from "./types";
4
5
  export declare function createNonInteractiveEnvHook(_ctx: PluginInput): {
5
6
  "tool.execute.before": (input: {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,8 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { BackgroundManager } from "../features/background-agent";
3
+ export interface TodoContinuationEnforcerOptions {
4
+ backgroundManager?: BackgroundManager;
5
+ }
2
6
  export interface TodoContinuationEnforcer {
3
7
  handler: (input: {
4
8
  event: {
@@ -9,4 +13,4 @@ export interface TodoContinuationEnforcer {
9
13
  markRecovering: (sessionID: string) => void;
10
14
  markRecoveryComplete: (sessionID: string) => void;
11
15
  }
12
- export declare function createTodoContinuationEnforcer(ctx: PluginInput): TodoContinuationEnforcer;
16
+ export declare function createTodoContinuationEnforcer(ctx: PluginInput, options?: TodoContinuationEnforcerOptions): TodoContinuationEnforcer;