Skip to content

Open-source, local-first AI agent for real work.

872 B
Raw Blame
import type { ConversationScenario } from "../profiles/index.js";
import type { CodingAgentRuntimeToolRegistration } from "../runtime-contracts/index.js";
import { createMemoryTool, type MemoryToolInput, type MemoryToolOptions } from "./memory-tool.js";

export const MEMORY_TOOL_SCOPES = ["im-claw"] as const satisfies readonly ConversationScenario[];
export const MEMORY_TOOL_CATEGORY = "memory" as const;

export interface MemoryToolRegistrationOptions extends MemoryToolOptions {
	readonly modelOrder?: number;
}

export function createMemoryToolRegistration(
	options: MemoryToolRegistrationOptions,
): CodingAgentRuntimeToolRegistration<MemoryToolInput> {
	const tool = createMemoryTool(options);
	return {
		tool: { ...tool, modelOrder: options.modelOrder },
		scopeUse: MEMORY_TOOL_SCOPES,
		modelOrder: options.modelOrder,
		category: MEMORY_TOOL_CATEGORY,
	};
}