oh-my-opencode 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 (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +140 -0
  3. package/README.ko.md +140 -0
  4. package/dist/agents/document-writer.d.ts +2 -0
  5. package/dist/agents/explore.d.ts +2 -0
  6. package/dist/agents/frontend-ui-ux-engineer.d.ts +2 -0
  7. package/dist/agents/index.d.ts +2 -0
  8. package/dist/agents/librarian.d.ts +2 -0
  9. package/dist/agents/oracle.d.ts +2 -0
  10. package/dist/ast-grep-napi.darwin-arm64-qa3xn4vh.node +0 -0
  11. package/dist/features/terminal/index.d.ts +1 -0
  12. package/dist/features/terminal/title.d.ts +13 -0
  13. package/dist/hooks/context-window-monitor.d.ts +18 -0
  14. package/dist/hooks/grep-blocker.d.ts +10 -0
  15. package/dist/hooks/index.d.ts +3 -0
  16. package/dist/hooks/session-notification.d.ts +18 -0
  17. package/dist/hooks/todo-continuation-enforcer.d.ts +7 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.js +15726 -0
  20. package/dist/tools/ast-grep/cli.d.ts +11 -0
  21. package/dist/tools/ast-grep/constants.d.ts +4 -0
  22. package/dist/tools/ast-grep/index.d.ts +92 -0
  23. package/dist/tools/ast-grep/napi.d.ts +13 -0
  24. package/dist/tools/ast-grep/tools.d.ts +135 -0
  25. package/dist/tools/ast-grep/types.d.ts +51 -0
  26. package/dist/tools/ast-grep/utils.d.ts +5 -0
  27. package/dist/tools/index.d.ts +255 -0
  28. package/dist/tools/lsp/client.d.ts +55 -0
  29. package/dist/tools/lsp/config.d.ts +24 -0
  30. package/dist/tools/lsp/constants.d.ts +5 -0
  31. package/dist/tools/lsp/index.d.ts +6 -0
  32. package/dist/tools/lsp/tools.d.ts +152 -0
  33. package/dist/tools/lsp/types.d.ts +131 -0
  34. package/dist/tools/lsp/utils.d.ts +25 -0
  35. package/dist/tools/safe-grep/cli.d.ts +3 -0
  36. package/dist/tools/safe-grep/constants.d.ts +16 -0
  37. package/dist/tools/safe-grep/index.d.ts +2 -0
  38. package/dist/tools/safe-grep/tools.d.ts +13 -0
  39. package/dist/tools/safe-grep/types.d.ts +36 -0
  40. package/dist/tools/safe-grep/utils.d.ts +3 -0
  41. package/package.json +53 -0
@@ -0,0 +1,152 @@
1
+ export declare const lsp_hover: {
2
+ description: string;
3
+ args: {
4
+ filePath: import("zod").ZodString;
5
+ line: import("zod").ZodNumber;
6
+ character: import("zod").ZodNumber;
7
+ };
8
+ execute(args: {
9
+ filePath: string;
10
+ line: number;
11
+ character: number;
12
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
13
+ };
14
+ export declare const lsp_goto_definition: {
15
+ description: string;
16
+ args: {
17
+ filePath: import("zod").ZodString;
18
+ line: import("zod").ZodNumber;
19
+ character: import("zod").ZodNumber;
20
+ };
21
+ execute(args: {
22
+ filePath: string;
23
+ line: number;
24
+ character: number;
25
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
26
+ };
27
+ export declare const lsp_find_references: {
28
+ description: string;
29
+ args: {
30
+ filePath: import("zod").ZodString;
31
+ line: import("zod").ZodNumber;
32
+ character: import("zod").ZodNumber;
33
+ includeDeclaration: import("zod").ZodOptional<import("zod").ZodBoolean>;
34
+ };
35
+ execute(args: {
36
+ filePath: string;
37
+ line: number;
38
+ character: number;
39
+ includeDeclaration?: boolean | undefined;
40
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
41
+ };
42
+ export declare const lsp_document_symbols: {
43
+ description: string;
44
+ args: {
45
+ filePath: import("zod").ZodString;
46
+ };
47
+ execute(args: {
48
+ filePath: string;
49
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
50
+ };
51
+ export declare const lsp_workspace_symbols: {
52
+ description: string;
53
+ args: {
54
+ filePath: import("zod").ZodString;
55
+ query: import("zod").ZodString;
56
+ limit: import("zod").ZodOptional<import("zod").ZodNumber>;
57
+ };
58
+ execute(args: {
59
+ filePath: string;
60
+ query: string;
61
+ limit?: number | undefined;
62
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
63
+ };
64
+ export declare const lsp_diagnostics: {
65
+ description: string;
66
+ args: {
67
+ filePath: import("zod").ZodString;
68
+ severity: import("zod").ZodOptional<import("zod").ZodEnum<{
69
+ all: "all";
70
+ error: "error";
71
+ warning: "warning";
72
+ information: "information";
73
+ hint: "hint";
74
+ }>>;
75
+ };
76
+ execute(args: {
77
+ filePath: string;
78
+ severity?: "all" | "error" | "warning" | "information" | "hint" | undefined;
79
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
80
+ };
81
+ export declare const lsp_servers: {
82
+ description: string;
83
+ args: {};
84
+ execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
85
+ };
86
+ export declare const lsp_prepare_rename: {
87
+ description: string;
88
+ args: {
89
+ filePath: import("zod").ZodString;
90
+ line: import("zod").ZodNumber;
91
+ character: import("zod").ZodNumber;
92
+ };
93
+ execute(args: {
94
+ filePath: string;
95
+ line: number;
96
+ character: number;
97
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
98
+ };
99
+ export declare const lsp_rename: {
100
+ description: string;
101
+ args: {
102
+ filePath: import("zod").ZodString;
103
+ line: import("zod").ZodNumber;
104
+ character: import("zod").ZodNumber;
105
+ newName: import("zod").ZodString;
106
+ };
107
+ execute(args: {
108
+ filePath: string;
109
+ line: number;
110
+ character: number;
111
+ newName: string;
112
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
113
+ };
114
+ export declare const lsp_code_actions: {
115
+ description: string;
116
+ args: {
117
+ filePath: import("zod").ZodString;
118
+ startLine: import("zod").ZodNumber;
119
+ startCharacter: import("zod").ZodNumber;
120
+ endLine: import("zod").ZodNumber;
121
+ endCharacter: import("zod").ZodNumber;
122
+ kind: import("zod").ZodOptional<import("zod").ZodEnum<{
123
+ quickfix: "quickfix";
124
+ refactor: "refactor";
125
+ "refactor.extract": "refactor.extract";
126
+ "refactor.inline": "refactor.inline";
127
+ "refactor.rewrite": "refactor.rewrite";
128
+ source: "source";
129
+ "source.organizeImports": "source.organizeImports";
130
+ "source.fixAll": "source.fixAll";
131
+ }>>;
132
+ };
133
+ execute(args: {
134
+ filePath: string;
135
+ startLine: number;
136
+ startCharacter: number;
137
+ endLine: number;
138
+ endCharacter: number;
139
+ kind?: "quickfix" | "refactor" | "refactor.extract" | "refactor.inline" | "refactor.rewrite" | "source" | "source.organizeImports" | "source.fixAll" | undefined;
140
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
141
+ };
142
+ export declare const lsp_code_action_resolve: {
143
+ description: string;
144
+ args: {
145
+ filePath: import("zod").ZodString;
146
+ codeAction: import("zod").ZodString;
147
+ };
148
+ execute(args: {
149
+ filePath: string;
150
+ codeAction: string;
151
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
152
+ };
@@ -0,0 +1,131 @@
1
+ export interface LSPServerConfig {
2
+ id: string;
3
+ command: string[];
4
+ extensions: string[];
5
+ disabled?: boolean;
6
+ env?: Record<string, string>;
7
+ initialization?: Record<string, unknown>;
8
+ }
9
+ export interface Position {
10
+ line: number;
11
+ character: number;
12
+ }
13
+ export interface Range {
14
+ start: Position;
15
+ end: Position;
16
+ }
17
+ export interface Location {
18
+ uri: string;
19
+ range: Range;
20
+ }
21
+ export interface LocationLink {
22
+ targetUri: string;
23
+ targetRange: Range;
24
+ targetSelectionRange: Range;
25
+ originSelectionRange?: Range;
26
+ }
27
+ export interface SymbolInfo {
28
+ name: string;
29
+ kind: number;
30
+ location: Location;
31
+ containerName?: string;
32
+ }
33
+ export interface DocumentSymbol {
34
+ name: string;
35
+ kind: number;
36
+ range: Range;
37
+ selectionRange: Range;
38
+ children?: DocumentSymbol[];
39
+ }
40
+ export interface Diagnostic {
41
+ range: Range;
42
+ severity?: number;
43
+ code?: string | number;
44
+ source?: string;
45
+ message: string;
46
+ }
47
+ export interface HoverResult {
48
+ contents: {
49
+ kind?: string;
50
+ value: string;
51
+ } | string | Array<{
52
+ kind?: string;
53
+ value: string;
54
+ } | string>;
55
+ range?: Range;
56
+ }
57
+ export interface TextDocumentIdentifier {
58
+ uri: string;
59
+ }
60
+ export interface VersionedTextDocumentIdentifier extends TextDocumentIdentifier {
61
+ version: number | null;
62
+ }
63
+ export interface TextEdit {
64
+ range: Range;
65
+ newText: string;
66
+ }
67
+ export interface TextDocumentEdit {
68
+ textDocument: VersionedTextDocumentIdentifier;
69
+ edits: TextEdit[];
70
+ }
71
+ export interface CreateFile {
72
+ kind: "create";
73
+ uri: string;
74
+ options?: {
75
+ overwrite?: boolean;
76
+ ignoreIfExists?: boolean;
77
+ };
78
+ }
79
+ export interface RenameFile {
80
+ kind: "rename";
81
+ oldUri: string;
82
+ newUri: string;
83
+ options?: {
84
+ overwrite?: boolean;
85
+ ignoreIfExists?: boolean;
86
+ };
87
+ }
88
+ export interface DeleteFile {
89
+ kind: "delete";
90
+ uri: string;
91
+ options?: {
92
+ recursive?: boolean;
93
+ ignoreIfNotExists?: boolean;
94
+ };
95
+ }
96
+ export interface WorkspaceEdit {
97
+ changes?: {
98
+ [uri: string]: TextEdit[];
99
+ };
100
+ documentChanges?: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[];
101
+ }
102
+ export interface PrepareRenameResult {
103
+ range: Range;
104
+ placeholder?: string;
105
+ }
106
+ export interface PrepareRenameDefaultBehavior {
107
+ defaultBehavior: boolean;
108
+ }
109
+ export interface Command {
110
+ title: string;
111
+ command: string;
112
+ arguments?: unknown[];
113
+ }
114
+ export interface CodeActionContext {
115
+ diagnostics: Diagnostic[];
116
+ only?: string[];
117
+ triggerKind?: CodeActionTriggerKind;
118
+ }
119
+ export type CodeActionTriggerKind = 1 | 2;
120
+ export interface CodeAction {
121
+ title: string;
122
+ kind?: string;
123
+ diagnostics?: Diagnostic[];
124
+ isPreferred?: boolean;
125
+ disabled?: {
126
+ reason: string;
127
+ };
128
+ edit?: WorkspaceEdit;
129
+ command?: Command;
130
+ data?: unknown;
131
+ }
@@ -0,0 +1,25 @@
1
+ import { LSPClient } from "./client";
2
+ import type { HoverResult, DocumentSymbol, SymbolInfo, Location, LocationLink, Diagnostic, PrepareRenameResult, PrepareRenameDefaultBehavior, WorkspaceEdit, TextEdit, CodeAction, Command } from "./types";
3
+ export declare function findWorkspaceRoot(filePath: string): string;
4
+ export declare function withLspClient<T>(filePath: string, fn: (client: LSPClient) => Promise<T>): Promise<T>;
5
+ export declare function formatHoverResult(result: HoverResult | null): string;
6
+ export declare function formatLocation(loc: Location | LocationLink): string;
7
+ export declare function formatSymbolKind(kind: number): string;
8
+ export declare function formatSeverity(severity: number | undefined): string;
9
+ export declare function formatDocumentSymbol(symbol: DocumentSymbol, indent?: number): string;
10
+ export declare function formatSymbolInfo(symbol: SymbolInfo): string;
11
+ export declare function formatDiagnostic(diag: Diagnostic): string;
12
+ export declare function filterDiagnosticsBySeverity(diagnostics: Diagnostic[], severityFilter?: "error" | "warning" | "information" | "hint" | "all"): Diagnostic[];
13
+ export declare function formatPrepareRenameResult(result: PrepareRenameResult | PrepareRenameDefaultBehavior | null): string;
14
+ export declare function formatTextEdit(edit: TextEdit): string;
15
+ export declare function formatWorkspaceEdit(edit: WorkspaceEdit | null): string;
16
+ export declare function formatCodeAction(action: CodeAction): string;
17
+ export declare function formatCodeActions(actions: (CodeAction | Command)[] | null): string;
18
+ export interface ApplyResult {
19
+ success: boolean;
20
+ filesModified: string[];
21
+ totalEdits: number;
22
+ errors: string[];
23
+ }
24
+ export declare function applyWorkspaceEdit(edit: WorkspaceEdit | null): ApplyResult;
25
+ export declare function formatApplyResult(result: ApplyResult): string;
@@ -0,0 +1,3 @@
1
+ import type { GrepOptions, GrepResult, CountResult } from "./types";
2
+ export declare function runRg(options: GrepOptions): Promise<GrepResult>;
3
+ export declare function runRgCount(options: Omit<GrepOptions, "context">): Promise<CountResult[]>;
@@ -0,0 +1,16 @@
1
+ export type GrepBackend = "rg" | "grep";
2
+ interface ResolvedCli {
3
+ path: string;
4
+ backend: GrepBackend;
5
+ }
6
+ export declare function resolveGrepCli(): ResolvedCli;
7
+ export declare const DEFAULT_MAX_DEPTH = 20;
8
+ export declare const DEFAULT_MAX_FILESIZE = "10M";
9
+ export declare const DEFAULT_MAX_COUNT = 500;
10
+ export declare const DEFAULT_MAX_COLUMNS = 1000;
11
+ export declare const DEFAULT_CONTEXT = 2;
12
+ export declare const DEFAULT_TIMEOUT_MS = 300000;
13
+ export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
14
+ export declare const RG_SAFETY_FLAGS: readonly ["--no-follow", "--color=never", "--no-heading", "--line-number", "--with-filename"];
15
+ export declare const GREP_SAFETY_FLAGS: readonly ["-n", "-H", "--color=never"];
16
+ export {};
@@ -0,0 +1,2 @@
1
+ import { safe_grep } from "./tools";
2
+ export { safe_grep };
@@ -0,0 +1,13 @@
1
+ export declare const safe_grep: {
2
+ description: string;
3
+ args: {
4
+ pattern: import("zod").ZodString;
5
+ include: import("zod").ZodOptional<import("zod").ZodString>;
6
+ path: import("zod").ZodOptional<import("zod").ZodString>;
7
+ };
8
+ execute(args: {
9
+ pattern: string;
10
+ include?: string | undefined;
11
+ path?: string | undefined;
12
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
13
+ };
@@ -0,0 +1,36 @@
1
+ export interface GrepMatch {
2
+ file: string;
3
+ line: number;
4
+ column?: number;
5
+ text: string;
6
+ }
7
+ export interface GrepResult {
8
+ matches: GrepMatch[];
9
+ totalMatches: number;
10
+ filesSearched: number;
11
+ truncated: boolean;
12
+ error?: string;
13
+ }
14
+ export interface GrepOptions {
15
+ pattern: string;
16
+ paths?: string[];
17
+ globs?: string[];
18
+ excludeGlobs?: string[];
19
+ context?: number;
20
+ maxDepth?: number;
21
+ maxFilesize?: string;
22
+ maxCount?: number;
23
+ maxColumns?: number;
24
+ caseSensitive?: boolean;
25
+ wholeWord?: boolean;
26
+ fixedStrings?: boolean;
27
+ multiline?: boolean;
28
+ hidden?: boolean;
29
+ noIgnore?: boolean;
30
+ fileType?: string[];
31
+ timeout?: number;
32
+ }
33
+ export interface CountResult {
34
+ file: string;
35
+ count: number;
36
+ }
@@ -0,0 +1,3 @@
1
+ import type { GrepResult, CountResult } from "./types";
2
+ export declare function formatGrepResult(result: GrepResult): string;
3
+ export declare function formatCountResult(results: CountResult[]): string;
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "oh-my-opencode",
3
+ "version": "0.1.0",
4
+ "description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly",
19
+ "clean": "rm -rf dist",
20
+ "prepublishOnly": "bun run clean && bun run build",
21
+ "typecheck": "tsc --noEmit"
22
+ },
23
+ "keywords": [
24
+ "opencode",
25
+ "plugin",
26
+ "oracle",
27
+ "librarian",
28
+ "agents",
29
+ "ai",
30
+ "llm"
31
+ ],
32
+ "author": "YeonGyu-Kim",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/code-yeongyu/oh-my-opencode.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/code-yeongyu/oh-my-opencode/issues"
40
+ },
41
+ "homepage": "https://github.com/code-yeongyu/oh-my-opencode#readme",
42
+ "dependencies": {
43
+ "@ast-grep/napi": "^0.40.0",
44
+ "@opencode-ai/plugin": "^1.0.7"
45
+ },
46
+ "devDependencies": {
47
+ "bun-types": "latest",
48
+ "typescript": "^5.7.3"
49
+ },
50
+ "peerDependencies": {
51
+ "bun": ">=1.0.0"
52
+ }
53
+ }