oh-my-opencode 2.4.0 → 2.4.1
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.ja.md +16 -3
- package/README.ko.md +17 -4
- package/README.md +15 -4
- package/README.zh-cn.md +15 -2
- package/dist/agents/oracle.d.ts +1 -0
- package/dist/agents/sisyphus.d.ts +1 -0
- package/dist/agents/types.d.ts +2 -0
- package/dist/agents/utils.test.d.ts +1 -0
- package/dist/config/schema.d.ts +25 -23
- package/dist/hooks/anthropic-auto-compact/types.d.ts +1 -0
- package/dist/hooks/compaction-context-injector/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/preemptive-compaction/constants.d.ts +3 -0
- package/dist/hooks/preemptive-compaction/index.d.ts +24 -0
- package/dist/hooks/preemptive-compaction/types.d.ts +17 -0
- package/dist/index.js +806 -336
- package/dist/shared/config-path.d.ts +4 -1
- package/dist/tools/ast-grep/index.d.ts +22 -22
- package/dist/tools/ast-grep/tools.d.ts +22 -22
- package/dist/tools/index.d.ts +22 -22
- package/package.json +1 -1
- package/dist/agents/build.d.ts +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns the user-level config directory based on the OS.
|
|
3
3
|
* - Linux/macOS: XDG_CONFIG_HOME or ~/.config
|
|
4
|
-
* - Windows: %APPDATA%
|
|
4
|
+
* - Windows: Checks ~/.config first (cross-platform), then %APPDATA% (fallback)
|
|
5
|
+
*
|
|
6
|
+
* On Windows, prioritizes ~/.config for cross-platform consistency.
|
|
7
|
+
* Falls back to %APPDATA% for backward compatibility with existing installations.
|
|
5
8
|
*/
|
|
6
9
|
export declare function getUserConfigDir(): string;
|
|
7
10
|
/**
|
|
@@ -10,24 +10,24 @@ export declare const builtinTools: {
|
|
|
10
10
|
csharp: "csharp";
|
|
11
11
|
rust: "rust";
|
|
12
12
|
php: "php";
|
|
13
|
-
python: "python";
|
|
14
|
-
javascript: "javascript";
|
|
15
|
-
go: "go";
|
|
16
13
|
c: "c";
|
|
17
14
|
cpp: "cpp";
|
|
15
|
+
css: "css";
|
|
16
|
+
elixir: "elixir";
|
|
17
|
+
go: "go";
|
|
18
|
+
haskell: "haskell";
|
|
19
|
+
html: "html";
|
|
18
20
|
java: "java";
|
|
19
|
-
|
|
21
|
+
javascript: "javascript";
|
|
22
|
+
json: "json";
|
|
20
23
|
lua: "lua";
|
|
24
|
+
python: "python";
|
|
25
|
+
ruby: "ruby";
|
|
26
|
+
scala: "scala";
|
|
21
27
|
swift: "swift";
|
|
22
|
-
elixir: "elixir";
|
|
23
28
|
yaml: "yaml";
|
|
24
|
-
json: "json";
|
|
25
|
-
html: "html";
|
|
26
|
-
css: "css";
|
|
27
|
-
haskell: "haskell";
|
|
28
29
|
kotlin: "kotlin";
|
|
29
30
|
nix: "nix";
|
|
30
|
-
scala: "scala";
|
|
31
31
|
solidity: "solidity";
|
|
32
32
|
tsx: "tsx";
|
|
33
33
|
}>;
|
|
@@ -37,7 +37,7 @@ export declare const builtinTools: {
|
|
|
37
37
|
};
|
|
38
38
|
execute(args: {
|
|
39
39
|
pattern: string;
|
|
40
|
-
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "
|
|
40
|
+
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "c" | "cpp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "lua" | "python" | "ruby" | "scala" | "swift" | "yaml" | "kotlin" | "nix" | "solidity" | "tsx";
|
|
41
41
|
paths?: string[] | undefined;
|
|
42
42
|
globs?: string[] | undefined;
|
|
43
43
|
context?: number | undefined;
|
|
@@ -54,24 +54,24 @@ export declare const builtinTools: {
|
|
|
54
54
|
csharp: "csharp";
|
|
55
55
|
rust: "rust";
|
|
56
56
|
php: "php";
|
|
57
|
-
python: "python";
|
|
58
|
-
javascript: "javascript";
|
|
59
|
-
go: "go";
|
|
60
57
|
c: "c";
|
|
61
58
|
cpp: "cpp";
|
|
59
|
+
css: "css";
|
|
60
|
+
elixir: "elixir";
|
|
61
|
+
go: "go";
|
|
62
|
+
haskell: "haskell";
|
|
63
|
+
html: "html";
|
|
62
64
|
java: "java";
|
|
63
|
-
|
|
65
|
+
javascript: "javascript";
|
|
66
|
+
json: "json";
|
|
64
67
|
lua: "lua";
|
|
68
|
+
python: "python";
|
|
69
|
+
ruby: "ruby";
|
|
70
|
+
scala: "scala";
|
|
65
71
|
swift: "swift";
|
|
66
|
-
elixir: "elixir";
|
|
67
72
|
yaml: "yaml";
|
|
68
|
-
json: "json";
|
|
69
|
-
html: "html";
|
|
70
|
-
css: "css";
|
|
71
|
-
haskell: "haskell";
|
|
72
73
|
kotlin: "kotlin";
|
|
73
74
|
nix: "nix";
|
|
74
|
-
scala: "scala";
|
|
75
75
|
solidity: "solidity";
|
|
76
76
|
tsx: "tsx";
|
|
77
77
|
}>;
|
|
@@ -82,7 +82,7 @@ export declare const builtinTools: {
|
|
|
82
82
|
execute(args: {
|
|
83
83
|
pattern: string;
|
|
84
84
|
rewrite: string;
|
|
85
|
-
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "
|
|
85
|
+
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "c" | "cpp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "lua" | "python" | "ruby" | "scala" | "swift" | "yaml" | "kotlin" | "nix" | "solidity" | "tsx";
|
|
86
86
|
paths?: string[] | undefined;
|
|
87
87
|
globs?: string[] | undefined;
|
|
88
88
|
dryRun?: boolean | undefined;
|
|
@@ -8,24 +8,24 @@ export declare const ast_grep_search: {
|
|
|
8
8
|
csharp: "csharp";
|
|
9
9
|
rust: "rust";
|
|
10
10
|
php: "php";
|
|
11
|
-
python: "python";
|
|
12
|
-
javascript: "javascript";
|
|
13
|
-
go: "go";
|
|
14
11
|
c: "c";
|
|
15
12
|
cpp: "cpp";
|
|
13
|
+
css: "css";
|
|
14
|
+
elixir: "elixir";
|
|
15
|
+
go: "go";
|
|
16
|
+
haskell: "haskell";
|
|
17
|
+
html: "html";
|
|
16
18
|
java: "java";
|
|
17
|
-
|
|
19
|
+
javascript: "javascript";
|
|
20
|
+
json: "json";
|
|
18
21
|
lua: "lua";
|
|
22
|
+
python: "python";
|
|
23
|
+
ruby: "ruby";
|
|
24
|
+
scala: "scala";
|
|
19
25
|
swift: "swift";
|
|
20
|
-
elixir: "elixir";
|
|
21
26
|
yaml: "yaml";
|
|
22
|
-
json: "json";
|
|
23
|
-
html: "html";
|
|
24
|
-
css: "css";
|
|
25
|
-
haskell: "haskell";
|
|
26
27
|
kotlin: "kotlin";
|
|
27
28
|
nix: "nix";
|
|
28
|
-
scala: "scala";
|
|
29
29
|
solidity: "solidity";
|
|
30
30
|
tsx: "tsx";
|
|
31
31
|
}>;
|
|
@@ -35,7 +35,7 @@ export declare const ast_grep_search: {
|
|
|
35
35
|
};
|
|
36
36
|
execute(args: {
|
|
37
37
|
pattern: string;
|
|
38
|
-
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "
|
|
38
|
+
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "c" | "cpp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "lua" | "python" | "ruby" | "scala" | "swift" | "yaml" | "kotlin" | "nix" | "solidity" | "tsx";
|
|
39
39
|
paths?: string[] | undefined;
|
|
40
40
|
globs?: string[] | undefined;
|
|
41
41
|
context?: number | undefined;
|
|
@@ -52,24 +52,24 @@ export declare const ast_grep_replace: {
|
|
|
52
52
|
csharp: "csharp";
|
|
53
53
|
rust: "rust";
|
|
54
54
|
php: "php";
|
|
55
|
-
python: "python";
|
|
56
|
-
javascript: "javascript";
|
|
57
|
-
go: "go";
|
|
58
55
|
c: "c";
|
|
59
56
|
cpp: "cpp";
|
|
57
|
+
css: "css";
|
|
58
|
+
elixir: "elixir";
|
|
59
|
+
go: "go";
|
|
60
|
+
haskell: "haskell";
|
|
61
|
+
html: "html";
|
|
60
62
|
java: "java";
|
|
61
|
-
|
|
63
|
+
javascript: "javascript";
|
|
64
|
+
json: "json";
|
|
62
65
|
lua: "lua";
|
|
66
|
+
python: "python";
|
|
67
|
+
ruby: "ruby";
|
|
68
|
+
scala: "scala";
|
|
63
69
|
swift: "swift";
|
|
64
|
-
elixir: "elixir";
|
|
65
70
|
yaml: "yaml";
|
|
66
|
-
json: "json";
|
|
67
|
-
html: "html";
|
|
68
|
-
css: "css";
|
|
69
|
-
haskell: "haskell";
|
|
70
71
|
kotlin: "kotlin";
|
|
71
72
|
nix: "nix";
|
|
72
|
-
scala: "scala";
|
|
73
73
|
solidity: "solidity";
|
|
74
74
|
tsx: "tsx";
|
|
75
75
|
}>;
|
|
@@ -80,7 +80,7 @@ export declare const ast_grep_replace: {
|
|
|
80
80
|
execute(args: {
|
|
81
81
|
pattern: string;
|
|
82
82
|
rewrite: string;
|
|
83
|
-
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "
|
|
83
|
+
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "c" | "cpp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "lua" | "python" | "ruby" | "scala" | "swift" | "yaml" | "kotlin" | "nix" | "solidity" | "tsx";
|
|
84
84
|
paths?: string[] | undefined;
|
|
85
85
|
globs?: string[] | undefined;
|
|
86
86
|
dryRun?: boolean | undefined;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -207,24 +207,24 @@ export declare const builtinTools: {
|
|
|
207
207
|
csharp: "csharp";
|
|
208
208
|
rust: "rust";
|
|
209
209
|
php: "php";
|
|
210
|
-
python: "python";
|
|
211
|
-
javascript: "javascript";
|
|
212
|
-
go: "go";
|
|
213
210
|
c: "c";
|
|
214
211
|
cpp: "cpp";
|
|
212
|
+
css: "css";
|
|
213
|
+
elixir: "elixir";
|
|
214
|
+
go: "go";
|
|
215
|
+
haskell: "haskell";
|
|
216
|
+
html: "html";
|
|
215
217
|
java: "java";
|
|
216
|
-
|
|
218
|
+
javascript: "javascript";
|
|
219
|
+
json: "json";
|
|
217
220
|
lua: "lua";
|
|
221
|
+
python: "python";
|
|
222
|
+
ruby: "ruby";
|
|
223
|
+
scala: "scala";
|
|
218
224
|
swift: "swift";
|
|
219
|
-
elixir: "elixir";
|
|
220
225
|
yaml: "yaml";
|
|
221
|
-
json: "json";
|
|
222
|
-
html: "html";
|
|
223
|
-
css: "css";
|
|
224
|
-
haskell: "haskell";
|
|
225
226
|
kotlin: "kotlin";
|
|
226
227
|
nix: "nix";
|
|
227
|
-
scala: "scala";
|
|
228
228
|
solidity: "solidity";
|
|
229
229
|
tsx: "tsx";
|
|
230
230
|
}>;
|
|
@@ -234,7 +234,7 @@ export declare const builtinTools: {
|
|
|
234
234
|
};
|
|
235
235
|
execute(args: {
|
|
236
236
|
pattern: string;
|
|
237
|
-
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "
|
|
237
|
+
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "c" | "cpp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "lua" | "python" | "ruby" | "scala" | "swift" | "yaml" | "kotlin" | "nix" | "solidity" | "tsx";
|
|
238
238
|
paths?: string[] | undefined;
|
|
239
239
|
globs?: string[] | undefined;
|
|
240
240
|
context?: number | undefined;
|
|
@@ -251,24 +251,24 @@ export declare const builtinTools: {
|
|
|
251
251
|
csharp: "csharp";
|
|
252
252
|
rust: "rust";
|
|
253
253
|
php: "php";
|
|
254
|
-
python: "python";
|
|
255
|
-
javascript: "javascript";
|
|
256
|
-
go: "go";
|
|
257
254
|
c: "c";
|
|
258
255
|
cpp: "cpp";
|
|
256
|
+
css: "css";
|
|
257
|
+
elixir: "elixir";
|
|
258
|
+
go: "go";
|
|
259
|
+
haskell: "haskell";
|
|
260
|
+
html: "html";
|
|
259
261
|
java: "java";
|
|
260
|
-
|
|
262
|
+
javascript: "javascript";
|
|
263
|
+
json: "json";
|
|
261
264
|
lua: "lua";
|
|
265
|
+
python: "python";
|
|
266
|
+
ruby: "ruby";
|
|
267
|
+
scala: "scala";
|
|
262
268
|
swift: "swift";
|
|
263
|
-
elixir: "elixir";
|
|
264
269
|
yaml: "yaml";
|
|
265
|
-
json: "json";
|
|
266
|
-
html: "html";
|
|
267
|
-
css: "css";
|
|
268
|
-
haskell: "haskell";
|
|
269
270
|
kotlin: "kotlin";
|
|
270
271
|
nix: "nix";
|
|
271
|
-
scala: "scala";
|
|
272
272
|
solidity: "solidity";
|
|
273
273
|
tsx: "tsx";
|
|
274
274
|
}>;
|
|
@@ -279,7 +279,7 @@ export declare const builtinTools: {
|
|
|
279
279
|
execute(args: {
|
|
280
280
|
pattern: string;
|
|
281
281
|
rewrite: string;
|
|
282
|
-
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "
|
|
282
|
+
lang: "bash" | "typescript" | "csharp" | "rust" | "php" | "c" | "cpp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "lua" | "python" | "ruby" | "scala" | "swift" | "yaml" | "kotlin" | "nix" | "solidity" | "tsx";
|
|
283
283
|
paths?: string[] | undefined;
|
|
284
284
|
globs?: string[] | undefined;
|
|
285
285
|
dryRun?: boolean | undefined;
|
package/package.json
CHANGED
package/dist/agents/build.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const BUILD_AGENT_PROMPT_EXTENSION = "\n# Agent Orchestration & Task Management\n\nYou are not just a coder - you are an **ORCHESTRATOR**. Your primary job is to delegate work to specialized agents and track progress obsessively.\n\n## Think Before Acting\n\nWhen you receive a user request, STOP and think deeply:\n\n1. **What specialized agents can handle this better than me?**\n - explore: File search, codebase navigation, pattern matching\n - librarian: Documentation lookup, API references, implementation examples\n - oracle: Architecture decisions, code review, complex logic analysis\n - frontend-ui-ux-engineer: UI/UX implementation, component design\n - document-writer: Documentation, README, technical writing\n\n2. **Can I parallelize this work?**\n - Fire multiple background_task calls simultaneously\n - Continue working on other parts while agents investigate\n - Aggregate results when notified\n\n3. **Have I planned this in my TODO list?**\n - Break down the task into atomic steps FIRST\n - Track every investigation, every delegation\n\n## PARALLEL TOOL CALLS - MANDATORY\n\n**ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.** This is non-negotiable.\n\nThis parallel approach allows you to:\n- Gather comprehensive context faster\n- Cross-reference information simultaneously\n- Reduce total execution time dramatically\n- Maintain high accuracy through concurrent validation\n- Complete multi-file modifications in a single turn\n\n**ALWAYS prefer parallel tool calls over sequential ones when the operations are independent.**\n\n## TODO Tool Obsession\n\n**USE TODO TOOLS AGGRESSIVELY.** This is non-negotiable.\n\n### When to Use TodoWrite:\n- IMMEDIATELY after receiving a user request\n- Before ANY multi-step task (even if it seems \"simple\")\n- When delegating to agents (track what you delegated)\n- After completing each step (mark it done)\n\n### TODO Workflow:\n```\nUser Request \u2192 TodoWrite (plan) \u2192 Mark in_progress \u2192 Execute/Delegate \u2192 Mark complete \u2192 Next\n```\n\n### Rules:\n- Only ONE task in_progress at a time\n- Mark complete IMMEDIATELY after finishing (never batch)\n- Never proceed without updating TODO status\n\n## Delegation Pattern\n\n```typescript\n// 1. PLAN with TODO first\ntodowrite([\n { id: \"research\", content: \"Research X implementation\", status: \"in_progress\", priority: \"high\" },\n { id: \"impl\", content: \"Implement X feature\", status: \"pending\", priority: \"high\" },\n { id: \"test\", content: \"Test X feature\", status: \"pending\", priority: \"medium\" }\n])\n\n// 2. DELEGATE research in parallel - FIRE MULTIPLE AT ONCE\nbackground_task(agent=\"explore\", prompt=\"Find all files related to X\")\nbackground_task(agent=\"librarian\", prompt=\"Look up X documentation\")\n\n// 3. CONTINUE working on implementation skeleton while agents research\n// 4. When notified, INTEGRATE findings and mark TODO complete\n```\n\n## Subagent Prompt Structure - MANDATORY 7 SECTIONS\n\nWhen invoking Task() or background_task() with any subagent, ALWAYS structure your prompt with these 7 sections to prevent AI slop:\n\n1. **TASK**: What exactly needs to be done (be obsessively specific)\n2. **EXPECTED OUTCOME**: Concrete deliverables when complete (files, behaviors, states)\n3. **REQUIRED SKILLS**: Which skills the agent MUST invoke\n4. **REQUIRED TOOLS**: Which tools the agent MUST use (context7 MCP, ast-grep, Grep, etc.)\n5. **MUST DO**: Exhaustive list of requirements (leave NOTHING implicit)\n6. **MUST NOT DO**: Forbidden actions (anticipate every way agent could go rogue)\n7. **CONTEXT**: Additional info agent needs (file paths, patterns, dependencies)\n\nExample:\n```\nbackground_task(agent=\"explore\", prompt=\"\"\"\nTASK: Find all authentication-related files in the codebase\n\nEXPECTED OUTCOME:\n- List of all auth files with their purposes\n- Identified patterns for token handling\n\nREQUIRED TOOLS:\n- ast-grep: Find function definitions with `sg --pattern 'def $FUNC($$$):' --lang python`\n- Grep: Search for 'auth', 'token', 'jwt' patterns\n\nMUST DO:\n- Search in src/, lib/, and utils/ directories\n- Include test files for context\n\nMUST NOT DO:\n- Do NOT modify any files\n- Do NOT make assumptions about implementation\n\nCONTEXT:\n- Project uses Python/Django\n- Auth system is custom-built\n\"\"\")\n```\n\n**Vague prompts = agent goes rogue. Lock them down.**\n\n## Anti-Patterns (AVOID):\n- Doing everything yourself when agents can help\n- Skipping TODO planning for \"quick\" tasks\n- Forgetting to mark tasks complete\n- Sequential execution when parallel is possible\n- Direct tool calls without considering delegation\n- Vague subagent prompts without the 7 sections\n\n## Remember:\n- You are the **team lead**, not the grunt worker\n- Your context window is precious - delegate to preserve it\n- Agents have specialized expertise - USE THEM\n- TODO tracking gives users visibility into your progress\n- Parallel execution = faster results\n- **ALWAYS fire multiple independent operations simultaneously**\n";
|