oh-my-opencode 2.5.2 → 2.5.4
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.
- package/README.ja.md +49 -15
- package/README.ko.md +48 -14
- package/README.md +49 -15
- package/README.zh-cn.md +49 -15
- package/dist/agents/build-prompt.d.ts +31 -0
- package/dist/cli/index.js +1823 -1
- package/dist/cli/run/completion.d.ts +2 -0
- package/dist/cli/run/completion.test.d.ts +1 -0
- package/dist/cli/run/events.d.ts +11 -0
- package/dist/cli/run/events.test.d.ts +1 -0
- package/dist/cli/run/index.d.ts +2 -0
- package/dist/cli/run/runner.d.ts +2 -0
- package/dist/cli/run/types.d.ts +71 -0
- package/dist/config/schema.d.ts +103 -2
- package/dist/features/background-agent/types.d.ts +8 -0
- package/dist/hooks/anthropic-auto-compact/executor.test.d.ts +1 -0
- package/dist/index.js +1126 -510
- package/dist/shared/data-path.d.ts +15 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/tools/index.d.ts +52 -0
- package/dist/tools/session-manager/constants.d.ts +11 -0
- package/dist/tools/session-manager/index.d.ts +3 -0
- package/dist/tools/session-manager/storage.d.ts +8 -0
- package/dist/tools/session-manager/storage.test.d.ts +1 -0
- package/dist/tools/session-manager/tools.d.ts +52 -0
- package/dist/tools/session-manager/tools.test.d.ts +1 -0
- package/dist/tools/session-manager/types.d.ts +71 -0
- package/dist/tools/session-manager/utils.d.ts +11 -0
- package/dist/tools/session-manager/utils.test.d.ts +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the user-level data directory based on the OS.
|
|
3
|
+
* - Linux/macOS: XDG_DATA_HOME or ~/.local/share
|
|
4
|
+
* - Windows: %LOCALAPPDATA%
|
|
5
|
+
*
|
|
6
|
+
* This follows XDG Base Directory specification on Unix systems
|
|
7
|
+
* and Windows conventions on Windows.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getDataDir(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the OpenCode storage directory path.
|
|
12
|
+
* - Linux/macOS: ~/.local/share/opencode/storage
|
|
13
|
+
* - Windows: %LOCALAPPDATA%\opencode\storage
|
|
14
|
+
*/
|
|
15
|
+
export declare function getOpenCodeStorageDir(): string;
|
package/dist/shared/index.d.ts
CHANGED
package/dist/tools/index.d.ts
CHANGED
|
@@ -318,4 +318,56 @@ export declare const builtinTools: {
|
|
|
318
318
|
command: string;
|
|
319
319
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
320
320
|
};
|
|
321
|
+
session_list: {
|
|
322
|
+
description: string;
|
|
323
|
+
args: {
|
|
324
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
325
|
+
from_date: import("zod").ZodOptional<import("zod").ZodString>;
|
|
326
|
+
to_date: import("zod").ZodOptional<import("zod").ZodString>;
|
|
327
|
+
};
|
|
328
|
+
execute(args: {
|
|
329
|
+
limit?: number | undefined;
|
|
330
|
+
from_date?: string | undefined;
|
|
331
|
+
to_date?: string | undefined;
|
|
332
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
333
|
+
};
|
|
334
|
+
session_read: {
|
|
335
|
+
description: string;
|
|
336
|
+
args: {
|
|
337
|
+
session_id: import("zod").ZodString;
|
|
338
|
+
include_todos: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
339
|
+
include_transcript: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
340
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
341
|
+
};
|
|
342
|
+
execute(args: {
|
|
343
|
+
session_id: string;
|
|
344
|
+
include_todos?: boolean | undefined;
|
|
345
|
+
include_transcript?: boolean | undefined;
|
|
346
|
+
limit?: number | undefined;
|
|
347
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
348
|
+
};
|
|
349
|
+
session_search: {
|
|
350
|
+
description: string;
|
|
351
|
+
args: {
|
|
352
|
+
query: import("zod").ZodString;
|
|
353
|
+
session_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
354
|
+
case_sensitive: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
355
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
356
|
+
};
|
|
357
|
+
execute(args: {
|
|
358
|
+
query: string;
|
|
359
|
+
session_id?: string | undefined;
|
|
360
|
+
case_sensitive?: boolean | undefined;
|
|
361
|
+
limit?: number | undefined;
|
|
362
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
363
|
+
};
|
|
364
|
+
session_info: {
|
|
365
|
+
description: string;
|
|
366
|
+
args: {
|
|
367
|
+
session_id: import("zod").ZodString;
|
|
368
|
+
};
|
|
369
|
+
execute(args: {
|
|
370
|
+
session_id: string;
|
|
371
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
372
|
+
};
|
|
321
373
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const OPENCODE_STORAGE: string;
|
|
2
|
+
export declare const MESSAGE_STORAGE: string;
|
|
3
|
+
export declare const PART_STORAGE: string;
|
|
4
|
+
export declare const TODO_DIR: string;
|
|
5
|
+
export declare const TRANSCRIPT_DIR: string;
|
|
6
|
+
export declare const SESSION_LIST_DESCRIPTION = "List all OpenCode sessions with optional filtering.\n\nReturns a list of available session IDs with metadata including message count, date range, and agents used.\n\nArguments:\n- limit (optional): Maximum number of sessions to return\n- from_date (optional): Filter sessions from this date (ISO 8601 format)\n- to_date (optional): Filter sessions until this date (ISO 8601 format)\n\nExample output:\n| Session ID | Messages | First | Last | Agents |\n|------------|----------|-------|------|--------|\n| ses_abc123 | 45 | 2025-12-20 | 2025-12-24 | build, oracle |\n| ses_def456 | 12 | 2025-12-19 | 2025-12-19 | build |";
|
|
7
|
+
export declare const SESSION_READ_DESCRIPTION = "Read messages and history from an OpenCode session.\n\nReturns a formatted view of session messages with role, timestamp, and content. Optionally includes todos and transcript data.\n\nArguments:\n- session_id (required): Session ID to read\n- include_todos (optional): Include todo list if available (default: false)\n- include_transcript (optional): Include transcript log if available (default: false)\n- limit (optional): Maximum number of messages to return (default: all)\n\nExample output:\nSession: ses_abc123\nMessages: 45\nDate Range: 2025-12-20 to 2025-12-24\n\n[Message 1] user (2025-12-20 10:30:00)\nHello, can you help me with...\n\n[Message 2] assistant (2025-12-20 10:30:15)\nOf course! Let me help you with...";
|
|
8
|
+
export declare const SESSION_SEARCH_DESCRIPTION = "Search for content within OpenCode session messages.\n\nPerforms full-text search across session messages and returns matching excerpts with context.\n\nArguments:\n- query (required): Search query string\n- session_id (optional): Search within specific session only (default: all sessions)\n- case_sensitive (optional): Case-sensitive search (default: false)\n- limit (optional): Maximum number of results to return (default: 20)\n\nExample output:\nFound 3 matches across 2 sessions:\n\n[ses_abc123] Message msg_001 (user)\n...implement the **session manager** tool...\n\n[ses_abc123] Message msg_005 (assistant)\n...I'll create a **session manager** with full search...\n\n[ses_def456] Message msg_012 (user)\n...use the **session manager** to find...";
|
|
9
|
+
export declare const SESSION_INFO_DESCRIPTION = "Get metadata and statistics about an OpenCode session.\n\nReturns detailed information about a session including message count, date range, agents used, and available data sources.\n\nArguments:\n- session_id (required): Session ID to inspect\n\nExample output:\nSession ID: ses_abc123\nMessages: 45\nDate Range: 2025-12-20 10:30:00 to 2025-12-24 15:45:30\nDuration: 4 days, 5 hours\nAgents Used: build, oracle, librarian\nHas Todos: Yes (12 items, 8 completed)\nHas Transcript: Yes (234 entries)";
|
|
10
|
+
export declare const SESSION_DELETE_DESCRIPTION = "Delete an OpenCode session and all associated data.\n\nRemoves session messages, parts, todos, and transcript. This operation cannot be undone.\n\nArguments:\n- session_id (required): Session ID to delete\n- confirm (required): Must be true to confirm deletion\n\nExample:\nsession_delete(session_id=\"ses_abc123\", confirm=true)\nSuccessfully deleted session ses_abc123";
|
|
11
|
+
export declare const TOOL_NAME_PREFIX = "session_";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionMessage, SessionInfo, TodoItem } from "./types";
|
|
2
|
+
export declare function getAllSessions(): string[];
|
|
3
|
+
export declare function getMessageDir(sessionID: string): string;
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const session_list: {
|
|
2
|
+
description: string;
|
|
3
|
+
args: {
|
|
4
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
5
|
+
from_date: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
to_date: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
};
|
|
8
|
+
execute(args: {
|
|
9
|
+
limit?: number | undefined;
|
|
10
|
+
from_date?: string | undefined;
|
|
11
|
+
to_date?: string | undefined;
|
|
12
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
13
|
+
};
|
|
14
|
+
export declare const session_read: {
|
|
15
|
+
description: string;
|
|
16
|
+
args: {
|
|
17
|
+
session_id: import("zod").ZodString;
|
|
18
|
+
include_todos: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
19
|
+
include_transcript: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
20
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
21
|
+
};
|
|
22
|
+
execute(args: {
|
|
23
|
+
session_id: string;
|
|
24
|
+
include_todos?: boolean | undefined;
|
|
25
|
+
include_transcript?: boolean | undefined;
|
|
26
|
+
limit?: number | undefined;
|
|
27
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
28
|
+
};
|
|
29
|
+
export declare const session_search: {
|
|
30
|
+
description: string;
|
|
31
|
+
args: {
|
|
32
|
+
query: import("zod").ZodString;
|
|
33
|
+
session_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
34
|
+
case_sensitive: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
35
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
36
|
+
};
|
|
37
|
+
execute(args: {
|
|
38
|
+
query: string;
|
|
39
|
+
session_id?: string | undefined;
|
|
40
|
+
case_sensitive?: boolean | undefined;
|
|
41
|
+
limit?: number | undefined;
|
|
42
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
43
|
+
};
|
|
44
|
+
export declare const session_info: {
|
|
45
|
+
description: string;
|
|
46
|
+
args: {
|
|
47
|
+
session_id: import("zod").ZodString;
|
|
48
|
+
};
|
|
49
|
+
execute(args: {
|
|
50
|
+
session_id: string;
|
|
51
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export interface SessionMessage {
|
|
2
|
+
id: string;
|
|
3
|
+
role: "user" | "assistant";
|
|
4
|
+
agent?: string;
|
|
5
|
+
time?: {
|
|
6
|
+
created: number;
|
|
7
|
+
updated?: number;
|
|
8
|
+
};
|
|
9
|
+
parts: MessagePart[];
|
|
10
|
+
}
|
|
11
|
+
export interface MessagePart {
|
|
12
|
+
id: string;
|
|
13
|
+
type: string;
|
|
14
|
+
text?: string;
|
|
15
|
+
thinking?: string;
|
|
16
|
+
tool?: string;
|
|
17
|
+
callID?: string;
|
|
18
|
+
input?: Record<string, unknown>;
|
|
19
|
+
output?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SessionInfo {
|
|
23
|
+
id: string;
|
|
24
|
+
message_count: number;
|
|
25
|
+
first_message?: Date;
|
|
26
|
+
last_message?: Date;
|
|
27
|
+
agents_used: string[];
|
|
28
|
+
has_todos: boolean;
|
|
29
|
+
has_transcript: boolean;
|
|
30
|
+
todos?: TodoItem[];
|
|
31
|
+
transcript_entries?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface TodoItem {
|
|
34
|
+
id: string;
|
|
35
|
+
content: string;
|
|
36
|
+
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
37
|
+
priority?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SearchResult {
|
|
40
|
+
session_id: string;
|
|
41
|
+
message_id: string;
|
|
42
|
+
role: string;
|
|
43
|
+
excerpt: string;
|
|
44
|
+
match_count: number;
|
|
45
|
+
timestamp?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface SessionListArgs {
|
|
48
|
+
limit?: number;
|
|
49
|
+
offset?: number;
|
|
50
|
+
from_date?: string;
|
|
51
|
+
to_date?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface SessionReadArgs {
|
|
54
|
+
session_id: string;
|
|
55
|
+
include_todos?: boolean;
|
|
56
|
+
include_transcript?: boolean;
|
|
57
|
+
limit?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface SessionSearchArgs {
|
|
60
|
+
query: string;
|
|
61
|
+
session_id?: string;
|
|
62
|
+
case_sensitive?: boolean;
|
|
63
|
+
limit?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface SessionInfoArgs {
|
|
66
|
+
session_id: string;
|
|
67
|
+
}
|
|
68
|
+
export interface SessionDeleteArgs {
|
|
69
|
+
session_id: string;
|
|
70
|
+
confirm: boolean;
|
|
71
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SessionInfo, SessionMessage, SearchResult } from "./types";
|
|
2
|
+
export declare function formatSessionList(sessionIDs: string[]): string;
|
|
3
|
+
export declare function formatSessionMessages(messages: SessionMessage[], includeTodos?: boolean, todos?: Array<{
|
|
4
|
+
id: string;
|
|
5
|
+
content: string;
|
|
6
|
+
status: string;
|
|
7
|
+
}>): string;
|
|
8
|
+
export declare function formatSessionInfo(info: SessionInfo): string;
|
|
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[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
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",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@code-yeongyu/comment-checker": "^0.6.0",
|
|
57
57
|
"@openauthjs/openauth": "^0.4.3",
|
|
58
58
|
"@opencode-ai/plugin": "^1.0.162",
|
|
59
|
+
"@opencode-ai/sdk": "^1.0.162",
|
|
59
60
|
"commander": "^14.0.2",
|
|
60
61
|
"hono": "^4.10.4",
|
|
61
62
|
"picocolors": "^1.1.1",
|