@wolfx/oh-my-openagent 4.1.1 → 4.2.0-patch.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.
Files changed (169) hide show
  1. package/README.ja.md +2 -1
  2. package/README.ko.md +2 -1
  3. package/README.md +2 -1
  4. package/README.ru.md +2 -1
  5. package/README.zh-cn.md +2 -1
  6. package/dist/agents/atlas/default-prompt-sections.d.ts +3 -3
  7. package/dist/agents/atlas/gemini-prompt-sections.d.ts +2 -2
  8. package/dist/agents/atlas/gpt-prompt-sections.d.ts +2 -2
  9. package/dist/agents/atlas/kimi-prompt-sections.d.ts +3 -3
  10. package/dist/agents/atlas/opus-4-7-prompt-sections.d.ts +3 -3
  11. package/dist/agents/momus.d.ts +1 -1
  12. package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
  13. package/dist/agents/prometheus/high-accuracy-mode.d.ts +1 -1
  14. package/dist/agents/prometheus/identity-constraints.d.ts +1 -1
  15. package/dist/agents/prometheus/plan-generation.d.ts +1 -1
  16. package/dist/agents/prometheus/plan-template.d.ts +1 -1
  17. package/dist/config/schema/team-mode.d.ts +1 -1
  18. package/dist/features/background-agent/error-classifier.d.ts +1 -0
  19. package/dist/features/background-agent/fallback-retry-handler.d.ts +15 -0
  20. package/dist/features/background-agent/manager.d.ts +11 -8
  21. package/dist/features/background-agent/parent-wake-notifier.d.ts +74 -0
  22. package/dist/features/background-agent/process-cleanup.d.ts +2 -0
  23. package/dist/features/background-agent/session-route.d.ts +12 -0
  24. package/dist/features/background-agent/spawner.d.ts +2 -2
  25. package/dist/features/background-agent/task-registry.d.ts +6 -0
  26. package/dist/features/background-agent/types.d.ts +2 -0
  27. package/dist/features/boulder-state/constants.d.ts +4 -4
  28. package/dist/features/boulder-state/storage.d.ts +1 -1
  29. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
  30. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  31. package/dist/features/context-injector/injector.d.ts +1 -1
  32. package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +18 -0
  33. package/dist/features/run-continuation-state/constants.d.ts +1 -1
  34. package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +3 -1
  35. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +3 -3
  36. package/dist/features/team-mode/tools/messaging.d.ts +1 -0
  37. package/dist/features/team-mode/types.d.ts +2 -2
  38. package/dist/features/tmux-subagent/attachable-session-status.d.ts +1 -1
  39. package/dist/features/tmux-subagent/manager.d.ts +6 -0
  40. package/dist/features/tmux-subagent/pane-state-parser.d.ts +2 -0
  41. package/dist/features/tmux-subagent/polling-manager.d.ts +6 -2
  42. package/dist/features/tmux-subagent/types.d.ts +4 -0
  43. package/dist/hooks/atlas/boulder-continuation-injector.d.ts +1 -0
  44. package/dist/hooks/atlas/omo-path.d.ts +6 -0
  45. package/dist/hooks/atlas/tool-execute-after.d.ts +3 -0
  46. package/dist/hooks/atlas/tool-progress.d.ts +14 -0
  47. package/dist/hooks/atlas/types.d.ts +7 -0
  48. package/dist/hooks/auto-slash-command/detector.d.ts +2 -0
  49. package/dist/hooks/auto-update-checker/cache.d.ts +8 -1
  50. package/dist/hooks/auto-update-checker/checker/cached-version.d.ts +8 -1
  51. package/dist/hooks/background-notification/hook.d.ts +0 -6
  52. package/dist/hooks/compaction-context-injector/types.d.ts +1 -0
  53. package/dist/hooks/interactive-bash-session/state-manager.d.ts +1 -1
  54. package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
  55. package/dist/hooks/keyword-detector/detector.d.ts +1 -0
  56. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
  57. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
  58. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -1
  59. package/dist/hooks/prometheus-md-only/constants.d.ts +1 -1
  60. package/dist/hooks/prometheus-md-only/path-policy.d.ts +3 -3
  61. package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +11 -0
  62. package/dist/hooks/ralph-loop/constants.d.ts +1 -1
  63. package/dist/hooks/ralph-loop/continuation-prompt-injector.d.ts +4 -0
  64. package/dist/hooks/ralph-loop/iteration-continuation.d.ts +5 -0
  65. package/dist/hooks/ralph-loop/loop-state-controller.d.ts +3 -3
  66. package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +2 -1
  67. package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +2 -2
  68. package/dist/hooks/ralph-loop/storage.d.ts +2 -2
  69. package/dist/hooks/ralph-loop/types.d.ts +4 -0
  70. package/dist/hooks/ralph-loop/verification-failure-handler.d.ts +2 -2
  71. package/dist/hooks/rules-injector/injector.d.ts +9 -2
  72. package/dist/hooks/rules-injector/matcher.d.ts +5 -0
  73. package/dist/hooks/rules-injector/project-root-finder.d.ts +4 -0
  74. package/dist/hooks/rules-injector/rule-scan-cache.d.ts +9 -2
  75. package/dist/hooks/runtime-fallback/constants.d.ts +10 -0
  76. package/dist/hooks/runtime-fallback/first-prompt-watchdog.d.ts +25 -0
  77. package/dist/hooks/runtime-fallback/hook.d.ts +14 -1
  78. package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +10 -2
  79. package/dist/hooks/runtime-fallback/types.d.ts +10 -0
  80. package/dist/hooks/session-recovery/detect-error-type.d.ts +1 -1
  81. package/dist/hooks/session-recovery/hook.d.ts +1 -0
  82. package/dist/hooks/session-recovery/interrupted-idle-message-fetch-timeout.d.ts +7 -0
  83. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +6 -1
  84. package/dist/hooks/session-recovery/types.d.ts +12 -0
  85. package/dist/hooks/shared/prompt-async-gate.d.ts +1 -0
  86. package/dist/hooks/shared/session-idle-settle.d.ts +1 -11
  87. package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
  88. package/dist/hooks/team-mode-status-injector/hook.d.ts +2 -1
  89. package/dist/hooks/todo-continuation-enforcer/pending-question-detection.d.ts +2 -0
  90. package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +3 -4
  91. package/dist/hooks/todo-continuation-enforcer/types.d.ts +2 -3
  92. package/dist/hooks/tool-pair-validator/hook.d.ts +7 -2
  93. package/dist/hooks/unstable-agent-babysitter/task-message-analyzer.d.ts +1 -0
  94. package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -0
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.js +41902 -70602
  97. package/dist/mcp/index.d.ts +3 -1
  98. package/dist/mcp/lsp.d.ts +13 -0
  99. package/dist/mcp/types.d.ts +1 -0
  100. package/dist/plugin/build-team-idle-wake-hint-client.d.ts +12 -0
  101. package/dist/plugin/chat-message.d.ts +1 -1
  102. package/dist/plugin/tool-registry.d.ts +1 -2
  103. package/dist/plugin-dispose.d.ts +0 -3
  104. package/dist/shared/agent-sort-shim.d.ts +1 -0
  105. package/dist/shared/delegated-child-session-bootstrap.d.ts +25 -0
  106. package/dist/shared/dynamic-truncator.d.ts +2 -0
  107. package/dist/shared/host-skill-config.d.ts +2 -0
  108. package/dist/shared/index.d.ts +2 -0
  109. package/dist/shared/internal-initiator-marker.d.ts +25 -0
  110. package/dist/shared/legacy-workspace-migration.d.ts +5 -0
  111. package/dist/shared/logger.d.ts +12 -0
  112. package/dist/shared/model-error-classifier.d.ts +2 -0
  113. package/dist/shared/model-resolution-pipeline.d.ts +4 -0
  114. package/dist/shared/opencode-http-api.d.ts +9 -0
  115. package/dist/shared/prompt-async-gate.d.ts +82 -0
  116. package/dist/shared/replace-tool-args.d.ts +13 -0
  117. package/dist/shared/session-idle-settle.d.ts +11 -0
  118. package/dist/shared/tmux/tmux-utils/pane-activate.d.ts +1 -0
  119. package/dist/shared/tmux/tmux-utils/pane-close.d.ts +10 -0
  120. package/dist/shared/tmux/tmux-utils/pane-command.d.ts +2 -0
  121. package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +11 -1
  122. package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +1 -1
  123. package/dist/shared/tmux/tmux-utils/server-health.d.ts +12 -1
  124. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +2 -2
  125. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +1 -1
  126. package/dist/shared/tmux/tmux-utils.d.ts +2 -0
  127. package/dist/testing/create-plugin-module.d.ts +41 -0
  128. package/dist/tools/background-task/constants.d.ts +1 -1
  129. package/dist/tools/background-task/with-sdk-call-timeout.d.ts +7 -0
  130. package/dist/tools/call-omo-agent/session-creator.d.ts +2 -1
  131. package/dist/tools/call-omo-agent/sync-executor.d.ts +2 -2
  132. package/dist/tools/delegate-task/subagent-discovery.d.ts +2 -0
  133. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +2 -1
  134. package/dist/tools/delegate-task/sync-session-creator.d.ts +2 -0
  135. package/dist/tools/delegate-task/sync-task.d.ts +1 -1
  136. package/dist/tools/index.d.ts +0 -3
  137. package/dist/tools/interactive-bash/tools.d.ts +5 -0
  138. package/package.json +17 -8
  139. package/dist/hooks/atlas/sisyphus-path.d.ts +0 -6
  140. package/dist/tools/lsp/client.d.ts +0 -3
  141. package/dist/tools/lsp/config.d.ts +0 -3
  142. package/dist/tools/lsp/constants.d.ts +0 -6
  143. package/dist/tools/lsp/diagnostics-tool.d.ts +0 -2
  144. package/dist/tools/lsp/directory-diagnostics.d.ts +0 -1
  145. package/dist/tools/lsp/find-references-tool.d.ts +0 -2
  146. package/dist/tools/lsp/goto-definition-tool.d.ts +0 -2
  147. package/dist/tools/lsp/index.d.ts +0 -8
  148. package/dist/tools/lsp/infer-extension.d.ts +0 -1
  149. package/dist/tools/lsp/language-config.d.ts +0 -1
  150. package/dist/tools/lsp/language-mappings.d.ts +0 -3
  151. package/dist/tools/lsp/lsp-client-connection.d.ts +0 -4
  152. package/dist/tools/lsp/lsp-client-transport.d.ts +0 -22
  153. package/dist/tools/lsp/lsp-client-wrapper.d.ts +0 -9
  154. package/dist/tools/lsp/lsp-client.d.ts +0 -17
  155. package/dist/tools/lsp/lsp-formatters.d.ts +0 -13
  156. package/dist/tools/lsp/lsp-manager-process-cleanup.d.ts +0 -15
  157. package/dist/tools/lsp/lsp-manager-temp-directory-cleanup.d.ts +0 -8
  158. package/dist/tools/lsp/lsp-process.d.ts +0 -29
  159. package/dist/tools/lsp/lsp-server.d.ts +0 -24
  160. package/dist/tools/lsp/rename-tools.d.ts +0 -3
  161. package/dist/tools/lsp/server-config-loader.d.ts +0 -25
  162. package/dist/tools/lsp/server-definitions.d.ts +0 -3
  163. package/dist/tools/lsp/server-installation.d.ts +0 -1
  164. package/dist/tools/lsp/server-path-bases.d.ts +0 -1
  165. package/dist/tools/lsp/server-resolution.d.ts +0 -15
  166. package/dist/tools/lsp/symbols-tool.d.ts +0 -2
  167. package/dist/tools/lsp/tools.d.ts +0 -5
  168. package/dist/tools/lsp/types.d.ts +0 -123
  169. package/dist/tools/lsp/workspace-edit.d.ts +0 -8
@@ -1,3 +1,4 @@
1
+ import { type LocalMcpConfig } from "./lsp";
1
2
  import type { OhMyOpenCodeConfig } from "../config/schema";
2
3
  export { McpNameSchema, type McpName } from "./types";
3
4
  type RemoteMcpConfig = {
@@ -7,4 +8,5 @@ type RemoteMcpConfig = {
7
8
  headers?: Record<string, string>;
8
9
  oauth?: false;
9
10
  };
10
- export declare function createBuiltinMcps(disabledMcps?: string[], config?: OhMyOpenCodeConfig): Record<string, RemoteMcpConfig>;
11
+ type BuiltinMcpConfig = RemoteMcpConfig | LocalMcpConfig;
12
+ export declare function createBuiltinMcps(disabledMcps?: string[], config?: OhMyOpenCodeConfig): Record<string, BuiltinMcpConfig>;
@@ -0,0 +1,13 @@
1
+ type LspMcpConfigOptions = {
2
+ readonly cwd?: string;
3
+ readonly moduleUrl?: string;
4
+ readonly exists?: (path: string) => boolean;
5
+ };
6
+ export type LocalMcpConfig = {
7
+ type: "local";
8
+ command: string[];
9
+ enabled: boolean;
10
+ environment?: Record<string, string>;
11
+ };
12
+ export declare function createLspMcpConfig(options?: LspMcpConfigOptions): LocalMcpConfig;
13
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export declare const McpNameSchema: z.ZodEnum<{
3
+ lsp: "lsp";
3
4
  websearch: "websearch";
4
5
  context7: "context7";
5
6
  grep_app: "grep_app";
@@ -0,0 +1,12 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ type SdkSession = PluginInput["client"]["session"];
3
+ type SdkPromptAsync = SdkSession["promptAsync"];
4
+ type SdkStatus = SdkSession["status"];
5
+ export type TeamIdleWakeHintNarrowClient = {
6
+ session: {
7
+ promptAsync?: SdkPromptAsync;
8
+ status?: SdkStatus;
9
+ };
10
+ };
11
+ export declare function buildTeamIdleWakeHintClient(client: PluginInput["client"]): TeamIdleWakeHintNarrowClient;
12
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { OhMyOpenCodeConfig } from "../config";
2
- import type { PluginContext } from "./types";
3
2
  import type { CreatedHooks } from "../create-hooks";
3
+ import type { PluginContext } from "./types";
4
4
  type FirstMessageVariantGate = {
5
5
  shouldOverride: (sessionID: string) => boolean;
6
6
  markApplied: (sessionID: string) => void;
@@ -5,11 +5,10 @@ import { createTeamSendMessageTool } from "../features/team-mode/tools/messaging
5
5
  import { createTeamListTool, createTeamStatusTool } from "../features/team-mode/tools/query";
6
6
  import { createTeamTaskCreateTool, createTeamTaskGetTool, createTeamTaskListTool, createTeamTaskUpdateTool } from "../features/team-mode/tools/tasks";
7
7
  import type { PluginContext, ToolsRecord } from "./types";
8
- import { builtinTools, createBackgroundTools, createCallOmoAgent, createLookAt, createSkillMcpTool, createSkillTool, createGrepTools, createGlobTools, createAstGrepTools, createSessionManagerTools, createDelegateTask, discoverCommandsSync, interactive_bash, createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, createHashlineEditTool } from "../tools";
8
+ import { createBackgroundTools, createCallOmoAgent, createLookAt, createSkillMcpTool, createSkillTool, createGrepTools, createGlobTools, createAstGrepTools, createSessionManagerTools, createDelegateTask, discoverCommandsSync, interactive_bash, createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, createHashlineEditTool } from "../tools";
9
9
  import type { Managers } from "../create-managers";
10
10
  import type { SkillContext } from "./skill-context";
11
11
  type ToolRegistryFactories = {
12
- builtinTools: typeof builtinTools;
13
12
  createBackgroundTools: typeof createBackgroundTools;
14
13
  createCallOmoAgent: typeof createCallOmoAgent;
15
14
  createLookAt: typeof createLookAt;
@@ -6,8 +6,5 @@ export declare function createPluginDispose(args: {
6
6
  skillMcpManager: {
7
7
  disconnectAll: () => Promise<void>;
8
8
  };
9
- lspManager: {
10
- stopAll: () => Promise<void>;
11
- };
12
9
  disposeHooks: () => void;
13
10
  }): PluginDispose;
@@ -25,4 +25,5 @@
25
25
  * (sst/opencode#19127).
26
26
  */
27
27
  export declare function setAgentSortOrder(agentOrder: readonly string[] | undefined): void;
28
+ export declare function setDefaultAgentForSort(agentName: string | undefined): void;
28
29
  export declare function installAgentSortShim(): void;
@@ -0,0 +1,25 @@
1
+ import type { ModelFallbackControllerAccessor } from "../hooks/model-fallback";
2
+ import type { FallbackEntry } from "./model-requirements";
3
+ export type DelegatedChildSessionRetryPart = {
4
+ type: "text";
5
+ text: string;
6
+ };
7
+ export type DelegatedChildSessionBootstrap = {
8
+ retryParts: DelegatedChildSessionRetryPart[];
9
+ fallbackChain?: FallbackEntry[];
10
+ category?: string;
11
+ system?: string;
12
+ tools?: Record<string, boolean>;
13
+ };
14
+ export declare function registerDelegatedChildSessionBootstrap(_args: {
15
+ sessionID: string;
16
+ promptText: string;
17
+ fallbackChain?: FallbackEntry[];
18
+ category?: string;
19
+ system?: string;
20
+ tools?: Record<string, boolean>;
21
+ modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
22
+ }): void;
23
+ export declare function getDelegatedChildSessionBootstrap(_sessionID: string): DelegatedChildSessionBootstrap | undefined;
24
+ export declare function clearDelegatedChildSessionBootstrap(_sessionID: string): void;
25
+ export declare function clearAllDelegatedChildSessionBootstrap(): void;
@@ -1,10 +1,12 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import { type ContextLimitModelCacheState } from "./context-limit-resolver";
3
+ export declare const DEFAULT_CONTEXT_WINDOW_USAGE_FETCH_TIMEOUT_MS = 5000;
3
4
  type ContextWindowUsage = {
4
5
  usedTokens: number;
5
6
  remainingTokens: number;
6
7
  usagePercentage: number;
7
8
  };
9
+ export declare function _setContextWindowUsageFetchTimeoutMsForTesting(ms: number | undefined): void;
8
10
  export declare function invalidateContextWindowUsageCache(ctx: PluginInput, sessionID?: string): void;
9
11
  export interface TruncationResult {
10
12
  result: string;
@@ -0,0 +1,2 @@
1
+ import type { SkillsConfig } from "../config/schema/skills";
2
+ export declare function adaptHostSkillConfig(value: unknown): SkillsConfig | undefined;
@@ -71,7 +71,9 @@ export * from "./plugin-command-discovery";
71
71
  export { SessionCategoryRegistry } from "./session-category-registry";
72
72
  export * from "./plugin-identity";
73
73
  export * from "./log-legacy-plugin-startup-warning";
74
+ export * from "./legacy-workspace-migration";
74
75
  export * from "./task-system-enabled";
75
76
  export * from "./parse-tools-config";
76
77
  export { parseModelString } from "./model-string-parser";
77
78
  export { EXCLUDED_DIRS } from "./excluded-dirs";
79
+ export * from "./replace-tool-args";
@@ -1,4 +1,29 @@
1
1
  export declare const OMO_INTERNAL_INITIATOR_MARKER = "<!-- OMO_INTERNAL_INITIATOR -->";
2
+ export type InternalInitiatorTextPartLike = {
3
+ type?: string;
4
+ text?: string;
5
+ synthetic?: boolean;
6
+ };
7
+ export type InternalInitiatorMessageLike = {
8
+ role?: string;
9
+ info?: {
10
+ role?: string;
11
+ };
12
+ parts?: readonly InternalInitiatorTextPartLike[];
13
+ };
14
+ export declare function hasInternalInitiatorMarker(text: string): boolean;
15
+ export declare function isTextPartLike(part: InternalInitiatorTextPartLike): part is InternalInitiatorTextPartLike & {
16
+ type: "text";
17
+ text: string;
18
+ };
19
+ export declare function isSyntheticOrInternalTextPart(part: InternalInitiatorTextPartLike): boolean;
20
+ export declare function isRealUserTextPart(part: InternalInitiatorTextPartLike): part is InternalInitiatorTextPartLike & {
21
+ type: "text";
22
+ text: string;
23
+ };
24
+ export declare function isSyntheticOrInternalOnlyTextParts(parts: readonly InternalInitiatorTextPartLike[] | undefined): boolean;
25
+ export declare function isSyntheticOrInternalUserMessage(message: InternalInitiatorMessageLike): boolean;
26
+ export declare function isRealUserMessage(message: InternalInitiatorMessageLike): boolean;
2
27
  export declare function stripInternalInitiatorMarkers(text: string): string;
3
28
  export declare function createInternalAgentTextPart(text: string): {
4
29
  type: "text";
@@ -0,0 +1,5 @@
1
+ export type LegacyWorkspaceMigrationResult = {
2
+ migrated: boolean;
3
+ skipped: string[];
4
+ };
5
+ export declare function migrateLegacyWorkspaceDirectory(directory: string): LegacyWorkspaceMigrationResult;
@@ -1,2 +1,14 @@
1
1
  export declare function log(message: string, data?: unknown): void;
2
2
  export declare function getLogFilePath(): string;
3
+ interface LoggerTestOverrides {
4
+ filePath?: string;
5
+ maxSizeBytes?: number;
6
+ maxBackups?: number;
7
+ }
8
+ /** @internal test-only seam */
9
+ export declare function _setLoggerForTesting(overrides: LoggerTestOverrides): void;
10
+ /** @internal test-only seam */
11
+ export declare function _resetLoggerForTesting(): void;
12
+ /** @internal test-only seam: synchronously flush the buffer */
13
+ export declare function _flushForTesting(): void;
14
+ export {};
@@ -2,6 +2,8 @@ import type { FallbackEntry } from "./model-requirements";
2
2
  export interface ErrorInfo {
3
3
  name?: string;
4
4
  message?: string;
5
+ /** HTTP status code from the provider response (e.g., 429 for rate limit) */
6
+ statusCode?: number;
5
7
  }
6
8
  /**
7
9
  * Determines if an error is a retryable model error.
@@ -1,4 +1,7 @@
1
+ import { log as writeLog } from "./logger";
1
2
  import type { FallbackEntry } from "./model-requirements";
3
+ type LogImplementation = typeof writeLog;
4
+ export declare function _setModelResolutionLogImplementationForTesting(logImplementation: LogImplementation | undefined): void;
2
5
  export type ModelResolutionRequest = {
3
6
  intent?: {
4
7
  uiSelectedModel?: string;
@@ -24,3 +27,4 @@ export type ModelResolutionResult = {
24
27
  reason?: string;
25
28
  };
26
29
  export declare function resolveModelPipeline(request: ModelResolutionRequest): ModelResolutionResult | undefined;
30
+ export {};
@@ -1,3 +1,12 @@
1
+ import { getServerBasicAuthHeader as resolveServerBasicAuthHeader } from "./opencode-server-auth";
2
+ import { log as writeLog } from "./logger";
3
+ type FetchImplementation = typeof fetch;
4
+ type LogImplementation = typeof writeLog;
5
+ type ServerBasicAuthHeaderResolver = typeof resolveServerBasicAuthHeader;
6
+ export declare function _setFetchImplementationForTesting(fetchImplementation: FetchImplementation | undefined): void;
7
+ export declare function _setLogImplementationForTesting(logImplementation: LogImplementation | undefined): void;
8
+ export declare function _setServerBasicAuthHeaderResolverForTesting(resolver: ServerBasicAuthHeaderResolver | undefined): void;
1
9
  export declare function getServerBaseUrl(client: unknown): string | null;
2
10
  export declare function patchPart(client: unknown, sessionID: string, messageID: string, partID: string, body: Record<string, unknown>): Promise<boolean>;
3
11
  export declare function deletePart(client: unknown, sessionID: string, messageID: string, partID: string): Promise<boolean>;
12
+ export {};
@@ -0,0 +1,82 @@
1
+ export declare const DEFAULT_PROMPT_ASYNC_POST_DISPATCH_HOLD_MS = 250;
2
+ export declare const DEFAULT_PROMPT_DISPATCH_TIMEOUT_MS = 30000;
3
+ export declare const DEFAULT_PROMPT_GATE_MESSAGES_FETCH_TIMEOUT_MS = 5000;
4
+ type PromptAsyncInput = {
5
+ path?: {
6
+ id?: string;
7
+ };
8
+ body?: unknown;
9
+ query?: unknown;
10
+ signal?: unknown;
11
+ [key: string]: unknown;
12
+ };
13
+ type PromptMessagesQuery = {
14
+ directory: string;
15
+ limit?: number;
16
+ };
17
+ type PromptAsyncClient<TInput> = {
18
+ session?: {
19
+ status?: () => Promise<unknown>;
20
+ messages?: (input: {
21
+ path: {
22
+ id: string;
23
+ };
24
+ query: PromptMessagesQuery;
25
+ }) => Promise<unknown>;
26
+ promptAsync?: (input: TInput) => Promise<unknown>;
27
+ };
28
+ };
29
+ type PromptClient<TInput> = {
30
+ session?: {
31
+ status?: () => Promise<unknown>;
32
+ messages?: (input: {
33
+ path: {
34
+ id: string;
35
+ };
36
+ query: PromptMessagesQuery;
37
+ }) => Promise<unknown>;
38
+ prompt?: (input: TInput) => Promise<unknown>;
39
+ };
40
+ };
41
+ export type InternalPromptDispatchMode = "async" | "sync";
42
+ type InternalPromptDispatchCommonArgs<TInput> = {
43
+ sessionID: string;
44
+ input: TInput;
45
+ source: string;
46
+ settleMs?: number;
47
+ postDispatchHoldMs?: number;
48
+ dispatchTimeoutMs?: number;
49
+ checkStatus?: boolean;
50
+ checkToolState?: boolean;
51
+ };
52
+ export type InternalPromptDispatchArgs<TInput = PromptAsyncInput> = InternalPromptDispatchCommonArgs<TInput> & ({
53
+ mode: "async";
54
+ client: PromptAsyncClient<TInput>;
55
+ } | {
56
+ mode: "sync";
57
+ client: PromptClient<TInput>;
58
+ });
59
+ export type InternalPromptDispatchResult = {
60
+ status: "dispatched";
61
+ response: unknown;
62
+ } | {
63
+ status: "active";
64
+ } | {
65
+ status: "reserved";
66
+ reservedBy: string;
67
+ } | {
68
+ status: "unavailable";
69
+ } | {
70
+ status: "failed";
71
+ error: unknown;
72
+ };
73
+ export type PromptAsyncGateResult = InternalPromptDispatchResult;
74
+ type PromptAsyncReservationReleaseOptions = {
75
+ reservedBy?: string | readonly string[];
76
+ reservedByPrefix?: string | readonly string[];
77
+ };
78
+ export declare function _setPromptGateMessagesFetchTimeoutMsForTesting(value: number | undefined): void;
79
+ export declare function dispatchInternalPrompt<TInput = PromptAsyncInput>(args: InternalPromptDispatchArgs<TInput>): Promise<InternalPromptDispatchResult>;
80
+ export declare function releaseAllPromptAsyncReservationsForTesting(): void;
81
+ export declare function releasePromptAsyncReservation(sessionID: string, source: string, options?: PromptAsyncReservationReleaseOptions): boolean;
82
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Safely replace tool arguments without mutating frozen objects.
3
+ *
4
+ * opencode >=1.14 may freeze `output.args` via Immer before plugin hooks run.
5
+ * Direct property assignment (`output.args.key = value`) or `Object.assign(output.args, patch)`
6
+ * throws `TypeError: Attempted to assign to readonly property` on a frozen object.
7
+ *
8
+ * This helper replaces `output.args` with a shallow clone containing the patch,
9
+ * which works regardless of whether the original args object is frozen.
10
+ */
11
+ export declare function replaceToolArgs(output: {
12
+ args: Record<string, unknown>;
13
+ }, patch: Record<string, unknown>): void;
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_SESSION_IDLE_SETTLE_MS = 150;
2
+ export declare function settleAfterSessionIdle(ms?: number): Promise<void>;
3
+ type SessionStatusClient = {
4
+ session?: {
5
+ status?: () => Promise<unknown>;
6
+ };
7
+ };
8
+ export declare function isActiveSessionStatusType(statusType: string): boolean;
9
+ export declare function isSessionActive(client: SessionStatusClient, sessionID: string): Promise<boolean>;
10
+ export declare function shouldPromptAfterSessionIdle(client: SessionStatusClient, sessionID: string, settleMs?: number): Promise<boolean>;
11
+ export {};
@@ -0,0 +1 @@
1
+ export declare function activateTmuxPane(paneId: string, sessionId: string, serverUrl: string, directory: string): Promise<boolean>;
@@ -1 +1,11 @@
1
+ import type { TmuxCommandResult } from "../runner";
2
+ type CloseTmuxPaneDependencies = {
3
+ readonly isInsideTmux: () => boolean;
4
+ readonly getTmuxPath: () => Promise<string | null | undefined>;
5
+ readonly runTmuxCommand: (tmuxPath: string, args: string[]) => Promise<TmuxCommandResult>;
6
+ readonly log: (message: string, data?: unknown) => void;
7
+ readonly delay: (milliseconds: number) => Promise<void>;
8
+ };
1
9
  export declare function closeTmuxPane(paneId: string): Promise<boolean>;
10
+ export declare function closeTmuxPaneWithDependencies(paneId: string, dependencies: CloseTmuxPaneDependencies): Promise<boolean>;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function buildTmuxAttachCommand(serverUrl: string, sessionId: string, directory?: string): string;
2
+ export declare function buildTmuxPlaceholderCommand(description: string): string;
@@ -1,3 +1,13 @@
1
1
  import type { TmuxConfig } from "../../../config/schema";
2
+ import { getTmuxPath } from "../../../tools/interactive-bash/tmux-path-resolver";
2
3
  import type { SpawnPaneResult } from "../types";
3
- export declare function replaceTmuxPane(paneId: string, sessionId: string, description: string, config: TmuxConfig, serverUrl: string, directory: string): Promise<SpawnPaneResult>;
4
+ import type { runTmuxCommand as RunTmuxCommand } from "../runner";
5
+ import { isInsideTmux } from "./environment";
6
+ type ReplaceTmuxPaneDeps = {
7
+ log: (message: string, data?: unknown) => void;
8
+ runTmuxCommand: typeof RunTmuxCommand;
9
+ isInsideTmux: typeof isInsideTmux;
10
+ getTmuxPath: typeof getTmuxPath;
11
+ };
12
+ export declare function replaceTmuxPane(paneId: string, sessionId: string, description: string, config: TmuxConfig, _serverUrl: string, _directory: string, depsInput?: Partial<ReplaceTmuxPaneDeps>): Promise<SpawnPaneResult>;
13
+ export {};
@@ -12,5 +12,5 @@ type SpawnTmuxPaneDeps = {
12
12
  isServerRunning: typeof isServerRunning;
13
13
  getTmuxPath: typeof getTmuxPath;
14
14
  };
15
- export declare function spawnTmuxPane(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, directory: string, targetPaneId?: string, splitDirection?: SplitDirection, depsInput?: Partial<SpawnTmuxPaneDeps>): Promise<SpawnPaneResult>;
15
+ export declare function spawnTmuxPane(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, _directory: string, targetPaneId?: string, splitDirection?: SplitDirection, depsInput?: Partial<SpawnTmuxPaneDeps>): Promise<SpawnPaneResult>;
16
16
  export {};
@@ -1,3 +1,14 @@
1
+ export type ServerHealthState = {
2
+ serverAvailable: boolean | null;
3
+ serverCheckUrl: string | null;
4
+ serverRunningInProcess: boolean;
5
+ };
6
+ type IsServerRunningOptions = {
7
+ fetchImplementation?: typeof fetch;
8
+ state?: ServerHealthState;
9
+ };
1
10
  export declare function markServerRunningInProcess(): void;
2
- export declare function isServerRunning(serverUrl: string): Promise<boolean>;
11
+ export declare function createServerHealthStateForTesting(): ServerHealthState;
12
+ export declare function isServerRunning(serverUrl: string, options?: IsServerRunningOptions): Promise<boolean>;
3
13
  export declare function resetServerCheck(): void;
14
+ export {};
@@ -11,6 +11,6 @@ type SpawnTmuxSessionDeps = {
11
11
  isServerRunning: typeof isServerRunning;
12
12
  getTmuxPath: typeof getTmuxPath;
13
13
  };
14
- export declare function getIsolatedSessionName(pid?: number): string;
15
- export declare function spawnTmuxSession(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, directory: string, sourcePaneId?: string, depsInput?: Partial<SpawnTmuxSessionDeps>): Promise<SpawnPaneResult>;
14
+ export declare function getIsolatedSessionName(pid?: number, managerId?: string): string;
15
+ export declare function spawnTmuxSession(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, _directory: string, sourcePaneId?: string, depsInput?: Partial<SpawnTmuxSessionDeps>, managerId?: string): Promise<SpawnPaneResult>;
16
16
  export {};
@@ -11,5 +11,5 @@ type SpawnTmuxWindowDeps = {
11
11
  isServerRunning: typeof isServerRunning;
12
12
  getTmuxPath: typeof getTmuxPath;
13
13
  };
14
- export declare function spawnTmuxWindow(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, directory: string, depsInput?: Partial<SpawnTmuxWindowDeps>): Promise<SpawnPaneResult>;
14
+ export declare function spawnTmuxWindow(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, _directory: string, depsInput?: Partial<SpawnTmuxWindowDeps>): Promise<SpawnPaneResult>;
15
15
  export {};
@@ -6,8 +6,10 @@ export type { PaneDimensions } from "./tmux-utils/pane-dimensions";
6
6
  export { spawnTmuxPane } from "./tmux-utils/pane-spawn";
7
7
  export { closeTmuxPane } from "./tmux-utils/pane-close";
8
8
  export { replaceTmuxPane } from "./tmux-utils/pane-replace";
9
+ export { activateTmuxPane } from "./tmux-utils/pane-activate";
9
10
  export { spawnTmuxWindow } from "./tmux-utils/window-spawn";
10
11
  export { spawnTmuxSession, getIsolatedSessionName } from "./tmux-utils/session-spawn";
11
12
  export { killTmuxSessionIfExists } from "./tmux-utils/session-kill";
12
13
  export { sweepStaleOmoAgentSessions, sweepTmuxSessionsWith } from "./tmux-utils/stale-session-sweep";
14
+ export { buildTmuxAttachCommand, buildTmuxPlaceholderCommand } from "./tmux-utils/pane-command";
13
15
  export { applyLayout, enforceMainPaneWidth } from "./tmux-utils/layout";
@@ -0,0 +1,41 @@
1
+ import type { PluginModule } from "@opencode-ai/plugin";
2
+ import { initConfigContext } from "../shared/config-context";
3
+ import { createHooks } from "../create-hooks";
4
+ import { createManagers } from "../create-managers";
5
+ import { createRuntimeTmuxConfig, isTmuxIntegrationEnabled } from "../create-runtime-tmux-config";
6
+ import { createTools } from "../create-tools";
7
+ import { initializeOpenClaw } from "../openclaw";
8
+ import { createPluginInterface } from "../plugin-interface";
9
+ import { loadPluginConfig } from "../plugin-config";
10
+ import { createModelCacheState } from "../plugin-state";
11
+ import { installAgentSortShim, setAgentSortOrder } from "../shared/agent-sort-shim";
12
+ import { detectExternalSkillPlugin, getSkillPluginConflictWarning } from "../shared/external-plugin-detector";
13
+ import { createFirstMessageVariantGate } from "../shared/first-message-variant";
14
+ import { log } from "../shared/logger";
15
+ import { logLegacyPluginStartupWarning } from "../shared/log-legacy-plugin-startup-warning";
16
+ import { migrateLegacyWorkspaceDirectory } from "../shared/legacy-workspace-migration";
17
+ import { injectServerAuthIntoClient } from "../shared/opencode-server-auth";
18
+ import { startBackgroundCheck as startTmuxCheck } from "../tools/interactive-bash";
19
+ export type PluginModuleDeps = {
20
+ initConfigContext: typeof initConfigContext;
21
+ installAgentSortShim: typeof installAgentSortShim;
22
+ setAgentSortOrder: typeof setAgentSortOrder;
23
+ log: typeof log;
24
+ logLegacyPluginStartupWarning: typeof logLegacyPluginStartupWarning;
25
+ migrateLegacyWorkspaceDirectory: typeof migrateLegacyWorkspaceDirectory;
26
+ detectExternalSkillPlugin: typeof detectExternalSkillPlugin;
27
+ getSkillPluginConflictWarning: typeof getSkillPluginConflictWarning;
28
+ injectServerAuthIntoClient: typeof injectServerAuthIntoClient;
29
+ loadPluginConfig: typeof loadPluginConfig;
30
+ initializeOpenClaw: typeof initializeOpenClaw;
31
+ isTmuxIntegrationEnabled: typeof isTmuxIntegrationEnabled;
32
+ startTmuxCheck: typeof startTmuxCheck;
33
+ createFirstMessageVariantGate: typeof createFirstMessageVariantGate;
34
+ createRuntimeTmuxConfig: typeof createRuntimeTmuxConfig;
35
+ createModelCacheState: typeof createModelCacheState;
36
+ createManagers: typeof createManagers;
37
+ createTools: typeof createTools;
38
+ createHooks: typeof createHooks;
39
+ createPluginInterface: typeof createPluginInterface;
40
+ };
41
+ export declare function createPluginModule(overrides?: Partial<PluginModuleDeps>): PluginModule;
@@ -1,3 +1,3 @@
1
- export declare const BACKGROUND_TASK_DESCRIPTION = "Run agent task in background. Returns task_id immediately; notifies on completion.\n\nUse `background_output` to get results. Prompts MUST be in English.";
1
+ export declare const BACKGROUND_TASK_DESCRIPTION = "Run agent task in background. Returns a background task ID (`bg_...`) immediately; notifies on completion.\n\nUse `background_output` to get results. Prompts MUST be in English.";
2
2
  export declare const BACKGROUND_OUTPUT_DESCRIPTION = "Get output from background task. Use full_session=true to fetch session messages with filters. System notifies on completion, so block=true rarely needed. - Timeout values are in milliseconds (ms), NOT seconds.\n\nIMPORTANT: ONLY call this tool AFTER receiving a <system-reminder> notification for the task. Do NOT call immediately after launching a background task - wait for the notification first.";
3
3
  export declare const BACKGROUND_CANCEL_DESCRIPTION = "Cancel running background task(s). Use all=true to cancel ALL before final answer.";
@@ -0,0 +1,7 @@
1
+ export declare const DEFAULT_BACKGROUND_OUTPUT_FETCH_TIMEOUT_MS = 5000;
2
+ export declare function _setBackgroundOutputFetchTimeoutMsForTesting(value: number | undefined): void;
3
+ export declare function getBackgroundOutputFetchTimeoutMs(): number;
4
+ export declare class BackgroundOutputFetchTimeoutError extends Error {
5
+ constructor(timeoutMs: number);
6
+ }
7
+ export declare function withSdkCallTimeout<T>(operation: Promise<T>, timeoutMs: number): Promise<T>;
@@ -1,5 +1,6 @@
1
1
  import type { CallOmoAgentArgs } from "./types";
2
2
  import type { PluginInput } from "@opencode-ai/plugin";
3
+ import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
3
4
  export declare function createOrGetSession(args: CallOmoAgentArgs, toolContext: {
4
5
  sessionID: string;
5
6
  messageID: string;
@@ -9,7 +10,7 @@ export declare function createOrGetSession(args: CallOmoAgentArgs, toolContext:
9
10
  title?: string;
10
11
  metadata?: Record<string, unknown>;
11
12
  }) => void;
12
- }, ctx: PluginInput): Promise<{
13
+ }, ctx: PluginInput, model?: DelegatedModelConfig): Promise<{
13
14
  sessionID: string;
14
15
  isNew: boolean;
15
16
  }>;
@@ -1,10 +1,10 @@
1
- import type { CallOmoAgentArgs } from "./types";
2
1
  import type { PluginInput } from "@opencode-ai/plugin";
3
- import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
4
2
  import type { FallbackEntry } from "../../shared/model-requirements";
3
+ import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
5
4
  import { waitForCompletion } from "./completion-poller";
6
5
  import { processMessages } from "./message-processor";
7
6
  import { createOrGetSession } from "./session-creator";
7
+ import type { CallOmoAgentArgs } from "./types";
8
8
  type ExecuteSyncDeps = {
9
9
  createOrGetSession: typeof createOrGetSession;
10
10
  waitForCompletion: typeof waitForCompletion;
@@ -2,6 +2,7 @@ export type AgentMode = "subagent" | "primary" | "all" | undefined;
2
2
  export type AgentInfo = {
3
3
  name: string;
4
4
  mode?: "subagent" | "primary" | "all";
5
+ hidden?: boolean;
5
6
  model?: string | {
6
7
  providerID: string;
7
8
  modelID: string;
@@ -10,6 +11,7 @@ export type AgentInfo = {
10
11
  export declare function sanitizeSubagentType(subagentType: string): string;
11
12
  export declare function mergeWithClaudeCodeAgents(serverAgents: AgentInfo[], directory: string | undefined): AgentInfo[];
12
13
  export declare function isTaskCallableAgentMode(mode: AgentMode): boolean;
14
+ export declare function isDemotedPlanAgent(agent: AgentInfo): boolean;
13
15
  export declare function findPrimaryAgentMatch(agents: AgentInfo[], requestedAgentName: string): AgentInfo | undefined;
14
16
  export declare function findCallableAgentMatch(agents: AgentInfo[], requestedAgentName: string): AgentInfo | undefined;
15
17
  export declare function listCallableAgentNames(agents: AgentInfo[]): string;
@@ -1,10 +1,11 @@
1
- import type { DelegateTaskArgs, OpencodeClient, DelegatedModelConfig } from "./types";
2
1
  import type { SisyphusAgentConfig } from "../../config/schema";
3
2
  import { promptSyncWithModelSuggestionRetry, promptWithModelSuggestionRetry } from "../../shared/model-suggestion-retry";
3
+ import type { DelegatedModelConfig, DelegateTaskArgs, OpencodeClient } from "./types";
4
4
  type SendSyncPromptDeps = {
5
5
  promptWithModelSuggestionRetry: typeof promptWithModelSuggestionRetry;
6
6
  promptSyncWithModelSuggestionRetry: typeof promptSyncWithModelSuggestionRetry;
7
7
  };
8
+ export declare function buildSyncPromptTools(agentToUse: string): Record<string, boolean>;
8
9
  export declare function sendSyncPrompt(client: OpencodeClient, input: {
9
10
  sessionID: string;
10
11
  agentToUse: string;
@@ -1,9 +1,11 @@
1
1
  import type { OpencodeClient } from "./types";
2
+ import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
2
3
  export declare function createSyncSession(client: OpencodeClient, input: {
3
4
  parentSessionID: string;
4
5
  agentToUse: string;
5
6
  description: string;
6
7
  defaultDirectory: string;
8
+ categoryModel?: DelegatedModelConfig;
7
9
  }): Promise<{
8
10
  ok: true;
9
11
  sessionID: string;
@@ -1,5 +1,5 @@
1
1
  import type { ModelFallbackInfo } from "../../features/task-toast-manager/types";
2
- import type { DelegateTaskArgs, ToolContextWithMetadata, DelegatedModelConfig } from "./types";
3
2
  import type { ExecutorContext, ParentContext } from "./executor-types";
4
3
  import { type SyncTaskDeps } from "./sync-task-deps";
4
+ import type { DelegatedModelConfig, DelegateTaskArgs, ToolContextWithMetadata } from "./types";
5
5
  export declare function executeSyncTask(args: DelegateTaskArgs, ctx: ToolContextWithMetadata, executorCtx: ExecutorContext, parentContext: ParentContext, agentToUse: string, categoryModel: DelegatedModelConfig | undefined, systemContent: string | undefined, modelInfo?: ModelFallbackInfo, fallbackChain?: import("../../shared/model-requirements").FallbackEntry[], deps?: SyncTaskDeps): Promise<string>;
@@ -1,5 +1,3 @@
1
- import { lspManager } from "./lsp";
2
- export { lspManager };
3
1
  export { createAstGrepTools } from "./ast-grep";
4
2
  export { createGrepTools } from "./grep";
5
3
  export { createGlobTools } from "./glob";
@@ -19,4 +17,3 @@ export { createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpda
19
17
  export { createHashlineEditTool } from "./hashline-edit";
20
18
  export { createTeamSendMessageTool } from "../features/team-mode/tools/messaging";
21
19
  export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
22
- export declare const builtinTools: Record<string, ToolDefinition>;
@@ -4,4 +4,9 @@ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
4
4
  * Handles single/double quotes and backslash escapes without external dependencies
5
5
  */
6
6
  export declare function tokenizeCommand(cmd: string): string[];
7
+ type InteractiveBashArgs = {
8
+ tmux_command: string;
9
+ };
10
+ export declare function executeInteractiveBash(args: InteractiveBashArgs): Promise<string>;
7
11
  export declare const interactive_bash: ToolDefinition;
12
+ export {};