@miosa/sdk 1.2.22 → 1.2.24
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 +100 -1
- package/dist/index.js +163 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -253,6 +253,19 @@ interface AgentRunCreateParams {
|
|
|
253
253
|
timeout?: number;
|
|
254
254
|
wait?: boolean;
|
|
255
255
|
env?: Record<string, string>;
|
|
256
|
+
/** Claude Code: `--output-format`, e.g. "json" or "stream-json". */
|
|
257
|
+
outputFormat?: "text" | "json" | "stream-json" | string;
|
|
258
|
+
output_format?: "text" | "json" | "stream-json" | string;
|
|
259
|
+
/** Claude Code: `--resume <session_id>`. */
|
|
260
|
+
resumeSessionId?: string;
|
|
261
|
+
resume_session_id?: string;
|
|
262
|
+
/** Codex: pass `--json` for JSONL event output. */
|
|
263
|
+
json?: boolean;
|
|
264
|
+
/** Codex: path to a JSON Schema file inside the runtime. */
|
|
265
|
+
outputSchema?: string;
|
|
266
|
+
output_schema?: string;
|
|
267
|
+
/** Codex: path to an image file inside the runtime. */
|
|
268
|
+
image?: string;
|
|
256
269
|
agentRuntimeProfileId?: string;
|
|
257
270
|
agentProfileId?: string;
|
|
258
271
|
agentRunGroupId?: string;
|
|
@@ -2339,12 +2352,24 @@ declare class Desktop$1 {
|
|
|
2339
2352
|
screenshot(): Promise<Uint8Array>;
|
|
2340
2353
|
/** Click at the given coordinates. */
|
|
2341
2354
|
click(x: number, y: number, button?: ClickParams["button"]): Promise<DesktopActionResult>;
|
|
2355
|
+
/** Explicit left-button click. Alias for click(x, y, "left"). */
|
|
2356
|
+
leftClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
2357
|
+
/** Right-button click. Alias for click(x, y, "right"). */
|
|
2358
|
+
rightClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
2359
|
+
/** Middle-button click. Alias for click(x, y, "middle"). */
|
|
2360
|
+
middleClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
2342
2361
|
/** Double-click at the given coordinates. */
|
|
2343
2362
|
doubleClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
2363
|
+
/** Move the mouse pointer without clicking. */
|
|
2364
|
+
moveMouse(x: number, y: number): Promise<DesktopActionResult>;
|
|
2344
2365
|
/** Type text into the currently focused element. */
|
|
2345
2366
|
type(text: string, delay?: number): Promise<DesktopActionResult>;
|
|
2367
|
+
/** Alias for `type(text)` used by simple computer-control loops. */
|
|
2368
|
+
write(text: string, delay?: number): Promise<DesktopActionResult>;
|
|
2346
2369
|
/** Send a key or key combination (e.g. "Enter", "ctrl+c"). */
|
|
2347
2370
|
key(key: string): Promise<DesktopActionResult>;
|
|
2371
|
+
/** Alias for `key(key)` used by simple computer-control loops. */
|
|
2372
|
+
press(key: string): Promise<DesktopActionResult>;
|
|
2348
2373
|
/** Scroll in a direction at an optional position. */
|
|
2349
2374
|
scroll(direction: ScrollParams["direction"], clicks?: number, x?: number, y?: number): Promise<DesktopActionResult>;
|
|
2350
2375
|
/** Click and drag from one coordinate to another. */
|
|
@@ -3123,6 +3148,7 @@ declare class ComputerInbox {
|
|
|
3123
3148
|
get(): Promise<Record<string, unknown>>;
|
|
3124
3149
|
update(fields: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
3125
3150
|
}
|
|
3151
|
+
type ComputerPromptOptions = Omit<AgentRunCreateParams, "prompt" | "targetKind" | "targetId" | "sandboxId" | "computerId">;
|
|
3126
3152
|
/**
|
|
3127
3153
|
* A Computer instance bound to a specific computer ID.
|
|
3128
3154
|
*
|
|
@@ -3207,6 +3233,13 @@ declare class Computer {
|
|
|
3207
3233
|
destroy(): Promise<void>;
|
|
3208
3234
|
/** Reload metadata from the API and update `this.data`. */
|
|
3209
3235
|
reload(): Promise<Computer>;
|
|
3236
|
+
/**
|
|
3237
|
+
* Run an AI agent inside this Computer.
|
|
3238
|
+
*
|
|
3239
|
+
* The Computer is the graphical desktop VM product. This dispatches the
|
|
3240
|
+
* same Agent Runs API as `miosa agent run --computer`, scoped to this VM.
|
|
3241
|
+
*/
|
|
3242
|
+
prompt(instruction: string, options?: ComputerPromptOptions): Promise<AgentRun>;
|
|
3210
3243
|
/**
|
|
3211
3244
|
* Capture a desktop screenshot as PNG bytes.
|
|
3212
3245
|
* Shortcut for `computer.desktop.screenshot()`.
|
|
@@ -3228,16 +3261,24 @@ declare class Computer {
|
|
|
3228
3261
|
rightClick(x: number, y: number): Promise<void>;
|
|
3229
3262
|
/** Double-click at the given coordinates. */
|
|
3230
3263
|
doubleClick(x: number, y: number): Promise<void>;
|
|
3264
|
+
/** Middle-button click. */
|
|
3265
|
+
middleClick(x: number, y: number): Promise<void>;
|
|
3266
|
+
/** Move the pointer without clicking. */
|
|
3267
|
+
moveMouse(x: number, y: number): Promise<void>;
|
|
3231
3268
|
/**
|
|
3232
3269
|
* Type text into the focused element.
|
|
3233
3270
|
* Shortcut for `computer.desktop.type(text)`.
|
|
3234
3271
|
*/
|
|
3235
3272
|
type(text: string): Promise<void>;
|
|
3273
|
+
/** Alias for `type(text)`. */
|
|
3274
|
+
write(text: string): Promise<void>;
|
|
3236
3275
|
/**
|
|
3237
3276
|
* Send a key or key combo.
|
|
3238
3277
|
* Shortcut for `computer.desktop.key(key)`.
|
|
3239
3278
|
*/
|
|
3240
3279
|
key(key: string): Promise<void>;
|
|
3280
|
+
/** Alias for `key(key)`. */
|
|
3281
|
+
press(key: string): Promise<void>;
|
|
3241
3282
|
/**
|
|
3242
3283
|
* Scroll in a direction.
|
|
3243
3284
|
* Shortcut for `computer.desktop.scroll(direction, clicks)`.
|
|
@@ -3305,6 +3346,13 @@ declare class Computer {
|
|
|
3305
3346
|
urls(): Promise<Record<string, unknown>>;
|
|
3306
3347
|
/** Mint a short-lived stream token for this computer. */
|
|
3307
3348
|
streamToken(): Promise<Record<string, unknown>>;
|
|
3349
|
+
/**
|
|
3350
|
+
* Mint a passwordless browser embed URL for authenticated platform sessions.
|
|
3351
|
+
*
|
|
3352
|
+
* Use this inside MIOSA or tenant apps. Raw shared desktop URLs can still use
|
|
3353
|
+
* the viewer password flow when opened outside an authenticated platform.
|
|
3354
|
+
*/
|
|
3355
|
+
embed(): Promise<Record<string, unknown>>;
|
|
3308
3356
|
/** Clone this computer into a new one. */
|
|
3309
3357
|
clone(opts?: Record<string, unknown>): Promise<Computer>;
|
|
3310
3358
|
/** Resize the computer (change CPU/memory/disk). */
|
|
@@ -5641,11 +5689,20 @@ interface TemplateData {
|
|
|
5641
5689
|
slug?: string;
|
|
5642
5690
|
[key: string]: unknown;
|
|
5643
5691
|
}
|
|
5692
|
+
interface ComputeCatalogData {
|
|
5693
|
+
products?: Array<Record<string, unknown>>;
|
|
5694
|
+
regions?: Array<Record<string, unknown>>;
|
|
5695
|
+
sizes?: Array<Record<string, unknown>>;
|
|
5696
|
+
templates?: Array<Record<string, unknown>>;
|
|
5697
|
+
[key: string]: unknown;
|
|
5698
|
+
}
|
|
5644
5699
|
declare class Regions {
|
|
5645
5700
|
private readonly http;
|
|
5646
5701
|
constructor(http: HttpClient);
|
|
5647
5702
|
/** List datacenter regions. */
|
|
5648
5703
|
listRegions(): Promise<RegionData[]>;
|
|
5704
|
+
/** Get canonical compute catalog, including product templates and readiness. */
|
|
5705
|
+
catalog(): Promise<ComputeCatalogData>;
|
|
5649
5706
|
/** List available compute sizes. */
|
|
5650
5707
|
listSizes(): Promise<SizeData[]>;
|
|
5651
5708
|
/** Get static compute pricing data. */
|
|
@@ -6084,6 +6141,7 @@ interface SandboxDeployParams {
|
|
|
6084
6141
|
idempotencyKey?: string;
|
|
6085
6142
|
idempotency_key?: string;
|
|
6086
6143
|
}
|
|
6144
|
+
type SandboxPromptOptions = Omit<AgentRunCreateParams, "prompt" | "targetKind" | "targetId" | "sandboxId" | "computerId">;
|
|
6087
6145
|
declare class SandboxCommands {
|
|
6088
6146
|
private readonly sandbox;
|
|
6089
6147
|
constructor(sandbox: Sandbox);
|
|
@@ -6150,6 +6208,11 @@ declare class SandboxEvents {
|
|
|
6150
6208
|
/** Stream live sandbox events via SSE. */
|
|
6151
6209
|
stream(): AsyncIterableIterator<Record<string, unknown>>;
|
|
6152
6210
|
}
|
|
6211
|
+
declare class SandboxMetrics {
|
|
6212
|
+
private readonly sandbox;
|
|
6213
|
+
constructor(sandbox: Sandbox);
|
|
6214
|
+
get(window?: string): Promise<Record<string, unknown>>;
|
|
6215
|
+
}
|
|
6153
6216
|
declare class SandboxPreviews {
|
|
6154
6217
|
private readonly sandbox;
|
|
6155
6218
|
constructor(sandbox: Sandbox);
|
|
@@ -6203,6 +6266,8 @@ declare class Sandbox {
|
|
|
6203
6266
|
readonly terminal: SandboxTerminal;
|
|
6204
6267
|
/** SSE event stream. */
|
|
6205
6268
|
readonly events: SandboxEvents;
|
|
6269
|
+
/** Operational metrics and current resource state. */
|
|
6270
|
+
readonly metricsResource: SandboxMetrics;
|
|
6206
6271
|
/** Preview CRUD + share/revokeShare. */
|
|
6207
6272
|
readonly previews: SandboxPreviews;
|
|
6208
6273
|
/** Read-only env var listing. */
|
|
@@ -6223,6 +6288,13 @@ declare class Sandbox {
|
|
|
6223
6288
|
get ready(): boolean;
|
|
6224
6289
|
get templateId(): string;
|
|
6225
6290
|
refresh(): Promise<Sandbox>;
|
|
6291
|
+
/**
|
|
6292
|
+
* Run an AI coding agent inside this Sandbox.
|
|
6293
|
+
*
|
|
6294
|
+
* Defaults to Claude Code, waits for completion, and runs from `/workspace`.
|
|
6295
|
+
* Pass `{ provider: "codex", env: { CODEX_API_KEY } }` to run Codex.
|
|
6296
|
+
*/
|
|
6297
|
+
prompt(instruction: string, options?: SandboxPromptOptions): Promise<AgentRun>;
|
|
6226
6298
|
private runExec;
|
|
6227
6299
|
private execStream;
|
|
6228
6300
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
@@ -6235,11 +6307,15 @@ declare class Sandbox {
|
|
|
6235
6307
|
listFiles(path?: string): Promise<SandboxFileList>;
|
|
6236
6308
|
statFile(path: string): Promise<SandboxFileStat>;
|
|
6237
6309
|
expose(port?: number): Promise<string>;
|
|
6310
|
+
getUrl(port?: number, path?: string): Promise<string>;
|
|
6311
|
+
getHost(port?: number): Promise<string>;
|
|
6238
6312
|
exposeInfo(port?: number): Promise<PreviewUrlInfo>;
|
|
6239
6313
|
startTemplate(options?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
6240
6314
|
getArtifacts(): Promise<Record<string, unknown>>;
|
|
6241
6315
|
getLogs(lines?: number): Promise<string | Record<string, unknown>>;
|
|
6242
6316
|
streamLogs(): AsyncIterableIterator<Record<string, unknown>>;
|
|
6317
|
+
metrics(window?: string): Promise<Record<string, unknown>>;
|
|
6318
|
+
getMetrics(window?: string): Promise<Record<string, unknown>>;
|
|
6243
6319
|
createSnapshot(comment?: string): Promise<SandboxSnapshot>;
|
|
6244
6320
|
listSnapshots(): Promise<SandboxSnapshot[]>;
|
|
6245
6321
|
restoreSnapshot(snapshotId: string): Promise<Sandbox>;
|
|
@@ -6839,6 +6915,26 @@ interface VolumeCreateParams {
|
|
|
6839
6915
|
idempotencyKey?: string;
|
|
6840
6916
|
[key: string]: unknown;
|
|
6841
6917
|
}
|
|
6918
|
+
interface VolumeAttachmentData {
|
|
6919
|
+
id: string;
|
|
6920
|
+
volume_id: string;
|
|
6921
|
+
computer_id: string;
|
|
6922
|
+
mount_path: string;
|
|
6923
|
+
read_only?: boolean;
|
|
6924
|
+
state?: string;
|
|
6925
|
+
created_at?: string;
|
|
6926
|
+
updated_at?: string;
|
|
6927
|
+
[key: string]: unknown;
|
|
6928
|
+
}
|
|
6929
|
+
interface VolumeAttachParams {
|
|
6930
|
+
volumeId?: string;
|
|
6931
|
+
volume_id?: string;
|
|
6932
|
+
mountPath?: string;
|
|
6933
|
+
mount_path?: string;
|
|
6934
|
+
readOnly?: boolean;
|
|
6935
|
+
read_only?: boolean;
|
|
6936
|
+
[key: string]: unknown;
|
|
6937
|
+
}
|
|
6842
6938
|
declare class Volumes {
|
|
6843
6939
|
private readonly http;
|
|
6844
6940
|
constructor(http: HttpClient);
|
|
@@ -6846,6 +6942,9 @@ declare class Volumes {
|
|
|
6846
6942
|
get(volumeId: string): Promise<VolumeData>;
|
|
6847
6943
|
create(params: VolumeCreateParams): Promise<VolumeData>;
|
|
6848
6944
|
delete(volumeId: string): Promise<void>;
|
|
6945
|
+
listAttachments(computerId: string): Promise<VolumeAttachmentData[]>;
|
|
6946
|
+
attach(computerId: string, params: VolumeAttachParams): Promise<VolumeAttachmentData>;
|
|
6947
|
+
detach(computerId: string, attachmentId: string): Promise<void>;
|
|
6849
6948
|
}
|
|
6850
6949
|
|
|
6851
6950
|
/**
|
|
@@ -7555,4 +7654,4 @@ declare class TokenRefreshFailedError extends MiosaError {
|
|
|
7555
7654
|
constructor(message: string, status?: number, details?: unknown, requestId?: string);
|
|
7556
7655
|
}
|
|
7557
7656
|
|
|
7558
|
-
export { AGENT_BUILD_KIND_SPECS, type AcceptOrgInviteResponse, type AcceptWorkspaceInviteResponse, type AddDomainParams, type AddWorkspaceMemberParams, Admin, type AgentBuildArtifactSpec, type AgentBuildExecutionPacket, type AgentBuildKind, type AgentBuildKindSpec, type AgentBuildPlannerDocument, type AgentDispatchParams, type AgentEvent$1 as AgentEvent, type AgentEventType, type AgentRun, type AgentRunCreateParams, type AgentRunEvent, type AgentRunGroup, type AgentRunGroupArtifact, type AgentRunGroupCounts, type AgentRunGroupCreateParams, type AgentRunGroupDispatchEntry, type AgentRunGroupDispatchResult, type AgentRunGroupEvent, type AgentRunGroupListParams, type AgentRunGroupStatus, type AgentRunGroupWaitOptions, AgentRunGroups, type AgentRunListParams, type AgentRunStatus, type AgentRunTargetKind, type AgentRunWaitOptions, AgentRuns, AgentRuntimeProfiles, type AgentSessionCreateParams, type AgentSessionData, type AgentSessionListResponse$1 as AgentSessionListResponse, type AgentSessionStatus$1 as AgentSessionStatus, type AllowParams, Analytics, type AnalyticsFilters, type ApiKeyCreateParams, type ApiKeyCreateResult, type ApiKeyData, type ApiKeyId, type ApiKeyListParams, ApiKeys, AppAuth, type AppAuthConfig, type AppAuthResourceType, type AppAuthSession, type AppAuthTokenPayload, type AppCatalogEntry, type AppInstallData, type AppInstallEvent, type AttachAwsRoleParams, type AuditListParams, AuditLog, type AuditLogEvent, type AuditLogListParams, type AuditTailParams, AuthError, type AuthToken, type BenchmarkCompareParams, type BenchmarkCreateParams, Benchmarks, type BindingCreateParams, type BindingListParams, type BrandingData, type BrandingUpdateParams, type BucketCreateParams, type BucketData, type BucketId, type BuilderSessionListParams, BuilderSessions, type BulkUserActionParams, type ChannelCreateParams, type ChannelData, type ChannelListParams, type ChannelUpdateParams, Channels, type ChatCompletionCreateParams, type ChatCompletionCreateStreamParams, Checkpoints, type ClickParams, Cloud, type CloudAccount, type CloudAccountCreateParams, type CloudAccountMode, type CloudAccountStatus, type CloudCredentialType, type CloudListParams, type CloudPlacementScope, type CloudPool, type CloudPoolCreateParams, type CloudPoolKind, type CloudPreflightRecordParams, type CloudPreflightRun, type CloudPreflightStatus, type CloudProvider, type CloudRegion, type CloudRegionCreateParams, type ClusterCreateParams, type ClusterData, type ClusterEvent, type ClusterId, type ClusterListResponse, type ClusterStatus, CommandCenter, Community, type CompletionCreateParams, type CompletionCreateStreamParams, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, type ComputerCreateParams, type ComputerData, ComputerEnv, type ComputerId, ComputerInbox, type ComputerListParams, type ComputerListResponse, ComputerLogs, type ComputerLogsGetParams, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, type ComputerSize, type ComputerStatus, type ComputerTemplateType, ComputerTerminal, type ComputerUpdateParams, type ComputerVisibility, ComputerVolumes, Computers, type ConnectorApplicableDefaultParams, type ConnectorCreateParams, type ConnectorData, type ConnectorDefault, type ConnectorDefaultListParams, type ConnectorDefaultParams, type ConnectorListParams, type ConnectorSubject, type ConnectorTokenParams, type ConnectorTokenResponse, Connectors, type CopyParams, type CreateAdminApiKeyParams, type CreateAgentBuildPacketParams, type CreateBuildAgentRunParams, type CreateOrgInviteParams, type CreateWorkspaceInviteParams, type CreateWorkspaceInviteResponse, type CreditBalance, type CreditTransaction, type CreditTransactionListResponse, type CreditUsage, Credits, type CronJobCreateParams, type CronJobData, type CronJobExecutionData, type CronJobExecutionId, type CronJobId, type CronJobListParams, type CronJobUpdateParams, CronJobs, type CursorInfo, type CustomDomainCreateParams, type CustomDomainData, type CustomDomainId, type CustomDomainListParams, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, type DashboardSummary, type DatabaseCreateParams, type DatabaseCredentials, type DatabaseData, type DatabaseId, type DatabaseListParams, type DatabaseLogsParams, type DatabaseLogsResult, Databases, type DeploymentBuildData, DeploymentConnectors, type DeploymentCreateParams, type DeploymentData, DeploymentDomains, type DeploymentId, type DeploymentListParams, type DeploymentProduct, type DeploymentReleaseData, type DeploymentReleaseId, DeploymentReleases, DeploymentRuntimeInstances, type DeploymentServiceData, type DeploymentServiceId, type DeploymentServiceType, type DeploymentSourceType, type DeploymentState, type DeploymentUpdateParams, type DeploymentVersionData, type DeploymentVersionId, type DeploymentVersionKind, type DeploymentVersionState, DeploymentVersions, Deployments, Desktop$1 as Desktop, type DesktopActionResult, type DeviceBootstrapParams, type DeviceBootstrapResult, type DeviceBrowserResult, type DeviceCapabilities, type DeviceData, type DeviceExecParams, type DeviceExecResult, type DeviceExposeParams, type DeviceExposeResult, type DeviceExtendParams, type DeviceFileEntry, type DeviceFileListParams, type DeviceKind, type DeviceLifecycleResult, type DeviceListParams, type DeviceReadFileParams, type DeviceReadFileResult, type DeviceWriteFileParams, type DeviceWriteFileResult, Devices, type DirEntry, type DirListResult, type DiscordSendTestParams, DockerDeploy, type DockerDeployApplianceStatus, type DockerDeployCreateParams, type DockerDeployDoctorCheck, type DockerDeployDoctorParams, type DockerDeployDoctorProbe, type DockerDeployDoctorResult, type DockerDeployHostData, type DockerDeployHostEnsureParams, type DockerDeployHostId, type DockerDeployHostListParams, type DockerDeployHostListResponse, type DockerDeployHostResponse, type DockerDeployHostStatus, type DoubleClickParams, type DragParams, type EgressAllowlistRule, EgressAudit, type EgressAuditEvent, type EgressBindingData, EgressHostNotAllowedError, EgressNetwork, type EgressPolicyData, type EgressPolicyMode, type EgressRuleEffect, type EgressSecretData, type EgressSecretScope, type EgressSecretType, EgressSecrets, type EgressSuggestion, Email, EmailCampaigns, EmailInbox, EmailTemplates, type EmbeddingCreateParams, Embeddings, Exec, type ExecParams, type ExecPythonParams, type ExecResult, type ExternalAttribution, type ExternalKeyCreateParams, type ExternalKeyData, ExternalKeys, type FileDeleteParams, type FileDownloadParams, type FileEntry, type FileExportParams, type FileExportResult, type FileListParams, type FileListResult, type FileStat, Files, FlatCustomDomains, type FsEntry, type FsListResponse, type FsStat, type FunctionCreateParams, type FunctionData, type FunctionId, type FunctionInvokeParams, type FunctionListParams, type FunctionUpdateParams, Functions, type GithubRepo, type GithubSshKey, type HealthCheckCreateParams, type HealthCheckData, type HealthCheckId, type HealthCheckListParams, type HealthCheckUpdateParams, HealthChecks, type HostCreateParams, type HostData, type HostEvent, type HostId, type HostListResponse, type HostStatus, type HostUpdateParams, InstallationRequiredError, InsufficientCreditsError, type IntegrationCatalogEntry, type IntegrationData, Integrations, type JobData, type JobEvent, type JobEventType, type JobId, type JobListResponse, type JobRunParams, type JobStatus, type KeyParams, type LaunchParams, type LinearCreateIssueParams, type ListAdminApiKeysParams, type ListAdminComputersParams, type ListAdminTenantsParams, type ListAdminUsersParams, ManagedProviderBindingOnlyError, Mcp, type McpDispatchParams, Miosa, type MiosaClientConfig, MiosaError, type MiosaErrorBody, type MkdirParams, type ModeParams, Models, type MouseButton, NetworkError, NetworkPolicy, type NetworkPolicyData, type NetworkPolicyEffect, type NetworkPolicyProtocol, type NetworkPolicyRule, type NetworkPolicySetParams, NotFoundError, type NotificationPrefsUpdateParams, OAuthFlow, type OauthConnectParams, type OauthProvider, type OauthStartResult, type OauthStatusResult, type ObjectListParams, type AgentEvent as OcAgentEvent, type OcAgentSessionData, type AgentSessionListResponse as OcAgentSessionListResponse, type OcWorkspaceCreateParams, type OcWorkspaceData, type OcWorkspaceEvent, type OcWorkspaceListResponse, type OcWorkspaceStatus, type OcWorkspaceUpdateParams, OpenComputers, type OrgInvite, type OrgInviteCreated, type OrgInviteCreatedResponse, type OrgInviteListResponse, type OrgInvitePreview, type OrgInviteRevokeResponse, OrgInvites, type OrgRole, type OverviewData, type PolicyCreateParams, type PolicyListParams, type PolicyUpdateParams, type PresignParams, type PresignResult, type PreviewDomainData, ProjectAuth, type ProjectAuthEnableParams, type ProjectAuthStatus, type ProjectAuthUpdateParams, type ProjectIntegrationCatalogEntry, type ProjectIntegrationCreateParams, type ProjectIntegrationData, type ProjectIntegrationListParams, type ProjectIntegrationUpdateParams, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, type ProviderKeyUpsertParams, type PublishFromSandboxParams, type PublishParams, type PublishResult, RateLimitError, type RegionData, Regions, type RollbackParams, type RulesListParams, type RuntimeCapabilities, RuntimeCapabilitiesResource, RuntimeEnv, type RuntimeEnvListParams, type RuntimeEnvScope, type RuntimeEnvSetParams, type RuntimeEnvTarget, type RuntimeEnvVar, type RuntimeInstanceData, type RuntimeInstanceId, type RuntimeInstanceState, type RuntimeLogsResult, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, type SandboxBuildSpec, type SandboxBuildSpecError, type SandboxBuildSpecValidation, SandboxCommands, type SandboxConnectorAttachParams, type SandboxConnectorBinding, type SandboxConnectorPreflightParams, type SandboxConnectorPreflightResult, SandboxConnectors, type SandboxCreateParams, type SandboxData, SandboxEnv, SandboxEvents, type SandboxExecEvent, type SandboxExecOptions, type SandboxExecResult, type SandboxExecRunner, SandboxFiles, type SandboxGetOrCreateParams, type SandboxId, type SandboxListParams, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, type SandboxState, SandboxTags, type SandboxTemplate, type SandboxTemplateBuild, type SandboxTemplateBuildCreateParams, type SandboxTemplateBuildResourceData, type SandboxTemplateBuildResourceId, type SandboxTemplateCreateParams, type SandboxTemplateList, type SandboxTemplateListParams, type SandboxTemplateResourceData, type SandboxTemplateResourceId, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, type ScrollDirection, type ScrollParams, type SecretCreateParams, type SecretData, type SecretId, type SecretListParams, type SecretRotateParams, type SecretSetParams, type SecretUpdateParams, type SessionId, Settings, type SettingsUpdateParams, type SizeData, type SlackSendTestParams, type SnapshotCreateParams, type SnapshotData, type SnapshotListResponse, type SnapshotProgressEvent, type SnapshotRestoreResult, type SnapshotStatus, SnapshotsStandalone, Storage, type StorageObjectData, SubjectNotAllowedError, type SuggestionsParams, type TemplateBuildCreateParams, type TemplateCreateParams, type TemplateData, Tenant, type TenantBrandingUpdateParams, type TenantId, type TenantPlan, type TenantSummary, type TerminalCreateParams, TimeoutError, type TimeseriesParams, TokenRefreshFailedError, type TunnelAuthMode, type TunnelCreateParams, type TunnelData, type TunnelId, type TunnelListResponse, type TunnelUpdateParams, type TypeParams, type UpdateWorkspaceMemberRoleParams, Usage, type UsageReportParams, type UsageSession, type UsageSessionsParams, type UsageSummary, UserAuthorizationRequiredError, type UserId, ValidationError, type VersionListParams, type VolumeCreateParams, type VolumeData, type VolumeId, type VolumeListParams, Volumes, type WaitParams, type WebhookCreateParams, type WebhookData, type WebhookDeliveryData, type WebhookDeliveryId, type WebhookId, type WebhookListParams, type WebhookUpdateParams, Webhooks, type WindowFocusParams, type WindowInfo, type WorkspaceId, type WorkspaceInvite, type WorkspaceInviteCreatedResponse, type WorkspaceInviteListResponse, type WorkspaceInvitePreview, type WorkspaceInviteRevokeResponse, WorkspaceInvites, type WorkspaceMember, type WorkspaceMemberAddedResponse, type WorkspaceMemberDeleteResponse, type WorkspaceMemberListResponse, type WorkspaceMemberRecord, type WorkspaceMemberRecordResponse, WorkspaceMembers, type WorkspaceRole, type WsTicket, createAgentBuildExecutionPacket, createAgentBuildOutputContract, createAgentBuildPrompt, createBuildAgentRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
|
|
7657
|
+
export { AGENT_BUILD_KIND_SPECS, type AcceptOrgInviteResponse, type AcceptWorkspaceInviteResponse, type AddDomainParams, type AddWorkspaceMemberParams, Admin, type AgentBuildArtifactSpec, type AgentBuildExecutionPacket, type AgentBuildKind, type AgentBuildKindSpec, type AgentBuildPlannerDocument, type AgentDispatchParams, type AgentEvent$1 as AgentEvent, type AgentEventType, type AgentRun, type AgentRunCreateParams, type AgentRunEvent, type AgentRunGroup, type AgentRunGroupArtifact, type AgentRunGroupCounts, type AgentRunGroupCreateParams, type AgentRunGroupDispatchEntry, type AgentRunGroupDispatchResult, type AgentRunGroupEvent, type AgentRunGroupListParams, type AgentRunGroupStatus, type AgentRunGroupWaitOptions, AgentRunGroups, type AgentRunListParams, type AgentRunStatus, type AgentRunTargetKind, type AgentRunWaitOptions, AgentRuns, AgentRuntimeProfiles, type AgentSessionCreateParams, type AgentSessionData, type AgentSessionListResponse$1 as AgentSessionListResponse, type AgentSessionStatus$1 as AgentSessionStatus, type AllowParams, Analytics, type AnalyticsFilters, type ApiKeyCreateParams, type ApiKeyCreateResult, type ApiKeyData, type ApiKeyId, type ApiKeyListParams, ApiKeys, AppAuth, type AppAuthConfig, type AppAuthResourceType, type AppAuthSession, type AppAuthTokenPayload, type AppCatalogEntry, type AppInstallData, type AppInstallEvent, type AttachAwsRoleParams, type AuditListParams, AuditLog, type AuditLogEvent, type AuditLogListParams, type AuditTailParams, AuthError, type AuthToken, type BenchmarkCompareParams, type BenchmarkCreateParams, Benchmarks, type BindingCreateParams, type BindingListParams, type BrandingData, type BrandingUpdateParams, type BucketCreateParams, type BucketData, type BucketId, type BuilderSessionListParams, BuilderSessions, type BulkUserActionParams, type ChannelCreateParams, type ChannelData, type ChannelListParams, type ChannelUpdateParams, Channels, type ChatCompletionCreateParams, type ChatCompletionCreateStreamParams, Checkpoints, type ClickParams, Cloud, type CloudAccount, type CloudAccountCreateParams, type CloudAccountMode, type CloudAccountStatus, type CloudCredentialType, type CloudListParams, type CloudPlacementScope, type CloudPool, type CloudPoolCreateParams, type CloudPoolKind, type CloudPreflightRecordParams, type CloudPreflightRun, type CloudPreflightStatus, type CloudProvider, type CloudRegion, type CloudRegionCreateParams, type ClusterCreateParams, type ClusterData, type ClusterEvent, type ClusterId, type ClusterListResponse, type ClusterStatus, CommandCenter, Community, type CompletionCreateParams, type CompletionCreateStreamParams, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, type ComputerCreateParams, type ComputerData, ComputerEnv, type ComputerId, ComputerInbox, type ComputerListParams, type ComputerListResponse, ComputerLogs, type ComputerLogsGetParams, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, type ComputerSize, type ComputerStatus, type ComputerTemplateType, ComputerTerminal, type ComputerUpdateParams, type ComputerVisibility, ComputerVolumes, Computers, type ConnectorApplicableDefaultParams, type ConnectorCreateParams, type ConnectorData, type ConnectorDefault, type ConnectorDefaultListParams, type ConnectorDefaultParams, type ConnectorListParams, type ConnectorSubject, type ConnectorTokenParams, type ConnectorTokenResponse, Connectors, type CopyParams, type CreateAdminApiKeyParams, type CreateAgentBuildPacketParams, type CreateBuildAgentRunParams, type CreateOrgInviteParams, type CreateWorkspaceInviteParams, type CreateWorkspaceInviteResponse, type CreditBalance, type CreditTransaction, type CreditTransactionListResponse, type CreditUsage, Credits, type CronJobCreateParams, type CronJobData, type CronJobExecutionData, type CronJobExecutionId, type CronJobId, type CronJobListParams, type CronJobUpdateParams, CronJobs, type CursorInfo, type CustomDomainCreateParams, type CustomDomainData, type CustomDomainId, type CustomDomainListParams, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, type DashboardSummary, type DatabaseCreateParams, type DatabaseCredentials, type DatabaseData, type DatabaseId, type DatabaseListParams, type DatabaseLogsParams, type DatabaseLogsResult, Databases, type DeploymentBuildData, DeploymentConnectors, type DeploymentCreateParams, type DeploymentData, DeploymentDomains, type DeploymentId, type DeploymentListParams, type DeploymentProduct, type DeploymentReleaseData, type DeploymentReleaseId, DeploymentReleases, DeploymentRuntimeInstances, type DeploymentServiceData, type DeploymentServiceId, type DeploymentServiceType, type DeploymentSourceType, type DeploymentState, type DeploymentUpdateParams, type DeploymentVersionData, type DeploymentVersionId, type DeploymentVersionKind, type DeploymentVersionState, DeploymentVersions, Deployments, Desktop$1 as Desktop, type DesktopActionResult, type DeviceBootstrapParams, type DeviceBootstrapResult, type DeviceBrowserResult, type DeviceCapabilities, type DeviceData, type DeviceExecParams, type DeviceExecResult, type DeviceExposeParams, type DeviceExposeResult, type DeviceExtendParams, type DeviceFileEntry, type DeviceFileListParams, type DeviceKind, type DeviceLifecycleResult, type DeviceListParams, type DeviceReadFileParams, type DeviceReadFileResult, type DeviceWriteFileParams, type DeviceWriteFileResult, Devices, type DirEntry, type DirListResult, type DiscordSendTestParams, DockerDeploy, type DockerDeployApplianceStatus, type DockerDeployCreateParams, type DockerDeployDoctorCheck, type DockerDeployDoctorParams, type DockerDeployDoctorProbe, type DockerDeployDoctorResult, type DockerDeployHostData, type DockerDeployHostEnsureParams, type DockerDeployHostId, type DockerDeployHostListParams, type DockerDeployHostListResponse, type DockerDeployHostResponse, type DockerDeployHostStatus, type DoubleClickParams, type DragParams, type EgressAllowlistRule, EgressAudit, type EgressAuditEvent, type EgressBindingData, EgressHostNotAllowedError, EgressNetwork, type EgressPolicyData, type EgressPolicyMode, type EgressRuleEffect, type EgressSecretData, type EgressSecretScope, type EgressSecretType, EgressSecrets, type EgressSuggestion, Email, EmailCampaigns, EmailInbox, EmailTemplates, type EmbeddingCreateParams, Embeddings, Exec, type ExecParams, type ExecPythonParams, type ExecResult, type ExternalAttribution, type ExternalKeyCreateParams, type ExternalKeyData, ExternalKeys, type FileDeleteParams, type FileDownloadParams, type FileEntry, type FileExportParams, type FileExportResult, type FileListParams, type FileListResult, type FileStat, Files, FlatCustomDomains, type FsEntry, type FsListResponse, type FsStat, type FunctionCreateParams, type FunctionData, type FunctionId, type FunctionInvokeParams, type FunctionListParams, type FunctionUpdateParams, Functions, type GithubRepo, type GithubSshKey, type HealthCheckCreateParams, type HealthCheckData, type HealthCheckId, type HealthCheckListParams, type HealthCheckUpdateParams, HealthChecks, type HostCreateParams, type HostData, type HostEvent, type HostId, type HostListResponse, type HostStatus, type HostUpdateParams, InstallationRequiredError, InsufficientCreditsError, type IntegrationCatalogEntry, type IntegrationData, Integrations, type JobData, type JobEvent, type JobEventType, type JobId, type JobListResponse, type JobRunParams, type JobStatus, type KeyParams, type LaunchParams, type LinearCreateIssueParams, type ListAdminApiKeysParams, type ListAdminComputersParams, type ListAdminTenantsParams, type ListAdminUsersParams, ManagedProviderBindingOnlyError, Mcp, type McpDispatchParams, Miosa, type MiosaClientConfig, MiosaError, type MiosaErrorBody, type MkdirParams, type ModeParams, Models, type MouseButton, NetworkError, NetworkPolicy, type NetworkPolicyData, type NetworkPolicyEffect, type NetworkPolicyProtocol, type NetworkPolicyRule, type NetworkPolicySetParams, NotFoundError, type NotificationPrefsUpdateParams, OAuthFlow, type OauthConnectParams, type OauthProvider, type OauthStartResult, type OauthStatusResult, type ObjectListParams, type AgentEvent as OcAgentEvent, type OcAgentSessionData, type AgentSessionListResponse as OcAgentSessionListResponse, type OcWorkspaceCreateParams, type OcWorkspaceData, type OcWorkspaceEvent, type OcWorkspaceListResponse, type OcWorkspaceStatus, type OcWorkspaceUpdateParams, OpenComputers, type OrgInvite, type OrgInviteCreated, type OrgInviteCreatedResponse, type OrgInviteListResponse, type OrgInvitePreview, type OrgInviteRevokeResponse, OrgInvites, type OrgRole, type OverviewData, type PolicyCreateParams, type PolicyListParams, type PolicyUpdateParams, type PresignParams, type PresignResult, type PreviewDomainData, ProjectAuth, type ProjectAuthEnableParams, type ProjectAuthStatus, type ProjectAuthUpdateParams, type ProjectIntegrationCatalogEntry, type ProjectIntegrationCreateParams, type ProjectIntegrationData, type ProjectIntegrationListParams, type ProjectIntegrationUpdateParams, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, type ProviderKeyUpsertParams, type PublishFromSandboxParams, type PublishParams, type PublishResult, RateLimitError, type RegionData, Regions, type RollbackParams, type RulesListParams, type RuntimeCapabilities, RuntimeCapabilitiesResource, RuntimeEnv, type RuntimeEnvListParams, type RuntimeEnvScope, type RuntimeEnvSetParams, type RuntimeEnvTarget, type RuntimeEnvVar, type RuntimeInstanceData, type RuntimeInstanceId, type RuntimeInstanceState, type RuntimeLogsResult, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, type SandboxBuildSpec, type SandboxBuildSpecError, type SandboxBuildSpecValidation, SandboxCommands, type SandboxConnectorAttachParams, type SandboxConnectorBinding, type SandboxConnectorPreflightParams, type SandboxConnectorPreflightResult, SandboxConnectors, type SandboxCreateParams, type SandboxData, SandboxEnv, SandboxEvents, type SandboxExecEvent, type SandboxExecOptions, type SandboxExecResult, type SandboxExecRunner, SandboxFiles, type SandboxGetOrCreateParams, type SandboxId, type SandboxListParams, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, type SandboxState, SandboxTags, type SandboxTemplate, type SandboxTemplateBuild, type SandboxTemplateBuildCreateParams, type SandboxTemplateBuildResourceData, type SandboxTemplateBuildResourceId, type SandboxTemplateCreateParams, type SandboxTemplateList, type SandboxTemplateListParams, type SandboxTemplateResourceData, type SandboxTemplateResourceId, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, type ScrollDirection, type ScrollParams, type SecretCreateParams, type SecretData, type SecretId, type SecretListParams, type SecretRotateParams, type SecretSetParams, type SecretUpdateParams, type SessionId, Settings, type SettingsUpdateParams, type SizeData, type SlackSendTestParams, type SnapshotCreateParams, type SnapshotData, type SnapshotListResponse, type SnapshotProgressEvent, type SnapshotRestoreResult, type SnapshotStatus, SnapshotsStandalone, Storage, type StorageObjectData, SubjectNotAllowedError, type SuggestionsParams, type TemplateBuildCreateParams, type TemplateCreateParams, type TemplateData, Tenant, type TenantBrandingUpdateParams, type TenantId, type TenantPlan, type TenantSummary, type TerminalCreateParams, TimeoutError, type TimeseriesParams, TokenRefreshFailedError, type TunnelAuthMode, type TunnelCreateParams, type TunnelData, type TunnelId, type TunnelListResponse, type TunnelUpdateParams, type TypeParams, type UpdateWorkspaceMemberRoleParams, Usage, type UsageReportParams, type UsageSession, type UsageSessionsParams, type UsageSummary, UserAuthorizationRequiredError, type UserId, ValidationError, type VersionListParams, type VolumeAttachParams, type VolumeAttachmentData, type VolumeCreateParams, type VolumeData, type VolumeId, type VolumeListParams, Volumes, type WaitParams, type WebhookCreateParams, type WebhookData, type WebhookDeliveryData, type WebhookDeliveryId, type WebhookId, type WebhookListParams, type WebhookUpdateParams, Webhooks, type WindowFocusParams, type WindowInfo, type WorkspaceId, type WorkspaceInvite, type WorkspaceInviteCreatedResponse, type WorkspaceInviteListResponse, type WorkspaceInvitePreview, type WorkspaceInviteRevokeResponse, WorkspaceInvites, type WorkspaceMember, type WorkspaceMemberAddedResponse, type WorkspaceMemberDeleteResponse, type WorkspaceMemberListResponse, type WorkspaceMemberRecord, type WorkspaceMemberRecordResponse, WorkspaceMembers, type WorkspaceRole, type WsTicket, createAgentBuildExecutionPacket, createAgentBuildOutputContract, createAgentBuildPrompt, createBuildAgentRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
|
package/dist/index.js
CHANGED
|
@@ -1047,6 +1047,11 @@ var AgentRuns = class {
|
|
|
1047
1047
|
timeout: params.timeout,
|
|
1048
1048
|
wait: params.wait,
|
|
1049
1049
|
env: params.env,
|
|
1050
|
+
output_format: params.outputFormat ?? params.output_format,
|
|
1051
|
+
resume_session_id: params.resumeSessionId ?? params.resume_session_id,
|
|
1052
|
+
json: params.json,
|
|
1053
|
+
output_schema: params.outputSchema ?? params.output_schema,
|
|
1054
|
+
image: params.image,
|
|
1050
1055
|
agent_runtime_profile_id: params.agentRuntimeProfileId,
|
|
1051
1056
|
agent_profile_id: params.agentProfileId,
|
|
1052
1057
|
agent_run_group_id: params.agentRunGroupId,
|
|
@@ -2684,6 +2689,18 @@ var Desktop = class {
|
|
|
2684
2689
|
button
|
|
2685
2690
|
});
|
|
2686
2691
|
}
|
|
2692
|
+
/** Explicit left-button click. Alias for click(x, y, "left"). */
|
|
2693
|
+
async leftClick(x, y) {
|
|
2694
|
+
return this.click(x, y, "left");
|
|
2695
|
+
}
|
|
2696
|
+
/** Right-button click. Alias for click(x, y, "right"). */
|
|
2697
|
+
async rightClick(x, y) {
|
|
2698
|
+
return this.click(x, y, "right");
|
|
2699
|
+
}
|
|
2700
|
+
/** Middle-button click. Alias for click(x, y, "middle"). */
|
|
2701
|
+
async middleClick(x, y) {
|
|
2702
|
+
return this.click(x, y, "middle");
|
|
2703
|
+
}
|
|
2687
2704
|
/** Double-click at the given coordinates. */
|
|
2688
2705
|
async doubleClick(x, y) {
|
|
2689
2706
|
const params = { x, y };
|
|
@@ -2692,16 +2709,28 @@ var Desktop = class {
|
|
|
2692
2709
|
params
|
|
2693
2710
|
);
|
|
2694
2711
|
}
|
|
2712
|
+
/** Move the mouse pointer without clicking. */
|
|
2713
|
+
async moveMouse(x, y) {
|
|
2714
|
+
return this.http.post(`${this.base()}/move`, { x, y });
|
|
2715
|
+
}
|
|
2695
2716
|
/** Type text into the currently focused element. */
|
|
2696
2717
|
async type(text, delay) {
|
|
2697
2718
|
const params = { text, ...delay !== void 0 && { delay } };
|
|
2698
2719
|
return this.http.post(`${this.base()}/type`, params);
|
|
2699
2720
|
}
|
|
2721
|
+
/** Alias for `type(text)` used by simple computer-control loops. */
|
|
2722
|
+
async write(text, delay) {
|
|
2723
|
+
return this.type(text, delay);
|
|
2724
|
+
}
|
|
2700
2725
|
/** Send a key or key combination (e.g. "Enter", "ctrl+c"). */
|
|
2701
2726
|
async key(key) {
|
|
2702
2727
|
const params = { key };
|
|
2703
2728
|
return this.http.post(`${this.base()}/key`, params);
|
|
2704
2729
|
}
|
|
2730
|
+
/** Alias for `key(key)` used by simple computer-control loops. */
|
|
2731
|
+
async press(key) {
|
|
2732
|
+
return this.key(key);
|
|
2733
|
+
}
|
|
2705
2734
|
/** Scroll in a direction at an optional position. */
|
|
2706
2735
|
async scroll(direction, clicks = 3, x, y) {
|
|
2707
2736
|
const params = {
|
|
@@ -4099,6 +4128,24 @@ var Computer = class _Computer {
|
|
|
4099
4128
|
this.data = await this.http.get(`/computers/${this.id}`);
|
|
4100
4129
|
return this;
|
|
4101
4130
|
}
|
|
4131
|
+
/**
|
|
4132
|
+
* Run an AI agent inside this Computer.
|
|
4133
|
+
*
|
|
4134
|
+
* The Computer is the graphical desktop VM product. This dispatches the
|
|
4135
|
+
* same Agent Runs API as `miosa agent run --computer`, scoped to this VM.
|
|
4136
|
+
*/
|
|
4137
|
+
async prompt(instruction, options = {}) {
|
|
4138
|
+
return new AgentRuns(this.http).run({
|
|
4139
|
+
...options,
|
|
4140
|
+
prompt: instruction,
|
|
4141
|
+
targetKind: "computer",
|
|
4142
|
+
targetId: this.id,
|
|
4143
|
+
computerId: this.id,
|
|
4144
|
+
provider: options.provider ?? "claude",
|
|
4145
|
+
cwd: options.cwd ?? "/workspace",
|
|
4146
|
+
wait: options.wait ?? true
|
|
4147
|
+
});
|
|
4148
|
+
}
|
|
4102
4149
|
// ─── Desktop shortcuts ─────────────────────────────────────────────────────
|
|
4103
4150
|
/**
|
|
4104
4151
|
* Capture a desktop screenshot as PNG bytes.
|
|
@@ -4138,6 +4185,14 @@ var Computer = class _Computer {
|
|
|
4138
4185
|
async doubleClick(x, y) {
|
|
4139
4186
|
await this.desktop.doubleClick(x, y);
|
|
4140
4187
|
}
|
|
4188
|
+
/** Middle-button click. */
|
|
4189
|
+
async middleClick(x, y) {
|
|
4190
|
+
await this.desktop.click(x, y, "middle");
|
|
4191
|
+
}
|
|
4192
|
+
/** Move the pointer without clicking. */
|
|
4193
|
+
async moveMouse(x, y) {
|
|
4194
|
+
await this.desktop.moveMouse(x, y);
|
|
4195
|
+
}
|
|
4141
4196
|
/**
|
|
4142
4197
|
* Type text into the focused element.
|
|
4143
4198
|
* Shortcut for `computer.desktop.type(text)`.
|
|
@@ -4145,6 +4200,10 @@ var Computer = class _Computer {
|
|
|
4145
4200
|
async type(text) {
|
|
4146
4201
|
await this.desktop.type(text);
|
|
4147
4202
|
}
|
|
4203
|
+
/** Alias for `type(text)`. */
|
|
4204
|
+
async write(text) {
|
|
4205
|
+
await this.desktop.write(text);
|
|
4206
|
+
}
|
|
4148
4207
|
/**
|
|
4149
4208
|
* Send a key or key combo.
|
|
4150
4209
|
* Shortcut for `computer.desktop.key(key)`.
|
|
@@ -4152,6 +4211,10 @@ var Computer = class _Computer {
|
|
|
4152
4211
|
async key(key) {
|
|
4153
4212
|
await this.desktop.key(key);
|
|
4154
4213
|
}
|
|
4214
|
+
/** Alias for `key(key)`. */
|
|
4215
|
+
async press(key) {
|
|
4216
|
+
await this.desktop.press(key);
|
|
4217
|
+
}
|
|
4155
4218
|
/**
|
|
4156
4219
|
* Scroll in a direction.
|
|
4157
4220
|
* Shortcut for `computer.desktop.scroll(direction, clicks)`.
|
|
@@ -4267,6 +4330,17 @@ var Computer = class _Computer {
|
|
|
4267
4330
|
await this.http.post(`/computers/${this.id}/stream-token`)
|
|
4268
4331
|
);
|
|
4269
4332
|
}
|
|
4333
|
+
/**
|
|
4334
|
+
* Mint a passwordless browser embed URL for authenticated platform sessions.
|
|
4335
|
+
*
|
|
4336
|
+
* Use this inside MIOSA or tenant apps. Raw shared desktop URLs can still use
|
|
4337
|
+
* the viewer password flow when opened outside an authenticated platform.
|
|
4338
|
+
*/
|
|
4339
|
+
async embed() {
|
|
4340
|
+
return unwrapData(
|
|
4341
|
+
await this.http.get(`/computers/${this.id}/embed`)
|
|
4342
|
+
);
|
|
4343
|
+
}
|
|
4270
4344
|
/** Clone this computer into a new one. */
|
|
4271
4345
|
async clone(opts = {}) {
|
|
4272
4346
|
const body4 = Object.fromEntries(
|
|
@@ -7039,6 +7113,11 @@ var Regions = class {
|
|
|
7039
7113
|
const data = await this.http.get("/compute/regions");
|
|
7040
7114
|
return listItems10(data);
|
|
7041
7115
|
}
|
|
7116
|
+
/** Get canonical compute catalog, including product templates and readiness. */
|
|
7117
|
+
async catalog() {
|
|
7118
|
+
const data = await this.http.get("/compute/catalog");
|
|
7119
|
+
return unwrap41(data);
|
|
7120
|
+
}
|
|
7042
7121
|
/** List available compute sizes. */
|
|
7043
7122
|
async listSizes() {
|
|
7044
7123
|
const data = await this.http.get("/compute/sizes");
|
|
@@ -7426,6 +7505,15 @@ var SandboxEvents = class {
|
|
|
7426
7505
|
return this.sandbox.http.stream(`/sandboxes/${this.sandbox.id}/events`);
|
|
7427
7506
|
}
|
|
7428
7507
|
};
|
|
7508
|
+
var SandboxMetrics = class {
|
|
7509
|
+
constructor(sandbox) {
|
|
7510
|
+
this.sandbox = sandbox;
|
|
7511
|
+
}
|
|
7512
|
+
sandbox;
|
|
7513
|
+
get(window2 = "1h") {
|
|
7514
|
+
return this.sandbox.metrics(window2);
|
|
7515
|
+
}
|
|
7516
|
+
};
|
|
7429
7517
|
var SandboxPreviews = class {
|
|
7430
7518
|
constructor(sandbox) {
|
|
7431
7519
|
this.sandbox = sandbox;
|
|
@@ -7566,6 +7654,7 @@ var Sandbox = class _Sandbox {
|
|
|
7566
7654
|
this.snapshots = new SandboxSnapshots(this);
|
|
7567
7655
|
this.terminal = new SandboxTerminal(this);
|
|
7568
7656
|
this.events = new SandboxEvents(this);
|
|
7657
|
+
this.metricsResource = new SandboxMetrics(this);
|
|
7569
7658
|
this.previews = new SandboxPreviews(this);
|
|
7570
7659
|
this.env = new SandboxEnv(this);
|
|
7571
7660
|
this.tags = new SandboxTags(this);
|
|
@@ -7588,6 +7677,8 @@ var Sandbox = class _Sandbox {
|
|
|
7588
7677
|
terminal;
|
|
7589
7678
|
/** SSE event stream. */
|
|
7590
7679
|
events;
|
|
7680
|
+
/** Operational metrics and current resource state. */
|
|
7681
|
+
metricsResource;
|
|
7591
7682
|
/** Preview CRUD + share/revokeShare. */
|
|
7592
7683
|
previews;
|
|
7593
7684
|
/** Read-only env var listing. */
|
|
@@ -7620,6 +7711,24 @@ var Sandbox = class _Sandbox {
|
|
|
7620
7711
|
);
|
|
7621
7712
|
return this;
|
|
7622
7713
|
}
|
|
7714
|
+
/**
|
|
7715
|
+
* Run an AI coding agent inside this Sandbox.
|
|
7716
|
+
*
|
|
7717
|
+
* Defaults to Claude Code, waits for completion, and runs from `/workspace`.
|
|
7718
|
+
* Pass `{ provider: "codex", env: { CODEX_API_KEY } }` to run Codex.
|
|
7719
|
+
*/
|
|
7720
|
+
async prompt(instruction, options = {}) {
|
|
7721
|
+
return new AgentRuns(this.http).run({
|
|
7722
|
+
...options,
|
|
7723
|
+
prompt: instruction,
|
|
7724
|
+
targetKind: "sandbox",
|
|
7725
|
+
targetId: this.id,
|
|
7726
|
+
sandboxId: this.id,
|
|
7727
|
+
provider: options.provider ?? "claude",
|
|
7728
|
+
cwd: options.cwd ?? "/workspace",
|
|
7729
|
+
wait: options.wait ?? true
|
|
7730
|
+
});
|
|
7731
|
+
}
|
|
7623
7732
|
async runExec(command, options) {
|
|
7624
7733
|
this.assertRunning("exec");
|
|
7625
7734
|
const response = unwrap44(
|
|
@@ -7712,6 +7821,14 @@ var Sandbox = class _Sandbox {
|
|
|
7712
7821
|
async expose(port) {
|
|
7713
7822
|
return (await this.exposeInfo(port)).url;
|
|
7714
7823
|
}
|
|
7824
|
+
async getUrl(port, path = "/") {
|
|
7825
|
+
const url = new URL((await this.exposeInfo(port)).url);
|
|
7826
|
+
url.pathname = path.startsWith("/") ? path : `/${path}`;
|
|
7827
|
+
return url.toString();
|
|
7828
|
+
}
|
|
7829
|
+
async getHost(port) {
|
|
7830
|
+
return new URL((await this.exposeInfo(port)).url).host;
|
|
7831
|
+
}
|
|
7715
7832
|
async exposeInfo(port) {
|
|
7716
7833
|
this.assertRunning("expose");
|
|
7717
7834
|
const response = unwrap44(
|
|
@@ -7750,6 +7867,17 @@ var Sandbox = class _Sandbox {
|
|
|
7750
7867
|
`/sandboxes/${this.id}/logs/stream`
|
|
7751
7868
|
);
|
|
7752
7869
|
}
|
|
7870
|
+
async metrics(window2 = "1h") {
|
|
7871
|
+
return unwrap44(
|
|
7872
|
+
await this.http.get(
|
|
7873
|
+
`/sandboxes/${this.id}/metrics`,
|
|
7874
|
+
{ window: window2 }
|
|
7875
|
+
)
|
|
7876
|
+
);
|
|
7877
|
+
}
|
|
7878
|
+
async getMetrics(window2 = "1h") {
|
|
7879
|
+
return this.metrics(window2);
|
|
7880
|
+
}
|
|
7753
7881
|
async createSnapshot(comment) {
|
|
7754
7882
|
this.assertRunning("snapshots.create");
|
|
7755
7883
|
return unwrap44(
|
|
@@ -8833,6 +8961,39 @@ var Volumes = class {
|
|
|
8833
8961
|
async delete(volumeId) {
|
|
8834
8962
|
await this.http.delete(`/volumes/${volumeId}`);
|
|
8835
8963
|
}
|
|
8964
|
+
async listAttachments(computerId) {
|
|
8965
|
+
const data = await this.http.get(`/computers/${computerId}/volumes`);
|
|
8966
|
+
return listItems15(data, [
|
|
8967
|
+
"data",
|
|
8968
|
+
"attachments",
|
|
8969
|
+
"volumes",
|
|
8970
|
+
"items"
|
|
8971
|
+
]);
|
|
8972
|
+
}
|
|
8973
|
+
async attach(computerId, params) {
|
|
8974
|
+
const volumeId = params.volumeId ?? params.volume_id;
|
|
8975
|
+
const mountPath = params.mountPath ?? params.mount_path;
|
|
8976
|
+
const readOnly = params.readOnly ?? params.read_only;
|
|
8977
|
+
const body4 = stripUndefined30({
|
|
8978
|
+
...params,
|
|
8979
|
+
volumeId: void 0,
|
|
8980
|
+
mountPath: void 0,
|
|
8981
|
+
readOnly: void 0,
|
|
8982
|
+
volume_id: volumeId,
|
|
8983
|
+
mount_path: mountPath,
|
|
8984
|
+
read_only: readOnly
|
|
8985
|
+
});
|
|
8986
|
+
const data = await this.http.post(
|
|
8987
|
+
`/computers/${computerId}/volumes`,
|
|
8988
|
+
body4
|
|
8989
|
+
);
|
|
8990
|
+
return unwrap51(data);
|
|
8991
|
+
}
|
|
8992
|
+
async detach(computerId, attachmentId) {
|
|
8993
|
+
await this.http.delete(
|
|
8994
|
+
`/computers/${computerId}/volumes/${attachmentId}`
|
|
8995
|
+
);
|
|
8996
|
+
}
|
|
8836
8997
|
};
|
|
8837
8998
|
function unwrap52(payload) {
|
|
8838
8999
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
@@ -9540,7 +9701,7 @@ function createAgentBuildExecutionPacket(params) {
|
|
|
9540
9701
|
quality_rules: params.qualityRules ?? [],
|
|
9541
9702
|
output_contract: outputContract,
|
|
9542
9703
|
runtime_instructions: {
|
|
9543
|
-
agent: "claude
|
|
9704
|
+
agent: "claude",
|
|
9544
9705
|
template: runtimeTemplate,
|
|
9545
9706
|
input_materialization: {
|
|
9546
9707
|
directory: DEFAULT_AGENT_BUILD_INPUT_ROOT,
|
|
@@ -9590,7 +9751,7 @@ function createBuildAgentRunParams(params) {
|
|
|
9590
9751
|
targetId: params.targetId,
|
|
9591
9752
|
sandboxId: params.sandboxId,
|
|
9592
9753
|
computerId: params.computerId,
|
|
9593
|
-
provider: params.provider ?? "claude
|
|
9754
|
+
provider: params.provider ?? "claude",
|
|
9594
9755
|
model: params.model,
|
|
9595
9756
|
cwd: params.cwd ?? "/workspace",
|
|
9596
9757
|
timeout: params.timeout ?? 1800,
|