An open-source, faster Devin alternative
TypeScript
docs/sdk: review follow-ups — session.listSources(), casing, workspaces reconcile
Igor Zalutskib4c429f1fe2b
diff --git a/docs/agent-sessions/api-reference.mdx b/docs/agent-sessions/api-reference.mdxindex f99ee90e..8fe39b5e 100644--- a/docs/agent-sessions/api-reference.mdx+++ b/docs/agent-sessions/api-reference.mdx@@ -32,7 +32,7 @@ const session = await oc.sessions.get("ses_..."); // server, org key| `session.cancel()` | Cooperatively stop the active turn (no-op if not running). || `session.result()` | `{ lastTurn, result? }` — the resolved final event. || `session.turns()` · `session.turn(id)` | Per-turn history: timing, error. |-| `session.sources` | Source checkout status — `SourceSummary[]`. |+| `session.sources` · `session.listSources()` | Source checkout status — create snapshot · live poll. || `session.mintClientToken(opts)` | Mint a client token. |</Tab>@@ -73,11 +73,12 @@ Turn = {started_at?, completed_at?}-SessionSource = // a sources[] entry (SDK camelCase: expiresAt)+SessionSource = // a sources[] entry — WIRE shape, snake_case{ repo, ref, sha, name? } // a registered repo id or "owner/repo" — auth via your connection| { url, ref, sha, name?, auth } // inline shortcut; name defaults to repo name, type defaults "git"SourceAuth = // inline path ONLY (connection-backed repos need none){ type: "risky_short_lived_token", token, expires_at } // workaround; short-lived; can't refresh+// SDK is camelCase: expiresAt (wire expires_at).SourceSummary = { name, status, path, sha } // sanitized; in the create response + GET …/sources// status: pending | materializing | resolved | failed | unavailable | auth_required```diff --git a/docs/agent-sessions/workspaces.mdx b/docs/agent-sessions/workspaces.mdxindex d5fa8b52..bd80a93e 100644--- a/docs/agent-sessions/workspaces.mdx+++ b/docs/agent-sessions/workspaces.mdx@@ -4,7 +4,7 @@ title: "Workspaces"description: "Prepared repo environments, rebuilt on push (coming soon)"----<Note>**Planned.** This page describes planned API shape, not shipped behavior. Today a session works in its [sandbox](/agent-sessions/runtime-tools) and clones a repo on demand.</Note>+<Note>**Planned.** This page describes planned API shape, not shipped behavior. Today a session works in its [sandbox](/agent-sessions/runtime-tools); for a public repo the agent clones on demand, and for a private repo OpenComputer checks it out before the first turn (see [Repos](/agent-sessions/repos)).</Note>Cloning, installing, and building take minutes. A **workspace** does that work ahead of time — on every push — and snapshots the result, so a session boots into a ready machine in seconds. It is a first-class resource (not an agent attribute), shared by every session that lands on its repo(s).diff --git a/sdks/typescript/src/agents/sessions.ts b/sdks/typescript/src/agents/sessions.tsindex edcd468d..449ce499 100644--- a/sdks/typescript/src/agents/sessions.ts+++ b/sdks/typescript/src/agents/sessions.ts@@ -208,9 +208,14 @@ export class Session extends ClientSession {get status(): SessionStatus { return this.data.status; }get lastTurn(): LastTurn | undefined { return this.data.lastTurn; }- /** Source checkout status from create — `{ name, status, path, sha }[]` (empty when none).- * For live status after create, poll `GET /sessions/:id/sources`. */+ /** Source checkout status from the create response — `{ name, status, path, sha }[]`+ * (empty when none). For **live** status, call {@link Session.listSources}. */get sources(): SourceSummary[] { return this._sources; }+ /** Fetch live source checkout status — poll this to watch materialization+ * (`pending`→`materializing`→`resolved`/`failed`/`auth_required`). */+ listSources(): Promise<SourceSummary[]> {+ return this.http.request("GET", `/sessions/${this.id}/sources`);+ }/** Opaque app routing state set at create (`null` when unset). See {@link CreateSessionParams.metadata}. */get metadata(): Record<string, unknown> | null { return this.data.metadata ?? null; }/** The latest fetched session record. */