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.
- package/LICENSE.md +82 -0
- package/README.ja.md +29 -2
- package/README.ko.md +29 -2
- package/README.md +31 -4
- package/README.zh-cn.md +29 -3
- package/dist/agents/document-writer.d.ts +1 -0
- package/dist/agents/explore.d.ts +1 -0
- package/dist/agents/frontend-ui-ux-engineer.d.ts +1 -0
- package/dist/agents/librarian.d.ts +1 -0
- package/dist/agents/multimodal-looker.d.ts +1 -0
- package/dist/agents/types.d.ts +3 -1
- package/dist/cli/config-manager.d.ts +71 -1
- package/dist/cli/config-manager.test.d.ts +1 -0
- package/dist/cli/index.js +3744 -0
- package/dist/config/schema.d.ts +21 -0
- package/dist/google-auth.js +1735 -0
- package/dist/hooks/claude-code-hooks/config-loader.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/index.d.ts +5 -0
- package/dist/hooks/claude-code-hooks/pre-compact.d.ts +16 -0
- package/dist/hooks/claude-code-hooks/types.d.ts +17 -1
- package/dist/hooks/non-interactive-env/detector.d.ts +1 -0
- package/dist/hooks/non-interactive-env/index.d.ts +1 -0
- package/dist/hooks/session-notification.test.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer.d.ts +5 -1
- package/dist/index.js +296 -55
- package/package.json +2 -2
- package/LICENSE +0 -21
|
@@ -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;
|
|
@@ -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;
|