roe-typescript 1.0.80 → 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 +21 -0
- 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/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,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript/Node SDK for the [Roe AI](https://www.roe-ai.com/) API.
|
|
4
4
|
|
|
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
|
+
|
|
5
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
|
|
@@ -118,6 +122,23 @@ const response = await client.raw.GET("/v1/users/current_user/");
|
|
|
118
122
|
console.log(response.response.status);
|
|
119
123
|
```
|
|
120
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
|
+
|
|
121
142
|
## Full Example
|
|
122
143
|
|
|
123
144
|
Create an agent that extracts structured data from websites:
|
|
@@ -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/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"
|