@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.
Files changed (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +325 -0
  3. package/dist/agents/designer.d.ts +2 -0
  4. package/dist/agents/explorer.d.ts +2 -0
  5. package/dist/agents/fixer.d.ts +2 -0
  6. package/dist/agents/index.d.ts +22 -0
  7. package/dist/agents/librarian.d.ts +2 -0
  8. package/dist/agents/oracle.d.ts +2 -0
  9. package/dist/agents/orchestrator.d.ts +15 -0
  10. package/dist/background/background-manager.d.ts +175 -0
  11. package/dist/background/index.d.ts +2 -0
  12. package/dist/background/tmux-session-manager.d.ts +63 -0
  13. package/dist/cli/config-io.d.ts +22 -0
  14. package/dist/cli/config-manager.d.ts +4 -0
  15. package/dist/cli/custom-skills.d.ts +29 -0
  16. package/dist/cli/index.d.ts +2 -0
  17. package/dist/cli/index.js +14471 -0
  18. package/dist/cli/install.d.ts +2 -0
  19. package/dist/cli/model-key-normalization.d.ts +1 -0
  20. package/dist/cli/paths.d.ts +21 -0
  21. package/dist/cli/providers.d.ts +104 -0
  22. package/dist/cli/skills.d.ts +52 -0
  23. package/dist/cli/system.d.ts +6 -0
  24. package/dist/cli/types.d.ts +38 -0
  25. package/dist/config/agent-mcps.d.ts +15 -0
  26. package/dist/config/constants.d.ts +14 -0
  27. package/dist/config/index.d.ts +4 -0
  28. package/dist/config/loader.d.ts +31 -0
  29. package/dist/config/schema.d.ts +220 -0
  30. package/dist/config/utils.d.ts +10 -0
  31. package/dist/hooks/auto-update-checker/cache.d.ts +6 -0
  32. package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
  33. package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
  34. package/dist/hooks/auto-update-checker/index.d.ts +17 -0
  35. package/dist/hooks/auto-update-checker/types.d.ts +23 -0
  36. package/dist/hooks/chat-headers.d.ts +16 -0
  37. package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
  38. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
  39. package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
  40. package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
  41. package/dist/hooks/foreground-fallback/index.d.ts +72 -0
  42. package/dist/hooks/index.d.ts +8 -0
  43. package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
  44. package/dist/hooks/json-error-recovery/index.d.ts +1 -0
  45. package/dist/hooks/phase-reminder/index.d.ts +26 -0
  46. package/dist/hooks/post-read-nudge/index.d.ts +18 -0
  47. package/dist/index.d.ts +5 -0
  48. package/dist/index.js +34409 -0
  49. package/dist/mcp/context7.d.ts +6 -0
  50. package/dist/mcp/grep-app.d.ts +6 -0
  51. package/dist/mcp/index.d.ts +6 -0
  52. package/dist/mcp/types.d.ts +12 -0
  53. package/dist/mcp/websearch.d.ts +6 -0
  54. package/dist/tools/ast-grep/cli.d.ts +15 -0
  55. package/dist/tools/ast-grep/constants.d.ts +25 -0
  56. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  57. package/dist/tools/ast-grep/index.d.ts +10 -0
  58. package/dist/tools/ast-grep/tools.d.ts +3 -0
  59. package/dist/tools/ast-grep/types.d.ts +30 -0
  60. package/dist/tools/ast-grep/utils.d.ts +4 -0
  61. package/dist/tools/background.d.ts +13 -0
  62. package/dist/tools/index.d.ts +3 -0
  63. package/dist/tools/lsp/client.d.ts +42 -0
  64. package/dist/tools/lsp/config-store.d.ts +29 -0
  65. package/dist/tools/lsp/config.d.ts +4 -0
  66. package/dist/tools/lsp/constants.d.ts +24 -0
  67. package/dist/tools/lsp/index.d.ts +4 -0
  68. package/dist/tools/lsp/tools.d.ts +5 -0
  69. package/dist/tools/lsp/types.d.ts +35 -0
  70. package/dist/tools/lsp/utils.d.ts +34 -0
  71. package/dist/utils/agent-variant.d.ts +47 -0
  72. package/dist/utils/env.d.ts +1 -0
  73. package/dist/utils/index.d.ts +7 -0
  74. package/dist/utils/internal-initiator.d.ts +6 -0
  75. package/dist/utils/logger.d.ts +1 -0
  76. package/dist/utils/polling.d.ts +21 -0
  77. package/dist/utils/tmux.d.ts +32 -0
  78. package/dist/utils/zip-extractor.d.ts +1 -0
  79. package/oh-my-openagent-slim.schema.json +448 -0
  80. package/package.json +72 -0
  81. package/src/skills/cartography/README.md +57 -0
  82. package/src/skills/cartography/SKILL.md +160 -0
  83. package/src/skills/cartography/scripts/cartographer.py +456 -0
  84. package/src/skills/cartography/scripts/test_cartographer.py +87 -0
@@ -0,0 +1,2 @@
1
+ import type { InstallArgs } from './types';
2
+ export declare function install(args: InstallArgs): Promise<number>;
@@ -0,0 +1 @@
1
+ export declare function buildModelKeyAliases(input: string): string[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Get the OpenCode plugin config directory.
3
+ *
4
+ * Resolution order:
5
+ * 1. OPENCODE_CONFIG_DIR (custom OpenCode directory)
6
+ * 2. XDG_CONFIG_HOME/opencode
7
+ * 3. ~/.config/opencode
8
+ */
9
+ export declare function getConfigDir(): string;
10
+ export declare function getOpenCodeConfigPaths(): string[];
11
+ export declare function getConfigJson(): string;
12
+ export declare function getConfigJsonc(): string;
13
+ export declare function getLiteConfig(): string;
14
+ export declare function getLiteConfigJsonc(): string;
15
+ export declare function getExistingLiteConfigPath(): string;
16
+ export declare function getExistingConfigPath(): string;
17
+ export declare function ensureConfigDir(): void;
18
+ /**
19
+ * Ensure the directory for OpenCode's main config file exists.
20
+ */
21
+ export declare function ensureOpenCodeConfigDir(): void;
@@ -0,0 +1,104 @@
1
+ import type { InstallConfig } from './types';
2
+ export declare const MODEL_MAPPINGS: {
3
+ readonly openai: {
4
+ readonly Ra: {
5
+ readonly model: "openai/gpt-5.4";
6
+ };
7
+ readonly Oracle: {
8
+ readonly model: "openai/gpt-5.4";
9
+ readonly variant: "high";
10
+ };
11
+ readonly Thoth: {
12
+ readonly model: "openai/gpt-5.4-mini";
13
+ readonly variant: "low";
14
+ };
15
+ readonly Horus: {
16
+ readonly model: "openai/gpt-5.4-mini";
17
+ readonly variant: "low";
18
+ };
19
+ readonly Bastet: {
20
+ readonly model: "openai/gpt-5.4-mini";
21
+ readonly variant: "medium";
22
+ };
23
+ readonly Anubis: {
24
+ readonly model: "openai/gpt-5.4-mini";
25
+ readonly variant: "low";
26
+ };
27
+ };
28
+ readonly kimi: {
29
+ readonly Ra: {
30
+ readonly model: "kimi-for-coding/k2p5";
31
+ };
32
+ readonly Oracle: {
33
+ readonly model: "kimi-for-coding/k2p5";
34
+ readonly variant: "high";
35
+ };
36
+ readonly Thoth: {
37
+ readonly model: "kimi-for-coding/k2p5";
38
+ readonly variant: "low";
39
+ };
40
+ readonly Horus: {
41
+ readonly model: "kimi-for-coding/k2p5";
42
+ readonly variant: "low";
43
+ };
44
+ readonly Bastet: {
45
+ readonly model: "kimi-for-coding/k2p5";
46
+ readonly variant: "medium";
47
+ };
48
+ readonly Anubis: {
49
+ readonly model: "kimi-for-coding/k2p5";
50
+ readonly variant: "low";
51
+ };
52
+ };
53
+ readonly copilot: {
54
+ readonly Ra: {
55
+ readonly model: "github-copilot/claude-opus-4.6";
56
+ };
57
+ readonly Oracle: {
58
+ readonly model: "github-copilot/claude-opus-4.6";
59
+ readonly variant: "high";
60
+ };
61
+ readonly Thoth: {
62
+ readonly model: "github-copilot/grok-code-fast-1";
63
+ readonly variant: "low";
64
+ };
65
+ readonly Horus: {
66
+ readonly model: "github-copilot/grok-code-fast-1";
67
+ readonly variant: "low";
68
+ };
69
+ readonly Bastet: {
70
+ readonly model: "github-copilot/gemini-3.1-pro-preview";
71
+ readonly variant: "medium";
72
+ };
73
+ readonly Anubis: {
74
+ readonly model: "github-copilot/claude-sonnet-4.6";
75
+ readonly variant: "low";
76
+ };
77
+ };
78
+ readonly 'zai-plan': {
79
+ readonly Ra: {
80
+ readonly model: "zai-coding-plan/glm-5";
81
+ };
82
+ readonly Oracle: {
83
+ readonly model: "zai-coding-plan/glm-5";
84
+ readonly variant: "high";
85
+ };
86
+ readonly Thoth: {
87
+ readonly model: "zai-coding-plan/glm-5";
88
+ readonly variant: "low";
89
+ };
90
+ readonly Horus: {
91
+ readonly model: "zai-coding-plan/glm-5";
92
+ readonly variant: "low";
93
+ };
94
+ readonly Bastet: {
95
+ readonly model: "zai-coding-plan/glm-5";
96
+ readonly variant: "medium";
97
+ };
98
+ readonly Anubis: {
99
+ readonly model: "zai-coding-plan/glm-5";
100
+ readonly variant: "low";
101
+ };
102
+ };
103
+ };
104
+ export declare function generateLiteConfig(installConfig: InstallConfig): Record<string, unknown>;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * A recommended skill to install via `npx skills add`.
3
+ */
4
+ export interface RecommendedSkill {
5
+ /** Human-readable name for prompts */
6
+ name: string;
7
+ /** GitHub repo URL for `npx skills add` */
8
+ repo: string;
9
+ /** Skill name within the repo (--skill flag) */
10
+ skillName: string;
11
+ /** List of agents that should auto-allow this skill */
12
+ allowedAgents: string[];
13
+ /** Description shown to user during install */
14
+ description: string;
15
+ /** Optional commands to run after the skill is added */
16
+ postInstallCommands?: string[];
17
+ }
18
+ /**
19
+ * A skill that is managed externally (e.g. user-installed) and needs
20
+ * permission grants but is NOT installed by this plugin's CLI.
21
+ */
22
+ export interface PermissionOnlySkill {
23
+ /** Skill name — must match the name OpenCode uses for permission checks */
24
+ name: string;
25
+ /** List of agents that should auto-allow this skill */
26
+ allowedAgents: string[];
27
+ /** Human-readable description (for documentation only) */
28
+ description: string;
29
+ }
30
+ /**
31
+ * List of recommended skills.
32
+ * Add new skills here to include them in the installation flow.
33
+ */
34
+ export declare const RECOMMENDED_SKILLS: RecommendedSkill[];
35
+ /**
36
+ * Skills managed externally (not installed by this plugin's CLI).
37
+ * Entries here only affect agent permission grants — nothing is installed.
38
+ */
39
+ export declare const PERMISSION_ONLY_SKILLS: PermissionOnlySkill[];
40
+ /**
41
+ * Install a skill using `npx skills add`.
42
+ * @param skill - The skill to install
43
+ * @returns True if installation succeeded, false otherwise
44
+ */
45
+ export declare function installSkill(skill: RecommendedSkill): boolean;
46
+ /**
47
+ * Get permission presets for a specific agent based on recommended skills.
48
+ * @param agentName - The name of the agent
49
+ * @param skillList - Optional explicit list of skills to allow (overrides recommendations)
50
+ * @returns Permission rules for the skill permission type
51
+ */
52
+ export declare function getSkillPermissionsForAgent(agentName: string, skillList?: string[]): Record<string, 'allow' | 'ask' | 'deny'>;
@@ -0,0 +1,6 @@
1
+ export declare function resolveOpenCodePath(): string;
2
+ export declare function isOpenCodeInstalled(): Promise<boolean>;
3
+ export declare function isTmuxInstalled(): Promise<boolean>;
4
+ export declare function getOpenCodeVersion(): Promise<string | null>;
5
+ export declare function getOpenCodePath(): string | null;
6
+ export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
@@ -0,0 +1,38 @@
1
+ export type BooleanArg = 'yes' | 'no';
2
+ export interface InstallArgs {
3
+ tui: boolean;
4
+ tmux?: BooleanArg;
5
+ skills?: BooleanArg;
6
+ dryRun?: boolean;
7
+ reset?: boolean;
8
+ }
9
+ export interface OpenCodeConfig {
10
+ plugin?: string[];
11
+ provider?: Record<string, unknown>;
12
+ agent?: Record<string, unknown>;
13
+ [key: string]: unknown;
14
+ }
15
+ export interface InstallConfig {
16
+ hasTmux: boolean;
17
+ installSkills: boolean;
18
+ installCustomSkills: boolean;
19
+ dryRun?: boolean;
20
+ reset: boolean;
21
+ }
22
+ export interface ConfigMergeResult {
23
+ success: boolean;
24
+ configPath: string;
25
+ error?: string;
26
+ }
27
+ export interface DetectedConfig {
28
+ isInstalled: boolean;
29
+ hasKimi: boolean;
30
+ hasOpenAI: boolean;
31
+ hasAnthropic?: boolean;
32
+ hasCopilot?: boolean;
33
+ hasZaiPlan?: boolean;
34
+ hasAntigravity: boolean;
35
+ hasChutes?: boolean;
36
+ hasOpencodeZen: boolean;
37
+ hasTmux: boolean;
38
+ }
@@ -0,0 +1,15 @@
1
+ import { type AgentName, type PluginConfig } from '.';
2
+ /** Default MCPs per agent - "*" means all MCPs, "!item" excludes specific MCPs */
3
+ export declare const DEFAULT_AGENT_MCPS: Record<AgentName, string[]>;
4
+ /**
5
+ * Parse a list with wildcard and exclusion syntax.
6
+ */
7
+ export declare function parseList(items: string[], allAvailable: string[]): string[];
8
+ /**
9
+ * Get available MCP names from schema and config.
10
+ */
11
+ export declare function getAvailableMcpNames(config?: PluginConfig): string[];
12
+ /**
13
+ * Get the MCP list for an agent (from config or defaults).
14
+ */
15
+ export declare function getAgentMcpList(agentName: string, config?: PluginConfig): string[];
@@ -0,0 +1,14 @@
1
+ export declare const AGENT_ALIASES: Record<string, string>;
2
+ export declare const SUBAGENT_NAMES: readonly ["Horus", "Thoth", "Oracle", "Bastet", "Anubis"];
3
+ export declare const ORCHESTRATOR_NAME: "Ra";
4
+ export declare const ALL_AGENT_NAMES: readonly ["Ra", "Horus", "Thoth", "Oracle", "Bastet", "Anubis"];
5
+ export type AgentName = (typeof ALL_AGENT_NAMES)[number];
6
+ export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
7
+ export declare const DEFAULT_MODELS: Record<AgentName, string | undefined>;
8
+ export declare const POLL_INTERVAL_MS = 500;
9
+ export declare const POLL_INTERVAL_SLOW_MS = 1000;
10
+ export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
11
+ export declare const DEFAULT_TIMEOUT_MS: number;
12
+ export declare const MAX_POLL_TIME_MS: number;
13
+ export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
14
+ export declare const STABLE_POLLS_THRESHOLD = 3;
@@ -0,0 +1,4 @@
1
+ export * from './constants';
2
+ export { loadAgentPrompt, loadPluginConfig } from './loader';
3
+ export * from './schema';
4
+ export { getAgentOverride } from './utils';
@@ -0,0 +1,31 @@
1
+ import { type PluginConfig } from './schema';
2
+ /**
3
+ * Load plugin configuration from user and project config files, merging them appropriately.
4
+ *
5
+ * Configuration is loaded from two locations:
6
+ * 1. User config: $OPENCODE_CONFIG_DIR/oh-my-opencode-slim.jsonc or .json,
7
+ * or ~/.config/opencode/oh-my-opencode-slim.jsonc or .json (or $XDG_CONFIG_HOME)
8
+ * 2. Project config: <directory>/.opencode/oh-my-opencode-slim.jsonc or .json
9
+ *
10
+ * JSONC format is preferred over JSON (allows comments and trailing commas).
11
+ * Project config takes precedence over user config. Nested objects (agents, tmux) are
12
+ * deep-merged, while top-level arrays are replaced entirely by project config.
13
+ *
14
+ * @param directory - Project directory to search for .opencode config
15
+ * @returns Merged plugin configuration (empty object if no configs found)
16
+ */
17
+ export declare function loadPluginConfig(directory: string): PluginConfig;
18
+ /**
19
+ * Load custom prompt for an agent from the prompts directory.
20
+ * Checks for {agent}.md (replaces default) and {agent}_append.md (appends to default).
21
+ * If preset is provided and safe for paths, it first checks {preset}/ subdirectory,
22
+ * then falls back to the root prompts directory.
23
+ *
24
+ * @param agentName - Name of the agent (e.g., "Ra", "Horus")
25
+ * @param preset - Optional preset name for preset-scoped prompt lookup
26
+ * @returns Object with prompt and/or appendPrompt if files exist
27
+ */
28
+ export declare function loadAgentPrompt(agentName: string, preset?: string): {
29
+ prompt?: string;
30
+ appendPrompt?: string;
31
+ };
@@ -0,0 +1,220 @@
1
+ import { z } from 'zod';
2
+ declare const FALLBACK_AGENT_NAMES: readonly ["Ra", "Oracle", "Bastet", "Horus", "Thoth", "Anubis"];
3
+ declare const MANUAL_AGENT_NAMES: readonly ["Ra", "Oracle", "Bastet", "Horus", "Thoth", "Anubis"];
4
+ export declare const ManualAgentPlanSchema: z.ZodObject<{
5
+ primary: z.ZodString;
6
+ fallback1: z.ZodString;
7
+ fallback2: z.ZodString;
8
+ fallback3: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export declare const ManualPlanSchema: z.ZodObject<{
11
+ Ra: z.ZodObject<{
12
+ primary: z.ZodString;
13
+ fallback1: z.ZodString;
14
+ fallback2: z.ZodString;
15
+ fallback3: z.ZodString;
16
+ }, z.core.$strip>;
17
+ Oracle: z.ZodObject<{
18
+ primary: z.ZodString;
19
+ fallback1: z.ZodString;
20
+ fallback2: z.ZodString;
21
+ fallback3: z.ZodString;
22
+ }, z.core.$strip>;
23
+ Bastet: z.ZodObject<{
24
+ primary: z.ZodString;
25
+ fallback1: z.ZodString;
26
+ fallback2: z.ZodString;
27
+ fallback3: z.ZodString;
28
+ }, z.core.$strip>;
29
+ Horus: z.ZodObject<{
30
+ primary: z.ZodString;
31
+ fallback1: z.ZodString;
32
+ fallback2: z.ZodString;
33
+ fallback3: z.ZodString;
34
+ }, z.core.$strip>;
35
+ Thoth: z.ZodObject<{
36
+ primary: z.ZodString;
37
+ fallback1: z.ZodString;
38
+ fallback2: z.ZodString;
39
+ fallback3: z.ZodString;
40
+ }, z.core.$strip>;
41
+ Anubis: z.ZodObject<{
42
+ primary: z.ZodString;
43
+ fallback1: z.ZodString;
44
+ fallback2: z.ZodString;
45
+ fallback3: z.ZodString;
46
+ }, z.core.$strip>;
47
+ }, z.core.$strict>;
48
+ export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
49
+ export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
50
+ export type ManualPlan = z.infer<typeof ManualPlanSchema>;
51
+ export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
52
+ export declare const AgentOverrideConfigSchema: z.ZodObject<{
53
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
54
+ id: z.ZodString;
55
+ variant: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>]>>]>>;
57
+ temperature: z.ZodOptional<z.ZodNumber>;
58
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
59
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
+ }, z.core.$strip>;
62
+ export declare const TmuxLayoutSchema: z.ZodEnum<{
63
+ "main-horizontal": "main-horizontal";
64
+ "main-vertical": "main-vertical";
65
+ tiled: "tiled";
66
+ "even-horizontal": "even-horizontal";
67
+ "even-vertical": "even-vertical";
68
+ }>;
69
+ export type TmuxLayout = z.infer<typeof TmuxLayoutSchema>;
70
+ export declare const TmuxConfigSchema: z.ZodObject<{
71
+ enabled: z.ZodDefault<z.ZodBoolean>;
72
+ layout: z.ZodDefault<z.ZodEnum<{
73
+ "main-horizontal": "main-horizontal";
74
+ "main-vertical": "main-vertical";
75
+ tiled: "tiled";
76
+ "even-horizontal": "even-horizontal";
77
+ "even-vertical": "even-vertical";
78
+ }>>;
79
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
80
+ }, z.core.$strip>;
81
+ export type TmuxConfig = z.infer<typeof TmuxConfigSchema>;
82
+ export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
83
+ /** Normalized model entry with optional per-model variant. */
84
+ export type ModelEntry = {
85
+ id: string;
86
+ variant?: string;
87
+ };
88
+ export declare const PresetSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
89
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
90
+ id: z.ZodString;
91
+ variant: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strip>]>>]>>;
93
+ temperature: z.ZodOptional<z.ZodNumber>;
94
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
95
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
97
+ }, z.core.$strip>>;
98
+ export type Preset = z.infer<typeof PresetSchema>;
99
+ export declare const McpNameSchema: z.ZodEnum<{
100
+ websearch: "websearch";
101
+ context7: "context7";
102
+ grep_app: "grep_app";
103
+ }>;
104
+ export type McpName = z.infer<typeof McpNameSchema>;
105
+ export declare const BackgroundTaskConfigSchema: z.ZodObject<{
106
+ maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
107
+ }, z.core.$strip>;
108
+ export type BackgroundTaskConfig = z.infer<typeof BackgroundTaskConfigSchema>;
109
+ export declare const FailoverConfigSchema: z.ZodObject<{
110
+ enabled: z.ZodDefault<z.ZodBoolean>;
111
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
112
+ retryDelayMs: z.ZodDefault<z.ZodNumber>;
113
+ chains: z.ZodDefault<z.ZodObject<{
114
+ Ra: z.ZodOptional<z.ZodArray<z.ZodString>>;
115
+ Oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
+ Bastet: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ Horus: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
+ Thoth: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
+ Anubis: z.ZodOptional<z.ZodArray<z.ZodString>>;
120
+ }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
121
+ }, z.core.$strip>;
122
+ export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
123
+ export declare const PluginConfigSchema: z.ZodObject<{
124
+ preset: z.ZodOptional<z.ZodString>;
125
+ setDefaultAgent: z.ZodOptional<z.ZodBoolean>;
126
+ scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
127
+ v1: "v1";
128
+ "v2-shadow": "v2-shadow";
129
+ v2: "v2";
130
+ }>>;
131
+ balanceProviderUsage: z.ZodOptional<z.ZodBoolean>;
132
+ manualPlan: z.ZodOptional<z.ZodObject<{
133
+ Ra: z.ZodObject<{
134
+ primary: z.ZodString;
135
+ fallback1: z.ZodString;
136
+ fallback2: z.ZodString;
137
+ fallback3: z.ZodString;
138
+ }, z.core.$strip>;
139
+ Oracle: z.ZodObject<{
140
+ primary: z.ZodString;
141
+ fallback1: z.ZodString;
142
+ fallback2: z.ZodString;
143
+ fallback3: z.ZodString;
144
+ }, z.core.$strip>;
145
+ Bastet: z.ZodObject<{
146
+ primary: z.ZodString;
147
+ fallback1: z.ZodString;
148
+ fallback2: z.ZodString;
149
+ fallback3: z.ZodString;
150
+ }, z.core.$strip>;
151
+ Horus: z.ZodObject<{
152
+ primary: z.ZodString;
153
+ fallback1: z.ZodString;
154
+ fallback2: z.ZodString;
155
+ fallback3: z.ZodString;
156
+ }, z.core.$strip>;
157
+ Thoth: z.ZodObject<{
158
+ primary: z.ZodString;
159
+ fallback1: z.ZodString;
160
+ fallback2: z.ZodString;
161
+ fallback3: z.ZodString;
162
+ }, z.core.$strip>;
163
+ Anubis: z.ZodObject<{
164
+ primary: z.ZodString;
165
+ fallback1: z.ZodString;
166
+ fallback2: z.ZodString;
167
+ fallback3: z.ZodString;
168
+ }, z.core.$strip>;
169
+ }, z.core.$strict>>;
170
+ presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
171
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
172
+ id: z.ZodString;
173
+ variant: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>]>>]>>;
175
+ temperature: z.ZodOptional<z.ZodNumber>;
176
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
177
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
178
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ }, z.core.$strip>>>>;
180
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
181
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
182
+ id: z.ZodString;
183
+ variant: z.ZodOptional<z.ZodString>;
184
+ }, z.core.$strip>]>>]>>;
185
+ temperature: z.ZodOptional<z.ZodNumber>;
186
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
187
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
188
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
189
+ }, z.core.$strip>>>;
190
+ disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
+ tmux: z.ZodOptional<z.ZodObject<{
192
+ enabled: z.ZodDefault<z.ZodBoolean>;
193
+ layout: z.ZodDefault<z.ZodEnum<{
194
+ "main-horizontal": "main-horizontal";
195
+ "main-vertical": "main-vertical";
196
+ tiled: "tiled";
197
+ "even-horizontal": "even-horizontal";
198
+ "even-vertical": "even-vertical";
199
+ }>>;
200
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
201
+ }, z.core.$strip>>;
202
+ background: z.ZodOptional<z.ZodObject<{
203
+ maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
204
+ }, z.core.$strip>>;
205
+ fallback: z.ZodOptional<z.ZodObject<{
206
+ enabled: z.ZodDefault<z.ZodBoolean>;
207
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
208
+ retryDelayMs: z.ZodDefault<z.ZodNumber>;
209
+ chains: z.ZodDefault<z.ZodObject<{
210
+ Ra: z.ZodOptional<z.ZodArray<z.ZodString>>;
211
+ Oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ Bastet: z.ZodOptional<z.ZodArray<z.ZodString>>;
213
+ Horus: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
+ Thoth: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
+ Anubis: z.ZodOptional<z.ZodArray<z.ZodString>>;
216
+ }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
217
+ }, z.core.$strip>>;
218
+ }, z.core.$strip>;
219
+ export type PluginConfig = z.infer<typeof PluginConfigSchema>;
220
+ export type { AgentName } from './constants';
@@ -0,0 +1,10 @@
1
+ import type { AgentOverrideConfig, PluginConfig } from './schema';
2
+ /**
3
+ * Get agent override config by name, supporting backward-compatible aliases.
4
+ * Checks both the current name and any legacy alias names.
5
+ *
6
+ * @param config - The plugin configuration
7
+ * @param name - The current agent name
8
+ * @returns The agent-specific override configuration if found
9
+ */
10
+ export declare function getAgentOverride(config: PluginConfig | undefined, name: string): AgentOverrideConfig | undefined;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Invalidates the current package by removing its directory and dependency entries.
3
+ * This forces a clean state before running a fresh install.
4
+ * @param packageName The name of the package to invalidate.
5
+ */
6
+ export declare function invalidatePackage(packageName?: string): boolean;
@@ -0,0 +1,28 @@
1
+ import type { PluginEntryInfo } from './types';
2
+ /**
3
+ * Extracts the update channel (latest, alpha, beta, etc.) from a version string.
4
+ * @param version The version or tag to analyze.
5
+ * @returns The channel name.
6
+ */
7
+ export declare function extractChannel(version: string | null): string;
8
+ /**
9
+ * Resolves the version of the plugin when running in local development mode.
10
+ */
11
+ export declare function getLocalDevVersion(directory: string): string | null;
12
+ /**
13
+ * Searches across all config locations to find the current installation entry for this plugin.
14
+ */
15
+ export declare function findPluginEntry(directory: string): PluginEntryInfo | null;
16
+ /**
17
+ * Resolves the installed version from node_modules, with memoization.
18
+ */
19
+ export declare function getCachedVersion(): string | null;
20
+ /**
21
+ * Safely updates a pinned version in the configuration file.
22
+ * It attempts to replace the exact plugin string to preserve comments and formatting.
23
+ */
24
+ export declare function updatePinnedVersion(configPath: string, oldEntry: string, newVersion: string): boolean;
25
+ /**
26
+ * Fetches the latest version for a specific channel from the NPM registry.
27
+ */
28
+ export declare function getLatestVersion(channel?: string): Promise<string | null>;
@@ -0,0 +1,11 @@
1
+ export declare const PACKAGE_NAME = "oh-my-opencode-slim";
2
+ export declare const NPM_REGISTRY_URL = "https://registry.npmjs.org/-/package/oh-my-opencode-slim/dist-tags";
3
+ export declare const NPM_FETCH_TIMEOUT = 5000;
4
+ /** The directory used by OpenCode to cache node_modules for plugins. */
5
+ export declare const CACHE_DIR: string;
6
+ /** Path to this plugin's package.json within the OpenCode cache. */
7
+ export declare const INSTALLED_PACKAGE_JSON: string;
8
+ /** Primary OpenCode configuration file path (standard JSON). */
9
+ export declare const USER_OPENCODE_CONFIG: string;
10
+ /** Alternative OpenCode configuration file path (JSON with Comments). */
11
+ export declare const USER_OPENCODE_CONFIG_JSONC: string;
@@ -0,0 +1,17 @@
1
+ import type { PluginInput } from '@opencode-ai/plugin';
2
+ import type { AutoUpdateCheckerOptions } from './types';
3
+ /**
4
+ * Creates an OpenCode hook that checks for plugin updates when a new session is created.
5
+ * @param ctx The plugin input context.
6
+ * @param options Configuration options for the update checker.
7
+ * @returns A hook object for the session.created event.
8
+ */
9
+ export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?: AutoUpdateCheckerOptions): {
10
+ event: ({ event }: {
11
+ event: {
12
+ type: string;
13
+ properties?: unknown;
14
+ };
15
+ }) => void;
16
+ };
17
+ export type { AutoUpdateCheckerOptions } from './types';
@@ -0,0 +1,23 @@
1
+ export interface NpmDistTags {
2
+ latest: string;
3
+ [key: string]: string;
4
+ }
5
+ export interface OpencodeConfig {
6
+ plugin?: string[];
7
+ [key: string]: unknown;
8
+ }
9
+ export interface PackageJson {
10
+ version: string;
11
+ name?: string;
12
+ [key: string]: unknown;
13
+ }
14
+ export interface AutoUpdateCheckerOptions {
15
+ showStartupToast?: boolean;
16
+ autoUpdate?: boolean;
17
+ }
18
+ export interface PluginEntryInfo {
19
+ entry: string;
20
+ isPinned: boolean;
21
+ pinnedVersion: string | null;
22
+ configPath: string;
23
+ }
@@ -0,0 +1,16 @@
1
+ import type { PluginInput, ProviderContext } from '@opencode-ai/plugin';
2
+ import type { Model, UserMessage } from '@opencode-ai/sdk';
3
+ interface ChatHeadersInput {
4
+ sessionID: string;
5
+ model: Model;
6
+ provider: ProviderContext;
7
+ message: UserMessage;
8
+ }
9
+ interface ChatHeadersOutput {
10
+ headers: Record<string, string>;
11
+ }
12
+ export declare function __resetInternalMarkerCacheForTesting(): void;
13
+ export declare function createChatHeadersHook(ctx: PluginInput): {
14
+ 'chat.headers': (input: ChatHeadersInput, output: ChatHeadersOutput) => Promise<void>;
15
+ };
16
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type DetectedError } from './patterns';
2
+ export declare function buildRetryGuidance(errorInfo: DetectedError): string;
@@ -0,0 +1,8 @@
1
+ import type { PluginInput } from '@opencode-ai/plugin';
2
+ export declare function createDelegateTaskRetryHook(_ctx: PluginInput): {
3
+ 'tool.execute.after': (input: {
4
+ tool: string;
5
+ }, output: {
6
+ output: unknown;
7
+ }) => Promise<void>;
8
+ };
@@ -0,0 +1,4 @@
1
+ export { buildRetryGuidance } from './guidance';
2
+ export { createDelegateTaskRetryHook } from './hook';
3
+ export type { DelegateTaskErrorPattern, DetectedError } from './patterns';
4
+ export { DELEGATE_TASK_ERROR_PATTERNS, detectDelegateTaskError, } from './patterns';