From 662015b71d7b990ef23f9bf9a0f9a620fd135f50 Mon Sep 17 00:00:00 2001 From: ZacharyZhang Date: Sun, 1 Mar 2026 20:09:01 -0500 Subject: [PATCH] Remove old kiro.ts (split into kirocli.ts and kiroide.ts) Co-Authored-By: Claude Opus 4.6 --- src/plugins/kiro.ts | 84 --------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 src/plugins/kiro.ts diff --git a/src/plugins/kiro.ts b/src/plugins/kiro.ts deleted file mode 100644 index e14579a..0000000 --- a/src/plugins/kiro.ts +++ /dev/null @@ -1,84 +0,0 @@ -import fsp from 'node:fs/promises'; -import path from 'node:path'; -import os from 'node:os'; -import type { AgentPlugin, InstallConfig, PluginStatus } from './base.js'; -import { SUPPORTED_AGENTS } from './registry.js'; - -const AGENT_KEY = 'kiro'; -const entry = SUPPORTED_AGENTS.get(AGENT_KEY)!; - -function resolveConfigDir(): string { - // .kiro/hooks is project-relative, but for global install use home dir - return path.join(os.homedir(), entry.configDir); -} - -function resolveConfigPath(): string { - return path.join(resolveConfigDir(), entry.configFile); -} - -export const kiroPlugin: AgentPlugin = { - async install(config: InstallConfig): Promise { - const configDir = resolveConfigDir(); - await fsp.mkdir(configDir, { recursive: true }); - - const configPath = resolveConfigPath(); - - const hookConfig = { - name: 'Elydora Audit', - description: 'Sends tool-use events to the Elydora tamper-evident audit platform', - version: '1.0.0', - hooks: { - pre_tool_use: { - command: `node "${config.guardScriptPath}"`, - timeout_ms: 5000, - }, - post_tool_use: { - command: `node "${config.hookScriptPath}"`, - timeout_ms: 5000, - }, - }, - }; - - await fsp.writeFile(configPath, JSON.stringify(hookConfig, null, 2) + '\n', 'utf-8'); - }, - - async uninstall(): Promise { - const configPath = resolveConfigPath(); - try { - await fsp.unlink(configPath); - } catch { - // Already removed - } - }, - - async status(): Promise { - const configPath = resolveConfigPath(); - const hookScriptPath = path.join(os.homedir(), '.elydora', 'hooks', `${AGENT_KEY}-hook.js`); - - let hookConfigured = false; - try { - const raw = await fsp.readFile(configPath, 'utf-8'); - const config = JSON.parse(raw); - hookConfigured = !!(config.hooks && config.hooks.pre_tool_use && config.hooks.post_tool_use); - } catch { - // Config not readable - } - - let hookScriptExists = false; - try { - await fsp.access(hookScriptPath); - hookScriptExists = true; - } catch { - // File doesn't exist - } - - return { - installed: hookConfigured && hookScriptExists, - agentName: AGENT_KEY, - displayName: entry.name, - hookConfigured, - hookScriptExists, - configPath, - }; - }, -};