evil-omo 3.11.7 → 3.12.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.
Files changed (29) hide show
  1. package/dist/cli/config-manager/bun-install.d.ts +2 -0
  2. package/dist/cli/index.js +302 -182
  3. package/dist/config/schema/background-task.d.ts +6 -0
  4. package/dist/config/schema/evil-omo-config.d.ts +6 -0
  5. package/dist/config/schema/hooks.d.ts +1 -0
  6. package/dist/create-hooks.d.ts +1 -0
  7. package/dist/evil-omo.schema.json +24 -0
  8. package/dist/features/background-agent/constants.d.ts +5 -1
  9. package/dist/features/background-agent/loop-detector.d.ts +16 -0
  10. package/dist/features/background-agent/manager.d.ts +1 -0
  11. package/dist/features/background-agent/session-status-classifier.d.ts +2 -0
  12. package/dist/features/background-agent/types.d.ts +7 -0
  13. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  14. package/dist/hooks/index.d.ts +1 -0
  15. package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +1 -0
  16. package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +1 -1
  17. package/dist/hooks/todo-description-override/description.d.ts +1 -0
  18. package/dist/hooks/todo-description-override/hook.d.ts +8 -0
  19. package/dist/hooks/todo-description-override/index.d.ts +1 -0
  20. package/dist/index.js +988 -509
  21. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  22. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  23. package/dist/shared/connected-providers-cache.d.ts +26 -29
  24. package/dist/shared/plugin-identity.d.ts +2 -1
  25. package/dist/shared/shell-env.d.ts +27 -0
  26. package/dist/tools/delegate-task/model-selection.d.ts +2 -0
  27. package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
  28. package/dist/tools/look-at/constants.d.ts +1 -1
  29. package/package.json +12 -12
@@ -23,6 +23,7 @@ export declare function createCoreHooks(args: {
23
23
  hashlineReadEnhancer: ReturnType<typeof import("../../hooks").createHashlineReadEnhancerHook> | null;
24
24
  jsonErrorRecovery: ReturnType<typeof import("../../hooks").createJsonErrorRecoveryHook> | null;
25
25
  readImageResizer: ReturnType<typeof import("../../hooks").createReadImageResizerHook> | null;
26
+ todoDescriptionOverride: ReturnType<typeof import("../../hooks").createTodoDescriptionOverrideHook> | null;
26
27
  contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
27
28
  preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
28
29
  sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
@@ -1,7 +1,7 @@
1
1
  import type { HookName, OhMyOpenCodeConfig } from "../../config";
2
2
  import type { ModelCacheState } from "../../plugin-state";
3
3
  import type { PluginContext } from "../types";
4
- import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook, createReadImageResizerHook, createJsonErrorRecoveryHook } from "../../hooks";
4
+ import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook, createReadImageResizerHook, createJsonErrorRecoveryHook, createTodoDescriptionOverrideHook } from "../../hooks";
5
5
  export type ToolGuardHooks = {
6
6
  commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
7
7
  toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
@@ -14,6 +14,7 @@ export type ToolGuardHooks = {
14
14
  hashlineReadEnhancer: ReturnType<typeof createHashlineReadEnhancerHook> | null;
15
15
  jsonErrorRecovery: ReturnType<typeof createJsonErrorRecoveryHook> | null;
16
16
  readImageResizer: ReturnType<typeof createReadImageResizerHook> | null;
17
+ todoDescriptionOverride: ReturnType<typeof createTodoDescriptionOverrideHook> | null;
17
18
  };
18
19
  export declare function createToolGuardHooks(args: {
19
20
  ctx: PluginContext;
@@ -10,36 +10,33 @@ interface ProviderModelsCache {
10
10
  connected: string[];
11
11
  updatedAt: string;
12
12
  }
13
- /**
14
- * Read the connected providers cache.
15
- * Returns the list of connected provider IDs, or null if cache doesn't exist.
16
- */
17
- export declare function readConnectedProvidersCache(): string[] | null;
18
- /**
19
- * Check if connected providers cache exists.
20
- */
21
- export declare function hasConnectedProvidersCache(): boolean;
22
- /**
23
- * Read the provider-models cache.
24
- * Returns the cache data, or null if cache doesn't exist.
25
- */
26
- export declare function readProviderModelsCache(): ProviderModelsCache | null;
27
- /**
28
- * Check if provider-models cache exists.
29
- */
30
- export declare function hasProviderModelsCache(): boolean;
31
- /**
32
- * Write the provider-models cache.
33
- */
34
- export declare function writeProviderModelsCache(data: {
13
+ export declare function createConnectedProvidersCacheStore(getCacheDir?: () => string): {
14
+ readConnectedProvidersCache: () => string[] | null;
15
+ hasConnectedProvidersCache: () => boolean;
16
+ readProviderModelsCache: () => ProviderModelsCache | null;
17
+ hasProviderModelsCache: () => boolean;
18
+ writeProviderModelsCache: (data: {
19
+ models: Record<string, string[]>;
20
+ connected: string[];
21
+ }) => void;
22
+ updateConnectedProvidersCache: (client: {
23
+ provider?: {
24
+ list?: () => Promise<{
25
+ data?: {
26
+ connected?: string[];
27
+ all?: Array<{
28
+ id: string;
29
+ models?: Record<string, unknown>;
30
+ }>;
31
+ };
32
+ }>;
33
+ };
34
+ }) => Promise<void>;
35
+ };
36
+ export declare const readConnectedProvidersCache: () => string[] | null, hasConnectedProvidersCache: () => boolean, readProviderModelsCache: () => ProviderModelsCache | null, hasProviderModelsCache: () => boolean, writeProviderModelsCache: (data: {
35
37
  models: Record<string, string[]>;
36
38
  connected: string[];
37
- }): void;
38
- /**
39
- * Update the connected providers cache by fetching from the client.
40
- * Also updates the provider-models cache with model lists per provider.
41
- */
42
- export declare function updateConnectedProvidersCache(client: {
39
+ }) => void, updateConnectedProvidersCache: (client: {
43
40
  provider?: {
44
41
  list?: () => Promise<{
45
42
  data?: {
@@ -51,5 +48,5 @@ export declare function updateConnectedProvidersCache(client: {
51
48
  };
52
49
  }>;
53
50
  };
54
- }): Promise<void>;
51
+ }) => Promise<void>;
55
52
  export {};
@@ -1,5 +1,6 @@
1
1
  export declare const PLUGIN_NAME = "evil-omo";
2
- export declare const ALL_PLUGIN_NAMES: readonly ["evil-omo"];
2
+ export declare const LEGACY_PLUGIN_NAME = "oh-my-opencode";
3
+ export declare const ALL_PLUGIN_NAMES: readonly ["evil-omo", "oh-my-opencode"];
3
4
  export declare const CONFIG_BASENAME = "evil-omo";
4
5
  export declare const ALL_CONFIG_BASENAMES: readonly ["evil-omo"];
5
6
  export declare const LOG_FILENAME = "evil-omo.log";
@@ -39,3 +39,30 @@ export declare function shellEscape(value: string, shellType: ShellType): string
39
39
  * ```
40
40
  */
41
41
  export declare function buildEnvPrefix(env: Record<string, string>, shellType: ShellType): string;
42
+ /**
43
+ * Escape a value for use in a double-quoted shell -c command argument.
44
+ *
45
+ * In shell -c "..." strings, these characters have special meaning and must be escaped:
46
+ * - $ - variable expansion, command substitution $(...)
47
+ * - ` - command substitution `...`
48
+ * - \\ - escape character
49
+ * - " - end quote
50
+ * - ; | & - command separators
51
+ * - # - comment
52
+ * - () - grouping operators
53
+ *
54
+ * @param value - The value to escape
55
+ * @returns Escaped value safe for double-quoted shell -c argument
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * // For malicious input
60
+ * const url = "http://localhost:3000'; cat /etc/passwd; echo '"
61
+ * const escaped = shellEscapeForDoubleQuotedCommand(url)
62
+ * // => "http://localhost:3000'\''; cat /etc/passwd; echo '"
63
+ *
64
+ * // Usage in command:
65
+ * const cmd = `/bin/sh -c "opencode attach ${escaped} --session ${sessionId}"`
66
+ * ```
67
+ */
68
+ export declare function shellEscapeForDoubleQuotedCommand(value: string): string;
@@ -9,4 +9,6 @@ export declare function resolveModelForDelegateTask(input: {
9
9
  }): {
10
10
  model: string;
11
11
  variant?: string;
12
+ } | {
13
+ skipped: true;
12
14
  } | undefined;
@@ -1 +1 @@
1
- export declare const HASHLINE_EDIT_DESCRIPTION = "Edit files using LINE#ID format for precise, safe modifications.\n\nWORKFLOW:\n1. Read target file/range and copy exact LINE#ID tags.\n2. Pick the smallest operation per logical mutation site.\n3. Submit one edit call per file with all related operations.\n4. If same file needs another call, re-read first.\n5. Use anchors as \"LINE#ID\" only (never include trailing \"|content\").\n\nVALIDATION:\n Payload shape: { \"filePath\": string, \"edits\": [...], \"delete\"?: boolean, \"rename\"?: string }\n Each edit must be one of: replace, append, prepend\n Edit shape: { \"op\": \"replace\"|\"append\"|\"prepend\", \"pos\"?: \"LINE#ID\", \"end\"?: \"LINE#ID\", \"lines\": string|string[]|null }\n lines must contain plain replacement text only (no LINE#ID prefixes, no diff + markers)\n CRITICAL: all operations validate against the same pre-edit file snapshot and apply bottom-up. Refs/tags are interpreted against the last-read version of the file.\n\nLINE#ID FORMAT (CRITICAL):\n Each line reference must be in \"{line_number}#{hash_id}\" format where:\n {line_number}: 1-based line number\n {hash_id}: Two CID letters from the set ZPMQVRWSNKTXJBYH\n\nFILE MODES:\n delete=true deletes file and requires edits=[] with no rename\n rename moves final content to a new path and removes old path\n\nCONTENT FORMAT:\n lines can be a string (single line) or string[] (multi-line, preferred).\n If you pass a multi-line string, it is split by real newline characters.\n Literal \"\\n\" is preserved as text.\n\nFILE CREATION:\n append without anchors adds content at EOF. If file does not exist, creates it.\n prepend without anchors adds content at BOF. If file does not exist, creates it.\n CRITICAL: only unanchored append/prepend can create a missing file.\n\nOPERATION CHOICE:\n replace with pos only -> replace one line at pos\n replace with pos+end -> replace ENTIRE range pos..end as a block (ranges MUST NOT overlap across edits)\n append with pos/end anchor -> insert after that anchor\n prepend with pos/end anchor -> insert before that anchor\n append/prepend without anchors -> EOF/BOF insertion\n\nRULES (CRITICAL):\n 1. Minimize scope: one logical mutation site per operation.\n 2. Preserve formatting: keep indentation, punctuation, line breaks, trailing commas, brace style.\n 3. Prefer insertion over neighbor rewrites: anchor to structural boundaries (}, ], },), not interior property lines.\n 4. No no-ops: replacement content must differ from current content.\n 5. Touch only requested code: avoid incidental edits.\n 6. Use exact current tokens: NEVER rewrite approximately.\n 7. For swaps/moves: prefer one range operation over multiple single-line operations.\n 8. Output tool calls only; no prose or commentary between them.\n\nTAG CHOICE (ALWAYS):\n - Copy tags exactly from read output or >>> mismatch output.\n - NEVER guess tags.\n - Anchor to structural lines (function/class/brace), NEVER blank lines.\n - Anti-pattern warning: blank/whitespace anchors are fragile.\n - Re-read after each successful edit call before issuing another on the same file.\n\nAUTOCORRECT (built-in - you do NOT need to handle these):\n Merged lines are auto-expanded back to original line count.\n Indentation is auto-restored from original lines.\n BOM and CRLF line endings are preserved automatically.\n Hashline prefixes and diff markers in text are auto-stripped.\n\nRECOVERY (when >>> mismatch error appears):\n Copy the updated LINE#ID tags shown in the error output directly.\n Re-read only if the needed tags are missing from the error snippet.\n ALWAYS batch all edits for one file in a single call.";
1
+ export declare const HASHLINE_EDIT_DESCRIPTION = "Edit files using LINE#ID format for precise, safe modifications.\n\nWORKFLOW:\n1. Read target file/range and copy exact LINE#ID tags.\n2. Pick the smallest operation per logical mutation site.\n3. Submit one edit call per file with all related operations.\n4. If same file needs another call, re-read first.\n5. Use anchors as \"LINE#ID\" only (never include trailing \"|content\").\n\n<must>\n- SNAPSHOT: All edits in one call reference the ORIGINAL file state. Do NOT adjust line numbers for prior edits in the same call \u2014 the system applies them bottom-up automatically.\n- replace removes lines pos..end (inclusive) and inserts lines in their place. Lines BEFORE pos and AFTER end are UNTOUCHED \u2014 do NOT include them in lines. If you do, they will appear twice.\n- lines must contain ONLY the content that belongs inside the consumed range. Content after end survives unchanged.\n- Tags MUST be copied exactly from read output or >>> mismatch output. NEVER guess tags.\n- Batch = multiple operations in edits[], NOT one big replace covering everything. Each operation targets the smallest possible change.\n- lines must contain plain replacement text only (no LINE#ID prefixes, no diff + markers).\n</must>\n\n<operations>\nLINE#ID FORMAT:\n Each line reference must be in \"{line_number}#{hash_id}\" format where:\n {line_number}: 1-based line number\n {hash_id}: Two CID letters from the set ZPMQVRWSNKTXJBYH\n\nOPERATION CHOICE:\n replace with pos only -> replace one line at pos\n replace with pos+end -> replace range pos..end inclusive as a block (ranges MUST NOT overlap across edits)\n append with pos/end anchor -> insert after that anchor\n prepend with pos/end anchor -> insert before that anchor\n append/prepend without anchors -> EOF/BOF insertion (also creates missing files)\n\nCONTENT FORMAT:\n lines can be a string (single line) or string[] (multi-line, preferred).\n If you pass a multi-line string, it is split by real newline characters.\n lines: null or lines: [] with replace -> delete those lines.\n\nFILE MODES:\n delete=true deletes file and requires edits=[] with no rename\n rename moves final content to a new path and removes old path\n\nRULES:\n 1. Minimize scope: one logical mutation site per operation.\n 2. Preserve formatting: keep indentation, punctuation, line breaks, trailing commas, brace style.\n 3. Prefer insertion over neighbor rewrites: anchor to structural boundaries (}, ], },), not interior property lines.\n 4. No no-ops: replacement content must differ from current content.\n 5. Touch only requested code: avoid incidental edits.\n 6. Use exact current tokens: NEVER rewrite approximately.\n 7. For swaps/moves: prefer one range operation over multiple single-line operations.\n 8. Anchor to structural lines (function/class/brace), NEVER blank lines.\n 9. Re-read after each successful edit call before issuing another on the same file.\n</operations>\n\n<examples>\nGiven this file content after read:\n 10#VK|function hello() {\n 11#XJ| console.log(\"hi\");\n 12#MB| console.log(\"bye\");\n 13#QR|}\n 14#TN|\n 15#WS|function world() {\n\nSingle-line replace (change line 11):\n { op: \"replace\", pos: \"11#XJ\", lines: [\" console.log(\\\"hello\\\");\"] }\n Result: line 11 replaced. Lines 10, 12-15 unchanged.\n\nRange replace (rewrite function body, lines 11-12):\n { op: \"replace\", pos: \"11#XJ\", end: \"12#MB\", lines: [\" return \\\"hello world\\\";\"] }\n Result: lines 11-12 removed, replaced by 1 new line. Lines 10, 13-15 unchanged.\n\nDelete a line:\n { op: \"replace\", pos: \"12#MB\", lines: null }\n Result: line 12 removed. Lines 10-11, 13-15 unchanged.\n\nInsert after line 13 (between functions):\n { op: \"append\", pos: \"13#QR\", lines: [\"\", \"function added() {\", \" return true;\", \"}\"] }\n Result: 4 new lines inserted after line 13. All existing lines unchanged.\n\nBAD \u2014 lines extend past end (DUPLICATES line 13):\n { op: \"replace\", pos: \"11#XJ\", end: \"12#MB\", lines: [\" return \\\"hi\\\";\", \"}\"] }\n Line 13 is \"}\" which already exists after end. Including \"}\" in lines duplicates it.\n CORRECT: { op: \"replace\", pos: \"11#XJ\", end: \"12#MB\", lines: [\" return \\\"hi\\\";\"] }\n</examples>\n\n<auto>\nBuilt-in autocorrect (you do NOT need to handle these):\n Merged lines are auto-expanded back to original line count.\n Indentation is auto-restored from original lines.\n BOM and CRLF line endings are preserved automatically.\n Hashline prefixes and diff markers in text are auto-stripped.\n Boundary echo lines (duplicating adjacent surviving lines) are auto-stripped.\n</auto>\n\nRECOVERY (when >>> mismatch error appears):\n Copy the updated LINE#ID tags shown in the error output directly.\n Re-read only if the needed tags are missing from the error snippet.";
@@ -1,2 +1,2 @@
1
1
  export declare const MULTIMODAL_LOOKER_AGENT: "multimodal-looker";
2
- export declare const LOOK_AT_DESCRIPTION = "Analyze media files (PDFs, images, diagrams) that require interpretation beyond raw text. Extracts specific information or summaries from documents, describes visual content. Use when you need analyzed/extracted data rather than literal file contents.";
2
+ export declare const LOOK_AT_DESCRIPTION = "Extract basic information from media files (PDFs, images, diagrams) when a quick summary suffices over precise reading. Good for simple text-based content extraction without using the Read tool. NEVER use for visual precision, aesthetic evaluation, or exact accuracy \u2014 use Read tool instead for those cases.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evil-omo",
3
- "version": "3.11.7",
3
+ "version": "3.12.2",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -76,17 +76,17 @@
76
76
  "typescript": "^5.7.3"
77
77
  },
78
78
  "optionalDependencies": {
79
- "evil-omo-darwin-arm64": "3.11.7",
80
- "evil-omo-darwin-x64": "3.11.7",
81
- "evil-omo-darwin-x64-baseline": "3.11.7",
82
- "evil-omo-linux-x64": "3.11.7",
83
- "evil-omo-linux-x64-baseline": "3.11.7",
84
- "evil-omo-linux-arm64": "3.11.7",
85
- "evil-omo-linux-x64-musl": "3.11.7",
86
- "evil-omo-linux-x64-musl-baseline": "3.11.7",
87
- "evil-omo-linux-arm64-musl": "3.11.7",
88
- "evil-omo-windows-x64": "3.11.7",
89
- "evil-omo-windows-x64-baseline": "3.11.7"
79
+ "evil-omo-darwin-arm64": "3.12.2",
80
+ "evil-omo-darwin-x64": "3.12.2",
81
+ "evil-omo-darwin-x64-baseline": "3.12.2",
82
+ "evil-omo-linux-x64": "3.12.2",
83
+ "evil-omo-linux-x64-baseline": "3.12.2",
84
+ "evil-omo-linux-arm64": "3.12.2",
85
+ "evil-omo-linux-x64-musl": "3.12.2",
86
+ "evil-omo-linux-x64-musl-baseline": "3.12.2",
87
+ "evil-omo-linux-arm64-musl": "3.12.2",
88
+ "evil-omo-windows-x64": "3.12.2",
89
+ "evil-omo-windows-x64-baseline": "3.12.2"
90
90
  },
91
91
  "overrides": {
92
92
  "@opencode-ai/sdk": "^1.2.24"