@wolfx/oh-my-openagent 3.17.4-beta.1 → 3.17.4-beta.3

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 (34) hide show
  1. package/dist/config/schema/comment-checker.d.ts +5 -0
  2. package/dist/config/schema/hooks.d.ts +1 -0
  3. package/dist/config/schema/oh-my-opencode-config.d.ts +3 -0
  4. package/dist/config/schema.d.ts +1 -0
  5. package/dist/create-hooks.d.ts +2 -0
  6. package/dist/hooks/comment-checker/cli-runner.d.ts +22 -0
  7. package/dist/hooks/comment-checker/cli.d.ts +52 -0
  8. package/dist/hooks/comment-checker/downloader.d.ts +25 -0
  9. package/dist/hooks/comment-checker/hook.d.ts +20 -0
  10. package/dist/hooks/comment-checker/index.d.ts +1 -0
  11. package/dist/hooks/comment-checker/pending-calls.d.ts +5 -0
  12. package/dist/hooks/comment-checker/types.d.ts +31 -0
  13. package/dist/hooks/index.d.ts +1 -0
  14. package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
  15. package/dist/index.js +25909 -24793
  16. package/dist/oh-my-opencode.schema.json +9 -0
  17. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  18. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  19. package/dist/plugin/tool-registry.d.ts +2 -1
  20. package/dist/tools/ast-grep/cli-binary-path-resolution.d.ts +5 -0
  21. package/dist/tools/ast-grep/cli.d.ts +12 -0
  22. package/dist/tools/ast-grep/constants.d.ts +5 -0
  23. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  24. package/dist/tools/ast-grep/environment-check.d.ts +20 -0
  25. package/dist/tools/ast-grep/index.d.ts +5 -0
  26. package/dist/tools/ast-grep/language-support.d.ts +6 -0
  27. package/dist/tools/ast-grep/process-output-timeout.d.ts +12 -0
  28. package/dist/tools/ast-grep/result-formatter.d.ts +5 -0
  29. package/dist/tools/ast-grep/sg-cli-path.d.ts +3 -0
  30. package/dist/tools/ast-grep/sg-compact-json-output.d.ts +2 -0
  31. package/dist/tools/ast-grep/tools.d.ts +3 -0
  32. package/dist/tools/ast-grep/types.d.ts +58 -0
  33. package/dist/tools/index.d.ts +1 -0
  34. package/package.json +82 -74
@@ -5290,6 +5290,15 @@
5290
5290
  },
5291
5291
  "additionalProperties": false
5292
5292
  },
5293
+ "comment_checker": {
5294
+ "type": "object",
5295
+ "properties": {
5296
+ "custom_prompt": {
5297
+ "type": "string"
5298
+ }
5299
+ },
5300
+ "additionalProperties": false
5301
+ },
5293
5302
  "experimental": {
5294
5303
  "type": "object",
5295
5304
  "properties": {
@@ -13,6 +13,7 @@ export declare function createCoreHooks(args: {
13
13
  contextInjectorMessagesTransform: ReturnType<typeof import("../../features/context-injector").createContextInjectorMessagesTransformHook>;
14
14
  thinkingBlockValidator: ReturnType<typeof import("../../hooks").createThinkingBlockValidatorHook> | null;
15
15
  toolPairValidator: ReturnType<typeof import("../../hooks").createToolPairValidatorHook> | null;
16
+ commentChecker: ReturnType<typeof import("../../hooks").createCommentCheckerHooks> | null;
16
17
  toolOutputTruncator: ReturnType<typeof import("../../hooks").createToolOutputTruncatorHook> | null;
17
18
  directoryAgentsInjector: ReturnType<typeof import("../../hooks").createDirectoryAgentsInjectorHook> | null;
18
19
  directoryReadmeInjector: ReturnType<typeof import("../../hooks").createDirectoryReadmeInjectorHook> | null;
@@ -1,8 +1,9 @@
1
1
  import type { HookName, OhMyOpenCodeConfig } from "../../config";
2
2
  import type { ModelCacheState } from "../../plugin-state";
3
3
  import type { PluginContext } from "../types";
4
- import { createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createBashFileReadGuardHook, createHashlineReadEnhancerHook, createReadImageResizerHook, createJsonErrorRecoveryHook, createTodoDescriptionOverrideHook, createWebFetchRedirectGuardHook } from "../../hooks";
4
+ import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createBashFileReadGuardHook, createHashlineReadEnhancerHook, createReadImageResizerHook, createJsonErrorRecoveryHook, createTodoDescriptionOverrideHook, createWebFetchRedirectGuardHook } from "../../hooks";
5
5
  export type ToolGuardHooks = {
6
+ commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
6
7
  toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
7
8
  directoryAgentsInjector: ReturnType<typeof createDirectoryAgentsInjectorHook> | null;
8
9
  directoryReadmeInjector: ReturnType<typeof createDirectoryReadmeInjectorHook> | null;
@@ -1,7 +1,7 @@
1
1
  import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder";
2
2
  import type { OhMyOpenCodeConfig } from "../config";
3
3
  import type { PluginContext, ToolsRecord } from "./types";
4
- import { builtinTools, createBackgroundTools, createCallOmoAgent, createLookAt, createSkillMcpTool, createSkillTool, createGrepTools, createGlobTools, createSessionManagerTools, createDelegateTask, discoverCommandsSync, interactive_bash, createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, createHashlineEditTool } from "../tools";
4
+ import { builtinTools, createBackgroundTools, createCallOmoAgent, createLookAt, createSkillMcpTool, createSkillTool, createGrepTools, createGlobTools, createAstGrepTools, createSessionManagerTools, createDelegateTask, discoverCommandsSync, interactive_bash, createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, createHashlineEditTool } from "../tools";
5
5
  import type { Managers } from "../create-managers";
6
6
  import type { SkillContext } from "./skill-context";
7
7
  type ToolRegistryFactories = {
@@ -13,6 +13,7 @@ type ToolRegistryFactories = {
13
13
  createSkillTool: typeof createSkillTool;
14
14
  createGrepTools: typeof createGrepTools;
15
15
  createGlobTools: typeof createGlobTools;
16
+ createAstGrepTools: typeof createAstGrepTools;
16
17
  createSessionManagerTools: typeof createSessionManagerTools;
17
18
  createDelegateTask: typeof createDelegateTask;
18
19
  discoverCommandsSync: typeof discoverCommandsSync;
@@ -0,0 +1,5 @@
1
+ export declare function getAstGrepPath(): Promise<string | null>;
2
+ export declare function startBackgroundInit(): void;
3
+ export declare function isCliAvailable(): boolean;
4
+ export declare function ensureCliAvailable(): Promise<boolean>;
5
+ export declare function getResolvedSgCliPath(): string | null;
@@ -0,0 +1,12 @@
1
+ import type { CliLanguage, SgResult } from "./types";
2
+ export { ensureCliAvailable, getAstGrepPath, isCliAvailable, startBackgroundInit, } from "./cli-binary-path-resolution";
3
+ export interface RunOptions {
4
+ pattern: string;
5
+ lang: CliLanguage;
6
+ paths?: string[];
7
+ globs?: string[];
8
+ rewrite?: string;
9
+ context?: number;
10
+ updateAll?: boolean;
11
+ }
12
+ export declare function runSg(options: RunOptions): Promise<SgResult>;
@@ -0,0 +1,5 @@
1
+ export type { EnvironmentCheckResult } from "./environment-check";
2
+ export { checkEnvironment, formatEnvironmentCheck } from "./environment-check";
3
+ export { CLI_LANGUAGES, NAPI_LANGUAGES, LANG_EXTENSIONS } from "./language-support";
4
+ export { DEFAULT_TIMEOUT_MS, DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_MAX_MATCHES } from "./language-support";
5
+ export { findSgCliPathSync, getSgCliPath, setSgCliPath } from "./sg-cli-path";
@@ -0,0 +1,5 @@
1
+ export declare function getCacheDir(): string;
2
+ export declare function getBinaryName(): string;
3
+ export declare function getCachedBinaryPath(): string | null;
4
+ export declare function downloadAstGrep(version?: string): Promise<string | null>;
5
+ export declare function ensureAstGrepBinary(): Promise<string | null>;
@@ -0,0 +1,20 @@
1
+ export interface EnvironmentCheckResult {
2
+ cli: {
3
+ available: boolean;
4
+ path: string;
5
+ error?: string;
6
+ };
7
+ napi: {
8
+ available: boolean;
9
+ error?: string;
10
+ };
11
+ }
12
+ /**
13
+ * Check if ast-grep CLI and NAPI are available.
14
+ * Call this at startup to provide early feedback about missing dependencies.
15
+ */
16
+ export declare function checkEnvironment(): EnvironmentCheckResult;
17
+ /**
18
+ * Format environment check result as user-friendly message.
19
+ */
20
+ export declare function formatEnvironmentCheck(result: EnvironmentCheckResult): string;
@@ -0,0 +1,5 @@
1
+ export { createAstGrepTools } from "./tools";
2
+ export { ensureAstGrepBinary, getCachedBinaryPath, getCacheDir } from "./downloader";
3
+ export { getAstGrepPath, isCliAvailable, ensureCliAvailable, startBackgroundInit } from "./cli";
4
+ export { checkEnvironment, formatEnvironmentCheck } from "./constants";
5
+ export type { EnvironmentCheckResult } from "./constants";
@@ -0,0 +1,6 @@
1
+ export declare const CLI_LANGUAGES: readonly ["bash", "c", "cpp", "csharp", "css", "elixir", "go", "haskell", "html", "java", "javascript", "json", "kotlin", "lua", "nix", "php", "python", "ruby", "rust", "scala", "solidity", "swift", "typescript", "tsx", "yaml"];
2
+ export declare const NAPI_LANGUAGES: readonly ["html", "javascript", "tsx", "css", "typescript"];
3
+ export declare const DEFAULT_TIMEOUT_MS = 300000;
4
+ export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
5
+ export declare const DEFAULT_MAX_MATCHES = 500;
6
+ export declare const LANG_EXTENSIONS: Record<string, string[]>;
@@ -0,0 +1,12 @@
1
+ type SpawnedProcess = {
2
+ stdout: ReadableStream | null;
3
+ stderr: ReadableStream | null;
4
+ exited: Promise<number>;
5
+ kill: () => void;
6
+ };
7
+ export declare function collectProcessOutputWithTimeout(process: SpawnedProcess, timeoutMs: number): Promise<{
8
+ stdout: string;
9
+ stderr: string;
10
+ exitCode: number;
11
+ }>;
12
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { AnalyzeResult, SgResult } from "./types";
2
+ export declare function formatSearchResult(result: SgResult): string;
3
+ export declare function formatReplaceResult(result: SgResult, isDryRun: boolean): string;
4
+ export declare function formatAnalyzeResult(results: AnalyzeResult[], extractedMetaVars: boolean): string;
5
+ export declare function formatTransformResult(_original: string, transformed: string, editCount: number): string;
@@ -0,0 +1,3 @@
1
+ export declare function findSgCliPathSync(): string | null;
2
+ export declare function getSgCliPath(): string | null;
3
+ export declare function setSgCliPath(path: string): void;
@@ -0,0 +1,2 @@
1
+ import type { SgResult } from "./types";
2
+ export declare function createSgResultFromStdout(stdout: string): SgResult;
@@ -0,0 +1,3 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import { type ToolDefinition } from "@opencode-ai/plugin/tool";
3
+ export declare function createAstGrepTools(ctx: PluginInput): Record<string, ToolDefinition>;
@@ -0,0 +1,58 @@
1
+ import type { CLI_LANGUAGES, NAPI_LANGUAGES } from "./constants";
2
+ export type CliLanguage = (typeof CLI_LANGUAGES)[number];
3
+ export type NapiLanguage = (typeof NAPI_LANGUAGES)[number];
4
+ export interface Position {
5
+ line: number;
6
+ column: number;
7
+ }
8
+ export interface Range {
9
+ start: Position;
10
+ end: Position;
11
+ }
12
+ export interface CliMatch {
13
+ text: string;
14
+ range: {
15
+ byteOffset: {
16
+ start: number;
17
+ end: number;
18
+ };
19
+ start: Position;
20
+ end: Position;
21
+ };
22
+ file: string;
23
+ lines: string;
24
+ charCount: {
25
+ leading: number;
26
+ trailing: number;
27
+ };
28
+ language: string;
29
+ }
30
+ export interface SearchMatch {
31
+ file: string;
32
+ text: string;
33
+ range: Range;
34
+ lines: string;
35
+ }
36
+ export interface MetaVariable {
37
+ name: string;
38
+ text: string;
39
+ kind: string;
40
+ }
41
+ export interface AnalyzeResult {
42
+ text: string;
43
+ range: Range;
44
+ kind: string;
45
+ metaVariables: MetaVariable[];
46
+ }
47
+ export interface TransformResult {
48
+ original: string;
49
+ transformed: string;
50
+ editCount: number;
51
+ }
52
+ export interface SgResult {
53
+ matches: CliMatch[];
54
+ totalMatches: number;
55
+ truncated: boolean;
56
+ truncatedReason?: "max_matches" | "max_output_bytes" | "timeout";
57
+ error?: string;
58
+ }
@@ -1,5 +1,6 @@
1
1
  import { lspManager } from "./lsp";
2
2
  export { lspManager };
3
+ export { createAstGrepTools } from "./ast-grep";
3
4
  export { createGrepTools } from "./grep";
4
5
  export { createGlobTools } from "./glob";
5
6
  export { createSkillTool } from "./skill";
package/package.json CHANGED
@@ -1,74 +1,82 @@
1
- {
2
- "name": "@wolfx/oh-my-openagent",
3
- "version": "3.17.4-beta.1",
4
- "description": "A fork of oh-my-openagent",
5
- "main": "./dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "type": "module",
8
- "files": [
9
- "dist"
10
- ],
11
- "publishConfig": {
12
- "access": "public",
13
- "registry": "https://registry.npmjs.org/"
14
- },
15
- "exports": {
16
- ".": {
17
- "types": "./dist/index.d.ts",
18
- "import": "./dist/index.js"
19
- },
20
- "./schema.json": "./dist/oh-my-opencode.schema.json"
21
- },
22
- "scripts": {
23
- "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun run build:schema",
24
- "build:schema": "bun run script/build-schema.ts",
25
- "build:model-capabilities": "bun run script/build-model-capabilities.ts",
26
- "clean": "rm -rf dist",
27
- "prepare": "bun run build",
28
- "prepublishOnly": "bun run clean && bun run build",
29
- "test:model-capabilities": "bun test src/shared/model-capability-aliases.test.ts src/shared/model-capability-guardrails.test.ts src/shared/model-capabilities.test.ts src/cli/doctor/checks/model-resolution.test.ts --bail",
30
- "typecheck": "tsc --noEmit",
31
- "test": "bun test"
32
- },
33
- "keywords": [
34
- "opencode",
35
- "plugin",
36
- "oracle",
37
- "librarian",
38
- "agents",
39
- "ai",
40
- "llm"
41
- ],
42
- "author": "YeonGyu-Kim",
43
- "license": "SUL-1.0",
44
- "repository": {
45
- "type": "git",
46
- "url": "git+https://github.com/code-yeongyu/oh-my-openagent.git"
47
- },
48
- "bugs": {
49
- "url": "https://github.com/code-yeongyu/oh-my-openagent/issues"
50
- },
51
- "homepage": "https://github.com/code-yeongyu/oh-my-openagent#readme",
52
- "dependencies": {
53
- "@clack/prompts": "^0.11.0",
54
- "@modelcontextprotocol/sdk": "^1.25.2",
55
- "@opencode-ai/plugin": "^1.4.0",
56
- "@opencode-ai/sdk": "^1.4.0",
57
- "commander": "^14.0.2",
58
- "diff": "^8.0.3",
59
- "js-yaml": "^4.1.1",
60
- "jsonc-parser": "^3.3.1",
61
- "picocolors": "^1.1.1",
62
- "picomatch": "^4.0.2",
63
- "posthog-node": "^5.29.2",
64
- "vscode-jsonrpc": "^8.2.0",
65
- "zod": "^4.3.0"
66
- },
67
- "devDependencies": {
68
- "@types/js-yaml": "^4.0.9",
69
- "@types/picomatch": "^3.0.2",
70
- "bun-types": "1.3.11",
71
- "typescript": "^5.7.3"
72
- },
73
- "overrides": {}
74
- }
1
+ {
2
+ "name": "@wolfx/oh-my-openagent",
3
+ "version": "3.17.4-beta.3",
4
+ "description": "A fork of oh-my-openagent",
5
+ "main": "./dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "publishConfig": {
12
+ "access": "public",
13
+ "registry": "https://registry.npmjs.org/"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./schema.json": "./dist/oh-my-opencode.schema.json"
21
+ },
22
+ "scripts": {
23
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun run build:schema",
24
+ "build:schema": "bun run script/build-schema.ts",
25
+ "build:model-capabilities": "bun run script/build-model-capabilities.ts",
26
+ "clean": "rm -rf dist",
27
+ "prepare": "bun run build",
28
+ "prepublishOnly": "bun run clean && bun run build",
29
+ "test:model-capabilities": "bun test src/shared/model-capability-aliases.test.ts src/shared/model-capability-guardrails.test.ts src/shared/model-capabilities.test.ts src/cli/doctor/checks/model-resolution.test.ts --bail",
30
+ "typecheck": "tsc --noEmit",
31
+ "test": "bun test"
32
+ },
33
+ "keywords": [
34
+ "opencode",
35
+ "plugin",
36
+ "oracle",
37
+ "librarian",
38
+ "agents",
39
+ "ai",
40
+ "llm"
41
+ ],
42
+ "author": "YeonGyu-Kim",
43
+ "license": "SUL-1.0",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/code-yeongyu/oh-my-openagent.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/code-yeongyu/oh-my-openagent/issues"
50
+ },
51
+ "homepage": "https://github.com/code-yeongyu/oh-my-openagent#readme",
52
+ "dependencies": {
53
+ "@ast-grep/cli": "^0.41.1",
54
+ "@ast-grep/napi": "^0.41.1",
55
+ "@clack/prompts": "^0.11.0",
56
+ "@wolfx/comment-checker": "^0.7.0",
57
+ "@modelcontextprotocol/sdk": "^1.25.2",
58
+ "@opencode-ai/plugin": "^1.4.0",
59
+ "@opencode-ai/sdk": "^1.4.0",
60
+ "commander": "^14.0.2",
61
+ "diff": "^8.0.3",
62
+ "js-yaml": "^4.1.1",
63
+ "jsonc-parser": "^3.3.1",
64
+ "picocolors": "^1.1.1",
65
+ "picomatch": "^4.0.2",
66
+ "posthog-node": "^5.29.2",
67
+ "vscode-jsonrpc": "^8.2.0",
68
+ "zod": "^4.3.0"
69
+ },
70
+ "devDependencies": {
71
+ "@types/js-yaml": "^4.0.9",
72
+ "@types/picomatch": "^3.0.2",
73
+ "bun-types": "1.3.11",
74
+ "typescript": "^5.7.3"
75
+ },
76
+ "overrides": {},
77
+ "trustedDependencies": [
78
+ "@ast-grep/cli",
79
+ "@ast-grep/napi",
80
+ "@wolfx/comment-checker"
81
+ ]
82
+ }