oh-my-opencode-serverlocal 0.1.0

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 (177) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja-JP.md +775 -0
  3. package/README.ko-KR.md +796 -0
  4. package/README.md +792 -0
  5. package/README.zh-CN.md +765 -0
  6. package/dist/agents/council.d.ts +27 -0
  7. package/dist/agents/councillor.d.ts +2 -0
  8. package/dist/agents/designer.d.ts +2 -0
  9. package/dist/agents/explorer.d.ts +2 -0
  10. package/dist/agents/fixer.d.ts +2 -0
  11. package/dist/agents/index.d.ts +31 -0
  12. package/dist/agents/librarian.d.ts +2 -0
  13. package/dist/agents/observer.d.ts +2 -0
  14. package/dist/agents/oracle.d.ts +2 -0
  15. package/dist/agents/orchestrator.d.ts +28 -0
  16. package/dist/agents/permissions.d.ts +10 -0
  17. package/dist/cli/background-subagents.d.ts +13 -0
  18. package/dist/cli/companion.d.ts +4 -0
  19. package/dist/cli/config-io.d.ts +25 -0
  20. package/dist/cli/config-manager.d.ts +4 -0
  21. package/dist/cli/custom-skills-registry.d.ts +18 -0
  22. package/dist/cli/custom-skills.d.ts +13 -0
  23. package/dist/cli/doctor.d.ts +38 -0
  24. package/dist/cli/index.d.ts +3 -0
  25. package/dist/cli/index.js +3565 -0
  26. package/dist/cli/install.d.ts +7 -0
  27. package/dist/cli/model-key-normalization.d.ts +1 -0
  28. package/dist/cli/paths.d.ts +35 -0
  29. package/dist/cli/providers.d.ts +145 -0
  30. package/dist/cli/skills.d.ts +24 -0
  31. package/dist/cli/system.d.ts +6 -0
  32. package/dist/cli/types.d.ts +47 -0
  33. package/dist/companion/manager.d.ts +50 -0
  34. package/dist/companion/updater.d.ts +36 -0
  35. package/dist/config/agent-mcps.d.ts +11 -0
  36. package/dist/config/constants.d.ts +38 -0
  37. package/dist/config/council-schema.d.ts +137 -0
  38. package/dist/config/index.d.ts +5 -0
  39. package/dist/config/loader.d.ts +88 -0
  40. package/dist/config/runtime-preset.d.ts +11 -0
  41. package/dist/config/schema.d.ts +1107 -0
  42. package/dist/config/strip-orchestrator-model.d.ts +9 -0
  43. package/dist/config/utils.d.ts +18 -0
  44. package/dist/council/council-manager.d.ts +53 -0
  45. package/dist/council/index.d.ts +1 -0
  46. package/dist/hooks/apply-patch/codec.d.ts +7 -0
  47. package/dist/hooks/apply-patch/errors.d.ts +25 -0
  48. package/dist/hooks/apply-patch/execution-context.d.ts +27 -0
  49. package/dist/hooks/apply-patch/index.d.ts +15 -0
  50. package/dist/hooks/apply-patch/matching.d.ts +26 -0
  51. package/dist/hooks/apply-patch/operations.d.ts +3 -0
  52. package/dist/hooks/apply-patch/prepared-changes.d.ts +17 -0
  53. package/dist/hooks/apply-patch/resolution.d.ts +19 -0
  54. package/dist/hooks/apply-patch/rewrite.d.ts +7 -0
  55. package/dist/hooks/apply-patch/test-helpers.d.ts +6 -0
  56. package/dist/hooks/apply-patch/types.d.ts +80 -0
  57. package/dist/hooks/auto-update-checker/cache.d.ts +11 -0
  58. package/dist/hooks/auto-update-checker/checker.d.ts +38 -0
  59. package/dist/hooks/auto-update-checker/constants.d.ts +12 -0
  60. package/dist/hooks/auto-update-checker/index.d.ts +18 -0
  61. package/dist/hooks/auto-update-checker/skill-sync.d.ts +67 -0
  62. package/dist/hooks/auto-update-checker/types.d.ts +34 -0
  63. package/dist/hooks/chat-headers.d.ts +16 -0
  64. package/dist/hooks/command-hook-utils.d.ts +5 -0
  65. package/dist/hooks/deepwork/index.d.ts +13 -0
  66. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
  67. package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
  68. package/dist/hooks/filter-available-skills/index.d.ts +19 -0
  69. package/dist/hooks/foreground-fallback/index.d.ts +122 -0
  70. package/dist/hooks/image-hook.d.ts +8 -0
  71. package/dist/hooks/index.d.ts +16 -0
  72. package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
  73. package/dist/hooks/loop-command/index.d.ts +13 -0
  74. package/dist/hooks/phase-reminder/index.d.ts +25 -0
  75. package/dist/hooks/post-file-tool-nudge/index.d.ts +23 -0
  76. package/dist/hooks/reflect/index.d.ts +13 -0
  77. package/dist/hooks/session-lifecycle.d.ts +10 -0
  78. package/dist/hooks/task-session-manager/index.d.ts +58 -0
  79. package/dist/hooks/task-session-manager/pending-call-tracker.d.ts +13 -0
  80. package/dist/hooks/task-session-manager/task-context-tracker.d.ts +14 -0
  81. package/dist/hooks/types.d.ts +26 -0
  82. package/dist/index.d.ts +5 -0
  83. package/dist/index.js +39519 -0
  84. package/dist/interview/dashboard-manager.d.ts +21 -0
  85. package/dist/interview/dashboard.d.ts +67 -0
  86. package/dist/interview/document.d.ts +29 -0
  87. package/dist/interview/helpers.d.ts +10 -0
  88. package/dist/interview/index.d.ts +1 -0
  89. package/dist/interview/manager.d.ts +21 -0
  90. package/dist/interview/parser.d.ts +11 -0
  91. package/dist/interview/prompts.d.ts +7 -0
  92. package/dist/interview/server.d.ts +15 -0
  93. package/dist/interview/service.d.ts +45 -0
  94. package/dist/interview/session-server.d.ts +21 -0
  95. package/dist/interview/types.d.ts +111 -0
  96. package/dist/interview/ui.d.ts +11 -0
  97. package/dist/loop/loop-session.d.ts +64 -0
  98. package/dist/mcp/context7.d.ts +6 -0
  99. package/dist/mcp/grep-app.d.ts +6 -0
  100. package/dist/mcp/index.d.ts +8 -0
  101. package/dist/mcp/types.d.ts +12 -0
  102. package/dist/mcp/websearch.d.ts +9 -0
  103. package/dist/multiplexer/cmux/close-policy.d.ts +20 -0
  104. package/dist/multiplexer/cmux/index.d.ts +102 -0
  105. package/dist/multiplexer/cmux/session-lifecycle.d.ts +92 -0
  106. package/dist/multiplexer/cmux/session-state.d.ts +45 -0
  107. package/dist/multiplexer/factory.d.ts +17 -0
  108. package/dist/multiplexer/herdr/index.d.ts +35 -0
  109. package/dist/multiplexer/index.d.ts +12 -0
  110. package/dist/multiplexer/session-manager.d.ts +69 -0
  111. package/dist/multiplexer/shared.d.ts +31 -0
  112. package/dist/multiplexer/tmux/index.d.ts +26 -0
  113. package/dist/multiplexer/types.d.ts +57 -0
  114. package/dist/multiplexer/zellij/index.d.ts +47 -0
  115. package/dist/tools/acp-run.d.ts +3 -0
  116. package/dist/tools/ast-grep/cli.d.ts +15 -0
  117. package/dist/tools/ast-grep/constants.d.ts +25 -0
  118. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  119. package/dist/tools/ast-grep/index.d.ts +10 -0
  120. package/dist/tools/ast-grep/tools.d.ts +3 -0
  121. package/dist/tools/ast-grep/types.d.ts +30 -0
  122. package/dist/tools/ast-grep/utils.d.ts +4 -0
  123. package/dist/tools/cancel-task.d.ts +16 -0
  124. package/dist/tools/council.d.ts +10 -0
  125. package/dist/tools/index.d.ts +7 -0
  126. package/dist/tools/preset-manager.d.ts +26 -0
  127. package/dist/tools/smartfetch/binary.d.ts +3 -0
  128. package/dist/tools/smartfetch/cache.d.ts +6 -0
  129. package/dist/tools/smartfetch/constants.d.ts +12 -0
  130. package/dist/tools/smartfetch/index.d.ts +3 -0
  131. package/dist/tools/smartfetch/network.d.ts +38 -0
  132. package/dist/tools/smartfetch/secondary-model.d.ts +35 -0
  133. package/dist/tools/smartfetch/tool.d.ts +3 -0
  134. package/dist/tools/smartfetch/types.d.ts +122 -0
  135. package/dist/tools/smartfetch/utils.d.ts +20 -0
  136. package/dist/tui-state.d.ts +18 -0
  137. package/dist/tui.d.ts +13 -0
  138. package/dist/tui.js +1112 -0
  139. package/dist/utils/agent-variant.d.ts +23 -0
  140. package/dist/utils/background-job-board.d.ts +113 -0
  141. package/dist/utils/background-job-coordinator.d.ts +72 -0
  142. package/dist/utils/background-job-store.d.ts +46 -0
  143. package/dist/utils/compat.d.ts +29 -0
  144. package/dist/utils/councillor-models.d.ts +20 -0
  145. package/dist/utils/env.d.ts +3 -0
  146. package/dist/utils/escape-html.d.ts +1 -0
  147. package/dist/utils/frontmatter.d.ts +6 -0
  148. package/dist/utils/guards.d.ts +4 -0
  149. package/dist/utils/index.d.ts +10 -0
  150. package/dist/utils/internal-initiator.d.ts +11 -0
  151. package/dist/utils/logger.d.ts +6 -0
  152. package/dist/utils/polling.d.ts +21 -0
  153. package/dist/utils/session.d.ts +75 -0
  154. package/dist/utils/subagent-depth.d.ts +35 -0
  155. package/dist/utils/system-collapse.d.ts +6 -0
  156. package/dist/utils/task.d.ts +20 -0
  157. package/dist/utils/zip-extractor.d.ts +1 -0
  158. package/package.json +108 -0
  159. package/src/companion/companion-manifest.json +12 -0
  160. package/src/skills/clonedeps/README.md +23 -0
  161. package/src/skills/clonedeps/SKILL.md +240 -0
  162. package/src/skills/clonedeps/codemap.md +32 -0
  163. package/src/skills/codemap/README.md +59 -0
  164. package/src/skills/codemap/SKILL.md +163 -0
  165. package/src/skills/codemap/codemap.md +36 -0
  166. package/src/skills/codemap/scripts/codemap.mjs +483 -0
  167. package/src/skills/codemap/scripts/codemap.test.ts +129 -0
  168. package/src/skills/codemap.md +78 -0
  169. package/src/skills/deepwork/SKILL.md +122 -0
  170. package/src/skills/loop-engineering/SKILL.md +30 -0
  171. package/src/skills/oh-my-opencode-slim/SKILL.md +326 -0
  172. package/src/skills/reflect/SKILL.md +326 -0
  173. package/src/skills/simplify/README.md +19 -0
  174. package/src/skills/simplify/SKILL.md +138 -0
  175. package/src/skills/simplify/codemap.md +36 -0
  176. package/src/skills/verification-planning/SKILL.md +102 -0
  177. package/src/skills/worktrees/SKILL.md +171 -0
@@ -0,0 +1,27 @@
1
+ import { type AgentDefinition } from './orchestrator';
2
+ export declare function createCouncilAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
3
+ /**
4
+ * Build the prompt for a specific councillor session.
5
+ *
6
+ * Returns the raw user prompt - the agent factory (councillor.ts) provides
7
+ * the system prompt with tool-aware instructions. No duplication.
8
+ *
9
+ * If a per-councillor prompt override is provided, it is prepended as
10
+ * role/guidance context before the user's question.
11
+ */
12
+ export declare function formatCouncillorPrompt(userPrompt: string, councillorPrompt?: string): string;
13
+ /**
14
+ * Format councillor results for the council agent to synthesize.
15
+ *
16
+ * Formats councillor results as structured data that the council agent
17
+ * (which called the tool) will receive as the tool response. The council
18
+ * agent's system prompt contains synthesis instructions.
19
+ * Returns a special message when all councillors failed to produce output.
20
+ */
21
+ export declare function formatCouncillorResults(originalPrompt: string, councillorResults: Array<{
22
+ name: string;
23
+ model: string;
24
+ status: string;
25
+ result?: string;
26
+ error?: string;
27
+ }>): string;
@@ -0,0 +1,2 @@
1
+ import { type AgentDefinition } from './orchestrator';
2
+ export declare function createCouncillorAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createDesignerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createExplorerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createFixerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,31 @@
1
+ import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk/v2';
2
+ import { type PluginConfig, SUBAGENT_NAMES } from '../config';
3
+ import { type AgentDefinition } from './orchestrator';
4
+ export type { AgentDefinition } from './orchestrator';
5
+ export type SubagentName = (typeof SUBAGENT_NAMES)[number];
6
+ export declare function isSubagent(name: string): name is SubagentName;
7
+ /**
8
+ * Create all agent definitions with optional configuration overrides.
9
+ * Instantiates the orchestrator and all subagents, applying user config and defaults.
10
+ *
11
+ * @param config - Optional plugin configuration with agent overrides
12
+ * @returns Array of agent definitions (orchestrator first, then subagents)
13
+ */
14
+ export declare function createAgents(config?: PluginConfig, options?: {
15
+ projectDirectory?: string;
16
+ }): AgentDefinition[];
17
+ /**
18
+ * Get agent configurations formatted for the OpenCode SDK.
19
+ * Converts agent definitions to SDK config format and applies classification metadata.
20
+ *
21
+ * @param config - Optional plugin configuration with agent overrides
22
+ * @param options - Optional options including projectDirectory
23
+ * @returns Record mapping agent names to their SDK configurations
24
+ */
25
+ export declare function getAgentConfigs(config?: PluginConfig, options?: {
26
+ projectDirectory?: string;
27
+ }): Record<string, SDKAgentConfig>;
28
+ /**
29
+ * Get the set of disabled agent names from config, applying protection rules.
30
+ */
31
+ export declare function getDisabledAgents(config?: PluginConfig): Set<string>;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createLibrarianAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createObserverAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createOracleAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,28 @@
1
+ import type { AgentConfig } from '@opencode-ai/sdk/v2';
2
+ export interface AgentDefinition {
3
+ name: string;
4
+ displayName?: string;
5
+ description?: string;
6
+ config: AgentConfig;
7
+ /** Priority-ordered model entries for runtime fallback resolution. */
8
+ _modelArray?: Array<{
9
+ id: string;
10
+ variant?: string;
11
+ }>;
12
+ }
13
+ /**
14
+ * Resolve agent prompt from base/custom/append inputs.
15
+ * If customPrompt is provided, it replaces the base entirely.
16
+ * If customAppendPrompt is provided, it appends after whichever base won.
17
+ */
18
+ export declare function resolvePrompt(base: string, customPrompt?: string, customAppendPrompt?: string): string;
19
+ /**
20
+ * Build the orchestrator prompt with dynamic agent filtering.
21
+ * @param disabledAgents - Set of disabled agent names to exclude from the prompt
22
+ * @returns The complete orchestrator prompt string
23
+ */
24
+ export declare function buildOrchestratorPrompt(disabledAgents?: Set<string>): string;
25
+ export declare function createOrchestratorAgent(model?: string | Array<string | {
26
+ id: string;
27
+ variant?: string;
28
+ }>, customPrompt?: string, customAppendPrompt?: string, disabledAgents?: Set<string>): AgentDefinition;
@@ -0,0 +1,10 @@
1
+ type AgentPermission = Record<string, 'allow' | 'ask' | 'deny' | Record<string, 'allow' | 'ask' | 'deny'>>;
2
+ /**
3
+ * Strict read-only tool permissions for advisory agents.
4
+ *
5
+ * Start with wildcard deny so newly-added tools are unavailable by default,
6
+ * then allow only inspection/search tools. Explicitly deny known mutating and
7
+ * delegation tools to make the read-only boundary obvious in generated config.
8
+ */
9
+ export declare function createReadOnlyAgentPermission(): AgentPermission;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ export type BackgroundSubagentsMode = 'ask' | 'yes' | 'no';
2
+ export type ShellKind = 'bash' | 'fish' | 'zsh';
3
+ export declare function isBackgroundSubagentsEnabled(value: string | undefined): boolean;
4
+ export declare function detectShellKind(shell: string | undefined): ShellKind | undefined;
5
+ export declare function detectBackgroundSubagentsTarget(env?: NodeJS.ProcessEnv): string | undefined;
6
+ export declare function getBackgroundSubagentsBlock(targetPath: string): string;
7
+ export declare function manualBackgroundSubagentsInstructions(options?: {
8
+ targetPath?: string;
9
+ shell?: ShellKind;
10
+ }): string;
11
+ export declare function expandHomePath(targetPath: string): string;
12
+ export declare function upsertBackgroundSubagentsBlock(content: string, block: string): string;
13
+ export declare function writeBackgroundSubagentsBlock(targetPath: string): void;
@@ -0,0 +1,4 @@
1
+ import { getCompanionBinaryPath, getCompanionTarget } from '../companion/updater';
2
+ import type { ConfigMergeResult, InstallConfig } from './types';
3
+ export { getCompanionBinaryPath, getCompanionTarget };
4
+ export declare function installCompanion(config: InstallConfig): Promise<ConfigMergeResult>;
@@ -0,0 +1,25 @@
1
+ import type { ConfigMergeResult, DetectedConfig, InstallConfig, OpenCodeConfig } from './types';
2
+ export declare function warmOpenCodePluginCache(): Promise<ConfigMergeResult | null>;
3
+ /**
4
+ * Strip JSON comments (single-line // and multi-line) and trailing commas for JSONC support.
5
+ */
6
+ export declare function stripJsonComments(json: string): string;
7
+ export declare function parseConfigFile(path: string): {
8
+ config: OpenCodeConfig | null;
9
+ error?: string;
10
+ };
11
+ export declare function parseConfig(path: string): {
12
+ config: OpenCodeConfig | null;
13
+ error?: string;
14
+ };
15
+ /**
16
+ * Write config to file atomically.
17
+ */
18
+ export declare function writeConfig(configPath: string, config: OpenCodeConfig): void;
19
+ export declare function addPluginToOpenCodeConfig(): Promise<ConfigMergeResult>;
20
+ export declare function addPluginToOpenCodeTuiConfig(): Promise<ConfigMergeResult>;
21
+ export declare function writeLiteConfig(installConfig: InstallConfig, targetPath?: string): ConfigMergeResult;
22
+ export declare function disableDefaultAgents(): ConfigMergeResult;
23
+ export declare function enableLspByDefault(): ConfigMergeResult;
24
+ export declare function canModifyOpenCodeConfig(): boolean;
25
+ export declare function detectCurrentConfig(): DetectedConfig;
@@ -0,0 +1,4 @@
1
+ export * from './config-io';
2
+ export * from './paths';
3
+ export * from './providers';
4
+ export * from './system';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A custom skill bundled in this repository.
3
+ * Unlike npx-installed skills, these are copied from src/skills/ to the OpenCode skills directory
4
+ */
5
+ export interface CustomSkill {
6
+ /** Skill name (folder name) */
7
+ name: string;
8
+ /** Human-readable description */
9
+ description: string;
10
+ /** List of agents that should auto-allow this skill */
11
+ allowedAgents: string[];
12
+ /** Source path in this repo (relative to project root) */
13
+ sourcePath: string;
14
+ }
15
+ /**
16
+ * Registry of custom skills bundled in this repository.
17
+ */
18
+ export declare const CUSTOM_SKILLS: CustomSkill[];
@@ -0,0 +1,13 @@
1
+ import { CUSTOM_SKILLS, type CustomSkill } from './custom-skills-registry';
2
+ export { CUSTOM_SKILLS, type CustomSkill };
3
+ /**
4
+ * Get the target directory for custom skills installation.
5
+ */
6
+ export declare function getCustomSkillsDir(): string;
7
+ /**
8
+ * Install a custom skill by copying from src/skills/ to the OpenCode skills directory
9
+ * @param skill - The custom skill to install
10
+ * @returns True if installation succeeded, false otherwise
11
+ * @deprecated Use syncBundledSkillsFromPackage instead.
12
+ */
13
+ export declare function installCustomSkill(skill: CustomSkill): boolean;
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import { type PluginConfig } from '../config/schema';
3
+ export type DoctorArgs = {
4
+ json?: boolean;
5
+ error?: string;
6
+ help?: boolean;
7
+ };
8
+ export declare function parseDoctorArgs(args: string[]): DoctorArgs;
9
+ export type ConfigCheckResult = {
10
+ scope: 'user' | 'project';
11
+ path: string | null;
12
+ exists: boolean;
13
+ ok: boolean;
14
+ config?: PluginConfig;
15
+ error?: {
16
+ kind: 'invalid-json' | 'invalid-schema' | 'read-error';
17
+ message: string;
18
+ issues?: z.ZodIssue[];
19
+ };
20
+ };
21
+ export type PresetCheckResult = {
22
+ preset: string;
23
+ ok: boolean;
24
+ error?: {
25
+ kind: 'missing-preset';
26
+ message: string;
27
+ };
28
+ };
29
+ export type DoctorResult = {
30
+ ok: boolean;
31
+ project: string;
32
+ configs: ConfigCheckResult[];
33
+ presetCheck?: PresetCheckResult;
34
+ };
35
+ export declare function runDoctorCheck(cwd: string): DoctorResult;
36
+ export declare function formatHumanDoctorResult(result: DoctorResult): string;
37
+ export declare function formatJsonDoctorResult(result: DoctorResult): string;
38
+ export declare function doctor(args: DoctorArgs): Promise<number>;
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ import type { InstallArgs } from './types';
3
+ export declare function parseArgs(args: string[]): InstallArgs;