@miosa/sdk 1.2.23 → 1.2.25
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 +38 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3123,6 +3123,7 @@ declare class ComputerInbox {
|
|
|
3123
3123
|
get(): Promise<Record<string, unknown>>;
|
|
3124
3124
|
update(fields: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
3125
3125
|
}
|
|
3126
|
+
type ComputerPromptOptions = Omit<AgentRunCreateParams, "prompt" | "targetKind" | "targetId" | "sandboxId" | "computerId">;
|
|
3126
3127
|
/**
|
|
3127
3128
|
* A Computer instance bound to a specific computer ID.
|
|
3128
3129
|
*
|
|
@@ -3207,6 +3208,13 @@ declare class Computer {
|
|
|
3207
3208
|
destroy(): Promise<void>;
|
|
3208
3209
|
/** Reload metadata from the API and update `this.data`. */
|
|
3209
3210
|
reload(): Promise<Computer>;
|
|
3211
|
+
/**
|
|
3212
|
+
* Run an AI agent inside this Computer.
|
|
3213
|
+
*
|
|
3214
|
+
* The Computer is the graphical desktop VM product. This dispatches the
|
|
3215
|
+
* same Agent Runs API as `miosa agent run --computer`, scoped to this VM.
|
|
3216
|
+
*/
|
|
3217
|
+
prompt(instruction: string, options?: ComputerPromptOptions): Promise<AgentRun>;
|
|
3210
3218
|
/**
|
|
3211
3219
|
* Capture a desktop screenshot as PNG bytes.
|
|
3212
3220
|
* Shortcut for `computer.desktop.screenshot()`.
|
|
@@ -6084,6 +6092,7 @@ interface SandboxDeployParams {
|
|
|
6084
6092
|
idempotencyKey?: string;
|
|
6085
6093
|
idempotency_key?: string;
|
|
6086
6094
|
}
|
|
6095
|
+
type SandboxPromptOptions = Omit<AgentRunCreateParams, "prompt" | "targetKind" | "targetId" | "sandboxId" | "computerId">;
|
|
6087
6096
|
declare class SandboxCommands {
|
|
6088
6097
|
private readonly sandbox;
|
|
6089
6098
|
constructor(sandbox: Sandbox);
|
|
@@ -6223,6 +6232,13 @@ declare class Sandbox {
|
|
|
6223
6232
|
get ready(): boolean;
|
|
6224
6233
|
get templateId(): string;
|
|
6225
6234
|
refresh(): Promise<Sandbox>;
|
|
6235
|
+
/**
|
|
6236
|
+
* Run an AI coding agent inside this Sandbox.
|
|
6237
|
+
*
|
|
6238
|
+
* Defaults to Claude Code, waits for completion, and runs from `/workspace`.
|
|
6239
|
+
* Pass `{ provider: "codex", env: { CODEX_API_KEY } }` to run Codex.
|
|
6240
|
+
*/
|
|
6241
|
+
prompt(instruction: string, options?: SandboxPromptOptions): Promise<AgentRun>;
|
|
6226
6242
|
private runExec;
|
|
6227
6243
|
private execStream;
|
|
6228
6244
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -4099,6 +4099,24 @@ var Computer = class _Computer {
|
|
|
4099
4099
|
this.data = await this.http.get(`/computers/${this.id}`);
|
|
4100
4100
|
return this;
|
|
4101
4101
|
}
|
|
4102
|
+
/**
|
|
4103
|
+
* Run an AI agent inside this Computer.
|
|
4104
|
+
*
|
|
4105
|
+
* The Computer is the graphical desktop VM product. This dispatches the
|
|
4106
|
+
* same Agent Runs API as `miosa agent run --computer`, scoped to this VM.
|
|
4107
|
+
*/
|
|
4108
|
+
async prompt(instruction, options = {}) {
|
|
4109
|
+
return new AgentRuns(this.http).run({
|
|
4110
|
+
...options,
|
|
4111
|
+
prompt: instruction,
|
|
4112
|
+
targetKind: "computer",
|
|
4113
|
+
targetId: this.id,
|
|
4114
|
+
computerId: this.id,
|
|
4115
|
+
provider: options.provider ?? "claude",
|
|
4116
|
+
cwd: options.cwd ?? "/workspace",
|
|
4117
|
+
wait: options.wait ?? true
|
|
4118
|
+
});
|
|
4119
|
+
}
|
|
4102
4120
|
// ─── Desktop shortcuts ─────────────────────────────────────────────────────
|
|
4103
4121
|
/**
|
|
4104
4122
|
* Capture a desktop screenshot as PNG bytes.
|
|
@@ -7620,6 +7638,24 @@ var Sandbox = class _Sandbox {
|
|
|
7620
7638
|
);
|
|
7621
7639
|
return this;
|
|
7622
7640
|
}
|
|
7641
|
+
/**
|
|
7642
|
+
* Run an AI coding agent inside this Sandbox.
|
|
7643
|
+
*
|
|
7644
|
+
* Defaults to Claude Code, waits for completion, and runs from `/workspace`.
|
|
7645
|
+
* Pass `{ provider: "codex", env: { CODEX_API_KEY } }` to run Codex.
|
|
7646
|
+
*/
|
|
7647
|
+
async prompt(instruction, options = {}) {
|
|
7648
|
+
return new AgentRuns(this.http).run({
|
|
7649
|
+
...options,
|
|
7650
|
+
prompt: instruction,
|
|
7651
|
+
targetKind: "sandbox",
|
|
7652
|
+
targetId: this.id,
|
|
7653
|
+
sandboxId: this.id,
|
|
7654
|
+
provider: options.provider ?? "claude",
|
|
7655
|
+
cwd: options.cwd ?? "/workspace",
|
|
7656
|
+
wait: options.wait ?? true
|
|
7657
|
+
});
|
|
7658
|
+
}
|
|
7623
7659
|
async runExec(command, options) {
|
|
7624
7660
|
this.assertRunning("exec");
|
|
7625
7661
|
const response = unwrap44(
|
|
@@ -9540,7 +9576,7 @@ function createAgentBuildExecutionPacket(params) {
|
|
|
9540
9576
|
quality_rules: params.qualityRules ?? [],
|
|
9541
9577
|
output_contract: outputContract,
|
|
9542
9578
|
runtime_instructions: {
|
|
9543
|
-
agent: "claude
|
|
9579
|
+
agent: "claude",
|
|
9544
9580
|
template: runtimeTemplate,
|
|
9545
9581
|
input_materialization: {
|
|
9546
9582
|
directory: DEFAULT_AGENT_BUILD_INPUT_ROOT,
|
|
@@ -9590,7 +9626,7 @@ function createBuildAgentRunParams(params) {
|
|
|
9590
9626
|
targetId: params.targetId,
|
|
9591
9627
|
sandboxId: params.sandboxId,
|
|
9592
9628
|
computerId: params.computerId,
|
|
9593
|
-
provider: params.provider ?? "claude
|
|
9629
|
+
provider: params.provider ?? "claude",
|
|
9594
9630
|
model: params.model,
|
|
9595
9631
|
cwd: params.cwd ?? "/workspace",
|
|
9596
9632
|
timeout: params.timeout ?? 1800,
|