oh-my-opencode 3.17.4 → 3.17.6

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 (145) hide show
  1. package/README.ja.md +3 -3
  2. package/README.ko.md +3 -3
  3. package/README.md +3 -3
  4. package/README.ru.md +3 -3
  5. package/README.zh-cn.md +3 -3
  6. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-16.d.ts +1 -0
  7. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-17.d.ts +1 -0
  8. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-18.d.ts +1 -0
  9. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-19.d.ts +1 -0
  10. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-20.d.ts +1 -0
  11. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-01.d.ts +1 -0
  12. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-02.d.ts +1 -0
  13. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-03.d.ts +1 -0
  14. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-04.d.ts +1 -0
  15. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-05.d.ts +1 -0
  16. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-06.d.ts +1 -0
  17. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-07.d.ts +1 -0
  18. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-08.d.ts +1 -0
  19. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-09.d.ts +1 -0
  20. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-10.d.ts +1 -0
  21. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-11.d.ts +1 -0
  22. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-12.d.ts +1 -0
  23. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-13.d.ts +1 -0
  24. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-14.d.ts +1 -0
  25. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-15.d.ts +1 -0
  26. package/dist/agents/agent-builder.d.ts +2 -3
  27. package/dist/agents/agent-skill-resolution.d.ts +7 -0
  28. package/dist/agents/atlas/default-prompt-sections.d.ts +2 -2
  29. package/dist/agents/atlas/gemini-prompt-sections.d.ts +1 -1
  30. package/dist/agents/atlas/gpt-prompt-sections.d.ts +1 -1
  31. package/dist/agents/frontier-tool-schema-guard.d.ts +3 -0
  32. package/dist/agents/hephaestus/agent.d.ts +1 -1
  33. package/dist/agents/hephaestus/gpt-5-5.d.ts +12 -0
  34. package/dist/agents/sisyphus/claude-opus-4-7.d.ts +20 -0
  35. package/dist/agents/sisyphus/gpt-5-5.d.ts +20 -0
  36. package/dist/agents/sisyphus/index.d.ts +5 -0
  37. package/dist/agents/sisyphus/kimi-k2-6.d.ts +32 -0
  38. package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
  39. package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +14 -0
  40. package/dist/agents/sisyphus-junior/index.d.ts +2 -0
  41. package/dist/agents/sisyphus-junior/kimi-k2-6.d.ts +13 -0
  42. package/dist/agents/types.d.ts +17 -1
  43. package/dist/cli/doctor/checks/model-resolution.d.ts +4 -0
  44. package/dist/cli/index.js +17471 -15372
  45. package/dist/config/schema/background-task.d.ts +0 -1
  46. package/dist/config/schema/oh-my-opencode-config.d.ts +0 -1
  47. package/dist/create-hooks.d.ts +2 -0
  48. package/dist/create-managers.d.ts +2 -0
  49. package/dist/create-tools.d.ts +1 -1
  50. package/dist/features/background-agent/process-cleanup.test-helpers.d.ts +4 -0
  51. package/dist/features/background-agent/subagent-spawn-limits.d.ts +0 -7
  52. package/dist/features/claude-code-command-loader/loader-cache.d.ts +6 -0
  53. package/dist/features/claude-code-command-loader/loader.d.ts +2 -0
  54. package/dist/features/team-mode/index.d.ts +2 -0
  55. package/dist/features/team-mode/team-layout-tmux/index.d.ts +1 -0
  56. package/dist/features/team-mode/team-layout-tmux/layout.d.ts +15 -0
  57. package/dist/features/team-mode/team-worktree/cleanup.d.ts +3 -0
  58. package/dist/features/team-mode/team-worktree/index.d.ts +2 -0
  59. package/dist/features/team-mode/team-worktree/manager.d.ts +15 -0
  60. package/dist/features/team-mode/types.d.ts +210 -0
  61. package/dist/features/tmux-subagent/event-handlers.d.ts +0 -4
  62. package/dist/features/tmux-subagent/index.d.ts +0 -3
  63. package/dist/features/tmux-subagent/manager.d.ts +4 -0
  64. package/dist/features/tmux-subagent/polling-manager.d.ts +2 -1
  65. package/dist/hooks/auto-update-checker/hook/deferred-startup-check.d.ts +1 -0
  66. package/dist/hooks/comment-checker/initialization-gate.d.ts +1 -0
  67. package/dist/hooks/directory-agents-injector/finder.d.ts +1 -1
  68. package/dist/hooks/directory-readme-injector/finder.d.ts +1 -1
  69. package/dist/hooks/index.d.ts +1 -1
  70. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
  71. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
  72. package/dist/hooks/model-fallback/controller-accessor.d.ts +8 -0
  73. package/dist/hooks/model-fallback/fallback-state-controller.d.ts +26 -0
  74. package/dist/hooks/model-fallback/hook.d.ts +21 -16
  75. package/dist/hooks/model-fallback/index.d.ts +2 -0
  76. package/dist/hooks/preemptive-compaction-trigger.d.ts +13 -0
  77. package/dist/hooks/preemptive-compaction-types.d.ts +53 -0
  78. package/dist/hooks/preemptive-compaction.d.ts +3 -15
  79. package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +1 -6
  80. package/dist/hooks/ralph-loop/session-event-handler.d.ts +2 -6
  81. package/dist/hooks/ralph-loop/types.d.ts +5 -0
  82. package/dist/hooks/rules-injector/cache.d.ts +5 -0
  83. package/dist/hooks/rules-injector/injector.d.ts +2 -0
  84. package/dist/hooks/rules-injector/project-root-finder.d.ts +1 -0
  85. package/dist/hooks/rules-injector/rule-file-finder.d.ts +2 -19
  86. package/dist/hooks/rules-injector/rule-scan-cache.d.ts +6 -0
  87. package/dist/hooks/session-notification-event-properties.d.ts +5 -0
  88. package/dist/hooks/session-notification-init.d.ts +7 -0
  89. package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +1 -0
  90. package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -1
  91. package/dist/index.d.ts +3 -3
  92. package/dist/index.js +52209 -73179
  93. package/dist/oh-my-opencode.schema.json +0 -5
  94. package/dist/plugin/hooks/create-core-hooks.d.ts +4 -0
  95. package/dist/plugin/hooks/create-session-hooks.d.ts +4 -0
  96. package/dist/plugin/tool-registry.d.ts +1 -1
  97. package/dist/shared/agent-display-names.d.ts +7 -2
  98. package/dist/shared/agent-sort-shim.d.ts +28 -0
  99. package/dist/shared/excluded-dirs.d.ts +1 -0
  100. package/dist/shared/file-reference-resolver.d.ts +1 -0
  101. package/dist/shared/index.d.ts +2 -0
  102. package/dist/shared/jsonc-parser.d.ts +8 -5
  103. package/dist/shared/load-opencode-plugins.d.ts +1 -0
  104. package/dist/shared/migration/migrations-sidecar.d.ts +1 -1
  105. package/dist/shared/model-capabilities/supplemental-entries.d.ts +2 -0
  106. package/dist/shared/permission-compat.d.ts +1 -1
  107. package/dist/shared/posthog-activity-state.d.ts +5 -2
  108. package/dist/shared/posthog.d.ts +5 -0
  109. package/dist/shared/project-discovery-dirs.d.ts +2 -0
  110. package/dist/shared/ripgrep-cli.d.ts +8 -0
  111. package/dist/shared/tmux/tmux-utils/index.d.ts +1 -0
  112. package/dist/shared/tmux/tmux-utils/session-kill.d.ts +1 -0
  113. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +1 -0
  114. package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -0
  115. package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +11 -0
  116. package/dist/shared/tmux/tmux-utils.d.ts +3 -1
  117. package/dist/tools/ast-grep/pattern-hints.d.ts +4 -0
  118. package/dist/tools/ast-grep/tool-descriptions.d.ts +3 -0
  119. package/dist/tools/call-omo-agent/sync-executor.d.ts +2 -3
  120. package/dist/tools/call-omo-agent/tools.d.ts +2 -1
  121. package/dist/tools/delegate-task/background-continuation.d.ts +1 -1
  122. package/dist/tools/delegate-task/executor-types.d.ts +2 -0
  123. package/dist/tools/delegate-task/resolve-metadata-model.d.ts +9 -0
  124. package/dist/tools/delegate-task/sync-continuation.d.ts +2 -2
  125. package/dist/tools/delegate-task/task-id.d.ts +2 -0
  126. package/dist/tools/delegate-task/tool-argument-preparation.d.ts +2 -0
  127. package/dist/tools/delegate-task/tool-description.d.ts +9 -0
  128. package/dist/tools/delegate-task/types.d.ts +4 -5
  129. package/dist/tools/glob/constants.d.ts +1 -1
  130. package/dist/tools/grep/cli.d.ts +1 -1
  131. package/dist/tools/grep/constants.d.ts +0 -8
  132. package/dist/tools/look-at/look-at-input-preparer.d.ts +22 -0
  133. package/dist/tools/look-at/look-at-prompt.d.ts +2 -0
  134. package/dist/tools/look-at/look-at-session-runner.d.ts +12 -0
  135. package/dist/tools/skill/description-formatter.d.ts +1 -1
  136. package/dist/tools/skill/session-skill-cache.d.ts +1 -0
  137. package/dist/tools/skill-mcp/parse-skill-mcp-arguments.d.ts +1 -0
  138. package/dist/tools/slashcommand/command-discovery-deps.d.ts +6 -0
  139. package/package.json +22 -18
  140. package/dist/features/tmux-subagent/cleanup.d.ts +0 -9
  141. package/dist/features/tmux-subagent/session-created-handler.d.ts +0 -22
  142. package/dist/features/tmux-subagent/session-deleted-handler.d.ts +0 -15
  143. package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +0 -7
  144. package/dist/plugin-dispose.d.ts +0 -13
  145. /package/dist/{tools/delegate-task → shared}/model-string-parser.d.ts +0 -0
@@ -5673,11 +5673,6 @@
5673
5673
  "minimum": 1,
5674
5674
  "maximum": 9007199254740991
5675
5675
  },
5676
- "maxDescendants": {
5677
- "type": "integer",
5678
- "minimum": 1,
5679
- "maximum": 9007199254740991
5680
- },
5681
5676
  "staleTimeoutMs": {
5682
5677
  "type": "number",
5683
5678
  "minimum": 60000
@@ -1,10 +1,14 @@
1
1
  import type { HookName, OhMyOpenCodeConfig } from "../../config";
2
+ import type { BackgroundManager } from "../../features/background-agent";
3
+ import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
2
4
  import type { PluginContext } from "../types";
3
5
  import type { ModelCacheState } from "../../plugin-state";
4
6
  export declare function createCoreHooks(args: {
5
7
  ctx: PluginContext;
6
8
  pluginConfig: OhMyOpenCodeConfig;
7
9
  modelCacheState: ModelCacheState;
10
+ backgroundManager: BackgroundManager;
11
+ modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
8
12
  isHookEnabled: (hookName: HookName) => boolean;
9
13
  safeHookEnabled: boolean;
10
14
  }): {
@@ -1,4 +1,6 @@
1
1
  import type { OhMyOpenCodeConfig, HookName } from "../../config";
2
+ import type { BackgroundManager } from "../../features/background-agent";
3
+ import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
2
4
  import type { ModelCacheState } from "../../plugin-state";
3
5
  import type { PluginContext } from "../types";
4
6
  import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createModelFallbackHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createPrometheusMdOnlyHook, createSisyphusJuniorNotepadHook, createNoSisyphusGptHook, createNoHephaestusNonGptHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook, createRuntimeFallbackHook, createLegacyPluginToastHook } from "../../hooks";
@@ -33,6 +35,8 @@ export declare function createSessionHooks(args: {
33
35
  ctx: PluginContext;
34
36
  pluginConfig: OhMyOpenCodeConfig;
35
37
  modelCacheState: ModelCacheState;
38
+ backgroundManager: BackgroundManager;
39
+ modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
36
40
  isHookEnabled: (hookName: HookName) => boolean;
37
41
  safeHookEnabled: boolean;
38
42
  }): SessionHooks;
@@ -32,7 +32,7 @@ export declare function trimToolsToCap(filteredTools: ToolsRecord, maxTools: num
32
32
  export declare function createToolRegistry(args: {
33
33
  ctx: PluginContext;
34
34
  pluginConfig: OhMyOpenCodeConfig;
35
- managers: Pick<Managers, "backgroundManager" | "tmuxSessionManager" | "skillMcpManager">;
35
+ managers: Pick<Managers, "backgroundManager" | "tmuxSessionManager" | "skillMcpManager" | "modelFallbackControllerAccessor">;
36
36
  skillContext: SkillContext;
37
37
  availableCategories: AvailableCategory[];
38
38
  interactiveBashEnabled?: boolean;
@@ -12,7 +12,6 @@
12
12
  export declare const AGENT_DISPLAY_NAMES: Record<string, string>;
13
13
  export declare function stripInvisibleAgentCharacters(agentName: string): string;
14
14
  export declare function stripAgentListSortPrefix(agentName: string): string;
15
- export declare function getAgentRuntimeName(configKey: string): string;
16
15
  /**
17
16
  * Get display name for an agent config key.
18
17
  * Uses case-insensitive lookup for backward compatibility.
@@ -20,7 +19,13 @@ export declare function getAgentRuntimeName(configKey: string): string;
20
19
  */
21
20
  export declare function getAgentDisplayName(configKey: string): string;
22
21
  /**
23
- * Runtime-facing agent name used for OpenCode list ordering.
22
+ * Thin alias for `getAgentDisplayName` preserved for external imports.
23
+ *
24
+ * Earlier versions injected zero-width prefixes here to bias OpenCode's
25
+ * `agent.name` sort. Sort ordering is now enforced by
26
+ * `src/shared/agent-sort-shim.ts`, so this function emits the canonical
27
+ * display name verbatim. Kept exported because downstream modules still
28
+ * import this symbol; do not collapse the call sites without coordinating.
24
29
  */
25
30
  export declare function getAgentListDisplayName(configKey: string): string;
26
31
  /**
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Agent sort shim.
3
+ *
4
+ * OpenCode 1.4.x ignores the agent `order` field (sst/opencode#19127) and
5
+ * sorts the agent list by `agent.name` via Remeda `sortBy(x => x.name, "asc")`
6
+ * at packages/opencode/src/agent/agent.ts. Without intervention, the four
7
+ * core agents collapse into Atlas -> Hephaestus -> Prometheus -> Sisyphus,
8
+ * which inverts the canonical sisyphus -> hephaestus -> prometheus -> atlas
9
+ * order this project ships.
10
+ *
11
+ * Earlier attempts to bias the sort key with invisible characters (ZWSP,
12
+ * U+2060 WORD JOINER, U+00AD SOFT HYPHEN, ANSI escape) caused visible-gap
13
+ * and column-truncation regressions in the TUI status bar (#3259, #3238).
14
+ *
15
+ * This shim is the narrowly-scoped alternative from PR #3267 with the Cubic
16
+ * P1 mitigations applied:
17
+ * 1. `isAgentArray` rejects any array element that is null, non-object, or
18
+ * lacks a string `name`, eliminating the throw-on-mixed-array failure
19
+ * mode that closed the original PR.
20
+ * 2. The activation predicate requires >= 2 elements whose `.name` is one
21
+ * of the four canonical core display names, so unrelated `.sort()` and
22
+ * `.toSorted()` calls (string arrays, number arrays, generic objects)
23
+ * execute native behavior unchanged.
24
+ *
25
+ * Remove this shim once OpenCode honors the agent `order` field
26
+ * (sst/opencode#19127).
27
+ */
28
+ export declare function installAgentSortShim(): void;
@@ -0,0 +1 @@
1
+ export declare const EXCLUDED_DIRS: ReadonlySet<string>;
@@ -1 +1,2 @@
1
+ export declare function resolveFilePath(filePath: string, cwd: string): string;
1
2
  export declare function resolveFileReferencesInText(text: string, cwd?: string, depth?: number, maxDepth?: number): Promise<string>;
@@ -70,3 +70,5 @@ export * from "./plugin-identity";
70
70
  export * from "./log-legacy-plugin-startup-warning";
71
71
  export * from "./task-system-enabled";
72
72
  export * from "./parse-tools-config";
73
+ export { parseModelString } from "./model-string-parser";
74
+ export { EXCLUDED_DIRS } from "./excluded-dirs";
@@ -6,6 +6,11 @@ export interface JsoncParseResult<T> {
6
6
  length: number;
7
7
  }>;
8
8
  }
9
+ type DetectPluginConfigResult = {
10
+ format: "json" | "jsonc" | "none";
11
+ path: string;
12
+ legacyPath?: string;
13
+ };
9
14
  export declare function parseJsonc<T = unknown>(content: string): T;
10
15
  export declare function parseJsoncSafe<T = unknown>(content: string): JsoncParseResult<T>;
11
16
  export declare function readJsoncFile<T = unknown>(filePath: string): T | null;
@@ -13,8 +18,6 @@ export declare function detectConfigFile(basePath: string): {
13
18
  format: "json" | "jsonc" | "none";
14
19
  path: string;
15
20
  };
16
- export declare function detectPluginConfigFile(dir: string): {
17
- format: "json" | "jsonc" | "none";
18
- path: string;
19
- legacyPath?: string;
20
- };
21
+ export declare function clearPluginConfigFileDetectionCache(): void;
22
+ export declare function detectPluginConfigFile(dir: string): DetectPluginConfigResult;
23
+ export {};
@@ -1 +1,2 @@
1
1
  export declare function loadOpencodePlugins(directory: string): string[];
2
+ export declare function clearOpencodePluginsCache(): void;
@@ -17,7 +17,7 @@
17
17
  * {
18
18
  * "appliedMigrations": [
19
19
  * "model-version:openai/gpt-5.3-codex->openai/gpt-5.4",
20
- * "model-version:anthropic/claude-opus-4-5->anthropic/claude-opus-4-6"
20
+ * "model-version:anthropic/claude-opus-4-5->anthropic/claude-opus-4-7"
21
21
  * ]
22
22
  * }
23
23
  */
@@ -0,0 +1,2 @@
1
+ import type { ModelCapabilitiesSnapshotEntry } from "./types";
2
+ export declare const SUPPLEMENTAL_MODEL_CAPABILITIES: Record<string, ModelCapabilitiesSnapshotEntry>;
@@ -9,7 +9,7 @@ export interface PermissionFormat {
9
9
  /**
10
10
  * Creates tool restrictions that deny specified tools.
11
11
  */
12
- export declare function createAgentToolRestrictions(denyTools: string[]): PermissionFormat;
12
+ export declare function createAgentToolRestrictions(denyTools: string[], allowTools?: string[]): PermissionFormat;
13
13
  /**
14
14
  * Creates tool restrictions that ONLY allow specified tools.
15
15
  * All other tools are denied by default using `*: deny` pattern.
@@ -1,8 +1,11 @@
1
1
  type PostHogActivityCaptureState = {
2
2
  dayUTC: string;
3
- hourUTC: string;
4
3
  captureDaily: boolean;
5
- captureHourly: boolean;
4
+ };
5
+ type PluginLoadedCaptureState = {
6
+ dayUTC: string;
7
+ capturePluginLoaded: boolean;
6
8
  };
7
9
  export declare function getPostHogActivityCaptureState(now?: Date): PostHogActivityCaptureState;
10
+ export declare function getPluginLoadedCaptureState(now?: Date): PluginLoadedCaptureState;
8
11
  export {};
@@ -1,4 +1,9 @@
1
1
  import { PostHog } from "posthog-node";
2
+ import { getPostHogActivityCaptureState } from "./posthog-activity-state";
3
+ /** @internal test-only */
4
+ export declare function __setActivityStateProviderForTesting(provider: typeof getPostHogActivityCaptureState): void;
5
+ /** @internal test-only */
6
+ export declare function __resetActivityStateProviderForTesting(): void;
2
7
  type PostHogCaptureEvent = Parameters<PostHog["capture"]>[0];
3
8
  type PostHogExceptionProperties = Parameters<PostHog["captureException"]>[2];
4
9
  type PostHogActivityReason = "run_started" | "plugin_loaded";
@@ -1,3 +1,5 @@
1
+ export declare function clearWorktreeCache(): void;
2
+ export declare function detectWorktreePath(directory: string): string | undefined;
1
3
  export declare function findProjectClaudeSkillDirs(startDirectory: string, stopDirectory?: string): string[];
2
4
  export declare function findProjectAgentsSkillDirs(startDirectory: string, stopDirectory?: string): string[];
3
5
  export declare function findProjectOpencodeSkillDirs(startDirectory: string, stopDirectory?: string): string[];
@@ -0,0 +1,8 @@
1
+ export type GrepBackend = "rg" | "grep";
2
+ export interface ResolvedCli {
3
+ path: string;
4
+ backend: GrepBackend;
5
+ }
6
+ export declare const DEFAULT_RG_THREADS = 4;
7
+ export declare function resolveGrepCli(): ResolvedCli;
8
+ export declare function resolveGrepCliWithAutoInstall(): Promise<ResolvedCli>;
@@ -0,0 +1 @@
1
+ export { killTmuxSessionIfExists } from "./session-kill";
@@ -0,0 +1 @@
1
+ export declare function killTmuxSessionIfExists(sessionName: string): Promise<boolean>;
@@ -1,3 +1,4 @@
1
1
  import type { TmuxConfig } from "../../../config/schema";
2
2
  import type { SpawnPaneResult } from "../types";
3
+ export declare function getIsolatedSessionName(pid?: number): string;
3
4
  export declare function spawnTmuxSession(sessionId: string, description: string, config: TmuxConfig, serverUrl: string, sourcePaneId?: string): Promise<SpawnPaneResult>;
@@ -0,0 +1 @@
1
+ export { spawn } from "bun";
@@ -0,0 +1,11 @@
1
+ export type SweepDeps = {
2
+ isInsideTmux: () => boolean;
3
+ getTmuxPath: () => Promise<string | null | undefined>;
4
+ listCandidateSessions: (tmux: string) => Promise<string[]>;
5
+ killSession: (sessionName: string) => Promise<boolean>;
6
+ processAlive: (pid: number) => boolean;
7
+ currentPid: number;
8
+ log: (message: string, payload?: unknown) => void;
9
+ };
10
+ export declare function sweepStaleOmoAgentSessionsWith(deps: SweepDeps): Promise<number>;
11
+ export declare function sweepStaleOmoAgentSessions(): Promise<number>;
@@ -7,5 +7,7 @@ export { spawnTmuxPane } from "./tmux-utils/pane-spawn";
7
7
  export { closeTmuxPane } from "./tmux-utils/pane-close";
8
8
  export { replaceTmuxPane } from "./tmux-utils/pane-replace";
9
9
  export { spawnTmuxWindow } from "./tmux-utils/window-spawn";
10
- export { spawnTmuxSession } from "./tmux-utils/session-spawn";
10
+ export { spawnTmuxSession, getIsolatedSessionName } from "./tmux-utils/session-spawn";
11
+ export { killTmuxSessionIfExists } from "./tmux-utils/session-kill";
12
+ export { sweepStaleOmoAgentSessions } from "./tmux-utils/stale-session-sweep";
11
13
  export { applyLayout, enforceMainPaneWidth } from "./tmux-utils/layout";
@@ -0,0 +1,4 @@
1
+ import type { CliLanguage } from "./types";
2
+ export declare function detectRegexMisuse(pattern: string): string | null;
3
+ export declare function detectLanguageSpecificMistake(pattern: string, lang: CliLanguage): string | null;
4
+ export declare function getPatternHint(pattern: string, lang: CliLanguage): string | null;
@@ -0,0 +1,3 @@
1
+ export declare const AST_GREP_SEARCH_DESCRIPTION: string;
2
+ export declare const AST_GREP_SEARCH_PATTERN_PARAM = "AST pattern - valid, parseable code using $VAR (one node) and $$$ (many nodes). NOT regex: no `|`, no `.*`, no `\\w`, no `[a-z]`. For text or alternation, use grep instead.";
3
+ export declare const AST_GREP_REPLACE_DESCRIPTION: string;
@@ -1,6 +1,5 @@
1
1
  import type { CallOmoAgentArgs } from "./types";
2
2
  import type { PluginInput } from "@opencode-ai/plugin";
3
- import { clearSessionFallbackChain, setSessionFallbackChain } from "../../hooks/model-fallback/hook";
4
3
  import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
5
4
  import type { FallbackEntry } from "../../shared/model-requirements";
6
5
  import { waitForCompletion } from "./completion-poller";
@@ -10,8 +9,8 @@ type ExecuteSyncDeps = {
10
9
  createOrGetSession: typeof createOrGetSession;
11
10
  waitForCompletion: typeof waitForCompletion;
12
11
  processMessages: typeof processMessages;
13
- setSessionFallbackChain: typeof setSessionFallbackChain;
14
- clearSessionFallbackChain: typeof clearSessionFallbackChain;
12
+ setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
13
+ clearSessionFallbackChain: (sessionID: string) => void;
15
14
  };
16
15
  type SpawnReservation = {
17
16
  commit: () => number;
@@ -1,4 +1,5 @@
1
1
  import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
+ import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
3
4
  import type { CategoriesConfig, AgentOverrides } from "../../config/schema";
4
- export declare function createCallOmoAgent(ctx: PluginInput, backgroundManager: BackgroundManager, disabledAgents?: string[], agentOverrides?: AgentOverrides, userCategories?: CategoriesConfig): ToolDefinition;
5
+ export declare function createCallOmoAgent(ctx: PluginInput, backgroundManager: BackgroundManager, disabledAgents?: string[], agentOverrides?: AgentOverrides, userCategories?: CategoriesConfig, modelFallbackControllerAccessor?: ModelFallbackControllerAccessor): ToolDefinition;
@@ -1,3 +1,3 @@
1
1
  import type { DelegateTaskArgs, ToolContextWithMetadata } from "./types";
2
2
  import type { ExecutorContext, ParentContext } from "./executor-types";
3
- export declare function executeBackgroundContinuation(args: DelegateTaskArgs, ctx: ToolContextWithMetadata, executorCtx: ExecutorContext, parentContext: ParentContext): Promise<string>;
3
+ export declare function executeBackgroundContinuation(args: DelegateTaskArgs, ctx: ToolContextWithMetadata, executorCtx: ExecutorContext, parentContext: ParentContext, systemContent?: string): Promise<string>;
@@ -1,5 +1,6 @@
1
1
  import type { BackgroundManager } from "../../features/background-agent";
2
2
  import type { CategoriesConfig, GitMasterConfig, BrowserAutomationProvider, AgentOverrides, SisyphusAgentConfig } from "../../config/schema";
3
+ import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
3
4
  import type { OpencodeClient } from "./types";
4
5
  export interface ExecutorContext {
5
6
  manager: BackgroundManager;
@@ -11,6 +12,7 @@ export interface ExecutorContext {
11
12
  browserProvider?: BrowserAutomationProvider;
12
13
  agentOverrides?: AgentOverrides;
13
14
  sisyphusAgentConfig?: SisyphusAgentConfig;
15
+ modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
14
16
  onSyncSessionCreated?: (event: {
15
17
  sessionID: string;
16
18
  parentID: string;
@@ -0,0 +1,9 @@
1
+ import type { DelegatedModelConfig } from "./types";
2
+ interface MetadataModel {
3
+ providerID: string;
4
+ modelID: string;
5
+ variant?: string;
6
+ }
7
+ type ModelLike = Pick<DelegatedModelConfig, "providerID" | "modelID" | "variant"> | MetadataModel;
8
+ export declare function resolveMetadataModel(primary: ModelLike | undefined, fallback: ModelLike | undefined): MetadataModel | undefined;
9
+ export {};
@@ -1,4 +1,4 @@
1
1
  import type { DelegateTaskArgs, ToolContextWithMetadata } from "./types";
2
- import type { ExecutorContext } from "./executor-types";
2
+ import type { ExecutorContext, ParentContext } from "./executor-types";
3
3
  import { type SyncContinuationDeps } from "./sync-continuation-deps";
4
- export declare function executeSyncContinuation(args: DelegateTaskArgs, ctx: ToolContextWithMetadata, executorCtx: ExecutorContext, deps?: SyncContinuationDeps): Promise<string>;
4
+ export declare function executeSyncContinuation(args: DelegateTaskArgs, ctx: ToolContextWithMetadata, executorCtx: ExecutorContext, parentContext: ParentContext, deps?: SyncContinuationDeps, systemContent?: string): Promise<string>;
@@ -0,0 +1,2 @@
1
+ import type { DelegateTaskArgs } from "./types";
2
+ export declare function getTaskID(args: Pick<DelegateTaskArgs, "task_id">): string | undefined;
@@ -0,0 +1,2 @@
1
+ import type { DelegateTaskArgs, ToolContextWithMetadata } from "./types";
2
+ export declare function prepareDelegateTaskArgs(args: Record<string, unknown>, ctx: ToolContextWithMetadata): Promise<DelegateTaskArgs>;
@@ -0,0 +1,9 @@
1
+ import type { AvailableCategory, AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
2
+ import type { DelegateTaskToolOptions } from "./types";
3
+ export interface DelegateTaskPresentation {
4
+ availableCategories: AvailableCategory[];
5
+ availableSkills: AvailableSkill[];
6
+ categoryExamples: string;
7
+ description: string;
8
+ }
9
+ export declare function createDelegateTaskPresentation(options: DelegateTaskToolOptions): DelegateTaskPresentation;
@@ -1,6 +1,7 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { BackgroundManager } from "../../features/background-agent";
3
3
  import type { CategoriesConfig, GitMasterConfig, BrowserAutomationProvider, AgentOverrides, SisyphusAgentConfig } from "../../config/schema";
4
+ import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
4
5
  import type { AvailableCategory, AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
5
6
  export type OpencodeClient = PluginInput["client"];
6
7
  export interface DelegateTaskArgs {
@@ -8,14 +9,11 @@ export interface DelegateTaskArgs {
8
9
  prompt: string;
9
10
  category?: string;
10
11
  subagent_type?: string;
12
+ requested_subagent_type?: string;
11
13
  run_in_background: boolean;
12
- session_id?: string;
14
+ task_id?: string;
13
15
  command?: string;
14
16
  load_skills: string[];
15
- execute?: {
16
- task_id: string;
17
- task_dir?: string;
18
- };
19
17
  }
20
18
  export interface ToolContextWithMetadata {
21
19
  sessionID: string;
@@ -63,6 +61,7 @@ export interface DelegateTaskToolOptions {
63
61
  availableSkills?: AvailableSkill[];
64
62
  agentOverrides?: AgentOverrides;
65
63
  sisyphusAgentConfig?: SisyphusAgentConfig;
64
+ modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
66
65
  onSyncSessionCreated?: (event: SyncSessionCreatedEvent) => Promise<void>;
67
66
  syncPollTimeoutMs?: number;
68
67
  }
@@ -1,4 +1,4 @@
1
- export { resolveGrepCli, resolveGrepCliWithAutoInstall, type GrepBackend, DEFAULT_RG_THREADS } from "../grep/constants";
1
+ export { resolveGrepCli, resolveGrepCliWithAutoInstall, type GrepBackend, DEFAULT_RG_THREADS } from "../../shared/ripgrep-cli";
2
2
  export declare const DEFAULT_TIMEOUT_MS = 60000;
3
3
  export declare const DEFAULT_LIMIT = 100;
4
4
  export declare const DEFAULT_MAX_DEPTH = 20;
@@ -1,4 +1,4 @@
1
- import { type ResolvedCli } from "./constants";
1
+ import { type ResolvedCli } from "../../shared/ripgrep-cli";
2
2
  import type { GrepOptions, GrepResult, CountResult } from "./types";
3
3
  export declare function runRg(options: GrepOptions, resolvedCli?: ResolvedCli): Promise<GrepResult>;
4
4
  export declare function runRgCount(options: Omit<GrepOptions, "context">, resolvedCli?: ResolvedCli): Promise<CountResult[]>;
@@ -1,10 +1,3 @@
1
- export type GrepBackend = "rg" | "grep";
2
- export interface ResolvedCli {
3
- path: string;
4
- backend: GrepBackend;
5
- }
6
- export declare function resolveGrepCli(): ResolvedCli;
7
- export declare function resolveGrepCliWithAutoInstall(): Promise<ResolvedCli>;
8
1
  export declare const DEFAULT_MAX_DEPTH = 20;
9
2
  export declare const DEFAULT_MAX_FILESIZE = "10M";
10
3
  export declare const DEFAULT_MAX_COUNT = 500;
@@ -12,6 +5,5 @@ export declare const DEFAULT_MAX_COLUMNS = 1000;
12
5
  export declare const DEFAULT_CONTEXT = 2;
13
6
  export declare const DEFAULT_TIMEOUT_MS = 60000;
14
7
  export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
15
- export declare const DEFAULT_RG_THREADS = 4;
16
8
  export declare const RG_SAFETY_FLAGS: readonly ["--no-follow", "--color=never", "--no-heading", "--line-number", "--with-filename"];
17
9
  export declare const GREP_SAFETY_FLAGS: readonly ["-n", "-H", "--color=never"];
@@ -0,0 +1,22 @@
1
+ import type { LookAtArgs } from "./types";
2
+ export interface LookAtFilePart {
3
+ type: "file";
4
+ mime: string;
5
+ url: string;
6
+ filename: string;
7
+ }
8
+ export interface PreparedLookAtInput {
9
+ readonly filePart: LookAtFilePart;
10
+ readonly isBase64Input: boolean;
11
+ readonly sourceDescription: string;
12
+ cleanup(): void;
13
+ }
14
+ type PrepareLookAtInputResult = {
15
+ ok: true;
16
+ value: PreparedLookAtInput;
17
+ } | {
18
+ ok: false;
19
+ error: string;
20
+ };
21
+ export declare function prepareLookAtInput(args: LookAtArgs): PrepareLookAtInputResult;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const READ_ENABLED = false;
2
+ export declare function buildLookAtPrompt(goal: string, isBase64Input: boolean): string;
@@ -0,0 +1,12 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { ToolContext } from "@opencode-ai/plugin/tool";
3
+ import type { LookAtFilePart } from "./look-at-input-preparer";
4
+ interface RunLookAtSessionInput {
5
+ ctx: PluginInput;
6
+ toolContext: ToolContext;
7
+ goal: string;
8
+ filePart: LookAtFilePart;
9
+ isBase64Input: boolean;
10
+ }
11
+ export declare function runLookAtSession({ ctx, toolContext, goal, filePart, isBase64Input, }: RunLookAtSessionInput): Promise<string>;
12
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { SkillInfo } from "./types";
2
2
  import type { CommandInfo } from "../slashcommand/types";
3
- export declare function formatCombinedDescription(skills: SkillInfo[], commands: CommandInfo[]): string;
3
+ export declare function formatCombinedDescription(skills?: SkillInfo[], commands?: CommandInfo[]): string;
@@ -0,0 +1 @@
1
+ export declare function shouldInvalidateSkillCacheForSession(sessionID?: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function parseSkillMcpArguments(argsJson: string | Record<string, unknown> | undefined): Record<string, unknown>;
@@ -0,0 +1,6 @@
1
+ export { EXCLUDED_DIRS } from "../../shared/excluded-dirs";
2
+ export { parseFrontmatter } from "../../shared/frontmatter";
3
+ export { sanitizeModelField } from "../../shared/model-sanitizer";
4
+ export { getOpenCodeCommandDirs } from "../../shared/opencode-command-dirs";
5
+ export { discoverPluginCommandDefinitions } from "../../shared/plugin-command-discovery";
6
+ export { findProjectOpencodeCommandDirs } from "../../shared/project-discovery-dirs";
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.17.4",
3
+ "version": "3.17.6",
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",
7
7
  "type": "module",
8
8
  "bin": {
9
- "oh-my-opencode": "bin/oh-my-opencode.js"
9
+ "oh-my-opencode": "bin/oh-my-opencode.js",
10
+ "oh-my-openagent": "bin/oh-my-opencode.js"
10
11
  },
11
12
  "files": [
12
13
  "dist",
@@ -21,7 +22,7 @@
21
22
  "./schema.json": "./dist/oh-my-opencode.schema.json"
22
23
  },
23
24
  "scripts": {
24
- "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
25
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external zod && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
25
26
  "build:all": "bun run build && bun run build:binaries",
26
27
  "build:binaries": "bun run script/build-binaries.ts",
27
28
  "build:schema": "bun run script/build-schema.ts",
@@ -69,32 +70,35 @@
69
70
  "picocolors": "^1.1.1",
70
71
  "picomatch": "^4.0.2",
71
72
  "posthog-node": "^5.29.2",
72
- "vscode-jsonrpc": "^8.2.0",
73
- "zod": "^4.3.0"
73
+ "vscode-jsonrpc": "^8.2.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/js-yaml": "^4.0.9",
77
77
  "@types/picomatch": "^3.0.2",
78
78
  "bun-types": "1.3.11",
79
- "typescript": "^5.7.3"
79
+ "typescript": "^5.7.3",
80
+ "zod": "^4.3.0"
80
81
  },
81
82
  "optionalDependencies": {
82
- "oh-my-opencode-darwin-arm64": "3.17.4",
83
- "oh-my-opencode-darwin-x64": "3.17.4",
84
- "oh-my-opencode-darwin-x64-baseline": "3.17.4",
85
- "oh-my-opencode-linux-arm64": "3.17.4",
86
- "oh-my-opencode-linux-arm64-musl": "3.17.4",
87
- "oh-my-opencode-linux-x64": "3.17.4",
88
- "oh-my-opencode-linux-x64-baseline": "3.17.4",
89
- "oh-my-opencode-linux-x64-musl": "3.17.4",
90
- "oh-my-opencode-linux-x64-musl-baseline": "3.17.4",
91
- "oh-my-opencode-windows-x64": "3.17.4",
92
- "oh-my-opencode-windows-x64-baseline": "3.17.4"
83
+ "oh-my-opencode-darwin-arm64": "3.17.6",
84
+ "oh-my-opencode-darwin-x64": "3.17.6",
85
+ "oh-my-opencode-darwin-x64-baseline": "3.17.6",
86
+ "oh-my-opencode-linux-arm64": "3.17.6",
87
+ "oh-my-opencode-linux-arm64-musl": "3.17.6",
88
+ "oh-my-opencode-linux-x64": "3.17.6",
89
+ "oh-my-opencode-linux-x64-baseline": "3.17.6",
90
+ "oh-my-opencode-linux-x64-musl": "3.17.6",
91
+ "oh-my-opencode-linux-x64-musl-baseline": "3.17.6",
92
+ "oh-my-opencode-windows-x64": "3.17.6",
93
+ "oh-my-opencode-windows-x64-baseline": "3.17.6"
93
94
  },
94
95
  "overrides": {},
95
96
  "trustedDependencies": [
96
97
  "@ast-grep/cli",
97
98
  "@ast-grep/napi",
98
99
  "@code-yeongyu/comment-checker"
99
- ]
100
+ ],
101
+ "peerDependencies": {
102
+ "zod": "^4.0.0"
103
+ }
100
104
  }
@@ -1,9 +0,0 @@
1
- import type { TmuxConfig } from "../../config/schema";
2
- import type { TrackedSession } from "./types";
3
- export declare function cleanupTmuxSessions(params: {
4
- tmuxConfig: TmuxConfig;
5
- serverUrl: string;
6
- sourcePaneId: string | undefined;
7
- sessions: Map<string, TrackedSession>;
8
- stopPolling: () => void;
9
- }): Promise<void>;
@@ -1,22 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { TmuxConfig } from "../../config/schema";
3
- import type { CapacityConfig, TrackedSession } from "./types";
4
- import { type SessionMapping } from "./decision-engine";
5
- import type { SessionCreatedEvent } from "./session-created-event";
6
- type OpencodeClient = PluginInput["client"];
7
- export interface SessionCreatedHandlerDeps {
8
- client: OpencodeClient;
9
- tmuxConfig: TmuxConfig;
10
- serverUrl: string;
11
- sourcePaneId: string | undefined;
12
- sessions: Map<string, TrackedSession>;
13
- pendingSessions: Set<string>;
14
- isInsideTmux: () => boolean;
15
- isEnabled: () => boolean;
16
- getCapacityConfig: () => CapacityConfig;
17
- getSessionMappings: () => SessionMapping[];
18
- waitForSessionReady: (sessionId: string) => Promise<boolean>;
19
- startPolling: () => void;
20
- }
21
- export declare function handleSessionCreated(deps: SessionCreatedHandlerDeps, event: SessionCreatedEvent): Promise<void>;
22
- export {};
@@ -1,15 +0,0 @@
1
- import type { TmuxConfig } from "../../config/schema";
2
- import type { TrackedSession } from "./types";
3
- import { type SessionMapping } from "./decision-engine";
4
- export interface SessionDeletedHandlerDeps {
5
- tmuxConfig: TmuxConfig;
6
- serverUrl: string;
7
- sourcePaneId: string | undefined;
8
- sessions: Map<string, TrackedSession>;
9
- isEnabled: () => boolean;
10
- getSessionMappings: () => SessionMapping[];
11
- stopPolling: () => void;
12
- }
13
- export declare function handleSessionDeleted(deps: SessionDeletedHandlerDeps, event: {
14
- sessionID: string;
15
- }): Promise<void>;