Merge pull request #1884 from code-yeongyu/feat/hashline-edit

feat: port hashline edit tool from oh-my-pi
This commit is contained in:
YeonGyu-Kim
2026-02-17 01:35:22 +09:00
committed by GitHub
31 changed files with 1655 additions and 31 deletions
@@ -10,6 +10,7 @@ import {
createRulesInjectorHook,
createTasksTodowriteDisablerHook,
createWriteExistingFileGuardHook,
createHashlineReadEnhancerHook,
} from "../../hooks"
import {
getOpenCodeVersion,
@@ -28,6 +29,7 @@ export type ToolGuardHooks = {
rulesInjector: ReturnType<typeof createRulesInjectorHook> | null
tasksTodowriteDisabler: ReturnType<typeof createTasksTodowriteDisablerHook> | null
writeExistingFileGuard: ReturnType<typeof createWriteExistingFileGuardHook> | null
hashlineReadEnhancer: ReturnType<typeof createHashlineReadEnhancerHook> | null
}
export function createToolGuardHooks(args: {
@@ -85,6 +87,10 @@ export function createToolGuardHooks(args: {
? safeHook("write-existing-file-guard", () => createWriteExistingFileGuardHook(ctx))
: null
const hashlineReadEnhancer = isHookEnabled("hashline-read-enhancer")
? safeHook("hashline-read-enhancer", () => createHashlineReadEnhancerHook(ctx, { hashline_edit: { enabled: pluginConfig.experimental?.hashline_edit ?? false } }))
: null
return {
commentChecker,
toolOutputTruncator,
@@ -94,5 +100,6 @@ export function createToolGuardHooks(args: {
rulesInjector,
tasksTodowriteDisabler,
writeExistingFileGuard,
hashlineReadEnhancer,
}
}
+1
View File
@@ -43,5 +43,6 @@ export function createToolExecuteAfterHandler(args: {
await hooks.delegateTaskRetry?.["tool.execute.after"]?.(input, output)
await hooks.atlasHook?.["tool.execute.after"]?.(input, output)
await hooks.taskResumeInfo?.["tool.execute.after"]?.(input, output)
await hooks.hashlineReadEnhancer?.["tool.execute.after"]?.(input, output)
}
}
-1
View File
@@ -29,7 +29,6 @@ export function createToolExecuteBeforeHandler(args: {
await hooks.prometheusMdOnly?.["tool.execute.before"]?.(input, output)
await hooks.sisyphusJuniorNotepad?.["tool.execute.before"]?.(input, output)
await hooks.atlasHook?.["tool.execute.before"]?.(input, output)
if (input.tool === "task") {
const argsObject = output.args
const category = typeof argsObject.category === "string" ? argsObject.category : undefined
+7
View File
@@ -25,6 +25,7 @@ import {
createTaskGetTool,
createTaskList,
createTaskUpdateTool,
createHashlineEditTool,
} from "../tools"
import { getMainSessionID } from "../features/claude-code-session-state"
import { filterDisabledTools } from "../shared/disabled-tools"
@@ -117,6 +118,11 @@ export function createToolRegistry(args: {
}
: {}
const hashlineEnabled = pluginConfig.experimental?.hashline_edit ?? false
const hashlineToolsRecord: Record<string, ToolDefinition> = hashlineEnabled
? { edit: createHashlineEditTool() }
: {}
const allTools: Record<string, ToolDefinition> = {
...builtinTools,
...createGrepTools(ctx),
@@ -132,6 +138,7 @@ export function createToolRegistry(args: {
slashcommand: slashcommandTool,
interactive_bash,
...taskToolsRecord,
...hashlineToolsRecord,
}
const filteredTools = filterDisabledTools(allTools, pluginConfig.disabled_tools)