MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / trpcPost

Function trpcPost

packages/worker-utils/src/cloud-agent-next-client.ts:215–243  ·  view source on GitHub ↗

* Parse a tRPC JSON-RPC envelope and return `result.data`, throwing on * non-200 responses or unexpected shapes.

(
  url: string,
  headers: Record<string, string>,
  body: unknown,
  procedure: string
)

Source from the content-addressed store, hash-verified

213 'paid model',
214 'add credits',
215 'credits required',
216 'credit balance is too low',
217 'insufficient funds',
218 'payment required',
219] as const;
220
221export function isCloudAgentNextBillingErrorBody(body: string): boolean {
222 const normalizedBody = body.toLowerCase();
223
224 return CLOUD_AGENT_NEXT_BILLING_ERROR_PATTERNS.some(pattern => normalizedBody.includes(pattern));
225}
226
227function isCloudAgentSandboxStatus(value: unknown): value is CloudAgentSandboxStatus {
228 return (
229 value === 'healthy' || value === 'destroyed' || value === 'unreachable' || value === 'unknown'
230 );
231}
232
233function isCloudAgentSessionExecutionHealth(
234 value: unknown
235): value is CloudAgentSessionExecutionHealth {
236 return value === 'healthy' || value === 'unknown' || value === 'stale' || value === 'none';
237}
238
239function isCloudAgentActiveExecutionStatus(
240 value: unknown
241): value is CloudAgentActiveExecutionStatus {
242 return (
243 value === 'pending' ||
244 value === 'running' ||
245 value === 'completed' ||
246 value === 'failed' ||

Callers 1

interruptSessionFunction · 0.85

Calls 4

textMethod · 0.65
jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected