roe-typescript 1.0.79 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +45 -17
  2. package/dist/auth.js +20 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  TypeScript/Node SDK for the [Roe AI](https://www.roe-ai.com/) API.
4
4
 
5
- > **v1.0.79** — `RoeHTTPClient`/axios were replaced by the generated
5
+ > **v1.0.80** — `RoeHTTPClient`/axios were replaced by the generated
6
6
  > `openapi-fetch` client exposed as `client.raw`; use `components["schemas"]`
7
7
  > (or inferred types from the wrappers) where you need response shapes from
8
8
  > the OpenAPI definitions. Highlights and migration notes across releases live
@@ -68,6 +68,40 @@ result.error_message // Error string or null
68
68
  result.outputs // AgentDatum[] from components["schemas"]["AgentDatum"]
69
69
  ```
70
70
 
71
+ ## Errors
72
+
73
+ Non-2xx responses throw typed exceptions from `roe-typescript`, all
74
+ subclasses of `RoeAPIException`. Use them to handle expected failures
75
+ without parsing error strings:
76
+
77
+ ```typescript
78
+ import {
79
+ RoeAPIException,
80
+ BadRequestError, // 400 — validation / bad input
81
+ AuthenticationError, // 401 — missing or invalid API key
82
+ InsufficientCreditsError, // 402 — plan limit / billing
83
+ ForbiddenError, // 403 — feature or resource forbidden
84
+ NotFoundError, // 404 — resource not found
85
+ RateLimitError, // 429 — throttled
86
+ ServerError, // 5xx — server-side
87
+ } from "roe-typescript";
88
+
89
+ try {
90
+ await client.agents.retrieve("00000000-0000-0000-0000-000000000000");
91
+ } catch (err) {
92
+ if (err instanceof NotFoundError) {
93
+ console.log(err.statusCode, err.message);
94
+ } else {
95
+ throw err;
96
+ }
97
+ }
98
+ ```
99
+
100
+ `job.wait()` does not throw on agent-side failures — instead the returned
101
+ result carries `result.status === JobStatus.FAILURE` and
102
+ `result.error_message`. Transport / HTTP errors hit the typed hierarchy
103
+ above.
104
+
71
105
  ## Raw API Access
72
106
 
73
107
  The generated raw client is exposed as `client.raw`:
@@ -150,6 +184,10 @@ client.agents.delete("agent-uuid") // Delete agent
150
184
  client.agents.duplicate("agent-uuid") // Duplicate agent
151
185
  ```
152
186
 
187
+ > `agents.duplicate(...)` returns an `AgentVersion` (the new agent's first
188
+ > version), **not** a `BaseAgent`. The new agent's `id` is reachable on the
189
+ > returned object as `.base_agent.id`.
190
+
153
191
  ### Running Agents
154
192
 
155
193
  ```typescript
@@ -424,30 +462,20 @@ const agent = await client.agents.create({
424
462
 
425
463
  | Model | Value |
426
464
  |-------|-------|
465
+ | GPT-5.4 Pro | `gpt-5.4-pro-2026-03-05` |
427
466
  | GPT-5.4 | `gpt-5.4-2026-03-05` |
467
+ | GPT-5.4 Mini | `gpt-5.4-mini-2026-03-17` |
468
+ | GPT-5.4 Nano | `gpt-5.4-nano-2026-03-17` |
428
469
  | GPT-5.2 | `gpt-5.2-2025-12-11` |
429
- | GPT-5.1 | `gpt-5.1-2025-11-13` |
430
470
  | GPT-5 | `gpt-5-2025-08-07` |
431
- | GPT-5 Mini | `gpt-5-mini-2025-08-07` |
432
471
  | GPT-4.1 | `gpt-4.1-2025-04-14` |
433
- | GPT-4.1 Mini | `gpt-4.1-mini-2025-04-14` |
434
- | O3 Pro | `o3-pro-2025-06-10` |
435
- | O3 | `o3-2025-04-16` |
436
- | O4 Mini | `o4-mini-2025-04-16` |
472
+ | Claude Opus 4.7 | `claude-opus-4-7` |
437
473
  | Claude Opus 4.6 | `claude-opus-4-6` |
438
474
  | Claude Sonnet 4.6 | `claude-sonnet-4-6` |
439
- | Claude Opus 4.5 | `claude-opus-4-5-20251101` |
440
- | Claude Sonnet 4.5 | `claude-sonnet-4-5-20250929` |
441
- | Claude Opus 4.1 | `claude-opus-4-1-20250805` |
442
- | Claude Opus 4 | `claude-opus-4-20250514` |
443
- | Claude Sonnet 4 | `claude-sonnet-4-20250514` |
444
475
  | Claude Haiku 4.5 | `claude-haiku-4-5-20251001` |
445
- | Gemini 3 Pro | `gemini-3-pro-preview` |
476
+ | Gemini 3.1 Pro | `gemini-3.1-pro-preview` |
446
477
  | Gemini 3 Flash | `gemini-3-flash-preview` |
447
- | Gemini 2.5 Pro | `gemini-2.5-pro` |
448
- | Gemini 2.5 Flash | `gemini-2.5-flash` |
449
- | Grok 4 | `grok-4-0709` |
450
- | Grok 4.1 Fast Reasoning | `grok-4-1-fast-reasoning` |
478
+ | Grok 4.20 Reasoning | `grok-4.20-0309-reasoning` |
451
479
 
452
480
  ## Engine Classes
453
481
 
package/dist/auth.js CHANGED
@@ -1,3 +1,22 @@
1
+ import { readFileSync } from "fs";
2
+ import { fileURLToPath } from "url";
3
+ import { dirname, join } from "path";
4
+ // Resolve the package's own version at runtime so the User-Agent doesn't
5
+ // silently drift across releases when the auto-release pipeline bumps
6
+ // package.json without touching this file. Falls back to "0.0.0" if the
7
+ // compiled module can't locate package.json (e.g. bundled by a downstream
8
+ // consumer that strips the surrounding file tree).
9
+ function resolvePackageVersion() {
10
+ try {
11
+ const here = dirname(fileURLToPath(import.meta.url));
12
+ const pkg = JSON.parse(readFileSync(join(here, "..", "package.json"), "utf8"));
13
+ return typeof pkg.version === "string" ? pkg.version : "0.0.0";
14
+ }
15
+ catch {
16
+ return "0.0.0";
17
+ }
18
+ }
19
+ const SDK_VERSION = resolvePackageVersion();
1
20
  export class RoeAuth {
2
21
  constructor(config) {
3
22
  this.config = config;
@@ -5,7 +24,7 @@ export class RoeAuth {
5
24
  getHeaders() {
6
25
  return {
7
26
  Authorization: `Bearer ${this.config.apiKey}`,
8
- "User-Agent": "roe-typescript/0.1.0",
27
+ "User-Agent": `roe-typescript/${SDK_VERSION}`,
9
28
  };
10
29
  }
11
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roe-typescript",
3
- "version": "1.0.79",
3
+ "version": "1.0.80",
4
4
  "description": "TypeScript SDK for the Roe AI API (feature parity with roe-python).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",