oh-my-opencode 3.1.8 → 3.1.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.
@@ -32,3 +32,4 @@ export * from "./connected-providers-cache";
32
32
  export * from "./case-insensitive";
33
33
  export * from "./session-utils";
34
34
  export * from "./tmux";
35
+ export * from "./model-suggestion-retry";
@@ -1,6 +1,14 @@
1
1
  export declare function fuzzyMatchModel(target: string, available: Set<string>, providers?: string[]): string | null;
2
+ /**
3
+ * Check if a target model is available (fuzzy match by model name, no provider filtering)
4
+ *
5
+ * @param targetModel - Model name to check (e.g., "gpt-5.2-codex")
6
+ * @param availableModels - Set of available models in "provider/model" format
7
+ * @returns true if model is available, false otherwise
8
+ */
9
+ export declare function isModelAvailable(targetModel: string, availableModels: Set<string>): boolean;
2
10
  export declare function getConnectedProviders(client: any): Promise<string[]>;
3
- export declare function fetchAvailableModels(_client?: any, options?: {
11
+ export declare function fetchAvailableModels(client?: any, options?: {
4
12
  connectedProviders?: string[] | null;
5
13
  }): Promise<Set<string>>;
6
14
  export declare function __resetModelCache(): void;
@@ -6,6 +6,7 @@ export type FallbackEntry = {
6
6
  export type ModelRequirement = {
7
7
  fallbackChain: FallbackEntry[];
8
8
  variant?: string;
9
+ requiresModel?: string;
9
10
  };
10
11
  export declare const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
11
12
  export declare const CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
@@ -4,7 +4,7 @@ export type ModelResolutionInput = {
4
4
  inheritedModel?: string;
5
5
  systemDefault?: string;
6
6
  };
7
- export type ModelSource = "override" | "provider-fallback" | "system-default";
7
+ export type ModelSource = "override" | "category-default" | "provider-fallback" | "system-default";
8
8
  export type ModelResolutionResult = {
9
9
  model: string;
10
10
  source: ModelSource;
@@ -13,6 +13,7 @@ export type ModelResolutionResult = {
13
13
  export type ExtendedModelResolutionInput = {
14
14
  uiSelectedModel?: string;
15
15
  userModel?: string;
16
+ categoryDefaultModel?: string;
16
17
  fallbackChain?: FallbackEntry[];
17
18
  availableModels: Set<string>;
18
19
  systemDefaultModel?: string;
@@ -0,0 +1,24 @@
1
+ import type { createOpencodeClient } from "@opencode-ai/sdk";
2
+ type Client = ReturnType<typeof createOpencodeClient>;
3
+ export interface ModelSuggestionInfo {
4
+ providerID: string;
5
+ modelID: string;
6
+ suggestion: string;
7
+ }
8
+ export declare function parseModelSuggestion(error: unknown): ModelSuggestionInfo | null;
9
+ interface PromptBody {
10
+ model?: {
11
+ providerID: string;
12
+ modelID: string;
13
+ };
14
+ [key: string]: unknown;
15
+ }
16
+ interface PromptArgs {
17
+ path: {
18
+ id: string;
19
+ };
20
+ body: PromptBody;
21
+ [key: string]: unknown;
22
+ }
23
+ export declare function promptWithModelSuggestionRetry(client: Client, args: PromptArgs): Promise<void>;
24
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,12 @@
1
1
  import type { CategoryConfig } from "../../config/schema";
2
2
  export declare const VISUAL_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on VISUAL/UI tasks.\n\nDesign-first mindset:\n- Bold aesthetic choices over safe defaults\n- Unexpected layouts, asymmetry, grid-breaking elements\n- Distinctive typography (avoid: Arial, Inter, Roboto, Space Grotesk)\n- Cohesive color palettes with sharp accents\n- High-impact animations with staggered reveals\n- Atmosphere: gradient meshes, noise textures, layered transparencies\n\nAVOID: Generic fonts, purple gradients on white, predictable layouts, cookie-cutter patterns.\n</Category_Context>";
3
- export declare const STRATEGIC_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on BUSINESS LOGIC / ARCHITECTURE tasks.\n\nStrategic advisor mindset:\n- Bias toward simplicity: least complex solution that fulfills requirements\n- Leverage existing code/patterns over new components\n- Prioritize developer experience and maintainability\n- One clear recommendation with effort estimate (Quick/Short/Medium/Large)\n- Signal when advanced approach warranted\n\nResponse format:\n- Bottom line (2-3 sentences)\n- Action plan (numbered steps)\n- Risks and mitigations (if relevant)\n</Category_Context>";
3
+ export declare const ULTRABRAIN_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on DEEP LOGICAL REASONING / COMPLEX ARCHITECTURE tasks.\n\n**CRITICAL - CODE STYLE REQUIREMENTS (NON-NEGOTIABLE)**:\n1. BEFORE writing ANY code, SEARCH the existing codebase to find similar patterns/styles\n2. Your code MUST match the project's existing conventions - blend in seamlessly\n3. Write READABLE code that humans can easily understand - no clever tricks\n4. If unsure about style, explore more files until you find the pattern\n\nStrategic advisor mindset:\n- Bias toward simplicity: least complex solution that fulfills requirements\n- Leverage existing code/patterns over new components\n- Prioritize developer experience and maintainability\n- One clear recommendation with effort estimate (Quick/Short/Medium/Large)\n- Signal when advanced approach warranted\n\nResponse format:\n- Bottom line (2-3 sentences)\n- Action plan (numbered steps)\n- Risks and mitigations (if relevant)\n</Category_Context>";
4
4
  export declare const ARTISTRY_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on HIGHLY CREATIVE / ARTISTIC tasks.\n\nArtistic genius mindset:\n- Push far beyond conventional boundaries\n- Explore radical, unconventional directions\n- Surprise and delight: unexpected twists, novel combinations\n- Rich detail and vivid expression\n- Break patterns deliberately when it serves the creative vision\n\nApproach:\n- Generate diverse, bold options first\n- Embrace ambiguity and wild experimentation\n- Balance novelty with coherence\n- This is for tasks requiring exceptional creativity\n</Category_Context>";
5
5
  export declare const QUICK_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on SMALL / QUICK tasks.\n\nEfficient execution mindset:\n- Fast, focused, minimal overhead\n- Get to the point immediately\n- No over-engineering\n- Simple solutions for simple problems\n\nApproach:\n- Minimal viable implementation\n- Skip unnecessary abstractions\n- Direct and concise\n</Category_Context>\n\n<Caller_Warning>\nTHIS CATEGORY USES A LESS CAPABLE MODEL (claude-haiku-4-5).\n\nThe model executing this task has LIMITED reasoning capacity. Your prompt MUST be:\n\n**EXHAUSTIVELY EXPLICIT** - Leave NOTHING to interpretation:\n1. MUST DO: List every required action as atomic, numbered steps\n2. MUST NOT DO: Explicitly forbid likely mistakes and deviations\n3. EXPECTED OUTPUT: Describe exact success criteria with concrete examples\n\n**WHY THIS MATTERS:**\n- Less capable models WILL deviate without explicit guardrails\n- Vague instructions \u2192 unpredictable results\n- Implicit expectations \u2192 missed requirements\n\n**PROMPT STRUCTURE (MANDATORY):**\n```\nTASK: [One-sentence goal]\n\nMUST DO:\n1. [Specific action with exact details]\n2. [Another specific action]\n...\n\nMUST NOT DO:\n- [Forbidden action + why]\n- [Another forbidden action]\n...\n\nEXPECTED OUTPUT:\n- [Exact deliverable description]\n- [Success criteria / verification method]\n```\n\nIf your prompt lacks this structure, REWRITE IT before delegating.\n</Caller_Warning>";
6
6
  export declare const UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on tasks that don't fit specific categories but require moderate effort.\n\n<Selection_Gate>\nBEFORE selecting this category, VERIFY ALL conditions:\n1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)\n2. Task requires more than trivial effort but is NOT system-wide\n3. Scope is contained within a few files/modules\n\nIf task fits ANY other category, DO NOT select unspecified-low.\nThis is NOT a default choice - it's for genuinely unclassifiable moderate-effort work.\n</Selection_Gate>\n</Category_Context>\n\n<Caller_Warning>\nTHIS CATEGORY USES A MID-TIER MODEL (claude-sonnet-4-5).\n\n**PROVIDE CLEAR STRUCTURE:**\n1. MUST DO: Enumerate required actions explicitly\n2. MUST NOT DO: State forbidden actions to prevent scope creep\n3. EXPECTED OUTPUT: Define concrete success criteria\n</Caller_Warning>";
7
7
  export declare const UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on tasks that don't fit specific categories but require substantial effort.\n\n<Selection_Gate>\nBEFORE selecting this category, VERIFY ALL conditions:\n1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)\n2. Task requires substantial effort across multiple systems/modules\n3. Changes have broad impact or require careful coordination\n4. NOT just \"complex\" - must be genuinely unclassifiable AND high-effort\n\nIf task fits ANY other category, DO NOT select unspecified-high.\nIf task is unclassifiable but moderate-effort, use unspecified-low instead.\n</Selection_Gate>\n</Category_Context>";
8
8
  export declare const WRITING_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on WRITING / PROSE tasks.\n\nWordsmith mindset:\n- Clear, flowing prose\n- Appropriate tone and voice\n- Engaging and readable\n- Proper structure and organization\n\nApproach:\n- Understand the audience\n- Draft with care\n- Polish for clarity and impact\n- Documentation, READMEs, articles, technical writing\n</Category_Context>";
9
+ export declare const DEEP_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on GOAL-ORIENTED AUTONOMOUS tasks.\n\n**CRITICAL - AUTONOMOUS EXECUTION MINDSET (NON-NEGOTIABLE)**:\nYou are NOT an interactive assistant. You are an autonomous problem-solver.\n\n**BEFORE making ANY changes**:\n1. SILENTLY explore the codebase extensively (5-15 minutes of reading is normal)\n2. Read related files, trace dependencies, understand the full context\n3. Build a complete mental model of the problem space\n4. DO NOT ask clarifying questions - the goal is already defined\n\n**Autonomous executor mindset**:\n- You receive a GOAL, not step-by-step instructions\n- Figure out HOW to achieve the goal yourself\n- Thorough research before any action\n- Fix hairy problems that require deep understanding\n- Work independently without frequent check-ins\n\n**Approach**:\n- Explore extensively, understand deeply, then act decisively\n- Prefer comprehensive solutions over quick patches\n- If the goal is unclear, make reasonable assumptions and proceed\n- Document your reasoning in code comments only when non-obvious\n\n**Response format**:\n- Minimal status updates (user trusts your autonomy)\n- Focus on results, not play-by-play progress\n- Report completion with summary of changes made\n</Category_Context>";
9
10
  export declare const DEFAULT_CATEGORIES: Record<string, CategoryConfig>;
10
11
  export declare const CATEGORY_PROMPT_APPENDS: Record<string, string>;
11
12
  export declare const CATEGORY_DESCRIPTIONS: Record<string, string>;
@@ -6,6 +6,7 @@ export declare function resolveCategoryConfig(categoryName: string, options: {
6
6
  userCategories?: CategoriesConfig;
7
7
  inheritedModel?: string;
8
8
  systemDefaultModel?: string;
9
+ availableModels?: Set<string>;
9
10
  }): {
10
11
  config: CategoryConfig;
11
12
  promptAppend: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "3.1.8",
3
+ "version": "3.1.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",
@@ -74,13 +74,13 @@
74
74
  "typescript": "^5.7.3"
75
75
  },
76
76
  "optionalDependencies": {
77
- "oh-my-opencode-darwin-arm64": "3.1.8",
78
- "oh-my-opencode-darwin-x64": "3.1.8",
79
- "oh-my-opencode-linux-arm64": "3.1.8",
80
- "oh-my-opencode-linux-arm64-musl": "3.1.8",
81
- "oh-my-opencode-linux-x64": "3.1.8",
82
- "oh-my-opencode-linux-x64-musl": "3.1.8",
83
- "oh-my-opencode-windows-x64": "3.1.8"
77
+ "oh-my-opencode-darwin-arm64": "3.1.9",
78
+ "oh-my-opencode-darwin-x64": "3.1.9",
79
+ "oh-my-opencode-linux-arm64": "3.1.9",
80
+ "oh-my-opencode-linux-arm64-musl": "3.1.9",
81
+ "oh-my-opencode-linux-x64": "3.1.9",
82
+ "oh-my-opencode-linux-x64-musl": "3.1.9",
83
+ "oh-my-opencode-windows-x64": "3.1.9"
84
84
  },
85
85
  "trustedDependencies": [
86
86
  "@ast-grep/cli",