Skip to content

@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 ​

ts
new ClawdeClient(options): ClawdeClient;

Parameters ​

ParameterType
optionsClawdeClientOptions

Returns ​

ClawdeClient

Methods ​

chat() ​

ts
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 ​

ParameterType
paramsChatParams

Returns ​

Promise<ChatResponse>


checkBudget() ​

ts
checkBudget(model, estimatedTokens): Promise<BudgetCheckResult>;

Parameters ​

ParameterType
modelstring
estimatedTokensnumber

Returns ​

Promise<BudgetCheckResult>


circuitBreaker() ​

ts
circuitBreaker<T>(toolName, options?): (fn) => Promise<T>;

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
toolNamestring
optionsCircuitBreakerOptions

Returns ​

(fn) => Promise<T>


off() ​

ts
off(event, callback): void;

Parameters ​

ParameterType
eventstring
callbackEventCallback

Returns ​

void


on() ​

ts
on(event, callback): void;

Parameters ​

ParameterType
eventVerdictEvent
callbackEventCallback

Returns ​

void


resolveContext() ​

ts
resolveContext(): Promise<ResolvedContext>;

Returns ​

Promise<ResolvedContext>

The circuit breaker for AI agents