oh-my-opencode 3.16.0 → 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 (46) hide show
  1. package/README.md +2 -0
  2. package/dist/agents/gpt-apply-patch-guard.d.ts +2 -0
  3. package/dist/agents/hephaestus/gpt-5-3-codex.d.ts +0 -1
  4. package/dist/cli/doctor/checks/system.d.ts +15 -2
  5. package/dist/cli/doctor/constants.d.ts +1 -1
  6. package/dist/cli/index.js +5838 -902
  7. package/dist/features/skill-mcp-manager/connection.d.ts +3 -4
  8. package/dist/features/skill-mcp-manager/http-client.d.ts +17 -3
  9. package/dist/features/skill-mcp-manager/manager.d.ts +2 -3
  10. package/dist/features/skill-mcp-manager/stdio-client.d.ts +16 -3
  11. package/dist/features/skill-mcp-manager/types.d.ts +16 -6
  12. package/dist/features/tmux-subagent/manager.d.ts +1 -0
  13. package/dist/hooks/atlas/session-last-agent.d.ts +10 -1
  14. package/dist/hooks/auto-update-checker/constants.d.ts +15 -0
  15. package/dist/hooks/auto-update-checker/hook.d.ts +22 -1
  16. package/dist/hooks/comment-checker/cli-runner.d.ts +4 -1
  17. package/dist/hooks/keyword-detector/hook.d.ts +1 -1
  18. package/dist/hooks/read-image-resizer/image-resizer.d.ts +3 -1
  19. package/dist/hooks/rules-injector/injector.d.ts +12 -0
  20. package/dist/index.js +7578 -1143
  21. package/dist/openclaw/dispatcher.d.ts +3 -12
  22. package/dist/openclaw/reply-listener-discord.d.ts +4 -0
  23. package/dist/openclaw/reply-listener-injection.d.ts +10 -0
  24. package/dist/openclaw/reply-listener-log.d.ts +2 -0
  25. package/dist/openclaw/reply-listener-paths.d.ts +7 -0
  26. package/dist/openclaw/reply-listener-process.d.ts +4 -0
  27. package/dist/openclaw/reply-listener-spawn.d.ts +5 -0
  28. package/dist/openclaw/reply-listener-startup.d.ts +12 -0
  29. package/dist/openclaw/reply-listener-state.d.ts +29 -0
  30. package/dist/openclaw/reply-listener-telegram.d.ts +4 -0
  31. package/dist/openclaw/reply-listener.d.ts +5 -18
  32. package/dist/openclaw/runtime-dispatch.d.ts +17 -0
  33. package/dist/openclaw/types.d.ts +4 -0
  34. package/dist/plugin/command-execute-before.d.ts +3 -1
  35. package/dist/plugin/tool-registry.d.ts +23 -0
  36. package/dist/plugin-handlers/agent-priority-order.d.ts +11 -0
  37. package/dist/shared/agent-display-names.d.ts +5 -0
  38. package/dist/shared/compaction-marker.d.ts +1 -0
  39. package/dist/shared/migration/migrations-sidecar.d.ts +41 -0
  40. package/dist/shared/plugin-identity.d.ts +2 -0
  41. package/dist/shared/posthog-activity-state.d.ts +8 -0
  42. package/dist/shared/posthog.d.ts +14 -0
  43. package/dist/shared/shell-env.d.ts +6 -2
  44. package/dist/testing/module-mock-lifecycle.d.ts +21 -0
  45. package/dist/tools/session-manager/tools.d.ts +19 -1
  46. package/package.json +13 -12
@@ -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>;
@@ -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[]>;
@@ -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,10 +1,20 @@
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";
6
5
  import type { SkillScope } from "../opencode-skill-loader/types";
7
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
+ }
8
18
  export interface SkillMcpClientInfo {
9
19
  serverName: string;
10
20
  skillName: string;
@@ -22,18 +32,18 @@ export interface SkillMcpServerContext {
22
32
  */
23
33
  export type ConnectionType = "stdio" | "http";
24
34
  export interface ManagedClientBase {
25
- client: Client;
35
+ client: McpClient;
26
36
  skillName: string;
27
37
  lastUsedAt: number;
28
38
  connectionType: ConnectionType;
29
39
  }
30
40
  export interface ManagedStdioClient extends ManagedClientBase {
31
41
  connectionType: "stdio";
32
- transport: StdioClientTransport;
42
+ transport: McpTransport;
33
43
  }
34
44
  export interface ManagedHttpClient extends ManagedClientBase {
35
45
  connectionType: "http";
36
- transport: StreamableHTTPClientTransport;
46
+ transport: McpTransport;
37
47
  }
38
48
  export type ManagedClient = ManagedStdioClient | ManagedHttpClient;
39
49
  export interface ProcessCleanupHandler {
@@ -48,7 +58,7 @@ export type OAuthProviderFactory = (options: {
48
58
  }) => OAuthProviderLike;
49
59
  export interface SkillMcpManagerState {
50
60
  clients: Map<string, ManagedClient>;
51
- pendingConnections: Map<string, Promise<Client>>;
61
+ pendingConnections: Map<string, Promise<McpClient>>;
52
62
  disconnectedSessions: Map<string, number>;
53
63
  authProviders: Map<string, McpOAuthProvider>;
54
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 {};
@@ -1,4 +1,14 @@
1
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"];
2
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;
@@ -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,7 +1,7 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { ContextCollector } from "../../features/context-injector";
3
3
  import type { RalphLoopHook } from "../ralph-loop";
4
- export declare function createKeywordDetectorHook(ctx: PluginInput, _collector?: ContextCollector, ralphLoop?: Pick<RalphLoopHook, "startLoop">): {
4
+ export declare function createKeywordDetectorHook(ctx: PluginInput, _collector?: ContextCollector, _ralphLoop?: Pick<RalphLoopHook, "startLoop">): {
5
5
  "chat.message": (input: {
6
6
  sessionID: string;
7
7
  agent?: string;
@@ -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>;
@@ -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
  };