oh-my-opencode 3.15.3 → 3.17.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 (86) hide show
  1. package/README.md +2 -0
  2. package/dist/agents/dynamic-agent-core-sections.d.ts +7 -0
  3. package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
  4. package/dist/agents/gpt-apply-patch-guard.d.ts +2 -0
  5. package/dist/agents/hephaestus/gpt-5-3-codex.d.ts +0 -1
  6. package/dist/cli/config-manager/backup-config.d.ts +6 -0
  7. package/dist/cli/config-manager/version-compatibility.d.ts +9 -0
  8. package/dist/cli/config-manager.d.ts +4 -0
  9. package/dist/cli/doctor/checks/system.d.ts +15 -2
  10. package/dist/cli/doctor/constants.d.ts +2 -2
  11. package/dist/cli/index.js +7094 -1270
  12. package/dist/cli/minimum-opencode-version.d.ts +1 -0
  13. package/dist/cli/model-fallback-types.d.ts +3 -0
  14. package/dist/cli/types.d.ts +1 -0
  15. package/dist/create-managers.d.ts +14 -0
  16. package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +5 -2
  17. package/dist/features/boulder-state/storage.d.ts +7 -0
  18. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +1 -1
  19. package/dist/features/claude-code-mcp-loader/env-expander.d.ts +5 -2
  20. package/dist/features/claude-code-plugin-loader/loader.d.ts +15 -0
  21. package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +2 -0
  22. package/dist/features/claude-code-plugin-loader/types.d.ts +11 -0
  23. package/dist/features/claude-code-session-state/state.d.ts +1 -0
  24. package/dist/features/mcp-oauth/provider.d.ts +1 -0
  25. package/dist/features/mcp-oauth/refresh-mutex.d.ts +26 -0
  26. package/dist/features/skill-mcp-manager/connection.d.ts +3 -4
  27. package/dist/features/skill-mcp-manager/error-redaction.d.ts +10 -0
  28. package/dist/features/skill-mcp-manager/http-client.d.ts +17 -3
  29. package/dist/features/skill-mcp-manager/manager.d.ts +2 -3
  30. package/dist/features/skill-mcp-manager/oauth-handler.d.ts +7 -0
  31. package/dist/features/skill-mcp-manager/stdio-client.d.ts +16 -3
  32. package/dist/features/skill-mcp-manager/types.d.ts +19 -7
  33. package/dist/features/tmux-subagent/manager.d.ts +1 -0
  34. package/dist/hooks/atlas/session-last-agent.d.ts +10 -1
  35. package/dist/hooks/atlas/types.d.ts +1 -0
  36. package/dist/hooks/auto-update-checker/constants.d.ts +17 -2
  37. package/dist/hooks/auto-update-checker/hook.d.ts +22 -1
  38. package/dist/hooks/comment-checker/cli-runner.d.ts +4 -1
  39. package/dist/hooks/keyword-detector/hook.d.ts +2 -1
  40. package/dist/hooks/ralph-loop/constants.d.ts +1 -0
  41. package/dist/hooks/ralph-loop/oracle-verification-detector.d.ts +8 -0
  42. package/dist/hooks/read-image-resizer/image-resizer.d.ts +3 -1
  43. package/dist/hooks/read-image-resizer/png-fallback-resizer.d.ts +2 -0
  44. package/dist/hooks/rules-injector/injector.d.ts +12 -0
  45. package/dist/hooks/runtime-fallback/auto-retry-signal.d.ts +4 -0
  46. package/dist/hooks/runtime-fallback/error-classifier.d.ts +1 -5
  47. package/dist/hooks/session-recovery/types.d.ts +2 -0
  48. package/dist/hooks/todo-continuation-enforcer/pending-question-detection.d.ts +1 -1
  49. package/dist/hooks/todo-continuation-enforcer/token-limit-detection.d.ts +4 -0
  50. package/dist/hooks/todo-continuation-enforcer/types.d.ts +7 -0
  51. package/dist/hooks/unstable-agent-babysitter/task-message-analyzer.d.ts +1 -0
  52. package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +2 -0
  53. package/dist/index.js +9071 -1699
  54. package/dist/openclaw/dispatcher.d.ts +3 -12
  55. package/dist/openclaw/reply-listener-discord.d.ts +4 -0
  56. package/dist/openclaw/reply-listener-injection.d.ts +10 -0
  57. package/dist/openclaw/reply-listener-log.d.ts +2 -0
  58. package/dist/openclaw/reply-listener-paths.d.ts +7 -0
  59. package/dist/openclaw/reply-listener-process.d.ts +4 -0
  60. package/dist/openclaw/reply-listener-spawn.d.ts +5 -0
  61. package/dist/openclaw/reply-listener-startup.d.ts +12 -0
  62. package/dist/openclaw/reply-listener-state.d.ts +29 -0
  63. package/dist/openclaw/reply-listener-telegram.d.ts +4 -0
  64. package/dist/openclaw/reply-listener.d.ts +5 -18
  65. package/dist/openclaw/runtime-dispatch.d.ts +17 -0
  66. package/dist/openclaw/types.d.ts +4 -0
  67. package/dist/plugin/chat-params.d.ts +1 -0
  68. package/dist/plugin/command-execute-before.d.ts +3 -1
  69. package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
  70. package/dist/plugin/tool-registry.d.ts +23 -0
  71. package/dist/plugin-handlers/agent-priority-order.d.ts +11 -0
  72. package/dist/shared/agent-display-names.d.ts +14 -2
  73. package/dist/shared/compaction-marker.d.ts +13 -0
  74. package/dist/shared/index.d.ts +1 -0
  75. package/dist/shared/internal-initiator-marker.d.ts +1 -0
  76. package/dist/shared/migration/migrations-sidecar.d.ts +41 -0
  77. package/dist/shared/plugin-identity.d.ts +2 -0
  78. package/dist/shared/posthog-activity-state.d.ts +8 -0
  79. package/dist/shared/posthog.d.ts +14 -0
  80. package/dist/shared/session-prompt-params-state.d.ts +1 -0
  81. package/dist/shared/shell-env.d.ts +6 -2
  82. package/dist/testing/module-mock-lifecycle.d.ts +21 -0
  83. package/dist/tools/background-task/constants.d.ts +1 -1
  84. package/dist/tools/session-manager/tools.d.ts +19 -1
  85. package/package.json +17 -18
  86. package/postinstall.mjs +63 -1
@@ -0,0 +1 @@
1
+ export declare function getUnsupportedOpenCodeVersionMessage(openCodeVersion: string | null): string | null;
@@ -1,3 +1,4 @@
1
+ import type { FallbackModelObject } from "../config/schema/fallback-models";
1
2
  export interface ProviderAvailability {
2
3
  native: {
3
4
  claude: boolean;
@@ -14,10 +15,12 @@ export interface ProviderAvailability {
14
15
  export interface AgentConfig {
15
16
  model: string;
16
17
  variant?: string;
18
+ fallback_models?: FallbackModelObject[];
17
19
  }
18
20
  export interface CategoryConfig {
19
21
  model: string;
20
22
  variant?: string;
23
+ fallback_models?: FallbackModelObject[];
21
24
  }
22
25
  export interface GeneratedOmoConfig {
23
26
  $schema: string;
@@ -30,6 +30,7 @@ export interface ConfigMergeResult {
30
30
  }
31
31
  export interface DetectedConfig {
32
32
  isInstalled: boolean;
33
+ installedVersion: string | null;
33
34
  hasClaude: boolean;
34
35
  isMax20: boolean;
35
36
  hasOpenAI: boolean;
@@ -3,8 +3,20 @@ import type { ModelCacheState } from "./plugin-state";
3
3
  import type { PluginContext, TmuxConfig } from "./plugin/types";
4
4
  import { BackgroundManager } from "./features/background-agent";
5
5
  import { SkillMcpManager } from "./features/skill-mcp-manager";
6
+ import { initTaskToastManager } from "./features/task-toast-manager";
6
7
  import { TmuxSessionManager } from "./features/tmux-subagent";
8
+ import { registerManagerForCleanup } from "./features/background-agent/process-cleanup";
7
9
  import { createConfigHandler } from "./plugin-handlers";
10
+ import { markServerRunningInProcess } from "./shared/tmux/tmux-utils/server-health";
11
+ type CreateManagersDeps = {
12
+ BackgroundManagerClass: typeof BackgroundManager;
13
+ SkillMcpManagerClass: typeof SkillMcpManager;
14
+ TmuxSessionManagerClass: typeof TmuxSessionManager;
15
+ initTaskToastManagerFn: typeof initTaskToastManager;
16
+ registerManagerForCleanupFn: typeof registerManagerForCleanup;
17
+ createConfigHandlerFn: typeof createConfigHandler;
18
+ markServerRunningInProcessFn: typeof markServerRunningInProcess;
19
+ };
8
20
  export type Managers = {
9
21
  tmuxSessionManager: TmuxSessionManager;
10
22
  backgroundManager: BackgroundManager;
@@ -17,4 +29,6 @@ export declare function createManagers(args: {
17
29
  tmuxConfig: TmuxConfig;
18
30
  modelCacheState: ModelCacheState;
19
31
  backgroundNotificationHookEnabled: boolean;
32
+ deps?: Partial<CreateManagersDeps>;
20
33
  }): Managers;
34
+ export {};
@@ -1,5 +1,7 @@
1
1
  import type { StoredMessage } from "../hook-message-injector";
2
+ export { isCompactionAgent } from "../../shared/compaction-marker";
2
3
  type SessionMessage = {
4
+ id?: string;
3
5
  info?: {
4
6
  agent?: string;
5
7
  model?: {
@@ -11,8 +13,9 @@ type SessionMessage = {
11
13
  modelID?: string;
12
14
  tools?: StoredMessage["tools"];
13
15
  };
16
+ parts?: Array<{
17
+ type?: string;
18
+ }>;
14
19
  };
15
- export declare function isCompactionAgent(agent: string | undefined): boolean;
16
20
  export declare function resolvePromptContextFromSessionMessages(messages: SessionMessage[], sessionID?: string): StoredMessage | null;
17
21
  export declare function findNearestMessageExcludingCompaction(messageDir: string, sessionID?: string): StoredMessage | null;
18
- export {};
@@ -25,6 +25,13 @@ export declare function upsertTaskSessionState(directory: string, input: {
25
25
  export declare function findPrometheusPlans(directory: string): string[];
26
26
  /**
27
27
  * Parse a plan file and count checkbox progress.
28
+ *
29
+ * Only top-level (zero-indent) checkboxes under `## TODOs` and
30
+ * `## Final Verification Wave` sections are counted. The checkbox
31
+ * body must carry a valid task label (`N.` for TODOs, `FN.` for
32
+ * Final Verification Wave). Nested acceptance-criteria checkboxes
33
+ * and checkboxes in other sections are intentionally ignored so
34
+ * that progress tracking stays aligned with `readCurrentTopLevelTask`.
28
35
  */
29
36
  export declare function getPlanProgress(planPath: string): PlanProgress;
30
37
  /**
@@ -1,3 +1,3 @@
1
1
  export declare const RALPH_LOOP_TEMPLATE = "You are starting a Ralph Loop - a self-referential development loop that runs until task completion.\n\n## How Ralph Loop Works\n\n1. You will work on the task continuously\n2. When you believe the task is FULLY complete, output: `<promise>{{COMPLETION_PROMISE}}</promise>`\n3. If you don't output the promise, the loop will automatically inject another prompt to continue\n4. Maximum iterations: Configurable (default 100)\n\n## Rules\n\n- Focus on completing the task fully, not partially\n- Don't output the completion promise until the task is truly done\n- Each iteration should make meaningful progress toward the goal\n- If stuck, try different approaches\n- Use todos to track your progress\n\n## Exit Conditions\n\n1. **Completion**: Output your completion promise tag when fully complete\n2. **Max Iterations**: Loop stops automatically at limit\n3. **Cancel**: User runs `/cancel-ralph` command\n\n## Your Task\n\nParse the arguments below and begin working on the task. The format is:\n`\"task description\" [--completion-promise=TEXT] [--max-iterations=N] [--strategy=reset|continue]`\n\nDefault completion promise is \"DONE\" and default max iterations is 100.";
2
- export declare const ULW_LOOP_TEMPLATE = "You are starting an ULTRAWORK Loop - a self-referential development loop that runs until verified completion.\n\n## How ULTRAWORK Loop Works\n\n1. You will work on the task continuously\n2. When you believe the work is complete, output: `<promise>{{COMPLETION_PROMISE}}</promise>`\n3. That does NOT finish the loop yet. The system will require Oracle verification\n4. The loop only ends after the system confirms Oracle verified the result\n5. There is no iteration limit\n\n## Rules\n\n- Focus on finishing the task completely\n- After you emit the completion promise, run Oracle verification when instructed\n- Do not treat DONE as final completion until Oracle verifies it\n\n## Exit Conditions\n\n1. **Verified Completion**: Oracle verifies the result and the system confirms it\n2. **Cancel**: User runs `/cancel-ralph`\n\n## Your Task\n\nParse the arguments below and begin working on the task. The format is:\n`\"task description\" [--completion-promise=TEXT] [--strategy=reset|continue]`\n\nDefault completion promise is \"DONE\".";
2
+ export declare const ULW_LOOP_TEMPLATE = "You are starting an ULTRAWORK Loop - a self-referential development loop that runs until verified completion.\n\n## How ULTRAWORK Loop Works\n\n1. You will work on the task continuously\n2. When you believe the work is complete, output: `<promise>{{COMPLETION_PROMISE}}</promise>`\n3. That does NOT finish the loop yet. The system will require Oracle verification\n4. The loop only ends after the system confirms Oracle verified the result\n5. The iteration limit is 500 for ultrawork mode, 100 for normal mode\n\n## Rules\n\n- Focus on finishing the task completely\n- After you emit the completion promise, run Oracle verification when instructed\n- Do not treat DONE as final completion until Oracle verifies it\n\n## Exit Conditions\n\n1. **Verified Completion**: Oracle verifies the result and the system confirms it\n2. **Cancel**: User runs `/cancel-ralph`\n\n## Your Task\n\nParse the arguments below and begin working on the task. The format is:\n`\"task description\" [--completion-promise=TEXT] [--strategy=reset|continue]`\n\nDefault completion promise is \"DONE\".";
3
3
  export declare const CANCEL_RALPH_TEMPLATE = "Cancel the currently active Ralph Loop.\n\nThis will:\n1. Stop the loop from continuing\n2. Clear the loop state file\n3. Allow the session to end normally\n\nCheck if a loop is active and cancel it. Inform the user of the result.";
@@ -1,2 +1,5 @@
1
- export declare function expandEnvVars(value: string): string;
2
- export declare function expandEnvVarsInObject<T>(obj: T): T;
1
+ export interface ExpandEnvVarsOptions {
2
+ trusted?: boolean;
3
+ }
4
+ export declare function expandEnvVars(value: string, options?: ExpandEnvVarsOptions): string;
5
+ export declare function expandEnvVarsInObject<T>(obj: T, options?: ExpandEnvVarsOptions): T;
@@ -2,6 +2,12 @@ import type { CommandDefinition } from "../claude-code-command-loader/types";
2
2
  import type { McpServerConfig } from "../claude-code-mcp-loader/types";
3
3
  import type { ClaudeCodeAgentConfig } from "../claude-code-agent-loader/types";
4
4
  import type { HooksConfig, LoadedPlugin, PluginLoadError, PluginLoaderOptions } from "./types";
5
+ import { discoverInstalledPlugins } from "./discovery";
6
+ import { loadPluginCommands } from "./command-loader";
7
+ import { loadPluginSkillsAsCommands } from "./skill-loader";
8
+ import { loadPluginAgents } from "./agent-loader";
9
+ import { loadPluginMcpServers } from "./mcp-server-loader";
10
+ import { loadPluginHooksConfigs } from "./hook-loader";
5
11
  export { discoverInstalledPlugins } from "./discovery";
6
12
  export { loadPluginCommands } from "./command-loader";
7
13
  export { loadPluginSkillsAsCommands } from "./skill-loader";
@@ -17,5 +23,14 @@ export interface PluginComponentsResult {
17
23
  plugins: LoadedPlugin[];
18
24
  errors: PluginLoadError[];
19
25
  }
26
+ export interface PluginComponentLoadDeps {
27
+ discoverInstalledPlugins: typeof discoverInstalledPlugins;
28
+ loadPluginCommands: typeof loadPluginCommands;
29
+ loadPluginSkillsAsCommands: typeof loadPluginSkillsAsCommands;
30
+ loadPluginAgents: typeof loadPluginAgents;
31
+ loadPluginMcpServers: typeof loadPluginMcpServers;
32
+ loadPluginHooksConfigs: typeof loadPluginHooksConfigs;
33
+ }
20
34
  export declare function clearPluginComponentsCache(): void;
21
35
  export declare function loadAllPluginComponents(options?: PluginLoaderOptions): Promise<PluginComponentsResult>;
36
+ export declare function loadAllPluginComponentsWithDeps(options: PluginLoaderOptions | undefined, deps: PluginComponentLoadDeps): Promise<PluginComponentsResult>;
@@ -0,0 +1,2 @@
1
+ import type { PluginInstallation } from "./types";
2
+ export declare function shouldLoadPluginForCwd(installation: Pick<PluginInstallation, "scope" | "projectPath">, cwd?: string): boolean;
@@ -16,6 +16,12 @@ export interface PluginInstallation {
16
16
  lastUpdated: string;
17
17
  gitCommitSha?: string;
18
18
  isLocal?: boolean;
19
+ /**
20
+ * Claude Code records this on project/local-scoped installations.
21
+ * Absolute path (or `~`-prefixed) of the project the plugin was installed for.
22
+ * Used to filter project/local plugins that do not belong to the current cwd.
23
+ */
24
+ projectPath?: string;
19
25
  }
20
26
  /**
21
27
  * Installed plugins database v1 (legacy)
@@ -46,6 +52,11 @@ export interface InstalledPluginEntryV3 {
46
52
  installPath: string;
47
53
  lastUpdated: string;
48
54
  gitCommitSha?: string;
55
+ /**
56
+ * Claude Code records this on project/local-scoped installations.
57
+ * Absolute path (or `~`-prefixed) of the project the plugin was installed for.
58
+ */
59
+ projectPath?: string;
49
60
  }
50
61
  /**
51
62
  * Installed plugins database structure
@@ -4,6 +4,7 @@ export declare function setMainSession(id: string | undefined): void;
4
4
  export declare function getMainSessionID(): string | undefined;
5
5
  export declare function registerAgentName(name: string): void;
6
6
  export declare function isAgentRegistered(name: string): boolean;
7
+ export declare function resolveRegisteredAgentName(name: string | undefined): string | undefined;
7
8
  /** @internal For testing only */
8
9
  export declare function _resetForTesting(): void;
9
10
  export declare function setSessionAgent(sessionID: string, agent: string): void;
@@ -25,5 +25,6 @@ export declare class McpOAuthProvider {
25
25
  code: string;
26
26
  }>;
27
27
  login(): Promise<OAuthTokenData>;
28
+ refresh(refreshToken: string): Promise<OAuthTokenData>;
28
29
  }
29
30
  export { generateCodeVerifier, generateCodeChallenge, buildAuthorizationUrl, startCallbackServer };
@@ -0,0 +1,26 @@
1
+ import type { OAuthTokenData } from "./storage";
2
+ /**
3
+ * Execute a token refresh with per-server mutual exclusion.
4
+ *
5
+ * If a refresh is already in progress for the given server, this will
6
+ * return the same promise to all concurrent callers. Once the refresh
7
+ * completes (success or failure), the lock is released.
8
+ *
9
+ * @param serverUrl - The OAuth server URL (used as mutex key)
10
+ * @param refreshFn - The actual refresh operation to execute
11
+ * @returns Promise that resolves to the new token data
12
+ */
13
+ export declare function withRefreshMutex(serverUrl: string, refreshFn: () => Promise<OAuthTokenData>): Promise<OAuthTokenData>;
14
+ /**
15
+ * Check if a refresh is currently in progress for a server.
16
+ *
17
+ * @param serverUrl - The OAuth server URL
18
+ * @returns true if a refresh operation is active
19
+ */
20
+ export declare function isRefreshInProgress(serverUrl: string): boolean;
21
+ /**
22
+ * Get the number of servers currently undergoing token refresh.
23
+ *
24
+ * @returns Number of active refresh operations
25
+ */
26
+ export declare function getActiveRefreshCount(): number;
@@ -1,15 +1,14 @@
1
- import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
1
  import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
3
- import type { SkillMcpClientInfo, SkillMcpManagerState } from "./types";
2
+ import type { McpClient, SkillMcpClientInfo, SkillMcpManagerState } from "./types";
4
3
  export declare function getOrCreateClient(params: {
5
4
  state: SkillMcpManagerState;
6
5
  clientKey: string;
7
6
  info: SkillMcpClientInfo;
8
7
  config: ClaudeCodeMcpServer;
9
- }): Promise<Client>;
8
+ }): Promise<McpClient>;
10
9
  export declare function getOrCreateClientWithRetryImpl(params: {
11
10
  state: SkillMcpManagerState;
12
11
  clientKey: string;
13
12
  info: SkillMcpClientInfo;
14
13
  config: ClaudeCodeMcpServer;
15
- }): Promise<Client>;
14
+ }): Promise<McpClient>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Redacts sensitive tokens from a string.
3
+ * Used for error messages that may contain command-line arguments or environment info.
4
+ */
5
+ export declare function redactSensitiveData(input: string): string;
6
+ /**
7
+ * Redacts sensitive data from an Error object, returning a new Error.
8
+ * Preserves the stack trace but redacts the message.
9
+ */
10
+ export declare function redactErrorSensitiveData(error: Error): Error;
@@ -1,3 +1,17 @@
1
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
- import type { SkillMcpClientConnectionParams } from "./types";
3
- export declare function createHttpClient(params: SkillMcpClientConnectionParams): Promise<Client>;
1
+ import type { McpClient, McpTransport, SkillMcpClientConnectionParams } from "./types";
2
+ type HttpClientFactory = (clientInfo: {
3
+ name: string;
4
+ version: string;
5
+ }, options: {
6
+ capabilities: Record<string, never>;
7
+ }) => McpClient;
8
+ type HttpTransportFactory = (url: URL, options?: {
9
+ requestInit?: RequestInit;
10
+ }) => McpTransport;
11
+ interface HttpClientDependencies {
12
+ createClient: HttpClientFactory;
13
+ createTransport: HttpTransportFactory;
14
+ }
15
+ export declare function setHttpClientDependenciesForTesting(dependencies?: Partial<HttpClientDependencies>): void;
16
+ export declare function createHttpClient(params: SkillMcpClientConnectionParams): Promise<McpClient>;
17
+ export {};
@@ -1,14 +1,13 @@
1
- import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
1
  import type { Prompt, Resource, Tool } from "@modelcontextprotocol/sdk/types.js";
3
2
  import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
4
- import type { OAuthProviderFactory, SkillMcpClientInfo, SkillMcpServerContext } from "./types";
3
+ import type { McpClient, OAuthProviderFactory, SkillMcpClientInfo, SkillMcpServerContext } from "./types";
5
4
  export declare class SkillMcpManager {
6
5
  private readonly state;
7
6
  constructor(options?: {
8
7
  createOAuthProvider?: OAuthProviderFactory;
9
8
  });
10
9
  private getClientKey;
11
- getOrCreateClient(info: SkillMcpClientInfo, config: ClaudeCodeMcpServer): Promise<Client>;
10
+ getOrCreateClient(info: SkillMcpClientInfo, config: ClaudeCodeMcpServer): Promise<McpClient>;
12
11
  disconnectSession(sessionID: string): Promise<void>;
13
12
  disconnectAll(): Promise<void>;
14
13
  listTools(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Tool[]>;
@@ -8,3 +8,10 @@ export declare function handleStepUpIfNeeded(params: {
8
8
  authProviders: Map<string, OAuthProviderLike>;
9
9
  createOAuthProvider?: OAuthProviderFactory;
10
10
  }): Promise<boolean>;
11
+ export declare function handlePostRequestAuthError(params: {
12
+ error: Error;
13
+ config: ClaudeCodeMcpServer;
14
+ authProviders: Map<string, OAuthProviderLike>;
15
+ createOAuthProvider?: OAuthProviderFactory;
16
+ refreshAttempted?: Set<string>;
17
+ }): Promise<boolean>;
@@ -1,3 +1,16 @@
1
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
- import type { SkillMcpClientConnectionParams } from "./types";
3
- export declare function createStdioClient(params: SkillMcpClientConnectionParams): Promise<Client>;
1
+ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
2
+ import type { McpClient, McpTransport, SkillMcpClientConnectionParams } from "./types";
3
+ type StdioClientFactory = (clientInfo: {
4
+ name: string;
5
+ version: string;
6
+ }, options: {
7
+ capabilities: Record<string, never>;
8
+ }) => McpClient;
9
+ type StdioTransportFactory = (options: ConstructorParameters<typeof StdioClientTransport>[0]) => McpTransport;
10
+ interface StdioClientDependencies {
11
+ createClient: StdioClientFactory;
12
+ createTransport: StdioTransportFactory;
13
+ }
14
+ export declare function setStdioClientDependenciesForTesting(dependencies?: Partial<StdioClientDependencies>): void;
15
+ export declare function createStdioClient(params: SkillMcpClientConnectionParams): Promise<McpClient>;
16
+ export {};
@@ -1,13 +1,25 @@
1
1
  import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
- import type { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
3
- import type { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
2
+ import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
4
3
  import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
5
4
  import type { McpOAuthProvider } from "../mcp-oauth/provider";
5
+ import type { SkillScope } from "../opencode-skill-loader/types";
6
6
  export type SkillMcpConfig = Record<string, ClaudeCodeMcpServer>;
7
+ export type McpTransport = Transport;
8
+ export interface McpClient {
9
+ connect: Client["connect"];
10
+ close: Client["close"];
11
+ listTools: Client["listTools"];
12
+ listResources: Client["listResources"];
13
+ listPrompts: Client["listPrompts"];
14
+ callTool: Client["callTool"];
15
+ readResource: Client["readResource"];
16
+ getPrompt: Client["getPrompt"];
17
+ }
7
18
  export interface SkillMcpClientInfo {
8
19
  serverName: string;
9
20
  skillName: string;
10
21
  sessionID: string;
22
+ scope?: SkillScope | "local";
11
23
  }
12
24
  export interface SkillMcpServerContext {
13
25
  config: ClaudeCodeMcpServer;
@@ -20,25 +32,25 @@ export interface SkillMcpServerContext {
20
32
  */
21
33
  export type ConnectionType = "stdio" | "http";
22
34
  export interface ManagedClientBase {
23
- client: Client;
35
+ client: McpClient;
24
36
  skillName: string;
25
37
  lastUsedAt: number;
26
38
  connectionType: ConnectionType;
27
39
  }
28
40
  export interface ManagedStdioClient extends ManagedClientBase {
29
41
  connectionType: "stdio";
30
- transport: StdioClientTransport;
42
+ transport: McpTransport;
31
43
  }
32
44
  export interface ManagedHttpClient extends ManagedClientBase {
33
45
  connectionType: "http";
34
- transport: StreamableHTTPClientTransport;
46
+ transport: McpTransport;
35
47
  }
36
48
  export type ManagedClient = ManagedStdioClient | ManagedHttpClient;
37
49
  export interface ProcessCleanupHandler {
38
50
  signal: NodeJS.Signals;
39
51
  listener: () => void;
40
52
  }
41
- export type OAuthProviderLike = Pick<McpOAuthProvider, "tokens" | "login">;
53
+ export type OAuthProviderLike = Pick<McpOAuthProvider, "tokens" | "login" | "refresh">;
42
54
  export type OAuthProviderFactory = (options: {
43
55
  serverUrl: string;
44
56
  clientId?: string;
@@ -46,7 +58,7 @@ export type OAuthProviderFactory = (options: {
46
58
  }) => OAuthProviderLike;
47
59
  export interface SkillMcpManagerState {
48
60
  clients: Map<string, ManagedClient>;
49
- pendingConnections: Map<string, Promise<Client>>;
61
+ pendingConnections: Map<string, Promise<McpClient>>;
50
62
  disconnectedSessions: Map<string, number>;
51
63
  authProviders: Map<string, McpOAuthProvider>;
52
64
  cleanupRegistered: boolean;
@@ -39,6 +39,7 @@ export declare class TmuxSessionManager {
39
39
  private spawnInIsolatedContainer;
40
40
  private getCapacityConfig;
41
41
  private getSessionMappings;
42
+ getTrackedPaneId(sessionId: string): string | undefined;
42
43
  private removeTrackedSession;
43
44
  private reassignIsolatedContainerAnchor;
44
45
  private cleanupIsolatedContainerAfterSessionDeletion;
@@ -1,3 +1,12 @@
1
+ import { getMessageDir, isSqliteBackend, normalizeSDKResponse } from "../../shared";
2
+ import { hasCompactionPartInStorage, isCompactionMessage } from "../../shared/compaction-marker";
3
+ type SessionLastAgentDeps = {
4
+ getMessageDir: typeof getMessageDir;
5
+ isSqliteBackend: typeof isSqliteBackend;
6
+ normalizeSDKResponse: typeof normalizeSDKResponse;
7
+ hasCompactionPartInStorage: typeof hasCompactionPartInStorage;
8
+ isCompactionMessage: typeof isCompactionMessage;
9
+ };
1
10
  type SessionMessagesClient = {
2
11
  session: {
3
12
  messages: (input: {
@@ -7,5 +16,5 @@ type SessionMessagesClient = {
7
16
  }) => Promise<unknown>;
8
17
  };
9
18
  };
10
- export declare function getLastAgentFromSession(sessionID: string, client?: SessionMessagesClient): Promise<string | null>;
19
+ export declare function getLastAgentFromSession(sessionID: string, client?: SessionMessagesClient, deps?: Partial<SessionLastAgentDeps>): Promise<string | null>;
11
20
  export {};
@@ -4,6 +4,7 @@ import type { TopLevelTaskRef } from "../../features/boulder-state";
4
4
  export type ModelInfo = {
5
5
  providerID: string;
6
6
  modelID: string;
7
+ variant?: string;
7
8
  };
8
9
  export interface AtlasHookOptions {
9
10
  directory: string;
@@ -1,5 +1,15 @@
1
- export declare const PACKAGE_NAME = "oh-my-openagent";
2
- export declare const NPM_REGISTRY_URL = "https://registry.npmjs.org/-/package/oh-my-openagent/dist-tags";
1
+ export declare const PACKAGE_NAME = "oh-my-opencode";
2
+ /**
3
+ * All package names the canonical plugin may be published under.
4
+ *
5
+ * The package is published to npm as both `oh-my-opencode` (legacy canonical)
6
+ * and `oh-my-openagent` (current canonical). Any code that *reads* an
7
+ * installed package.json or walks up from an import path must accept both,
8
+ * because the installed name depends on which package the user added to
9
+ * their config. Code that *writes* continues to use {@link PACKAGE_NAME}.
10
+ */
11
+ export declare const ACCEPTED_PACKAGE_NAMES: readonly ["oh-my-opencode", "oh-my-openagent"];
12
+ export declare const NPM_REGISTRY_URL = "https://registry.npmjs.org/-/package/oh-my-opencode/dist-tags";
3
13
  export declare const NPM_FETCH_TIMEOUT = 5000;
4
14
  export declare const CACHE_ROOT_DIR: string;
5
15
  export declare const CACHE_DIR: string;
@@ -9,3 +19,8 @@ export declare function getUserConfigDir(): string;
9
19
  export declare function getUserOpencodeConfig(): string;
10
20
  export declare function getUserOpencodeConfigJsonc(): string;
11
21
  export declare const INSTALLED_PACKAGE_JSON: string;
22
+ /**
23
+ * Candidate paths where the installed package.json may live, in priority order.
24
+ * Readers should try each path in order and stop on the first success.
25
+ */
26
+ export declare const INSTALLED_PACKAGE_JSON_CANDIDATES: string[];
@@ -1,6 +1,26 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
+ import { log } from "../../shared/logger";
2
3
  import type { AutoUpdateCheckerOptions } from "./types";
3
- export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?: AutoUpdateCheckerOptions): {
4
+ import { getCachedVersion, getLocalDevVersion } from "./checker";
5
+ import { runBackgroundUpdateCheck } from "./hook/background-update-check";
6
+ import { showConfigErrorsIfAny } from "./hook/config-errors-toast";
7
+ import { updateAndShowConnectedProvidersCacheStatus } from "./hook/connected-providers-status";
8
+ import { refreshModelCapabilitiesOnStartup } from "./hook/model-capabilities-status";
9
+ import { showModelCacheWarningIfNeeded } from "./hook/model-cache-warning";
10
+ import { showLocalDevToast, showVersionToast } from "./hook/startup-toasts";
11
+ interface AutoUpdateCheckerDeps {
12
+ getCachedVersion: typeof getCachedVersion;
13
+ getLocalDevVersion: typeof getLocalDevVersion;
14
+ showConfigErrorsIfAny: typeof showConfigErrorsIfAny;
15
+ updateAndShowConnectedProvidersCacheStatus: typeof updateAndShowConnectedProvidersCacheStatus;
16
+ refreshModelCapabilitiesOnStartup: typeof refreshModelCapabilitiesOnStartup;
17
+ showModelCacheWarningIfNeeded: typeof showModelCacheWarningIfNeeded;
18
+ showLocalDevToast: typeof showLocalDevToast;
19
+ showVersionToast: typeof showVersionToast;
20
+ runBackgroundUpdateCheck: typeof runBackgroundUpdateCheck;
21
+ log: typeof log;
22
+ }
23
+ export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?: AutoUpdateCheckerOptions, deps?: AutoUpdateCheckerDeps): {
4
24
  event: ({ event }: {
5
25
  event: {
6
26
  type: string;
@@ -8,3 +28,4 @@ export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?:
8
28
  };
9
29
  }) => void;
10
30
  };
31
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { PendingCall } from "./types";
2
+ import { runCommentChecker } from "./cli";
2
3
  export declare function initializeCommentCheckerCli(debugLog: (...args: unknown[]) => void): void;
3
4
  export declare function getCommentCheckerCliPathPromise(): Promise<string | null> | null;
4
5
  export declare function processWithCli(input: {
@@ -7,7 +8,9 @@ export declare function processWithCli(input: {
7
8
  callID: string;
8
9
  }, pendingCall: PendingCall, output: {
9
10
  output: string;
10
- }, cliPath: string, customPrompt: string | undefined, debugLog: (...args: unknown[]) => void): Promise<void>;
11
+ }, cliPath: string, customPrompt: string | undefined, debugLog: (...args: unknown[]) => void, deps?: {
12
+ runCommentChecker?: typeof runCommentChecker;
13
+ }): Promise<void>;
11
14
  export interface ApplyPatchEdit {
12
15
  filePath: string;
13
16
  before: string;
@@ -1,6 +1,7 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { ContextCollector } from "../../features/context-injector";
3
- export declare function createKeywordDetectorHook(ctx: PluginInput, _collector?: ContextCollector): {
3
+ import type { RalphLoopHook } from "../ralph-loop";
4
+ export declare function createKeywordDetectorHook(ctx: PluginInput, _collector?: ContextCollector, _ralphLoop?: Pick<RalphLoopHook, "startLoop">): {
4
5
  "chat.message": (input: {
5
6
  sessionID: string;
6
7
  agent?: string;
@@ -2,5 +2,6 @@ export declare const HOOK_NAME = "ralph-loop";
2
2
  export declare const DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md";
3
3
  export declare const COMPLETION_TAG_PATTERN: RegExp;
4
4
  export declare const DEFAULT_MAX_ITERATIONS = 100;
5
+ export declare const ULTRAWORK_MAX_ITERATIONS = 500;
5
6
  export declare const DEFAULT_COMPLETION_PROMISE = "DONE";
6
7
  export declare const ULTRAWORK_VERIFICATION_PROMISE = "VERIFIED";
@@ -0,0 +1,8 @@
1
+ export interface OracleVerificationEvidence {
2
+ agent: string;
3
+ promise: string;
4
+ sessionID?: string;
5
+ }
6
+ export declare function parseOracleVerificationEvidence(text: string): OracleVerificationEvidence | undefined;
7
+ export declare function isOracleVerified(text: string): boolean;
8
+ export declare function extractOracleSessionID(text: string): string | undefined;
@@ -1,3 +1,5 @@
1
1
  import type { ImageDimensions, ResizeResult } from "./types";
2
2
  export declare function calculateTargetDimensions(width: number, height: number, maxLongEdge?: number): ImageDimensions | null;
3
- export declare function resizeImage(base64DataUrl: string, mimeType: string, target: ImageDimensions): Promise<ResizeResult | null>;
3
+ export declare function resizeImage(base64DataUrl: string, mimeType: string, target: ImageDimensions, deps?: {
4
+ loadSharpModule?: () => Promise<unknown | null>;
5
+ }): Promise<ResizeResult | null>;
@@ -0,0 +1,2 @@
1
+ import type { ImageDimensions, ResizeResult } from "./types";
2
+ export declare function resizeImageFallback(base64DataUrl: string, mimeType: string, target: ImageDimensions): ResizeResult | null;
@@ -1,4 +1,8 @@
1
+ import { readFileSync, statSync } from "node:fs";
2
+ import { homedir } from "node:os";
1
3
  import type { FindRuleFilesOptions } from "./rule-file-finder";
4
+ import { createContentHash, isDuplicateByContentHash, isDuplicateByRealPath, shouldApplyRule } from "./matcher";
5
+ import { saveInjectedRules } from "./storage";
2
6
  import type { SessionInjectedRulesCache } from "./cache";
3
7
  type ToolExecuteOutput = {
4
8
  title: string;
@@ -16,6 +20,14 @@ export declare function createRuleInjectionProcessor(deps: {
16
20
  truncator: DynamicTruncator;
17
21
  getSessionCache: (sessionID: string) => SessionInjectedRulesCache;
18
22
  ruleFinderOptions?: FindRuleFilesOptions;
23
+ readFileSync?: typeof readFileSync;
24
+ statSync?: typeof statSync;
25
+ homedir?: typeof homedir;
26
+ shouldApplyRule?: typeof shouldApplyRule;
27
+ isDuplicateByRealPath?: typeof isDuplicateByRealPath;
28
+ createContentHash?: typeof createContentHash;
29
+ isDuplicateByContentHash?: typeof isDuplicateByContentHash;
30
+ saveInjectedRules?: typeof saveInjectedRules;
19
31
  }): {
20
32
  processFilePathForInjection: (filePath: string, sessionID: string, output: ToolExecuteOutput) => Promise<void>;
21
33
  };
@@ -0,0 +1,4 @@
1
+ export interface AutoRetrySignal {
2
+ signal: string;
3
+ }
4
+ export declare function extractAutoRetrySignal(info: Record<string, unknown> | undefined): AutoRetrySignal | undefined;
@@ -1,12 +1,8 @@
1
+ export { extractAutoRetrySignal } from "./auto-retry-signal";
1
2
  export declare function getErrorMessage(error: unknown): string;
2
3
  export declare function extractStatusCode(error: unknown, retryOnErrors?: number[]): number | undefined;
3
4
  export declare function extractErrorName(error: unknown): string | undefined;
4
5
  export declare function classifyErrorType(error: unknown): string | undefined;
5
- export interface AutoRetrySignal {
6
- signal: string;
7
- }
8
- export declare const AUTO_RETRY_PATTERNS: Array<(combined: string) => boolean>;
9
- export declare function extractAutoRetrySignal(info: Record<string, unknown> | undefined): AutoRetrySignal | undefined;
10
6
  export declare function containsErrorContent(parts: Array<{
11
7
  type?: string;
12
8
  text?: string;
@@ -66,6 +66,7 @@ export interface MessageData {
66
66
  model?: {
67
67
  providerID: string;
68
68
  modelID: string;
69
+ variant?: string;
69
70
  };
70
71
  system?: string;
71
72
  tools?: Record<string, boolean>;
@@ -86,6 +87,7 @@ export interface ResumeConfig {
86
87
  model?: {
87
88
  providerID: string;
88
89
  modelID: string;
90
+ variant?: string;
89
91
  };
90
92
  tools?: Record<string, boolean>;
91
93
  }
@@ -1,5 +1,5 @@
1
1
  interface MessagePart {
2
- type: string;
2
+ type?: string;
3
3
  name?: string;
4
4
  toolName?: string;
5
5
  }
@@ -0,0 +1,4 @@
1
+ export declare function isTokenLimitError(error: {
2
+ name?: string;
3
+ message?: string;
4
+ } | undefined): boolean;