Imperal Docs
SDK Reference

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

VerbPurposeKey input
repo_profileA structured profile of the repo — languages, size, key symbols, test-command hints. Call it to orient before reading files.
orientOne-call orientation for a task: the repo profile plus the most relevant symbols/snippets for your query.query
search_codeFind code by name or meaning across the indexed repo; ranked matches with locations.query
graph_sliceFor 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_changeGiven 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.

On this page