@wolfx/oh-my-openagent 3.17.4-beta.2 → 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.
- package/dist/config/schema/comment-checker.d.ts +5 -0
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +3 -0
- package/dist/config/schema.d.ts +1 -0
- package/dist/create-hooks.d.ts +2 -0
- package/dist/hooks/comment-checker/cli-runner.d.ts +22 -0
- package/dist/hooks/comment-checker/cli.d.ts +52 -0
- package/dist/hooks/comment-checker/downloader.d.ts +25 -0
- package/dist/hooks/comment-checker/hook.d.ts +20 -0
- package/dist/hooks/comment-checker/index.d.ts +1 -0
- package/dist/hooks/comment-checker/pending-calls.d.ts +5 -0
- package/dist/hooks/comment-checker/types.d.ts +31 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
- package/dist/index.js +25909 -24791
- package/dist/oh-my-opencode.schema.json +9 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/plugin/tool-registry.d.ts +2 -1
- package/dist/tools/ast-grep/cli-binary-path-resolution.d.ts +5 -0
- package/dist/tools/ast-grep/cli.d.ts +12 -0
- package/dist/tools/ast-grep/constants.d.ts +5 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/environment-check.d.ts +20 -0
- package/dist/tools/ast-grep/index.d.ts +5 -0
- package/dist/tools/ast-grep/language-support.d.ts +6 -0
- package/dist/tools/ast-grep/process-output-timeout.d.ts +12 -0
- package/dist/tools/ast-grep/result-formatter.d.ts +5 -0
- package/dist/tools/ast-grep/sg-cli-path.d.ts +3 -0
- package/dist/tools/ast-grep/sg-compact-json-output.d.ts +2 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +58 -0
- package/dist/tools/index.d.ts +1 -0
- package/package.json +82 -74
|
@@ -7,6 +7,7 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
7
7
|
"context-window-monitor": "context-window-monitor";
|
|
8
8
|
"session-recovery": "session-recovery";
|
|
9
9
|
"session-notification": "session-notification";
|
|
10
|
+
"comment-checker": "comment-checker";
|
|
10
11
|
"tool-output-truncator": "tool-output-truncator";
|
|
11
12
|
"question-label-truncator": "question-label-truncator";
|
|
12
13
|
"directory-agents-injector": "directory-agents-injector";
|
|
@@ -1917,6 +1917,9 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1917
1917
|
replace_plan: z.ZodOptional<z.ZodBoolean>;
|
|
1918
1918
|
tdd: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1919
1919
|
}, z.core.$strip>>;
|
|
1920
|
+
comment_checker: z.ZodOptional<z.ZodObject<{
|
|
1921
|
+
custom_prompt: z.ZodOptional<z.ZodString>;
|
|
1922
|
+
}, z.core.$strip>>;
|
|
1920
1923
|
experimental: z.ZodOptional<z.ZodObject<{
|
|
1921
1924
|
aggressive_truncation: z.ZodOptional<z.ZodBoolean>;
|
|
1922
1925
|
auto_resume: z.ZodOptional<z.ZodBoolean>;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./schema/background-task";
|
|
|
5
5
|
export * from "./schema/browser-automation";
|
|
6
6
|
export * from "./schema/categories";
|
|
7
7
|
export * from "./schema/claude-code";
|
|
8
|
+
export * from "./schema/comment-checker";
|
|
8
9
|
export * from "./schema/commands";
|
|
9
10
|
export * from "./schema/dynamic-context-pruning";
|
|
10
11
|
export * from "./schema/experimental";
|
package/dist/create-hooks.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ type DisposableHook = {
|
|
|
10
10
|
} | null | undefined;
|
|
11
11
|
export type DisposableCreatedHooks = {
|
|
12
12
|
claudeCodeHooks?: DisposableHook;
|
|
13
|
+
commentChecker?: DisposableHook;
|
|
13
14
|
runtimeFallback?: DisposableHook;
|
|
14
15
|
todoContinuationEnforcer?: DisposableHook;
|
|
15
16
|
autoSlashCommand?: DisposableHook;
|
|
@@ -41,6 +42,7 @@ export declare function createHooks(args: {
|
|
|
41
42
|
contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
42
43
|
thinkingBlockValidator: ReturnType<typeof import("./hooks").createThinkingBlockValidatorHook> | null;
|
|
43
44
|
toolPairValidator: ReturnType<typeof import("./hooks").createToolPairValidatorHook> | null;
|
|
45
|
+
commentChecker: ReturnType<typeof import("./hooks").createCommentCheckerHooks> | null;
|
|
44
46
|
toolOutputTruncator: ReturnType<typeof import("./hooks").createToolOutputTruncatorHook> | null;
|
|
45
47
|
directoryAgentsInjector: ReturnType<typeof import("./hooks").createDirectoryAgentsInjectorHook> | null;
|
|
46
48
|
directoryReadmeInjector: ReturnType<typeof import("./hooks").createDirectoryReadmeInjectorHook> | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PendingCall } from "./types";
|
|
2
|
+
import { runCommentChecker } from "./cli";
|
|
3
|
+
export declare function initializeCommentCheckerCli(debugLog: (...args: unknown[]) => void): void;
|
|
4
|
+
export declare function getCommentCheckerCliPathPromise(): Promise<string | null> | null;
|
|
5
|
+
export declare function processWithCli(input: {
|
|
6
|
+
tool: string;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
callID: string;
|
|
9
|
+
}, pendingCall: PendingCall, output: {
|
|
10
|
+
output: string;
|
|
11
|
+
}, cliPath: string, customPrompt: string | undefined, debugLog: (...args: unknown[]) => void, deps?: {
|
|
12
|
+
runCommentChecker?: typeof runCommentChecker;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
export interface ApplyPatchEdit {
|
|
15
|
+
filePath: string;
|
|
16
|
+
before: string;
|
|
17
|
+
after: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function processApplyPatchEditsWithCli(sessionID: string, edits: ApplyPatchEdit[], output: {
|
|
20
|
+
output: string;
|
|
21
|
+
}, cliPath: string, customPrompt: string | undefined, debugLog: (...args: unknown[]) => void): Promise<void>;
|
|
22
|
+
export declare function isCliPathUsable(cliPath: string | null): cliPath is string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asynchronously get comment-checker binary path.
|
|
3
|
+
* Will trigger lazy download if binary not found.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getCommentCheckerPath(): Promise<string | null>;
|
|
6
|
+
/**
|
|
7
|
+
* Synchronously get comment-checker path (no download).
|
|
8
|
+
* Returns cached path or searches known locations.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCommentCheckerPathSync(): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Start background initialization.
|
|
13
|
+
* Call this early to trigger download while other init happens.
|
|
14
|
+
*/
|
|
15
|
+
export declare function startBackgroundInit(): void;
|
|
16
|
+
export interface HookInput {
|
|
17
|
+
session_id: string;
|
|
18
|
+
tool_name: string;
|
|
19
|
+
transcript_path: string;
|
|
20
|
+
cwd: string;
|
|
21
|
+
hook_event_name: string;
|
|
22
|
+
tool_input: {
|
|
23
|
+
file_path?: string;
|
|
24
|
+
content?: string;
|
|
25
|
+
old_string?: string;
|
|
26
|
+
new_string?: string;
|
|
27
|
+
edits?: Array<{
|
|
28
|
+
old_string: string;
|
|
29
|
+
new_string: string;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
tool_response?: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface CheckResult {
|
|
35
|
+
hasComments: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Run comment-checker CLI with given input.
|
|
40
|
+
* @param input Hook input to check
|
|
41
|
+
* @param cliPath Optional explicit path to CLI binary
|
|
42
|
+
* @param customPrompt Optional custom prompt to replace default warning message
|
|
43
|
+
*/
|
|
44
|
+
export declare function runCommentChecker(input: HookInput, cliPath?: string, customPrompt?: string): Promise<CheckResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Check if CLI is available (sync check, no download).
|
|
47
|
+
*/
|
|
48
|
+
export declare function isCliAvailable(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Check if CLI will be available (async, may trigger download).
|
|
51
|
+
*/
|
|
52
|
+
export declare function ensureCliAvailable(): Promise<boolean>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the cache directory for oh-my-opencode binaries.
|
|
3
|
+
* On Windows: Uses %LOCALAPPDATA% or %APPDATA% (Windows conventions)
|
|
4
|
+
* On Unix: Follows XDG Base Directory Specification
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCacheDir(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Get the binary name based on platform.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getBinaryName(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Get the cached binary path if it exists.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCachedBinaryPath(): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Download the comment-checker binary from GitHub Releases.
|
|
17
|
+
* Returns the path to the downloaded binary, or null on failure.
|
|
18
|
+
*/
|
|
19
|
+
export declare function downloadCommentChecker(): Promise<string | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Ensure the comment-checker binary is available.
|
|
22
|
+
* First checks cache, then downloads if needed.
|
|
23
|
+
* Returns the binary path or null if unavailable.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ensureCommentCheckerBinary(): Promise<string | null>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CommentCheckerConfig } from "../../config/schema";
|
|
2
|
+
export declare function createCommentCheckerHooks(config?: CommentCheckerConfig): {
|
|
3
|
+
"tool.execute.before": (input: {
|
|
4
|
+
tool: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
callID: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
args: Record<string, unknown>;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
"tool.execute.after": (input: {
|
|
11
|
+
tool: string;
|
|
12
|
+
sessionID: string;
|
|
13
|
+
callID: string;
|
|
14
|
+
}, output: {
|
|
15
|
+
title: string;
|
|
16
|
+
output: string;
|
|
17
|
+
metadata: unknown;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
dispose: () => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCommentCheckerHooks } from "./hook";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PendingCall } from "./types";
|
|
2
|
+
export declare function startPendingCallCleanup(): void;
|
|
3
|
+
export declare function stopPendingCallCleanup(): void;
|
|
4
|
+
export declare function registerPendingCall(callID: string, pendingCall: PendingCall): void;
|
|
5
|
+
export declare function takePendingCall(callID: string): PendingCall | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type CommentType = "line" | "block" | "docstring";
|
|
2
|
+
export interface CommentInfo {
|
|
3
|
+
text: string;
|
|
4
|
+
lineNumber: number;
|
|
5
|
+
filePath: string;
|
|
6
|
+
commentType: CommentType;
|
|
7
|
+
isDocstring: boolean;
|
|
8
|
+
metadata?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export interface PendingCall {
|
|
11
|
+
filePath: string;
|
|
12
|
+
content?: string;
|
|
13
|
+
oldString?: string;
|
|
14
|
+
newString?: string;
|
|
15
|
+
edits?: Array<{
|
|
16
|
+
old_string: string;
|
|
17
|
+
new_string: string;
|
|
18
|
+
}>;
|
|
19
|
+
tool: "write" | "edit" | "multiedit";
|
|
20
|
+
sessionID: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
}
|
|
23
|
+
export interface FileComments {
|
|
24
|
+
filePath: string;
|
|
25
|
+
comments: CommentInfo[];
|
|
26
|
+
}
|
|
27
|
+
export interface FilterResult {
|
|
28
|
+
shouldSkip: boolean;
|
|
29
|
+
reason?: string;
|
|
30
|
+
}
|
|
31
|
+
export type CommentFilter = (comment: CommentInfo) => FilterResult;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { buildWindowsToastScript, escapeAppleScriptText, escapePowerShellSingleQ
|
|
|
6
6
|
export { hasIncompleteTodos } from "./session-todo-status";
|
|
7
7
|
export { createIdleNotificationScheduler } from "./session-notification-scheduler";
|
|
8
8
|
export { createSessionRecoveryHook, type SessionRecoveryHook, type SessionRecoveryOptions } from "./session-recovery";
|
|
9
|
+
export { createCommentCheckerHooks } from "./comment-checker";
|
|
9
10
|
export { createToolOutputTruncatorHook } from "./tool-output-truncator";
|
|
10
11
|
export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector";
|
|
11
12
|
export { createDirectoryReadmeInjectorHook } from "./directory-readme-injector";
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* - Vietnamese: tìm kiếm, tra cứu, định vị, quét, phát hiện, truy tìm, tìm ra, ở đâu, liệt kê
|
|
10
10
|
*/
|
|
11
11
|
export declare const SEARCH_PATTERN: RegExp;
|
|
12
|
-
export declare const SEARCH_MESSAGE = "[search-mode]\nMAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:\n- explore agents (codebase patterns, file structures)\n- librarian agents (remote repos, official docs, GitHub examples)\nPlus direct tools: Grep, ripgrep (rg)\nNEVER stop at first result - be exhaustive.";
|
|
12
|
+
export declare const SEARCH_MESSAGE = "[search-mode]\nMAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:\n- explore agents (codebase patterns, file structures, ast-grep)\n- librarian agents (remote repos, official docs, GitHub examples)\nPlus direct tools: Grep, ripgrep (rg), ast-grep (sg)\nNEVER stop at first result - be exhaustive.";
|