oh-my-opencode-slim 1.0.3 → 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.
@@ -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
@@ -735,6 +735,32 @@ function disableDefaultAgents() {
735
735
  };
736
736
  }
737
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
+ }
738
764
  function detectCurrentConfig() {
739
765
  const result = {
740
766
  isInstalled: false,
@@ -1030,7 +1056,7 @@ async function runInstall(config) {
1030
1056
  const detected = detectCurrentConfig();
1031
1057
  const isUpdate = detected.isInstalled;
1032
1058
  printHeader(isUpdate);
1033
- let totalSteps = 4;
1059
+ let totalSteps = 5;
1034
1060
  if (config.installSkills)
1035
1061
  totalSteps += 1;
1036
1062
  if (config.installCustomSkills)
@@ -1060,6 +1086,14 @@ async function runInstall(config) {
1060
1086
  if (!handleStepResult(agentResult, "Default agents disabled"))
1061
1087
  return 1;
1062
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
+ }
1063
1097
  printStep(step++, totalSteps, "Writing oh-my-opencode-slim configuration...");
1064
1098
  if (config.dryRun) {
1065
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;
@@ -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,4 +1,17 @@
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;
4
17
  readContextMinLines?: number;
@@ -20,10 +33,8 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
20
33
  output: unknown;
21
34
  metadata?: unknown;
22
35
  }) => Promise<void>;
23
- 'experimental.chat.system.transform': (input: {
24
- sessionID?: string;
25
- }, output: {
26
- system: string[];
36
+ 'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
37
+ messages: ChatMessage[];
27
38
  }) => Promise<void>;
28
39
  event: (input: {
29
40
  event: {
@@ -38,3 +49,4 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
38
49
  };
39
50
  }) => Promise<void>;
40
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 {};