chore: include pre-built dist for github install

This commit is contained in:
Robin Mordasiewicz
2026-03-14 04:56:50 +00:00
parent a7f0a4cf46
commit bce8ff3a75
1011 changed files with 150081 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import type { PendingCall } from "./types";
export declare function initializeCommentCheckerCli(debugLog: (...args: unknown[]) => void): void;
export declare function getCommentCheckerCliPathPromise(): Promise<string | null> | null;
export declare function processWithCli(input: {
tool: string;
sessionID: string;
callID: string;
}, pendingCall: PendingCall, output: {
output: string;
}, cliPath: string, customPrompt: string | undefined, debugLog: (...args: unknown[]) => void): Promise<void>;
export interface ApplyPatchEdit {
filePath: string;
before: string;
after: string;
}
export declare function processApplyPatchEditsWithCli(sessionID: string, edits: ApplyPatchEdit[], output: {
output: string;
}, cliPath: string, customPrompt: string | undefined, debugLog: (...args: unknown[]) => void): Promise<void>;
export declare function isCliPathUsable(cliPath: string | null): cliPath is string;
+52
View File
@@ -0,0 +1,52 @@
/**
* Asynchronously get comment-checker binary path.
* Will trigger lazy download if binary not found.
*/
export declare function getCommentCheckerPath(): Promise<string | null>;
/**
* Synchronously get comment-checker path (no download).
* Returns cached path or searches known locations.
*/
export declare function getCommentCheckerPathSync(): string | null;
/**
* Start background initialization.
* Call this early to trigger download while other init happens.
*/
export declare function startBackgroundInit(): void;
export interface HookInput {
session_id: string;
tool_name: string;
transcript_path: string;
cwd: string;
hook_event_name: string;
tool_input: {
file_path?: string;
content?: string;
old_string?: string;
new_string?: string;
edits?: Array<{
old_string: string;
new_string: string;
}>;
};
tool_response?: unknown;
}
export interface CheckResult {
hasComments: boolean;
message: string;
}
/**
* Run comment-checker CLI with given input.
* @param input Hook input to check
* @param cliPath Optional explicit path to CLI binary
* @param customPrompt Optional custom prompt to replace default warning message
*/
export declare function runCommentChecker(input: HookInput, cliPath?: string, customPrompt?: string): Promise<CheckResult>;
/**
* Check if CLI is available (sync check, no download).
*/
export declare function isCliAvailable(): boolean;
/**
* Check if CLI will be available (async, may trigger download).
*/
export declare function ensureCliAvailable(): Promise<boolean>;
+25
View File
@@ -0,0 +1,25 @@
/**
* Get the cache directory for oh-my-opencode binaries.
* On Windows: Uses %LOCALAPPDATA% or %APPDATA% (Windows conventions)
* On Unix: Follows XDG Base Directory Specification
*/
export declare function getCacheDir(): string;
/**
* Get the binary name based on platform.
*/
export declare function getBinaryName(): string;
/**
* Get the cached binary path if it exists.
*/
export declare function getCachedBinaryPath(): string | null;
/**
* Download the comment-checker binary from GitHub Releases.
* Returns the path to the downloaded binary, or null on failure.
*/
export declare function downloadCommentChecker(): Promise<string | null>;
/**
* Ensure the comment-checker binary is available.
* First checks cache, then downloads if needed.
* Returns the binary path or null if unavailable.
*/
export declare function ensureCommentCheckerBinary(): Promise<string | null>;
+19
View File
@@ -0,0 +1,19 @@
import type { CommentCheckerConfig } from "../../config/schema";
export declare function createCommentCheckerHooks(config?: CommentCheckerConfig): {
"tool.execute.before": (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
args: Record<string, unknown>;
}) => Promise<void>;
"tool.execute.after": (input: {
tool: string;
sessionID: string;
callID: string;
}, output: {
title: string;
output: string;
metadata: unknown;
}) => Promise<void>;
};
+1
View File
@@ -0,0 +1 @@
export { createCommentCheckerHooks } from "./hook";
+4
View File
@@ -0,0 +1,4 @@
import type { PendingCall } from "./types";
export declare function startPendingCallCleanup(): void;
export declare function registerPendingCall(callID: string, pendingCall: PendingCall): void;
export declare function takePendingCall(callID: string): PendingCall | undefined;
+31
View File
@@ -0,0 +1,31 @@
export type CommentType = "line" | "block" | "docstring";
export interface CommentInfo {
text: string;
lineNumber: number;
filePath: string;
commentType: CommentType;
isDocstring: boolean;
metadata?: Record<string, string>;
}
export interface PendingCall {
filePath: string;
content?: string;
oldString?: string;
newString?: string;
edits?: Array<{
old_string: string;
new_string: string;
}>;
tool: "write" | "edit" | "multiedit";
sessionID: string;
timestamp: number;
}
export interface FileComments {
filePath: string;
comments: CommentInfo[];
}
export interface FilterResult {
shouldSkip: boolean;
reason?: string;
}
export type CommentFilter = (comment: CommentInfo) => FilterResult;