oh-my-opencode-slim 1.0.2 → 1.0.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/README.md CHANGED
@@ -8,7 +8,6 @@
8
8
  <a href="https://boringdystopia.ai/"><img src="https://img.shields.io/badge/boringdystopia.ai-111111?style=for-the-badge&logo=vercel&logoColor=white" alt="boringdystopia.ai"></a>&nbsp;
9
9
  <a href="https://x.com/alvinunreal"><img src="https://img.shields.io/badge/X-@alvinunreal-000000?style=for-the-badge&logo=x&logoColor=white" alt="X @alvinunreal"></a>&nbsp;
10
10
  <a href="https://t.me/boringdystopiadevelopment"><img src="https://img.shields.io/badge/Telegram-Join%20channel-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white" alt="Telegram Join channel"></a>&nbsp;
11
- <a href="https://deepwiki.com/alvinunreal/oh-my-opencode-slim"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
12
11
  </p>
13
12
  </div>
14
13
 
@@ -69,7 +68,7 @@ The default generated configuration looks like this:
69
68
  "preset": "openai",
70
69
  "presets": {
71
70
  "openai": {
72
- "orchestrator": { "model": "openai/gpt-5.5", "variant": "high", "skills": ["*"], "mcps": ["*", "!context7"] },
71
+ "orchestrator": { "model": "openai/gpt-5.5", "skills": ["*"], "mcps": ["*", "!context7"] },
73
72
  "oracle": { "model": "openai/gpt-5.5", "variant": "high", "skills": ["simplify"], "mcps": [] },
74
73
  "librarian": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": ["websearch", "context7", "grep_app"] },
75
74
  "explorer": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": [] },
@@ -18,5 +18,6 @@ export declare function writeConfig(configPath: string, config: OpenCodeConfig):
18
18
  export declare function addPluginToOpenCodeConfig(): Promise<ConfigMergeResult>;
19
19
  export declare function writeLiteConfig(installConfig: InstallConfig, targetPath?: string): ConfigMergeResult;
20
20
  export declare function disableDefaultAgents(): ConfigMergeResult;
21
+ export declare function enableLspByDefault(): ConfigMergeResult;
21
22
  export declare function canModifyOpenCodeConfig(): boolean;
22
23
  export declare function detectCurrentConfig(): DetectedConfig;
package/dist/cli/index.js CHANGED
@@ -260,7 +260,9 @@ var InterviewConfigSchema = z2.object({
260
260
  dashboard: z2.boolean().default(false)
261
261
  });
262
262
  var SessionManagerConfigSchema = z2.object({
263
- maxSessionsPerAgent: z2.number().int().min(1).max(10).default(2)
263
+ maxSessionsPerAgent: z2.number().int().min(1).max(10).default(2),
264
+ readContextMinLines: z2.number().int().min(0).max(1000).default(10),
265
+ readContextMaxFiles: z2.number().int().min(0).max(50).default(8)
264
266
  });
265
267
  var TodoContinuationConfigSchema = z2.object({
266
268
  maxContinuations: z2.number().int().min(1).max(50).default(5).describe("Maximum consecutive auto-continuations before stopping to ask user"),
@@ -733,6 +735,32 @@ function disableDefaultAgents() {
733
735
  };
734
736
  }
735
737
  }
738
+ function enableLspByDefault() {
739
+ const configPath = getExistingConfigPath();
740
+ try {
741
+ ensureOpenCodeConfigDir();
742
+ const { config: parsedConfig, error } = parseConfig(configPath);
743
+ if (error) {
744
+ return {
745
+ success: false,
746
+ configPath,
747
+ error: `Failed to parse config: ${error}`
748
+ };
749
+ }
750
+ const config = parsedConfig ?? {};
751
+ if (config.lsp === undefined) {
752
+ config.lsp = true;
753
+ writeConfig(configPath, config);
754
+ }
755
+ return { success: true, configPath };
756
+ } catch (err) {
757
+ return {
758
+ success: false,
759
+ configPath,
760
+ error: `Failed to enable LSP: ${err}`
761
+ };
762
+ }
763
+ }
736
764
  function detectCurrentConfig() {
737
765
  const result = {
738
766
  isInstalled: false,
@@ -1028,7 +1056,7 @@ async function runInstall(config) {
1028
1056
  const detected = detectCurrentConfig();
1029
1057
  const isUpdate = detected.isInstalled;
1030
1058
  printHeader(isUpdate);
1031
- let totalSteps = 4;
1059
+ let totalSteps = 5;
1032
1060
  if (config.installSkills)
1033
1061
  totalSteps += 1;
1034
1062
  if (config.installCustomSkills)
@@ -1058,6 +1086,14 @@ async function runInstall(config) {
1058
1086
  if (!handleStepResult(agentResult, "Default agents disabled"))
1059
1087
  return 1;
1060
1088
  }
1089
+ printStep(step++, totalSteps, "Enabling OpenCode LSP integration...");
1090
+ if (config.dryRun) {
1091
+ printInfo("Dry run mode - skipping LSP configuration");
1092
+ } else {
1093
+ const lspResult = enableLspByDefault();
1094
+ if (!handleStepResult(lspResult, "LSP enabled"))
1095
+ return 1;
1096
+ }
1061
1097
  printStep(step++, totalSteps, "Writing oh-my-opencode-slim configuration...");
1062
1098
  if (config.dryRun) {
1063
1099
  const liteConfig = generateLiteConfig(config);
@@ -1,2 +1,2 @@
1
- import type { InstallArgs } from "./types";
1
+ import type { InstallArgs } from './types';
2
2
  export declare function install(args: InstallArgs): Promise<number>;
@@ -20,7 +20,7 @@ export declare const DEFAULT_TIMEOUT_MS: number;
20
20
  export declare const MAX_POLL_TIME_MS: number;
21
21
  export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
22
22
  export declare const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
23
- export declare const PHASE_REMINDER_TEXT = "!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192 choose the best parallelized path based on your capabilities and agents delegation rules \u2192 execute \u2192 verify.\nIf delegating, launch the specialist in the same turn you mention it !END!";
23
+ export declare const PHASE_REMINDER_TEXT = "!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192 choose the best parallelized path based on your capabilities and agents delegation rules \u2192 recall session reuse rules \u2192 execute \u2192 verify.\nIf delegating, launch the specialist in the same turn you mention it !END!";
24
24
  export declare const TMUX_SPAWN_DELAY_MS = 500;
25
25
  export declare const COUNCILLOR_STAGGER_MS = 250;
26
26
  export declare const STABLE_POLLS_THRESHOLD = 3;
@@ -1,5 +1,5 @@
1
1
  export * from './constants';
2
2
  export * from './council-schema';
3
- export { loadAgentPrompt, loadPluginConfig } from './loader';
3
+ export { deepMerge, loadAgentPrompt, loadPluginConfig } from './loader';
4
4
  export * from './schema';
5
5
  export { getAgentOverride, getCustomAgentNames } from './utils';
@@ -1,4 +1,13 @@
1
1
  import { type PluginConfig } from './schema';
2
+ /**
3
+ * Recursively merge two objects, with override values taking precedence.
4
+ * For nested objects, merges recursively. For arrays and primitives, override replaces base.
5
+ *
6
+ * @param base - Base object to merge into
7
+ * @param override - Override object whose values take precedence
8
+ * @returns Merged object, or undefined if both inputs are undefined
9
+ */
10
+ export declare function deepMerge<T extends Record<string, unknown>>(base?: T, override?: T): T | undefined;
2
11
  /**
3
12
  * Load plugin configuration from user and project config files, merging them appropriately.
4
13
  *
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Module-level runtime preset state.
3
+ *
4
+ * Survives plugin re-inits triggered by client.config.update() →
5
+ * Instance.dispose(). The plugin function re-runs but this module-level
6
+ * variable persists within the same Node.js process.
7
+ */
8
+ export declare function setActiveRuntimePreset(name: string | null): void;
9
+ export declare function getActiveRuntimePreset(): string | null;
10
+ export declare function getPreviousRuntimePreset(): string | null;
11
+ export declare function setActiveRuntimePresetWithPrevious(name: string | null): void;
12
+ export declare function rollbackRuntimePreset(previous: string | null): void;
@@ -160,6 +160,8 @@ export declare const InterviewConfigSchema: z.ZodObject<{
160
160
  export type InterviewConfig = z.infer<typeof InterviewConfigSchema>;
161
161
  export declare const SessionManagerConfigSchema: z.ZodObject<{
162
162
  maxSessionsPerAgent: z.ZodDefault<z.ZodNumber>;
163
+ readContextMinLines: z.ZodDefault<z.ZodNumber>;
164
+ readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
163
165
  }, z.core.$strip>;
164
166
  export type SessionManagerConfig = z.infer<typeof SessionManagerConfigSchema>;
165
167
  export declare const TodoContinuationConfigSchema: z.ZodObject<{
@@ -305,6 +307,8 @@ export declare const PluginConfigSchema: z.ZodObject<{
305
307
  }, z.core.$strip>>;
306
308
  sessionManager: z.ZodOptional<z.ZodObject<{
307
309
  maxSessionsPerAgent: z.ZodDefault<z.ZodNumber>;
310
+ readContextMinLines: z.ZodDefault<z.ZodNumber>;
311
+ readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
308
312
  }, z.core.$strip>>;
309
313
  todoContinuation: z.ZodOptional<z.ZodObject<{
310
314
  maxContinuations: z.ZodDefault<z.ZodNumber>;
@@ -1,4 +1,10 @@
1
- import type { LineComparator, RescueResult, SeekHit } from './types';
1
+ import type { LineComparator, MatchComparatorName, RescueResult, SeekHit } from './types';
2
+ export type PreparedAutoRescueTarget = {
3
+ exact: string;
4
+ unicode: string;
5
+ trimEnd: string;
6
+ unicodeTrimEnd: string;
7
+ };
2
8
  export declare function equalExact(a: string, b: string): boolean;
3
9
  export declare function equalUnicodeExact(a: string, b: string): boolean;
4
10
  export declare function equalTrimEnd(a: string, b: string): boolean;
@@ -6,6 +12,8 @@ export declare function equalUnicodeTrimEnd(a: string, b: string): boolean;
6
12
  export declare function equalTrim(a: string, b: string): boolean;
7
13
  export declare function equalUnicodeTrim(a: string, b: string): boolean;
8
14
  export declare const autoRescueComparators: LineComparator[];
15
+ export declare function prepareAutoRescueTarget(target: string): PreparedAutoRescueTarget;
16
+ export declare function matchPreparedAutoRescueComparator(candidate: string, target: PreparedAutoRescueTarget): MatchComparatorName | undefined;
9
17
  export declare const permissiveComparators: LineComparator[];
10
18
  export declare function seekMatch(lines: string[], pattern: string[], start: number, eof?: boolean): SeekHit | undefined;
11
19
  export declare function seek(lines: string[], pattern: string[], start: number, eof?: boolean): number;
@@ -2,9 +2,6 @@ import type { ApplyPatchRuntimeOptions } from './types';
2
2
  export type RewritePatchResult = {
3
3
  patchText: string;
4
4
  changed: boolean;
5
- rewrittenChunks: number;
6
- totalChunks: number;
7
- rewriteModes: string[];
8
5
  };
9
6
  export declare function rewritePatch(root: string, patchText: string, cfg: ApplyPatchRuntimeOptions, worktree?: string): Promise<RewritePatchResult>;
10
7
  export declare function rewritePatchText(root: string, patchText: string, cfg: ApplyPatchRuntimeOptions, worktree?: string): Promise<string>;
@@ -1,4 +1,4 @@
1
- export declare const PHASE_REMINDER = "<reminder>!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192 choose the best parallelized path based on your capabilities and agents delegation rules \u2192 execute \u2192 verify.\nIf delegating, launch the specialist in the same turn you mention it !END!</reminder>";
1
+ export declare const PHASE_REMINDER = "<internal_reminder>!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192 choose the best parallelized path based on your capabilities and agents delegation rules \u2192 recall session reuse rules \u2192 execute \u2192 verify.\nIf delegating, launch the specialist in the same turn you mention it !END!</internal_reminder>";
2
2
  interface MessageInfo {
3
3
  role: string;
4
4
  agent?: string;
@@ -7,29 +7,13 @@ interface ToolExecuteAfterInput {
7
7
  sessionID?: string;
8
8
  callID?: string;
9
9
  }
10
- interface ChatSystemTransformInput {
11
- sessionID?: string;
12
- }
13
- interface ChatSystemTransformOutput {
14
- system: string[];
15
- }
16
- interface EventInput {
17
- event: {
18
- type: string;
19
- properties?: {
20
- info?: {
21
- id?: string;
22
- };
23
- sessionID?: string;
24
- };
25
- };
10
+ interface ToolExecuteAfterOutput {
11
+ output?: unknown;
26
12
  }
27
13
  interface PostFileToolNudgeOptions {
28
14
  shouldInject?: (sessionID: string) => boolean;
29
15
  }
30
16
  export declare function createPostFileToolNudgeHook(options?: PostFileToolNudgeOptions): {
31
- 'tool.execute.after': (input: ToolExecuteAfterInput, _output: unknown) => Promise<void>;
32
- 'experimental.chat.system.transform': (input: ChatSystemTransformInput, output: ChatSystemTransformOutput) => Promise<void>;
33
- event: (input: EventInput) => Promise<void>;
17
+ 'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
34
18
  };
35
19
  export {};
@@ -1,6 +1,21 @@
1
1
  import type { PluginInput } from '@opencode-ai/plugin';
2
+ interface ChatMessagePart {
3
+ type: string;
4
+ text?: string;
5
+ [key: string]: unknown;
6
+ }
7
+ interface ChatMessage {
8
+ info: {
9
+ role: string;
10
+ agent?: string;
11
+ sessionID?: string;
12
+ };
13
+ parts: ChatMessagePart[];
14
+ }
2
15
  export declare function createTaskSessionManagerHook(_ctx: PluginInput, options: {
3
16
  maxSessionsPerAgent: number;
17
+ readContextMinLines?: number;
18
+ readContextMaxFiles?: number;
4
19
  shouldManageSession: (sessionID: string) => boolean;
5
20
  }): {
6
21
  'tool.execute.before': (input: {
@@ -16,11 +31,10 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
16
31
  callID?: string;
17
32
  }, output: {
18
33
  output: unknown;
34
+ metadata?: unknown;
19
35
  }) => Promise<void>;
20
- 'experimental.chat.system.transform': (input: {
21
- sessionID?: string;
22
- }, output: {
23
- system: string[];
36
+ 'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
37
+ messages: ChatMessage[];
24
38
  }) => Promise<void>;
25
39
  event: (input: {
26
40
  event: {
@@ -28,9 +42,11 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
28
42
  properties?: {
29
43
  info?: {
30
44
  id?: string;
45
+ parentID?: string;
31
46
  };
32
47
  sessionID?: string;
33
48
  };
34
49
  };
35
50
  }) => Promise<void>;
36
51
  };
52
+ export {};
@@ -23,11 +23,8 @@ export declare function createTodoContinuationHook(ctx: PluginInput, config?: {
23
23
  handleToolExecuteAfter: (input: {
24
24
  tool: string;
25
25
  sessionID?: string;
26
- }) => Promise<void>;
27
- handleChatSystemTransform: (input: {
28
- sessionID?: string;
29
- }, output: {
30
- system: string[];
26
+ }, output?: {
27
+ output?: unknown;
31
28
  }) => Promise<void>;
32
29
  handleMessagesTransform: (output: {
33
30
  messages: ChatTransformMessage[];
@@ -4,12 +4,6 @@ interface ToolInput {
4
4
  tool: string;
5
5
  sessionID?: string;
6
6
  }
7
- interface SystemInput {
8
- sessionID?: string;
9
- }
10
- interface SystemOutput {
11
- system: string[];
12
- }
13
7
  interface EventInput {
14
8
  type: string;
15
9
  properties?: {
@@ -34,8 +28,8 @@ interface Options {
34
28
  }
35
29
  export declare function createTodoHygiene(options: Options): {
36
30
  handleRequestStart(input: RequestStartInput): void;
37
- handleToolExecuteAfter(input: ToolInput): Promise<void>;
38
- handleChatSystemTransform(input: SystemInput, output: SystemOutput): Promise<void>;
31
+ handleToolExecuteAfter(input: ToolInput, _output?: unknown): Promise<void>;
32
+ getPendingReminder(sessionID: string): string | null;
39
33
  handleEvent(event: EventInput): void;
40
34
  };
41
35
  export {};