feat: @orangecheck/agent-console-client (shared HTTP client) + agent-mcp 0.2.0#1
Open
feat: @orangecheck/agent-console-client (shared HTTP client) + agent-mcp 0.2.0#1
Conversation
The four framework adapters (anthropic / openai / vercel / langgraph)
each shipped 0.1.0 with an inline copy of postActionToConsole. Adding
a fifth adapter would have meant a fifth copy. Extracted the shared
client first.
@orangecheck/agent-console-client (NEW, v0.1.0):
- postActionToConsole(action, { apiToken, projectId })
- postDelegationToConsole(del, client, { agent_name?, agent_env? })
- postRevocationToConsole(rev, client)
- postSubdelegationToConsole(sub, client, { agent_name?, agent_env? })
- ApiError class carrying the server's stable reason string
- 8 unit tests covering Bearer auth, body shape, error reasons,
JSON-fallback, default baseUrl, all four envelope kinds
@orangecheck/agent-mcp 0.0.1 → 0.2.0:
- Re-exports postActionToConsole + ConsoleClient + PostActionResult
from the shared package (back-compat surface; consumers can import
from either)
- New invokeWithStampAndPost wrapper — same shape as the other 4
adapters: stamp + execute + post, three lines of config
- Tests still green
Cleanup-pass to dedupe the inline copies in the other 4 adapters lands
in a follow-up bump (agent-anthropic 0.1.0 → 0.1.1, etc).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts the inline `postActionToConsole` helper that was being copy-pasted across the framework adapters into a dedicated package. Then bumps `agent-mcp` (which still didn't have the helper) to use it.
New: `@orangecheck/agent-console-client@0.1.0`
Single shared HTTP client for posting envelopes to console.ochk.io:
8 unit tests covering Bearer auth shape, body field round-trip, error reason propagation, JSON-fallback on non-JSON bodies, default baseUrl, and all four envelope kinds.
`@orangecheck/agent-mcp` 0.0.1 → 0.2.0
Adds the `postActionToConsole` re-export + new `invokeWithStampAndPost` wrapper so MCP integrations get the same three-lines-of-config story as anthropic/openai/vercel/langgraph.
Followup
Dedupe pass on the other 4 adapters (agent-anthropic 0.1.0 → 0.1.1, etc) — drop the inline copies, import from `@orangecheck/agent-console-client` instead. Lands in a separate PR to keep this one tight.
Test plan