chore: include pre-built dist for github install

This commit is contained in:
Robin Mordasiewicz
2026-03-14 04:56:50 +00:00
parent a7f0a4cf46
commit bce8ff3a75
1011 changed files with 150081 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
export { OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE } from "../../shared";
export declare const TODO_DIR: string;
export declare const TRANSCRIPT_DIR: string;
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 |";
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...";
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...";
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)";
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";
export declare const TOOL_NAME_PREFIX = "session_";
+3
View File
@@ -0,0 +1,3 @@
export { createSessionManagerTools } from "./tools";
export * from "./types";
export * from "./constants";
+11
View File
@@ -0,0 +1,11 @@
import type { SessionInfo, SessionMessage, SearchResult } from "./types";
export declare function formatSessionList(sessionIDs: string[]): Promise<string>;
export declare function formatSessionMessages(messages: SessionMessage[], includeTodos?: boolean, todos?: Array<{
id?: string;
content: string;
status: string;
}>): string;
export declare function formatSessionInfo(info: SessionInfo): string;
export declare function formatSearchResults(results: SearchResult[]): string;
export declare function filterSessionsByDate(sessionIDs: string[], fromDate?: string, toDate?: string): Promise<string[]>;
export declare function searchInSession(sessionID: string, query: string, caseSensitive?: boolean, maxResults?: number): Promise<SearchResult[]>;
+15
View File
@@ -0,0 +1,15 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { SessionMessage, SessionInfo, TodoItem, SessionMetadata } from "./types";
export interface GetMainSessionsOptions {
directory?: string;
}
export declare function setStorageClient(client: PluginInput["client"]): void;
export declare function resetStorageClient(): void;
export declare function getMainSessions(options: GetMainSessionsOptions): Promise<SessionMetadata[]>;
export declare function getAllSessions(): Promise<string[]>;
export { getMessageDir } from "../../shared/opencode-message-dir";
export declare function sessionExists(sessionID: string): Promise<boolean>;
export declare function readSessionMessages(sessionID: string): Promise<SessionMessage[]>;
export declare function readSessionTodos(sessionID: string): Promise<TodoItem[]>;
export declare function readSessionTranscript(sessionID: string): Promise<number>;
export declare function getSessionInfo(sessionID: string): Promise<SessionInfo | null>;
+3
View File
@@ -0,0 +1,3 @@
import type { PluginInput } from "@opencode-ai/plugin";
import { type ToolDefinition } from "@opencode-ai/plugin/tool";
export declare function createSessionManagerTools(ctx: PluginInput): Record<string, ToolDefinition>;
+89
View File
@@ -0,0 +1,89 @@
export interface SessionMessage {
id: string;
role: "user" | "assistant";
agent?: string;
time?: {
created: number;
updated?: number;
};
parts: MessagePart[];
}
export interface MessagePart {
id: string;
type: string;
text?: string;
thinking?: string;
tool?: string;
callID?: string;
input?: Record<string, unknown>;
output?: string;
error?: string;
}
export interface SessionInfo {
id: string;
message_count: number;
first_message?: Date;
last_message?: Date;
agents_used: string[];
has_todos: boolean;
has_transcript: boolean;
todos?: TodoItem[];
transcript_entries?: number;
}
export interface TodoItem {
id?: string;
content: string;
status: "pending" | "in_progress" | "completed" | "cancelled";
priority?: string;
}
export interface SearchResult {
session_id: string;
message_id: string;
role: string;
excerpt: string;
match_count: number;
timestamp?: number;
}
export interface SessionMetadata {
id: string;
version?: string;
projectID: string;
directory: string;
title?: string;
parentID?: string;
time: {
created: number;
updated: number;
};
summary?: {
additions: number;
deletions: number;
files: number;
};
}
export interface SessionListArgs {
limit?: number;
offset?: number;
from_date?: string;
to_date?: string;
project_path?: string;
}
export interface SessionReadArgs {
session_id: string;
include_todos?: boolean;
include_transcript?: boolean;
limit?: number;
}
export interface SessionSearchArgs {
query: string;
session_id?: string;
case_sensitive?: boolean;
limit?: number;
}
export interface SessionInfoArgs {
session_id: string;
}
export interface SessionDeleteArgs {
session_id: string;
confirm: boolean;
}