oh-my-opencode 3.0.0-beta.8 → 3.0.0-beta.9

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 (53) hide show
  1. package/README.ja.md +6 -13
  2. package/README.md +13 -20
  3. package/README.zh-cn.md +13 -20
  4. package/dist/agents/orchestrator-sisyphus.d.ts +2 -2
  5. package/dist/agents/prometheus-prompt.d.ts +1 -1
  6. package/dist/agents/utils.d.ts +3 -3
  7. package/dist/cli/doctor/checks/opencode.d.ts +5 -1
  8. package/dist/cli/index.js +129 -46
  9. package/dist/config/schema.d.ts +205 -213
  10. package/dist/features/background-agent/concurrency.d.ts +17 -0
  11. package/dist/features/background-agent/manager.d.ts +24 -5
  12. package/dist/features/background-agent/types.d.ts +3 -1
  13. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
  14. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
  15. package/dist/features/claude-code-session-state/state.d.ts +2 -1
  16. package/dist/features/context-injector/index.d.ts +1 -1
  17. package/dist/features/opencode-skill-loader/skill-content.d.ts +1 -0
  18. package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
  19. package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
  20. package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +1 -2
  21. package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +0 -5
  22. package/dist/hooks/compaction-context-injector/index.d.ts +7 -1
  23. package/dist/hooks/{sisyphus-task-retry → delegate-task-retry}/index.d.ts +4 -4
  24. package/dist/hooks/index.d.ts +1 -3
  25. package/dist/hooks/prometheus-md-only/constants.d.ts +1 -1
  26. package/dist/index.js +1692 -2011
  27. package/dist/shared/agent-tool-restrictions.d.ts +7 -0
  28. package/dist/shared/index.d.ts +2 -0
  29. package/dist/shared/opencode-version.d.ts +6 -3
  30. package/dist/shared/permission-compat.d.ts +22 -9
  31. package/dist/shared/system-directive.d.ts +31 -0
  32. package/dist/tools/{sisyphus-task → delegate-task}/constants.d.ts +1 -1
  33. package/dist/tools/{sisyphus-task → delegate-task}/index.d.ts +1 -1
  34. package/dist/tools/{sisyphus-task → delegate-task}/tools.d.ts +2 -2
  35. package/dist/tools/delegate-task/tools.test.d.ts +1 -0
  36. package/dist/tools/{sisyphus-task → delegate-task}/types.d.ts +2 -2
  37. package/dist/tools/index.d.ts +1 -1
  38. package/dist/tools/interactive-bash/constants.d.ts +1 -1
  39. package/dist/tools/lsp/client.d.ts +4 -0
  40. package/dist/tools/lsp/config.test.d.ts +1 -0
  41. package/dist/tools/lsp/constants.d.ts +3 -0
  42. package/dist/tools/lsp/index.d.ts +1 -1
  43. package/dist/tools/lsp/tools.d.ts +3 -1
  44. package/dist/tools/lsp/types.d.ts +23 -0
  45. package/dist/tools/lsp/utils.d.ts +5 -1
  46. package/dist/tools/skill/types.d.ts +3 -0
  47. package/package.json +8 -8
  48. package/dist/hooks/empty-message-sanitizer/index.d.ts +0 -12
  49. package/dist/hooks/preemptive-compaction/constants.d.ts +0 -3
  50. package/dist/hooks/preemptive-compaction/index.d.ts +0 -24
  51. package/dist/hooks/preemptive-compaction/types.d.ts +0 -17
  52. /package/dist/{hooks/sisyphus-task-retry/index.test.d.ts → features/claude-code-session-state/state.test.d.ts} +0 -0
  53. /package/dist/{tools/sisyphus-task/tools.test.d.ts → hooks/delegate-task-retry/index.test.d.ts} +0 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Agent tool restrictions for session.prompt calls.
3
+ * OpenCode SDK's session.prompt `tools` parameter expects boolean values.
4
+ * true = tool allowed, false = tool denied.
5
+ */
6
+ export declare function getAgentToolRestrictions(agentName: string): Record<string, boolean>;
7
+ export declare function hasAgentToolRestrictions(agentName: string): boolean;
@@ -24,3 +24,5 @@ export * from "./zip-extractor";
24
24
  export * from "./agent-variant";
25
25
  export * from "./session-cursor";
26
26
  export * from "./shell-env";
27
+ export * from "./system-directive";
28
+ export * from "./agent-tool-restrictions";
@@ -1,10 +1,13 @@
1
- export declare const PERMISSION_BREAKING_VERSION = "1.1.1";
1
+ /**
2
+ * Minimum OpenCode version required for this plugin.
3
+ * This plugin only supports OpenCode 1.1.1+ which uses the permission system.
4
+ */
5
+ export declare const MINIMUM_OPENCODE_VERSION = "1.1.1";
2
6
  export declare function parseVersion(version: string): number[];
3
7
  export declare function compareVersions(a: string, b: string): -1 | 0 | 1;
4
8
  export declare function isVersionGte(a: string, b: string): boolean;
5
9
  export declare function isVersionLt(a: string, b: string): boolean;
6
10
  export declare function getOpenCodeVersion(): string | null;
7
- export declare function supportsNewPermissionSystem(): boolean;
8
- export declare function usesLegacyToolsSystem(): boolean;
11
+ export declare function isOpenCodeVersionAtLeast(version: string): boolean;
9
12
  export declare function resetVersionCache(): void;
10
13
  export declare function setVersionCache(version: string | null): void;
@@ -1,14 +1,27 @@
1
- import { supportsNewPermissionSystem } from "./opencode-version";
2
- export { supportsNewPermissionSystem };
1
+ /**
2
+ * Permission system utilities for OpenCode 1.1.1+.
3
+ * This module only supports the new permission format.
4
+ */
3
5
  export type PermissionValue = "ask" | "allow" | "deny";
4
- export interface LegacyToolsFormat {
5
- tools: Record<string, boolean>;
6
- }
7
- export interface NewPermissionFormat {
6
+ export interface PermissionFormat {
8
7
  permission: Record<string, PermissionValue>;
9
8
  }
10
- export type VersionAwareRestrictions = LegacyToolsFormat | NewPermissionFormat;
11
- export declare function createAgentToolRestrictions(denyTools: string[]): VersionAwareRestrictions;
9
+ /**
10
+ * Creates tool restrictions that deny specified tools.
11
+ */
12
+ export declare function createAgentToolRestrictions(denyTools: string[]): PermissionFormat;
13
+ /**
14
+ * Creates tool restrictions that ONLY allow specified tools.
15
+ * All other tools are denied by default using `*: deny` pattern.
16
+ */
17
+ export declare function createAgentToolAllowlist(allowTools: string[]): PermissionFormat;
18
+ /**
19
+ * Converts legacy tools format to permission format.
20
+ * For migrating user configs from older versions.
21
+ */
12
22
  export declare function migrateToolsToPermission(tools: Record<string, boolean>): Record<string, PermissionValue>;
13
- export declare function migratePermissionToTools(permission: Record<string, PermissionValue>): Record<string, boolean>;
23
+ /**
24
+ * Migrates agent config from legacy tools format to permission format.
25
+ * If config has `tools`, converts to `permission`.
26
+ */
14
27
  export declare function migrateAgentConfig(config: Record<string, unknown>): Record<string, unknown>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Unified system directive prefix for oh-my-opencode internal messages.
3
+ * All system-generated messages should use this prefix for consistent filtering.
4
+ *
5
+ * Format: [SYSTEM DIRECTIVE: OH-MY-OPENCODE - {TYPE}]
6
+ */
7
+ export declare const SYSTEM_DIRECTIVE_PREFIX = "[SYSTEM DIRECTIVE: OH-MY-OPENCODE";
8
+ /**
9
+ * Creates a system directive header with the given type.
10
+ * @param type - The directive type (e.g., "TODO CONTINUATION", "RALPH LOOP")
11
+ * @returns Formatted directive string like "[SYSTEM DIRECTIVE: OH-MY-OPENCODE - TODO CONTINUATION]"
12
+ */
13
+ export declare function createSystemDirective(type: string): string;
14
+ /**
15
+ * Checks if a message starts with the oh-my-opencode system directive prefix.
16
+ * Used by keyword-detector and other hooks to skip system-generated messages.
17
+ * @param text - The message text to check
18
+ * @returns true if the message is a system directive
19
+ */
20
+ export declare function isSystemDirective(text: string): boolean;
21
+ export declare const SystemDirectiveTypes: {
22
+ readonly TODO_CONTINUATION: "TODO CONTINUATION";
23
+ readonly RALPH_LOOP: "RALPH LOOP";
24
+ readonly BOULDER_CONTINUATION: "BOULDER CONTINUATION";
25
+ readonly DELEGATION_REQUIRED: "DELEGATION REQUIRED";
26
+ readonly SINGLE_TASK_ONLY: "SINGLE TASK ONLY";
27
+ readonly COMPACTION_CONTEXT: "COMPACTION CONTEXT";
28
+ readonly CONTEXT_WINDOW_MONITOR: "CONTEXT WINDOW MONITOR";
29
+ readonly PROMETHEUS_READ_ONLY: "PROMETHEUS READ-ONLY";
30
+ };
31
+ export type SystemDirectiveType = (typeof SystemDirectiveTypes)[keyof typeof SystemDirectiveTypes];
@@ -9,4 +9,4 @@ export declare const GENERAL_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou a
9
9
  export declare const DEFAULT_CATEGORIES: Record<string, CategoryConfig>;
10
10
  export declare const CATEGORY_PROMPT_APPENDS: Record<string, string>;
11
11
  export declare const CATEGORY_DESCRIPTIONS: Record<string, string>;
12
- export declare const SISYPHUS_TASK_DESCRIPTION: string;
12
+ export declare const DELEGATE_TASK_DESCRIPTION: string;
@@ -1,3 +1,3 @@
1
- export { createSisyphusTask, type SisyphusTaskToolOptions } from "./tools";
1
+ export { createDelegateTask, type DelegateTaskToolOptions } from "./tools";
2
2
  export type * from "./types";
3
3
  export * from "./constants";
@@ -2,7 +2,7 @@ import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
3
  import type { CategoriesConfig, GitMasterConfig } from "../../config/schema";
4
4
  type OpencodeClient = PluginInput["client"];
5
- export interface SisyphusTaskToolOptions {
5
+ export interface DelegateTaskToolOptions {
6
6
  manager: BackgroundManager;
7
7
  client: OpencodeClient;
8
8
  directory: string;
@@ -14,5 +14,5 @@ export interface BuildSystemContentInput {
14
14
  categoryPromptAppend?: string;
15
15
  }
16
16
  export declare function buildSystemContent(input: BuildSystemContentInput): string | undefined;
17
- export declare function createSisyphusTask(options: SisyphusTaskToolOptions): ToolDefinition;
17
+ export declare function createDelegateTask(options: DelegateTaskToolOptions): ToolDefinition;
18
18
  export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,9 @@
1
- export interface SisyphusTaskArgs {
1
+ export interface DelegateTaskArgs {
2
2
  description: string;
3
3
  prompt: string;
4
4
  category?: string;
5
5
  subagent_type?: string;
6
6
  run_in_background: boolean;
7
7
  resume?: string;
8
- skills: string[];
8
+ skills: string[] | null;
9
9
  }
@@ -11,6 +11,6 @@ import type { BackgroundManager } from "../features/background-agent";
11
11
  type OpencodeClient = PluginInput["client"];
12
12
  export { createCallOmoAgent } from "./call-omo-agent";
13
13
  export { createLookAt } from "./look-at";
14
- export { createSisyphusTask, type SisyphusTaskToolOptions, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS } from "./sisyphus-task";
14
+ export { createDelegateTask, type DelegateTaskToolOptions, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS } from "./delegate-task";
15
15
  export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
16
16
  export declare const builtinTools: Record<string, ToolDefinition>;
@@ -1,3 +1,3 @@
1
1
  export declare const DEFAULT_TIMEOUT_MS = 60000;
2
2
  export declare const BLOCKED_TMUX_SUBCOMMANDS: string[];
3
- export declare const INTERACTIVE_BASH_DESCRIPTION = "Execute tmux commands. Use \"omo-{name}\" session pattern.\n\nFor: server processes, long-running tasks, background jobs, interactive CLI tools.\n\nBlocked (use bash instead): capture-pane, save-buffer, show-buffer, pipe-pane.";
3
+ export declare const INTERACTIVE_BASH_DESCRIPTION = "WARNING: This is TMUX ONLY. Pass tmux subcommands directly (without 'tmux' prefix).\n\nExamples: new-session -d -s omo-dev, send-keys -t omo-dev \"vim\" Enter\n\nFor TUI apps needing ongoing interaction (vim, htop, pudb). One-shot commands \u2192 use Bash with &.";
@@ -42,6 +42,10 @@ export declare class LSPClient {
42
42
  private handleServerRequest;
43
43
  initialize(): Promise<void>;
44
44
  openFile(filePath: string): Promise<void>;
45
+ definition(filePath: string, line: number, character: number): Promise<unknown>;
46
+ references(filePath: string, line: number, character: number, includeDeclaration?: boolean): Promise<unknown>;
47
+ documentSymbols(filePath: string): Promise<unknown>;
48
+ workspaceSymbols(query: string): Promise<unknown>;
45
49
  diagnostics(filePath: string): Promise<{
46
50
  items: Diagnostic[];
47
51
  }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,8 @@
1
1
  import type { LSPServerConfig } from "./types";
2
+ export declare const SYMBOL_KIND_MAP: Record<number, string>;
2
3
  export declare const SEVERITY_MAP: Record<number, string>;
4
+ export declare const DEFAULT_MAX_REFERENCES = 200;
5
+ export declare const DEFAULT_MAX_SYMBOLS = 200;
3
6
  export declare const DEFAULT_MAX_DIAGNOSTICS = 200;
4
7
  export declare const LSP_INSTALL_HINTS: Record<string, string>;
5
8
  export declare const BUILTIN_SERVERS: Record<string, Omit<LSPServerConfig, "id">>;
@@ -3,4 +3,4 @@ export * from "./constants";
3
3
  export * from "./config";
4
4
  export * from "./client";
5
5
  export * from "./utils";
6
- export * from "./tools";
6
+ export { lsp_goto_definition, lsp_find_references, lsp_symbols, lsp_diagnostics, lsp_prepare_rename, lsp_rename } from "./tools";
@@ -1,5 +1,7 @@
1
1
  import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
+ export declare const lsp_goto_definition: ToolDefinition;
3
+ export declare const lsp_find_references: ToolDefinition;
4
+ export declare const lsp_symbols: ToolDefinition;
2
5
  export declare const lsp_diagnostics: ToolDefinition;
3
- export declare const lsp_servers: ToolDefinition;
4
6
  export declare const lsp_prepare_rename: ToolDefinition;
5
7
  export declare const lsp_rename: ToolDefinition;
@@ -14,6 +14,29 @@ export interface Range {
14
14
  start: Position;
15
15
  end: Position;
16
16
  }
17
+ export interface Location {
18
+ uri: string;
19
+ range: Range;
20
+ }
21
+ export interface LocationLink {
22
+ targetUri: string;
23
+ targetRange: Range;
24
+ targetSelectionRange: Range;
25
+ originSelectionRange?: Range;
26
+ }
27
+ export interface SymbolInfo {
28
+ name: string;
29
+ kind: number;
30
+ location: Location;
31
+ containerName?: string;
32
+ }
33
+ export interface DocumentSymbol {
34
+ name: string;
35
+ kind: number;
36
+ range: Range;
37
+ selectionRange: Range;
38
+ children?: DocumentSymbol[];
39
+ }
17
40
  export interface Diagnostic {
18
41
  range: Range;
19
42
  severity?: number;
@@ -1,12 +1,16 @@
1
1
  import { LSPClient } from "./client";
2
- import type { Diagnostic, PrepareRenameResult, PrepareRenameDefaultBehavior, Range, WorkspaceEdit, TextEdit, ServerLookupResult } from "./types";
2
+ import type { Location, LocationLink, DocumentSymbol, SymbolInfo, Diagnostic, PrepareRenameResult, PrepareRenameDefaultBehavior, Range, WorkspaceEdit, TextEdit, ServerLookupResult } from "./types";
3
3
  export declare function findWorkspaceRoot(filePath: string): string;
4
4
  export declare function uriToPath(uri: string): string;
5
5
  export declare function formatServerLookupError(result: Exclude<ServerLookupResult, {
6
6
  status: "found";
7
7
  }>): string;
8
8
  export declare function withLspClient<T>(filePath: string, fn: (client: LSPClient) => Promise<T>): Promise<T>;
9
+ export declare function formatLocation(loc: Location | LocationLink): string;
10
+ export declare function formatSymbolKind(kind: number): string;
9
11
  export declare function formatSeverity(severity: number | undefined): string;
12
+ export declare function formatDocumentSymbol(symbol: DocumentSymbol, indent?: number): string;
13
+ export declare function formatSymbolInfo(symbol: SymbolInfo): string;
10
14
  export declare function formatDiagnostic(diag: Diagnostic): string;
11
15
  export declare function filterDiagnosticsBySeverity(diagnostics: Diagnostic[], severityFilter?: "error" | "warning" | "information" | "hint" | "all"): Diagnostic[];
12
16
  export declare function formatPrepareRenameResult(result: PrepareRenameResult | PrepareRenameDefaultBehavior | Range | null): string;
@@ -1,5 +1,6 @@
1
1
  import type { SkillScope, LoadedSkill } from "../../features/opencode-skill-loader/types";
2
2
  import type { SkillMcpManager } from "../../features/skill-mcp-manager";
3
+ import type { GitMasterConfig } from "../../config/schema";
3
4
  export interface SkillArgs {
4
5
  name: string;
5
6
  }
@@ -22,4 +23,6 @@ export interface SkillLoadOptions {
22
23
  mcpManager?: SkillMcpManager;
23
24
  /** Session ID getter for MCP client identification */
24
25
  getSessionID?: () => string;
26
+ /** Git master configuration for watermark/co-author settings */
27
+ gitMasterConfig?: GitMasterConfig;
25
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.0.0-beta.8",
3
+ "version": "3.0.0-beta.9",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -77,13 +77,13 @@
77
77
  "typescript": "^5.7.3"
78
78
  },
79
79
  "optionalDependencies": {
80
- "oh-my-opencode-darwin-arm64": "3.0.0-beta.8",
81
- "oh-my-opencode-darwin-x64": "3.0.0-beta.8",
82
- "oh-my-opencode-linux-arm64": "3.0.0-beta.8",
83
- "oh-my-opencode-linux-arm64-musl": "3.0.0-beta.8",
84
- "oh-my-opencode-linux-x64": "3.0.0-beta.8",
85
- "oh-my-opencode-linux-x64-musl": "3.0.0-beta.8",
86
- "oh-my-opencode-windows-x64": "3.0.0-beta.8"
80
+ "oh-my-opencode-darwin-arm64": "3.0.0-beta.9",
81
+ "oh-my-opencode-darwin-x64": "3.0.0-beta.9",
82
+ "oh-my-opencode-linux-arm64": "3.0.0-beta.9",
83
+ "oh-my-opencode-linux-arm64-musl": "3.0.0-beta.9",
84
+ "oh-my-opencode-linux-x64": "3.0.0-beta.9",
85
+ "oh-my-opencode-linux-x64-musl": "3.0.0-beta.9",
86
+ "oh-my-opencode-windows-x64": "3.0.0-beta.9"
87
87
  },
88
88
  "trustedDependencies": [
89
89
  "@ast-grep/cli",
@@ -1,12 +0,0 @@
1
- import type { Message, Part } from "@opencode-ai/sdk";
2
- interface MessageWithParts {
3
- info: Message;
4
- parts: Part[];
5
- }
6
- type MessagesTransformHook = {
7
- "experimental.chat.messages.transform"?: (input: Record<string, never>, output: {
8
- messages: MessageWithParts[];
9
- }) => Promise<void>;
10
- };
11
- export declare function createEmptyMessageSanitizerHook(): MessagesTransformHook;
12
- export {};
@@ -1,3 +0,0 @@
1
- export declare const DEFAULT_THRESHOLD = 0.85;
2
- export declare const MIN_TOKENS_FOR_COMPACTION = 50000;
3
- export declare const COMPACTION_COOLDOWN_MS = 60000;
@@ -1,24 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { ExperimentalConfig } from "../../config";
3
- export interface SummarizeContext {
4
- sessionID: string;
5
- providerID: string;
6
- modelID: string;
7
- usageRatio: number;
8
- directory: string;
9
- }
10
- export type BeforeSummarizeCallback = (ctx: SummarizeContext) => Promise<void> | void;
11
- export type GetModelLimitCallback = (providerID: string, modelID: string) => number | undefined;
12
- export interface PreemptiveCompactionOptions {
13
- experimental?: ExperimentalConfig;
14
- onBeforeSummarize?: BeforeSummarizeCallback;
15
- getModelLimit?: GetModelLimitCallback;
16
- }
17
- export declare function createPreemptiveCompactionHook(ctx: PluginInput, options?: PreemptiveCompactionOptions): {
18
- event: ({ event }: {
19
- event: {
20
- type: string;
21
- properties?: unknown;
22
- };
23
- }) => Promise<void>;
24
- };
@@ -1,17 +0,0 @@
1
- export interface PreemptiveCompactionState {
2
- lastCompactionTime: Map<string, number>;
3
- compactionInProgress: Set<string>;
4
- }
5
- export interface TokenInfo {
6
- input: number;
7
- output: number;
8
- reasoning: number;
9
- cache: {
10
- read: number;
11
- write: number;
12
- };
13
- }
14
- export interface ModelLimits {
15
- context: number;
16
- output: number;
17
- }