refactor(hooks): drop no-op directory injector callbacks
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user