@vm0/cli 9.157.1 → 9.158.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/{chunk-YWCHIHYE.js → chunk-AUKY6FBC.js} +584 -82
- package/{chunk-YWCHIHYE.js.map → chunk-AUKY6FBC.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -2
- package/zero.js +275 -1043
- package/zero.js.map +1 -1
|
@@ -30012,7 +30012,7 @@ var require_proxy_agent = __commonJS({
|
|
|
30012
30012
|
});
|
|
30013
30013
|
}
|
|
30014
30014
|
dispatch(opts, handler) {
|
|
30015
|
-
const headers =
|
|
30015
|
+
const headers = buildHeaders5(opts.headers);
|
|
30016
30016
|
throwIfProxyAuthIsSent(headers);
|
|
30017
30017
|
if (headers && !("host" in headers) && !("Host" in headers)) {
|
|
30018
30018
|
const { host } = new URL3(opts.origin);
|
|
@@ -30048,7 +30048,7 @@ var require_proxy_agent = __commonJS({
|
|
|
30048
30048
|
await this[kClient].destroy();
|
|
30049
30049
|
}
|
|
30050
30050
|
};
|
|
30051
|
-
function
|
|
30051
|
+
function buildHeaders5(headers) {
|
|
30052
30052
|
if (Array.isArray(headers)) {
|
|
30053
30053
|
const headersPair = {};
|
|
30054
30054
|
for (let i = 0; i < headers.length; i += 2) {
|
|
@@ -74083,7 +74083,7 @@ if (DSN) {
|
|
|
74083
74083
|
init2({
|
|
74084
74084
|
dsn: DSN,
|
|
74085
74085
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
74086
|
-
release: "9.
|
|
74086
|
+
release: "9.158.0",
|
|
74087
74087
|
sendDefaultPii: false,
|
|
74088
74088
|
tracesSampleRate: 0,
|
|
74089
74089
|
shutdownTimeout: 500,
|
|
@@ -74102,7 +74102,7 @@ if (DSN) {
|
|
|
74102
74102
|
}
|
|
74103
74103
|
});
|
|
74104
74104
|
setContext("cli", {
|
|
74105
|
-
version: "9.
|
|
74105
|
+
version: "9.158.0",
|
|
74106
74106
|
command: process.argv.slice(2).join(" ")
|
|
74107
74107
|
});
|
|
74108
74108
|
setContext("runtime", {
|
|
@@ -74342,7 +74342,8 @@ var FEATURE_SWITCHES = {
|
|
|
74342
74342
|
["pwaOfflineCache" /* PwaOfflineCache */]: {
|
|
74343
74343
|
maintainer: "ethan@vm0.ai",
|
|
74344
74344
|
description: "Enable PWA offline caching (static asset cache-first, offline fallback page, and service worker updateViaCache: none)",
|
|
74345
|
-
enabled: false
|
|
74345
|
+
enabled: false,
|
|
74346
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
74346
74347
|
},
|
|
74347
74348
|
["mailchimpConnector" /* MailchimpConnector */]: {
|
|
74348
74349
|
maintainer: "ethan@vm0.ai",
|
|
@@ -74380,10 +74381,17 @@ var FEATURE_SWITCHES = {
|
|
|
74380
74381
|
enabled: false,
|
|
74381
74382
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
74382
74383
|
},
|
|
74384
|
+
["desktopLocalAgent" /* DesktopLocalAgent */]: {
|
|
74385
|
+
maintainer: "lancy@vm0.ai",
|
|
74386
|
+
description: "Enable the Desktop-owned Local Agent page, folder selection, and native host lifecycle",
|
|
74387
|
+
enabled: false,
|
|
74388
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
74389
|
+
},
|
|
74383
74390
|
["lab" /* Lab */]: {
|
|
74384
74391
|
maintainer: "ethan@vm0.ai",
|
|
74385
74392
|
description: "Show the Lab page for toggling experimental features",
|
|
74386
|
-
enabled: false
|
|
74393
|
+
enabled: false,
|
|
74394
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
74387
74395
|
},
|
|
74388
74396
|
["auditLink" /* AuditLink */]: {
|
|
74389
74397
|
maintainer: "ethan@vm0.ai",
|
|
@@ -74408,8 +74416,7 @@ var FEATURE_SWITCHES = {
|
|
|
74408
74416
|
["chatHeaderNewButton" /* ChatHeaderNewButton */]: {
|
|
74409
74417
|
maintainer: "ethan@vm0.ai",
|
|
74410
74418
|
description: "Replace the Invite people button in the agent chat page header with a New button that creates a new chat thread",
|
|
74411
|
-
enabled: false
|
|
74412
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
74419
|
+
enabled: false
|
|
74413
74420
|
},
|
|
74414
74421
|
["agentPhoneAppUi" /* AgentPhoneAppUi */]: {
|
|
74415
74422
|
maintainer: "linghan@vm0.ai",
|
|
@@ -74420,8 +74427,7 @@ var FEATURE_SWITCHES = {
|
|
|
74420
74427
|
["chatMessageStartButton" /* ChatMessageStartButton */]: {
|
|
74421
74428
|
maintainer: "linghan@vm0.ai",
|
|
74422
74429
|
description: "Show an icon button in assistant message group actions that scrolls back to the start of that message group.",
|
|
74423
|
-
enabled: false
|
|
74424
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
74430
|
+
enabled: false
|
|
74425
74431
|
},
|
|
74426
74432
|
["goal" /* Goal */]: {
|
|
74427
74433
|
maintainer: "ethan@vm0.ai",
|
|
@@ -74432,8 +74438,7 @@ var FEATURE_SWITCHES = {
|
|
|
74432
74438
|
["chatThreadRename" /* ChatThreadRename */]: {
|
|
74433
74439
|
maintainer: "ethan@vm0.ai",
|
|
74434
74440
|
description: "Adds a Rename chat item to the sidebar thread kebab menu. When the user renames a thread, automated title generation is suppressed for that thread.",
|
|
74435
|
-
enabled: false
|
|
74436
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
74441
|
+
enabled: false
|
|
74437
74442
|
},
|
|
74438
74443
|
["docsSite" /* DocsSite */]: {
|
|
74439
74444
|
maintainer: "linghan@vm0.ai",
|
|
@@ -107984,92 +107989,586 @@ init_esm_shims();
|
|
|
107984
107989
|
// ../../packages/api-contracts/src/contracts/zero-computer-use.ts
|
|
107985
107990
|
init_esm_shims();
|
|
107986
107991
|
var c25 = initContract();
|
|
107987
|
-
var
|
|
107992
|
+
var computerUseHostStatusSchema = external_exports.enum(["online", "offline"]);
|
|
107993
|
+
var computerUseReadCommandKindSchema = external_exports.enum([
|
|
107994
|
+
"apps.list",
|
|
107995
|
+
"app.state"
|
|
107996
|
+
]);
|
|
107997
|
+
var computerUseWriteCommandKindSchema = external_exports.enum([
|
|
107998
|
+
"app.open",
|
|
107999
|
+
"element.click",
|
|
108000
|
+
"element.scroll",
|
|
108001
|
+
"element.set_value",
|
|
108002
|
+
"element.perform_action",
|
|
108003
|
+
"keyboard.type_text",
|
|
108004
|
+
"keyboard.press_key"
|
|
108005
|
+
]);
|
|
108006
|
+
var computerUseCommandKindSchema = external_exports.enum([
|
|
108007
|
+
...computerUseReadCommandKindSchema.options,
|
|
108008
|
+
...computerUseWriteCommandKindSchema.options
|
|
108009
|
+
]);
|
|
108010
|
+
var computerUseCommandStatusSchema = external_exports.enum([
|
|
108011
|
+
"pending_approval",
|
|
108012
|
+
"queued",
|
|
108013
|
+
"running",
|
|
108014
|
+
"succeeded",
|
|
108015
|
+
"failed"
|
|
108016
|
+
]);
|
|
108017
|
+
var computerUseCommandErrorCodeSchema = external_exports.enum([
|
|
108018
|
+
"no_host",
|
|
108019
|
+
"permission_denied",
|
|
108020
|
+
"accessibility_unavailable",
|
|
108021
|
+
"screen_recording_unavailable",
|
|
108022
|
+
"unsupported_command",
|
|
108023
|
+
"timeout"
|
|
108024
|
+
]);
|
|
108025
|
+
var hostNameSchema = external_exports.string().trim().min(1).max(128);
|
|
108026
|
+
var hostVersionSchema = external_exports.string().trim().min(1).max(64);
|
|
108027
|
+
var hostOsVersionSchema = external_exports.string().trim().min(1).max(128);
|
|
108028
|
+
var hostIdPathParamsSchema = external_exports.object({
|
|
108029
|
+
hostId: external_exports.string().min(1)
|
|
108030
|
+
});
|
|
108031
|
+
var commandIdPathParamsSchema = external_exports.object({
|
|
108032
|
+
commandId: external_exports.string().min(1)
|
|
108033
|
+
});
|
|
108034
|
+
var supportedCapabilitiesSchema = external_exports.array(external_exports.string().trim().min(1).max(128)).max(50);
|
|
108035
|
+
var appNameSchema = external_exports.string().trim().min(1).max(256);
|
|
108036
|
+
var snapshotIdSchema = external_exports.string().trim().min(1).max(256);
|
|
108037
|
+
var elementIdSchema = external_exports.string().trim().min(1).max(256);
|
|
108038
|
+
var computerUsePermissionsSchema = external_exports.object({
|
|
108039
|
+
accessibility: external_exports.boolean(),
|
|
108040
|
+
screenRecording: external_exports.boolean()
|
|
108041
|
+
});
|
|
108042
|
+
var computerUseRuntimeBodySchema = external_exports.object({
|
|
108043
|
+
hostName: hostNameSchema,
|
|
108044
|
+
appVersion: hostVersionSchema,
|
|
108045
|
+
osVersion: hostOsVersionSchema,
|
|
108046
|
+
supportedCapabilities: supportedCapabilitiesSchema.default([]),
|
|
108047
|
+
permissions: computerUsePermissionsSchema
|
|
108048
|
+
});
|
|
108049
|
+
var computerUseCommandTargetShape = {
|
|
108050
|
+
hostId: external_exports.string().min(1).optional(),
|
|
108051
|
+
hostName: hostNameSchema.optional(),
|
|
108052
|
+
timeoutMs: external_exports.number().int().min(1e3).max(6e4).default(15e3)
|
|
108053
|
+
};
|
|
108054
|
+
var computerUseCommandPayloadShape = {
|
|
108055
|
+
app: appNameSchema.optional(),
|
|
108056
|
+
snapshotId: snapshotIdSchema.optional(),
|
|
108057
|
+
elementId: elementIdSchema.optional(),
|
|
108058
|
+
x: external_exports.number().int().min(0).optional(),
|
|
108059
|
+
y: external_exports.number().int().min(0).optional(),
|
|
108060
|
+
button: external_exports.enum(["left", "right", "middle"]).optional(),
|
|
108061
|
+
clickCount: external_exports.number().int().min(1).max(3).optional(),
|
|
108062
|
+
direction: external_exports.enum(["up", "down", "left", "right"]).optional(),
|
|
108063
|
+
pages: external_exports.number().positive().max(25).optional(),
|
|
108064
|
+
value: external_exports.string().min(1).max(64e3).optional(),
|
|
108065
|
+
text: external_exports.string().min(1).max(64e3).optional(),
|
|
108066
|
+
key: external_exports.string().trim().min(1).max(256).optional(),
|
|
108067
|
+
action: external_exports.string().trim().min(1).max(256).optional()
|
|
108068
|
+
};
|
|
108069
|
+
var computerUseCommandCreateBodySchema = external_exports.object({
|
|
108070
|
+
kind: computerUseReadCommandKindSchema,
|
|
108071
|
+
...computerUseCommandTargetShape,
|
|
108072
|
+
...computerUseCommandPayloadShape
|
|
108073
|
+
}).superRefine((body, ctx) => {
|
|
108074
|
+
if (body.kind === "app.state" && !body.app) {
|
|
108075
|
+
ctx.addIssue({
|
|
108076
|
+
code: "custom",
|
|
108077
|
+
path: ["app"],
|
|
108078
|
+
message: "app.state requires app"
|
|
108079
|
+
});
|
|
108080
|
+
}
|
|
108081
|
+
});
|
|
108082
|
+
var computerUseWriteCommandCreateBaseSchema = external_exports.object({
|
|
108083
|
+
kind: computerUseWriteCommandKindSchema,
|
|
108084
|
+
...computerUseCommandTargetShape,
|
|
108085
|
+
...computerUseCommandPayloadShape
|
|
108086
|
+
});
|
|
108087
|
+
function requireComputerUseField(ctx, field, message) {
|
|
108088
|
+
ctx.addIssue({ code: "custom", path: [field], message });
|
|
108089
|
+
}
|
|
108090
|
+
function validateElementClickCommand(body, ctx) {
|
|
108091
|
+
const hasPoint = body.x !== void 0 && body.y !== void 0;
|
|
108092
|
+
if (!body.elementId && !hasPoint) {
|
|
108093
|
+
requireComputerUseField(
|
|
108094
|
+
ctx,
|
|
108095
|
+
"elementId",
|
|
108096
|
+
"element.click requires elementId or x/y"
|
|
108097
|
+
);
|
|
108098
|
+
}
|
|
108099
|
+
if (body.x === void 0 !== (body.y === void 0)) {
|
|
108100
|
+
requireComputerUseField(
|
|
108101
|
+
ctx,
|
|
108102
|
+
"x",
|
|
108103
|
+
"element.click coordinates require both x and y"
|
|
108104
|
+
);
|
|
108105
|
+
}
|
|
108106
|
+
}
|
|
108107
|
+
function validateElementScrollCommand(body, ctx) {
|
|
108108
|
+
if (!body.elementId) {
|
|
108109
|
+
requireComputerUseField(
|
|
108110
|
+
ctx,
|
|
108111
|
+
"elementId",
|
|
108112
|
+
"element.scroll requires elementId"
|
|
108113
|
+
);
|
|
108114
|
+
}
|
|
108115
|
+
if (!body.direction) {
|
|
108116
|
+
requireComputerUseField(
|
|
108117
|
+
ctx,
|
|
108118
|
+
"direction",
|
|
108119
|
+
"element.scroll requires direction"
|
|
108120
|
+
);
|
|
108121
|
+
}
|
|
108122
|
+
}
|
|
108123
|
+
function validateElementSetValueCommand(body, ctx) {
|
|
108124
|
+
if (!body.elementId) {
|
|
108125
|
+
requireComputerUseField(
|
|
108126
|
+
ctx,
|
|
108127
|
+
"elementId",
|
|
108128
|
+
"element.set_value requires elementId"
|
|
108129
|
+
);
|
|
108130
|
+
}
|
|
108131
|
+
if (!body.value) {
|
|
108132
|
+
requireComputerUseField(ctx, "value", "element.set_value requires value");
|
|
108133
|
+
}
|
|
108134
|
+
}
|
|
108135
|
+
function validateElementActionCommand(body, ctx) {
|
|
108136
|
+
if (!body.elementId) {
|
|
108137
|
+
requireComputerUseField(
|
|
108138
|
+
ctx,
|
|
108139
|
+
"elementId",
|
|
108140
|
+
"element.perform_action requires elementId"
|
|
108141
|
+
);
|
|
108142
|
+
}
|
|
108143
|
+
if (!body.action) {
|
|
108144
|
+
requireComputerUseField(
|
|
108145
|
+
ctx,
|
|
108146
|
+
"action",
|
|
108147
|
+
"element.perform_action requires action"
|
|
108148
|
+
);
|
|
108149
|
+
}
|
|
108150
|
+
}
|
|
108151
|
+
function validateComputerUseWriteCommand(body, ctx) {
|
|
108152
|
+
if (!body.app) {
|
|
108153
|
+
requireComputerUseField(ctx, "app", `${body.kind} requires app`);
|
|
108154
|
+
return;
|
|
108155
|
+
}
|
|
108156
|
+
switch (body.kind) {
|
|
108157
|
+
case "app.open":
|
|
108158
|
+
return;
|
|
108159
|
+
case "element.click":
|
|
108160
|
+
validateElementClickCommand(body, ctx);
|
|
108161
|
+
return;
|
|
108162
|
+
case "element.scroll":
|
|
108163
|
+
validateElementScrollCommand(body, ctx);
|
|
108164
|
+
return;
|
|
108165
|
+
case "element.set_value":
|
|
108166
|
+
validateElementSetValueCommand(body, ctx);
|
|
108167
|
+
return;
|
|
108168
|
+
case "element.perform_action":
|
|
108169
|
+
validateElementActionCommand(body, ctx);
|
|
108170
|
+
return;
|
|
108171
|
+
case "keyboard.type_text":
|
|
108172
|
+
if (!body.text) {
|
|
108173
|
+
requireComputerUseField(
|
|
108174
|
+
ctx,
|
|
108175
|
+
"text",
|
|
108176
|
+
"keyboard.type_text requires text"
|
|
108177
|
+
);
|
|
108178
|
+
}
|
|
108179
|
+
return;
|
|
108180
|
+
case "keyboard.press_key":
|
|
108181
|
+
if (!body.key) {
|
|
108182
|
+
requireComputerUseField(ctx, "key", "keyboard.press_key requires key");
|
|
108183
|
+
}
|
|
108184
|
+
}
|
|
108185
|
+
}
|
|
108186
|
+
var computerUseWriteCommandCreateBodySchema = computerUseWriteCommandCreateBaseSchema.superRefine(
|
|
108187
|
+
validateComputerUseWriteCommand
|
|
108188
|
+
);
|
|
108189
|
+
var computerUseCommandErrorSchema = external_exports.object({
|
|
108190
|
+
code: computerUseCommandErrorCodeSchema,
|
|
108191
|
+
message: external_exports.string()
|
|
108192
|
+
});
|
|
108193
|
+
var computerUseCommandResultSchema = external_exports.record(external_exports.string(), external_exports.unknown());
|
|
108194
|
+
var computerUseHostSchema = external_exports.object({
|
|
107988
108195
|
id: external_exports.string(),
|
|
107989
|
-
|
|
107990
|
-
|
|
107991
|
-
|
|
107992
|
-
|
|
108196
|
+
displayName: external_exports.string(),
|
|
108197
|
+
appVersion: external_exports.string(),
|
|
108198
|
+
osVersion: external_exports.string(),
|
|
108199
|
+
supportedCapabilities: external_exports.array(external_exports.string()),
|
|
108200
|
+
permissions: computerUsePermissionsSchema,
|
|
108201
|
+
status: computerUseHostStatusSchema,
|
|
108202
|
+
lastSeenAt: external_exports.string(),
|
|
108203
|
+
createdAt: external_exports.string()
|
|
107993
108204
|
});
|
|
107994
|
-
var
|
|
107995
|
-
|
|
107996
|
-
|
|
108205
|
+
var computerUseHostStartResponseSchema = external_exports.object({
|
|
108206
|
+
hostId: external_exports.string(),
|
|
108207
|
+
hostToken: external_exports.string()
|
|
107997
108208
|
});
|
|
107998
|
-
var
|
|
107999
|
-
|
|
108209
|
+
var computerUseHeartbeatResponseSchema = external_exports.object({
|
|
108210
|
+
ok: external_exports.literal(true),
|
|
108211
|
+
hostId: external_exports.string()
|
|
108212
|
+
});
|
|
108213
|
+
var computerUseHostListResponseSchema = external_exports.object({
|
|
108214
|
+
hosts: external_exports.array(computerUseHostSchema)
|
|
108215
|
+
});
|
|
108216
|
+
var computerUseHostDeleteResponseSchema = external_exports.object({
|
|
108217
|
+
ok: external_exports.literal(true)
|
|
108218
|
+
});
|
|
108219
|
+
var computerUseCommandCreateResponseSchema = external_exports.object({
|
|
108220
|
+
commandId: external_exports.string(),
|
|
108221
|
+
status: external_exports.enum(["queued", "pending_approval"])
|
|
108222
|
+
});
|
|
108223
|
+
var computerUseCommandResponseSchema = external_exports.object({
|
|
108224
|
+
id: external_exports.string(),
|
|
108225
|
+
kind: computerUseCommandKindSchema,
|
|
108226
|
+
status: computerUseCommandStatusSchema,
|
|
108227
|
+
hostId: external_exports.string().nullable(),
|
|
108228
|
+
hostName: external_exports.string().nullable(),
|
|
108229
|
+
payload: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
108230
|
+
result: computerUseCommandResultSchema.optional(),
|
|
108231
|
+
error: computerUseCommandErrorSchema.optional(),
|
|
108232
|
+
timeoutMs: external_exports.number().int().nullable(),
|
|
108233
|
+
createdAt: external_exports.string(),
|
|
108234
|
+
claimedAt: external_exports.string().nullable(),
|
|
108235
|
+
completedAt: external_exports.string().nullable()
|
|
108236
|
+
});
|
|
108237
|
+
var computerUseCommandApprovalBodySchema = external_exports.object({
|
|
108238
|
+
decision: external_exports.enum(["approve", "deny"]),
|
|
108239
|
+
message: external_exports.string().max(512).optional()
|
|
108240
|
+
});
|
|
108241
|
+
var computerUseCommandApprovalResponseSchema = external_exports.object({
|
|
108242
|
+
commandId: external_exports.string(),
|
|
108243
|
+
status: external_exports.enum(["queued", "failed"])
|
|
108244
|
+
});
|
|
108245
|
+
var computerUseHostCommandNextBodySchema = external_exports.object({
|
|
108246
|
+
supportedCapabilities: supportedCapabilitiesSchema.default([])
|
|
108247
|
+
});
|
|
108248
|
+
var computerUseHostCommandNextResponseSchema = external_exports.discriminatedUnion(
|
|
108249
|
+
"status",
|
|
108250
|
+
[
|
|
108251
|
+
external_exports.object({ status: external_exports.literal("idle") }),
|
|
108252
|
+
external_exports.object({
|
|
108253
|
+
status: external_exports.literal("command"),
|
|
108254
|
+
command: computerUseCommandResponseSchema
|
|
108255
|
+
})
|
|
108256
|
+
]
|
|
108257
|
+
);
|
|
108258
|
+
var computerUseHostCommandCompleteBodySchema = external_exports.discriminatedUnion(
|
|
108259
|
+
"status",
|
|
108260
|
+
[
|
|
108261
|
+
external_exports.object({
|
|
108262
|
+
status: external_exports.literal("succeeded"),
|
|
108263
|
+
result: computerUseCommandResultSchema
|
|
108264
|
+
}),
|
|
108265
|
+
external_exports.object({
|
|
108266
|
+
status: external_exports.literal("failed"),
|
|
108267
|
+
error: computerUseCommandErrorSchema
|
|
108268
|
+
})
|
|
108269
|
+
]
|
|
108270
|
+
);
|
|
108271
|
+
var computerUseCommandCompleteResponseSchema = external_exports.object({
|
|
108272
|
+
ok: external_exports.literal(true)
|
|
108273
|
+
});
|
|
108274
|
+
var computerUseAuditEventSchema = external_exports.object({
|
|
108275
|
+
id: external_exports.string(),
|
|
108276
|
+
commandId: external_exports.string(),
|
|
108277
|
+
runId: external_exports.string().nullable(),
|
|
108278
|
+
hostId: external_exports.string().nullable(),
|
|
108279
|
+
kind: computerUseWriteCommandKindSchema,
|
|
108280
|
+
app: external_exports.string().nullable(),
|
|
108281
|
+
event: external_exports.enum(["created", "approved", "denied", "completed"]),
|
|
108282
|
+
approvalOutcome: external_exports.enum(["approved", "denied"]).nullable(),
|
|
108283
|
+
redactedResult: external_exports.record(external_exports.string(), external_exports.unknown()).nullable(),
|
|
108284
|
+
error: external_exports.record(external_exports.string(), external_exports.unknown()).nullable(),
|
|
108285
|
+
createdAt: external_exports.string()
|
|
108286
|
+
});
|
|
108287
|
+
var computerUseAuditEventListResponseSchema = external_exports.object({
|
|
108288
|
+
auditEvents: external_exports.array(computerUseAuditEventSchema)
|
|
108289
|
+
});
|
|
108290
|
+
var zeroComputerUseHostsContract = c25.router({
|
|
108291
|
+
start: {
|
|
108000
108292
|
method: "POST",
|
|
108001
|
-
path: "/api/zero/computer-use/
|
|
108293
|
+
path: "/api/zero/computer-use/hosts/start",
|
|
108002
108294
|
headers: authHeadersSchema,
|
|
108003
|
-
body:
|
|
108295
|
+
body: computerUseRuntimeBodySchema,
|
|
108004
108296
|
responses: {
|
|
108005
|
-
200:
|
|
108297
|
+
200: computerUseHostStartResponseSchema,
|
|
108006
108298
|
401: apiErrorSchema,
|
|
108007
|
-
403: apiErrorSchema
|
|
108008
|
-
409: apiErrorSchema
|
|
108299
|
+
403: apiErrorSchema
|
|
108009
108300
|
},
|
|
108010
|
-
summary: "
|
|
108011
|
-
}
|
|
108012
|
-
|
|
108013
|
-
|
|
108014
|
-
|
|
108301
|
+
summary: "Start or reactivate a desktop computer-use host"
|
|
108302
|
+
},
|
|
108303
|
+
list: {
|
|
108304
|
+
method: "GET",
|
|
108305
|
+
path: "/api/zero/computer-use/hosts",
|
|
108306
|
+
headers: authHeadersSchema,
|
|
108307
|
+
responses: {
|
|
108308
|
+
200: computerUseHostListResponseSchema,
|
|
108309
|
+
401: apiErrorSchema,
|
|
108310
|
+
403: apiErrorSchema
|
|
108311
|
+
},
|
|
108312
|
+
summary: "List linked desktop computer-use hosts"
|
|
108313
|
+
},
|
|
108314
|
+
delete: {
|
|
108015
108315
|
method: "DELETE",
|
|
108016
|
-
path: "/api/zero/computer-use/
|
|
108316
|
+
path: "/api/zero/computer-use/hosts/:hostId",
|
|
108017
108317
|
headers: authHeadersSchema,
|
|
108018
|
-
|
|
108318
|
+
pathParams: hostIdPathParamsSchema,
|
|
108019
108319
|
responses: {
|
|
108020
|
-
|
|
108320
|
+
200: computerUseHostDeleteResponseSchema,
|
|
108021
108321
|
401: apiErrorSchema,
|
|
108022
108322
|
403: apiErrorSchema,
|
|
108023
108323
|
404: apiErrorSchema
|
|
108024
108324
|
},
|
|
108025
|
-
summary: "
|
|
108325
|
+
summary: "Delete a desktop computer-use host"
|
|
108326
|
+
}
|
|
108327
|
+
});
|
|
108328
|
+
var zeroComputerUseHeartbeatContract = c25.router({
|
|
108329
|
+
heartbeat: {
|
|
108330
|
+
method: "POST",
|
|
108331
|
+
path: "/api/zero/computer-use/heartbeat",
|
|
108332
|
+
headers: authHeadersSchema,
|
|
108333
|
+
body: computerUseRuntimeBodySchema,
|
|
108334
|
+
responses: {
|
|
108335
|
+
200: computerUseHeartbeatResponseSchema,
|
|
108336
|
+
401: apiErrorSchema
|
|
108337
|
+
},
|
|
108338
|
+
summary: "Refresh a desktop computer-use host heartbeat"
|
|
108026
108339
|
}
|
|
108027
108340
|
});
|
|
108028
|
-
var
|
|
108029
|
-
|
|
108341
|
+
var zeroComputerUseCommandContract = c25.router({
|
|
108342
|
+
create: {
|
|
108343
|
+
method: "POST",
|
|
108344
|
+
path: "/api/zero/computer-use/commands",
|
|
108345
|
+
headers: authHeadersSchema,
|
|
108346
|
+
body: computerUseCommandCreateBodySchema,
|
|
108347
|
+
responses: {
|
|
108348
|
+
200: computerUseCommandCreateResponseSchema,
|
|
108349
|
+
400: apiErrorSchema,
|
|
108350
|
+
401: apiErrorSchema,
|
|
108351
|
+
403: apiErrorSchema,
|
|
108352
|
+
404: apiErrorSchema,
|
|
108353
|
+
409: apiErrorSchema
|
|
108354
|
+
},
|
|
108355
|
+
summary: "Create a read-only desktop computer-use command"
|
|
108356
|
+
},
|
|
108357
|
+
get: {
|
|
108030
108358
|
method: "GET",
|
|
108031
|
-
path: "/api/zero/computer-use/
|
|
108359
|
+
path: "/api/zero/computer-use/commands/:commandId",
|
|
108032
108360
|
headers: authHeadersSchema,
|
|
108361
|
+
pathParams: commandIdPathParamsSchema,
|
|
108033
108362
|
responses: {
|
|
108034
|
-
200:
|
|
108363
|
+
200: computerUseCommandResponseSchema,
|
|
108035
108364
|
401: apiErrorSchema,
|
|
108036
108365
|
403: apiErrorSchema,
|
|
108037
108366
|
404: apiErrorSchema
|
|
108038
108367
|
},
|
|
108039
|
-
summary: "Get computer-use
|
|
108368
|
+
summary: "Get a desktop computer-use command result"
|
|
108369
|
+
}
|
|
108370
|
+
});
|
|
108371
|
+
var zeroComputerUseWriteCommandContract = c25.router({
|
|
108372
|
+
create: {
|
|
108373
|
+
method: "POST",
|
|
108374
|
+
path: "/api/zero/computer-use/write-commands",
|
|
108375
|
+
headers: authHeadersSchema,
|
|
108376
|
+
body: computerUseWriteCommandCreateBodySchema,
|
|
108377
|
+
responses: {
|
|
108378
|
+
200: computerUseCommandCreateResponseSchema,
|
|
108379
|
+
400: apiErrorSchema,
|
|
108380
|
+
401: apiErrorSchema,
|
|
108381
|
+
403: apiErrorSchema,
|
|
108382
|
+
404: apiErrorSchema,
|
|
108383
|
+
409: apiErrorSchema
|
|
108384
|
+
},
|
|
108385
|
+
summary: "Create an approved-write desktop computer-use command"
|
|
108386
|
+
}
|
|
108387
|
+
});
|
|
108388
|
+
var zeroComputerUseCommandApprovalContract = c25.router({
|
|
108389
|
+
decide: {
|
|
108390
|
+
method: "POST",
|
|
108391
|
+
path: "/api/zero/computer-use/commands/:commandId/approval",
|
|
108392
|
+
headers: authHeadersSchema,
|
|
108393
|
+
pathParams: commandIdPathParamsSchema,
|
|
108394
|
+
body: computerUseCommandApprovalBodySchema,
|
|
108395
|
+
responses: {
|
|
108396
|
+
200: computerUseCommandApprovalResponseSchema,
|
|
108397
|
+
401: apiErrorSchema,
|
|
108398
|
+
403: apiErrorSchema,
|
|
108399
|
+
404: apiErrorSchema,
|
|
108400
|
+
409: apiErrorSchema
|
|
108401
|
+
},
|
|
108402
|
+
summary: "Approve or deny a pending desktop computer-use write command"
|
|
108403
|
+
}
|
|
108404
|
+
});
|
|
108405
|
+
var zeroComputerUseHostCommandsContract = c25.router({
|
|
108406
|
+
next: {
|
|
108407
|
+
method: "POST",
|
|
108408
|
+
path: "/api/zero/computer-use/host/commands/next",
|
|
108409
|
+
headers: authHeadersSchema,
|
|
108410
|
+
body: computerUseHostCommandNextBodySchema,
|
|
108411
|
+
responses: {
|
|
108412
|
+
200: computerUseHostCommandNextResponseSchema,
|
|
108413
|
+
401: apiErrorSchema
|
|
108414
|
+
},
|
|
108415
|
+
summary: "Claim the next approved desktop computer-use command"
|
|
108416
|
+
},
|
|
108417
|
+
complete: {
|
|
108418
|
+
method: "POST",
|
|
108419
|
+
path: "/api/zero/computer-use/host/commands/:commandId/complete",
|
|
108420
|
+
headers: authHeadersSchema,
|
|
108421
|
+
pathParams: commandIdPathParamsSchema,
|
|
108422
|
+
body: computerUseHostCommandCompleteBodySchema,
|
|
108423
|
+
responses: {
|
|
108424
|
+
200: computerUseCommandCompleteResponseSchema,
|
|
108425
|
+
400: apiErrorSchema,
|
|
108426
|
+
401: apiErrorSchema,
|
|
108427
|
+
404: apiErrorSchema,
|
|
108428
|
+
409: apiErrorSchema
|
|
108429
|
+
},
|
|
108430
|
+
summary: "Complete a desktop computer-use command"
|
|
108431
|
+
}
|
|
108432
|
+
});
|
|
108433
|
+
var zeroComputerUseAuditEventsContract = c25.router({
|
|
108434
|
+
list: {
|
|
108435
|
+
method: "GET",
|
|
108436
|
+
path: "/api/zero/computer-use/audit-events",
|
|
108437
|
+
headers: authHeadersSchema,
|
|
108438
|
+
query: external_exports.object({
|
|
108439
|
+
limit: external_exports.coerce.number().int().positive().max(200).default(50),
|
|
108440
|
+
commandId: external_exports.string().optional(),
|
|
108441
|
+
hostId: external_exports.string().optional(),
|
|
108442
|
+
runId: external_exports.string().optional()
|
|
108443
|
+
}),
|
|
108444
|
+
responses: {
|
|
108445
|
+
200: computerUseAuditEventListResponseSchema,
|
|
108446
|
+
401: apiErrorSchema,
|
|
108447
|
+
403: apiErrorSchema
|
|
108448
|
+
},
|
|
108449
|
+
summary: "List desktop computer-use write command audit events"
|
|
108040
108450
|
}
|
|
108041
108451
|
});
|
|
108042
108452
|
|
|
108043
108453
|
// src/lib/api/domains/zero-computer-use.ts
|
|
108044
|
-
|
|
108045
|
-
|
|
108046
|
-
|
|
108047
|
-
|
|
108454
|
+
function normalizeConfiguredUrl(value) {
|
|
108455
|
+
return value.startsWith("http") ? value : `https://${value}`;
|
|
108456
|
+
}
|
|
108457
|
+
function resolveComputerUseApiBaseUrl(baseUrl) {
|
|
108458
|
+
const override = process.env.VM0_API_BACKEND_URL;
|
|
108459
|
+
if (override) {
|
|
108460
|
+
return normalizeConfiguredUrl(override).replace(/\/$/, "");
|
|
108461
|
+
}
|
|
108462
|
+
const url2 = new URL(baseUrl);
|
|
108463
|
+
if (url2.hostname === "www.vm0.ai" || url2.hostname === "app.vm0.ai") {
|
|
108464
|
+
url2.hostname = "api.vm0.ai";
|
|
108465
|
+
}
|
|
108466
|
+
return url2.toString().replace(/\/$/, "");
|
|
108467
|
+
}
|
|
108468
|
+
function buildHeaders2(token) {
|
|
108469
|
+
const headers = {};
|
|
108470
|
+
if (token) {
|
|
108471
|
+
headers.Authorization = `Bearer ${token}`;
|
|
108472
|
+
}
|
|
108473
|
+
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
108474
|
+
if (bypassSecret) {
|
|
108475
|
+
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
108476
|
+
}
|
|
108477
|
+
return headers;
|
|
108478
|
+
}
|
|
108479
|
+
async function getComputerUseClientConfig() {
|
|
108480
|
+
const baseUrl = resolveComputerUseApiBaseUrl(await getBaseUrl());
|
|
108481
|
+
const token = await getActiveToken();
|
|
108482
|
+
if (!token) {
|
|
108483
|
+
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
108484
|
+
}
|
|
108485
|
+
return {
|
|
108486
|
+
baseUrl,
|
|
108487
|
+
baseHeaders: buildHeaders2(token),
|
|
108488
|
+
jsonQuery: false
|
|
108489
|
+
};
|
|
108490
|
+
}
|
|
108491
|
+
function commandBody(params) {
|
|
108492
|
+
return {
|
|
108493
|
+
kind: params.kind,
|
|
108494
|
+
timeoutMs: params.timeoutMs ?? 15e3,
|
|
108495
|
+
...params.hostId ? { hostId: params.hostId } : {},
|
|
108496
|
+
...params.hostName ? { hostName: params.hostName } : {},
|
|
108497
|
+
...params.app ? { app: params.app } : {},
|
|
108498
|
+
...params.snapshotId ? { snapshotId: params.snapshotId } : {},
|
|
108499
|
+
...params.elementId ? { elementId: params.elementId } : {},
|
|
108500
|
+
...params.x !== void 0 ? { x: params.x } : {},
|
|
108501
|
+
...params.y !== void 0 ? { y: params.y } : {},
|
|
108502
|
+
...params.button ? { button: params.button } : {},
|
|
108503
|
+
...params.clickCount !== void 0 ? { clickCount: params.clickCount } : {},
|
|
108504
|
+
...params.direction ? { direction: params.direction } : {},
|
|
108505
|
+
...params.pages !== void 0 ? { pages: params.pages } : {},
|
|
108506
|
+
...params.value !== void 0 ? { value: params.value } : {},
|
|
108507
|
+
...params.text !== void 0 ? { text: params.text } : {},
|
|
108508
|
+
...params.key ? { key: params.key } : {},
|
|
108509
|
+
...params.action ? { action: params.action } : {}
|
|
108510
|
+
};
|
|
108511
|
+
}
|
|
108512
|
+
async function createComputerUseReadCommand(params) {
|
|
108513
|
+
const config4 = await getComputerUseClientConfig();
|
|
108514
|
+
const client = initClient(zeroComputerUseCommandContract, config4);
|
|
108515
|
+
const result = await client.create({ body: commandBody(params) });
|
|
108048
108516
|
if (result.status === 200) {
|
|
108049
108517
|
return result.body;
|
|
108050
108518
|
}
|
|
108051
|
-
handleError(result, "Failed to
|
|
108519
|
+
handleError(result, "Failed to create computer-use command");
|
|
108052
108520
|
}
|
|
108053
|
-
async function
|
|
108054
|
-
const config4 = await
|
|
108055
|
-
const client = initClient(
|
|
108056
|
-
const result = await client.
|
|
108057
|
-
if (result.status ===
|
|
108058
|
-
return;
|
|
108521
|
+
async function createComputerUseWriteCommand(params) {
|
|
108522
|
+
const config4 = await getComputerUseClientConfig();
|
|
108523
|
+
const client = initClient(zeroComputerUseWriteCommandContract, config4);
|
|
108524
|
+
const result = await client.create({ body: commandBody(params) });
|
|
108525
|
+
if (result.status === 200) {
|
|
108526
|
+
return result.body;
|
|
108059
108527
|
}
|
|
108060
|
-
handleError(result, "Failed to
|
|
108528
|
+
handleError(result, "Failed to create computer-use write command");
|
|
108061
108529
|
}
|
|
108062
|
-
async function
|
|
108063
|
-
const config4 = await
|
|
108064
|
-
const client = initClient(
|
|
108065
|
-
const result = await client.
|
|
108530
|
+
async function getComputerUseCommand(commandId) {
|
|
108531
|
+
const config4 = await getComputerUseClientConfig();
|
|
108532
|
+
const client = initClient(zeroComputerUseCommandContract, config4);
|
|
108533
|
+
const result = await client.get({ params: { commandId } });
|
|
108066
108534
|
if (result.status === 200) {
|
|
108067
108535
|
return result.body;
|
|
108068
108536
|
}
|
|
108069
|
-
|
|
108070
|
-
|
|
108537
|
+
handleError(result, "Failed to get computer-use command");
|
|
108538
|
+
}
|
|
108539
|
+
async function listComputerUseHosts() {
|
|
108540
|
+
const config4 = await getComputerUseClientConfig();
|
|
108541
|
+
const client = initClient(zeroComputerUseHostsContract, config4);
|
|
108542
|
+
const result = await client.list({ headers: {} });
|
|
108543
|
+
if (result.status === 200) {
|
|
108544
|
+
return result.body;
|
|
108545
|
+
}
|
|
108546
|
+
handleError(result, "Failed to list computer-use hosts");
|
|
108547
|
+
}
|
|
108548
|
+
async function deleteComputerUseHost(hostId) {
|
|
108549
|
+
const config4 = await getComputerUseClientConfig();
|
|
108550
|
+
const client = initClient(zeroComputerUseHostsContract, config4);
|
|
108551
|
+
const result = await client.delete({ params: { hostId } });
|
|
108552
|
+
if (result.status === 200) {
|
|
108553
|
+
return result.body;
|
|
108071
108554
|
}
|
|
108072
|
-
handleError(result, "Failed to
|
|
108555
|
+
handleError(result, "Failed to revoke computer-use host");
|
|
108556
|
+
}
|
|
108557
|
+
async function listComputerUseAuditEvents(params) {
|
|
108558
|
+
const config4 = await getComputerUseClientConfig();
|
|
108559
|
+
const client = initClient(zeroComputerUseAuditEventsContract, config4);
|
|
108560
|
+
const result = await client.list({
|
|
108561
|
+
query: {
|
|
108562
|
+
limit: params.limit ?? 50,
|
|
108563
|
+
...params.commandId ? { commandId: params.commandId } : {},
|
|
108564
|
+
...params.hostId ? { hostId: params.hostId } : {},
|
|
108565
|
+
...params.runId ? { runId: params.runId } : {}
|
|
108566
|
+
}
|
|
108567
|
+
});
|
|
108568
|
+
if (result.status === 200) {
|
|
108569
|
+
return result.body;
|
|
108570
|
+
}
|
|
108571
|
+
handleError(result, "Failed to list computer-use audit events");
|
|
108073
108572
|
}
|
|
108074
108573
|
|
|
108075
108574
|
// src/lib/api/domains/zero-local-agent.ts
|
|
@@ -108141,7 +108640,7 @@ var localAgentJobStatusSchema = external_exports.enum([
|
|
|
108141
108640
|
"failed"
|
|
108142
108641
|
]);
|
|
108143
108642
|
var localAgentHostStatusSchema = external_exports.enum(["online", "closed"]);
|
|
108144
|
-
var
|
|
108643
|
+
var hostNameSchema2 = external_exports.string().trim().min(1).max(128);
|
|
108145
108644
|
var supportedBackendsSchema = external_exports.array(localAgentBackendSchema).min(1).max(2);
|
|
108146
108645
|
var promptSchema = external_exports.string().trim().min(1).max(6e4);
|
|
108147
108646
|
var localAgentRealtimeSubscriptionSchema = external_exports.object({
|
|
@@ -108243,7 +108742,7 @@ var zeroLocalAgentDeviceStartContract = c27.router({
|
|
|
108243
108742
|
method: "POST",
|
|
108244
108743
|
path: "/api/zero/local-agent/device/start",
|
|
108245
108744
|
body: external_exports.object({
|
|
108246
|
-
hostName:
|
|
108745
|
+
hostName: hostNameSchema2,
|
|
108247
108746
|
supportedBackends: supportedBackendsSchema
|
|
108248
108747
|
}),
|
|
108249
108748
|
responses: {
|
|
@@ -108293,7 +108792,7 @@ var zeroLocalAgentHeartbeatContract = c27.router({
|
|
|
108293
108792
|
path: "/api/zero/local-agent/heartbeat",
|
|
108294
108793
|
headers: authHeadersSchema,
|
|
108295
108794
|
body: external_exports.object({
|
|
108296
|
-
hostName:
|
|
108795
|
+
hostName: hostNameSchema2,
|
|
108297
108796
|
supportedBackends: supportedBackendsSchema,
|
|
108298
108797
|
realtimeConnected: external_exports.boolean().optional()
|
|
108299
108798
|
}),
|
|
@@ -108376,7 +108875,7 @@ var zeroLocalAgentHostsContract = c27.router({
|
|
|
108376
108875
|
path: "/api/zero/local-agent/hosts/start",
|
|
108377
108876
|
headers: authHeadersSchema,
|
|
108378
108877
|
body: external_exports.object({
|
|
108379
|
-
hostName:
|
|
108878
|
+
hostName: hostNameSchema2,
|
|
108380
108879
|
supportedBackends: supportedBackendsSchema,
|
|
108381
108880
|
hostId: external_exports.string().min(1).optional()
|
|
108382
108881
|
}),
|
|
@@ -108468,13 +108967,13 @@ var zeroLocalAgentHostJobsContract = c27.router({
|
|
|
108468
108967
|
});
|
|
108469
108968
|
|
|
108470
108969
|
// src/lib/api/domains/zero-local-agent.ts
|
|
108471
|
-
function
|
|
108970
|
+
function normalizeConfiguredUrl2(value) {
|
|
108472
108971
|
return value.startsWith("http") ? value : `https://${value}`;
|
|
108473
108972
|
}
|
|
108474
108973
|
function resolveLocalAgentApiBaseUrl(baseUrl) {
|
|
108475
108974
|
const override = process.env.VM0_API_BACKEND_URL;
|
|
108476
108975
|
if (override) {
|
|
108477
|
-
return
|
|
108976
|
+
return normalizeConfiguredUrl2(override).replace(/\/$/, "");
|
|
108478
108977
|
}
|
|
108479
108978
|
const url2 = new URL(baseUrl);
|
|
108480
108979
|
if (url2.hostname === "www.vm0.ai" || url2.hostname === "app.vm0.ai") {
|
|
@@ -108482,7 +108981,7 @@ function resolveLocalAgentApiBaseUrl(baseUrl) {
|
|
|
108482
108981
|
}
|
|
108483
108982
|
return url2.toString().replace(/\/$/, "");
|
|
108484
108983
|
}
|
|
108485
|
-
function
|
|
108984
|
+
function buildHeaders3(token) {
|
|
108486
108985
|
const headers = {};
|
|
108487
108986
|
if (token) {
|
|
108488
108987
|
headers.Authorization = `Bearer ${token}`;
|
|
@@ -108506,7 +109005,7 @@ async function getLocalAgentClientConfig() {
|
|
|
108506
109005
|
};
|
|
108507
109006
|
}
|
|
108508
109007
|
function buildBearerHeaders(token) {
|
|
108509
|
-
return
|
|
109008
|
+
return buildHeaders3(token);
|
|
108510
109009
|
}
|
|
108511
109010
|
async function sendLocalAgentHeartbeat(params) {
|
|
108512
109011
|
const baseUrl = resolveLocalAgentApiBaseUrl(await getBaseUrl());
|
|
@@ -108694,7 +109193,7 @@ var localBrowserCommandErrorCodeSchema = external_exports.enum([
|
|
|
108694
109193
|
"timeout",
|
|
108695
109194
|
"unsupported_command"
|
|
108696
109195
|
]);
|
|
108697
|
-
var
|
|
109196
|
+
var hostNameSchema3 = external_exports.string().trim().min(1).max(128);
|
|
108698
109197
|
var browserSchema = external_exports.string().trim().min(1).max(64);
|
|
108699
109198
|
var extensionVersionSchema = external_exports.string().trim().min(1).max(64);
|
|
108700
109199
|
var tabIdSchema = external_exports.string().trim().min(1).max(128);
|
|
@@ -108703,12 +109202,12 @@ var targetUrlSchema = external_exports.string().trim().url().max(2048).refine((v
|
|
|
108703
109202
|
return protocol === "http:" || protocol === "https:";
|
|
108704
109203
|
}, "URL must use http or https");
|
|
108705
109204
|
var cssSelectorSchema = external_exports.string().trim().min(1).max(1024);
|
|
108706
|
-
var
|
|
109205
|
+
var supportedCapabilitiesSchema2 = external_exports.array(external_exports.string().trim().min(1).max(128)).max(50);
|
|
108707
109206
|
var localBrowserRuntimeBodySchema = external_exports.object({
|
|
108708
|
-
hostName:
|
|
109207
|
+
hostName: hostNameSchema3,
|
|
108709
109208
|
browser: browserSchema,
|
|
108710
109209
|
extensionVersion: extensionVersionSchema,
|
|
108711
|
-
supportedCapabilities:
|
|
109210
|
+
supportedCapabilities: supportedCapabilitiesSchema2.default([])
|
|
108712
109211
|
});
|
|
108713
109212
|
var localBrowserRealtimeSubscriptionSchema = external_exports.object({
|
|
108714
109213
|
channelName: external_exports.string(),
|
|
@@ -108783,7 +109282,7 @@ var localBrowserHostDeleteResponseSchema = external_exports.object({
|
|
|
108783
109282
|
var localBrowserCommandTargetShape = {
|
|
108784
109283
|
tabId: tabIdSchema.optional(),
|
|
108785
109284
|
hostId: external_exports.string().min(1).optional(),
|
|
108786
|
-
hostName:
|
|
109285
|
+
hostName: hostNameSchema3.optional(),
|
|
108787
109286
|
timeoutMs: external_exports.number().int().min(1e3).max(6e4).default(15e3)
|
|
108788
109287
|
};
|
|
108789
109288
|
var localBrowserCommandCreateBodySchema = external_exports.object({
|
|
@@ -109182,7 +109681,7 @@ var zeroLocalBrowserHostCommandsContract = c28.router({
|
|
|
109182
109681
|
path: "/api/zero/local-browser/host/commands/next",
|
|
109183
109682
|
headers: authHeadersSchema,
|
|
109184
109683
|
body: external_exports.object({
|
|
109185
|
-
supportedCapabilities:
|
|
109684
|
+
supportedCapabilities: supportedCapabilitiesSchema2.default([])
|
|
109186
109685
|
}),
|
|
109187
109686
|
responses: {
|
|
109188
109687
|
200: localBrowserHostCommandNextResponseSchema,
|
|
@@ -109211,13 +109710,13 @@ var zeroLocalBrowserHostCommandsContract = c28.router({
|
|
|
109211
109710
|
});
|
|
109212
109711
|
|
|
109213
109712
|
// src/lib/api/domains/zero-local-browser.ts
|
|
109214
|
-
function
|
|
109713
|
+
function normalizeConfiguredUrl3(value) {
|
|
109215
109714
|
return value.startsWith("http") ? value : `https://${value}`;
|
|
109216
109715
|
}
|
|
109217
109716
|
function resolveLocalBrowserApiBaseUrl(baseUrl) {
|
|
109218
109717
|
const override = process.env.VM0_API_BACKEND_URL;
|
|
109219
109718
|
if (override) {
|
|
109220
|
-
return
|
|
109719
|
+
return normalizeConfiguredUrl3(override).replace(/\/$/, "");
|
|
109221
109720
|
}
|
|
109222
109721
|
const url2 = new URL(baseUrl);
|
|
109223
109722
|
if (url2.hostname === "www.vm0.ai" || url2.hostname === "app.vm0.ai") {
|
|
@@ -109225,7 +109724,7 @@ function resolveLocalBrowserApiBaseUrl(baseUrl) {
|
|
|
109225
109724
|
}
|
|
109226
109725
|
return url2.toString().replace(/\/$/, "");
|
|
109227
109726
|
}
|
|
109228
|
-
function
|
|
109727
|
+
function buildHeaders4(token) {
|
|
109229
109728
|
const headers = {};
|
|
109230
109729
|
if (token) {
|
|
109231
109730
|
headers.Authorization = `Bearer ${token}`;
|
|
@@ -109244,7 +109743,7 @@ async function getLocalBrowserClientConfig() {
|
|
|
109244
109743
|
}
|
|
109245
109744
|
return {
|
|
109246
109745
|
baseUrl,
|
|
109247
|
-
baseHeaders:
|
|
109746
|
+
baseHeaders: buildHeaders4(token),
|
|
109248
109747
|
jsonQuery: false
|
|
109249
109748
|
};
|
|
109250
109749
|
}
|
|
@@ -131541,9 +132040,12 @@ export {
|
|
|
131541
132040
|
searchLogs,
|
|
131542
132041
|
requestDeveloperSupportConsent,
|
|
131543
132042
|
submitDeveloperSupport,
|
|
131544
|
-
|
|
131545
|
-
|
|
131546
|
-
|
|
132043
|
+
createComputerUseReadCommand,
|
|
132044
|
+
createComputerUseWriteCommand,
|
|
132045
|
+
getComputerUseCommand,
|
|
132046
|
+
listComputerUseHosts,
|
|
132047
|
+
deleteComputerUseHost,
|
|
132048
|
+
listComputerUseAuditEvents,
|
|
131547
132049
|
createLocalBrowserReadCommand,
|
|
131548
132050
|
createLocalBrowserWriteCommand,
|
|
131549
132051
|
getLocalBrowserReadCommand,
|
|
@@ -131607,4 +132109,4 @@ undici/lib/web/fetch/body.js:
|
|
|
131607
132109
|
undici/lib/web/websocket/frame.js:
|
|
131608
132110
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
131609
132111
|
*/
|
|
131610
|
-
//# sourceMappingURL=chunk-
|
|
132112
|
+
//# sourceMappingURL=chunk-AUKY6FBC.js.map
|