Repository navigation
ask: HTTP API (POST /api/v1/ask) and the w3bs_ask MCP tool - #277
Merged
Merged
Conversation
The server side of `w3bs ask` (docs/ask.md), so ask ships on every surface:
CLI + TUI chat (w3bs 0.1.19), API, MCP (hosted /mcp and stdio).
- src/ask.mjs: same registry (fixtures/agents.json), pit.world grounding,
question-first prompt and echo strip as the CLI; Infernet /api/chat with
p2p_only and a non-p2p route refused; INFERNET_API_KEY from the server env.
- POST /api/v1/ask {agent, question, search?} (+ /api/ask for the stdio MCP),
GET /api/v1/ask/agents; 20 questions an hour per client IP (W3BS_ASK_PER_HOUR).
- w3bs_ask on the hosted and stdio MCP servers; discovery lists the ask URL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The server side of
w3bs ask(#275), so ask ships with a CLI, TUI, API and MCP:POST /api/v1/ask {agent, question, search?}returns the same object asw3bs ask --json(answer, sources, node, job id, latency).GET /api/v1/ask/agentslists the agents. No key is needed; the limit is 20 questions an hour per client IP (W3BS_ASK_PER_HOUR).w3bs_askon the hosted/mcpand on the stdio server./api/chatwithp2p_only, and any non-p2p route is refused, so there is no paid fallback. The server sendsINFERNET_API_KEY(an Infernet trusted-client key, set in the dev2 app.env) so w3bs.org users do not share one anonymous 20/h budget.fixtures/agents.json), grounding and prompt as the CLI.test/ask.test.mjscovers the unit pieces, plus the API and MCP against a fake pit.world and Infernet (checks p2p_only, the bearer, sources, node and the throttle). The conformance tool count goes to 12.🤖 Generated with Claude Code