oh-my-opencode 3.5.6 → 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 (137) 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 +450 -116
  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 +30 -1
  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/constants.d.ts +1 -1
  19. package/dist/features/background-agent/manager.d.ts +3 -0
  20. package/dist/features/background-agent/message-dir.d.ts +1 -1
  21. package/dist/features/background-agent/result-handler.d.ts +1 -1
  22. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  23. package/dist/features/builtin-skills/skills/playwright-cli.d.ts +10 -0
  24. package/dist/features/claude-code-mcp-loader/loader.d.ts +1 -1
  25. package/dist/features/hook-message-injector/constants.d.ts +1 -3
  26. package/dist/features/hook-message-injector/index.d.ts +1 -1
  27. package/dist/features/hook-message-injector/injector.d.ts +51 -3
  28. package/dist/features/tmux-subagent/action-executor-core.d.ts +21 -0
  29. package/dist/features/tmux-subagent/action-executor.d.ts +3 -12
  30. package/dist/features/tmux-subagent/grid-planning.d.ts +2 -2
  31. package/dist/features/tmux-subagent/manager.d.ts +0 -1
  32. package/dist/features/tmux-subagent/pane-split-availability.d.ts +3 -2
  33. package/dist/features/tmux-subagent/polling-manager.d.ts +1 -0
  34. package/dist/features/tmux-subagent/spawn-target-finder.d.ts +1 -1
  35. package/dist/hooks/agent-usage-reminder/constants.d.ts +0 -1
  36. package/dist/hooks/anthropic-context-window-limit-recovery/client.d.ts +3 -34
  37. package/dist/hooks/anthropic-context-window-limit-recovery/deduplication-recovery.d.ts +4 -1
  38. package/dist/hooks/anthropic-context-window-limit-recovery/empty-content-recovery-sdk.d.ts +11 -0
  39. package/dist/hooks/anthropic-context-window-limit-recovery/message-builder.d.ts +4 -1
  40. package/dist/hooks/anthropic-context-window-limit-recovery/message-storage-directory.d.ts +5 -1
  41. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.d.ts +4 -1
  42. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-tool-output-truncation.d.ts +5 -2
  43. package/dist/hooks/anthropic-context-window-limit-recovery/storage-paths.d.ts +2 -2
  44. package/dist/hooks/anthropic-context-window-limit-recovery/storage.d.ts +1 -0
  45. package/dist/hooks/anthropic-context-window-limit-recovery/target-token-truncation.d.ts +4 -1
  46. package/dist/hooks/anthropic-context-window-limit-recovery/tool-result-storage-sdk.d.ts +29 -0
  47. package/dist/hooks/atlas/session-last-agent.d.ts +4 -1
  48. package/dist/hooks/atlas/tool-execute-before.d.ts +2 -0
  49. package/dist/hooks/context-window-monitor.d.ts +5 -1
  50. package/dist/hooks/directory-agents-injector/constants.d.ts +0 -1
  51. package/dist/hooks/directory-agents-injector/hook.d.ts +3 -1
  52. package/dist/hooks/directory-readme-injector/constants.d.ts +0 -1
  53. package/dist/hooks/directory-readme-injector/hook.d.ts +3 -1
  54. package/dist/hooks/hashline-read-enhancer/hook.d.ts +18 -0
  55. package/dist/hooks/hashline-read-enhancer/index.d.ts +1 -0
  56. package/dist/hooks/index.d.ts +1 -0
  57. package/dist/hooks/interactive-bash-session/constants.d.ts +0 -1
  58. package/dist/hooks/preemptive-compaction.d.ts +4 -1
  59. package/dist/hooks/prometheus-md-only/agent-resolution.d.ts +4 -1
  60. package/dist/hooks/ralph-loop/message-storage-directory.d.ts +1 -1
  61. package/dist/hooks/rules-injector/constants.d.ts +0 -1
  62. package/dist/hooks/rules-injector/hook.d.ts +3 -1
  63. package/dist/hooks/session-recovery/constants.d.ts +1 -3
  64. package/dist/hooks/session-recovery/recover-empty-content-message-sdk.d.ts +13 -0
  65. package/dist/hooks/session-recovery/recover-empty-content-message.d.ts +1 -1
  66. package/dist/hooks/session-recovery/recover-thinking-block-order.d.ts +1 -1
  67. package/dist/hooks/session-recovery/recover-thinking-disabled-violation.d.ts +1 -1
  68. package/dist/hooks/session-recovery/storage/empty-text.d.ts +5 -0
  69. package/dist/hooks/session-recovery/storage/message-dir.d.ts +1 -1
  70. package/dist/hooks/session-recovery/storage/messages-reader.d.ts +4 -0
  71. package/dist/hooks/session-recovery/storage/parts-reader.d.ts +4 -0
  72. package/dist/hooks/session-recovery/storage/text-part-injector.d.ts +4 -0
  73. package/dist/hooks/session-recovery/storage/thinking-prepend.d.ts +4 -0
  74. package/dist/hooks/session-recovery/storage/thinking-strip.d.ts +4 -0
  75. package/dist/hooks/session-recovery/storage.d.ts +7 -0
  76. package/dist/hooks/sisyphus-junior-notepad/hook.d.ts +1 -1
  77. package/dist/hooks/think-mode/switcher.d.ts +7 -0
  78. package/dist/hooks/todo-continuation-enforcer/message-directory.d.ts +1 -1
  79. package/dist/hooks/todo-continuation-enforcer/types.d.ts +1 -1
  80. package/dist/hooks/tool-output-truncator.d.ts +3 -0
  81. package/dist/index.js +24207 -22344
  82. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
  83. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -0
  84. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +4 -1
  85. package/dist/plugin-config.d.ts +1 -1
  86. package/dist/plugin-handlers/agent-key-remapper.d.ts +1 -0
  87. package/dist/shared/agent-display-names.d.ts +5 -0
  88. package/dist/shared/dynamic-truncator.d.ts +7 -3
  89. package/dist/shared/fallback-model-availability.d.ts +9 -2
  90. package/dist/shared/git-worktree/index.d.ts +2 -0
  91. package/dist/shared/git-worktree/parse-status-porcelain-line.d.ts +6 -0
  92. package/dist/shared/index.d.ts +8 -1
  93. package/dist/shared/model-availability.d.ts +0 -5
  94. package/dist/shared/model-name-matcher.d.ts +0 -1
  95. package/dist/shared/normalize-sdk-response.d.ts +4 -0
  96. package/dist/shared/opencode-http-api.d.ts +3 -0
  97. package/dist/shared/opencode-storage-detection.d.ts +2 -0
  98. package/dist/shared/opencode-storage-paths.d.ts +4 -0
  99. package/dist/shared/opencode-version.d.ts +5 -0
  100. package/dist/shared/session-directory-resolver.d.ts +7 -0
  101. package/dist/shared/session-utils.d.ts +2 -2
  102. package/dist/shared/tmux/tmux-utils/layout.d.ts +2 -2
  103. package/dist/tools/background-task/create-background-cancel.d.ts +1 -1
  104. package/dist/tools/background-task/create-background-task.d.ts +2 -2
  105. package/dist/tools/background-task/message-dir.d.ts +1 -1
  106. package/dist/tools/background-task/modules/background-cancel.d.ts +1 -1
  107. package/dist/tools/background-task/modules/utils.d.ts +2 -1
  108. package/dist/tools/call-omo-agent/background-agent-executor.d.ts +2 -1
  109. package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
  110. package/dist/tools/call-omo-agent/message-dir.d.ts +1 -1
  111. package/dist/tools/call-omo-agent/message-storage-directory.d.ts +1 -1
  112. package/dist/tools/call-omo-agent/tools.d.ts +1 -1
  113. package/dist/tools/delegate-task/parent-context-resolver.d.ts +2 -1
  114. package/dist/tools/delegate-task/sisyphus-junior-agent.d.ts +1 -1
  115. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +7 -1
  116. package/dist/tools/hashline-edit/constants.d.ts +2 -0
  117. package/dist/tools/hashline-edit/edit-operations.d.ts +6 -0
  118. package/dist/tools/hashline-edit/hash-computation.d.ts +3 -0
  119. package/dist/tools/hashline-edit/index.d.ts +7 -0
  120. package/dist/tools/hashline-edit/tools.d.ts +2 -0
  121. package/dist/tools/hashline-edit/types.d.ts +22 -0
  122. package/dist/tools/hashline-edit/validation.d.ts +6 -0
  123. package/dist/tools/index.d.ts +1 -0
  124. package/dist/tools/session-manager/constants.d.ts +1 -4
  125. package/dist/tools/session-manager/session-formatter.d.ts +1 -1
  126. package/dist/tools/session-manager/storage.d.ts +5 -2
  127. package/dist/tools/session-manager/types.d.ts +1 -1
  128. package/dist/tools/task/todo-sync.d.ts +2 -2
  129. package/package.json +8 -8
  130. package/dist/tools/task/task-action-create.d.ts +0 -4
  131. package/dist/tools/task/task-action-delete.d.ts +0 -2
  132. package/dist/tools/task/task-action-get.d.ts +0 -2
  133. package/dist/tools/task/task-action-list.d.ts +0 -2
  134. package/dist/tools/task/task-action-update.d.ts +0 -2
  135. package/dist/tools/task/task-id-validator.d.ts +0 -1
  136. package/dist/tools/task/task.d.ts +0 -3
  137. /package/dist/{features/background-agent/message-storage-locator.d.ts → shared/opencode-message-dir.d.ts} +0 -0
@@ -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,5 +1,5 @@
1
1
  import { type OhMyOpenCodeConfig } from "./config";
2
2
  export declare function parseConfigPartially(rawConfig: Record<string, unknown>): OhMyOpenCodeConfig | null;
3
- export declare function loadConfigFromPath(configPath: string, ctx: unknown): OhMyOpenCodeConfig | null;
3
+ export declare function loadConfigFromPath(configPath: string, _ctx: unknown): OhMyOpenCodeConfig | null;
4
4
  export declare function mergeConfigs(base: OhMyOpenCodeConfig, override: OhMyOpenCodeConfig): OhMyOpenCodeConfig;
5
5
  export declare function loadPluginConfig(directory: string, ctx: unknown): OhMyOpenCodeConfig;
@@ -0,0 +1 @@
1
+ export declare function remapAgentKeysToDisplayNames(agents: Record<string, unknown>): Record<string, unknown>;
@@ -10,3 +10,8 @@ export declare const AGENT_DISPLAY_NAMES: Record<string, string>;
10
10
  * Returns original key if not found.
11
11
  */
12
12
  export declare function getAgentDisplayName(configKey: string): string;
13
+ /**
14
+ * Resolve an agent name (display name or config key) to its lowercase config key.
15
+ * "Atlas (Plan Executor)" → "atlas", "atlas" → "atlas", "unknown" → "unknown"
16
+ */
17
+ export declare function getAgentConfigKey(agentName: string): string;
@@ -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;
@@ -18,6 +18,7 @@ export * from "./migration";
18
18
  export * from "./opencode-config-dir";
19
19
  export type { OpenCodeBinaryType, OpenCodeConfigDirOptions, OpenCodeConfigPaths, } from "./opencode-config-dir-types";
20
20
  export * from "./opencode-version";
21
+ export * from "./opencode-storage-detection";
21
22
  export * from "./permission-compat";
22
23
  export * from "./external-plugin-detector";
23
24
  export * from "./zip-extractor";
@@ -30,14 +31,20 @@ export * from "./agent-tool-restrictions";
30
31
  export * from "./model-requirements";
31
32
  export * from "./model-resolver";
32
33
  export { resolveModelPipeline } from "./model-resolution-pipeline";
33
- export type { ModelResolutionRequest, ModelResolutionProvenance, ModelResolutionResult as ModelResolutionPipelineResult, } from "./model-resolution-types";
34
+ export type { ModelResolutionRequest, ModelResolutionProvenance, ModelResolutionResult, } from "./model-resolution-types";
34
35
  export * from "./model-availability";
36
+ export * from "./fallback-model-availability";
35
37
  export * from "./connected-providers-cache";
36
38
  export * from "./session-utils";
37
39
  export * from "./tmux";
38
40
  export * from "./model-suggestion-retry";
39
41
  export * from "./opencode-server-auth";
42
+ export * from "./opencode-http-api";
40
43
  export * from "./port-utils";
41
44
  export * from "./git-worktree";
42
45
  export * from "./safe-create-hook";
43
46
  export * from "./truncate-description";
47
+ export * from "./opencode-storage-paths";
48
+ export * from "./opencode-message-dir";
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;
@@ -1,2 +1 @@
1
1
  export declare function fuzzyMatchModel(target: string, available: Set<string>, providers?: string[]): string | null;
2
- export declare function isModelAvailable(targetModel: string, availableModels: Set<string>): boolean;
@@ -0,0 +1,4 @@
1
+ export interface NormalizeSDKResponseOptions {
2
+ preferResponseOnMissingData?: boolean;
3
+ }
4
+ export declare function normalizeSDKResponse<TData>(response: unknown, fallback: TData, options?: NormalizeSDKResponseOptions): TData;
@@ -0,0 +1,3 @@
1
+ export declare function getServerBaseUrl(client: unknown): string | null;
2
+ export declare function patchPart(client: unknown, sessionID: string, messageID: string, partID: string, body: Record<string, unknown>): Promise<boolean>;
3
+ export declare function deletePart(client: unknown, sessionID: string, messageID: string, partID: string): Promise<boolean>;
@@ -0,0 +1,2 @@
1
+ export declare function isSqliteBackend(): boolean;
2
+ export declare function resetSqliteBackendCache(): void;
@@ -0,0 +1,4 @@
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 SESSION_STORAGE: string;
@@ -11,6 +11,11 @@ export declare const MINIMUM_OPENCODE_VERSION = "1.1.1";
11
11
  * is auto-disabled to prevent duplicate AGENTS.md loading.
12
12
  */
13
13
  export declare const OPENCODE_NATIVE_AGENTS_INJECTION_VERSION = "1.1.37";
14
+ /**
15
+ * OpenCode version that introduced SQLite backend for storage.
16
+ * When this version is detected AND opencode.db exists, SQLite backend is used.
17
+ */
18
+ export declare const OPENCODE_SQLITE_VERSION = "1.1.53";
14
19
  export declare function parseVersion(version: string): number[];
15
20
  export declare function compareVersions(a: string, b: string): -1 | 0 | 1;
16
21
  export declare function getOpenCodeVersion(): string | null;
@@ -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,2 +1,2 @@
1
- export declare function getMessageDir(sessionID: string): string | null;
2
- export declare function isCallerOrchestrator(sessionID?: string): boolean;
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ export declare function isCallerOrchestrator(sessionID?: string, client?: PluginInput["client"]): Promise<boolean>;
@@ -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,4 +1,4 @@
1
1
  import { type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
3
  import type { BackgroundCancelClient } from "./clients";
4
- export declare function createBackgroundCancel(manager: BackgroundManager, client: BackgroundCancelClient): ToolDefinition;
4
+ export declare function createBackgroundCancel(manager: BackgroundManager, _client: BackgroundCancelClient): ToolDefinition;
@@ -1,3 +1,3 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin";
1
+ import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
- export declare function createBackgroundTask(manager: BackgroundManager): ToolDefinition;
3
+ export declare function createBackgroundTask(manager: BackgroundManager, client: PluginInput["client"]): ToolDefinition;
@@ -1 +1 @@
1
- export declare function getMessageDir(sessionID: string): string | null;
1
+ export { getMessageDir } from "../../shared/opencode-message-dir";
@@ -1,4 +1,4 @@
1
1
  import { type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundCancelClient } from "../types";
3
3
  import type { BackgroundManager } from "../../../features/background-agent";
4
- export declare function createBackgroundCancel(manager: BackgroundManager, client: BackgroundCancelClient): ToolDefinition;
4
+ export declare function createBackgroundCancel(manager: BackgroundManager, _client: BackgroundCancelClient): ToolDefinition;
@@ -1,4 +1,5 @@
1
- export declare function getMessageDir(sessionID: string): string | null;
1
+ import { getMessageDir } from "../../../shared";
2
+ export { getMessageDir };
2
3
  export declare function formatDuration(start: Date, end?: Date): string;
3
4
  export declare function truncateText(text: string, maxLength: number): string;
4
5
  export declare function delay(ms: number): Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import type { BackgroundManager } from "../../features/background-agent";
2
+ import type { PluginInput } from "@opencode-ai/plugin";
2
3
  import type { CallOmoAgentArgs } from "./types";
3
4
  import type { ToolContextWithMetadata } from "./tool-context-with-metadata";
4
- export declare function executeBackgroundAgent(args: CallOmoAgentArgs, toolContext: ToolContextWithMetadata, manager: BackgroundManager): Promise<string>;
5
+ export declare function executeBackgroundAgent(args: CallOmoAgentArgs, toolContext: ToolContextWithMetadata, manager: BackgroundManager, client: PluginInput["client"]): Promise<string>;
@@ -1,5 +1,6 @@
1
1
  import type { CallOmoAgentArgs } from "./types";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
+ import type { PluginInput } from "@opencode-ai/plugin";
3
4
  export declare function executeBackground(args: CallOmoAgentArgs, toolContext: {
4
5
  sessionID: string;
5
6
  messageID: string;
@@ -9,4 +10,4 @@ export declare function executeBackground(args: CallOmoAgentArgs, toolContext: {
9
10
  title?: string;
10
11
  metadata?: Record<string, unknown>;
11
12
  }) => void;
12
- }, manager: BackgroundManager): Promise<string>;
13
+ }, manager: BackgroundManager, client: PluginInput["client"]): Promise<string>;
@@ -1 +1 @@
1
- export declare function getMessageDir(sessionID: string): string | null;
1
+ export { getMessageDir } from "../../shared/opencode-message-dir";
@@ -1 +1 @@
1
- export declare function getMessageDir(sessionID: string): string | null;
1
+ export { getMessageDir } from "../../shared";
@@ -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,3 +1,4 @@
1
1
  import type { ToolContextWithMetadata } from "./types";
2
+ import type { OpencodeClient } from "./types";
2
3
  import type { ParentContext } from "./executor-types";
3
- export declare function resolveParentContext(ctx: ToolContextWithMetadata): ParentContext;
4
+ export declare function resolveParentContext(ctx: ToolContextWithMetadata, client: OpencodeClient): Promise<ParentContext>;
@@ -1 +1 @@
1
- export declare const SISYPHUS_JUNIOR_AGENT = "sisyphus-junior";
1
+ export declare const SISYPHUS_JUNIOR_AGENT: string;
@@ -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>;
@@ -1,7 +1,4 @@
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 SESSION_STORAGE: string;
1
+ export { OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE } from "../../shared";
5
2
  export declare const TODO_DIR: string;
6
3
  export declare const TRANSCRIPT_DIR: string;
7
4
  export declare const SESSION_LIST_DESCRIPTION = "List all OpenCode sessions with optional filtering.\n\nReturns a list of available session IDs with metadata including message count, date range, and agents used.\n\nArguments:\n- limit (optional): Maximum number of sessions to return\n- from_date (optional): Filter sessions from this date (ISO 8601 format)\n- to_date (optional): Filter sessions until this date (ISO 8601 format)\n\nExample output:\n| Session ID | Messages | First | Last | Agents |\n|------------|----------|-------|------|--------|\n| ses_abc123 | 45 | 2025-12-20 | 2025-12-24 | build, oracle |\n| ses_def456 | 12 | 2025-12-19 | 2025-12-19 | build |";
@@ -1,7 +1,7 @@
1
1
  import type { SessionInfo, SessionMessage, SearchResult } from "./types";
2
2
  export declare function formatSessionList(sessionIDs: string[]): Promise<string>;
3
3
  export declare function formatSessionMessages(messages: SessionMessage[], includeTodos?: boolean, todos?: Array<{
4
- id: string;
4
+ id?: string;
5
5
  content: string;
6
6
  status: string;
7
7
  }>): string;
@@ -1,11 +1,14 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
1
2
  import type { SessionMessage, SessionInfo, TodoItem, SessionMetadata } from "./types";
2
3
  export interface GetMainSessionsOptions {
3
4
  directory?: string;
4
5
  }
6
+ export declare function setStorageClient(client: PluginInput["client"]): void;
7
+ export declare function resetStorageClient(): void;
5
8
  export declare function getMainSessions(options: GetMainSessionsOptions): Promise<SessionMetadata[]>;
6
9
  export declare function getAllSessions(): Promise<string[]>;
7
- export declare function getMessageDir(sessionID: string): string;
8
- export declare function sessionExists(sessionID: string): boolean;
10
+ export { getMessageDir } from "../../shared/opencode-message-dir";
11
+ export declare function sessionExists(sessionID: string): Promise<boolean>;
9
12
  export declare function readSessionMessages(sessionID: string): Promise<SessionMessage[]>;
10
13
  export declare function readSessionTodos(sessionID: string): Promise<TodoItem[]>;
11
14
  export declare function readSessionTranscript(sessionID: string): Promise<number>;
@@ -31,7 +31,7 @@ export interface SessionInfo {
31
31
  transcript_entries?: number;
32
32
  }
33
33
  export interface TodoItem {
34
- id: string;
34
+ id?: string;
35
35
  content: string;
36
36
  status: "pending" | "in_progress" | "completed" | "cancelled";
37
37
  priority?: string;
@@ -1,7 +1,7 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { Task } from "../../features/claude-tasks/types.ts";
3
3
  export interface TodoInfo {
4
- id: string;
4
+ id?: string;
5
5
  content: string;
6
6
  status: "pending" | "in_progress" | "completed" | "cancelled";
7
7
  priority?: "low" | "medium" | "high";
@@ -12,5 +12,5 @@ type TodoWriter = (input: {
12
12
  }) => Promise<void>;
13
13
  export declare function syncTaskToTodo(task: Task): TodoInfo | null;
14
14
  export declare function syncTaskTodoUpdate(ctx: PluginInput | undefined, task: Task, sessionID: string, writer?: TodoWriter): Promise<void>;
15
- export declare function syncAllTasksToTodos(ctx: PluginInput, tasks: Task[], sessionID?: string): Promise<void>;
15
+ export declare function syncAllTasksToTodos(ctx: PluginInput, tasks: Task[], sessionID?: string, writer?: TodoWriter): Promise<void>;
16
16
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.5.6",
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.5.6",
78
- "oh-my-opencode-darwin-x64": "3.5.6",
79
- "oh-my-opencode-linux-arm64": "3.5.6",
80
- "oh-my-opencode-linux-arm64-musl": "3.5.6",
81
- "oh-my-opencode-linux-x64": "3.5.6",
82
- "oh-my-opencode-linux-x64-musl": "3.5.6",
83
- "oh-my-opencode-windows-x64": "3.5.6"
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",
@@ -1,4 +0,0 @@
1
- import type { OhMyOpenCodeConfig } from "../../config/schema";
2
- export declare function handleCreate(args: Record<string, unknown>, config: Partial<OhMyOpenCodeConfig>, context: {
3
- sessionID: string;
4
- }): Promise<string>;
@@ -1,2 +0,0 @@
1
- import type { OhMyOpenCodeConfig } from "../../config/schema";
2
- export declare function handleDelete(args: Record<string, unknown>, config: Partial<OhMyOpenCodeConfig>): Promise<string>;
@@ -1,2 +0,0 @@
1
- import type { OhMyOpenCodeConfig } from "../../config/schema";
2
- export declare function handleGet(args: Record<string, unknown>, config: Partial<OhMyOpenCodeConfig>): Promise<string>;
@@ -1,2 +0,0 @@
1
- import type { OhMyOpenCodeConfig } from "../../config/schema";
2
- export declare function handleList(args: Record<string, unknown>, config: Partial<OhMyOpenCodeConfig>): Promise<string>;
@@ -1,2 +0,0 @@
1
- import type { OhMyOpenCodeConfig } from "../../config/schema";
2
- export declare function handleUpdate(args: Record<string, unknown>, config: Partial<OhMyOpenCodeConfig>): Promise<string>;
@@ -1 +0,0 @@
1
- export declare function parseTaskId(id: string): string | null;
@@ -1,3 +0,0 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
- import type { OhMyOpenCodeConfig } from "../../config/schema";
3
- export declare function createTask(config: Partial<OhMyOpenCodeConfig>): ToolDefinition;