Merge pull request #3348 from code-yeongyu/refactor/ulw-repo-cleanup-20260411

refactor: simplify nullish guards and remove dead no-op paths
This commit is contained in:
YeonGyu-Kim
2026-04-12 18:04:43 +09:00
committed by GitHub
15 changed files with 156 additions and 46 deletions
+5 -12
View File
@@ -16,8 +16,10 @@ interface ToolExecuteOutput {
metadata: unknown;
}
interface ToolExecuteBeforeOutput {
args: unknown;
interface DirectoryAgentsInjectorHook {
"tool.execute.before"?: (input: ToolExecuteInput, output: { args: unknown }) => Promise<void>;
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
event: (input: EventInput) => Promise<void>;
}
interface EventInput {
@@ -30,7 +32,7 @@ interface EventInput {
export function createDirectoryAgentsInjectorHook(
ctx: PluginInput,
modelCacheState?: { anthropicContext1MEnabled: boolean },
) {
): DirectoryAgentsInjectorHook {
const sessionCaches = new Map<string, Set<string>>();
const truncator = createDynamicTruncator(ctx, modelCacheState);
@@ -50,14 +52,6 @@ export function createDirectoryAgentsInjectorHook(
}
};
const toolExecuteBefore = async (
input: ToolExecuteInput,
output: ToolExecuteBeforeOutput,
): Promise<void> => {
void input;
void output;
};
const eventHandler = async ({ event }: EventInput) => {
const props = event.properties as Record<string, unknown> | undefined;
@@ -80,7 +74,6 @@ export function createDirectoryAgentsInjectorHook(
};
return {
"tool.execute.before": toolExecuteBefore,
"tool.execute.after": toolExecuteAfter,
event: eventHandler,
};
+5 -12
View File
@@ -16,8 +16,10 @@ interface ToolExecuteOutput {
metadata: unknown;
}
interface ToolExecuteBeforeOutput {
args: unknown;
interface DirectoryReadmeInjectorHook {
"tool.execute.before"?: (input: ToolExecuteInput, output: { args: unknown }) => Promise<void>;
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
event: (input: EventInput) => Promise<void>;
}
interface EventInput {
@@ -30,7 +32,7 @@ interface EventInput {
export function createDirectoryReadmeInjectorHook(
ctx: PluginInput,
modelCacheState?: { anthropicContext1MEnabled: boolean },
) {
): DirectoryReadmeInjectorHook {
const sessionCaches = new Map<string, Set<string>>();
const truncator = createDynamicTruncator(ctx, modelCacheState);
@@ -50,14 +52,6 @@ export function createDirectoryReadmeInjectorHook(
}
};
const toolExecuteBefore = async (
input: ToolExecuteInput,
output: ToolExecuteBeforeOutput,
): Promise<void> => {
void input;
void output;
};
const eventHandler = async ({ event }: EventInput) => {
const props = event.properties as Record<string, unknown> | undefined;
@@ -80,7 +74,6 @@ export function createDirectoryReadmeInjectorHook(
};
return {
"tool.execute.before": toolExecuteBefore,
"tool.execute.after": toolExecuteAfter,
event: eventHandler,
};