oh-my-opencode-slim 2.0.0-beta.1 → 2.0.0-beta.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 +2 -2
- package/dist/agents/orchestrator.d.ts +1 -1
- package/dist/cli/index.js +6 -0
- package/dist/hooks/deepwork/index.d.ts +13 -0
- package/dist/hooks/{session-goal → goal}/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/index.js +507 -932
- package/dist/tools/index.d.ts +0 -2
- package/dist/tui.js +6 -0
- package/package.json +3 -2
- package/src/skills/codemap.md +3 -2
- package/src/skills/deepwork/SKILL.md +92 -0
- package/dist/agents/council-master.d.ts +0 -2
- package/dist/background/background-manager.d.ts +0 -203
- package/dist/background/index.d.ts +0 -3
- package/dist/background/multiplexer-session-manager.d.ts +0 -70
- package/dist/background/subagent-depth.d.ts +0 -35
- package/dist/cli/divoom.d.ts +0 -23
- package/dist/goal/index.d.ts +0 -3
- package/dist/goal/manager.d.ts +0 -41
- package/dist/goal/prompts.d.ts +0 -4
- package/dist/goal/store.d.ts +0 -15
- package/dist/goal/types.d.ts +0 -28
- package/dist/integrations/divoom/index.d.ts +0 -3
- package/dist/integrations/divoom/status-manager.d.ts +0 -31
- package/dist/integrations/divoom/swift-helper-source.d.ts +0 -1
- package/dist/integrations/divoom/swift-transport.d.ts +0 -26
- package/dist/integrations/divoom/types.d.ts +0 -41
- package/dist/tools/background.d.ts +0 -13
- package/dist/tools/fork/command.d.ts +0 -28
- package/dist/tools/fork/files.d.ts +0 -33
- package/dist/tools/fork/index.d.ts +0 -10
- package/dist/tools/fork/state.d.ts +0 -7
- package/dist/tools/fork/tools.d.ts +0 -23
- package/dist/tools/fork/vendor.d.ts +0 -28
- package/dist/tools/handoff/command.d.ts +0 -29
- package/dist/tools/handoff/files.d.ts +0 -33
- package/dist/tools/handoff/index.d.ts +0 -10
- package/dist/tools/handoff/state.d.ts +0 -7
- package/dist/tools/handoff/tools.d.ts +0 -23
- package/dist/tools/handoff/vendor.d.ts +0 -28
- package/dist/tools/lsp/client.d.ts +0 -81
- package/dist/tools/lsp/config-store.d.ts +0 -29
- package/dist/tools/lsp/config.d.ts +0 -5
- package/dist/tools/lsp/constants.d.ts +0 -24
- package/dist/tools/lsp/index.d.ts +0 -4
- package/dist/tools/lsp/tools.d.ts +0 -5
- package/dist/tools/lsp/types.d.ts +0 -45
- package/dist/tools/lsp/utils.d.ts +0 -34
- package/dist/tools/subtask/command.d.ts +0 -30
- package/dist/tools/subtask/files.d.ts +0 -34
- package/dist/tools/subtask/index.d.ts +0 -11
- package/dist/tools/subtask/state.d.ts +0 -7
- package/dist/tools/subtask/tools.d.ts +0 -23
- package/dist/tools/subtask/vendor.d.ts +0 -27
- package/dist/utils/tmux-debug-log.d.ts +0 -2
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { DivoomConfig } from '../../config';
|
|
2
|
-
export type DivoomStatus = 'idle' | 'working' | 'alerting';
|
|
3
|
-
export type DivoomEvent = {
|
|
4
|
-
type: string;
|
|
5
|
-
properties?: {
|
|
6
|
-
info?: {
|
|
7
|
-
id?: string;
|
|
8
|
-
parentID?: string;
|
|
9
|
-
title?: string;
|
|
10
|
-
agent?: string;
|
|
11
|
-
sessionID?: string;
|
|
12
|
-
};
|
|
13
|
-
sessionID?: string;
|
|
14
|
-
status?: {
|
|
15
|
-
type: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type DivoomStatusUpdate = {
|
|
20
|
-
status: DivoomStatus;
|
|
21
|
-
reason: string;
|
|
22
|
-
timestamp: number;
|
|
23
|
-
};
|
|
24
|
-
export interface DivoomTransport {
|
|
25
|
-
sendStatus(update: DivoomStatusUpdate): Promise<void>;
|
|
26
|
-
dispose?(): Promise<void> | void;
|
|
27
|
-
}
|
|
28
|
-
export type DivoomStatusManagerOptions = {
|
|
29
|
-
config?: DivoomConfig;
|
|
30
|
-
transport?: DivoomTransport;
|
|
31
|
-
storageDir?: string;
|
|
32
|
-
registerBeforeExit?: boolean;
|
|
33
|
-
now?: () => number;
|
|
34
|
-
schedule?: (callback: () => void, delayMs: number) => unknown;
|
|
35
|
-
clearSchedule?: (timer: unknown) => void;
|
|
36
|
-
};
|
|
37
|
-
export type DivoomStatusFaceMap = Record<DivoomStatus, number>;
|
|
38
|
-
export type CommandRunner = (command: string, args: string[]) => Promise<{
|
|
39
|
-
stdout: string;
|
|
40
|
-
stderr: string;
|
|
41
|
-
}>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type PluginInput, type ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
-
import type { BackgroundTaskManager } from '../background';
|
|
3
|
-
import type { PluginConfig } from '../config';
|
|
4
|
-
import type { MultiplexerConfig } from '../config/schema';
|
|
5
|
-
/**
|
|
6
|
-
* Creates background task management tools for the plugin.
|
|
7
|
-
* @param _ctx - Plugin input context
|
|
8
|
-
* @param manager - Background task manager for launching and tracking tasks
|
|
9
|
-
* @param _multiplexerConfig - Optional multiplexer configuration for session management
|
|
10
|
-
* @param _pluginConfig - Optional plugin configuration for agent variants
|
|
11
|
-
* @returns Object containing background_task, background_output, background_cancel, and ask_orchestrator tools
|
|
12
|
-
*/
|
|
13
|
-
export declare function createBackgroundTools(_ctx: PluginInput, manager: BackgroundTaskManager, _multiplexerConfig?: MultiplexerConfig, _pluginConfig?: PluginConfig): Record<string, ToolDefinition>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command registration manager for fork functionality.
|
|
3
|
-
*
|
|
4
|
-
* Manages the /fork slash command registration and template.
|
|
5
|
-
*/
|
|
6
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
-
import type { ForkState } from './state';
|
|
8
|
-
/**
|
|
9
|
-
* Creates a fork command manager.
|
|
10
|
-
*
|
|
11
|
-
* Handles registration of the /fork command and fork session state events.
|
|
12
|
-
*/
|
|
13
|
-
export declare function createForkCommandManager(_ctx: PluginInput, state: ForkState, _processedSessions?: Set<string>): {
|
|
14
|
-
registerCommand: (opencodeConfig: Record<string, unknown>) => void;
|
|
15
|
-
handleEvent(input: {
|
|
16
|
-
event: {
|
|
17
|
-
type: string;
|
|
18
|
-
properties?: {
|
|
19
|
-
info?: {
|
|
20
|
-
id?: string;
|
|
21
|
-
parentID?: string;
|
|
22
|
-
};
|
|
23
|
-
sessionID?: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}): void;
|
|
27
|
-
};
|
|
28
|
-
export type ForkCommandManager = ReturnType<typeof createForkCommandManager>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File reference parsing and synthetic file parts for fork sessions.
|
|
3
|
-
*
|
|
4
|
-
* Handles extraction of @file references from fork prompts and
|
|
5
|
-
* building synthetic text parts that match OpenCode's Read tool output
|
|
6
|
-
* format.
|
|
7
|
-
*/
|
|
8
|
-
import type { TextPartInput } from '@opencode-ai/sdk';
|
|
9
|
-
/**
|
|
10
|
-
* File reference regex matching OpenCode's internal pattern.
|
|
11
|
-
* Matches @file references like @src/plugin.ts
|
|
12
|
-
*/
|
|
13
|
-
export declare const FILE_REGEX: RegExp;
|
|
14
|
-
/**
|
|
15
|
-
* Parse @file references from text.
|
|
16
|
-
*
|
|
17
|
-
* @param text - Text to search for @file references
|
|
18
|
-
* @returns Set of file paths referenced in the text
|
|
19
|
-
*/
|
|
20
|
-
export declare function parseFileReferences(text: string): Set<string>;
|
|
21
|
-
/**
|
|
22
|
-
* Build synthetic text parts matching OpenCode's Read tool output.
|
|
23
|
-
*
|
|
24
|
-
* Creates two synthetic text parts for each file:
|
|
25
|
-
* 1. Header describing the Read tool call
|
|
26
|
-
* 2. Formatted file content with line numbers
|
|
27
|
-
*
|
|
28
|
-
* @param directory - Project directory to resolve relative paths against
|
|
29
|
-
* @param refs - Set of file path references to check
|
|
30
|
-
* @returns Array of synthetic text parts (non-existent and binary files are
|
|
31
|
-
* skipped)
|
|
32
|
-
*/
|
|
33
|
-
export declare function buildSyntheticFileParts(directory: string, refs: Set<string>): Promise<TextPartInput[]>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fork functionality for orchestrator worker sessions.
|
|
3
|
-
*
|
|
4
|
-
* Provides tools and commands for forking current context into child workers.
|
|
5
|
-
*/
|
|
6
|
-
export { createForkCommandManager, type ForkCommandManager, } from './command';
|
|
7
|
-
export { buildSyntheticFileParts, FILE_REGEX, parseFileReferences, } from './files';
|
|
8
|
-
export { createForkState, type ForkState } from './state';
|
|
9
|
-
export { createForkSessionTool, createReadSessionTool, type OpencodeClient, } from './tools';
|
|
10
|
-
export { DEFAULT_READ_LIMIT, formatFileContent, isBinaryFile, MAX_BYTES, MAX_LINE_LENGTH, } from './vendor';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface ForkState {
|
|
2
|
-
markSession(sessionID: string, sourceSessionID: string): void;
|
|
3
|
-
unmarkSession(sessionID: string): void;
|
|
4
|
-
isForkSession(sessionID: string): boolean;
|
|
5
|
-
sourceFor(sessionID: string): string | undefined;
|
|
6
|
-
}
|
|
7
|
-
export declare function createForkState(): ForkState;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool definitions for fork functionality.
|
|
3
|
-
*
|
|
4
|
-
* Factory functions that create tool definitions with injected dependencies:
|
|
5
|
-
* - createForkSessionTool: Create a fork worker session
|
|
6
|
-
* - createReadSessionTool: Read conversation transcript from a session
|
|
7
|
-
*/
|
|
8
|
-
import type { PluginInput, ToolDefinition } from '@opencode-ai/plugin';
|
|
9
|
-
import type { SubagentDepthTracker } from '../../utils/subagent-depth';
|
|
10
|
-
import type { ForkState } from './state';
|
|
11
|
-
export type OpencodeClient = PluginInput['client'];
|
|
12
|
-
/**
|
|
13
|
-
* Create the fork_session tool.
|
|
14
|
-
*
|
|
15
|
-
* Takes the OpenCode client as a dependency for TUI and session operations.
|
|
16
|
-
*/
|
|
17
|
-
export declare function createForkSessionTool(ctx: PluginInput, state: ForkState, depthTracker?: SubagentDepthTracker): ToolDefinition;
|
|
18
|
-
/**
|
|
19
|
-
* Create the read_session tool.
|
|
20
|
-
*
|
|
21
|
-
* Takes the OpenCode client as a dependency for session.messages() calls.
|
|
22
|
-
*/
|
|
23
|
-
export declare function createReadSessionTool(client: OpencodeClient, state: ForkState): ToolDefinition;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vendored read-format helpers from OpenCode.
|
|
3
|
-
*
|
|
4
|
-
* Source: https://github.com/sst/opencode
|
|
5
|
-
* File: packages/opencode/src/tool/read.ts
|
|
6
|
-
*
|
|
7
|
-
* These functions and constants are copied to ensure synthetic file parts
|
|
8
|
-
* match OpenCode's Read tool output exactly.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Constants from OpenCode's ReadTool
|
|
12
|
-
*/
|
|
13
|
-
export declare const DEFAULT_READ_LIMIT = 2000;
|
|
14
|
-
export declare const MAX_LINE_LENGTH = 2000;
|
|
15
|
-
export declare const MAX_BYTES: number;
|
|
16
|
-
/**
|
|
17
|
-
* Check if a file is binary (copied from OpenCode's ReadTool)
|
|
18
|
-
*/
|
|
19
|
-
export declare function isBinaryFile(filepath: string): Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Format file content matching OpenCode's Read tool output format.
|
|
22
|
-
*
|
|
23
|
-
* @param _filepath - Absolute path to the file (unused in output, kept for
|
|
24
|
-
* signature compatibility)
|
|
25
|
-
* @param content - File content as string
|
|
26
|
-
* @returns Formatted output with line numbers in <file> tags
|
|
27
|
-
*/
|
|
28
|
-
export declare function formatFileContent(_filepath: string, content: string): string;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command registration manager for fork functionality.
|
|
3
|
-
*
|
|
4
|
-
* Manages the /fork-session slash command registration and template.
|
|
5
|
-
*/
|
|
6
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
-
import type { ForkState } from './state';
|
|
8
|
-
/**
|
|
9
|
-
* Creates a fork command manager.
|
|
10
|
-
*
|
|
11
|
-
* Handles registration of the /fork-session command and fork session state
|
|
12
|
-
* events.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createForkCommandManager(_ctx: PluginInput, state: ForkState, _processedSessions?: Set<string>): {
|
|
15
|
-
registerCommand: (opencodeConfig: Record<string, unknown>) => void;
|
|
16
|
-
handleEvent(input: {
|
|
17
|
-
event: {
|
|
18
|
-
type: string;
|
|
19
|
-
properties?: {
|
|
20
|
-
info?: {
|
|
21
|
-
id?: string;
|
|
22
|
-
parentID?: string;
|
|
23
|
-
};
|
|
24
|
-
sessionID?: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
}): void;
|
|
28
|
-
};
|
|
29
|
-
export type ForkCommandManager = ReturnType<typeof createForkCommandManager>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File reference parsing and synthetic file parts for fork sessions.
|
|
3
|
-
*
|
|
4
|
-
* Handles extraction of @file references from fork prompts and
|
|
5
|
-
* building synthetic text parts that match OpenCode's Read tool output
|
|
6
|
-
* format.
|
|
7
|
-
*/
|
|
8
|
-
import type { TextPartInput } from '@opencode-ai/sdk';
|
|
9
|
-
/**
|
|
10
|
-
* File reference regex matching OpenCode's internal pattern.
|
|
11
|
-
* Matches @file references like @src/plugin.ts
|
|
12
|
-
*/
|
|
13
|
-
export declare const FILE_REGEX: RegExp;
|
|
14
|
-
/**
|
|
15
|
-
* Parse @file references from text.
|
|
16
|
-
*
|
|
17
|
-
* @param text - Text to search for @file references
|
|
18
|
-
* @returns Set of file paths referenced in the text
|
|
19
|
-
*/
|
|
20
|
-
export declare function parseFileReferences(text: string): Set<string>;
|
|
21
|
-
/**
|
|
22
|
-
* Build synthetic text parts matching OpenCode's Read tool output.
|
|
23
|
-
*
|
|
24
|
-
* Creates two synthetic text parts for each file:
|
|
25
|
-
* 1. Header describing the Read tool call
|
|
26
|
-
* 2. Formatted file content with line numbers
|
|
27
|
-
*
|
|
28
|
-
* @param directory - Project directory to resolve relative paths against
|
|
29
|
-
* @param refs - Set of file path references to check
|
|
30
|
-
* @returns Array of synthetic text parts (non-existent and binary files are
|
|
31
|
-
* skipped)
|
|
32
|
-
*/
|
|
33
|
-
export declare function buildSyntheticFileParts(directory: string, refs: Set<string>): Promise<TextPartInput[]>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fork functionality for orchestrator worker sessions.
|
|
3
|
-
*
|
|
4
|
-
* Provides tools and commands for forking current context into child workers.
|
|
5
|
-
*/
|
|
6
|
-
export { createForkCommandManager, type ForkCommandManager, } from './command';
|
|
7
|
-
export { buildSyntheticFileParts, FILE_REGEX, parseFileReferences, } from './files';
|
|
8
|
-
export { createForkState, type ForkState } from './state';
|
|
9
|
-
export { createForkSessionTool, createReadSessionTool, type OpencodeClient, } from './tools';
|
|
10
|
-
export { DEFAULT_READ_LIMIT, formatFileContent, isBinaryFile, MAX_BYTES, MAX_LINE_LENGTH, } from './vendor';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface ForkState {
|
|
2
|
-
markSession(sessionID: string, sourceSessionID: string): void;
|
|
3
|
-
unmarkSession(sessionID: string): void;
|
|
4
|
-
isForkSession(sessionID: string): boolean;
|
|
5
|
-
sourceFor(sessionID: string): string | undefined;
|
|
6
|
-
}
|
|
7
|
-
export declare function createForkState(): ForkState;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool definitions for fork functionality.
|
|
3
|
-
*
|
|
4
|
-
* Factory functions that create tool definitions with injected dependencies:
|
|
5
|
-
* - createForkSessionTool: Create a fork worker session
|
|
6
|
-
* - createReadSessionTool: Read conversation transcript from a session
|
|
7
|
-
*/
|
|
8
|
-
import type { PluginInput, ToolDefinition } from '@opencode-ai/plugin';
|
|
9
|
-
import type { SubagentDepthTracker } from '../../utils/subagent-depth';
|
|
10
|
-
import type { ForkState } from './state';
|
|
11
|
-
export type OpencodeClient = PluginInput['client'];
|
|
12
|
-
/**
|
|
13
|
-
* Create the fork_session tool.
|
|
14
|
-
*
|
|
15
|
-
* Takes the OpenCode client as a dependency for TUI and session operations.
|
|
16
|
-
*/
|
|
17
|
-
export declare function createForkSessionTool(ctx: PluginInput, state: ForkState, depthTracker?: SubagentDepthTracker): ToolDefinition;
|
|
18
|
-
/**
|
|
19
|
-
* Create the read_session tool.
|
|
20
|
-
*
|
|
21
|
-
* Takes the OpenCode client as a dependency for session.messages() calls.
|
|
22
|
-
*/
|
|
23
|
-
export declare function createReadSessionTool(client: OpencodeClient, state: ForkState): ToolDefinition;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vendored read-format helpers from OpenCode.
|
|
3
|
-
*
|
|
4
|
-
* Source: https://github.com/sst/opencode
|
|
5
|
-
* File: packages/opencode/src/tool/read.ts
|
|
6
|
-
*
|
|
7
|
-
* These functions and constants are copied to ensure synthetic file parts
|
|
8
|
-
* match OpenCode's Read tool output exactly.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Constants from OpenCode's ReadTool
|
|
12
|
-
*/
|
|
13
|
-
export declare const DEFAULT_READ_LIMIT = 2000;
|
|
14
|
-
export declare const MAX_LINE_LENGTH = 2000;
|
|
15
|
-
export declare const MAX_BYTES: number;
|
|
16
|
-
/**
|
|
17
|
-
* Check if a file is binary (copied from OpenCode's ReadTool)
|
|
18
|
-
*/
|
|
19
|
-
export declare function isBinaryFile(filepath: string): Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Format file content matching OpenCode's Read tool output format.
|
|
22
|
-
*
|
|
23
|
-
* @param _filepath - Absolute path to the file (unused in output, kept for
|
|
24
|
-
* signature compatibility)
|
|
25
|
-
* @param content - File content as string
|
|
26
|
-
* @returns Formatted output with line numbers in <file> tags
|
|
27
|
-
*/
|
|
28
|
-
export declare function formatFileContent(_filepath: string, content: string): string;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { Diagnostic, ResolvedServer } from './types';
|
|
2
|
-
export declare const LSP_TIMEOUTS: {
|
|
3
|
-
start: number;
|
|
4
|
-
request: number;
|
|
5
|
-
diagnostics: number;
|
|
6
|
-
openFileDelay: number;
|
|
7
|
-
initializeDelay: number;
|
|
8
|
-
diagnosticSettleDelay: number;
|
|
9
|
-
};
|
|
10
|
-
interface DiagnosticProviderCapabilities {
|
|
11
|
-
identifier?: string;
|
|
12
|
-
interFileDependencies?: boolean;
|
|
13
|
-
workspaceDiagnostics?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function getDiagnosticsCapabilitySummary({ diagnosticProvider, publishDiagnosticsObserved, workspaceConfigurationRequested, }: {
|
|
16
|
-
diagnosticProvider?: DiagnosticProviderCapabilities | null;
|
|
17
|
-
publishDiagnosticsObserved?: boolean;
|
|
18
|
-
workspaceConfigurationRequested?: boolean;
|
|
19
|
-
}): {
|
|
20
|
-
availableModes: string[];
|
|
21
|
-
preferredMode: 'push' | 'pull';
|
|
22
|
-
inferredTransport: 'push' | 'pull' | 'hybrid';
|
|
23
|
-
pull: boolean;
|
|
24
|
-
pushObserved: boolean;
|
|
25
|
-
pullResultTracking: boolean;
|
|
26
|
-
workspaceDiagnostics: boolean;
|
|
27
|
-
interFileDependencies: boolean;
|
|
28
|
-
workspaceConfiguration: boolean;
|
|
29
|
-
};
|
|
30
|
-
export declare function getWorkspaceConfiguration(items: Array<{
|
|
31
|
-
section?: string;
|
|
32
|
-
} | undefined>): Array<unknown>;
|
|
33
|
-
declare class LSPServerManager {
|
|
34
|
-
private static instance;
|
|
35
|
-
private clients;
|
|
36
|
-
private cleanupInterval;
|
|
37
|
-
private readonly IDLE_TIMEOUT;
|
|
38
|
-
private constructor();
|
|
39
|
-
private registerProcessCleanup;
|
|
40
|
-
static getInstance(): LSPServerManager;
|
|
41
|
-
private getKey;
|
|
42
|
-
private startCleanupTimer;
|
|
43
|
-
private cleanupIdleClients;
|
|
44
|
-
getClient(root: string, server: ResolvedServer): Promise<LSPClient>;
|
|
45
|
-
releaseClient(root: string, serverId: string): void;
|
|
46
|
-
isServerInitializing(root: string, serverId: string): boolean;
|
|
47
|
-
stopAll(): Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
export declare const lspManager: LSPServerManager;
|
|
50
|
-
export declare class LSPClient {
|
|
51
|
-
private root;
|
|
52
|
-
private server;
|
|
53
|
-
private proc;
|
|
54
|
-
private connection;
|
|
55
|
-
private openedFiles;
|
|
56
|
-
private stderrBuffer;
|
|
57
|
-
private processExited;
|
|
58
|
-
private diagnosticsStore;
|
|
59
|
-
private diagnosticResultIds;
|
|
60
|
-
private documents;
|
|
61
|
-
private diagnosticProvider;
|
|
62
|
-
private publishDiagnosticsObserved;
|
|
63
|
-
private supportsPullDiagnostics;
|
|
64
|
-
private workspaceConfigurationRequested;
|
|
65
|
-
constructor(root: string, server: ResolvedServer);
|
|
66
|
-
start(): Promise<void>;
|
|
67
|
-
private startStderrReading;
|
|
68
|
-
initialize(): Promise<void>;
|
|
69
|
-
private waitForPublishedDiagnostics;
|
|
70
|
-
openFile(filePath: string): Promise<void>;
|
|
71
|
-
private ensureDocumentSynced;
|
|
72
|
-
definition(filePath: string, line: number, character: number): Promise<unknown>;
|
|
73
|
-
references(filePath: string, line: number, character: number, includeDeclaration?: boolean): Promise<unknown>;
|
|
74
|
-
diagnostics(filePath: string): Promise<{
|
|
75
|
-
items: Diagnostic[];
|
|
76
|
-
}>;
|
|
77
|
-
rename(filePath: string, line: number, character: number, newName: string): Promise<unknown>;
|
|
78
|
-
isAlive(): boolean;
|
|
79
|
-
stop(): Promise<void>;
|
|
80
|
-
}
|
|
81
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User-provided LSP server config (from opencode.json lsp section).
|
|
3
|
-
* Fields are optional because user config may not include all properties.
|
|
4
|
-
*/
|
|
5
|
-
export interface UserLspConfig {
|
|
6
|
-
id: string;
|
|
7
|
-
command?: string[];
|
|
8
|
-
extensions?: string[];
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
env?: Record<string, string>;
|
|
11
|
-
initialization?: Record<string, unknown>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Set the user's lsp config from opencode.json.
|
|
15
|
-
* Called during plugin initialization.
|
|
16
|
-
*/
|
|
17
|
-
export declare function setUserLspConfig(config: Record<string, unknown> | undefined): void;
|
|
18
|
-
/**
|
|
19
|
-
* Get the user's lsp config for a specific server ID.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getUserLspConfig(serverId: string): UserLspConfig | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Get all user-configured lsp servers.
|
|
24
|
-
*/
|
|
25
|
-
export declare function getAllUserLspConfigs(): Map<string, UserLspConfig>;
|
|
26
|
-
/**
|
|
27
|
-
* Check if user has configured any lsp servers.
|
|
28
|
-
*/
|
|
29
|
-
export declare function hasUserLspConfig(): boolean;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ServerLookupResult } from './types';
|
|
2
|
-
export declare function findServerForExtension(ext: string, filePath?: string): ServerLookupResult;
|
|
3
|
-
export declare function getLanguageId(ext: string): string;
|
|
4
|
-
export declare function resolveServerCommand(command: string[], cwd?: string): string[] | null;
|
|
5
|
-
export declare function isServerInstalled(command: string[]): boolean;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { LSPServerConfig, RootFunction } from './types';
|
|
2
|
-
export declare const SYMBOL_KIND_MAP: Record<number, string>;
|
|
3
|
-
export declare const SEVERITY_MAP: Record<number, string>;
|
|
4
|
-
export declare const DEFAULT_MAX_REFERENCES = 200;
|
|
5
|
-
export declare const DEFAULT_MAX_DIAGNOSTICS = 200;
|
|
6
|
-
/**
|
|
7
|
-
* NearestRoot helper - mirrors OpenCode core's NearestRoot function.
|
|
8
|
-
* Creates a RootFunction that walks up directories looking for root markers.
|
|
9
|
-
*/
|
|
10
|
-
export declare function NearestRoot(includePatterns: string[], excludePatterns?: string[]): RootFunction;
|
|
11
|
-
/**
|
|
12
|
-
* Built-in LSP servers - mirrors OpenCode core LSPServer namespace.
|
|
13
|
-
* User configuration from opencode.json lsp section takes precedence and is
|
|
14
|
-
* merged on top of these: user settings override command/extensions/env, while
|
|
15
|
-
* root patterns are always preserved from built-in. Servers can be removed by
|
|
16
|
-
* setting `"disabled": true` in the user config.
|
|
17
|
-
*/
|
|
18
|
-
export declare const BUILTIN_SERVERS: Record<string, Omit<LSPServerConfig, 'id'>>;
|
|
19
|
-
export declare const LSP_INSTALL_HINTS: Record<string, string>;
|
|
20
|
-
/**
|
|
21
|
-
* Maps file extensions to LSP language IDs.
|
|
22
|
-
* Mirrors OpenCode core's LANGUAGE_EXTENSIONS constant.
|
|
23
|
-
*/
|
|
24
|
-
export declare const LANGUAGE_EXTENSIONS: Record<string, string>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { lspManager } from './client';
|
|
2
|
-
export { getUserLspConfig, setUserLspConfig } from './config-store';
|
|
3
|
-
export { lsp_diagnostics, lsp_find_references, lsp_goto_definition, lsp_rename, } from './tools';
|
|
4
|
-
export type { Diagnostic, Location, LSPServerConfig, ResolvedServer, WorkspaceEdit, } from './types';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type ToolDefinition } from '@opencode-ai/plugin/tool';
|
|
2
|
-
export declare const lsp_goto_definition: ToolDefinition;
|
|
3
|
-
export declare const lsp_find_references: ToolDefinition;
|
|
4
|
-
export declare const lsp_diagnostics: ToolDefinition;
|
|
5
|
-
export declare const lsp_rename: ToolDefinition;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { CreateFile, DeleteFile, Diagnostic, DocumentSymbol, Location, LocationLink, Position, Range, RenameFile, SymbolInformation as SymbolInfo, TextDocumentEdit, TextDocumentIdentifier, TextEdit, VersionedTextDocumentIdentifier, WorkspaceEdit } from 'vscode-languageserver-protocol';
|
|
2
|
-
/**
|
|
3
|
-
* Root function type - mirrors OpenCode core's RootFunction.
|
|
4
|
-
* Returns the project root directory for a given file, or undefined if not applicable.
|
|
5
|
-
*/
|
|
6
|
-
export type RootFunction = (file: string) => string | undefined;
|
|
7
|
-
export interface LSPServerConfig {
|
|
8
|
-
id: string;
|
|
9
|
-
command: string[];
|
|
10
|
-
extensions: string[];
|
|
11
|
-
root?: RootFunction;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
env?: Record<string, string>;
|
|
14
|
-
initialization?: Record<string, unknown>;
|
|
15
|
-
}
|
|
16
|
-
export interface ResolvedServer {
|
|
17
|
-
id: string;
|
|
18
|
-
command: string[];
|
|
19
|
-
extensions: string[];
|
|
20
|
-
root?: RootFunction;
|
|
21
|
-
env?: Record<string, string>;
|
|
22
|
-
initialization?: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
export type ServerLookupResult = {
|
|
25
|
-
status: 'found';
|
|
26
|
-
server: ResolvedServer;
|
|
27
|
-
} | {
|
|
28
|
-
status: 'not_configured';
|
|
29
|
-
extension: string;
|
|
30
|
-
} | {
|
|
31
|
-
status: 'not_installed';
|
|
32
|
-
server: ResolvedServer;
|
|
33
|
-
installHint: string;
|
|
34
|
-
};
|
|
35
|
-
export type { CreateFile, DeleteFile, Diagnostic, DocumentSymbol, Location, LocationLink, Position, Range, RenameFile, SymbolInfo, TextDocumentEdit, TextDocumentIdentifier, TextEdit, VersionedTextDocumentIdentifier, WorkspaceEdit, };
|
|
36
|
-
export interface DocumentDiagnosticReportFull {
|
|
37
|
-
kind: 'full';
|
|
38
|
-
items: Diagnostic[];
|
|
39
|
-
resultId?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface DocumentDiagnosticReportUnchanged {
|
|
42
|
-
kind: 'unchanged';
|
|
43
|
-
resultId?: string;
|
|
44
|
-
}
|
|
45
|
-
export type DocumentDiagnosticReport = DocumentDiagnosticReportFull | DocumentDiagnosticReportUnchanged;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { LSPClient } from './client';
|
|
2
|
-
import type { Diagnostic, Location, LocationLink, ResolvedServer, ServerLookupResult, WorkspaceEdit } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Find the project root for a specific LSP server using its root function.
|
|
5
|
-
* Mirrors OpenCode core's RootFunction approach.
|
|
6
|
-
*
|
|
7
|
-
* @param filePath - The file to find the root for
|
|
8
|
-
* @param server - The LSP server config with root function
|
|
9
|
-
* @returns The project root directory, or file's directory if no root function
|
|
10
|
-
*/
|
|
11
|
-
export declare function findServerProjectRoot(filePath: string, server: ResolvedServer): string;
|
|
12
|
-
/**
|
|
13
|
-
* Legacy function for backward compatibility.
|
|
14
|
-
* @deprecated Use findServerProjectRoot with server-specific patterns instead.
|
|
15
|
-
*/
|
|
16
|
-
export declare function findWorkspaceRoot(filePath: string): string;
|
|
17
|
-
export declare function uriToPath(uri: string): string;
|
|
18
|
-
export declare function formatServerLookupError(result: Exclude<ServerLookupResult, {
|
|
19
|
-
status: 'found';
|
|
20
|
-
}>): string;
|
|
21
|
-
export declare function withLspClient<T>(filePath: string, fn: (client: LSPClient) => Promise<T>): Promise<T>;
|
|
22
|
-
export declare function formatLocation(loc: Location | LocationLink): string;
|
|
23
|
-
export declare function formatSymbolKind(kind: number): string;
|
|
24
|
-
export declare function formatSeverity(severity: number | undefined): string;
|
|
25
|
-
export declare function formatDiagnostic(diag: Diagnostic): string;
|
|
26
|
-
export declare function filterDiagnosticsBySeverity(diagnostics: Diagnostic[], severityFilter?: 'error' | 'warning' | 'information' | 'hint' | 'all'): Diagnostic[];
|
|
27
|
-
export interface ApplyResult {
|
|
28
|
-
success: boolean;
|
|
29
|
-
filesModified: string[];
|
|
30
|
-
totalEdits: number;
|
|
31
|
-
errors: string[];
|
|
32
|
-
}
|
|
33
|
-
export declare function applyWorkspaceEdit(edit: WorkspaceEdit | null): ApplyResult;
|
|
34
|
-
export declare function formatApplyResult(result: ApplyResult): string;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command registration manager for subtask functionality.
|
|
3
|
-
*
|
|
4
|
-
* Manages the /subtask slash command registration and the SUBTASK_COMMAND
|
|
5
|
-
* template that guides the AI in generating subtask prompts.
|
|
6
|
-
*/
|
|
7
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
8
|
-
import type { SubtaskState } from './state';
|
|
9
|
-
/**
|
|
10
|
-
* Creates a subtask command manager.
|
|
11
|
-
*
|
|
12
|
-
* Handles registration of the /subtask command and processing of chat
|
|
13
|
-
* messages to inject synthetic file parts for subtask sessions.
|
|
14
|
-
*/
|
|
15
|
-
export declare function createSubtaskCommandManager(_ctx: PluginInput, state: SubtaskState): {
|
|
16
|
-
registerCommand: (opencodeConfig: Record<string, unknown>) => void;
|
|
17
|
-
handleEvent(input: {
|
|
18
|
-
event: {
|
|
19
|
-
type: string;
|
|
20
|
-
properties?: {
|
|
21
|
-
info?: {
|
|
22
|
-
id?: string;
|
|
23
|
-
parentID?: string;
|
|
24
|
-
};
|
|
25
|
-
sessionID?: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
}): void;
|
|
29
|
-
};
|
|
30
|
-
export type SubtaskCommandManager = ReturnType<typeof createSubtaskCommandManager>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File reference parsing and synthetic file parts for subtask sessions.
|
|
3
|
-
*
|
|
4
|
-
* Handles extraction of @file references from subtask prompts and
|
|
5
|
-
* building synthetic text parts that match OpenCode's Read tool output
|
|
6
|
-
* format.
|
|
7
|
-
*/
|
|
8
|
-
import type { TextPartInput } from '@opencode-ai/sdk';
|
|
9
|
-
/**
|
|
10
|
-
* File reference regex matching OpenCode's internal pattern.
|
|
11
|
-
* Matches @file references like @src/plugin.ts
|
|
12
|
-
*/
|
|
13
|
-
export declare const FILE_REGEX: RegExp;
|
|
14
|
-
export declare function cleanFileReference(ref: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Parse @file references from text.
|
|
17
|
-
*
|
|
18
|
-
* @param text - Text to search for @file references
|
|
19
|
-
* @returns Set of file paths referenced in the text
|
|
20
|
-
*/
|
|
21
|
-
export declare function parseFileReferences(text: string): Set<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Build synthetic text parts matching OpenCode's Read tool output.
|
|
24
|
-
*
|
|
25
|
-
* Creates two synthetic text parts for each file:
|
|
26
|
-
* 1. Header describing the Read tool call
|
|
27
|
-
* 2. Formatted file content with line numbers
|
|
28
|
-
*
|
|
29
|
-
* @param directory - Project directory to resolve relative paths against
|
|
30
|
-
* @param refs - Set of file path references to check
|
|
31
|
-
* @returns Array of synthetic text parts (non-existent and binary files are
|
|
32
|
-
* skipped)
|
|
33
|
-
*/
|
|
34
|
-
export declare function buildSyntheticFileParts(directory: string, refs: Set<string>): Promise<TextPartInput[]>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subtask functionality for session continuation.
|
|
3
|
-
*
|
|
4
|
-
* Provides tools and commands for creating subtask prompts that allow
|
|
5
|
-
* work to continue seamlessly in new sessions with preloaded context.
|
|
6
|
-
*/
|
|
7
|
-
export { createSubtaskCommandManager, type SubtaskCommandManager, } from './command';
|
|
8
|
-
export { buildSyntheticFileParts, FILE_REGEX, parseFileReferences, } from './files';
|
|
9
|
-
export { createSubtaskState, type SubtaskState } from './state';
|
|
10
|
-
export { createReadSessionTool, createSubtaskTool, type OpencodeClient, } from './tools';
|
|
11
|
-
export { DEFAULT_READ_LIMIT, formatFileContent, isBinaryFile, MAX_BYTES, MAX_LINE_LENGTH, } from './vendor';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface SubtaskState {
|
|
2
|
-
markSession(sessionID: string, sourceSessionID: string): void;
|
|
3
|
-
unmarkSession(sessionID: string): void;
|
|
4
|
-
isSubtaskSession(sessionID: string): boolean;
|
|
5
|
-
sourceFor(sessionID: string): string | undefined;
|
|
6
|
-
}
|
|
7
|
-
export declare function createSubtaskState(): SubtaskState;
|