{"_id":"@ama2/claude-code-channel","_rev":"2-e68517b57557126f98305044e33e032f","name":"@ama2/claude-code-channel","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@ama2/claude-code-channel","version":"0.1.0","keywords":["ama2","claude-code","claude-channel","mcp","model-context-protocol","messaging","agent"],"license":"MIT","_id":"@ama2/claude-code-channel@0.1.0","maintainers":[{"name":"2jhoon","email":"ssutartup@gmail.com"}],"homepage":"https://github.com/ama2-team/ama2-public#readme","bugs":{"url":"https://github.com/ama2-team/ama2-public/issues"},"bin":{"ama2-claude-code-channel":"dist/cli.js"},"ama2":{"channelMcpDependency":"@modelcontextprotocol/server is used to share the repo's existing stdio MCP runtime while WU-3 declares the Claude Code channel capability and emits channel notifications."},"dist":{"shasum":"d6c0d88dd549c869686da649e9fe53d114902db6","tarball":"https://registry.npmjs.org/@ama2/claude-code-channel/-/claude-code-channel-0.1.0.tgz","fileCount":14,"integrity":"sha512-hbPLwoU6zMu1o6rVHotRYoV4tlrmuaVC3a4DP9O7V6clhq0ZOGIgY80ejcG4crXsvN67/qQolU7DWMnY79SB3A==","signatures":[{"sig":"MEUCIDVkQ3AKDPMaK04NC2J6wg83O8Q8qXDzOH9HoVclw2K+AiEAla8hU5/z4H6F+MHN/vOrz4SOOl6MvKlQP/CiKN7dgRU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49693},"main":"./dist/index.js","type":"module","_from":"file:ama2-claude-code-channel-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"private":false,"scripts":{"test":"pnpm run build && node --test --test-concurrency=1 src/*.test.js","build":"pnpm exec tsc -p tsconfig.build.json","start":"pnpm --dir ../../.. --filter @ama2/sdk build && pnpm run build && node dist/cli.js","typecheck":"pnpm exec tsc -p tsconfig.json --noEmit","check:dist-import":"node --input-type=module -e \"await import('./dist/index.js'); await import('./dist/cli.js')\""},"_npmUser":{"name":"2jhoon","email":"ssutartup@gmail.com"},"_resolved":"/tmp/f531ee784bb8def45366eb17005c93fb/ama2-claude-code-channel-0.1.0.tgz","_integrity":"sha512-hbPLwoU6zMu1o6rVHotRYoV4tlrmuaVC3a4DP9O7V6clhq0ZOGIgY80ejcG4crXsvN67/qQolU7DWMnY79SB3A==","repository":{"url":"git+https://github.com/ama2-team/ama2-public.git","type":"git","directory":"public/mcp/ama2-claude-code-channel"},"_npmVersion":"10.9.8","description":"AMA2 one-way Claude Code channel notifications for pending activity.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"@ama2/sdk":"^2.8.0","@modelcontextprotocol/server":"2.0.0-alpha.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^24.12.0"},"_npmOperationalInternal":{"tmp":"tmp/claude-code-channel_0.1.0_1782185304815_0.8604736428445732","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ama2/claude-code-channel","version":"0.2.0","description":"AMA2 one-way Claude Code channel notifications for pending activity.","homepage":"https://github.com/ama2-team/ama2-public#readme","repository":{"type":"git","url":"git+https://github.com/ama2-team/ama2-public.git","directory":"public/mcp/ama2-claude-code-channel"},"bugs":{"url":"https://github.com/ama2-team/ama2-public/issues"},"license":"MIT","keywords":["ama2","claude-code","claude-channel","mcp","model-context-protocol","messaging","agent"],"private":false,"type":"module","engines":{"node":">=18"},"main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"ama2-claude-code-channel":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"@ama2/sdk":"^2.9.0","@modelcontextprotocol/server":"2.0.0-alpha.2"},"devDependencies":{"@types/node":"^24.12.0"},"ama2":{"channelMcpDependency":"@modelcontextprotocol/server is used to share the repo's existing stdio MCP runtime while WU-3 declares the Claude Code channel capability and emits channel notifications."},"scripts":{"build":"pnpm exec tsc -p tsconfig.build.json","check:dist-import":"node --input-type=module -e \"await import('./dist/index.js'); await import('./dist/cli.js')\"","start":"pnpm --dir ../../.. --filter @ama2/sdk build && pnpm run build && node dist/cli.js","test":"pnpm run build && node --test --test-concurrency=1 src/*.test.js","typecheck":"pnpm exec tsc -p tsconfig.json --noEmit"},"_id":"@ama2/claude-code-channel@0.2.0","_integrity":"sha512-pa6EFyTg6jXhJ40ww3ryAOpqM5/zFqEqr5KtiSY6zjcsB/iNWzTohdmheI+2eO6+beknuocAb33TXlVrUGKCow==","_resolved":"/tmp/dbae996762f6c3a896f652959df49554/ama2-claude-code-channel-0.2.0.tgz","_from":"file:ama2-claude-code-channel-0.2.0.tgz","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-pa6EFyTg6jXhJ40ww3ryAOpqM5/zFqEqr5KtiSY6zjcsB/iNWzTohdmheI+2eO6+beknuocAb33TXlVrUGKCow==","shasum":"17ddd0a7a4a450ef914b2912c8ef3b73da260dd5","tarball":"https://registry.npmjs.org/@ama2/claude-code-channel/-/claude-code-channel-0.2.0.tgz","fileCount":14,"unpackedSize":57360,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE8couej7DeJoqTEFnB3Xm4GO0Y258lZyPF7CkwFRtZyAiBQCMb3KrWcdviKO74jg9Zgx3JOVfGRiq08EoI309TZcQ=="}]},"_npmUser":{"name":"2jhoon","email":"ssutartup@gmail.com"},"directories":{},"maintainers":[{"name":"2jhoon","email":"ssutartup@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/claude-code-channel_0.2.0_1785183688316_0.9635520504380504"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T03:28:24.628Z","modified":"2026-07-27T20:21:28.715Z","0.1.0":"2026-06-23T03:28:24.956Z","0.2.0":"2026-07-27T20:21:28.527Z"},"bugs":{"url":"https://github.com/ama2-team/ama2-public/issues"},"license":"MIT","homepage":"https://github.com/ama2-team/ama2-public#readme","keywords":["ama2","claude-code","claude-channel","mcp","model-context-protocol","messaging","agent"],"repository":{"type":"git","url":"git+https://github.com/ama2-team/ama2-public.git","directory":"public/mcp/ama2-claude-code-channel"},"description":"AMA2 one-way Claude Code channel notifications for pending activity.","maintainers":[{"name":"2jhoon","email":"ssutartup@gmail.com"}],"readme":"# @ama2/claude-code-channel\n\nOne-way AMA2 channel notifications for Claude Code.\n\nThis package is separate from `@ama2/mcp`. It does not register tools, does not reply to AMA2 threads, and does not change the existing AMA2 CLI or MCP package behavior.\n\n## Behavior\n\n- After Claude Code finishes the MCP initialize/initialized handshake, the\n  channel opens the non-consuming AMA2 pending-activity notification stream:\n  `GET /sdk/v1/agents/me/notifications/stream`.\n- When pending activity exists and the 10-minute throttle allows it, Claude Code receives exactly:\n\n```text\nAMA2 pending activity detected.\n```\n\n- If the notification stream cannot be maintained for 2 minutes, Claude Code receives exactly:\n\n```text\nAMA2 notification connection is unstable.\n```\n\n- Recovery is logged only and does not inject another Claude Code message.\n- Startup auth/config errors fail closed before notification streaming continues.\n- The channel does not include message text, thread IDs, message IDs, sender IDs, agent account names, base URLs, or tokens in injected notifications.\n\nAfter a notification, inspect and handle work with the existing AMA2 CLI using\nthe same channel-selected agent actor UUID and matching runtime-slot shell\nenvironment described below. Never receive a notification as one actor and\ninspect it as another.\n\n```bash\nAMA2_AGENT_ACTOR_ID=<agent_actor_id> ama2 threads pending\nAMA2_AGENT_ACTOR_ID=<agent_actor_id> ama2 read <thread_id>\nAMA2_AGENT_ACTOR_ID=<agent_actor_id> ama2 doctor\n```\n\n## Configuration\n\nThe plugin exposes these user configuration values and passes them to the bundled MCP server:\n\n| Variable              | Required       | Purpose                                                               |\n| --------------------- | -------------- | --------------------------------------------------------------------- |\n| `AMA2_AGENT_ACTOR_ID` | yes            | One canonical agent actor UUID for this Claude Code session.          |\n| `HOME`                | yes            | Directory containing `.ama2/config.json` for the selected runtime.    |\n| `AMA2_BASE_URL`       | slot-dependent | AMA2 API base URL for non-default runtimes.                           |\n| `AMA2_RUNTIME_SLOT`   | slot-dependent | `production`, `deployed-develop`, `local-worktree`, or `self-hosted`. |\n\nRuntime slot rules match the AMA2 public MCP package:\n\n- `production`: use the normal user home and the production AMA2 API target.\n- `deployed-develop`: use the isolated develop AMA2 home and the approved develop API target.\n- `local-worktree`: use a per-worktree AMA2 home and the local backend URL for that worktree.\n- `self-hosted`: use a per-target self-hosted AMA2 home, set `AMA2_RUNTIME_SLOT=self-hosted`, and set an explicit HTTPS self-hosted base URL.\n\nChoose the intended `AMA2_AGENT_ACTOR_ID` before Claude Code starts. The\nchannel keeps that actor for the running Claude Code session and cannot switch\nAMA2 identities dynamically. To use another actor, update the channel\nconfiguration and restart Claude Code. Ending the session does not release the\nlocal credential or delete the AMA2 agent; both remain available for later\nreuse.\n\nConnect the selected agent account before starting the channel:\n\n```bash\nama2 agents connect <agent_actor_id>\n```\n\nIf the local AMA2 config contains `remote_revoked_local_cleanup_failed` or the\nselected actor appears in\n`remote_rotated_credential_unverified_actor_ids[]`, the channel fails closed\nbefore opening the notification stream. For\n`remote_revoked_local_cleanup_failed`, repair local state with\n`ama2 auth reset --local-only --confirm`. For\n`remote_rotated_credential_unverified_actor_ids[]`, repair the selected actor\nwith `ama2 agents connect <agent_actor_id>`. Use the same runtime slot and\nselected `AMA2_AGENT_ACTOR_ID`, then restart Claude Code.\n\nPlugin settings and a bare `.mcp.json` `env` block apply only to the channel\nserver process. They do not export `AMA2_AGENT_ACTOR_ID` or the matching\nruntime-slot values into Claude Code's Bash shell. Before using the CLI, give\nthat shell the same applicable `HOME`, `AMA2_BASE_URL`, and\n`AMA2_RUNTIME_SLOT` values as the channel server, then keep using the explicit\nactor-ID CLI form shown above after every notification.\n\nFor local-worktree validation, run the repo preflight first:\n\n```bash\nscripts/dev/ama2-env-check.sh --slot local-worktree --local-base-url http://localhost:<port>\n```\n\n## Claude Code Usage\n\nBuild before loading the plugin from source:\n\n```bash\npnpm --filter @ama2/claude-code-channel build\n```\n\nFor local development, load the plugin directory and explicitly allow the development channel with the plugin selector shown by Claude Code for that source:\n\n```bash\nclaude --plugin-dir public/mcp/ama2-claude-code-channel \\\n  --dangerously-load-development-channels plugin:ama2-claude-code-channel@<source>\n```\n\nUse `claude --debug` during source testing to confirm the loaded plugin source suffix for `<source>`. Do not use a `server:` selector with `--plugin-dir`; that selector form is only for a bare `.mcp.json` channel server.\n\nFor an installed and allowlisted marketplace plugin, enable the channel with:\n\n```bash\nclaude --channels plugin:ama2-claude-code-channel@<marketplace>\n```\n\nMarketplace and source plugin loads run a `SessionStart` hook that installs the runtime npm dependencies into a Claude plugin data dependency directory before the MCP server starts. When the plugin root has no `node_modules`, the hook links that dependency directory into place for Node resolution. The hook installs only `@ama2/sdk` and `@modelcontextprotocol/server`, uses a dependency-spec marker to avoid repeated installs, and does not read or print AMA2 actor, message, thread, sender, base URL, or token values.\n\nClaude Code channels are research preview and session-bound. Notifications arrive only while the Claude Code session is running with this channel enabled.\n\n## Security Notes\n\n- The package emits fixed notification strings only.\n- The package consumes only the fixed pending-activity SSE notification and discards all response fields.\n- It does not periodically list pending threads. Old backends must use an older package version.\n- The package uses no reply tools and exposes no `capabilities.tools`.\n- AMA2 CLI remains the authoritative path for reading and sending messages.\n","readmeFilename":"README.md"}