18 Commits
Author SHA1 Message Date
Éverton Toffanetto 86f001c6bf fix(omp): follow OMP's profile rules, PI_CONFIG_DIR and XDG session dir
A named profile (`--profile`, `OMP_PROFILE`, or the legacy `PI_PROFILE`) owns
`~/.omp/profiles/<name>/agent` and ignores `PI_CODING_AGENT_DIR`, as OMP does;
`install-hooks` wrote the extension into `PI_CODING_AGENT_DIR` instead. Profile
names are normalized and refused like OMP does, `PI_CONFIG_DIR` renames the
`~/.omp` root, and on Linux and macOS sessions move to `$XDG_DATA_HOME/omp`
when that directory exists. `install-mcp`, auto-wire, session import,
`backfill`, `doctor` and the `uninstall` sweep follow the same agent dir.

Refs #820
2026-09-27 00:24:41 -03:00
enrell 33b5dd2c2d feat(opencode2): add first-party OpenCode 2.0 beta support
MCP (mcp.servers + oauth:false), dependency-free plugin shape
(ai-memory-opencode2.ts), managed run opencode2, v2 transcript
adapter (session_v2/session_message), acceptance case, docs,
changelog. Shares v1's config dir, session store, and agent kind;
no migration. Verified live against beta-18999.
2026-09-03 23:30:16 -03:00
AkitaOnRails fe2bd57d13 feat(command-code): add verified MCP and hook support 2026-08-05 17:47:03 -03:00
AkitaOnRails 89fbf6a676 Merge remote-tracking branch 'origin/main' into maint/pr-361
# Conflicts:
#	CHANGELOG.md
#	README.md
#	crates/ai-memory-cli/src/commands/hook.rs
#	crates/ai-memory-core/src/ids.rs
#	crates/ai-memory-hooks/src/capture_policy.rs
#	crates/ai-memory-mcp/src/server.rs
#	crates/ai-memory-mcp/tests/mcp_stateless_http.rs
#	docs/install.md
#	docs/windows.md
2026-08-04 12:49:08 -03:00
Samir Hanna VerzaandClaude Fable 5 24d9a00caf feat(agents): add version-aware Kiro CLI lifecycle hooks
Add first-party lifecycle capture for the AWS Kiro CLI (#355). The
binary ships two agent engines with incompatible hook surfaces, so each
is selected explicitly and never guessed:

- `install-hooks --agent kiro-cli` merges five flat camelCase entries
  (agentSpawn, userPromptSubmit, preToolUse, postToolUse, stop) into
  every existing v2 agent config under ~/.kiro/agents/. Entries carry no
  matcher key (absent = every tool; empty string matches nothing) and no
  type key (the v2 Hook schema has neither), and agentSpawn raises
  max_output_size to 64 KiB so an injected handoff + brief is not
  truncated. The v2 engine has no global hook surface and the built-in
  default agent has no file on disk, so the installer updates existing
  configs and bails with guidance when none exist instead of inventing
  an agent that would never be active.
- `install-hooks --agent kiro-cli-v3` writes the standalone versioned
  hooks file ~/.kiro/hooks/ai-memory.json (PascalCase triggers, command
  actions, timeout in seconds) for the early-access v3 engine, never
  touching other files in the hooks directory and preserving
  non-ai-memory entries inside ours.

Both surfaces honor $KIRO_HOME (verified against kiro-cli 2.16.0),
share one hooks/kiro-cli script bundle, uninstall cleanly, and keep
capture fail-open: hooks always exit 0 and print nothing on capture
paths, because exit code 2 blocks the tool call and session-start /
user-prompt stdout is added to the agent context on both engines. For
the same reason the native `ai-memory hook` command suppresses its `{}`
protocol line for kiro-cli and prints a fetched session-start handoff
raw (no hookSpecificOutput envelope — Kiro documents none).

Kiro tool payloads (tool_name/tool_input, tool_response.success) join
the capture policy with fixture vectors, including fs_read's batched
operations path extraction; fs_read/fs_write/execute_bash join the tool
family map. The v3 stdin payload shape is not publicly documented and
extraction stays verified on the v2 shape only (documented as such).

Also add `?flavor=bedrock` as an alias of the Moonshot root-schema
flattening: Kiro talks to Amazon Bedrock's Converse API, which rejects
root-level anyOf/oneOf/allOf in tool schemas, so a manually configured
~/.kiro/settings/mcp.json can point at …/mcp?flavor=bedrock (#351).

Contracts verified against kiro-cli 2.16.0 (binary surface probed
locally), kiro.dev's v2/v3 hook references, and the shipping HookTrigger
implementation in aws/amazon-q-developer-cli.

Closes #355.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJvj7D7czyZzqk4pDXgLxY
2026-08-03 23:45:16 -03:00
AkitaOnRails 9d7ec11371 fix: harden memory and release trust boundaries 2026-07-30 00:42:38 -03:00
Lucas Oliveira 876a81b5e9 style(comments): trim kimi-code additions to rationale only
Per project comment guidance: keep intent/constraint/provenance, drop
line-by-line mechanics. Function-level rationale moves to doc comments
(moonshot_safe_tool_list, moonshot_flavored_mcp_url, mcp_url_candidates);
upstream comments untouched.
2026-07-19 12:15:32 -03:00
Lucas Oliveira fcb848349e docs(install-hooks): fix kimi-code subagent comment accuracy
The old wording implied the claude-code path in THIS script also installs
the subagent hooks; the default SCRIPTS array omits them for every agent.
Point at the on-disk bundle (hooks/claude-code/, which ships
subagent-start/stop) as the thing kimi-code mirrors, per PR review.
2026-07-19 11:44:43 -03:00
Lucas Oliveira 34c4877391 feat(agents): add Kimi Code as a first-class supported agent 2026-07-17 12:20:44 -03:00
AkitaOnRails 59a1c8bbb4 fix(pi): add generated bridge extension 2026-07-01 02:45:54 -03:00
AkitaOnRails e292445a46 fix(install): split Pi from OMP targets 2026-07-01 02:07:02 -03:00
AkitaOnRails 9ccfdfee02 fix(install-hooks): harden Grok hook support 2026-06-14 11:20:41 -03:00
Lucas Oliveira 31fc4fe033 feat: add Antigravity CLI (agy) as supported harness
Antigravity CLI is the successor to Gemini CLI, built in Go with
parallel subagent support. This adds full MCP + lifecycle hook
integration with the correct config format differences:

- MCP config lives in a separate mcp_config.json (not settings.json)
- Uses serverUrl (not httpUrl) for streamable-HTTP endpoints
- Hooks config uses named-groups format with Antigravity-native
  events (PreToolUse, PostToolUse, PreInvocation, Stop)
- Mixed shape: nested for tool events, flat for lifecycle events
2026-05-25 18:47:28 -03:00
AkitaOnRails a8d27e5fe6 feat: add OpenClaw lifecycle integration 2026-05-25 15:04:00 -03:00
AkitaOnRails b6dd257c61 docs: clarify Pi OMP aliases 2026-05-24 23:23:07 -03:00
AkitaOnRails 14762fcc0f feat: add omp integration 2026-05-24 22:24:38 -03:00
AkitaOnRails bb0932e480 fix: harden config and opencode capture 2026-05-24 14:07:07 -03:00
AkitaOnRailsandClaude Opus 4.7 622082f3cd M17: docker-primary install flow + setup-agent + curl installer
Closes the gap "do I still need the binary on the host?" The answer
is now: no — docker is sufficient for every task except the one
edge case (hook scripts must live on the host fs so the agent CLI
can exec them), and that case has two solid solutions:

  1. `docker cp ai-memory:/usr/local/share/ai-memory/hooks ~/.ai-memory/`
     — works on every docker config (rootless, userns-remap, vanilla)
     because the daemon mediates the copy.
  2. `scripts/install-hooks.sh` from GitHub raw — pure curl, no
     docker needed at all. For machines that connect TO an
     ai-memory server but don't run one.

## Code changes

- Dockerfile: COPY hooks /usr/local/share/ai-memory/hooks so the
  bundled scripts ship in the image (was previously absent; users
  had to clone the repo).
- New `setup-agent` subcommand: one-shot bind-mount workflow that
  extracts the bundle + renders the JSON in one invocation. Tested
  to work on hosts where container UID matches host UID (e.g. the
  homelab); has known caveats on rootless docker (documented in
  docs/install.md → "Bind mounts vs docker cp").
- install_hooks.rs: extracted `build_claude_code_payload()` as a
  pure function so setup-agent can reuse it. Per-script
  existence-check downgraded from hard bail to stderr warning —
  install-hooks running inside docker against a host path can
  legitimately produce JSON without the scripts being on the
  container's own filesystem.
- New `scripts/install-hooks.sh`: curl-based hook installer that
  pulls each agent's seven .sh files directly from GitHub raw.
  Flags: --agent claude-code|codex|opencode, --to <dir>, --ref
  <git-ref>. For the no-docker case.

## Docs

- README rewritten end-to-end to a tight "happy path" — Quick start
  is one terminal session: generate token → docker run → claude mcp
  add + docker cp + install-hooks. Everything else moves to
  docs/install.md.
- New docs/install.md: installation cookbook covering all alternative
  agent CLIs (Codex, OpenCode, Cursor, Claude Desktop, Gemini CLI,
  OpenClaw, pi), the curl installer, building from source, LLM
  provider tiers + self-hosted Ollama, full subcommand reference,
  and the "operating without auth" loopback-only mode.
- Removed the heavyweight "Configure your agent CLI" tables + the
  inline CLI reference from README — both now live in install.md
  where they belong.

## Deployed

Pushed akitaonrails/ai-memory:latest (digest sha256:828b47be…).
Homelab pulled + restarted, container running healthy with the
bundled hooks visible at /usr/local/share/ai-memory/hooks/{
claude-code,codex,opencode}.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 12:08:24 -03:00