oh-my-opencode 2.6.2 → 2.7.1

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.
@@ -1,15 +1,14 @@
1
1
  /**
2
- * Returns the user-level data directory based on the OS.
3
- * - Linux/macOS: XDG_DATA_HOME or ~/.local/share
4
- * - Windows: %LOCALAPPDATA%
2
+ * Returns the user-level data directory.
3
+ * Matches OpenCode's behavior via xdg-basedir:
4
+ * - All platforms: XDG_DATA_HOME or ~/.local/share
5
5
  *
6
- * This follows XDG Base Directory specification on Unix systems
7
- * and Windows conventions on Windows.
6
+ * Note: OpenCode uses xdg-basedir which returns ~/.local/share on ALL platforms
7
+ * including Windows, so we match that behavior exactly.
8
8
  */
9
9
  export declare function getDataDir(): string;
10
10
  /**
11
11
  * Returns the OpenCode storage directory path.
12
- * - Linux/macOS: ~/.local/share/opencode/storage
13
- * - Windows: %LOCALAPPDATA%\opencode\storage
12
+ * All platforms: ~/.local/share/opencode/storage
14
13
  */
15
14
  export declare function getOpenCodeStorageDir(): string;
@@ -1,7 +1,6 @@
1
1
  export declare function findSgCliPathSync(): string | null;
2
2
  export declare function getSgCliPath(): string;
3
3
  export declare function setSgCliPath(path: string): void;
4
- export declare const SG_CLI_PATH: string;
5
4
  export declare const CLI_LANGUAGES: readonly ["bash", "c", "cpp", "csharp", "css", "elixir", "go", "haskell", "html", "java", "javascript", "json", "kotlin", "lua", "nix", "php", "python", "ruby", "rust", "scala", "solidity", "swift", "typescript", "tsx", "yaml"];
6
5
  export declare const NAPI_LANGUAGES: readonly ["html", "javascript", "tsx", "css", "typescript"];
7
6
  export declare const DEFAULT_TIMEOUT_MS = 300000;
@@ -1,5 +1,4 @@
1
- import type { ResolvedServer } from "./config";
2
- import type { Diagnostic } from "./types";
1
+ import type { Diagnostic, ResolvedServer } from "./types";
3
2
  declare class LSPServerManager {
4
3
  private static instance;
5
4
  private clients;
@@ -1,12 +1,5 @@
1
- export interface ResolvedServer {
2
- id: string;
3
- command: string[];
4
- extensions: string[];
5
- priority: number;
6
- env?: Record<string, string>;
7
- initialization?: Record<string, unknown>;
8
- }
9
- export declare function findServerForExtension(ext: string): ResolvedServer | null;
1
+ import type { ServerLookupResult } from "./types";
2
+ export declare function findServerForExtension(ext: string): ServerLookupResult;
10
3
  export declare function getLanguageId(ext: string): string;
11
4
  export declare function isServerInstalled(command: string[]): boolean;
12
5
  export declare function getAllServers(): Array<{
@@ -4,5 +4,6 @@ export declare const SEVERITY_MAP: Record<number, string>;
4
4
  export declare const DEFAULT_MAX_REFERENCES = 200;
5
5
  export declare const DEFAULT_MAX_SYMBOLS = 200;
6
6
  export declare const DEFAULT_MAX_DIAGNOSTICS = 200;
7
+ export declare const LSP_INSTALL_HINTS: Record<string, string>;
7
8
  export declare const BUILTIN_SERVERS: Record<string, Omit<LSPServerConfig, "id">>;
8
9
  export declare const EXT_TO_LANG: Record<string, string>;
@@ -129,3 +129,28 @@ export interface CodeAction {
129
129
  command?: Command;
130
130
  data?: unknown;
131
131
  }
132
+ export interface ServerLookupInfo {
133
+ id: string;
134
+ command: string[];
135
+ extensions: string[];
136
+ }
137
+ export type ServerLookupResult = {
138
+ status: "found";
139
+ server: ResolvedServer;
140
+ } | {
141
+ status: "not_configured";
142
+ extension: string;
143
+ availableServers: string[];
144
+ } | {
145
+ status: "not_installed";
146
+ server: ServerLookupInfo;
147
+ installHint: string;
148
+ };
149
+ export interface ResolvedServer {
150
+ id: string;
151
+ command: string[];
152
+ extensions: string[];
153
+ priority: number;
154
+ env?: Record<string, string>;
155
+ initialization?: Record<string, unknown>;
156
+ }
@@ -1,6 +1,9 @@
1
1
  import { LSPClient } from "./client";
2
- import type { HoverResult, DocumentSymbol, SymbolInfo, Location, LocationLink, Diagnostic, PrepareRenameResult, PrepareRenameDefaultBehavior, Range, WorkspaceEdit, TextEdit, CodeAction, Command } from "./types";
2
+ import type { HoverResult, DocumentSymbol, SymbolInfo, Location, LocationLink, Diagnostic, PrepareRenameResult, PrepareRenameDefaultBehavior, Range, WorkspaceEdit, TextEdit, CodeAction, Command, ServerLookupResult } from "./types";
3
3
  export declare function findWorkspaceRoot(filePath: string): string;
4
+ export declare function formatServerLookupError(result: Exclude<ServerLookupResult, {
5
+ status: "found";
6
+ }>): string;
4
7
  export declare function withLspClient<T>(filePath: string, fn: (client: LSPClient) => Promise<T>): Promise<T>;
5
8
  export declare function formatHoverResult(result: HoverResult | null): string;
6
9
  export declare function formatLocation(loc: Location | LocationLink): string;
@@ -1,8 +1,8 @@
1
1
  import type { SessionMessage, SessionInfo, TodoItem } from "./types";
2
- export declare function getAllSessions(): string[];
2
+ export declare function getAllSessions(): Promise<string[]>;
3
3
  export declare function getMessageDir(sessionID: string): string;
4
4
  export declare function sessionExists(sessionID: string): boolean;
5
- export declare function readSessionMessages(sessionID: string): SessionMessage[];
6
- export declare function readSessionTodos(sessionID: string): TodoItem[];
7
- export declare function readSessionTranscript(sessionID: string): number;
8
- export declare function getSessionInfo(sessionID: string): SessionInfo | null;
5
+ export declare function readSessionMessages(sessionID: string): Promise<SessionMessage[]>;
6
+ export declare function readSessionTodos(sessionID: string): Promise<TodoItem[]>;
7
+ export declare function readSessionTranscript(sessionID: string): Promise<number>;
8
+ export declare function getSessionInfo(sessionID: string): Promise<SessionInfo | null>;
@@ -1,5 +1,5 @@
1
1
  import type { SessionInfo, SessionMessage, SearchResult } from "./types";
2
- export declare function formatSessionList(sessionIDs: string[]): string;
2
+ export declare function formatSessionList(sessionIDs: string[]): Promise<string>;
3
3
  export declare function formatSessionMessages(messages: SessionMessage[], includeTodos?: boolean, todos?: Array<{
4
4
  id: string;
5
5
  content: string;
@@ -7,5 +7,5 @@ export declare function formatSessionMessages(messages: SessionMessage[], includ
7
7
  }>): string;
8
8
  export declare function formatSessionInfo(info: SessionInfo): string;
9
9
  export declare function formatSearchResults(results: SearchResult[]): string;
10
- export declare function filterSessionsByDate(sessionIDs: string[], fromDate?: string, toDate?: string): string[];
11
- export declare function searchInSession(sessionID: string, query: string, caseSensitive?: boolean): SearchResult[];
10
+ export declare function filterSessionsByDate(sessionIDs: string[], fromDate?: string, toDate?: string): Promise<string[]>;
11
+ export declare function searchInSession(sessionID: string, query: string, caseSensitive?: boolean, maxResults?: number): Promise<SearchResult[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "2.6.2",
3
+ "version": "2.7.1",
4
4
  "description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -53,7 +53,7 @@
53
53
  "@ast-grep/cli": "^0.40.0",
54
54
  "@ast-grep/napi": "^0.40.0",
55
55
  "@clack/prompts": "^0.11.0",
56
- "@code-yeongyu/comment-checker": "^0.6.0",
56
+ "@code-yeongyu/comment-checker": "^0.6.1",
57
57
  "@openauthjs/openauth": "^0.4.3",
58
58
  "@opencode-ai/plugin": "^1.0.162",
59
59
  "@opencode-ai/sdk": "^1.0.162",