@codebolt/api-docs-index
v0.1.1
Published
Generated searchable API documentation index and local agent tools for CodeBolt creator agents.
Readme
@codebolt/api-docs-index
Generated searchable API documentation index for CodeBolt creator agents.
The package keeps API discovery separate from @codebolt/codeboltjs, so normal runtime SDK consumers do not ship the full documentation corpus. The root import exposes search and authoring helpers. @codebolt/api-docs-index/tools exposes CodeBolt local agent tools and uses @codebolt/agent plus @codebolt/codeboltjs as peer dependencies.
Generate
npm run generate --workspace=sdks/api-docs-indexThe generator reads:
sdks/codeboltjs/src/modulessdks/agent/src/unifiedsdks/clientsdk/src/apiD:\Codeboltapps\codeboltdocs\docs\05_referencewhen presentoverlays/*.json|*.yaml|*.yml
It writes:
generated/api-index.jsonlgenerated/api-manifest.json
Use In Agents
import {
searchApiDocsTool,
getApiSpecTool,
listApiCategoriesTool,
createAgentProjectTool,
validateApiUsageTool,
} from "@codebolt/api-docs-index/tools";
const agent = createAgent({
tools: [
searchApiDocsTool,
getApiSpecTool,
listApiCategoriesTool,
createAgentProjectTool,
validateApiUsageTool,
],
});Use Directly
import { searchApiDocs, getApiSpec } from "@codebolt/api-docs-index";
const matches = await searchApiDocs("send message to user");
const spec = await getApiSpec("codeboltjs.chat.sendMessage");Module Manifest, Module Specs, Scoped .d.ts
The discovery layer for creator agents. getModuleManifest() returns a compact
one-line-per-module catalogue (curated via overlays/modules.yaml) meant to be
injected statically into a creator agent's system prompt, so the LLM knows every
module that exists before deciding what to look up. getModuleSpec(module)
returns all of one module's API records in a single call. getModuleDts(modules)
returns TypeScript declarations scoped to the selected modules (sidecar files in
generated/dts/, copied from the SDK builds at generate time - build
sdks/codeboltjs and sdks/agent before generating).
import { getModuleManifest, getModuleSpec, getModuleDts } from "@codebolt/api-docs-index";
const manifest = getModuleManifest({ includeMethods: false }); // system-prompt sized
const chatApis = getModuleSpec("chat"); // one call, all methods
const dts = getModuleDts(["fs", "chat", "agent-core"]); // code-phase ground truthTools: getModuleSpecTool (get_module_spec), getModuleDtsTool (get_module_dts).
search_api_docs now defaults to the runtime-api/agent-framework surfaces; pass
includeDocs: true to widen to reference docs.
Examples Library
examples/<id>/ holds complete reference agents (meta.yaml + full files) that a
creator agent reads and adapts - unlike the string templates in authoring.ts,
which only provide deterministic scaffolding. listExamples() / getExample(id)
plus the list_examples / get_example tools. First entry: act-updated, the
flagship processor-pipeline agent. Validated generated agents can be added back
here so the library grows with use (feedback loop - future milestone).
Run npm run verify after npm run generate to check the index (canary modules
present in the manifest, module specs resolvable, dts sidecar populated).
Authoring Helpers
import {
listAgentTemplates,
getAgentTemplate,
createAgentProject,
validateAgentManifest,
validateApiUsage,
} from "@codebolt/api-docs-index";The CodeBolt tool adapter additionally exports:
listAgentTemplatesToolgetAgentTemplateToolcreateAgentProjectToolvalidateAgentManifestToolvalidateApiUsageTooltestRunAgentSandboxToolgetSandboxLogsToolgetExecutionTraceTool
