roe-typescript 1.0.803 → 1.1.0
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 +5 -3
- package/dist/api/agents.d.ts +3 -3
- package/dist/api/agents.js +6 -10
- package/dist/models/job.d.ts +1 -1
- package/dist/models/job.js +4 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript/Node SDK for the [Roe](https://www.roe-ai.com/) API.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
>
|
|
7
|
-
>
|
|
5
|
+
<!-- ROE-SDK:RELEASE-BANNER:START -->
|
|
6
|
+
> **v1.1.0** - Schema synchronization across roe-python / roe-typescript /
|
|
7
|
+
> roe-golang. This release is generated from SDK OpenAPI marker `1-0-83`, and
|
|
8
|
+
> all public package metadata is bumped to 1.1.0.
|
|
9
|
+
<!-- ROE-SDK:RELEASE-BANNER:END -->
|
|
8
10
|
|
|
9
11
|
> **v1.0.80** — `RoeHTTPClient`/axios were replaced by the generated
|
|
10
12
|
> `openapi-fetch` client exposed as `client.raw`; use `components["schemas"]`
|
package/dist/api/agents.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { Job, JobBatch } from "../models/job.js";
|
|
|
5
5
|
type BaseAgent = components["schemas"]["BaseAgent"];
|
|
6
6
|
type PaginatedBaseAgentList = components["schemas"]["PaginatedBaseAgentList"];
|
|
7
7
|
type AgentVersion = components["schemas"]["AgentVersion"];
|
|
8
|
-
type AgentJobStatus = components["schemas"]["
|
|
8
|
+
type AgentJobStatus = components["schemas"]["AgentJobSingleStatus"];
|
|
9
|
+
type AgentJobBatchStatus = components["schemas"]["AgentJobStatus"];
|
|
9
10
|
type AgentJobResultItem = components["schemas"]["AgentJobResultItem"];
|
|
10
11
|
type AgentJobDeleteDataResponse = components["schemas"]["AgentJobDeleteDataResponse"];
|
|
11
12
|
type AgentDatum = components["schemas"]["AgentDatum"];
|
|
@@ -38,7 +39,7 @@ export declare class AgentJobsAPI {
|
|
|
38
39
|
private get organizationId();
|
|
39
40
|
retrieveStatus(jobId: string): Promise<AgentJobStatus>;
|
|
40
41
|
retrieveResult(jobId: string): Promise<components["schemas"]["AgentJobResultResponse"]>;
|
|
41
|
-
retrieveStatusMany(jobIds: string[]): Promise<
|
|
42
|
+
retrieveStatusMany(jobIds: string[]): Promise<AgentJobBatchStatus[]>;
|
|
42
43
|
retrieveResultMany(jobIds: string[]): Promise<AgentJobResultItem[]>;
|
|
43
44
|
downloadReference(jobId: string, resourceId: string, asAttachment?: boolean): Promise<Buffer>;
|
|
44
45
|
cancel(jobId: string): Promise<void>;
|
|
@@ -83,7 +84,6 @@ export declare class AgentsAPI {
|
|
|
83
84
|
agentId: string;
|
|
84
85
|
batchInputs: Record<string, unknown>[];
|
|
85
86
|
timeoutSeconds?: number;
|
|
86
|
-
metadata?: Record<string, unknown>;
|
|
87
87
|
}): Promise<JobBatch>;
|
|
88
88
|
runSync(agentId: string, inputs: Record<string, unknown>, metadata?: Record<string, unknown>): Promise<AgentDatum[]>;
|
|
89
89
|
runVersion(params: {
|
package/dist/api/agents.js
CHANGED
|
@@ -154,11 +154,12 @@ export class AgentJobsAPI {
|
|
|
154
154
|
params: { query: { organization_id: this.organizationId } },
|
|
155
155
|
body: { job_ids: chunk },
|
|
156
156
|
});
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
const payload = data;
|
|
158
|
+
if (Array.isArray(payload)) {
|
|
159
|
+
results.push(...payload);
|
|
159
160
|
}
|
|
160
|
-
else if (
|
|
161
|
-
results.push(...
|
|
161
|
+
else if (payload?.results) {
|
|
162
|
+
results.push(...payload.results);
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
return results;
|
|
@@ -312,17 +313,12 @@ export class AgentsAPI {
|
|
|
312
313
|
for (const chunk of this.iterChunks(params.batchInputs, AgentsAPI.MAX_BATCH_SIZE)) {
|
|
313
314
|
if (!chunk.length)
|
|
314
315
|
continue;
|
|
315
|
-
// Generated request type only models { inputs }, but the backend also
|
|
316
|
-
// accepts a sibling `metadata` field — attach it via a serializer cast.
|
|
317
|
-
const body = { inputs: chunk };
|
|
318
|
-
if (params.metadata !== undefined)
|
|
319
|
-
body.metadata = params.metadata;
|
|
320
316
|
const { data } = await this.raw.POST("/v1/agents/run/{agent_id}/async/many/", {
|
|
321
317
|
params: {
|
|
322
318
|
path: { agent_id: params.agentId },
|
|
323
319
|
query: { organization_id: this.config.organizationId },
|
|
324
320
|
},
|
|
325
|
-
body:
|
|
321
|
+
body: { inputs: chunk },
|
|
326
322
|
});
|
|
327
323
|
const ids = Array.isArray(data) ? data : [];
|
|
328
324
|
for (const jobId of ids) {
|
package/dist/models/job.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare enum JobStatus {
|
|
|
9
9
|
CANCELLED = 5,
|
|
10
10
|
CACHED = 6
|
|
11
11
|
}
|
|
12
|
-
type AgentJobStatus = components["schemas"]["
|
|
12
|
+
type AgentJobStatus = components["schemas"]["AgentJobSingleStatus"];
|
|
13
13
|
type AgentJobResultResponse = components["schemas"]["AgentJobResultResponse"];
|
|
14
14
|
type AgentJobResultItem = components["schemas"]["AgentJobResultItem"];
|
|
15
15
|
type AgentDatum = components["schemas"]["AgentDatum"];
|
package/dist/models/job.js
CHANGED
|
@@ -96,8 +96,6 @@ export class JobBatch {
|
|
|
96
96
|
const statusBatch = await this.agentsApi.jobs.retrieveStatusMany(pending);
|
|
97
97
|
const completedIds = [];
|
|
98
98
|
for (const status of statusBatch) {
|
|
99
|
-
// The bulk status endpoint returns AgentJobStatus[]; the schema lacks an `id`
|
|
100
|
-
// field on each, but the backend includes it in practice — extract via cast.
|
|
101
99
|
const id = status.id;
|
|
102
100
|
if (!id) {
|
|
103
101
|
throw new Error("AgentJobStatus response is missing an `id` field; backend schema may have changed");
|
|
@@ -113,8 +111,8 @@ export class JobBatch {
|
|
|
113
111
|
this.statuses[id] = {
|
|
114
112
|
id,
|
|
115
113
|
status: code,
|
|
116
|
-
timestamp: status.timestamp,
|
|
117
|
-
error_message: status.error_message,
|
|
114
|
+
timestamp: status.timestamp ?? 0,
|
|
115
|
+
error_message: status.error_message ?? undefined,
|
|
118
116
|
};
|
|
119
117
|
}
|
|
120
118
|
}
|
|
@@ -213,8 +211,8 @@ export class JobBatch {
|
|
|
213
211
|
const js = {
|
|
214
212
|
id,
|
|
215
213
|
status: s.status,
|
|
216
|
-
timestamp: s.timestamp,
|
|
217
|
-
error_message: s.error_message,
|
|
214
|
+
timestamp: s.timestamp ?? 0,
|
|
215
|
+
error_message: s.error_message ?? undefined,
|
|
218
216
|
};
|
|
219
217
|
this.statuses[id] = js;
|
|
220
218
|
statusMap[id] = js;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "roe-typescript",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "TypeScript SDK for the Roe API (feature parity with roe-python).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"mime-types": "^2.1.35",
|
|
24
24
|
"openapi-fetch": "^0.13.8",
|
|
25
25
|
"undici": "^6.25.0",
|
|
26
|
-
"uuid": "^11.
|
|
26
|
+
"uuid": "^11.1.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/mime-types": "^2.1.4",
|