oh-my-opencode 2.9.1 → 2.11.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 (55) hide show
  1. package/README.ja.md +10 -0
  2. package/README.ko.md +10 -0
  3. package/README.md +46 -0
  4. package/README.zh-cn.md +10 -0
  5. package/dist/agents/utils.d.ts +7 -1
  6. package/dist/cli/doctor/checks/gh.d.ts +13 -0
  7. package/dist/cli/doctor/checks/gh.test.d.ts +1 -0
  8. package/dist/cli/doctor/checks/index.d.ts +1 -0
  9. package/dist/cli/doctor/constants.d.ts +1 -0
  10. package/dist/cli/index.js +3192 -360
  11. package/dist/config/schema.d.ts +174 -165
  12. package/dist/features/builtin-skills/types.d.ts +2 -0
  13. package/dist/features/claude-code-command-loader/types.d.ts +19 -0
  14. package/dist/features/claude-code-mcp-loader/loader.d.ts +1 -0
  15. package/dist/features/claude-code-mcp-loader/loader.test.d.ts +1 -0
  16. package/dist/features/opencode-skill-loader/loader.test.d.ts +1 -0
  17. package/dist/features/opencode-skill-loader/types.d.ts +3 -0
  18. package/dist/features/skill-mcp-manager/index.d.ts +2 -0
  19. package/dist/features/skill-mcp-manager/manager.d.ts +21 -0
  20. package/dist/features/skill-mcp-manager/manager.test.d.ts +1 -0
  21. package/dist/features/skill-mcp-manager/types.d.ts +11 -0
  22. package/dist/google-auth.js +3 -3
  23. package/dist/hooks/anthropic-context-window-limit-recovery/storage.test.d.ts +1 -0
  24. package/dist/hooks/auto-slash-command/constants.d.ts +5 -0
  25. package/dist/hooks/auto-slash-command/detector.d.ts +9 -0
  26. package/dist/hooks/auto-slash-command/detector.test.d.ts +1 -0
  27. package/dist/hooks/auto-slash-command/executor.d.ts +7 -0
  28. package/dist/hooks/auto-slash-command/index.d.ts +8 -0
  29. package/dist/hooks/auto-slash-command/index.test.d.ts +1 -0
  30. package/dist/hooks/auto-slash-command/types.d.ts +27 -0
  31. package/dist/hooks/auto-update-checker/constants.d.ts +4 -0
  32. package/dist/hooks/index.d.ts +1 -0
  33. package/dist/hooks/keyword-detector/detector.d.ts +5 -0
  34. package/dist/hooks/keyword-detector/index.d.ts +2 -1
  35. package/dist/hooks/rules-injector/constants.d.ts +2 -0
  36. package/dist/hooks/rules-injector/finder.d.ts +1 -13
  37. package/dist/hooks/rules-injector/finder.test.d.ts +1 -0
  38. package/dist/hooks/rules-injector/parser.test.d.ts +1 -0
  39. package/dist/hooks/rules-injector/types.d.ts +13 -0
  40. package/dist/index.js +30596 -17457
  41. package/dist/plugin-config.d.ts +4 -0
  42. package/dist/plugin-handlers/config-handler.d.ts +10 -0
  43. package/dist/plugin-handlers/index.d.ts +1 -0
  44. package/dist/plugin-state.d.ts +6 -0
  45. package/dist/shared/frontmatter.d.ts +2 -2
  46. package/dist/shared/frontmatter.test.d.ts +1 -0
  47. package/dist/tools/index.d.ts +1 -0
  48. package/dist/tools/skill/tools.test.d.ts +1 -0
  49. package/dist/tools/skill/types.d.ts +5 -0
  50. package/dist/tools/skill-mcp/constants.d.ts +2 -0
  51. package/dist/tools/skill-mcp/index.d.ts +3 -0
  52. package/dist/tools/skill-mcp/tools.d.ts +11 -0
  53. package/dist/tools/skill-mcp/tools.test.d.ts +1 -0
  54. package/dist/tools/skill-mcp/types.d.ts +8 -0
  55. package/package.json +4 -1
@@ -1,3 +1,4 @@
1
+ import type { SkillMcpConfig } from "../skill-mcp-manager/types";
1
2
  export interface BuiltinSkill {
2
3
  name: string;
3
4
  description: string;
@@ -10,4 +11,5 @@ export interface BuiltinSkill {
10
11
  model?: string;
11
12
  subtask?: boolean;
12
13
  argumentHint?: string;
14
+ mcpConfig?: SkillMcpConfig;
13
15
  }
@@ -1,4 +1,19 @@
1
1
  export type CommandScope = "user" | "project" | "opencode" | "opencode-project";
2
+ /**
3
+ * Handoff definition for command workflows.
4
+ * Based on speckit's handoff pattern for multi-agent orchestration.
5
+ * @see https://github.com/github/spec-kit
6
+ */
7
+ export interface HandoffDefinition {
8
+ /** Human-readable label for the handoff action */
9
+ label: string;
10
+ /** Target agent/command identifier (e.g., "speckit.tasks") */
11
+ agent: string;
12
+ /** Pre-filled prompt text for the handoff */
13
+ prompt: string;
14
+ /** If true, automatically executes after command completion; if false, shows as suggestion */
15
+ send?: boolean;
16
+ }
2
17
  export interface CommandDefinition {
3
18
  name: string;
4
19
  description?: string;
@@ -7,6 +22,8 @@ export interface CommandDefinition {
7
22
  model?: string;
8
23
  subtask?: boolean;
9
24
  argumentHint?: string;
25
+ /** Handoff definitions for workflow transitions */
26
+ handoffs?: HandoffDefinition[];
10
27
  }
11
28
  export interface CommandFrontmatter {
12
29
  description?: string;
@@ -14,6 +31,8 @@ export interface CommandFrontmatter {
14
31
  agent?: string;
15
32
  model?: string;
16
33
  subtask?: boolean;
34
+ /** Handoff definitions for workflow transitions */
35
+ handoffs?: HandoffDefinition[];
17
36
  }
18
37
  export interface LoadedCommand {
19
38
  name: string;
@@ -1,3 +1,4 @@
1
1
  import type { LoadedMcpServer, McpLoadResult } from "./types";
2
+ export declare function getSystemMcpServerNames(): Set<string>;
2
3
  export declare function loadMcpConfigs(): Promise<McpLoadResult>;
3
4
  export declare function formatLoadedServersForToast(loadedServers: LoadedMcpServer[]): string;
@@ -1,4 +1,5 @@
1
1
  import type { CommandDefinition } from "../claude-code-command-loader/types";
2
+ import type { SkillMcpConfig } from "../skill-mcp-manager/types";
2
3
  export type SkillScope = "builtin" | "config" | "user" | "project" | "opencode" | "opencode-project";
3
4
  export interface SkillMetadata {
4
5
  name?: string;
@@ -11,6 +12,7 @@ export interface SkillMetadata {
11
12
  compatibility?: string;
12
13
  metadata?: Record<string, string>;
13
14
  "allowed-tools"?: string;
15
+ mcp?: SkillMcpConfig;
14
16
  }
15
17
  export interface LoadedSkill {
16
18
  name: string;
@@ -22,4 +24,5 @@ export interface LoadedSkill {
22
24
  compatibility?: string;
23
25
  metadata?: Record<string, string>;
24
26
  allowedTools?: string[];
27
+ mcpConfig?: SkillMcpConfig;
25
28
  }
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export { SkillMcpManager } from "./manager";
@@ -0,0 +1,21 @@
1
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
+ import type { Tool, Resource, Prompt } from "@modelcontextprotocol/sdk/types.js";
3
+ import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
4
+ import type { SkillMcpClientInfo, SkillMcpServerContext } from "./types";
5
+ export declare class SkillMcpManager {
6
+ private clients;
7
+ private getClientKey;
8
+ getOrCreateClient(info: SkillMcpClientInfo, config: ClaudeCodeMcpServer): Promise<Client>;
9
+ private createClient;
10
+ disconnectSession(sessionID: string): Promise<void>;
11
+ disconnectAll(): Promise<void>;
12
+ listTools(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Tool[]>;
13
+ listResources(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Resource[]>;
14
+ listPrompts(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Prompt[]>;
15
+ callTool(info: SkillMcpClientInfo, context: SkillMcpServerContext, name: string, args: Record<string, unknown>): Promise<unknown>;
16
+ readResource(info: SkillMcpClientInfo, context: SkillMcpServerContext, uri: string): Promise<unknown>;
17
+ getPrompt(info: SkillMcpClientInfo, context: SkillMcpServerContext, name: string, args: Record<string, string>): Promise<unknown>;
18
+ private getOrCreateClientWithRetry;
19
+ getConnectedServers(): string[];
20
+ isConnected(info: SkillMcpClientInfo): boolean;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
2
+ export type SkillMcpConfig = Record<string, ClaudeCodeMcpServer>;
3
+ export interface SkillMcpClientInfo {
4
+ serverName: string;
5
+ skillName: string;
6
+ sessionID: string;
7
+ }
8
+ export interface SkillMcpServerContext {
9
+ config: ClaudeCodeMcpServer;
10
+ skillName: string;
11
+ }
@@ -59,12 +59,12 @@ var GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
59
59
  var GOOGLE_USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo";
60
60
  var ANTIGRAVITY_TOKEN_REFRESH_BUFFER_MS = 60000;
61
61
  var SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator";
62
- // node_modules/jose/dist/browser/lib/buffer_utils.js
62
+ // node_modules/@openauthjs/openauth/node_modules/jose/dist/browser/lib/buffer_utils.js
63
63
  var encoder = new TextEncoder;
64
64
  var decoder = new TextDecoder;
65
65
  var MAX_INT32 = 2 ** 32;
66
66
 
67
- // node_modules/jose/dist/browser/runtime/base64url.js
67
+ // node_modules/@openauthjs/openauth/node_modules/jose/dist/browser/runtime/base64url.js
68
68
  var encodeBase64 = (input) => {
69
69
  let unencoded = input;
70
70
  if (typeof unencoded === "string") {
@@ -101,7 +101,7 @@ var decode = (input) => {
101
101
  }
102
102
  };
103
103
 
104
- // node_modules/jose/dist/browser/util/base64url.js
104
+ // node_modules/@openauthjs/openauth/node_modules/jose/dist/browser/util/base64url.js
105
105
  var exports_base64url = {};
106
106
  __export(exports_base64url, {
107
107
  encode: () => encode2,
@@ -0,0 +1,5 @@
1
+ export declare const HOOK_NAME: "auto-slash-command";
2
+ export declare const AUTO_SLASH_COMMAND_TAG_OPEN = "<auto-slash-command>";
3
+ export declare const AUTO_SLASH_COMMAND_TAG_CLOSE = "</auto-slash-command>";
4
+ export declare const SLASH_COMMAND_PATTERN: RegExp;
5
+ export declare const EXCLUDED_COMMANDS: Set<string>;
@@ -0,0 +1,9 @@
1
+ import type { ParsedSlashCommand } from "./types";
2
+ export declare function removeCodeBlocks(text: string): string;
3
+ export declare function parseSlashCommand(text: string): ParsedSlashCommand | null;
4
+ export declare function isExcludedCommand(command: string): boolean;
5
+ export declare function detectSlashCommand(text: string): ParsedSlashCommand | null;
6
+ export declare function extractPromptText(parts: Array<{
7
+ type: string;
8
+ text?: string;
9
+ }>): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { ParsedSlashCommand } from "./types";
2
+ export interface ExecuteResult {
3
+ success: boolean;
4
+ replacementText?: string;
5
+ error?: string;
6
+ }
7
+ export declare function executeSlashCommand(parsed: ParsedSlashCommand): Promise<ExecuteResult>;
@@ -0,0 +1,8 @@
1
+ import type { AutoSlashCommandHookInput, AutoSlashCommandHookOutput } from "./types";
2
+ export * from "./detector";
3
+ export * from "./executor";
4
+ export * from "./constants";
5
+ export * from "./types";
6
+ export declare function createAutoSlashCommandHook(): {
7
+ "chat.message": (input: AutoSlashCommandHookInput, output: AutoSlashCommandHookOutput) => Promise<void>;
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ export interface AutoSlashCommandHookInput {
2
+ sessionID: string;
3
+ agent?: string;
4
+ model?: {
5
+ providerID: string;
6
+ modelID: string;
7
+ };
8
+ messageID?: string;
9
+ }
10
+ export interface AutoSlashCommandHookOutput {
11
+ message: Record<string, unknown>;
12
+ parts: Array<{
13
+ type: string;
14
+ text?: string;
15
+ [key: string]: unknown;
16
+ }>;
17
+ }
18
+ export interface ParsedSlashCommand {
19
+ command: string;
20
+ args: string;
21
+ raw: string;
22
+ }
23
+ export interface AutoSlashCommandResult {
24
+ detected: boolean;
25
+ parsedCommand?: ParsedSlashCommand;
26
+ injectedMessage?: string;
27
+ }
@@ -4,6 +4,10 @@ export declare const NPM_FETCH_TIMEOUT = 5000;
4
4
  export declare const CACHE_DIR: string;
5
5
  export declare const VERSION_FILE: string;
6
6
  export declare const INSTALLED_PACKAGE_JSON: string;
7
+ /**
8
+ * Get the Windows-specific APPDATA directory (for fallback checks)
9
+ */
10
+ export declare function getWindowsAppdataDir(): string | null;
7
11
  export declare const USER_CONFIG_DIR: string;
8
12
  export declare const USER_OPENCODE_CONFIG: string;
9
13
  export declare const USER_OPENCODE_CONFIG_JSONC: string;
@@ -22,3 +22,4 @@ export { createInteractiveBashSessionHook } from "./interactive-bash-session";
22
22
  export { createEmptyMessageSanitizerHook } from "./empty-message-sanitizer";
23
23
  export { createThinkingBlockValidatorHook } from "./thinking-block-validator";
24
24
  export { createRalphLoopHook, type RalphLoopHook } from "./ralph-loop";
25
+ export { createAutoSlashCommandHook } from "./auto-slash-command";
@@ -1,5 +1,10 @@
1
+ export interface DetectedKeyword {
2
+ type: "ultrawork" | "search" | "analyze";
3
+ message: string;
4
+ }
1
5
  export declare function removeCodeBlocks(text: string): string;
2
6
  export declare function detectKeywords(text: string): string[];
7
+ export declare function detectKeywordsWithType(text: string): DetectedKeyword[];
3
8
  export declare function extractPromptText(parts: Array<{
4
9
  type: string;
5
10
  text?: string;
@@ -1,7 +1,8 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
1
2
  export * from "./detector";
2
3
  export * from "./constants";
3
4
  export * from "./types";
4
- export declare function createKeywordDetectorHook(): {
5
+ export declare function createKeywordDetectorHook(ctx: PluginInput): {
5
6
  "chat.message": (input: {
6
7
  sessionID: string;
7
8
  agent?: string;
@@ -2,5 +2,7 @@ export declare const OPENCODE_STORAGE: string;
2
2
  export declare const RULES_INJECTOR_STORAGE: string;
3
3
  export declare const PROJECT_MARKERS: string[];
4
4
  export declare const PROJECT_RULE_SUBDIRS: [string, string][];
5
+ export declare const PROJECT_RULE_FILES: string[];
6
+ export declare const GITHUB_INSTRUCTIONS_PATTERN: RegExp;
5
7
  export declare const USER_RULE_DIR = ".claude/rules";
6
8
  export declare const RULE_EXTENSIONS: string[];
@@ -1,16 +1,4 @@
1
- /**
2
- * Candidate rule file with metadata for filtering and sorting
3
- */
4
- export interface RuleFileCandidate {
5
- /** Absolute path to the rule file */
6
- path: string;
7
- /** Real path after symlink resolution (for duplicate detection) */
8
- realPath: string;
9
- /** Whether this is a global/user-level rule */
10
- isGlobal: boolean;
11
- /** Directory distance from current file (9999 for global rules) */
12
- distance: number;
13
- }
1
+ import type { RuleFileCandidate } from "./types";
14
2
  /**
15
3
  * Find project root by walking up from startPath.
16
4
  * Checks for PROJECT_MARKERS (.git, pyproject.toml, package.json, etc.)
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Rule file metadata (Claude Code style frontmatter)
3
+ * Supports both Claude Code format (globs, paths) and GitHub Copilot format (applyTo)
3
4
  * @see https://docs.anthropic.com/en/docs/claude-code/settings#rule-files
5
+ * @see https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot
4
6
  */
5
7
  export interface RuleMetadata {
6
8
  description?: string;
@@ -28,6 +30,17 @@ export interface RuleInfo {
28
30
  /** Real path after symlink resolution (for duplicate detection) */
29
31
  realPath: string;
30
32
  }
33
+ /**
34
+ * Rule file candidate with discovery context
35
+ */
36
+ export interface RuleFileCandidate {
37
+ path: string;
38
+ realPath: string;
39
+ isGlobal: boolean;
40
+ distance: number;
41
+ /** Single-file rules (e.g., .github/copilot-instructions.md) always apply without frontmatter */
42
+ isSingleFile?: boolean;
43
+ }
31
44
  /**
32
45
  * Session storage for injected rules tracking
33
46
  */