d68f003000
CI / Change detection (push) Has been cancelled
CI / Version drift (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Workflow RLM cache (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / npm wrapper smoke (push) Has been cancelled
CI / Mobile runtime smoke (push) Has been cancelled
CI / Workflow lint (push) Has been cancelled
CI / Documentation (push) Has been cancelled
Web Frontend / Lint & Type Check (push) Failing after 1s
Auto-close harvested PRs / close (push) Failing after 1s
cargo-deny / cargo-deny (bans licenses sources) (push) Failing after 1s
Security audit / cargo-audit (push) Failing after 1s
Sync to CNB / sync (push) Failing after 1s
cargo-deny / cargo-deny (advisories) (push) Failing after 3s
Web Frontend / Deploy to Cloudflare (push) Has been cancelled
36 lines
1.1 KiB
Markdown
36 lines
1.1 KiB
Markdown
# @codewhale/runtime-sdk
|
|
|
|
Small JavaScript helpers and TypeScript declarations for CodeWhale's local
|
|
Runtime API. The package is intentionally transport-only: it never bypasses the
|
|
Rust runtime, sandbox, approvals, provider configuration, or fleet ledger.
|
|
|
|
```js
|
|
import { createRuntimeClient } from "@codewhale/runtime-sdk";
|
|
|
|
const client = createRuntimeClient({
|
|
baseUrl: "http://127.0.0.1:7878",
|
|
token: process.env.CODEWHALE_RUNTIME_TOKEN,
|
|
});
|
|
|
|
const { runs } = await client.listFleetRuns();
|
|
const workers = await client.listFleetWorkers(runs[0].id);
|
|
await client.interruptWorker(workers.workers[0].worker_id);
|
|
```
|
|
|
|
## Fleet Helpers
|
|
|
|
- `listFleetRuns()`
|
|
- `getFleetRun(runId)`
|
|
- `listFleetWorkers(runId)`
|
|
- `getFleetWorker(workerId)`
|
|
- `interruptWorker(workerId)`
|
|
- `restartWorker(workerId)`
|
|
- `stopFleetRun(runId)`
|
|
- `fleetEvents(runId)`
|
|
- `createFleetRun(spec)`
|
|
|
|
`fleetEvents` and `createFleetRun` are typed ahead of the current v0.8.60 Rust
|
|
Runtime API. If the local runtime does not expose those endpoints, the helpers
|
|
raise `RuntimeCapabilityError` with a stable `capability` string instead of a
|
|
generic fetch failure.
|