oh-my-opencode 3.6.0 → 3.7.0

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 (59) hide show
  1. package/README.ja.md +6 -6
  2. package/README.ko.md +6 -6
  3. package/README.md +6 -6
  4. package/README.zh-cn.md +6 -6
  5. package/dist/agents/sisyphus-junior/gpt.d.ts +4 -14
  6. package/dist/cli/index.js +357 -104
  7. package/dist/cli/run/event-handlers.d.ts +1 -0
  8. package/dist/cli/run/opencode-bin-path.d.ts +3 -0
  9. package/dist/cli/run/opencode-binary-resolver.d.ts +5 -0
  10. package/dist/cli/run/session-resolver.d.ts +1 -0
  11. package/dist/cli/run/types.d.ts +29 -0
  12. package/dist/config/schema/browser-automation.d.ts +2 -0
  13. package/dist/config/schema/experimental.d.ts +1 -0
  14. package/dist/config/schema/hooks.d.ts +1 -0
  15. package/dist/config/schema/oh-my-opencode-config.d.ts +3 -0
  16. package/dist/create-hooks.d.ts +3 -0
  17. package/dist/create-managers.d.ts +1 -0
  18. package/dist/features/background-agent/manager.d.ts +3 -0
  19. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  20. package/dist/features/builtin-skills/skills/playwright-cli.d.ts +10 -0
  21. package/dist/features/tmux-subagent/action-executor-core.d.ts +21 -0
  22. package/dist/features/tmux-subagent/action-executor.d.ts +3 -12
  23. package/dist/features/tmux-subagent/grid-planning.d.ts +2 -2
  24. package/dist/features/tmux-subagent/pane-split-availability.d.ts +3 -2
  25. package/dist/features/tmux-subagent/polling-manager.d.ts +1 -0
  26. package/dist/features/tmux-subagent/spawn-target-finder.d.ts +1 -1
  27. package/dist/hooks/context-window-monitor.d.ts +5 -1
  28. package/dist/hooks/directory-agents-injector/hook.d.ts +3 -1
  29. package/dist/hooks/directory-readme-injector/hook.d.ts +3 -1
  30. package/dist/hooks/hashline-read-enhancer/hook.d.ts +18 -0
  31. package/dist/hooks/hashline-read-enhancer/index.d.ts +1 -0
  32. package/dist/hooks/index.d.ts +1 -0
  33. package/dist/hooks/preemptive-compaction.d.ts +4 -1
  34. package/dist/hooks/rules-injector/hook.d.ts +3 -1
  35. package/dist/hooks/think-mode/switcher.d.ts +7 -0
  36. package/dist/hooks/tool-output-truncator.d.ts +3 -0
  37. package/dist/index.js +1758 -830
  38. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
  39. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -0
  40. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +4 -1
  41. package/dist/shared/dynamic-truncator.d.ts +7 -3
  42. package/dist/shared/fallback-model-availability.d.ts +9 -2
  43. package/dist/shared/git-worktree/index.d.ts +2 -0
  44. package/dist/shared/git-worktree/parse-status-porcelain-line.d.ts +6 -0
  45. package/dist/shared/index.d.ts +2 -0
  46. package/dist/shared/model-availability.d.ts +0 -5
  47. package/dist/shared/session-directory-resolver.d.ts +7 -0
  48. package/dist/shared/tmux/tmux-utils/layout.d.ts +2 -2
  49. package/dist/tools/call-omo-agent/tools.d.ts +1 -1
  50. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +7 -1
  51. package/dist/tools/hashline-edit/constants.d.ts +2 -0
  52. package/dist/tools/hashline-edit/edit-operations.d.ts +6 -0
  53. package/dist/tools/hashline-edit/hash-computation.d.ts +3 -0
  54. package/dist/tools/hashline-edit/index.d.ts +7 -0
  55. package/dist/tools/hashline-edit/tools.d.ts +2 -0
  56. package/dist/tools/hashline-edit/types.d.ts +22 -0
  57. package/dist/tools/hashline-edit/validation.d.ts +6 -0
  58. package/dist/tools/index.d.ts +1 -0
  59. package/package.json +8 -8
@@ -1,8 +1,10 @@
1
1
  import type { HookName, OhMyOpenCodeConfig } from "../../config";
2
2
  import type { PluginContext } from "../types";
3
+ import type { ModelCacheState } from "../../plugin-state";
3
4
  export declare function createCoreHooks(args: {
4
5
  ctx: PluginContext;
5
6
  pluginConfig: OhMyOpenCodeConfig;
7
+ modelCacheState: ModelCacheState;
6
8
  isHookEnabled: (hookName: HookName) => boolean;
7
9
  safeHookEnabled: boolean;
8
10
  }): {
@@ -18,6 +20,7 @@ export declare function createCoreHooks(args: {
18
20
  rulesInjector: ReturnType<typeof import("../../hooks").createRulesInjectorHook> | null;
19
21
  tasksTodowriteDisabler: ReturnType<typeof import("../../hooks").createTasksTodowriteDisablerHook> | null;
20
22
  writeExistingFileGuard: ReturnType<typeof import("../../hooks").createWriteExistingFileGuardHook> | null;
23
+ hashlineReadEnhancer: ReturnType<typeof import("../../hooks").createHashlineReadEnhancerHook> | null;
21
24
  contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
22
25
  preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
23
26
  sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
@@ -1,4 +1,5 @@
1
1
  import type { OhMyOpenCodeConfig, HookName } from "../../config";
2
+ import type { ModelCacheState } from "../../plugin-state";
2
3
  import type { PluginContext } from "../types";
3
4
  import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createPrometheusMdOnlyHook, createSisyphusJuniorNotepadHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook } from "../../hooks";
4
5
  import { createAnthropicEffortHook } from "../../hooks/anthropic-effort";
@@ -26,6 +27,7 @@ export type SessionHooks = {
26
27
  export declare function createSessionHooks(args: {
27
28
  ctx: PluginContext;
28
29
  pluginConfig: OhMyOpenCodeConfig;
30
+ modelCacheState: ModelCacheState;
29
31
  isHookEnabled: (hookName: HookName) => boolean;
30
32
  safeHookEnabled: boolean;
31
33
  }): SessionHooks;
@@ -1,6 +1,7 @@
1
1
  import type { HookName, OhMyOpenCodeConfig } from "../../config";
2
+ import type { ModelCacheState } from "../../plugin-state";
2
3
  import type { PluginContext } from "../types";
3
- import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook } from "../../hooks";
4
+ import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook } from "../../hooks";
4
5
  export type ToolGuardHooks = {
5
6
  commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
6
7
  toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
@@ -10,10 +11,12 @@ export type ToolGuardHooks = {
10
11
  rulesInjector: ReturnType<typeof createRulesInjectorHook> | null;
11
12
  tasksTodowriteDisabler: ReturnType<typeof createTasksTodowriteDisablerHook> | null;
12
13
  writeExistingFileGuard: ReturnType<typeof createWriteExistingFileGuardHook> | null;
14
+ hashlineReadEnhancer: ReturnType<typeof createHashlineReadEnhancerHook> | null;
13
15
  };
14
16
  export declare function createToolGuardHooks(args: {
15
17
  ctx: PluginContext;
16
18
  pluginConfig: OhMyOpenCodeConfig;
19
+ modelCacheState: ModelCacheState;
17
20
  isHookEnabled: (hookName: HookName) => boolean;
18
21
  safeHookEnabled: boolean;
19
22
  }): ToolGuardHooks;
@@ -1,4 +1,7 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
+ type ModelCacheStateLike = {
3
+ anthropicContext1MEnabled: boolean;
4
+ };
2
5
  export interface TruncationResult {
3
6
  result: string;
4
7
  truncated: boolean;
@@ -10,13 +13,13 @@ export interface TruncationOptions {
10
13
  contextWindowLimit?: number;
11
14
  }
12
15
  export declare function truncateToTokenLimit(output: string, maxTokens: number, preserveHeaderLines?: number): TruncationResult;
13
- export declare function getContextWindowUsage(ctx: PluginInput, sessionID: string): Promise<{
16
+ export declare function getContextWindowUsage(ctx: PluginInput, sessionID: string, modelCacheState?: ModelCacheStateLike): Promise<{
14
17
  usedTokens: number;
15
18
  remainingTokens: number;
16
19
  usagePercentage: number;
17
20
  } | null>;
18
- export declare function dynamicTruncate(ctx: PluginInput, sessionID: string, output: string, options?: TruncationOptions): Promise<TruncationResult>;
19
- export declare function createDynamicTruncator(ctx: PluginInput): {
21
+ export declare function dynamicTruncate(ctx: PluginInput, sessionID: string, output: string, options?: TruncationOptions, modelCacheState?: ModelCacheStateLike): Promise<TruncationResult>;
22
+ export declare function createDynamicTruncator(ctx: PluginInput, modelCacheState?: ModelCacheStateLike): {
20
23
  truncate: (sessionID: string, output: string, options?: TruncationOptions) => Promise<TruncationResult>;
21
24
  getUsage: (sessionID: string) => Promise<{
22
25
  usedTokens: number;
@@ -25,3 +28,4 @@ export declare function createDynamicTruncator(ctx: PluginInput): {
25
28
  } | null>;
26
29
  truncateSync: (output: string, maxTokens: number, preserveHeaderLines?: number) => TruncationResult;
27
30
  };
31
+ export {};
@@ -1,5 +1,12 @@
1
- export declare function isAnyFallbackModelAvailable(fallbackChain: Array<{
1
+ type FallbackEntry = {
2
2
  providers: string[];
3
3
  model: string;
4
- }>, availableModels: Set<string>): boolean;
4
+ };
5
+ type ResolvedFallbackModel = {
6
+ provider: string;
7
+ model: string;
8
+ };
9
+ export declare function resolveFirstAvailableFallback(fallbackChain: FallbackEntry[], availableModels: Set<string>): ResolvedFallbackModel | null;
10
+ export declare function isAnyFallbackModelAvailable(fallbackChain: FallbackEntry[], availableModels: Set<string>): boolean;
5
11
  export declare function isAnyProviderConnected(providers: string[], availableModels: Set<string>): boolean;
12
+ export {};
@@ -1,4 +1,6 @@
1
1
  export type { GitFileStatus, GitFileStat } from "./types";
2
+ export type { ParsedGitStatusPorcelainLine } from "./parse-status-porcelain-line";
3
+ export { parseGitStatusPorcelainLine } from "./parse-status-porcelain-line";
2
4
  export { parseGitStatusPorcelain } from "./parse-status-porcelain";
3
5
  export { parseGitDiffNumstat } from "./parse-diff-numstat";
4
6
  export { collectGitDiffStats } from "./collect-git-diff-stats";
@@ -0,0 +1,6 @@
1
+ import type { GitFileStatus } from "./types";
2
+ export interface ParsedGitStatusPorcelainLine {
3
+ filePath: string;
4
+ status: GitFileStatus;
5
+ }
6
+ export declare function parseGitStatusPorcelainLine(line: string): ParsedGitStatusPorcelainLine | null;
@@ -33,6 +33,7 @@ export * from "./model-resolver";
33
33
  export { resolveModelPipeline } from "./model-resolution-pipeline";
34
34
  export type { ModelResolutionRequest, ModelResolutionProvenance, ModelResolutionResult, } from "./model-resolution-types";
35
35
  export * from "./model-availability";
36
+ export * from "./fallback-model-availability";
36
37
  export * from "./connected-providers-cache";
37
38
  export * from "./session-utils";
38
39
  export * from "./tmux";
@@ -46,3 +47,4 @@ export * from "./truncate-description";
46
47
  export * from "./opencode-storage-paths";
47
48
  export * from "./opencode-message-dir";
48
49
  export * from "./normalize-sdk-response";
50
+ export * from "./session-directory-resolver";
@@ -11,10 +11,5 @@ export declare function getConnectedProviders(client: any): Promise<string[]>;
11
11
  export declare function fetchAvailableModels(client?: any, options?: {
12
12
  connectedProviders?: string[] | null;
13
13
  }): Promise<Set<string>>;
14
- export declare function isAnyFallbackModelAvailable(fallbackChain: Array<{
15
- providers: string[];
16
- model: string;
17
- }>, availableModels: Set<string>): boolean;
18
- export declare function isAnyProviderConnected(providers: string[], availableModels: Set<string>): boolean;
19
14
  export declare function __resetModelCache(): void;
20
15
  export declare function isModelCacheAvailable(): boolean;
@@ -0,0 +1,7 @@
1
+ export declare function isWindowsAppDataDirectory(directory: string): boolean;
2
+ export declare function resolveSessionDirectory(options: {
3
+ parentDirectory: string | null | undefined;
4
+ fallbackDirectory: string;
5
+ platform?: NodeJS.Platform;
6
+ currentWorkingDirectory?: string;
7
+ }): string;
@@ -1,3 +1,3 @@
1
1
  import type { TmuxLayout } from "../../../config/schema";
2
- export declare function applyLayout(tmux: string, layout: TmuxLayout, mainPaneSize: number): Promise<void>;
3
- export declare function enforceMainPaneWidth(mainPaneId: string, windowWidth: number): Promise<void>;
2
+ export declare function applyLayout(layout: TmuxLayout, mainPaneSize: number): Promise<void>;
3
+ export declare function enforceMainPaneWidth(mainPaneId: string, windowWidth: number, mainPaneSize: number): Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
- export declare function createCallOmoAgent(ctx: PluginInput, backgroundManager: BackgroundManager): ToolDefinition;
3
+ export declare function createCallOmoAgent(ctx: PluginInput, backgroundManager: BackgroundManager, disabledAgents?: string[]): ToolDefinition;
@@ -1,4 +1,9 @@
1
1
  import type { DelegateTaskArgs, OpencodeClient } from "./types";
2
+ import { promptSyncWithModelSuggestionRetry, promptWithModelSuggestionRetry } from "../../shared/model-suggestion-retry";
3
+ type SendSyncPromptDeps = {
4
+ promptWithModelSuggestionRetry: typeof promptWithModelSuggestionRetry;
5
+ promptSyncWithModelSuggestionRetry: typeof promptSyncWithModelSuggestionRetry;
6
+ };
2
7
  export declare function sendSyncPrompt(client: OpencodeClient, input: {
3
8
  sessionID: string;
4
9
  agentToUse: string;
@@ -13,4 +18,5 @@ export declare function sendSyncPrompt(client: OpencodeClient, input: {
13
18
  removeTask: (id: string) => void;
14
19
  } | null | undefined;
15
20
  taskId: string | undefined;
16
- }): Promise<string | null>;
21
+ }, deps?: SendSyncPromptDeps): Promise<string | null>;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const HASH_DICT: readonly ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
2
+ export declare const HASHLINE_PATTERN: RegExp;
@@ -0,0 +1,6 @@
1
+ import type { HashlineEdit } from "./types";
2
+ export declare function applySetLine(lines: string[], anchor: string, newText: string): string[];
3
+ export declare function applyReplaceLines(lines: string[], startAnchor: string, endAnchor: string, newText: string): string[];
4
+ export declare function applyInsertAfter(lines: string[], anchor: string, text: string): string[];
5
+ export declare function applyReplace(content: string, oldText: string, newText: string): string;
6
+ export declare function applyHashlineEdits(content: string, edits: HashlineEdit[]): string;
@@ -0,0 +1,3 @@
1
+ export declare function computeLineHash(lineNumber: number, content: string): string;
2
+ export declare function formatHashLine(lineNumber: number, content: string): string;
3
+ export declare function formatHashLines(content: string): string;
@@ -0,0 +1,7 @@
1
+ export { computeLineHash, formatHashLine, formatHashLines } from "./hash-computation";
2
+ export { parseLineRef, validateLineRef } from "./validation";
3
+ export type { LineRef } from "./validation";
4
+ export type { SetLine, ReplaceLines, InsertAfter, Replace, HashlineEdit } from "./types";
5
+ export { HASH_DICT, HASHLINE_PATTERN } from "./constants";
6
+ export { applyHashlineEdits, applyInsertAfter, applyReplace, applyReplaceLines, applySetLine, } from "./edit-operations";
7
+ export { createHashlineEditTool } from "./tools";
@@ -0,0 +1,2 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ export declare function createHashlineEditTool(): ToolDefinition;
@@ -0,0 +1,22 @@
1
+ export interface SetLine {
2
+ type: "set_line";
3
+ line: string;
4
+ text: string;
5
+ }
6
+ export interface ReplaceLines {
7
+ type: "replace_lines";
8
+ start_line: string;
9
+ end_line: string;
10
+ text: string;
11
+ }
12
+ export interface InsertAfter {
13
+ type: "insert_after";
14
+ line: string;
15
+ text: string;
16
+ }
17
+ export interface Replace {
18
+ type: "replace";
19
+ old_text: string;
20
+ new_text: string;
21
+ }
22
+ export type HashlineEdit = SetLine | ReplaceLines | InsertAfter | Replace;
@@ -0,0 +1,6 @@
1
+ export interface LineRef {
2
+ line: number;
3
+ hash: string;
4
+ }
5
+ export declare function parseLineRef(ref: string): LineRef;
6
+ export declare function validateLineRef(lines: string[], ref: string): void;
@@ -16,5 +16,6 @@ export { createCallOmoAgent } from "./call-omo-agent";
16
16
  export { createLookAt } from "./look-at";
17
17
  export { createDelegateTask } from "./delegate-task";
18
18
  export { createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, } from "./task";
19
+ export { createHashlineEditTool } from "./hashline-edit";
19
20
  export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
20
21
  export declare const builtinTools: Record<string, ToolDefinition>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
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",
@@ -74,13 +74,13 @@
74
74
  "typescript": "^5.7.3"
75
75
  },
76
76
  "optionalDependencies": {
77
- "oh-my-opencode-darwin-arm64": "3.6.0",
78
- "oh-my-opencode-darwin-x64": "3.6.0",
79
- "oh-my-opencode-linux-arm64": "3.6.0",
80
- "oh-my-opencode-linux-arm64-musl": "3.6.0",
81
- "oh-my-opencode-linux-x64": "3.6.0",
82
- "oh-my-opencode-linux-x64-musl": "3.6.0",
83
- "oh-my-opencode-windows-x64": "3.6.0"
77
+ "oh-my-opencode-darwin-arm64": "3.7.0",
78
+ "oh-my-opencode-darwin-x64": "3.7.0",
79
+ "oh-my-opencode-linux-arm64": "3.7.0",
80
+ "oh-my-opencode-linux-arm64-musl": "3.7.0",
81
+ "oh-my-opencode-linux-x64": "3.7.0",
82
+ "oh-my-opencode-linux-x64-musl": "3.7.0",
83
+ "oh-my-opencode-windows-x64": "3.7.0"
84
84
  },
85
85
  "trustedDependencies": [
86
86
  "@ast-grep/cli",