Repository navigation
Docs command - #71
Merged
Merged
Docs command#71
Conversation
Generator places a leaf's page in its own folder when it has one. Drop the generated edit hint comment; bootstrap moves to its folder.
Semantic lookup over Kontent.ai Learn for agents, JSON on stdout. mapi --help points at it.
IvanKiral
force-pushed
the
docs_command
branch
from
September 21, 2026 09:13
a7528e2 to
fd4c120
Compare
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.
Motivation
kontent docs search|endpoint|object <query>looks up Kontent.ai Learn docs and API reference from the terminal, so an agent (or a human) drivingkontent mapican find the right endpoint and payload shape without leaving the CLI. It talks to the Learn-MCP service (https://learn-mcp.kontent.ai, no auth, GET only) through a newsrc/lib/learnclient on core-sdk'screateFetchQuery. Each subcommand prints a JSON array of service-ranked candidates;--limit(1-10) and--compacton all three,--apifilter onsearch. Thezod/minischemas declare only the fields the CLI reads, so unknown keys pass through to stdout. Empty query, no match and request failure are distinct error kinds, and no-match hints point atdocs searchor at dropping--api.Agent evals harness (
evals/, opt-in) runs the Agent SDK against the built CLI on one cloned environment, then grades the resulting state through the Management SDK with deterministic checks. The agent getsBash(confined to a workspace dir) andWebFetch(kontent.aionly, key-in-URL denied); the policy is a pure reducer wired into thePreToolUsehook. Seven tasks run sequentially in dependency order; a task whose parent did not PASS is recorded BLOCKED. Each run writesrun.json, a markdown report, per-task traces, raw SDK messages and a shim log of everykontentinvocation toevals/results/(git-ignored). The paid run is gated onEVALS_MAPI_KEY/EVALS_SOURCE_ENV_IDand never part ofpnpm testor CI; the harness's own unit tests do run inpnpm test. Adds@anthropic-ai/claude-agent-sdkas a dev dependency. Playbook inevals/README.md.kontent mapifixes from the eval runs:HTTP <status> <text>on stderr instead of leaving both streams silent.kontent login,--mapiKey,Authorizationheader,KONTENT_MAPI_KEY.--envIdis rejected before any request goes out.--envIdis prepended to the path and points atkontent docsfor endpoint lookup.Docs and infra: each command's README now lives next to its module (
project/sample/bootstrap/), andgenerateCommandDocs.tsresolves the page folder from the filesystem.test/helpers/environment.tsandrequiredEnv.tsare extracted from the e2e helpers and shared with evals. CLAUDE.md, the root README table and.env.templateare updated.Checklist
How to test
For
mapi: runkontent mapi types --envId ""(rejected before any request) and, while logged out with no key set,kontent mapi types --envId <id>(credential hint on stderr). Publishing a variant with-X PUTnow printsHTTP 204 No Contenton stderr.For the evals run, set
EVALS_MAPI_KEYandEVALS_SOURCE_ENV_IDin.env, make sureANTHROPIC_API_KEYis unset, and runpnpm evals:run. Results land inevals/results/<date>-<time>-<model>/.