roe-typescript 1.0.79 → 1.0.802
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.
- package/README.md +66 -17
- package/dist/api/_generated.d.ts +11 -0
- package/dist/api/_generated.js +13 -0
- package/dist/api/discovery.d.ts +16 -0
- package/dist/api/discovery.js +31 -0
- package/dist/api/tables.d.ts +21 -0
- package/dist/api/tables.js +26 -0
- package/dist/auth.js +20 -1
- package/dist/client.d.ts +3 -0
- package/dist/client.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript/Node SDK for the [Roe AI](https://www.roe-ai.com/) API.
|
|
4
4
|
|
|
5
|
-
> **v1.0.
|
|
5
|
+
> **v1.0.802** — Version synchronization across roe-python / roe-typescript /
|
|
6
|
+
> roe-golang. No major-version migration; the public SDK packages now share a
|
|
7
|
+
> single 1.0.x patch counter driven by the SDK OpenAPI spec.
|
|
8
|
+
|
|
9
|
+
> **v1.0.80** — `RoeHTTPClient`/axios were replaced by the generated
|
|
6
10
|
> `openapi-fetch` client exposed as `client.raw`; use `components["schemas"]`
|
|
7
11
|
> (or inferred types from the wrappers) where you need response shapes from
|
|
8
12
|
> the OpenAPI definitions. Highlights and migration notes across releases live
|
|
@@ -68,6 +72,40 @@ result.error_message // Error string or null
|
|
|
68
72
|
result.outputs // AgentDatum[] from components["schemas"]["AgentDatum"]
|
|
69
73
|
```
|
|
70
74
|
|
|
75
|
+
## Errors
|
|
76
|
+
|
|
77
|
+
Non-2xx responses throw typed exceptions from `roe-typescript`, all
|
|
78
|
+
subclasses of `RoeAPIException`. Use them to handle expected failures
|
|
79
|
+
without parsing error strings:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import {
|
|
83
|
+
RoeAPIException,
|
|
84
|
+
BadRequestError, // 400 — validation / bad input
|
|
85
|
+
AuthenticationError, // 401 — missing or invalid API key
|
|
86
|
+
InsufficientCreditsError, // 402 — plan limit / billing
|
|
87
|
+
ForbiddenError, // 403 — feature or resource forbidden
|
|
88
|
+
NotFoundError, // 404 — resource not found
|
|
89
|
+
RateLimitError, // 429 — throttled
|
|
90
|
+
ServerError, // 5xx — server-side
|
|
91
|
+
} from "roe-typescript";
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
await client.agents.retrieve("00000000-0000-0000-0000-000000000000");
|
|
95
|
+
} catch (err) {
|
|
96
|
+
if (err instanceof NotFoundError) {
|
|
97
|
+
console.log(err.statusCode, err.message);
|
|
98
|
+
} else {
|
|
99
|
+
throw err;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`job.wait()` does not throw on agent-side failures — instead the returned
|
|
105
|
+
result carries `result.status === JobStatus.FAILURE` and
|
|
106
|
+
`result.error_message`. Transport / HTTP errors hit the typed hierarchy
|
|
107
|
+
above.
|
|
108
|
+
|
|
71
109
|
## Raw API Access
|
|
72
110
|
|
|
73
111
|
The generated raw client is exposed as `client.raw`:
|
|
@@ -84,6 +122,23 @@ const response = await client.raw.GET("/v1/users/current_user/");
|
|
|
84
122
|
console.log(response.response.status);
|
|
85
123
|
```
|
|
86
124
|
|
|
125
|
+
<!-- ROE-SDK:GENERATED-FRIENDLY-APIS:START -->
|
|
126
|
+
## Generated Friendly APIs
|
|
127
|
+
|
|
128
|
+
This block is synced from `roe-main/roe-sdk/sdk_contract.yml` during SDK fan-out.
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
const engines = await client.discovery.listAgentEngineTypes();
|
|
132
|
+
const models = await client.discovery.listSupportedModels("text");
|
|
133
|
+
|
|
134
|
+
const upload = await client.tables.upload({
|
|
135
|
+
tableName: "customers",
|
|
136
|
+
file: "customers.csv",
|
|
137
|
+
withHeaders: true,
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
<!-- ROE-SDK:GENERATED-FRIENDLY-APIS:END -->
|
|
141
|
+
|
|
87
142
|
## Full Example
|
|
88
143
|
|
|
89
144
|
Create an agent that extracts structured data from websites:
|
|
@@ -150,6 +205,10 @@ client.agents.delete("agent-uuid") // Delete agent
|
|
|
150
205
|
client.agents.duplicate("agent-uuid") // Duplicate agent
|
|
151
206
|
```
|
|
152
207
|
|
|
208
|
+
> `agents.duplicate(...)` returns an `AgentVersion` (the new agent's first
|
|
209
|
+
> version), **not** a `BaseAgent`. The new agent's `id` is reachable on the
|
|
210
|
+
> returned object as `.base_agent.id`.
|
|
211
|
+
|
|
153
212
|
### Running Agents
|
|
154
213
|
|
|
155
214
|
```typescript
|
|
@@ -424,30 +483,20 @@ const agent = await client.agents.create({
|
|
|
424
483
|
|
|
425
484
|
| Model | Value |
|
|
426
485
|
|-------|-------|
|
|
486
|
+
| GPT-5.4 Pro | `gpt-5.4-pro-2026-03-05` |
|
|
427
487
|
| GPT-5.4 | `gpt-5.4-2026-03-05` |
|
|
488
|
+
| GPT-5.4 Mini | `gpt-5.4-mini-2026-03-17` |
|
|
489
|
+
| GPT-5.4 Nano | `gpt-5.4-nano-2026-03-17` |
|
|
428
490
|
| GPT-5.2 | `gpt-5.2-2025-12-11` |
|
|
429
|
-
| GPT-5.1 | `gpt-5.1-2025-11-13` |
|
|
430
491
|
| GPT-5 | `gpt-5-2025-08-07` |
|
|
431
|
-
| GPT-5 Mini | `gpt-5-mini-2025-08-07` |
|
|
432
492
|
| GPT-4.1 | `gpt-4.1-2025-04-14` |
|
|
433
|
-
|
|
|
434
|
-
| O3 Pro | `o3-pro-2025-06-10` |
|
|
435
|
-
| O3 | `o3-2025-04-16` |
|
|
436
|
-
| O4 Mini | `o4-mini-2025-04-16` |
|
|
493
|
+
| Claude Opus 4.7 | `claude-opus-4-7` |
|
|
437
494
|
| Claude Opus 4.6 | `claude-opus-4-6` |
|
|
438
495
|
| 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
496
|
| Claude Haiku 4.5 | `claude-haiku-4-5-20251001` |
|
|
445
|
-
| Gemini 3 Pro | `gemini-3-pro-preview` |
|
|
497
|
+
| Gemini 3.1 Pro | `gemini-3.1-pro-preview` |
|
|
446
498
|
| Gemini 3 Flash | `gemini-3-flash-preview` |
|
|
447
|
-
|
|
|
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` |
|
|
499
|
+
| Grok 4.20 Reasoning | `grok-4.20-0309-reasoning` |
|
|
451
500
|
|
|
452
501
|
## Engine Classes
|
|
453
502
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RoeConfig } from "../config.js";
|
|
2
|
+
import type { RoeRawClient } from "../generated/client.js";
|
|
3
|
+
import { DiscoveryAPI } from "./discovery.js";
|
|
4
|
+
import { TablesAPI } from "./tables.js";
|
|
5
|
+
export { DiscoveryAPI } from "./discovery.js";
|
|
6
|
+
export { TablesAPI } from "./tables.js";
|
|
7
|
+
export type GeneratedApis = {
|
|
8
|
+
readonly discovery: DiscoveryAPI;
|
|
9
|
+
readonly tables: TablesAPI;
|
|
10
|
+
};
|
|
11
|
+
export declare function createGeneratedApis(config: RoeConfig, raw: RoeRawClient): GeneratedApis;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Auto-generated friendly API facades for the Roe AI SDK.
|
|
2
|
+
// Generated by scripts/generate-sdk from openapi/wrappers.yml.
|
|
3
|
+
// Do not edit by hand.
|
|
4
|
+
import { DiscoveryAPI } from "./discovery.js";
|
|
5
|
+
import { TablesAPI } from "./tables.js";
|
|
6
|
+
export { DiscoveryAPI } from "./discovery.js";
|
|
7
|
+
export { TablesAPI } from "./tables.js";
|
|
8
|
+
export function createGeneratedApis(config, raw) {
|
|
9
|
+
return {
|
|
10
|
+
discovery: new DiscoveryAPI(config, raw),
|
|
11
|
+
tables: new TablesAPI(config, raw),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RoeConfig } from "../config.js";
|
|
2
|
+
import type { RoeRawClient } from "../generated/client.js";
|
|
3
|
+
import type { components } from "../generated/schema.js";
|
|
4
|
+
type AgentEngineTypeList = components["schemas"]["AgentEngineTypeList"];
|
|
5
|
+
type SupportedLLMModelList = components["schemas"]["SupportedLLMModelList"];
|
|
6
|
+
export declare class DiscoveryAPI {
|
|
7
|
+
readonly config: RoeConfig;
|
|
8
|
+
readonly raw: RoeRawClient;
|
|
9
|
+
/** API for discovering valid agent engine types and model IDs. */
|
|
10
|
+
constructor(config: RoeConfig, raw: RoeRawClient);
|
|
11
|
+
/** Return production engine_class_id values accepted by agent creation. */
|
|
12
|
+
listAgentEngineTypes(): Promise<AgentEngineTypeList>;
|
|
13
|
+
/** Return non-deprecated model IDs accepted in engine_config.model. */
|
|
14
|
+
listSupportedModels(capability?: string | null): Promise<SupportedLLMModelList>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Auto-generated friendly API facades for the Roe AI SDK.
|
|
2
|
+
// Generated by scripts/generate-sdk from openapi/wrappers.yml.
|
|
3
|
+
// Do not edit by hand.
|
|
4
|
+
import { RoeAPIException } from "../exceptions.js";
|
|
5
|
+
export class DiscoveryAPI {
|
|
6
|
+
/** API for discovering valid agent engine types and model IDs. */
|
|
7
|
+
constructor(config, raw) {
|
|
8
|
+
this.config = config;
|
|
9
|
+
this.raw = raw;
|
|
10
|
+
}
|
|
11
|
+
/** Return production engine_class_id values accepted by agent creation. */
|
|
12
|
+
async listAgentEngineTypes() {
|
|
13
|
+
const result = await this.raw.GET("/v1/agents/types/");
|
|
14
|
+
if (result.data == null) {
|
|
15
|
+
throw new RoeAPIException("agent engine discovery returned an empty response");
|
|
16
|
+
}
|
|
17
|
+
return result.data;
|
|
18
|
+
}
|
|
19
|
+
/** Return non-deprecated model IDs accepted in engine_config.model. */
|
|
20
|
+
async listSupportedModels(capability) {
|
|
21
|
+
const query = {};
|
|
22
|
+
if (capability != null)
|
|
23
|
+
query["capability"] = capability;
|
|
24
|
+
const init = Object.keys(query).length > 0 ? { params: { query } } : undefined;
|
|
25
|
+
const result = await this.raw.GET("/v1/agents/models/", init);
|
|
26
|
+
if (result.data == null) {
|
|
27
|
+
throw new RoeAPIException("model discovery returned an empty response");
|
|
28
|
+
}
|
|
29
|
+
return result.data;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RoeConfig } from "../config.js";
|
|
2
|
+
import type { RoeRawClient } from "../generated/client.js";
|
|
3
|
+
import type { components } from "../generated/schema.js";
|
|
4
|
+
import type { FileUpload } from "../models/file.js";
|
|
5
|
+
type TableUploadResponse = components["schemas"]["TableUploadResponse"];
|
|
6
|
+
export type TableUploadFile = string | NodeJS.ReadableStream | FileUpload;
|
|
7
|
+
export type TableUploadParams = {
|
|
8
|
+
tableName: string;
|
|
9
|
+
file: TableUploadFile;
|
|
10
|
+
withHeaders?: boolean;
|
|
11
|
+
organizationId?: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare class TablesAPI {
|
|
14
|
+
readonly config: RoeConfig;
|
|
15
|
+
readonly raw: RoeRawClient;
|
|
16
|
+
/** API for uploading CSV files into Roe tables. */
|
|
17
|
+
constructor(config: RoeConfig, raw: RoeRawClient);
|
|
18
|
+
/** Upload a CSV file and create a Roe table. */
|
|
19
|
+
upload(params: TableUploadParams): Promise<TableUploadResponse>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Auto-generated friendly API facades for the Roe AI SDK.
|
|
2
|
+
// Generated by scripts/generate-sdk from openapi/wrappers.yml.
|
|
3
|
+
// Do not edit by hand.
|
|
4
|
+
import { RoeAPIException } from "../exceptions.js";
|
|
5
|
+
import { postDynamicInputs } from "../utils/dynamicInputs.js";
|
|
6
|
+
export class TablesAPI {
|
|
7
|
+
/** API for uploading CSV files into Roe tables. */
|
|
8
|
+
constructor(config, raw) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
this.raw = raw;
|
|
11
|
+
}
|
|
12
|
+
/** Upload a CSV file and create a Roe table. */
|
|
13
|
+
async upload(params) {
|
|
14
|
+
const inputs = {
|
|
15
|
+
table_name: params.tableName,
|
|
16
|
+
file: params.file,
|
|
17
|
+
with_headers: params.withHeaders ?? true,
|
|
18
|
+
organization_id: params.organizationId ?? this.config.organizationId,
|
|
19
|
+
};
|
|
20
|
+
const data = await postDynamicInputs(this.raw, "/v1/tables/upload/", {}, {}, inputs, undefined, this.config.maxRetries);
|
|
21
|
+
if (data == null) {
|
|
22
|
+
throw new RoeAPIException("table upload returned an empty response");
|
|
23
|
+
}
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
26
|
+
}
|
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":
|
|
27
|
+
"User-Agent": `roe-typescript/${SDK_VERSION}`,
|
|
9
28
|
};
|
|
10
29
|
}
|
|
11
30
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentsAPI } from "./api/agents.js";
|
|
2
|
+
import { type GeneratedApis } from "./api/_generated.js";
|
|
2
3
|
import { PoliciesAPI } from "./api/policies.js";
|
|
3
4
|
import { UsersAPI } from "./api/users.js";
|
|
4
5
|
import { RoeAuth } from "./auth.js";
|
|
@@ -18,3 +19,5 @@ export declare class RoeClient {
|
|
|
18
19
|
/** No-op kept for source compatibility; the raw client manages its own connections. */
|
|
19
20
|
close(): void;
|
|
20
21
|
}
|
|
22
|
+
export interface RoeClient extends GeneratedApis {
|
|
23
|
+
}
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentsAPI } from "./api/agents.js";
|
|
2
|
+
import { createGeneratedApis } from "./api/_generated.js";
|
|
2
3
|
import { PoliciesAPI } from "./api/policies.js";
|
|
3
4
|
import { UsersAPI } from "./api/users.js";
|
|
4
5
|
import { RoeAuth } from "./auth.js";
|
|
@@ -18,6 +19,7 @@ export class RoeClient {
|
|
|
18
19
|
this._agents = new AgentsAPI(this.config, this.raw);
|
|
19
20
|
this._policies = new PoliciesAPI(this.config, this.raw);
|
|
20
21
|
this._users = new UsersAPI(this.config, this.raw);
|
|
22
|
+
Object.assign(this, createGeneratedApis(this.config, this.raw));
|
|
21
23
|
}
|
|
22
24
|
get agents() {
|
|
23
25
|
return this._agents;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { createRoeRawClient } from "./generated/client.js";
|
|
|
6
6
|
export type { RoeApiComponents, RoeApiPaths, RoeRawClient } from "./generated/client.js";
|
|
7
7
|
export type { components, paths } from "./generated/schema.js";
|
|
8
8
|
export * from "./exceptions.js";
|
|
9
|
+
export * from "./api/_generated.js";
|
|
9
10
|
export * from "./api/agents.js";
|
|
10
11
|
export * from "./api/policies.js";
|
|
11
12
|
export * from "./api/users.js";
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { RoeConfig } from "./config.js";
|
|
|
3
3
|
export { RoeAuth } from "./auth.js";
|
|
4
4
|
export { createRoeRawClient } from "./generated/client.js";
|
|
5
5
|
export * from "./exceptions.js";
|
|
6
|
+
export * from "./api/_generated.js";
|
|
6
7
|
export * from "./api/agents.js";
|
|
7
8
|
export * from "./api/policies.js";
|
|
8
9
|
export * from "./api/users.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "roe-typescript",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.802",
|
|
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",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@types/mime-types": "^2.1.4",
|
|
30
30
|
"@types/node": "^22.9.0",
|
|
31
31
|
"@types/uuid": "^10.0.0",
|
|
32
|
+
"js-yaml": "^4.1.1",
|
|
32
33
|
"openapi-typescript": "^7.6.1",
|
|
33
34
|
"typescript": "^5.6.3",
|
|
34
35
|
"vitest": "^1.6.0"
|