@intutic/clawde / ClawdeClient
Class: ClawdeClient
The data-plane client: chat() sends an OpenAI-format request through the Intutic proxy, which governs it and forwards it to the provider, and throws ClawdeBlockedError when the proxy refuses it. checkBudget() and circuitBreaker() add a workspace budget check, and on() registers callbacks for refusal verdicts. For the operator APIs, use ControlPlaneClient.
Constructors
Constructor
new ClawdeClient(options): ClawdeClient;Parameters
| Parameter | Type |
|---|---|
options | ClawdeClientOptions |
Returns
ClawdeClient
Methods
chat()
chat(params): Promise<ChatResponse>;Send a chat request through the proxy.
Resolves with verdict: 'allow' when the proxy let the request through. A governance refusal, including one the proxy answers with a 200 and names in x-intutic-refusal (or, on a stream, in its : intutic-refusal line), fires the matching event and rejects with ClawdeBlockedError, unretried. Transport failures, timeouts and 5xx answers are retried; anything else rejects with ClawdeConnectionError.
Parameters
| Parameter | Type |
|---|---|
params | ChatParams |
Returns
Promise<ChatResponse>
checkBudget()
checkBudget(model, estimatedTokens): Promise<BudgetCheckResult>;Parameters
| Parameter | Type |
|---|---|
model | string |
estimatedTokens | number |
Returns
Promise<BudgetCheckResult>
circuitBreaker()
circuitBreaker<T>(toolName, options?): (fn) => Promise<T>;Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
toolName | string |
options | CircuitBreakerOptions |
Returns
(fn) => Promise<T>
off()
off(event, callback): void;Parameters
| Parameter | Type |
|---|---|
event | string |
callback | EventCallback |
Returns
void
on()
on(event, callback): void;Parameters
| Parameter | Type |
|---|---|
event | VerdictEvent |
callback | EventCallback |
Returns
void
resolveContext()
resolveContext(): Promise<ResolvedContext>;Returns
Promise<ResolvedContext>