Skip to content

An open-source, faster Devin alternative

TypeScript

feat(sdk): type `runtime` and document the runtime↔model pairing (0.9.2 → 0.9.3)

Igor Zalutski0bcdc347a372
diff --git a/sdks/typescript/package-lock.json b/sdks/typescript/package-lock.json
index 7413c4c6..9aa3e19e 100644
--- a/sdks/typescript/package-lock.json
+++ b/sdks/typescript/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@opencomputer/sdk",
- "version": "0.9.2",
+ "version": "0.9.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@opencomputer/sdk",
- "version": "0.9.2",
+ "version": "0.9.3",
"license": "MIT",
"devDependencies": {
"@types/node": "^25.3.0",
diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json
index 8d76d81c..6a9f3ed2 100644
--- a/sdks/typescript/package.json
+++ b/sdks/typescript/package.json
@@ -1,6 +1,6 @@
{
"name": "@opencomputer/sdk",
- "version": "0.9.2",
+ "version": "0.9.3",
"description": "TypeScript SDK for OpenComputer - cloud sandbox platform",
"type": "module",
"main": "dist/index.js",
diff --git a/sdks/typescript/src/agents/agents.ts b/sdks/typescript/src/agents/agents.ts
index 2f7338d2..24279662 100644
--- a/sdks/typescript/src/agents/agents.ts
+++ b/sdks/typescript/src/agents/agents.ts
@@ -1,11 +1,13 @@
import type { Http, Query } from "./http.js";
-import type { Agent, Limits } from "./types.js";
+import type { Agent, Limits, Runtime } from "./types.js";
export interface CreateAgentParams {
name: string;
prompt: string;
+ /** `provider/model` id; must match the runtime's provider (`anthropic/…` for `claude`, `openai/…` for `codex`). */
model: string;
- runtime?: string;
+ /** Defaults to `claude`. Fixes the model's provider (see `model`); immutable after create. */
+ runtime?: Runtime;
/** Model provider key for the runtime (Anthropic for `claude`, OpenAI for `codex`), stored as a sealed credential. Or pass `credential`, or rely on the org default. */
key?: string;
credential?: string;
@@ -14,6 +16,7 @@ export interface CreateAgentParams {
export interface UpdateAgentParams {
prompt?: string;
+ /** Stay within the agent's runtime provider (`anthropic/…` for `claude`, `openai/…` for `codex`); the runtime itself is immutable. */
model?: string;
key?: string;
credential?: string;
diff --git a/sdks/typescript/src/agents/types.ts b/sdks/typescript/src/agents/types.ts
index d17fdea6..ea89802b 100644
--- a/sdks/typescript/src/agents/types.ts
+++ b/sdks/typescript/src/agents/types.ts
@@ -9,6 +9,11 @@ export type YieldReason =
export interface Limits { tokens?: number; turnSeconds?: number; turns?: number; }
+// The runtime an agent runs on. It fixes the model's provider — `claude` runs
+// `anthropic/…` models, `codex` runs `openai/…` (more land over time). The union
+// keeps known values discoverable while still accepting future ones.
+export type Runtime = "claude" | "codex" | (string & {});
+
export interface Actor {
id?: string;
type?: "human" | "agent" | "system" | (string & {});
@@ -20,7 +25,7 @@ export interface Agent {
name: string;
promptHash?: string;
model: string;
- runtime: string;
+ runtime: Runtime;
revision?: number;
credentialId?: string | null;
limits?: Limits;