oh-my-opencode 0.1.25 → 0.1.27
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 +21 -5
- package/README.md +21 -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/grep-output-truncator.d.ts +12 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/pulse-monitor.d.ts +10 -0
- 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 +892 -297
- package/dist/tools/ast-grep/index.d.ts +8 -8
- package/dist/tools/ast-grep/tools.d.ts +12 -12
- 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 +20 -9
- package/dist/tools/lsp/client.d.ts +5 -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
|
@@ -20,11 +20,11 @@ export declare const builtinTools: {
|
|
|
20
20
|
swift: "swift";
|
|
21
21
|
elixir: "elixir";
|
|
22
22
|
yaml: "yaml";
|
|
23
|
-
|
|
23
|
+
json: "json";
|
|
24
|
+
html: "html";
|
|
24
25
|
css: "css";
|
|
26
|
+
bash: "bash";
|
|
25
27
|
haskell: "haskell";
|
|
26
|
-
html: "html";
|
|
27
|
-
json: "json";
|
|
28
28
|
kotlin: "kotlin";
|
|
29
29
|
nix: "nix";
|
|
30
30
|
scala: "scala";
|
|
@@ -37,7 +37,7 @@ export declare const builtinTools: {
|
|
|
37
37
|
};
|
|
38
38
|
execute(args: {
|
|
39
39
|
pattern: string;
|
|
40
|
-
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "
|
|
40
|
+
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "json" | "html" | "css" | "bash" | "haskell" | "kotlin" | "nix" | "scala" | "solidity" | "tsx";
|
|
41
41
|
paths?: string[] | undefined;
|
|
42
42
|
globs?: string[] | undefined;
|
|
43
43
|
context?: number | undefined;
|
|
@@ -64,11 +64,11 @@ export declare const builtinTools: {
|
|
|
64
64
|
swift: "swift";
|
|
65
65
|
elixir: "elixir";
|
|
66
66
|
yaml: "yaml";
|
|
67
|
-
|
|
67
|
+
json: "json";
|
|
68
|
+
html: "html";
|
|
68
69
|
css: "css";
|
|
70
|
+
bash: "bash";
|
|
69
71
|
haskell: "haskell";
|
|
70
|
-
html: "html";
|
|
71
|
-
json: "json";
|
|
72
72
|
kotlin: "kotlin";
|
|
73
73
|
nix: "nix";
|
|
74
74
|
scala: "scala";
|
|
@@ -82,7 +82,7 @@ export declare const builtinTools: {
|
|
|
82
82
|
execute(args: {
|
|
83
83
|
pattern: string;
|
|
84
84
|
rewrite: string;
|
|
85
|
-
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "
|
|
85
|
+
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "json" | "html" | "css" | "bash" | "haskell" | "kotlin" | "nix" | "scala" | "solidity" | "tsx";
|
|
86
86
|
paths?: string[] | undefined;
|
|
87
87
|
globs?: string[] | undefined;
|
|
88
88
|
dryRun?: boolean | undefined;
|
|
@@ -18,11 +18,11 @@ export declare const ast_grep_search: {
|
|
|
18
18
|
swift: "swift";
|
|
19
19
|
elixir: "elixir";
|
|
20
20
|
yaml: "yaml";
|
|
21
|
-
|
|
21
|
+
json: "json";
|
|
22
|
+
html: "html";
|
|
22
23
|
css: "css";
|
|
24
|
+
bash: "bash";
|
|
23
25
|
haskell: "haskell";
|
|
24
|
-
html: "html";
|
|
25
|
-
json: "json";
|
|
26
26
|
kotlin: "kotlin";
|
|
27
27
|
nix: "nix";
|
|
28
28
|
scala: "scala";
|
|
@@ -35,7 +35,7 @@ export declare const ast_grep_search: {
|
|
|
35
35
|
};
|
|
36
36
|
execute(args: {
|
|
37
37
|
pattern: string;
|
|
38
|
-
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "
|
|
38
|
+
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "json" | "html" | "css" | "bash" | "haskell" | "kotlin" | "nix" | "scala" | "solidity" | "tsx";
|
|
39
39
|
paths?: string[] | undefined;
|
|
40
40
|
globs?: string[] | undefined;
|
|
41
41
|
context?: number | undefined;
|
|
@@ -62,11 +62,11 @@ export declare const ast_grep_replace: {
|
|
|
62
62
|
swift: "swift";
|
|
63
63
|
elixir: "elixir";
|
|
64
64
|
yaml: "yaml";
|
|
65
|
-
|
|
65
|
+
json: "json";
|
|
66
|
+
html: "html";
|
|
66
67
|
css: "css";
|
|
68
|
+
bash: "bash";
|
|
67
69
|
haskell: "haskell";
|
|
68
|
-
html: "html";
|
|
69
|
-
json: "json";
|
|
70
70
|
kotlin: "kotlin";
|
|
71
71
|
nix: "nix";
|
|
72
72
|
scala: "scala";
|
|
@@ -80,7 +80,7 @@ export declare const ast_grep_replace: {
|
|
|
80
80
|
execute(args: {
|
|
81
81
|
pattern: string;
|
|
82
82
|
rewrite: string;
|
|
83
|
-
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "
|
|
83
|
+
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "json" | "html" | "css" | "bash" | "haskell" | "kotlin" | "nix" | "scala" | "solidity" | "tsx";
|
|
84
84
|
paths?: string[] | undefined;
|
|
85
85
|
globs?: string[] | undefined;
|
|
86
86
|
dryRun?: boolean | undefined;
|
|
@@ -98,8 +98,8 @@ export declare const ast_grep_analyze: {
|
|
|
98
98
|
lang: import("zod").ZodEnum<{
|
|
99
99
|
typescript: "typescript";
|
|
100
100
|
javascript: "javascript";
|
|
101
|
-
css: "css";
|
|
102
101
|
html: "html";
|
|
102
|
+
css: "css";
|
|
103
103
|
tsx: "tsx";
|
|
104
104
|
}>;
|
|
105
105
|
pattern: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -107,7 +107,7 @@ export declare const ast_grep_analyze: {
|
|
|
107
107
|
};
|
|
108
108
|
execute(args: {
|
|
109
109
|
code: string;
|
|
110
|
-
lang: "typescript" | "javascript" | "
|
|
110
|
+
lang: "typescript" | "javascript" | "html" | "css" | "tsx";
|
|
111
111
|
pattern?: string | undefined;
|
|
112
112
|
extractMetaVars?: boolean | undefined;
|
|
113
113
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
@@ -119,8 +119,8 @@ export declare const ast_grep_transform: {
|
|
|
119
119
|
lang: import("zod").ZodEnum<{
|
|
120
120
|
typescript: "typescript";
|
|
121
121
|
javascript: "javascript";
|
|
122
|
-
css: "css";
|
|
123
122
|
html: "html";
|
|
123
|
+
css: "css";
|
|
124
124
|
tsx: "tsx";
|
|
125
125
|
}>;
|
|
126
126
|
pattern: import("zod").ZodString;
|
|
@@ -128,7 +128,7 @@ export declare const ast_grep_transform: {
|
|
|
128
128
|
};
|
|
129
129
|
execute(args: {
|
|
130
130
|
code: string;
|
|
131
|
-
lang: "typescript" | "javascript" | "
|
|
131
|
+
lang: "typescript" | "javascript" | "html" | "css" | "tsx";
|
|
132
132
|
pattern: string;
|
|
133
133
|
rewrite: string;
|
|
134
134
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { resolveGrepCli, type GrepBackend } from "../grep/constants";
|
|
2
|
+
export declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
3
|
+
export declare const DEFAULT_LIMIT = 100;
|
|
4
|
+
export declare const DEFAULT_MAX_DEPTH = 20;
|
|
5
|
+
export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
|
|
6
|
+
export declare const RG_FILES_FLAGS: readonly ["--files", "--color=never", "--glob=!.git/*"];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const glob: {
|
|
2
|
+
description: string;
|
|
3
|
+
args: {
|
|
4
|
+
pattern: import("zod").ZodString;
|
|
5
|
+
path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
};
|
|
7
|
+
execute(args: {
|
|
8
|
+
pattern: string;
|
|
9
|
+
path?: string | undefined;
|
|
10
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface FileMatch {
|
|
2
|
+
path: string;
|
|
3
|
+
mtime: number;
|
|
4
|
+
}
|
|
5
|
+
export interface GlobResult {
|
|
6
|
+
files: FileMatch[];
|
|
7
|
+
totalFiles: number;
|
|
8
|
+
truncated: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface GlobOptions {
|
|
12
|
+
pattern: string;
|
|
13
|
+
paths?: string[];
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
noIgnore?: boolean;
|
|
16
|
+
maxDepth?: number;
|
|
17
|
+
timeout?: number;
|
|
18
|
+
limit?: number;
|
|
19
|
+
}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -171,11 +171,11 @@ export declare const builtinTools: {
|
|
|
171
171
|
swift: "swift";
|
|
172
172
|
elixir: "elixir";
|
|
173
173
|
yaml: "yaml";
|
|
174
|
-
|
|
174
|
+
json: "json";
|
|
175
|
+
html: "html";
|
|
175
176
|
css: "css";
|
|
177
|
+
bash: "bash";
|
|
176
178
|
haskell: "haskell";
|
|
177
|
-
html: "html";
|
|
178
|
-
json: "json";
|
|
179
179
|
kotlin: "kotlin";
|
|
180
180
|
nix: "nix";
|
|
181
181
|
scala: "scala";
|
|
@@ -188,7 +188,7 @@ export declare const builtinTools: {
|
|
|
188
188
|
};
|
|
189
189
|
execute(args: {
|
|
190
190
|
pattern: string;
|
|
191
|
-
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "
|
|
191
|
+
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "json" | "html" | "css" | "bash" | "haskell" | "kotlin" | "nix" | "scala" | "solidity" | "tsx";
|
|
192
192
|
paths?: string[] | undefined;
|
|
193
193
|
globs?: string[] | undefined;
|
|
194
194
|
context?: number | undefined;
|
|
@@ -215,11 +215,11 @@ export declare const builtinTools: {
|
|
|
215
215
|
swift: "swift";
|
|
216
216
|
elixir: "elixir";
|
|
217
217
|
yaml: "yaml";
|
|
218
|
-
|
|
218
|
+
json: "json";
|
|
219
|
+
html: "html";
|
|
219
220
|
css: "css";
|
|
221
|
+
bash: "bash";
|
|
220
222
|
haskell: "haskell";
|
|
221
|
-
html: "html";
|
|
222
|
-
json: "json";
|
|
223
223
|
kotlin: "kotlin";
|
|
224
224
|
nix: "nix";
|
|
225
225
|
scala: "scala";
|
|
@@ -233,13 +233,13 @@ export declare const builtinTools: {
|
|
|
233
233
|
execute(args: {
|
|
234
234
|
pattern: string;
|
|
235
235
|
rewrite: string;
|
|
236
|
-
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "
|
|
236
|
+
lang: "typescript" | "csharp" | "rust" | "php" | "python" | "javascript" | "go" | "c" | "cpp" | "java" | "ruby" | "lua" | "swift" | "elixir" | "yaml" | "json" | "html" | "css" | "bash" | "haskell" | "kotlin" | "nix" | "scala" | "solidity" | "tsx";
|
|
237
237
|
paths?: string[] | undefined;
|
|
238
238
|
globs?: string[] | undefined;
|
|
239
239
|
dryRun?: boolean | undefined;
|
|
240
240
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
241
241
|
};
|
|
242
|
-
|
|
242
|
+
grep: {
|
|
243
243
|
description: string;
|
|
244
244
|
args: {
|
|
245
245
|
pattern: import("zod").ZodString;
|
|
@@ -252,4 +252,15 @@ export declare const builtinTools: {
|
|
|
252
252
|
path?: string | undefined;
|
|
253
253
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
254
254
|
};
|
|
255
|
+
glob: {
|
|
256
|
+
description: string;
|
|
257
|
+
args: {
|
|
258
|
+
pattern: import("zod").ZodString;
|
|
259
|
+
path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
260
|
+
};
|
|
261
|
+
execute(args: {
|
|
262
|
+
pattern: string;
|
|
263
|
+
path?: string | undefined;
|
|
264
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
265
|
+
};
|
|
255
266
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ResolvedServer } from "./config";
|
|
2
|
+
import type { Diagnostic } from "./types";
|
|
2
3
|
declare class LSPServerManager {
|
|
3
4
|
private static instance;
|
|
4
5
|
private clients;
|
|
@@ -26,6 +27,7 @@ export declare class LSPClient {
|
|
|
26
27
|
private openedFiles;
|
|
27
28
|
private stderrBuffer;
|
|
28
29
|
private processExited;
|
|
30
|
+
private diagnosticsStore;
|
|
29
31
|
constructor(root: string, server: ResolvedServer);
|
|
30
32
|
start(): Promise<void>;
|
|
31
33
|
private startReading;
|
|
@@ -44,7 +46,9 @@ export declare class LSPClient {
|
|
|
44
46
|
references(filePath: string, line: number, character: number, includeDeclaration?: boolean): Promise<unknown>;
|
|
45
47
|
documentSymbols(filePath: string): Promise<unknown>;
|
|
46
48
|
workspaceSymbols(query: string): Promise<unknown>;
|
|
47
|
-
diagnostics(filePath: string): Promise<
|
|
49
|
+
diagnostics(filePath: string): Promise<{
|
|
50
|
+
items: Diagnostic[];
|
|
51
|
+
}>;
|
|
48
52
|
prepareRename(filePath: string, line: number, character: number): Promise<unknown>;
|
|
49
53
|
rename(filePath: string, line: number, character: number, newName: string): Promise<unknown>;
|
|
50
54
|
codeAction(filePath: string, startLine: number, startChar: number, endLine: number, endChar: number, only?: string[]): Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
export declare function createGrepBlocker(_ctx: PluginInput): {
|
|
3
|
-
"tool.execute.before": (input: {
|
|
4
|
-
tool: string;
|
|
5
|
-
sessionID: string;
|
|
6
|
-
callID: string;
|
|
7
|
-
}, _output: {
|
|
8
|
-
args: unknown;
|
|
9
|
-
}) => Promise<void>;
|
|
10
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Recovery - Message State Error Recovery
|
|
3
|
-
*
|
|
4
|
-
* Handles FOUR specific scenarios:
|
|
5
|
-
* 1. tool_use block exists without tool_result
|
|
6
|
-
* - Recovery: inject tool_result with "cancelled" content
|
|
7
|
-
*
|
|
8
|
-
* 2. Thinking block order violation (first block must be thinking)
|
|
9
|
-
* - Recovery: prepend empty thinking block
|
|
10
|
-
*
|
|
11
|
-
* 3. Thinking disabled but message contains thinking blocks
|
|
12
|
-
* - Recovery: strip thinking/redacted_thinking blocks
|
|
13
|
-
*
|
|
14
|
-
* 4. Empty content message (non-empty content required)
|
|
15
|
-
* - Recovery: inject text part directly via filesystem
|
|
16
|
-
*/
|
|
17
|
-
import type { PluginInput } from "@opencode-ai/plugin";
|
|
18
|
-
interface MessageInfo {
|
|
19
|
-
id?: string;
|
|
20
|
-
role?: string;
|
|
21
|
-
sessionID?: string;
|
|
22
|
-
parentID?: string;
|
|
23
|
-
error?: unknown;
|
|
24
|
-
}
|
|
25
|
-
export declare function createSessionRecoveryHook(ctx: PluginInput): {
|
|
26
|
-
handleSessionRecovery: (info: MessageInfo) => Promise<boolean>;
|
|
27
|
-
isRecoverableError: (error: unknown) => boolean;
|
|
28
|
-
setOnAbortCallback: (callback: (sessionID: string) => void) => void;
|
|
29
|
-
};
|
|
30
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|