oh-my-opencode 3.0.0 → 3.1.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 (45) hide show
  1. package/dist/agents/atlas.d.ts +1 -1
  2. package/dist/agents/utils.d.ts +3 -2
  3. package/dist/cli/config-manager.d.ts +77 -14
  4. package/dist/cli/index.js +340 -122
  5. package/dist/config/index.d.ts +2 -2
  6. package/dist/config/schema.d.ts +59 -0
  7. package/dist/features/background-agent/manager.d.ts +13 -2
  8. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +1 -1
  9. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  10. package/dist/features/builtin-skills/index.d.ts +1 -1
  11. package/dist/features/builtin-skills/skills.d.ts +5 -1
  12. package/dist/features/builtin-skills/skills.test.d.ts +1 -0
  13. package/dist/features/opencode-skill-loader/skill-content.d.ts +3 -2
  14. package/dist/features/tmux-subagent/action-executor.d.ts +22 -0
  15. package/dist/features/tmux-subagent/decision-engine.d.ts +38 -0
  16. package/dist/features/tmux-subagent/decision-engine.test.d.ts +1 -0
  17. package/dist/features/tmux-subagent/index.d.ts +5 -0
  18. package/dist/features/tmux-subagent/manager.d.ts +54 -0
  19. package/dist/features/tmux-subagent/manager.test.d.ts +1 -0
  20. package/dist/features/tmux-subagent/pane-state-querier.d.ts +2 -0
  21. package/dist/features/tmux-subagent/types.d.ts +51 -0
  22. package/dist/hooks/category-skill-reminder/index.d.ts +22 -0
  23. package/dist/hooks/category-skill-reminder/index.test.d.ts +1 -0
  24. package/dist/hooks/index.d.ts +2 -0
  25. package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +2 -0
  26. package/dist/hooks/sisyphus-junior-notepad/index.d.ts +12 -0
  27. package/dist/index.js +2905 -1009
  28. package/dist/shared/connected-providers-cache.d.ts +52 -0
  29. package/dist/shared/data-path.d.ts +16 -0
  30. package/dist/shared/index.d.ts +3 -1
  31. package/dist/shared/model-availability.d.ts +4 -5
  32. package/dist/shared/session-utils.d.ts +2 -0
  33. package/dist/shared/tmux/constants.d.ts +5 -0
  34. package/dist/shared/tmux/index.d.ts +3 -0
  35. package/dist/shared/tmux/tmux-utils.d.ts +17 -0
  36. package/dist/shared/tmux/tmux-utils.test.d.ts +1 -0
  37. package/dist/shared/tmux/types.d.ts +4 -0
  38. package/dist/tools/call-omo-agent/constants.d.ts +1 -1
  39. package/dist/tools/delegate-task/tools.d.ts +8 -1
  40. package/dist/tools/delegate-task/types.d.ts +2 -1
  41. package/dist/tools/index.d.ts +1 -2
  42. package/dist/tools/slashcommand/tools.test.d.ts +1 -0
  43. package/package.json +8 -8
  44. package/dist/hooks/background-compaction/index.d.ts +0 -19
  45. package/dist/shared/config-path.d.ts +0 -13
@@ -0,0 +1,52 @@
1
+ interface ProviderModelsCache {
2
+ models: Record<string, string[]>;
3
+ connected: string[];
4
+ updatedAt: string;
5
+ }
6
+ /**
7
+ * Read the connected providers cache.
8
+ * Returns the list of connected provider IDs, or null if cache doesn't exist.
9
+ */
10
+ export declare function readConnectedProvidersCache(): string[] | null;
11
+ /**
12
+ * Check if connected providers cache exists.
13
+ */
14
+ export declare function hasConnectedProvidersCache(): boolean;
15
+ /**
16
+ * Read the provider-models cache.
17
+ * Returns the cache data, or null if cache doesn't exist.
18
+ */
19
+ export declare function readProviderModelsCache(): ProviderModelsCache | null;
20
+ /**
21
+ * Check if provider-models cache exists.
22
+ */
23
+ export declare function hasProviderModelsCache(): boolean;
24
+ /**
25
+ * Write the provider-models cache.
26
+ */
27
+ export declare function writeProviderModelsCache(data: {
28
+ models: Record<string, string[]>;
29
+ connected: string[];
30
+ }): void;
31
+ /**
32
+ * Update the connected providers cache by fetching from the client.
33
+ * Also updates the provider-models cache with model lists per provider.
34
+ */
35
+ export declare function updateConnectedProvidersCache(client: {
36
+ provider?: {
37
+ list?: () => Promise<{
38
+ data?: {
39
+ connected?: string[];
40
+ };
41
+ }>;
42
+ };
43
+ model?: {
44
+ list?: () => Promise<{
45
+ data?: Array<{
46
+ id: string;
47
+ provider: string;
48
+ }>;
49
+ }>;
50
+ };
51
+ }): Promise<void>;
52
+ export {};
@@ -12,3 +12,19 @@ export declare function getDataDir(): string;
12
12
  * All platforms: ~/.local/share/opencode/storage
13
13
  */
14
14
  export declare function getOpenCodeStorageDir(): string;
15
+ /**
16
+ * Returns the user-level cache directory.
17
+ * Matches OpenCode's behavior via xdg-basedir:
18
+ * - All platforms: XDG_CACHE_HOME or ~/.cache
19
+ */
20
+ export declare function getCacheDir(): string;
21
+ /**
22
+ * Returns the oh-my-opencode cache directory.
23
+ * All platforms: ~/.cache/oh-my-opencode
24
+ */
25
+ export declare function getOmoOpenCodeCacheDir(): string;
26
+ /**
27
+ * Returns the OpenCode cache directory (for reading OpenCode's cache).
28
+ * All platforms: ~/.cache/opencode
29
+ */
30
+ export declare function getOpenCodeCacheDir(): string;
@@ -10,7 +10,6 @@ export * from "./hook-disabled";
10
10
  export * from "./deep-merge";
11
11
  export * from "./file-utils";
12
12
  export * from "./dynamic-truncator";
13
- export * from "./config-path";
14
13
  export * from "./data-path";
15
14
  export * from "./config-errors";
16
15
  export * from "./claude-config-dir";
@@ -29,4 +28,7 @@ export * from "./agent-tool-restrictions";
29
28
  export * from "./model-requirements";
30
29
  export * from "./model-resolver";
31
30
  export * from "./model-availability";
31
+ export * from "./connected-providers-cache";
32
32
  export * from "./case-insensitive";
33
+ export * from "./session-utils";
34
+ export * from "./tmux";
@@ -1,8 +1,7 @@
1
- /**
2
- * Fuzzy matching utility for model names
3
- * Supports substring matching with provider filtering and priority-based selection
4
- */
5
1
  export declare function fuzzyMatchModel(target: string, available: Set<string>, providers?: string[]): string | null;
6
- export declare function fetchAvailableModels(_client?: any): Promise<Set<string>>;
2
+ export declare function getConnectedProviders(client: any): Promise<string[]>;
3
+ export declare function fetchAvailableModels(_client?: any, options?: {
4
+ connectedProviders?: string[] | null;
5
+ }): Promise<Set<string>>;
7
6
  export declare function __resetModelCache(): void;
8
7
  export declare function isModelCacheAvailable(): boolean;
@@ -0,0 +1,2 @@
1
+ export declare function getMessageDir(sessionID: string): string | null;
2
+ export declare function isCallerOrchestrator(sessionID?: string): boolean;
@@ -0,0 +1,5 @@
1
+ export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
2
+ export declare const SESSION_TIMEOUT_MS: number;
3
+ export declare const SESSION_MISSING_GRACE_MS = 6000;
4
+ export declare const SESSION_READY_POLL_INTERVAL_MS = 500;
5
+ export declare const SESSION_READY_TIMEOUT_MS = 10000;
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./constants";
3
+ export * from "./tmux-utils";
@@ -0,0 +1,17 @@
1
+ import type { TmuxConfig, TmuxLayout } from "../../config/schema";
2
+ import type { SpawnPaneResult } from "./types";
3
+ export declare function isInsideTmux(): boolean;
4
+ export declare function isServerRunning(serverUrl: string): Promise<boolean>;
5
+ export declare function resetServerCheck(): void;
6
+ export type SplitDirection = "-h" | "-v";
7
+ export declare function getCurrentPaneId(): string | undefined;
8
+ export interface PaneDimensions {
9
+ paneWidth: number;
10
+ windowWidth: number;
11
+ }
12
+ export declare function getPaneDimensions(paneId: string): Promise<PaneDimensions | null>;
13
+ export declare function spawnTmuxPane(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, targetPaneId?: string, splitDirection?: SplitDirection): Promise<SpawnPaneResult>;
14
+ export declare function closeTmuxPane(paneId: string): Promise<boolean>;
15
+ export declare function replaceTmuxPane(paneId: string, sessionId: string, description: string, config: TmuxConfig, serverUrl: string): Promise<SpawnPaneResult>;
16
+ export declare function applyLayout(tmux: string, layout: TmuxLayout, mainPaneSize: number): Promise<void>;
17
+ export declare function enforceMainPaneWidth(mainPaneId: string, windowWidth: number): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface SpawnPaneResult {
2
+ success: boolean;
3
+ paneId?: string;
4
+ }
@@ -1,2 +1,2 @@
1
1
  export declare const ALLOWED_AGENTS: readonly ["explore", "librarian"];
2
- export declare const CALL_OMO_AGENT_DESCRIPTION = "Spawn explore/librarian agent. run_in_background REQUIRED (true=async with task_id, false=sync).\n\nAvailable: {agents}\n\nPass `resume=session_id` to continue previous agent with full context. Prompts MUST be in English. Use `background_output` for async results.";
2
+ export declare const CALL_OMO_AGENT_DESCRIPTION = "Spawn explore/librarian agent. run_in_background REQUIRED (true=async with task_id, false=sync).\n\nAvailable: {agents}\n\nPass `session_id=<id>` to continue previous agent with full context. Prompts MUST be in English. Use `background_output` for async results.";
@@ -1,6 +1,6 @@
1
1
  import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
- import type { CategoryConfig, CategoriesConfig, GitMasterConfig } from "../../config/schema";
3
+ import type { CategoryConfig, CategoriesConfig, GitMasterConfig, BrowserAutomationProvider } from "../../config/schema";
4
4
  type OpencodeClient = PluginInput["client"];
5
5
  export declare function resolveCategoryConfig(categoryName: string, options: {
6
6
  userCategories?: CategoriesConfig;
@@ -11,6 +11,11 @@ export declare function resolveCategoryConfig(categoryName: string, options: {
11
11
  promptAppend: string;
12
12
  model: string;
13
13
  } | null;
14
+ export interface SyncSessionCreatedEvent {
15
+ sessionID: string;
16
+ parentID: string;
17
+ title: string;
18
+ }
14
19
  export interface DelegateTaskToolOptions {
15
20
  manager: BackgroundManager;
16
21
  client: OpencodeClient;
@@ -18,6 +23,8 @@ export interface DelegateTaskToolOptions {
18
23
  userCategories?: CategoriesConfig;
19
24
  gitMasterConfig?: GitMasterConfig;
20
25
  sisyphusJuniorModel?: string;
26
+ browserProvider?: BrowserAutomationProvider;
27
+ onSyncSessionCreated?: (event: SyncSessionCreatedEvent) => Promise<void>;
21
28
  }
22
29
  export interface BuildSystemContentInput {
23
30
  skillContent?: string;
@@ -4,6 +4,7 @@ export interface DelegateTaskArgs {
4
4
  category?: string;
5
5
  subagent_type?: string;
6
6
  run_in_background: boolean;
7
- resume?: string;
7
+ session_id?: string;
8
+ command?: string;
8
9
  load_skills: string[];
9
10
  }
@@ -4,13 +4,12 @@ export { createSlashcommandTool, discoverCommandsSync } from "./slashcommand";
4
4
  export { sessionExists } from "./session-manager/storage";
5
5
  export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash";
6
6
  export { createSkillTool } from "./skill";
7
- export { getTmuxPath } from "./interactive-bash/utils";
8
7
  export { createSkillMcpTool } from "./skill-mcp";
9
8
  import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin";
10
9
  import type { BackgroundManager } from "../features/background-agent";
11
10
  type OpencodeClient = PluginInput["client"];
12
11
  export { createCallOmoAgent } from "./call-omo-agent";
13
12
  export { createLookAt } from "./look-at";
14
- export { createDelegateTask, type DelegateTaskToolOptions, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS } from "./delegate-task";
13
+ export { createDelegateTask } from "./delegate-task";
15
14
  export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
16
15
  export declare const builtinTools: Record<string, ToolDefinition>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
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",
@@ -73,13 +73,13 @@
73
73
  "typescript": "^5.7.3"
74
74
  },
75
75
  "optionalDependencies": {
76
- "oh-my-opencode-darwin-arm64": "3.0.0",
77
- "oh-my-opencode-darwin-x64": "3.0.0",
78
- "oh-my-opencode-linux-arm64": "3.0.0",
79
- "oh-my-opencode-linux-arm64-musl": "3.0.0",
80
- "oh-my-opencode-linux-x64": "3.0.0",
81
- "oh-my-opencode-linux-x64-musl": "3.0.0",
82
- "oh-my-opencode-windows-x64": "3.0.0"
76
+ "oh-my-opencode-darwin-arm64": "3.1.0",
77
+ "oh-my-opencode-darwin-x64": "3.1.0",
78
+ "oh-my-opencode-linux-arm64": "3.1.0",
79
+ "oh-my-opencode-linux-arm64-musl": "3.1.0",
80
+ "oh-my-opencode-linux-x64": "3.1.0",
81
+ "oh-my-opencode-linux-x64-musl": "3.1.0",
82
+ "oh-my-opencode-windows-x64": "3.1.0"
83
83
  },
84
84
  "trustedDependencies": [
85
85
  "@ast-grep/cli",
@@ -1,19 +0,0 @@
1
- import type { BackgroundManager } from "../../features/background-agent";
2
- interface CompactingInput {
3
- sessionID: string;
4
- }
5
- interface CompactingOutput {
6
- context: string[];
7
- prompt?: string;
8
- }
9
- /**
10
- * Background agent compaction hook - preserves task state during context compaction.
11
- *
12
- * When OpenCode compacts session context to save tokens, this hook injects
13
- * information about running and recently completed background tasks so the
14
- * agent doesn't lose awareness of delegated work.
15
- */
16
- export declare function createBackgroundCompactionHook(manager: BackgroundManager): {
17
- "experimental.session.compacting": (input: CompactingInput, output: CompactingOutput) => Promise<void>;
18
- };
19
- export {};
@@ -1,13 +0,0 @@
1
- /**
2
- * Returns the user-level config directory based on the OS.
3
- * @deprecated Use getOpenCodeConfigDir() from opencode-config-dir.ts instead.
4
- */
5
- export declare function getUserConfigDir(): string;
6
- /**
7
- * Returns the full path to the user-level oh-my-opencode config file.
8
- */
9
- export declare function getUserConfigPath(): string;
10
- /**
11
- * Returns the full path to the project-level oh-my-opencode config file.
12
- */
13
- export declare function getProjectConfigPath(directory: string): string;