oh-my-opencode 0.1.26 → 0.1.28
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/README.ko.md +11 -5
- package/README.md +11 -5
- package/dist/hooks/directory-agents-injector/constants.d.ts +3 -0
- package/dist/hooks/directory-agents-injector/index.d.ts +22 -0
- package/dist/hooks/directory-agents-injector/storage.d.ts +3 -0
- package/dist/hooks/directory-agents-injector/types.d.ts +5 -0
- package/dist/hooks/empty-task-response-detector.d.ts +12 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/pulse-monitor.d.ts +1 -1
- package/dist/hooks/session-recovery/constants.d.ts +6 -0
- package/dist/hooks/session-recovery/index.d.ts +14 -0
- package/dist/hooks/session-recovery/storage.d.ts +14 -0
- package/dist/hooks/session-recovery/types.d.ts +75 -0
- package/dist/index.js +634 -281
- package/dist/tools/glob/cli.d.ts +2 -0
- package/dist/tools/glob/constants.d.ts +6 -0
- package/dist/tools/glob/index.d.ts +2 -0
- package/dist/tools/glob/tools.d.ts +11 -0
- package/dist/tools/glob/types.d.ts +19 -0
- package/dist/tools/glob/utils.d.ts +2 -0
- package/dist/tools/grep/index.d.ts +2 -0
- package/dist/tools/{safe-grep → grep}/tools.d.ts +1 -1
- package/dist/tools/index.d.ts +12 -1
- package/package.json +1 -1
- package/dist/hooks/grep-blocker.d.ts +0 -10
- package/dist/hooks/session-recovery.d.ts +0 -30
- package/dist/tools/safe-grep/index.d.ts +0 -2
- /package/dist/tools/{safe-grep → grep}/cli.d.ts +0 -0
- /package/dist/tools/{safe-grep → grep}/constants.d.ts +0 -0
- /package/dist/tools/{safe-grep → grep}/types.d.ts +0 -0
- /package/dist/tools/{safe-grep → grep}/utils.d.ts +0 -0
package/README.ko.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- [Tools](#tools)
|
|
14
14
|
- [내장 LSP Tools](#내장-lsp-tools)
|
|
15
15
|
- [내장 AST-Grep Tools](#내장-ast-grep-tools)
|
|
16
|
-
- [
|
|
16
|
+
- [Grep](#grep)
|
|
17
17
|
- [내장 MCPs](#내장-mcps)
|
|
18
18
|
- [기타 편의 기능](#기타-편의-기능)
|
|
19
19
|
- [설정](#설정)
|
|
@@ -142,6 +142,7 @@ OpenCode 는 아주 확장가능하고 아주 커스터마이저블합니다.
|
|
|
142
142
|
- **Thinking Disabled Violation**: thinking 이 비활성화인데 thinking 블록이 있을 때 → thinking 블록 제거
|
|
143
143
|
- **Empty Content Message**: 메시지가 thinking/meta 블록만 있고 실제 내용이 없을 때 → 파일시스템을 통해 "(interrupted)" 텍스트 주입
|
|
144
144
|
- **Comment Checker**: 코드 수정 후 불필요한 주석을 감지하여 보고합니다. BDD 패턴, 지시어, 독스트링 등 유효한 주석은 똑똑하게 제외하고, AI가 남긴 흔적을 제거하여 코드를 깨끗하게 유지합니다.
|
|
145
|
+
- **Directory AGENTS.md Injector**: 파일을 읽을 때 `AGENTS.md` 내용을 자동으로 주입합니다. 파일 디렉토리부터 프로젝트 루트까지 탐색하며, 디렉토리별 컨텍스트를 에이전트에게 제공합니다. Claude Code의 CLAUDE.md 기능에서 영감을 받았습니다.
|
|
145
146
|
|
|
146
147
|
### Agents
|
|
147
148
|
|
|
@@ -185,11 +186,16 @@ OpenCode 는 아주 확장가능하고 아주 커스터마이저블합니다.
|
|
|
185
186
|
- **ast_grep_search**: AST 인식 코드 패턴 검색 (25개 언어)
|
|
186
187
|
- **ast_grep_replace**: AST 인식 코드 교체
|
|
187
188
|
|
|
188
|
-
####
|
|
189
|
-
- **
|
|
189
|
+
#### Grep
|
|
190
|
+
- **grep**: 안전 제한이 있는 콘텐츠 검색 (5분 타임아웃, 10MB 출력 제한). OpenCode의 내장 `grep` 도구를 대체합니다.
|
|
190
191
|
- 기본 grep 도구는 시간제한이 걸려있지 않습니다. 대형 코드베이스에서 광범위한 패턴을 검색하면 CPU가 폭발하고 무한히 멈출 수 있습니다.
|
|
191
|
-
-
|
|
192
|
-
|
|
192
|
+
- 이 도구는 엄격한 제한을 적용하며, 내장 `grep`을 완전히 대체합니다.
|
|
193
|
+
|
|
194
|
+
#### Glob
|
|
195
|
+
|
|
196
|
+
- **glob**: 타임아웃 보호가 있는 파일 패턴 매칭 (60초). OpenCode 내장 `glob` 도구를 대체합니다.
|
|
197
|
+
- 기본 `glob`은 타임아웃이 없습니다. ripgrep이 멈추면 무한정 대기합니다.
|
|
198
|
+
- 이 도구는 타임아웃을 강제하고 만료 시 프로세스를 종료합니다.
|
|
193
199
|
|
|
194
200
|
#### 내장 MCPs
|
|
195
201
|
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ English | [한국어](README.ko.md)
|
|
|
13
13
|
- [Tools](#tools)
|
|
14
14
|
- [Built-in LSP Tools](#built-in-lsp-tools)
|
|
15
15
|
- [Built-in AST-Grep Tools](#built-in-ast-grep-tools)
|
|
16
|
-
- [
|
|
16
|
+
- [Grep](#grep)
|
|
17
17
|
- [Built-in MCPs](#built-in-mcps)
|
|
18
18
|
- [Other Features](#other-features)
|
|
19
19
|
- [Configuration](#configuration)
|
|
@@ -138,6 +138,7 @@ I believe in the right tool for the job. For your wallet's sake, use CLIProxyAPI
|
|
|
138
138
|
- **Thinking Disabled Violation**: When thinking blocks exist but thinking is disabled → strips thinking blocks
|
|
139
139
|
- **Empty Content Message**: When message has only thinking/meta blocks without actual content → injects "(interrupted)" text via filesystem
|
|
140
140
|
- **Comment Checker**: Detects and reports unnecessary comments after code modifications. Smartly ignores valid patterns (BDD, directives, docstrings, shebangs) to keep the codebase clean from AI-generated artifacts.
|
|
141
|
+
- **Directory AGENTS.md Injector**: Automatically injects `AGENTS.md` contents when reading files. Searches upward from the file's directory to project root, providing directory-level context to the agent. Inspired by Claude Code's CLAUDE.md feature.
|
|
141
142
|
|
|
142
143
|
### Agents
|
|
143
144
|
- **oracle** (`openai/gpt-5.1`): The architect. Expert in code reviews and strategy. Uses GPT-5.1 for its unmatched logic and reasoning capabilities. Inspired by AmpCode.
|
|
@@ -181,12 +182,17 @@ The features you use in your editor—other agents cannot access them. Oh My Ope
|
|
|
181
182
|
- **ast_grep_search**: AST-aware code pattern search (25 languages)
|
|
182
183
|
- **ast_grep_replace**: AST-aware code replacement
|
|
183
184
|
|
|
184
|
-
####
|
|
185
|
+
#### Grep
|
|
185
186
|
|
|
186
|
-
- **
|
|
187
|
+
- **grep**: Content search with safety limits (5min timeout, 10MB output). Overrides OpenCode's built-in `grep` tool.
|
|
187
188
|
- The default `grep` lacks safeguards. On a large codebase, a broad pattern can cause CPU overload and indefinite hanging.
|
|
188
|
-
-
|
|
189
|
-
|
|
189
|
+
- This tool enforces strict limits and completely replaces the built-in `grep`.
|
|
190
|
+
|
|
191
|
+
#### Glob
|
|
192
|
+
|
|
193
|
+
- **glob**: File pattern matching with timeout protection (60s). Overrides OpenCode's built-in `glob` tool.
|
|
194
|
+
- The default `glob` lacks timeout. If ripgrep hangs, it waits indefinitely.
|
|
195
|
+
- This tool enforces timeouts and kills the process on expiration.
|
|
190
196
|
|
|
191
197
|
#### Built-in MCPs
|
|
192
198
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface ToolExecuteInput {
|
|
3
|
+
tool: string;
|
|
4
|
+
sessionID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
}
|
|
7
|
+
interface ToolExecuteOutput {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface EventInput {
|
|
13
|
+
event: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties?: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function createDirectoryAgentsInjectorHook(ctx: PluginInput): {
|
|
19
|
+
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
|
|
20
|
+
event: ({ event }: EventInput) => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export declare function createEmptyTaskResponseDetectorHook(_ctx: PluginInput): {
|
|
3
|
+
"tool.execute.after": (input: {
|
|
4
|
+
tool: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
callID: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export { createSessionRecoveryHook } from "./session-recovery";
|
|
|
5
5
|
export { createCommentCheckerHooks } from "./comment-checker";
|
|
6
6
|
export { createGrepOutputTruncatorHook } from "./grep-output-truncator";
|
|
7
7
|
export { createPulseMonitorHook } from "./pulse-monitor";
|
|
8
|
+
export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector";
|
|
9
|
+
export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector";
|
|
@@ -4,7 +4,7 @@ export declare function createPulseMonitorHook(ctx: PluginInput): {
|
|
|
4
4
|
event: any;
|
|
5
5
|
}) => Promise<void>;
|
|
6
6
|
"tool.execute.before": () => Promise<void>;
|
|
7
|
-
"tool.execute.after": (
|
|
7
|
+
"tool.execute.after": (_input: {
|
|
8
8
|
sessionID: string;
|
|
9
9
|
}) => Promise<void>;
|
|
10
10
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const OPENCODE_STORAGE: string;
|
|
2
|
+
export declare const MESSAGE_STORAGE: string;
|
|
3
|
+
export declare const PART_STORAGE: string;
|
|
4
|
+
export declare const THINKING_TYPES: Set<string>;
|
|
5
|
+
export declare const META_TYPES: Set<string>;
|
|
6
|
+
export declare const CONTENT_TYPES: Set<string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface MessageInfo {
|
|
3
|
+
id?: string;
|
|
4
|
+
role?: string;
|
|
5
|
+
sessionID?: string;
|
|
6
|
+
parentID?: string;
|
|
7
|
+
error?: unknown;
|
|
8
|
+
}
|
|
9
|
+
export declare function createSessionRecoveryHook(ctx: PluginInput): {
|
|
10
|
+
handleSessionRecovery: (info: MessageInfo) => Promise<boolean>;
|
|
11
|
+
isRecoverableError: (error: unknown) => boolean;
|
|
12
|
+
setOnAbortCallback: (callback: (sessionID: string) => void) => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StoredMessageMeta, StoredPart } from "./types";
|
|
2
|
+
export declare function generatePartId(): string;
|
|
3
|
+
export declare function getMessageDir(sessionID: string): string;
|
|
4
|
+
export declare function readMessages(sessionID: string): StoredMessageMeta[];
|
|
5
|
+
export declare function readParts(messageID: string): StoredPart[];
|
|
6
|
+
export declare function hasContent(part: StoredPart): boolean;
|
|
7
|
+
export declare function messageHasContent(messageID: string): boolean;
|
|
8
|
+
export declare function injectTextPart(sessionID: string, messageID: string, text: string): boolean;
|
|
9
|
+
export declare function findEmptyMessages(sessionID: string): string[];
|
|
10
|
+
export declare function findFirstEmptyMessage(sessionID: string): string | null;
|
|
11
|
+
export declare function findMessagesWithThinkingBlocks(sessionID: string): string[];
|
|
12
|
+
export declare function findMessagesWithOrphanThinking(sessionID: string): string[];
|
|
13
|
+
export declare function prependThinkingPart(sessionID: string, messageID: string): boolean;
|
|
14
|
+
export declare function stripThinkingParts(messageID: string): boolean;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export type ThinkingPartType = "thinking" | "redacted_thinking" | "reasoning";
|
|
2
|
+
export type MetaPartType = "step-start" | "step-finish";
|
|
3
|
+
export type ContentPartType = "text" | "tool" | "tool_use" | "tool_result";
|
|
4
|
+
export interface StoredMessageMeta {
|
|
5
|
+
id: string;
|
|
6
|
+
sessionID: string;
|
|
7
|
+
role: "user" | "assistant";
|
|
8
|
+
parentID?: string;
|
|
9
|
+
time?: {
|
|
10
|
+
created: number;
|
|
11
|
+
completed?: number;
|
|
12
|
+
};
|
|
13
|
+
error?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface StoredTextPart {
|
|
16
|
+
id: string;
|
|
17
|
+
sessionID: string;
|
|
18
|
+
messageID: string;
|
|
19
|
+
type: "text";
|
|
20
|
+
text: string;
|
|
21
|
+
synthetic?: boolean;
|
|
22
|
+
ignored?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface StoredToolPart {
|
|
25
|
+
id: string;
|
|
26
|
+
sessionID: string;
|
|
27
|
+
messageID: string;
|
|
28
|
+
type: "tool";
|
|
29
|
+
callID: string;
|
|
30
|
+
tool: string;
|
|
31
|
+
state: {
|
|
32
|
+
status: "pending" | "running" | "completed" | "error";
|
|
33
|
+
input: Record<string, unknown>;
|
|
34
|
+
output?: string;
|
|
35
|
+
error?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface StoredReasoningPart {
|
|
39
|
+
id: string;
|
|
40
|
+
sessionID: string;
|
|
41
|
+
messageID: string;
|
|
42
|
+
type: "reasoning";
|
|
43
|
+
text: string;
|
|
44
|
+
}
|
|
45
|
+
export interface StoredStepPart {
|
|
46
|
+
id: string;
|
|
47
|
+
sessionID: string;
|
|
48
|
+
messageID: string;
|
|
49
|
+
type: "step-start" | "step-finish";
|
|
50
|
+
}
|
|
51
|
+
export type StoredPart = StoredTextPart | StoredToolPart | StoredReasoningPart | StoredStepPart | {
|
|
52
|
+
id: string;
|
|
53
|
+
sessionID: string;
|
|
54
|
+
messageID: string;
|
|
55
|
+
type: string;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
};
|
|
58
|
+
export interface MessageData {
|
|
59
|
+
info?: {
|
|
60
|
+
id?: string;
|
|
61
|
+
role?: string;
|
|
62
|
+
sessionID?: string;
|
|
63
|
+
parentID?: string;
|
|
64
|
+
error?: unknown;
|
|
65
|
+
};
|
|
66
|
+
parts?: Array<{
|
|
67
|
+
type: string;
|
|
68
|
+
id?: string;
|
|
69
|
+
text?: string;
|
|
70
|
+
thinking?: string;
|
|
71
|
+
name?: string;
|
|
72
|
+
input?: Record<string, unknown>;
|
|
73
|
+
callID?: string;
|
|
74
|
+
}>;
|
|
75
|
+
}
|