@a4hgehad/oh-my-openagent-slim 0.8.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/LICENSE +21 -0
- package/README.md +325 -0
- package/dist/agents/designer.d.ts +2 -0
- package/dist/agents/explorer.d.ts +2 -0
- package/dist/agents/fixer.d.ts +2 -0
- package/dist/agents/index.d.ts +22 -0
- package/dist/agents/librarian.d.ts +2 -0
- package/dist/agents/oracle.d.ts +2 -0
- package/dist/agents/orchestrator.d.ts +15 -0
- package/dist/background/background-manager.d.ts +175 -0
- package/dist/background/index.d.ts +2 -0
- package/dist/background/tmux-session-manager.d.ts +63 -0
- package/dist/cli/config-io.d.ts +22 -0
- package/dist/cli/config-manager.d.ts +4 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +14471 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/paths.d.ts +21 -0
- package/dist/cli/providers.d.ts +104 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +38 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +14 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +31 -0
- package/dist/config/schema.d.ts +220 -0
- package/dist/config/utils.d.ts +10 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +6 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +17 -0
- package/dist/hooks/auto-update-checker/types.d.ts +23 -0
- package/dist/hooks/chat-headers.d.ts +16 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/foreground-fallback/index.d.ts +72 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +26 -0
- package/dist/hooks/post-read-nudge/index.d.ts +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +34409 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +6 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/background.d.ts +13 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/lsp/client.d.ts +42 -0
- package/dist/tools/lsp/config-store.d.ts +29 -0
- package/dist/tools/lsp/config.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +24 -0
- package/dist/tools/lsp/index.d.ts +4 -0
- package/dist/tools/lsp/tools.d.ts +5 -0
- package/dist/tools/lsp/types.d.ts +35 -0
- package/dist/tools/lsp/utils.d.ts +34 -0
- package/dist/utils/agent-variant.d.ts +47 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/internal-initiator.d.ts +6 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/tmux.d.ts +32 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/oh-my-openagent-slim.schema.json +448 -0
- package/package.json +72 -0
- package/src/skills/cartography/README.md +57 -0
- package/src/skills/cartography/SKILL.md +160 -0
- package/src/skills/cartography/scripts/cartographer.py +456 -0
- package/src/skills/cartography/scripts/test_cartographer.py +87 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DelegateTaskErrorPattern {
|
|
2
|
+
pattern: string;
|
|
3
|
+
errorType: string;
|
|
4
|
+
fixHint: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const DELEGATE_TASK_ERROR_PATTERNS: DelegateTaskErrorPattern[];
|
|
7
|
+
export interface DetectedError {
|
|
8
|
+
errorType: string;
|
|
9
|
+
originalOutput: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function detectDelegateTaskError(output: string): DetectedError | null;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime model fallback for foreground (interactive) agent sessions.
|
|
3
|
+
*
|
|
4
|
+
* When OpenCode fires a session.error, message.updated, or session.status
|
|
5
|
+
* event containing a rate-limit signal, this manager:
|
|
6
|
+
* 1. Looks up the next untried model in the agent's configured chain
|
|
7
|
+
* 2. Aborts the rate-limited prompt via client.session.abort()
|
|
8
|
+
* 3. Re-queues the last user message via client.session.promptAsync()
|
|
9
|
+
* with the new model — promptAsync returns immediately so we never
|
|
10
|
+
* block the event handler waiting for a full LLM response.
|
|
11
|
+
*
|
|
12
|
+
* This mirrors the BackgroundTaskManager's fallback loop but operates
|
|
13
|
+
* reactively through the event system instead of wrapping prompt() in a
|
|
14
|
+
* try/catch, which is not possible for interactive (foreground) sessions.
|
|
15
|
+
*/
|
|
16
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
17
|
+
type OpencodeClient = PluginInput['client'];
|
|
18
|
+
export declare function isRateLimitError(error: unknown): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Manages runtime model fallback for foreground agent sessions.
|
|
21
|
+
*
|
|
22
|
+
* Constructed at plugin init with the ordered fallback chains for each agent
|
|
23
|
+
* (built from _modelArray entries merged with fallback.chains config).
|
|
24
|
+
*/
|
|
25
|
+
export declare class ForegroundFallbackManager {
|
|
26
|
+
private readonly client;
|
|
27
|
+
/**
|
|
28
|
+
* Ordered fallback chains per agent.
|
|
29
|
+
* e.g. { Ra: ['anthropic/claude-opus-4-5', 'openai/gpt-4o'] }
|
|
30
|
+
* The first model that hasn't been tried yet is selected on each fallback.
|
|
31
|
+
*/
|
|
32
|
+
private readonly chains;
|
|
33
|
+
private readonly enabled;
|
|
34
|
+
/** sessionID → last observed model string ("providerID/modelID") */
|
|
35
|
+
private readonly sessionModel;
|
|
36
|
+
/** sessionID → agent name (populated from message.updated info.agent field) */
|
|
37
|
+
private readonly sessionAgent;
|
|
38
|
+
/** sessionID → set of models already attempted this session */
|
|
39
|
+
private readonly sessionTried;
|
|
40
|
+
/** Sessions with an active fallback switch in flight */
|
|
41
|
+
private readonly inProgress;
|
|
42
|
+
/** sessionID → timestamp of last trigger (for deduplication) */
|
|
43
|
+
private readonly lastTrigger;
|
|
44
|
+
constructor(client: OpencodeClient,
|
|
45
|
+
/**
|
|
46
|
+
* Ordered fallback chains per agent.
|
|
47
|
+
* e.g. { Ra: ['anthropic/claude-opus-4-5', 'openai/gpt-4o'] }
|
|
48
|
+
* The first model that hasn't been tried yet is selected on each fallback.
|
|
49
|
+
*/
|
|
50
|
+
chains: Record<string, string[]>, enabled: boolean);
|
|
51
|
+
/**
|
|
52
|
+
* Process an OpenCode plugin event.
|
|
53
|
+
* Call this from the plugin's `event` hook for every event received.
|
|
54
|
+
*/
|
|
55
|
+
handleEvent(rawEvent: unknown): Promise<void>;
|
|
56
|
+
private tryFallback;
|
|
57
|
+
/**
|
|
58
|
+
* Determine the fallback chain to use for a session.
|
|
59
|
+
*
|
|
60
|
+
* Priority:
|
|
61
|
+
* 1. Agent name known AND has a configured chain → return it directly
|
|
62
|
+
* 2. Agent name known but NO chain configured → return [] (no fallback;
|
|
63
|
+
* do NOT bleed into other agents' chains which would re-prompt the
|
|
64
|
+
* session with a model belonging to a completely different agent)
|
|
65
|
+
* 3. Agent name unknown, current model known → search all chains for
|
|
66
|
+
* the model to infer which chain to use
|
|
67
|
+
* 4. Nothing matches → flatten all chains as a last resort (only
|
|
68
|
+
* reached when both agent name and current model are unavailable)
|
|
69
|
+
*/
|
|
70
|
+
private resolveChain;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { AutoUpdateCheckerOptions } from './auto-update-checker';
|
|
2
|
+
export { createAutoUpdateCheckerHook } from './auto-update-checker';
|
|
3
|
+
export { createChatHeadersHook } from './chat-headers';
|
|
4
|
+
export { createDelegateTaskRetryHook } from './delegate-task-retry';
|
|
5
|
+
export { ForegroundFallbackManager, isRateLimitError, } from './foreground-fallback';
|
|
6
|
+
export { createJsonErrorRecoveryHook } from './json-error-recovery';
|
|
7
|
+
export { createPhaseReminderHook } from './phase-reminder';
|
|
8
|
+
export { createPostReadNudgeHook } from './post-read-nudge';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
export declare const JSON_ERROR_TOOL_EXCLUDE_LIST: readonly ["bash", "read", "glob", "webfetch", "grep_app_searchgithub", "websearch_web_search_exa"];
|
|
3
|
+
export declare const JSON_ERROR_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
4
|
+
export declare const JSON_ERROR_REMINDER = "\n[JSON PARSE ERROR - IMMEDIATE ACTION REQUIRED]\n\nYou sent invalid JSON arguments. The system could not parse your tool call.\nSTOP and do this NOW:\n\n1. LOOK at the error message above to see what was expected vs what you sent.\n2. CORRECT your JSON syntax (missing braces, unescaped quotes, trailing commas, etc).\n3. RETRY the tool call with valid JSON.\n\nDO NOT repeat the exact same invalid call.\n";
|
|
5
|
+
interface ToolExecuteAfterInput {
|
|
6
|
+
tool: string;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
callID: string;
|
|
9
|
+
}
|
|
10
|
+
interface ToolExecuteAfterOutput {
|
|
11
|
+
title: string;
|
|
12
|
+
output: unknown;
|
|
13
|
+
metadata: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare function createJsonErrorRecoveryHook(_ctx: PluginInput): {
|
|
16
|
+
'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createJsonErrorRecoveryHook, JSON_ERROR_PATTERNS, JSON_ERROR_REMINDER, JSON_ERROR_TOOL_EXCLUDE_LIST, } from './hook';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const PHASE_REMINDER = "<reminder>Recall Workflow Rules:\nUnderstand \u2192 find the best path (delegate based on rules and parallelize independent work) \u2192 execute \u2192 verify.\nIf delegating, launch the specialist in the same turn you mention it.</reminder>";
|
|
2
|
+
interface MessageInfo {
|
|
3
|
+
role: string;
|
|
4
|
+
agent?: string;
|
|
5
|
+
sessionID?: string;
|
|
6
|
+
}
|
|
7
|
+
interface MessagePart {
|
|
8
|
+
type: string;
|
|
9
|
+
text?: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface MessageWithParts {
|
|
13
|
+
info: MessageInfo;
|
|
14
|
+
parts: MessagePart[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates the experimental.chat.messages.transform hook for phase reminder injection.
|
|
18
|
+
* This hook runs right before sending to API, so it doesn't affect UI display.
|
|
19
|
+
* Only injects for the Ra agent.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createPhaseReminderHook(): {
|
|
22
|
+
'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
|
|
23
|
+
messages: MessageWithParts[];
|
|
24
|
+
}) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-Read nudge - appends a delegation reminder after file reads.
|
|
3
|
+
* Catches the "read files → implement myself" anti-pattern.
|
|
4
|
+
*/
|
|
5
|
+
interface ToolExecuteAfterInput {
|
|
6
|
+
tool: string;
|
|
7
|
+
sessionID?: string;
|
|
8
|
+
callID?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ToolExecuteAfterOutput {
|
|
11
|
+
title: string;
|
|
12
|
+
output: string;
|
|
13
|
+
metadata: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createPostReadNudgeHook(): {
|
|
16
|
+
'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Plugin } from '@opencode-ai/plugin';
|
|
2
|
+
declare const OhMyOpenCodeLite: Plugin;
|
|
3
|
+
export default OhMyOpenCodeLite;
|
|
4
|
+
export type { AgentName, AgentOverrideConfig, McpName, PluginConfig, TmuxConfig, TmuxLayout, } from './config';
|
|
5
|
+
export type { RemoteMcpConfig } from './mcp';
|