Skip to content

feat(kiro): add Kiro CLI harness for session capture and MCP install #364

Description

@sumitvairagar

Summary

Add a Kiro harness so sessions from Kiro CLI (kiro-cli) are captured into Hivemind shared memory, exactly like the existing Claude Code, Cursor, Codex, and Cowork harnesses.

Why Kiro

Kiro is an AI coding agent from AWS (free tier available). Its JSONL session format is already compatible with Hivemind's capture pipeline — no hooks or plugin API needed, just transcript tailing, the same approach the Cowork harness uses. It also installs MCP servers via a standard ~/.kiro/settings/mcp.json config file, so the Hivemind MCP server can be wired in with a single hivemind install kiro command.

I run Java/Spring workshops where attendees use kiro-cli. Hivemind would be a natural fit for shared team memory across those sessions, but there's no integration path today.

Technical approach

I've read the Cowork harness (src/mcp/cowork-ingest.ts) and the Kiro session format. They map cleanly:

Kiro JSONL format (~/.kiro/sessions/cli/<uuid>.jsonl):

{"version":"v1","kind":"Prompt","data":{"content":[{"kind":"text","data":"..."}]}}
{"version":"v1","kind":"AssistantMessage","data":{"content":[{"kind":"text","data":"..."},{"kind":"toolUse","data":{"toolUseId":"...","name":"...","input":{...}}}]}}
{"version":"v1","kind":"ToolResults","data":{"content":[{"kind":"toolResult","data":{"toolUseId":"...","content":[...]}}]}}

Mapping to Hivemind session rows:

Kiro kind Hivemind type
Prompt user_message (content from data.content[].data where kind=text)
AssistantMessage text blocks assistant_message
AssistantMessage toolUse blocks tool_call (tool_name, tool_use_id, tool_input)
ToolResults toolResult blocks tool_result (tool_use_id, tool_response)

MCP installation path — Kiro reads ~/.kiro/settings/mcp.json:

{
  "mcpServers": {
    "hivemind": {
      "command": "npx",
      "args": ["-y", "hivemind", "mcp"]
    }
  }
}

Planned implementation

  • src/kiro/kiro-ingest.ts — tails ~/.kiro/sessions/cli/*.jsonl, maps kinds to Hivemind rows, watermarks per-transcript, drains to the session queue. Mirrors cowork-ingest.ts.
  • src/cli/install-kiro.ts — merges the Hivemind MCP server entry into ~/.kiro/settings/mcp.json, preserving existing servers.
  • hivemind install kiro CLI command.
  • startKiroIngestLoop() called from the MCP server on startup.
  • Tests mirroring cowork-ingest.test.ts and install-cowork.test.ts.

Scope

Transcript tailing only (same as Cowork) — no kiro plugin API or hooks required. Sessions captured as agent = "kiro" rows. Summaries and skillify triggered on idle sessions via the existing summarizeIdleSessions pattern.

Happy to implement this if the approach looks good to you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions