oh-my-opencode-slim 2.0.0-beta.1 → 2.0.0-beta.10

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 (67) hide show
  1. package/README.ja-JP.md +635 -0
  2. package/README.md +19 -9
  3. package/README.zh-CN.md +624 -0
  4. package/dist/cli/index.js +9 -3
  5. package/dist/config/constants.d.ts +1 -1
  6. package/dist/config/schema.d.ts +3 -3
  7. package/dist/hooks/deepwork/index.d.ts +13 -0
  8. package/dist/hooks/index.d.ts +1 -1
  9. package/dist/hooks/phase-reminder/index.d.ts +1 -1
  10. package/dist/index.js +766 -1271
  11. package/dist/multiplexer/session-manager.d.ts +4 -1
  12. package/dist/tools/ast-grep/tools.d.ts +1 -1
  13. package/dist/tools/cancel-task.d.ts +10 -0
  14. package/dist/tools/index.d.ts +1 -2
  15. package/dist/tui.js +10 -4
  16. package/dist/utils/background-job-board.d.ts +34 -1
  17. package/dist/utils/index.d.ts +0 -1
  18. package/oh-my-opencode-slim.schema.json +1 -1
  19. package/package.json +6 -4
  20. package/src/skills/codemap.md +3 -2
  21. package/src/skills/deepwork/SKILL.md +89 -0
  22. package/dist/agents/council-master.d.ts +0 -2
  23. package/dist/background/background-manager.d.ts +0 -203
  24. package/dist/background/index.d.ts +0 -3
  25. package/dist/background/multiplexer-session-manager.d.ts +0 -70
  26. package/dist/background/subagent-depth.d.ts +0 -35
  27. package/dist/cli/divoom.d.ts +0 -23
  28. package/dist/goal/index.d.ts +0 -3
  29. package/dist/goal/manager.d.ts +0 -41
  30. package/dist/goal/prompts.d.ts +0 -4
  31. package/dist/goal/store.d.ts +0 -15
  32. package/dist/goal/types.d.ts +0 -28
  33. package/dist/hooks/session-goal/index.d.ts +0 -38
  34. package/dist/integrations/divoom/index.d.ts +0 -3
  35. package/dist/integrations/divoom/status-manager.d.ts +0 -31
  36. package/dist/integrations/divoom/swift-helper-source.d.ts +0 -1
  37. package/dist/integrations/divoom/swift-transport.d.ts +0 -26
  38. package/dist/integrations/divoom/types.d.ts +0 -41
  39. package/dist/tools/background.d.ts +0 -13
  40. package/dist/tools/fork/command.d.ts +0 -28
  41. package/dist/tools/fork/files.d.ts +0 -33
  42. package/dist/tools/fork/index.d.ts +0 -10
  43. package/dist/tools/fork/state.d.ts +0 -7
  44. package/dist/tools/fork/tools.d.ts +0 -23
  45. package/dist/tools/fork/vendor.d.ts +0 -28
  46. package/dist/tools/handoff/command.d.ts +0 -29
  47. package/dist/tools/handoff/files.d.ts +0 -33
  48. package/dist/tools/handoff/index.d.ts +0 -10
  49. package/dist/tools/handoff/state.d.ts +0 -7
  50. package/dist/tools/handoff/tools.d.ts +0 -23
  51. package/dist/tools/handoff/vendor.d.ts +0 -28
  52. package/dist/tools/lsp/client.d.ts +0 -81
  53. package/dist/tools/lsp/config-store.d.ts +0 -29
  54. package/dist/tools/lsp/config.d.ts +0 -5
  55. package/dist/tools/lsp/constants.d.ts +0 -24
  56. package/dist/tools/lsp/index.d.ts +0 -4
  57. package/dist/tools/lsp/tools.d.ts +0 -5
  58. package/dist/tools/lsp/types.d.ts +0 -45
  59. package/dist/tools/lsp/utils.d.ts +0 -34
  60. package/dist/tools/subtask/command.d.ts +0 -30
  61. package/dist/tools/subtask/files.d.ts +0 -34
  62. package/dist/tools/subtask/index.d.ts +0 -11
  63. package/dist/tools/subtask/state.d.ts +0 -7
  64. package/dist/tools/subtask/tools.d.ts +0 -23
  65. package/dist/tools/subtask/vendor.d.ts +0 -27
  66. package/dist/utils/session-manager.d.ts +0 -55
  67. package/dist/utils/tmux-debug-log.d.ts +0 -2
@@ -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;
@@ -1,23 +0,0 @@
1
- /**
2
- * Tool definitions for subtask functionality.
3
- *
4
- * Factory functions that create tool definitions with injected dependencies:
5
- * - createSubtaskTool: Create a new session with subtask prompt
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 { SubtaskState } from './state';
11
- export type OpencodeClient = PluginInput['client'];
12
- /**
13
- * Create the subtask tool.
14
- *
15
- * Takes the OpenCode client as a dependency for TUI and session operations.
16
- */
17
- export declare function createSubtaskTool(ctx: PluginInput, state: SubtaskState, 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: SubtaskState): ToolDefinition;
@@ -1,27 +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 (used as `<path>` in the output)
24
- * @param content - File content as string
25
- * @returns Formatted output with line numbers in <file> tags
26
- */
27
- export declare function formatFileContent(_filepath: string, content: string): string;
@@ -1,55 +0,0 @@
1
- import type { AgentName } from '../config';
2
- export interface ContextFile {
3
- path: string;
4
- lineCount: number;
5
- lineNumbers?: number[];
6
- lastReadAt: number;
7
- }
8
- export interface RememberedTaskSession {
9
- alias: string;
10
- taskId: string;
11
- agentType: AgentName;
12
- label: string;
13
- contextFiles: ContextFile[];
14
- createdAt: number;
15
- lastUsedAt: number;
16
- }
17
- interface SessionManagerOptions {
18
- readContextMinLines?: number;
19
- readContextMaxFiles?: number;
20
- }
21
- export declare function deriveTaskSessionLabel(input: {
22
- description?: string;
23
- prompt?: string;
24
- agentType: AgentName;
25
- }): string;
26
- export declare class SessionManager {
27
- private readonly maxSessionsPerAgent;
28
- private readonly readContextMinLines;
29
- private readonly readContextMaxFiles;
30
- private readonly sessionsByParent;
31
- private readonly nextAliasIndexByParent;
32
- private orderCounter;
33
- constructor(maxSessionsPerAgent: number, options?: SessionManagerOptions);
34
- remember(input: {
35
- parentSessionId: string;
36
- taskId: string;
37
- agentType: AgentName;
38
- label: string;
39
- }): RememberedTaskSession;
40
- markUsed(parentSessionId: string, agentType: AgentName, key: string): void;
41
- resolve(parentSessionId: string, agentType: AgentName, key: string): RememberedTaskSession | undefined;
42
- drop(parentSessionId: string, agentType: AgentName, key: string): void;
43
- dropTask(taskId: string): void;
44
- taskIds(): Set<string>;
45
- addContext(taskId: string, files: ContextFile[]): void;
46
- clearParent(parentSessionId: string): void;
47
- formatForPrompt(parentSessionId: string): string | undefined;
48
- private getAgentGroup;
49
- private setAgentGroup;
50
- private nextAlias;
51
- private trimGroup;
52
- private trimContextFiles;
53
- private nextOrder;
54
- }
55
- export {};
@@ -1,2 +0,0 @@
1
- export declare function logTmuxDebug(event: string, data?: unknown): void;
2
- export declare function getTmuxDebugLogPath(): string;