@miosa/sdk 1.2.10 → 1.2.11
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/dist/index.d.ts +16 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -243,6 +243,18 @@ interface AgentRun {
|
|
|
243
243
|
updated_at?: string;
|
|
244
244
|
[key: string]: unknown;
|
|
245
245
|
}
|
|
246
|
+
interface AgentRunArtifact {
|
|
247
|
+
id: string;
|
|
248
|
+
agent_run_id?: string;
|
|
249
|
+
target_kind?: AgentRunTargetKind;
|
|
250
|
+
target_id?: string;
|
|
251
|
+
path: string;
|
|
252
|
+
kind?: string;
|
|
253
|
+
mime_type?: string;
|
|
254
|
+
size_bytes?: number;
|
|
255
|
+
created_at?: string;
|
|
256
|
+
[key: string]: unknown;
|
|
257
|
+
}
|
|
246
258
|
interface AgentRunCreateParams {
|
|
247
259
|
prompt: string;
|
|
248
260
|
targetKind?: AgentRunTargetKind;
|
|
@@ -274,6 +286,10 @@ declare class AgentRuns {
|
|
|
274
286
|
constructor(http: HttpClient);
|
|
275
287
|
list(params?: AgentRunListParams): Promise<AgentRun[]>;
|
|
276
288
|
get(id: string): Promise<AgentRun>;
|
|
289
|
+
artifacts(id: string): Promise<AgentRunArtifact[]>;
|
|
290
|
+
downloadArtifact(id: string, artifactId: string, options?: {
|
|
291
|
+
inline?: boolean;
|
|
292
|
+
}): Promise<Uint8Array>;
|
|
277
293
|
run(params: AgentRunCreateParams): Promise<AgentRun>;
|
|
278
294
|
cancel(id: string): Promise<AgentRun>;
|
|
279
295
|
}
|
package/dist/index.js
CHANGED
|
@@ -736,6 +736,23 @@ var AgentRuns = class {
|
|
|
736
736
|
await this.http.get(`/agent-runs/${encodeURIComponent(id)}`)
|
|
737
737
|
);
|
|
738
738
|
}
|
|
739
|
+
async artifacts(id) {
|
|
740
|
+
const data = unwrap2(
|
|
741
|
+
await this.http.get(
|
|
742
|
+
`/agent-runs/${encodeURIComponent(id)}/artifacts`
|
|
743
|
+
)
|
|
744
|
+
);
|
|
745
|
+
if (Array.isArray(data)) return data;
|
|
746
|
+
return data.artifacts ?? data.items ?? [];
|
|
747
|
+
}
|
|
748
|
+
async downloadArtifact(id, artifactId, options = {}) {
|
|
749
|
+
const query2 = options.inline ? "?disposition=inline" : "";
|
|
750
|
+
return this.http.getBinary(
|
|
751
|
+
`/agent-runs/${encodeURIComponent(id)}/artifacts/${encodeURIComponent(
|
|
752
|
+
artifactId
|
|
753
|
+
)}/download${query2}`
|
|
754
|
+
);
|
|
755
|
+
}
|
|
739
756
|
async run(params) {
|
|
740
757
|
const body3 = stripUndefined({
|
|
741
758
|
prompt: params.prompt,
|