myai-opencode 0.6.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 +244 -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 +7 -0
- package/dist/background/background-manager.d.ts +131 -0
- package/dist/background/index.d.ts +2 -0
- package/dist/background/tmux-session-manager.d.ts +58 -0
- package/dist/cli/config-io.d.ts +21 -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 +14342 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/paths.d.ts +7 -0
- package/dist/cli/providers.d.ts +79 -0
- package/dist/cli/skills.d.ts +35 -0
- package/dist/cli/system.d.ts +4 -0
- package/dist/cli/types.d.ts +34 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +12 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +26 -0
- package/dist/config/schema.d.ts +81 -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/index.d.ts +4 -0
- package/dist/hooks/phase-reminder/index.d.ts +25 -0
- package/dist/hooks/post-read-nudge/index.d.ts +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +33076 -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/grep/cli.d.ts +3 -0
- package/dist/tools/grep/constants.d.ts +18 -0
- package/dist/tools/grep/downloader.d.ts +3 -0
- package/dist/tools/grep/index.d.ts +5 -0
- package/dist/tools/grep/tools.d.ts +2 -0
- package/dist/tools/grep/types.d.ts +35 -0
- package/dist/tools/grep/utils.d.ts +2 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/lsp/client.d.ts +42 -0
- package/dist/tools/lsp/config.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +8 -0
- package/dist/tools/lsp/index.d.ts +3 -0
- package/dist/tools/lsp/tools.d.ts +5 -0
- package/dist/tools/lsp/types.d.ts +28 -0
- package/dist/tools/lsp/utils.d.ts +21 -0
- package/dist/utils/agent-variant.d.ts +47 -0
- package/dist/utils/index.d.ts +5 -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/package.json +68 -0
- package/src/skills/cartography/README.md +57 -0
- package/src/skills/cartography/SKILL.md +137 -0
- package/src/skills/cartography/scripts/cartographer.py +456 -0
- package/src/skills/cartography/scripts/test_cartographer.py +87 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getConfigDir(): string;
|
|
2
|
+
export declare function getOpenCodeConfigPaths(): string[];
|
|
3
|
+
export declare function getConfigJson(): string;
|
|
4
|
+
export declare function getConfigJsonc(): string;
|
|
5
|
+
export declare function getLiteConfig(): string;
|
|
6
|
+
export declare function getExistingConfigPath(): string;
|
|
7
|
+
export declare function ensureConfigDir(): void;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { InstallConfig } from './types';
|
|
2
|
+
export declare const MODEL_MAPPINGS: {
|
|
3
|
+
readonly kimi: {
|
|
4
|
+
readonly orchestrator: {
|
|
5
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
6
|
+
};
|
|
7
|
+
readonly oracle: {
|
|
8
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
9
|
+
readonly variant: "high";
|
|
10
|
+
};
|
|
11
|
+
readonly librarian: {
|
|
12
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
13
|
+
readonly variant: "low";
|
|
14
|
+
};
|
|
15
|
+
readonly explorer: {
|
|
16
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
17
|
+
readonly variant: "low";
|
|
18
|
+
};
|
|
19
|
+
readonly designer: {
|
|
20
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
21
|
+
readonly variant: "medium";
|
|
22
|
+
};
|
|
23
|
+
readonly fixer: {
|
|
24
|
+
readonly model: "kimi-for-coding/k2p5";
|
|
25
|
+
readonly variant: "low";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly openai: {
|
|
29
|
+
readonly orchestrator: {
|
|
30
|
+
readonly model: "openai/gpt-5.2-codex";
|
|
31
|
+
};
|
|
32
|
+
readonly oracle: {
|
|
33
|
+
readonly model: "openai/gpt-5.2-codex";
|
|
34
|
+
readonly variant: "high";
|
|
35
|
+
};
|
|
36
|
+
readonly librarian: {
|
|
37
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
38
|
+
readonly variant: "low";
|
|
39
|
+
};
|
|
40
|
+
readonly explorer: {
|
|
41
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
42
|
+
readonly variant: "low";
|
|
43
|
+
};
|
|
44
|
+
readonly designer: {
|
|
45
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
46
|
+
readonly variant: "medium";
|
|
47
|
+
};
|
|
48
|
+
readonly fixer: {
|
|
49
|
+
readonly model: "openai/gpt-5.1-codex-mini";
|
|
50
|
+
readonly variant: "low";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly 'zen-free': {
|
|
54
|
+
readonly orchestrator: {
|
|
55
|
+
readonly model: "opencode/big-pickle";
|
|
56
|
+
};
|
|
57
|
+
readonly oracle: {
|
|
58
|
+
readonly model: "opencode/big-pickle";
|
|
59
|
+
readonly variant: "high";
|
|
60
|
+
};
|
|
61
|
+
readonly librarian: {
|
|
62
|
+
readonly model: "opencode/big-pickle";
|
|
63
|
+
readonly variant: "low";
|
|
64
|
+
};
|
|
65
|
+
readonly explorer: {
|
|
66
|
+
readonly model: "opencode/big-pickle";
|
|
67
|
+
readonly variant: "low";
|
|
68
|
+
};
|
|
69
|
+
readonly designer: {
|
|
70
|
+
readonly model: "opencode/big-pickle";
|
|
71
|
+
readonly variant: "medium";
|
|
72
|
+
};
|
|
73
|
+
readonly fixer: {
|
|
74
|
+
readonly model: "opencode/big-pickle";
|
|
75
|
+
readonly variant: "low";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export declare function generateLiteConfig(installConfig: InstallConfig): Record<string, unknown>;
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
* List of recommended skills.
|
|
20
|
+
* Add new skills here to include them in the installation flow.
|
|
21
|
+
*/
|
|
22
|
+
export declare const RECOMMENDED_SKILLS: RecommendedSkill[];
|
|
23
|
+
/**
|
|
24
|
+
* Install a skill using `npx skills add`.
|
|
25
|
+
* @param skill - The skill to install
|
|
26
|
+
* @returns True if installation succeeded, false otherwise
|
|
27
|
+
*/
|
|
28
|
+
export declare function installSkill(skill: RecommendedSkill): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Get permission presets for a specific agent based on recommended skills.
|
|
31
|
+
* @param agentName - The name of the agent
|
|
32
|
+
* @param skillList - Optional explicit list of skills to allow (overrides recommendations)
|
|
33
|
+
* @returns Permission rules for the skill permission type
|
|
34
|
+
*/
|
|
35
|
+
export declare function getSkillPermissionsForAgent(agentName: string, skillList?: string[]): Record<string, 'allow' | 'ask' | 'deny'>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function isOpenCodeInstalled(): Promise<boolean>;
|
|
2
|
+
export declare function isTmuxInstalled(): Promise<boolean>;
|
|
3
|
+
export declare function getOpenCodeVersion(): Promise<string | null>;
|
|
4
|
+
export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type BooleanArg = 'yes' | 'no';
|
|
2
|
+
export interface InstallArgs {
|
|
3
|
+
tui: boolean;
|
|
4
|
+
kimi?: BooleanArg;
|
|
5
|
+
openai?: BooleanArg;
|
|
6
|
+
tmux?: BooleanArg;
|
|
7
|
+
skills?: BooleanArg;
|
|
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
|
+
hasKimi: boolean;
|
|
17
|
+
hasOpenAI: boolean;
|
|
18
|
+
hasOpencodeZen: boolean;
|
|
19
|
+
hasTmux: boolean;
|
|
20
|
+
installSkills: boolean;
|
|
21
|
+
installCustomSkills: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ConfigMergeResult {
|
|
24
|
+
success: boolean;
|
|
25
|
+
configPath: string;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DetectedConfig {
|
|
29
|
+
isInstalled: boolean;
|
|
30
|
+
hasKimi: boolean;
|
|
31
|
+
hasOpenAI: boolean;
|
|
32
|
+
hasOpencodeZen: boolean;
|
|
33
|
+
hasTmux: boolean;
|
|
34
|
+
}
|
|
@@ -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,12 @@
|
|
|
1
|
+
export declare const AGENT_ALIASES: Record<string, string>;
|
|
2
|
+
export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "fixer"];
|
|
3
|
+
export declare const ORCHESTRATOR_NAME: "orchestrator";
|
|
4
|
+
export declare const ALL_AGENT_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "fixer"];
|
|
5
|
+
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|
|
6
|
+
export declare const DEFAULT_MODELS: Record<AgentName, string>;
|
|
7
|
+
export declare const POLL_INTERVAL_MS = 500;
|
|
8
|
+
export declare const POLL_INTERVAL_SLOW_MS = 1000;
|
|
9
|
+
export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
|
|
10
|
+
export declare const DEFAULT_TIMEOUT_MS: number;
|
|
11
|
+
export declare const MAX_POLL_TIME_MS: number;
|
|
12
|
+
export declare const STABLE_POLLS_THRESHOLD = 3;
|
|
@@ -0,0 +1,26 @@
|
|
|
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: ~/.config/opencode/oh-my-opencode-slim.json (or $XDG_CONFIG_HOME)
|
|
7
|
+
* 2. Project config: <directory>/.opencode/oh-my-opencode-slim.json
|
|
8
|
+
*
|
|
9
|
+
* Project config takes precedence over user config. Nested objects (agents, tmux) are
|
|
10
|
+
* deep-merged, while top-level arrays are replaced entirely by project config.
|
|
11
|
+
*
|
|
12
|
+
* @param directory - Project directory to search for .opencode config
|
|
13
|
+
* @returns Merged plugin configuration (empty object if no configs found)
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadPluginConfig(directory: string): PluginConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Load custom prompt for an agent from the prompts directory.
|
|
18
|
+
* Checks for {agent}.md (replaces default) and {agent}_append.md (appends to default).
|
|
19
|
+
*
|
|
20
|
+
* @param agentName - Name of the agent (e.g., "orchestrator", "explorer")
|
|
21
|
+
* @returns Object with prompt and/or appendPrompt if files exist
|
|
22
|
+
*/
|
|
23
|
+
export declare function loadAgentPrompt(agentName: string): {
|
|
24
|
+
prompt?: string;
|
|
25
|
+
appendPrompt?: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
3
|
+
model: z.ZodOptional<z.ZodString>;
|
|
4
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
6
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7
|
+
mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const TmuxLayoutSchema: z.ZodEnum<{
|
|
10
|
+
"main-horizontal": "main-horizontal";
|
|
11
|
+
"main-vertical": "main-vertical";
|
|
12
|
+
tiled: "tiled";
|
|
13
|
+
"even-horizontal": "even-horizontal";
|
|
14
|
+
"even-vertical": "even-vertical";
|
|
15
|
+
}>;
|
|
16
|
+
export type TmuxLayout = z.infer<typeof TmuxLayoutSchema>;
|
|
17
|
+
export declare const TmuxConfigSchema: z.ZodObject<{
|
|
18
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
20
|
+
"main-horizontal": "main-horizontal";
|
|
21
|
+
"main-vertical": "main-vertical";
|
|
22
|
+
tiled: "tiled";
|
|
23
|
+
"even-horizontal": "even-horizontal";
|
|
24
|
+
"even-vertical": "even-vertical";
|
|
25
|
+
}>>;
|
|
26
|
+
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type TmuxConfig = z.infer<typeof TmuxConfigSchema>;
|
|
29
|
+
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
|
|
30
|
+
export declare const PresetSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
31
|
+
model: z.ZodOptional<z.ZodString>;
|
|
32
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
34
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
export type Preset = z.infer<typeof PresetSchema>;
|
|
38
|
+
export declare const McpNameSchema: z.ZodEnum<{
|
|
39
|
+
websearch: "websearch";
|
|
40
|
+
context7: "context7";
|
|
41
|
+
grep_app: "grep_app";
|
|
42
|
+
}>;
|
|
43
|
+
export type McpName = z.infer<typeof McpNameSchema>;
|
|
44
|
+
export declare const BackgroundTaskConfigSchema: z.ZodObject<{
|
|
45
|
+
maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type BackgroundTaskConfig = z.infer<typeof BackgroundTaskConfigSchema>;
|
|
48
|
+
export declare const PluginConfigSchema: z.ZodObject<{
|
|
49
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
50
|
+
presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
51
|
+
model: z.ZodOptional<z.ZodString>;
|
|
52
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
54
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
|
+
mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
}, z.core.$strip>>>>;
|
|
57
|
+
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
58
|
+
model: z.ZodOptional<z.ZodString>;
|
|
59
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
61
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
64
|
+
disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
tmux: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
68
|
+
"main-horizontal": "main-horizontal";
|
|
69
|
+
"main-vertical": "main-vertical";
|
|
70
|
+
tiled: "tiled";
|
|
71
|
+
"even-horizontal": "even-horizontal";
|
|
72
|
+
"even-vertical": "even-vertical";
|
|
73
|
+
}>>;
|
|
74
|
+
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
background: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
81
|
+
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,25 @@
|
|
|
1
|
+
interface MessageInfo {
|
|
2
|
+
role: string;
|
|
3
|
+
agent?: string;
|
|
4
|
+
sessionID?: string;
|
|
5
|
+
}
|
|
6
|
+
interface MessagePart {
|
|
7
|
+
type: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
interface MessageWithParts {
|
|
12
|
+
info: MessageInfo;
|
|
13
|
+
parts: MessagePart[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates the experimental.chat.messages.transform hook for phase reminder injection.
|
|
17
|
+
* This hook runs right before sending to API, so it doesn't affect UI display.
|
|
18
|
+
* Only injects for the orchestrator agent.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createPhaseReminderHook(): {
|
|
21
|
+
'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
|
|
22
|
+
messages: MessageWithParts[];
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
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';
|