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
+4
View File
@@ -0,0 +1,4 @@
export declare const AGENT_USAGE_REMINDER_STORAGE: string;
export declare const TARGET_TOOLS: Set<string>;
export declare const AGENT_TOOLS: Set<string>;
export declare const REMINDER_MESSAGE = "\n[Agent Usage Reminder]\n\nYou called a search/fetch tool directly without leveraging specialized agents.\n\nRECOMMENDED: Use task with explore/librarian agents for better results:\n\n```\n// Parallel exploration - fire multiple agents simultaneously\ntask(agent=\"explore\", prompt=\"Find all files matching pattern X\")\ntask(agent=\"explore\", prompt=\"Search for implementation of Y\") \ntask(agent=\"librarian\", prompt=\"Lookup documentation for Z\")\n\n// Then continue your work while they run in background\n// System will notify you when each completes\n```\n\nWHY:\n- Agents can perform deeper, more thorough searches\n- Background tasks run in parallel, saving time\n- Specialized agents have domain expertise\n- Reduces context window usage in main session\n\nALWAYS prefer: Multiple parallel task calls > Direct tool calls\n";
+22
View File
@@ -0,0 +1,22 @@
import type { PluginInput } from "@opencode-ai/plugin";
interface ToolExecuteInput {
tool: string;
sessionID: string;
callID: string;
}
interface ToolExecuteOutput {
title: string;
output: string;
metadata: unknown;
}
interface EventInput {
event: {
type: string;
properties?: unknown;
};
}
export declare function createAgentUsageReminderHook(_ctx: PluginInput): {
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
event: ({ event }: EventInput) => Promise<void>;
};
export {};
+1
View File
@@ -0,0 +1 @@
export { createAgentUsageReminderHook } from "./hook";
+4
View File
@@ -0,0 +1,4 @@
import type { AgentUsageState } from "./types";
export declare function loadAgentUsageState(sessionID: string): AgentUsageState | null;
export declare function saveAgentUsageState(state: AgentUsageState): void;
export declare function clearAgentUsageState(sessionID: string): void;
+6
View File
@@ -0,0 +1,6 @@
export interface AgentUsageState {
sessionID: string;
agentUsed: boolean;
reminderCount: number;
updatedAt: number;
}
@@ -0,0 +1,14 @@
import type { AutoCompactState } from "./types";
import type { Client } from "./client";
export declare function runAggressiveTruncationStrategy(params: {
sessionID: string;
autoCompactState: AutoCompactState;
client: Client;
directory: string;
truncateAttempt: number;
currentTokens: number;
maxTokens: number;
}): Promise<{
handled: boolean;
nextTruncateAttempt: number;
}>;
@@ -0,0 +1,29 @@
import type { PluginInput } from "@opencode-ai/plugin";
export type Client = PluginInput["client"] & {
session: {
promptAsync: (opts: {
path: {
id: string;
};
body: {
parts: Array<{
type: string;
text: string;
}>;
};
query: {
directory: string;
};
}) => Promise<unknown>;
};
tui: {
showToast: (opts: {
body: {
title: string;
message: string;
variant: string;
duration: number;
};
}) => Promise<unknown>;
};
};
@@ -0,0 +1,6 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { ParsedTokenLimitError } from "./types";
import type { ExperimentalConfig } from "../../config";
type OpencodeClient = PluginInput["client"];
export declare function attemptDeduplicationRecovery(sessionID: string, parsed: ParsedTokenLimitError, experimental: ExperimentalConfig | undefined, client?: OpencodeClient): Promise<void>;
export {};
@@ -0,0 +1,11 @@
import type { Client } from "./client";
export declare function fixEmptyMessagesWithSDK(params: {
sessionID: string;
client: Client;
placeholderText: string;
messageIndex?: number;
}): Promise<{
fixed: boolean;
fixedMessageIds: string[];
scannedEmptyCount: number;
}>;
@@ -0,0 +1,8 @@
import type { AutoCompactState } from "./types";
import type { Client } from "./client";
export declare function fixEmptyMessages(params: {
sessionID: string;
autoCompactState: AutoCompactState;
client: Client;
messageIndex?: number;
}): Promise<boolean>;
@@ -0,0 +1,6 @@
import type { AutoCompactState } from "./types";
import type { OhMyOpenCodeConfig } from "../../config";
import type { ExperimentalConfig } from "../../config";
import type { Client } from "./client";
export { getLastAssistant } from "./message-builder";
export declare function executeCompact(sessionID: string, msg: Record<string, unknown>, autoCompactState: AutoCompactState, client: Client, directory: string, pluginConfig: OhMyOpenCodeConfig, _experimental?: ExperimentalConfig): Promise<void>;
@@ -0,0 +1,8 @@
export { createAnthropicContextWindowLimitRecoveryHook } from "./recovery-hook";
export type { AnthropicContextWindowLimitRecoveryOptions } from "./recovery-hook";
export type { AutoCompactState, ParsedTokenLimitError, TruncateState } from "./types";
export { parseAnthropicTokenLimitError } from "./parser";
export { executeCompact, getLastAssistant } from "./executor";
export * from "./state";
export * from "./message-builder";
export * from "./recovery-strategy";
@@ -0,0 +1,7 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare const PLACEHOLDER_TEXT = "[user interrupted]";
type OpencodeClient = PluginInput["client"];
export declare function sanitizeEmptyMessagesBeforeSummarize(sessionID: string, client?: OpencodeClient): Promise<number>;
export declare function formatBytes(bytes: number): string;
export declare function getLastAssistant(sessionID: string, client: any, directory: string): Promise<Record<string, unknown> | null>;
export {};
@@ -0,0 +1,6 @@
import type { PluginInput } from "@opencode-ai/plugin";
import { getMessageDir } from "../../shared/opencode-message-dir";
export { getMessageDir };
type OpencodeClient = PluginInput["client"];
export declare function getMessageIdsFromSDK(client: OpencodeClient, sessionID: string): Promise<string[]>;
export declare function getMessageIds(sessionID: string): string[];
@@ -0,0 +1,2 @@
import type { ParsedTokenLimitError } from "./types";
export declare function parseAnthropicTokenLimitError(err: unknown): ParsedTokenLimitError | null;
@@ -0,0 +1,10 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { PruningState } from "./pruning-types";
type OpencodeClient = PluginInput["client"];
export interface DeduplicationConfig {
enabled: boolean;
protectedTools?: string[];
}
export declare function createToolSignature(toolName: string, input: unknown): string;
export declare function executeDeduplication(sessionID: string, state: PruningState, config: DeduplicationConfig, protectedTools: Set<string>, client?: OpencodeClient): Promise<number>;
export {};
@@ -0,0 +1,6 @@
import type { PluginInput } from "@opencode-ai/plugin";
type OpencodeClient = PluginInput["client"];
export declare function truncateToolOutputsByCallId(sessionID: string, callIds: Set<string>, client?: OpencodeClient): Promise<{
truncatedCount: number;
}>;
export {};
@@ -0,0 +1,36 @@
export interface ToolCallSignature {
toolName: string;
signature: string;
callID: string;
turn: number;
}
export interface FileOperation {
callID: string;
tool: string;
filePath: string;
turn: number;
}
export interface ErroredToolCall {
callID: string;
toolName: string;
turn: number;
errorAge: number;
}
export interface PruningResult {
itemsPruned: number;
totalTokensSaved: number;
strategies: {
deduplication: number;
supersedeWrites: number;
purgeErrors: number;
};
}
export interface PruningState {
toolIdsToPrune: Set<string>;
currentTurn: number;
fileOperations: Map<string, FileOperation[]>;
toolSignatures: Map<string, ToolCallSignature[]>;
erroredTools: Map<string, ErroredToolCall>;
}
export declare const CHARS_PER_TOKEN = 4;
export declare function estimateTokens(text: string): number;
@@ -0,0 +1,14 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { ExperimentalConfig, OhMyOpenCodeConfig } from "../../config";
export interface AnthropicContextWindowLimitRecoveryOptions {
experimental?: ExperimentalConfig;
pluginConfig: OhMyOpenCodeConfig;
}
export declare function createAnthropicContextWindowLimitRecoveryHook(ctx: PluginInput, options?: AnthropicContextWindowLimitRecoveryOptions): {
event: ({ event }: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
};
@@ -0,0 +1,2 @@
export { runAggressiveTruncationStrategy } from "./aggressive-truncation-strategy";
export { runSummarizeRetryStrategy } from "./summarize-retry-strategy";
@@ -0,0 +1,6 @@
import type { AutoCompactState, RetryState, TruncateState } from "./types";
export declare function getOrCreateRetryState(autoCompactState: AutoCompactState, sessionID: string): RetryState;
export declare function getOrCreateTruncateState(autoCompactState: AutoCompactState, sessionID: string): TruncateState;
export declare function clearSessionState(autoCompactState: AutoCompactState, sessionID: string): void;
export declare function getEmptyContentAttempt(autoCompactState: AutoCompactState, sessionID: string): number;
export declare function incrementEmptyContentAttempt(autoCompactState: AutoCompactState, sessionID: string): number;
@@ -0,0 +1,3 @@
import { MESSAGE_STORAGE, PART_STORAGE } from "../../shared";
export { MESSAGE_STORAGE as MESSAGE_STORAGE_DIR, PART_STORAGE as PART_STORAGE_DIR };
export declare const TRUNCATION_MESSAGE = "[TOOL RESULT TRUNCATED - Context limit exceeded. Original output was too large and has been truncated to recover the session. Please re-run this tool if you need the full output.]";
@@ -0,0 +1,4 @@
export type { AggressiveTruncateResult, ToolResultInfo } from "./tool-part-types";
export { countTruncatedResults, findLargestToolResult, findToolResultsBySize, getTotalToolOutputSize, truncateToolResult, } from "./tool-result-storage";
export { countTruncatedResultsFromSDK, findToolResultsBySizeFromSDK, getTotalToolOutputSizeFromSDK, truncateToolResultAsync, } from "./tool-result-storage-sdk";
export { truncateUntilTargetTokens } from "./target-token-truncation";
@@ -0,0 +1,13 @@
import type { AutoCompactState } from "./types";
import type { OhMyOpenCodeConfig } from "../../config";
import type { Client } from "./client";
export declare function runSummarizeRetryStrategy(params: {
sessionID: string;
msg: Record<string, unknown>;
autoCompactState: AutoCompactState;
client: Client;
directory: string;
pluginConfig: OhMyOpenCodeConfig;
errorType?: string;
messageIndex?: number;
}): Promise<void>;
@@ -0,0 +1,5 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { AggressiveTruncateResult } from "./tool-part-types";
type OpencodeClient = PluginInput["client"];
export declare function truncateUntilTargetTokens(sessionID: string, currentTokens: number, maxTokens: number, targetRatio?: number, charsPerToken?: number, client?: OpencodeClient): Promise<AggressiveTruncateResult>;
export {};
@@ -0,0 +1,39 @@
export interface StoredToolPart {
id: string;
sessionID: string;
messageID: string;
type: "tool";
callID: string;
tool: string;
state: {
status: "pending" | "running" | "completed" | "error";
input: Record<string, unknown>;
output?: string;
error?: string;
time?: {
start: number;
end?: number;
compacted?: number;
};
};
truncated?: boolean;
originalSize?: number;
}
export interface ToolResultInfo {
partPath: string;
partId: string;
messageID: string;
toolName: string;
outputSize: number;
}
export interface AggressiveTruncateResult {
success: boolean;
sufficient: boolean;
truncatedCount: number;
totalBytesRemoved: number;
targetBytesToRemove: number;
truncatedTools: Array<{
toolName: string;
originalSize: number;
}>;
}
@@ -0,0 +1,29 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { ToolResultInfo } from "./tool-part-types";
type OpencodeClient = PluginInput["client"];
interface SDKToolPart {
id: string;
type: string;
callID?: string;
tool?: string;
state?: {
status?: string;
input?: Record<string, unknown>;
output?: string;
error?: string;
time?: {
start?: number;
end?: number;
compacted?: number;
};
};
}
export declare function findToolResultsBySizeFromSDK(client: OpencodeClient, sessionID: string): Promise<ToolResultInfo[]>;
export declare function truncateToolResultAsync(client: OpencodeClient, sessionID: string, messageID: string, partId: string, part: SDKToolPart): Promise<{
success: boolean;
toolName?: string;
originalSize?: number;
}>;
export declare function countTruncatedResultsFromSDK(client: OpencodeClient, sessionID: string): Promise<number>;
export declare function getTotalToolOutputSizeFromSDK(client: OpencodeClient, sessionID: string): Promise<number>;
export {};
@@ -0,0 +1,10 @@
import type { ToolResultInfo } from "./tool-part-types";
export declare function findToolResultsBySize(sessionID: string): ToolResultInfo[];
export declare function findLargestToolResult(sessionID: string): ToolResultInfo | null;
export declare function truncateToolResult(partPath: string): {
success: boolean;
toolName?: string;
originalSize?: number;
};
export declare function getTotalToolOutputSize(sessionID: string): number;
export declare function countTruncatedResults(sessionID: string): number;
@@ -0,0 +1,38 @@
export interface ParsedTokenLimitError {
currentTokens: number;
maxTokens: number;
requestId?: string;
errorType: string;
providerID?: string;
modelID?: string;
messageIndex?: number;
}
export interface RetryState {
attempt: number;
lastAttemptTime: number;
firstAttemptTime: number;
}
export interface TruncateState {
truncateAttempt: number;
lastTruncatedPartId?: string;
}
export interface AutoCompactState {
pendingCompact: Set<string>;
errorDataBySession: Map<string, ParsedTokenLimitError>;
retryStateBySession: Map<string, RetryState>;
truncateStateBySession: Map<string, TruncateState>;
emptyContentAttemptBySession: Map<string, number>;
compactionInProgress: Set<string>;
}
export declare const RETRY_CONFIG: {
readonly maxAttempts: 2;
readonly initialDelayMs: 2000;
readonly backoffFactor: 2;
readonly maxDelayMs: 30000;
};
export declare const TRUNCATE_CONFIG: {
readonly maxTruncateAttempts: 20;
readonly minOutputSizeToTruncate: 500;
readonly targetTokenRatio: 0.5;
readonly charsPerToken: 4;
};
+26
View File
@@ -0,0 +1,26 @@
interface ChatParamsInput {
sessionID: string;
agent: {
name?: string;
};
model: {
providerID: string;
modelID: string;
};
provider: {
id: string;
};
message: {
variant?: string;
};
}
interface ChatParamsOutput {
temperature?: number;
topP?: number;
topK?: number;
options: Record<string, unknown>;
}
export declare function createAnthropicEffortHook(): {
"chat.params": (input: ChatParamsInput, output: ChatParamsOutput) => Promise<void>;
};
export {};
+1
View File
@@ -0,0 +1 @@
export { createAnthropicEffortHook } from "./hook";
+19
View File
@@ -0,0 +1,19 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { AtlasHookOptions } from "./types";
export declare function createAtlasHook(ctx: PluginInput, options?: AtlasHookOptions): {
handler: (arg: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
"tool.execute.before": (toolInput: {
tool: string;
sessionID?: string;
callID?: string;
}, toolOutput: {
args: Record<string, unknown>;
message?: string;
}) => Promise<void>;
"tool.execute.after": (toolInput: import("./types").ToolExecuteAfterInput, toolOutput: import("./types").ToolExecuteAfterOutput) => Promise<void>;
};
+14
View File
@@ -0,0 +1,14 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { BackgroundManager } from "../../features/background-agent";
import type { SessionState } from "./types";
export declare function injectBoulderContinuation(input: {
ctx: PluginInput;
sessionID: string;
planName: string;
remaining: number;
total: number;
agent?: string;
worktreePath?: string;
backgroundManager?: BackgroundManager;
sessionState: SessionState;
}): Promise<void>;
+6
View File
@@ -0,0 +1,6 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function isSessionInBoulderLineage(input: {
client: PluginInput["client"];
sessionID: string;
boulderSessionIDs: string[];
}): Promise<boolean>;
+13
View File
@@ -0,0 +1,13 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { AtlasHookOptions, SessionState } from "./types";
export declare function createAtlasEventHandler(input: {
ctx: PluginInput;
options?: AtlasHookOptions;
sessions: Map<string, SessionState>;
getState: (sessionID: string) => SessionState;
}): (arg: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
+4
View File
@@ -0,0 +1,4 @@
export declare function shouldPauseForFinalWaveApproval(input: {
planPath: string;
taskOutput: string;
}): boolean;
+1
View File
@@ -0,0 +1 @@
export declare const HOOK_NAME = "atlas";
+8
View File
@@ -0,0 +1,8 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { AtlasHookOptions, SessionState } from "./types";
export declare function handleAtlasSessionIdle(input: {
ctx: PluginInput;
options?: AtlasHookOptions;
getState: (sessionID: string) => SessionState;
sessionID: string;
}): Promise<void>;
+3
View File
@@ -0,0 +1,3 @@
export { HOOK_NAME } from "./hook-name";
export { createAtlasHook } from "./atlas-hook";
export type { AtlasHookOptions } from "./types";
+1
View File
@@ -0,0 +1 @@
export declare function isAbortError(error: unknown): boolean;
+9
View File
@@ -0,0 +1,9 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { ModelInfo } from "./types";
type PromptContext = {
model?: ModelInfo;
tools?: Record<string, boolean>;
};
export declare function resolveRecentPromptContextForSession(ctx: PluginInput, sessionID: string): Promise<PromptContext>;
export declare function resolveRecentModelForSession(ctx: PluginInput, sessionID: string): Promise<ModelInfo | undefined>;
export {};
+11
View File
@@ -0,0 +1,11 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { BoulderState, PlanProgress } from "../../features/boulder-state";
export declare function resolveActiveBoulderSession(input: {
client: PluginInput["client"];
directory: string;
sessionID: string;
}): Promise<{
boulderState: BoulderState;
progress: PlanProgress;
appendedSession: boolean;
} | null>;
+11
View File
@@ -0,0 +1,11 @@
type SessionMessagesClient = {
session: {
messages: (input: {
path: {
id: string;
};
}) => Promise<unknown>;
};
};
export declare function getLastAgentFromSession(sessionID: string, client?: SessionMessagesClient): Promise<string | null>;
export {};
+6
View File
@@ -0,0 +1,6 @@
/**
* Cross-platform check if a path is inside .sisyphus/ directory.
* Handles both forward slashes (Unix) and backslashes (Windows).
* Uses path segment matching (not substring) to avoid false positives like "not-sisyphus/file.txt"
*/
export declare function isSisyphusPath(filePath: string): boolean;
+1
View File
@@ -0,0 +1 @@
export declare function extractSessionIdFromOutput(output: string): string;
+6
View File
@@ -0,0 +1,6 @@
export declare const DIRECT_WORK_REMINDER: string;
export declare const BOULDER_CONTINUATION_PROMPT: string;
export declare const VERIFICATION_REMINDER = "**THE SUBAGENT JUST CLAIMED THIS TASK IS DONE. THEY ARE PROBABLY LYING.**\n\nSubagents say \"done\" when code has errors, tests pass trivially, logic is wrong,\nor they quietly added features nobody asked for. This happens EVERY TIME.\nAssume the work is broken until YOU prove otherwise.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (before running anything)**\n\nDo NOT run tests yet. Read the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat\")` \u2014 see exactly which files changed. Any file outside expected scope = scope creep.\n2. `Read` EVERY changed file \u2014 no exceptions, no skimming.\n3. For EACH file, critically ask:\n - Does this code ACTUALLY do what the task required? (Re-read the task, compare line by line)\n - Any stubs, TODOs, placeholders, hardcoded values? (`Grep` for TODO, FIXME, HACK, xxx)\n - Logic errors? Trace the happy path AND the error path in your head.\n - Anti-patterns? (`Grep` for `as any`, `@ts-ignore`, empty catch, console.log in changed files)\n - Scope creep? Did the subagent touch things or add features NOT in the task spec?\n4. Cross-check every claim:\n - Said \"Updated X\" \u2014 READ X. Actually updated, or just superficially touched?\n - Said \"Added tests\" \u2014 READ the tests. Do they test REAL behavior or just `expect(true).toBe(true)`?\n - Said \"Follows patterns\" \u2014 OPEN a reference file. Does it ACTUALLY match?\n\n**If you cannot explain what every changed line does, you have NOT reviewed it.**\n\n**PHASE 2: RUN AUTOMATED CHECKS (targeted, then broad)**\n\nNow that you understand the code, verify mechanically:\n1. `lsp_diagnostics` on EACH changed file \u2014 ZERO new errors\n2. Run tests for changed modules FIRST, then full suite\n3. Build/typecheck \u2014 exit 0\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. The code has bugs that tests don't cover. Fix the code.\n\n**PHASE 3: HANDS-ON QA \u2014 ACTUALLY RUN IT (MANDATORY for user-facing changes)**\n\nTests and linters CANNOT catch: visual bugs, wrong CLI output, broken user flows, API response shape issues.\n\n**If this task produced anything a user would SEE or INTERACT with, you MUST launch it and verify yourself.**\n\n- **Frontend/UI**: `/playwright` skill \u2014 load the page, click through the flow, check console. Verify: page loads, interactions work, console clean, responsive.\n- **TUI/CLI**: `interactive_bash` \u2014 run the command, try good input, try bad input, try --help. Verify: command runs, output correct, error messages helpful, edge inputs handled.\n- **API/Backend**: `Bash` with curl \u2014 hit the endpoint, check response body, send malformed input. Verify: returns 200, body correct, error cases return proper errors.\n- **Config/Build**: Actually start the service or import the config. Verify: loads without error, backward compatible.\n\nThis is NOT optional \"if applicable\". If the deliverable is user-facing and you did not run it, you are shipping untested work.\n\n**PHASE 4: GATE DECISION \u2014 Should you proceed to the next task?**\n\nAnswer honestly:\n1. Can I explain what EVERY changed line does? (If no \u2014 back to Phase 1)\n2. Did I SEE it work with my own eyes? (If user-facing and no \u2014 back to Phase 3)\n3. Am I confident nothing existing is broken? (If no \u2014 run broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO. Investigate until CERTAIN.\n\n- **All 3 YES** \u2014 Proceed: mark task complete, move to next.\n- **Any NO** \u2014 Reject: resume session with `session_id`, fix the specific issue.\n- **Unsure** \u2014 Reject: \"unsure\" = \"no\". Investigate until you have a definitive answer.\n\n**DO NOT proceed to the next task until all 4 phases are complete and the gate passes.**";
export declare const VERIFICATION_REMINDER_GEMINI = "**THE SUBAGENT HAS FINISHED. THEIR WORK IS EXTREMELY SUSPICIOUS.**\n\nThe subagent CLAIMS this task is done. Based on thousands of executions, subagent claims are FALSE more often than true.\nThey ROUTINELY:\n- Ship code with syntax errors they didn't bother to check\n- Create stub implementations with TODOs and call it \"done\"\n- Write tests that pass trivially (testing nothing meaningful)\n- Implement logic that does NOT match what was requested\n- Add features nobody asked for and call it \"improvement\"\n- Report \"all tests pass\" when they didn't run any tests\n\n**This is NOT a theoretical warning. This WILL happen on this task. Assume the work is BROKEN.**\n\n**YOU MUST VERIFY WITH ACTUAL TOOL CALLS. NOT REASONING. TOOL CALLS.**\nThinking \"it looks correct\" is NOT verification. Running `lsp_diagnostics` IS.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (DO NOT SKIP \u2014 DO NOT RUN TESTS YET)**\n\nRead the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat\")` \u2014 see exactly which files changed.\n2. `Read` EVERY changed file \u2014 no exceptions, no skimming.\n3. For EACH file:\n - Does this code ACTUALLY do what the task required? RE-READ the task spec.\n - Any stubs, TODOs, placeholders? `Grep` for TODO, FIXME, HACK, xxx\n - Anti-patterns? `Grep` for `as any`, `@ts-ignore`, empty catch\n - Scope creep? Did the subagent add things NOT in the task spec?\n4. Cross-check EVERY claim against actual code.\n\n**If you cannot explain what every changed line does, GO BACK AND READ AGAIN.**\n\n**PHASE 2: RUN AUTOMATED CHECKS**\n\n1. `lsp_diagnostics` on EACH changed file \u2014 ZERO new errors. ACTUALLY RUN THIS.\n2. Run tests for changed modules, then full suite. ACTUALLY RUN THESE.\n3. Build/typecheck \u2014 exit 0.\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. Fix the code.\n\n**PHASE 3: HANDS-ON QA (MANDATORY for user-facing changes)**\n\n- **Frontend/UI**: `/playwright`\n- **TUI/CLI**: `interactive_bash`\n- **API/Backend**: `Bash` with curl\n\n**If user-facing and you did not run it, you are shipping UNTESTED BROKEN work.**\n\n**PHASE 4: GATE DECISION**\n\n1. Can I explain what EVERY changed line does? (If no \u2192 Phase 1)\n2. Did I SEE it work via tool calls? (If user-facing and no \u2192 Phase 3)\n3. Am I confident nothing is broken? (If no \u2192 broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO.\n\n**DO NOT proceed to the next task until all 4 phases are complete.**";
export declare const ORCHESTRATOR_DELEGATION_REQUIRED: string;
export declare const SINGLE_TASK_DIRECTIVE: string;
+9
View File
@@ -0,0 +1,9 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { SessionState } from "./types";
import type { ToolExecuteAfterInput, ToolExecuteAfterOutput } from "./types";
export declare function createToolExecuteAfterHandler(input: {
ctx: PluginInput;
pendingFilePaths: Map<string, string>;
autoCommit: boolean;
getState: (sessionID: string) => SessionState;
}): (toolInput: ToolExecuteAfterInput, toolOutput: ToolExecuteAfterOutput) => Promise<void>;
+12
View File
@@ -0,0 +1,12 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function createToolExecuteBeforeHandler(input: {
ctx: PluginInput;
pendingFilePaths: Map<string, string>;
}): (toolInput: {
tool: string;
sessionID?: string;
callID?: string;
}, toolOutput: {
args: Record<string, unknown>;
message?: string;
}) => Promise<void>;
+33
View File
@@ -0,0 +1,33 @@
import type { AgentOverrides } from "../../config";
import type { BackgroundManager } from "../../features/background-agent";
export type ModelInfo = {
providerID: string;
modelID: string;
};
export interface AtlasHookOptions {
directory: string;
backgroundManager?: BackgroundManager;
isContinuationStopped?: (sessionID: string) => boolean;
shouldSkipContinuation?: (sessionID: string) => boolean;
agentOverrides?: AgentOverrides;
/** Enable auto-commit after each atomic task completion (default: true) */
autoCommit?: boolean;
}
export interface ToolExecuteAfterInput {
tool: string;
sessionID?: string;
callID?: string;
}
export interface ToolExecuteAfterOutput {
title: string;
output: string;
metadata: Record<string, unknown>;
}
export interface SessionState {
lastEventWasAbortError?: boolean;
lastContinuationInjectedAt?: number;
promptFailureCount: number;
lastFailureAt?: number;
pendingRetryTimer?: ReturnType<typeof setTimeout>;
waitingForFinalWaveApproval?: boolean;
}
+10
View File
@@ -0,0 +1,10 @@
export declare function buildCompletionGate(planName: string, sessionId: string): string;
export declare function buildOrchestratorReminder(planName: string, progress: {
total: number;
completed: number;
}, sessionId: string, autoCommit?: boolean, includeCompletionGate?: boolean): string;
export declare function buildFinalWaveApprovalReminder(planName: string, progress: {
total: number;
completed: number;
}, sessionId: string): string;
export declare function buildStandaloneVerificationReminder(sessionId: string): string;
+1
View File
@@ -0,0 +1 @@
export declare function isWriteOrEditToolName(toolName: string): boolean;
+5
View File
@@ -0,0 +1,5 @@
export declare const HOOK_NAME: "auto-slash-command";
export declare const AUTO_SLASH_COMMAND_TAG_OPEN = "<auto-slash-command>";
export declare const AUTO_SLASH_COMMAND_TAG_CLOSE = "</auto-slash-command>";
export declare const SLASH_COMMAND_PATTERN: RegExp;
export declare const EXCLUDED_COMMANDS: Set<string>;
+13
View File
@@ -0,0 +1,13 @@
import type { ParsedSlashCommand } from "./types";
export declare function removeCodeBlocks(text: string): string;
export declare function parseSlashCommand(text: string): ParsedSlashCommand | null;
export declare function isExcludedCommand(command: string): boolean;
export declare function detectSlashCommand(text: string): ParsedSlashCommand | null;
export declare function extractPromptText(parts: Array<{
type: string;
text?: string;
}>): string;
export declare function findSlashCommandPartIndex(parts: Array<{
type: string;
text?: string;
}>): number;
+13
View File
@@ -0,0 +1,13 @@
import { type LoadedSkill } from "../../features/opencode-skill-loader";
import type { ParsedSlashCommand } from "./types";
export interface ExecutorOptions {
skills?: LoadedSkill[];
pluginsEnabled?: boolean;
enabledPluginsOverride?: Record<string, boolean>;
}
export interface ExecuteResult {
success: boolean;
replacementText?: string;
error?: string;
}
export declare function executeSlashCommand(parsed: ParsedSlashCommand, options?: ExecutorOptions): Promise<ExecuteResult>;
+18
View File
@@ -0,0 +1,18 @@
import type { AutoSlashCommandHookInput, AutoSlashCommandHookOutput, CommandExecuteBeforeInput, CommandExecuteBeforeOutput } from "./types";
import type { LoadedSkill } from "../../features/opencode-skill-loader";
export interface AutoSlashCommandHookOptions {
skills?: LoadedSkill[];
pluginsEnabled?: boolean;
enabledPluginsOverride?: Record<string, boolean>;
}
export declare function createAutoSlashCommandHook(options?: AutoSlashCommandHookOptions): {
"chat.message": (input: AutoSlashCommandHookInput, output: AutoSlashCommandHookOutput) => Promise<void>;
"command.execute.before": (input: CommandExecuteBeforeInput, output: CommandExecuteBeforeOutput) => Promise<void>;
event: ({ event, }: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
dispose: () => void;
};
+6
View File
@@ -0,0 +1,6 @@
export * from "./detector";
export * from "./executor";
export * from "./constants";
export * from "./types";
export { createAutoSlashCommandHook } from "./hook";
export type { AutoSlashCommandHookOptions } from "./hook";
@@ -0,0 +1,7 @@
export interface ProcessedCommandStore {
has(commandKey: string): boolean;
add(commandKey: string): void;
cleanupSession(sessionID: string): void;
clear(): void;
}
export declare function createProcessedCommandStore(): ProcessedCommandStore;
+39
View File
@@ -0,0 +1,39 @@
export interface AutoSlashCommandHookInput {
sessionID: string;
agent?: string;
model?: {
providerID: string;
modelID: string;
};
messageID?: string;
}
export interface AutoSlashCommandHookOutput {
message: Record<string, unknown>;
parts: Array<{
type: string;
text?: string;
[key: string]: unknown;
}>;
}
export interface ParsedSlashCommand {
command: string;
args: string;
raw: string;
}
export interface AutoSlashCommandResult {
detected: boolean;
parsedCommand?: ParsedSlashCommand;
injectedMessage?: string;
}
export interface CommandExecuteBeforeInput {
command: string;
sessionID: string;
arguments: string;
}
export interface CommandExecuteBeforeOutput {
parts: Array<{
type: string;
text?: string;
[key: string]: unknown;
}>;
}
+3
View File
@@ -0,0 +1,3 @@
export declare function invalidatePackage(packageName?: string): boolean;
/** @deprecated Use invalidatePackage instead - this nukes ALL plugins */
export declare function invalidateCache(): boolean;
+10
View File
@@ -0,0 +1,10 @@
export { isLocalDevMode, getLocalDevPath } from "./checker/local-dev-path";
export { getLocalDevVersion } from "./checker/local-dev-version";
export { findPluginEntry } from "./checker/plugin-entry";
export type { PluginEntryInfo } from "./checker/plugin-entry";
export { getCachedVersion } from "./checker/cached-version";
export { updatePinnedVersion } from "./checker/pinned-version-updater";
export { getLatestVersion } from "./checker/latest-version";
export { checkForUpdate } from "./checker/check-for-update";
export { syncCachePackageJsonToIntent } from "./checker/sync-package-json";
export type { SyncResult } from "./checker/sync-package-json";
@@ -0,0 +1 @@
export declare function getCachedVersion(): string | null;
@@ -0,0 +1,2 @@
import type { UpdateCheckResult } from "../types";
export declare function checkForUpdate(directory: string): Promise<UpdateCheckResult>;
@@ -0,0 +1 @@
export declare function getConfigPaths(directory: string): string[];
@@ -0,0 +1 @@
export declare function stripJsonComments(json: string): string;
@@ -0,0 +1 @@
export declare function getLatestVersion(channel?: string): Promise<string | null>;
@@ -0,0 +1,2 @@
export declare function isLocalDevMode(directory: string): boolean;
export declare function getLocalDevPath(directory: string): string | null;
@@ -0,0 +1 @@
export declare function getLocalDevVersion(directory: string): string | null;
@@ -0,0 +1 @@
export declare function findPackageJsonUp(startPath: string): string | null;
@@ -0,0 +1,2 @@
export declare function updatePinnedVersion(configPath: string, oldEntry: string, newVersion: string): boolean;
export declare function revertPinnedVersion(configPath: string, failedVersion: string, originalEntry: string): boolean;
@@ -0,0 +1,7 @@
export interface PluginEntryInfo {
entry: string;
isPinned: boolean;
pinnedVersion: string | null;
configPath: string;
}
export declare function findPluginEntry(directory: string): PluginEntryInfo | null;
@@ -0,0 +1,7 @@
import type { PluginEntryInfo } from "./plugin-entry";
export interface SyncResult {
synced: boolean;
error: "file_not_found" | "plugin_not_in_deps" | "parse_error" | "write_error" | null;
message?: string;
}
export declare function syncCachePackageJsonToIntent(pluginInfo: PluginEntryInfo): SyncResult;
+10
View File
@@ -0,0 +1,10 @@
export declare const PACKAGE_NAME = "oh-my-opencode";
export declare const NPM_REGISTRY_URL = "https://registry.npmjs.org/-/package/oh-my-opencode/dist-tags";
export declare const NPM_FETCH_TIMEOUT = 5000;
export declare const CACHE_DIR: string;
export declare const VERSION_FILE: string;
export declare function getWindowsAppdataDir(): string | null;
export declare const USER_CONFIG_DIR: string;
export declare const USER_OPENCODE_CONFIG: string;
export declare const USER_OPENCODE_CONFIG_JSONC: string;
export declare const INSTALLED_PACKAGE_JSON: string;
+10
View File
@@ -0,0 +1,10 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { AutoUpdateCheckerOptions } from "./types";
export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?: AutoUpdateCheckerOptions): {
event: ({ event }: {
event: {
type: string;
properties?: unknown;
};
}) => void;
};
@@ -0,0 +1,2 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function runBackgroundUpdateCheck(ctx: PluginInput, autoUpdate: boolean, getToastMessage: (isUpdate: boolean, latestVersion?: string) => string): Promise<void>;
@@ -0,0 +1,2 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function showConfigErrorsIfAny(ctx: PluginInput): Promise<void>;
@@ -0,0 +1,2 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function updateAndShowConnectedProvidersCacheStatus(ctx: PluginInput): Promise<void>;
@@ -0,0 +1,2 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function showModelCacheWarningIfNeeded(ctx: PluginInput): Promise<void>;
@@ -0,0 +1,2 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function showSpinnerToast(ctx: PluginInput, version: string, message: string): Promise<void>;
@@ -0,0 +1,3 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function showVersionToast(ctx: PluginInput, version: string | null, message: string): Promise<void>;
export declare function showLocalDevToast(ctx: PluginInput, version: string | null, isSisyphusEnabled: boolean): Promise<void>;
@@ -0,0 +1,3 @@
import type { PluginInput } from "@opencode-ai/plugin";
export declare function showUpdateAvailableToast(ctx: PluginInput, latestVersion: string, getToastMessage: (isUpdate: boolean, latestVersion?: string) => string): Promise<void>;
export declare function showAutoUpdatedToast(ctx: PluginInput, oldVersion: string, newVersion: string): Promise<void>;
+5
View File
@@ -0,0 +1,5 @@
export { createAutoUpdateCheckerHook } from "./hook";
export { isPrereleaseVersion, isDistTag, isPrereleaseOrDistTag, extractChannel, } from "./version-channel";
export { checkForUpdate } from "./checker";
export { invalidatePackage, invalidateCache } from "./cache";
export type { UpdateCheckResult, AutoUpdateCheckerOptions } from "./types";
+25
View File
@@ -0,0 +1,25 @@
export interface NpmDistTags {
latest: string;
[key: string]: string;
}
export interface OpencodeConfig {
plugin?: string[];
[key: string]: unknown;
}
export interface PackageJson {
version: string;
name?: string;
[key: string]: unknown;
}
export interface UpdateCheckResult {
needsUpdate: boolean;
currentVersion: string | null;
latestVersion: string | null;
isLocalDev: boolean;
isPinned: boolean;
}
export interface AutoUpdateCheckerOptions {
showStartupToast?: boolean;
isSisyphusEnabled?: boolean;
autoUpdate?: boolean;
}
+4
View File
@@ -0,0 +1,4 @@
export declare function isPrereleaseVersion(version: string): boolean;
export declare function isDistTag(version: string): boolean;
export declare function isPrereleaseOrDistTag(pinnedVersion: string | null): boolean;
export declare function extractChannel(version: string | null): string;
+29
View File
@@ -0,0 +1,29 @@
import type { BackgroundManager } from "../../features/background-agent";
interface Event {
type: string;
properties?: Record<string, unknown>;
}
interface EventInput {
event: Event;
}
interface ChatMessageInput {
sessionID: string;
}
interface ChatMessageOutput {
parts: Array<{
type: string;
text?: string;
[key: string]: unknown;
}>;
}
/**
* Background notification hook - handles event routing to BackgroundManager.
*
* Notifications are now delivered directly via session.prompt({ noReply })
* from the manager, so this hook only needs to handle event routing.
*/
export declare function createBackgroundNotificationHook(manager: BackgroundManager): {
"chat.message": (input: ChatMessageInput, output: ChatMessageOutput) => Promise<void>;
event: ({ event }: EventInput) => Promise<void>;
};
export {};
+2
View File
@@ -0,0 +1,2 @@
export { createBackgroundNotificationHook } from "./hook";
export type { BackgroundNotificationHookConfig } from "./types";
+4
View File
@@ -0,0 +1,4 @@
import type { BackgroundTask } from "../../features/background-agent";
export interface BackgroundNotificationHookConfig {
formatNotification?: (tasks: BackgroundTask[]) => string;
}
+2
View File
@@ -0,0 +1,2 @@
import type { AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
export declare function buildReminderMessage(availableSkills: AvailableSkill[]): string;
+23
View File
@@ -0,0 +1,23 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { AvailableSkill } from "../../agents/dynamic-agent-prompt-builder";
interface ToolExecuteInput {
tool: string;
sessionID: string;
callID: string;
agent?: string;
}
interface ToolExecuteOutput {
title: string;
output: string;
metadata: unknown;
}
export declare function createCategorySkillReminderHook(_ctx: PluginInput, availableSkills?: AvailableSkill[]): {
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
event: ({ event }: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
};
export {};
+1
View File
@@ -0,0 +1 @@
export { createCategorySkillReminderHook } from "./hook";
@@ -0,0 +1,48 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { PluginConfig } from "./types";
import type { ContextCollector } from "../../features/context-injector";
export declare function createClaudeCodeHooksHook(ctx: PluginInput, config?: PluginConfig, contextCollector?: ContextCollector): {
"experimental.session.compacting": (input: {
sessionID: string;
}, output: {
context: string[];
}) => Promise<void>;
"chat.message": (input: {
sessionID: string;
agent?: string;
model?: {
providerID: string;
modelID: string;
};
messageID?: string;
}, output: {
message: Record<string, unknown>;
parts: Array<{
type: string;
text?: string;
[key: string]: unknown;
}>;
}) => Promise<void>;
"tool.execute.before": (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
args: Record<string, unknown>;
}) => Promise<void>;
"tool.execute.after": (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
title: string;
output: string;
metadata: unknown;
} | undefined) => Promise<void>;
event: (input: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
};
+13
View File
@@ -0,0 +1,13 @@
import type { ClaudeHookEvent } from "./types";
export interface DisabledHooksConfig {
Stop?: string[];
PreToolUse?: string[];
PostToolUse?: string[];
UserPromptSubmit?: string[];
PreCompact?: string[];
}
export interface PluginExtendedConfig {
disabledHooks?: DisabledHooksConfig;
}
export declare function loadPluginExtendedConfig(): Promise<PluginExtendedConfig>;
export declare function isHookCommandDisabled(eventType: ClaudeHookEvent, command: string, config: PluginExtendedConfig | null): boolean;
+3
View File
@@ -0,0 +1,3 @@
import type { ClaudeHooksConfig } from "./types";
export declare function getClaudeSettingsPaths(customPath?: string): string[];
export declare function loadClaudeHooksConfig(customSettingsPath?: string): Promise<ClaudeHooksConfig | null>;
+4
View File
@@ -0,0 +1,4 @@
import type { HookAction } from "./types";
import type { CommandResult } from "../../shared/command-executor/execute-hook-command";
export declare function getHookIdentifier(hook: HookAction): string;
export declare function dispatchHook(hook: HookAction, stdinJson: string, cwd: string): Promise<CommandResult>;
+4
View File
@@ -0,0 +1,4 @@
import type { HookHttp } from "./types";
import type { CommandResult } from "../../shared/command-executor/execute-hook-command";
export declare function interpolateEnvVars(value: string, allowedEnvVars: string[]): string;
export declare function executeHttpHook(hook: HookHttp, stdin: string): Promise<CommandResult>;
@@ -0,0 +1,19 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { PluginConfig } from "../types";
import type { ContextCollector } from "../../../features/context-injector";
export declare function createChatMessageHandler(ctx: PluginInput, config: PluginConfig, contextCollector?: ContextCollector): (input: {
sessionID: string;
agent?: string;
model?: {
providerID: string;
modelID: string;
};
messageID?: string;
}, output: {
message: Record<string, unknown>;
parts: Array<{
type: string;
text?: string;
[key: string]: unknown;
}>;
}) => Promise<void>;
@@ -0,0 +1,7 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { PluginConfig } from "../types";
export declare function createPreCompactHandler(ctx: PluginInput, config: PluginConfig): (input: {
sessionID: string;
}, output: {
context: string[];
}) => Promise<void>;
@@ -0,0 +1,8 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { PluginConfig } from "../types";
export declare function createSessionEventHandler(ctx: PluginInput, config: PluginConfig): (input: {
event: {
type: string;
properties?: unknown;
};
}) => Promise<void>;
@@ -0,0 +1,11 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { PluginConfig } from "../types";
export declare function createToolExecuteAfterHandler(ctx: PluginInput, config: PluginConfig): (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
title: string;
output: string;
metadata: unknown;
} | undefined) => Promise<void>;
@@ -0,0 +1,9 @@
import type { PluginInput } from "@opencode-ai/plugin";
import type { PluginConfig } from "../types";
export declare function createToolExecuteBeforeHandler(ctx: PluginInput, config: PluginConfig): (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
args: Record<string, unknown>;
}) => Promise<void>;
+1
View File
@@ -0,0 +1 @@
export { createClaudeCodeHooksHook } from "./claude-code-hooks-hook";

Some files were not shown because too many files have changed in this diff Show More