CPC — Code Provider Contract
CPC — the read-only, SDL-shaped contract Webbee uses to understand a codebase. Five verbs, one EntityList shape: the SDL for code.
CPC is SDL for code. Where SDL gives Webbee a typed, structured view of your data, CPC gives it a typed, structured view of your codebase — so the agent orients by understanding the code graph instead of scanning files blind.
CPC v1 is a frozen, read-only contract: five verbs, each returning an
SDL-shaped EntityList. It never mutates your code.
The five verbs
| Verb | Purpose | Key input |
|---|---|---|
repo_profile | A structured profile of the repo — languages, size, key symbols, test-command hints. Call it to orient before reading files. | — |
orient | One-call orientation for a task: the repo profile plus the most relevant symbols/snippets for your query. | query |
search_code | Find code by name or meaning across the indexed repo; ranked matches with locations. | query |
graph_slice | For each symbol, its definition, signature, direct callers and callees from the code graph. Batch-first — pass every symbol you care about at once. | symbols[] |
impact_of_change | Given symbols you plan to change, the files and symbols that depend on them (who breaks). | symbols[] |
The result shape
Every verb returns the same SDL-shaped EntityList envelope — the identical
shape SDL list tools return for data, so the agent reads code and data through
one contract:
{
"ok": true,
"data": {
"items": [
{ "id": "<path>::<name>", "title": "<name>", "kind": "function" }
],
"total": 12,
"has_more": false
}
}Symbol items carry a stable id of the form <path>::<name>; file- and
repo-level items use their path or repo id accordingly. Every item also carries a
human title and a kind (function, class, method, file, repo, …). Verbs that
describe relationships (graph_slice, impact_of_change) add relationship fields
to each item.
Read-only by contract
CPC never writes. The five verbs only read the code graph; changing code is a separate, consent-gated concern. This is a hard property of the contract, not a convention — CPC is how the agent understands, not how it acts.
How Webbee uses it
Webbee is directed to query the graph first — orient on a new task, then
graph_slice / search_code / impact_of_change to locate exactly what
matters — and to read only the spans those verbs point to. That is faster and
cheaper than scanning files, and it is why Webbee stays oriented in a large
repository: it holds a real map of where it is.
SDL — Structured Data Layer
The typed-entity system CPC's result shape is built on — facets, roles, and EntityList.
@chat.function reference
The LLM-callable handler decorator — how extensions expose typed, read/write tools.
SDK: API surface
Full ctx API — ctx.store, ctx.http, ctx.cache, ctx.user, and every context accessor.
SDL — Structured Data Layer
SDL — Structured Data Layer: type the meaning of fields so Webbee reads your entities as data, with typed facets and roles instead of field-name guessing.
UI actions reference
UI actions reference — panel actions that trigger handlers and refresh surfaces: ui.Call, ui.Navigate, ui.Send, ui.Open, plus the auto_action prop format.