Skip to content

feat(axi-sdk-js): add OpenCode ambient integration#38

Merged
kunchenguid merged 4 commits into
mainfrom
feat/axi-sdk-js-opencode-plugin
May 12, 2026
Merged

feat(axi-sdk-js): add OpenCode ambient integration#38
kunchenguid merged 4 commits into
mainfrom
feat/axi-sdk-js-opencode-plugin

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

The developer wanted to add OpenCode support to the AXI JavaScript SDK’s existing self-installation system, which already handled Claude and Codex. They asked the agent to research OpenCode’s plugin documentation, discuss the design via lavish-axi, then implement an ambient-context-only OpenCode plugin that injects the AXI home view without adding a custom tool. They explicitly allowed using their real OpenCode setup for development/testing and required end-to-end validation before declaring completion. They also wanted confirmation that downstream users would get OpenCode support automatically after upgrading the SDK, while preserving Claude and Codex behavior.

What Changed

  • Added OpenCode support to the AXI JavaScript SDK self-install hooks through a managed ambient-context plugin that injects the AXI home view.
  • Updated hook tests and CLI fixtures so OpenCode, Claude, and Codex installation paths are covered without requiring prebuilt dist/ output.
  • Refreshed SDK, AXI skill, README, and docs guidance to describe OpenCode plugin-based ambient integration alongside existing session-hook integrations.

Risk Assessment

⚠️ Medium: The diff is well-contained, but it adds a generated global OpenCode plugin that depends on OpenCode's experimental system-transform hook and user runtime environment, so integration risk remains despite no substantiated code findings.

Testing

  • Summary: Exercised the axi-sdk-js unit and subprocess integration tests covering hook installation, OpenCode plugin generation/runtime behavior, and the dist-free CLI fixture; all relevant tests passed.
  • npm test in packages/axi-sdk-js
  • npm test
  • npx vitest run test/hooks.test.ts
  • npx vitest run test/cli.test.ts -t "hooks automatically|hook installation"
  • Outcome: 🔧 1 issue found → auto-fixed across 2 runs (7m49s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

Round 1 - passed ✅

✅ **Rebase** - passed

Round 1 - passed ✅

⚠️ **Review** - medium risk

Round 1 - passed ✅

🔧 **Test** - 1 issue found → auto-fixed

Round 1 - found 1 warning

  • ⚠️ packages/axi-sdk-js/test/fixtures/version-bin.mjs:1 - npm test fails in the subprocess integration tests because this fixture imports ../../dist/cli.js, but dist/ is not present in the fresh worktree after dependency installation. The focused OpenCode and hook-installation tests run successfully without the prebuilt package output.
  • npm test
  • npx vitest run test/hooks.test.ts
  • npx vitest run test/cli.test.ts -t "hooks automatically|hook installation"

Round 2 (auto-fix) - passed ✅

  • npm test in packages/axi-sdk-js
🔧 **Document** - 4 issues found → auto-fixed

Round 1 - found 4 issues (2 warnings, 2 infos)

  • ⚠️ .agents/skills/axi/SKILL.md:154 - The AXI skill still says default ambient-context app targets are Claude Code and Codex only. The SDK change now self-installs OpenCode support by default too, so this guidance should include OpenCode to avoid agents building new AXIs from stale target-app assumptions.
  • ⚠️ .agents/skills/axi/SKILL.md:163 - The per-app integration guidance lists Claude Code and Codex but has no OpenCode entry. It should document that OpenCode is supported via a managed plugin in ~/.config/opencode/plugins/ using ambient system-context injection rather than a native SessionStart hook.
  • ℹ️ README.md:77 - The public principle summary describes ambient context only as self-installing into session hooks. With OpenCode support, the implementation can self-install through a plugin instead, so the summary should be broadened to mention session hooks or plugins/context integrations.
  • ℹ️ docs/index.html:578 - The website's Ambient context section says the agent context always comes from session hooks that output to stdout. The new OpenCode path injects the AXI home view through a managed plugin system-context transform, so this public documentation should be updated to avoid excluding the OpenCode behavior.

Round 2 (auto-fix) - passed ✅

🔧 **Lint** - 4 issues found → auto-fixed

Round 1 - found 4 warnings

  • ⚠️ docs/index.html:1 - Prettier formatting check failed for this changed file.
  • ⚠️ packages/axi-sdk-js/README.md:1 - Prettier formatting check failed for this changed file.
  • ⚠️ packages/axi-sdk-js/src/hooks.ts:1 - Prettier formatting check failed for this changed file.
  • ⚠️ packages/axi-sdk-js/test/hooks.test.ts:1 - Prettier formatting check failed for this changed file.

Round 2 (auto-fix) - passed ✅

✅ **Push** - passed

Round 1 - passed ✅

@kunchenguid kunchenguid merged commit fc54e94 into main May 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant